Implemented Features and Items granting effects, actions, attacks and spells
This commit is contained in:
32
rpg-docs/client/views/character/features/features.html
Normal file
32
rpg-docs/client/views/character/features/features.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<template name="features">
|
||||
<div class="statsFlex"><!--resources-->
|
||||
{{#if attributeBase "rages"}}
|
||||
{{#statCard id="rages" type="attribute" title="Rages"}}
|
||||
{{attributeValue "rages"}}
|
||||
{{/statCard}}
|
||||
{{/if}}
|
||||
{{#if canCast}}
|
||||
{{#statCard id="spellSlots" type="attribute" title="Spell Slots"}}
|
||||
<h1>{{> spellSlots}}</h1>
|
||||
{{/statCard}}
|
||||
{{/if}}
|
||||
{{#if attributeBase "sorceryPoints"}}
|
||||
{{#statCard id="sorceryPoints" type="attribute" title="Sorcery Points"}}
|
||||
{{attributeValue "sorceryPoints"}}
|
||||
{{/statCard}}
|
||||
{{/if}}
|
||||
{{#if attributeBase "expertiseDice"}}
|
||||
{{#statCard id="expertiseDice" type="attribute" title="Expertise Dice"}}
|
||||
{{attributeValue "expertiseDice"}}
|
||||
{{/statCard}}
|
||||
{{/if}}
|
||||
{{#if attributeBase "superiorityDice"}}
|
||||
{{#statCard id="superiorityDice" type="attribute" title="Superiority Dice"}}
|
||||
{{attributeValue "superiorityDice"}}
|
||||
{{/statCard}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="actionsFlex">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
19
rpg-docs/client/views/character/features/features.js
Normal file
19
rpg-docs/client/views/character/features/features.js
Normal file
@@ -0,0 +1,19 @@
|
||||
Template.features.helpers({
|
||||
features: function(){
|
||||
var features = Features.find({character: this._id});
|
||||
return features;
|
||||
}
|
||||
});
|
||||
|
||||
Template.features.events({
|
||||
// Fires when any element is clicked
|
||||
'change .enabled': function (event) {
|
||||
var enable = event.target.checked
|
||||
Features.update(this._id, {$set: {enabled: enable}});
|
||||
if(enable){
|
||||
Template.parentData(1).pushEffects(this.name, this.effects);
|
||||
} else {
|
||||
Template.parentData(1).pullEffects(this.effects);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user