rename /rpg-docs to /app

This commit is contained in:
Andrew Zhu
2018-06-07 01:07:49 -07:00
parent de93636c7c
commit c099e3173b
420 changed files with 12 additions and 25 deletions

View File

@@ -0,0 +1,17 @@
<template name="attackView">
<div class="attackView layout horizontal">
<div class="paper-font-headline layout horizontal center" style="margin-right: 16px;">
{{evaluateAttackBonus charId attack}}
</div>
<div class="layout vertical">
<div>
{{evaluateDamage charId attack}}&nbsp;{{attack.damageType}}
</div>
{{#if attack.details}}
<div class="paper-font-caption">
{{attack.details}}
</div>
{{/if}}
</div>
</div>
</template>

View File

@@ -0,0 +1,28 @@
Template.attackView.helpers ({
evaluateAttackBonus: function(charId, attack) {
if (attack.parent.collection == "Spells") {
var spell = Spells.findOne(attack.parent.id);
if (spell) {
bonus = evaluate(charId, attack.attackBonus, {"spellListId": spell.parent.id});
}
} else {
var bonus = evaluate(charId, attack.attackBonus);
}
if (_.isFinite(bonus)) {
return bonus > 0 ? "+" + bonus : "" + bonus;
} else {
return bonus;
}
},
evaluateDamage: function(charId, attack) {
if (attack.parent.collection == "Spells") {
var spell = Spells.findOne(attack.parent.id);
if (spell) {
return evaluateSpellString(charId, spell.parent.id, attack.damage);
}
} else {
return evaluateString(charId, attack.damage);
}
},
})