Added UI for weakness/resistance
This commit is contained in:
@@ -175,7 +175,7 @@ Template.effectEdit.events({
|
||||
if(!detail.isSelected) return;
|
||||
var value = +detail.item.getAttribute("name");
|
||||
if (value == this.value) return;
|
||||
Effects.update(this._id, {$set: {value: value, calculation: ""}});
|
||||
Effects.update(this._id, {$set: {value: value, calculation: "", operation: "mul"}});
|
||||
},
|
||||
"core-select #proficiencyDropDown": function(event){
|
||||
var detail = event.originalEvent.detail;
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
editable pin
|
||||
role="slider"
|
||||
></paper-slider>
|
||||
<!--Temp hitpoints go here-->
|
||||
<div class="caption">
|
||||
{{#if multipliers.immunities.length}} <div>Immune: {{#each multipliers.immunities}} {{name}} {{/each}}</div>{{/if}}
|
||||
{{#if multipliers.resistances.length}}<div>Resistance: {{#each multipliers.resistances}} {{name}} {{/each}}</div>{{/if}}
|
||||
{{#if multipliers.weaknesses.length}} <div>Weakness: {{#each multipliers.weaknesses}} {{name}} {{/each}}</div>{{/if}}
|
||||
</div>
|
||||
{{#if showDeathSave}}
|
||||
{{#with deathSaveObject}}
|
||||
<div class="padded" layout vertical center>
|
||||
|
||||
@@ -20,8 +20,32 @@ Template.healthCard.helpers({
|
||||
passDisabled: function(num){
|
||||
return !(num === this.pass || num - 1 === this.pass)
|
||||
},
|
||||
dead: function(char){
|
||||
dead: function(){
|
||||
return this.fail >= 3;
|
||||
},
|
||||
multipliers: function(){
|
||||
var char = Characters.findOne(this._id, {fields: {_id: 1} });
|
||||
var multipliers = [
|
||||
{name: "Acid", value: char.attributeValue("acidMultiplier", 1)},
|
||||
{name: "Bludgeoning", value: char.attributeValue("bludgeoningMultiplier", 1)},
|
||||
{name: "Cold", value: char.attributeValue("coldMultiplier", 1)},
|
||||
{name: "Fire", value: char.attributeValue("fireMultiplier", 1)},
|
||||
{name: "Force", value: char.attributeValue("forceMultiplier", 1)},
|
||||
{name: "Lightning", value: char.attributeValue("lightningMultiplier", 1)},
|
||||
{name: "Necrotic", value: char.attributeValue("necroticMultiplier", 1)},
|
||||
{name: "Piercing", value: char.attributeValue("piercingMultiplier", 1)},
|
||||
{name: "Poison", value: char.attributeValue("poisonMultiplier", 1)},
|
||||
{name: "Psychic", value: char.attributeValue("psychicMultiplier", 1)},
|
||||
{name: "Radiant", value: char.attributeValue("radiantMultiplier", 1)},
|
||||
{name: "Slashing", value: char.attributeValue("slashingMultiplier", 1)},
|
||||
{name: "Thunder", value: char.attributeValue("thunderMultiplier", 1)}
|
||||
];
|
||||
multipliers = _.groupBy(multipliers, "value");
|
||||
return {
|
||||
"immunities": multipliers["0"] || [],
|
||||
"resistances": multipliers["0.5"] || [],
|
||||
"weaknesses": multipliers["2"] || []
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user