Implemented skill and attribute summary dialogs
This commit is contained in:
@@ -18,7 +18,7 @@ dburles:collection-helpers@1.0.3
|
|||||||
dburles:mongo-collection-instances@0.3.3
|
dburles:mongo-collection-instances@0.3.3
|
||||||
ddp@1.1.0
|
ddp@1.1.0
|
||||||
deps@1.0.7
|
deps@1.0.7
|
||||||
differential:vulcanize@0.0.4
|
differential:vulcanize@0.0.5
|
||||||
ejson@1.0.6
|
ejson@1.0.6
|
||||||
email@1.0.6
|
email@1.0.6
|
||||||
fastclick@1.0.3
|
fastclick@1.0.3
|
||||||
@@ -46,15 +46,16 @@ logging@1.0.7
|
|||||||
matb33:collection-hooks@0.7.11
|
matb33:collection-hooks@0.7.11
|
||||||
meteor@1.1.6
|
meteor@1.1.6
|
||||||
meteor-platform@1.2.2
|
meteor-platform@1.2.2
|
||||||
mike:mocha@0.5.2
|
mike:mocha@0.5.3
|
||||||
minifiers@1.1.5
|
minifiers@1.1.5
|
||||||
minimongo@1.0.8
|
minimongo@1.0.8
|
||||||
mobile-status-bar@1.0.3
|
mobile-status-bar@1.0.3
|
||||||
momentjs:moment@2.10.0
|
momentjs:moment@2.10.3
|
||||||
mongo@1.1.0
|
mongo@1.1.0
|
||||||
npm-bcrypt@0.7.8_2
|
npm-bcrypt@0.7.8_2
|
||||||
observe-sequence@1.0.6
|
observe-sequence@1.0.6
|
||||||
ordered-dict@1.0.3
|
ordered-dict@1.0.3
|
||||||
|
package-version-parser@3.0.3
|
||||||
percolate:migrations@0.7.3
|
percolate:migrations@0.7.3
|
||||||
practicalmeteor:chai@1.9.2_3
|
practicalmeteor:chai@1.9.2_3
|
||||||
practicalmeteor:loglevel@1.1.0_3
|
practicalmeteor:loglevel@1.1.0_3
|
||||||
@@ -64,6 +65,9 @@ reactive-var@1.0.5
|
|||||||
reload@1.1.3
|
reload@1.1.3
|
||||||
retry@1.0.3
|
retry@1.0.3
|
||||||
routepolicy@1.0.5
|
routepolicy@1.0.5
|
||||||
|
sanjo:long-running-child-process@1.0.3
|
||||||
|
sanjo:meteor-files-helpers@1.1.0_4
|
||||||
|
sanjo:meteor-version@1.0.0
|
||||||
service-configuration@1.0.4
|
service-configuration@1.0.4
|
||||||
session@1.1.0
|
session@1.1.0
|
||||||
sha@1.0.3
|
sha@1.0.3
|
||||||
@@ -75,11 +79,11 @@ tracker@1.0.7
|
|||||||
ui@1.0.6
|
ui@1.0.6
|
||||||
underscore@1.0.3
|
underscore@1.0.3
|
||||||
url@1.0.4
|
url@1.0.4
|
||||||
velocity:core@0.4.5
|
velocity:chokidar@0.12.6_1
|
||||||
velocity:html-reporter@0.3.2
|
velocity:core@0.6.0
|
||||||
velocity:node-soft-mirror@0.3.1
|
velocity:html-reporter@0.5.3
|
||||||
|
velocity:meteor-internals@1.1.0_7
|
||||||
velocity:shim@0.1.0
|
velocity:shim@0.1.0
|
||||||
velocity:test-proxy@0.0.4
|
|
||||||
webapp@1.2.0
|
webapp@1.2.0
|
||||||
webapp-hashing@1.0.3
|
webapp-hashing@1.0.3
|
||||||
zimme:collection-behaviours@1.0.4
|
zimme:collection-behaviours@1.0.4
|
||||||
|
|||||||
@@ -33,6 +33,16 @@ table {
|
|||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.summaryTable td{
|
||||||
|
text-align: right;
|
||||||
|
padding: 4px;
|
||||||
|
min-width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summaryTable td:first-child {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
background-color: #444;
|
background-color: #444;
|
||||||
opacity: 0.12;
|
opacity: 0.12;
|
||||||
@@ -94,12 +104,12 @@ paper-button {
|
|||||||
color: rgba(0, 0, 0, 0.54);
|
color: rgba(0, 0, 0, 0.54);
|
||||||
}
|
}
|
||||||
|
|
||||||
.clickable {
|
.clickable, .statCard {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skillRow {
|
.skillRow {
|
||||||
cursor: initial;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.resourceCards {
|
.resourceCards {
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
.containerSummaryTable td{
|
|
||||||
text-align: right;
|
|
||||||
padding: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.containerSummaryTable td:first-child {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<template name="containerView">
|
<template name="containerView">
|
||||||
<div layout horizontal wrap center justified>
|
<div layout horizontal wrap center justified>
|
||||||
<table class="containerSummaryTable fullwidth">
|
<table class="summaryTable fullwidth">
|
||||||
<tr><td>Container</td><td>{{weight}}lbs</td><td>{{longValueString value}}</td></tr>
|
<tr><td>Container</td><td>{{weight}}lbs</td><td>{{longValueString value}}</td></tr>
|
||||||
<tr><td>Contents</td><td>{{contentsWeight}}lbs</td><td>{{longValueString contentsValue}}</td></tr>
|
<tr><td>Contents</td><td>{{contentsWeight}}lbs</td><td>{{longValueString contentsValue}}</td></tr>
|
||||||
<tr class="body2"><td>Total</td><td>{{totalWeight}}lbs</td><td>{{longValueString totalValue}}</td></tr>
|
<tr class="body2"><td>Total</td><td>{{totalWeight}}lbs</td><td>{{longValueString totalValue}}</td></tr>
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<!-- needs name, char, and statName -->
|
||||||
|
<template name="attributeDialog">
|
||||||
|
{{#baseDialog title=name class=colorClass hideEdit=true}}
|
||||||
|
{{> attributeDialogView}}
|
||||||
|
{{/baseDialog}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="attributeDialogView">
|
||||||
|
<div layout horizontal center-aligned>
|
||||||
|
<div class="display2">
|
||||||
|
{{char.attributeValue statName}}
|
||||||
|
</div>
|
||||||
|
{{#if adjustment}}
|
||||||
|
<div class="display1">
|
||||||
|
/{{char.attributeBase statName}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="vertMargin">
|
||||||
|
|
||||||
|
<table class="summaryTable">
|
||||||
|
{{#each baseEffects}}
|
||||||
|
<tr>
|
||||||
|
<td>{{sourceName}}</td>
|
||||||
|
<td>{{signedString statValue}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
{{#each addEffects}}
|
||||||
|
<tr>
|
||||||
|
<td>{{sourceName}}</td>
|
||||||
|
<td>{{signedString statValue}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
{{#each mulEffects}}
|
||||||
|
<tr>
|
||||||
|
<td>{{sourceName}}</td>
|
||||||
|
<td>×{{statValue}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
{{#each minEffects}}
|
||||||
|
<tr>
|
||||||
|
<td>{{sourceName}}</td>
|
||||||
|
<td>Min: {{statValue}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
{{#each maxEffects}}
|
||||||
|
<tr>
|
||||||
|
<td>{{sourceName}}</td>
|
||||||
|
<td>Max: {{statValue}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
<tr class="body2">
|
||||||
|
<td>Base Value</td>
|
||||||
|
<td>{{char.attributeBase statName}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Adjustment</td>
|
||||||
|
<td>{{signedString adjustment}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="body2">
|
||||||
|
<td>Total</td>
|
||||||
|
<td>{{char.attributeValue statName}}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
//TODO add dexterity armor
|
||||||
|
var stats = {
|
||||||
|
"strength":{"name":"Strength"},
|
||||||
|
"dexterity":{"name":"Dexterity"},
|
||||||
|
"constitution":{"name":"Constitution"},
|
||||||
|
"intelligence":{"name":"Intelligence"},
|
||||||
|
"wisdom":{"name":"Wisdom"},
|
||||||
|
"charisma":{"name":"Charisma"},
|
||||||
|
"strengthSave":{"name":"Strength Save",},
|
||||||
|
"dexteritySave":{"name":"Dexterity Save",},
|
||||||
|
"constitutionSave":{"name":"Constitution Save",},
|
||||||
|
"intelligenceSave":{"name":"Intelligence Save",},
|
||||||
|
"wisdomSave":{"name":"Wisdom Save",},
|
||||||
|
"charismaSave":{"name":"Charisma Save",},
|
||||||
|
"acrobatics":{"name":"Acrobatics",},
|
||||||
|
"animalHandling":{"name":"Animal Handling",},
|
||||||
|
"arcana":{"name":"Arcana",},
|
||||||
|
"athletics":{"name":"Athletics",},
|
||||||
|
"deception":{"name":"Deception",},
|
||||||
|
"history":{"name":"History",},
|
||||||
|
"insight":{"name":"Insight",},
|
||||||
|
"intimidation":{"name":"Intimidation",},
|
||||||
|
"investigation":{"name":"Investigation",},
|
||||||
|
"medicine":{"name":"Medicine",},
|
||||||
|
"nature":{"name":"Nature",},
|
||||||
|
"perception":{"name":"Perception",},
|
||||||
|
"performance":{"name":"Performance",},
|
||||||
|
"persuasion":{"name":"Persuasion",},
|
||||||
|
"religion":{"name":"Religion",},
|
||||||
|
"sleightOfHand":{"name":"Sleight of Hand",},
|
||||||
|
"stealth":{"name":"Stealth",},
|
||||||
|
"survival":{"name":"Survival",},
|
||||||
|
"initiative":{"name":"Initiative",},
|
||||||
|
"hitPoints":{"name":"Hit Points"},
|
||||||
|
"armor":{"name":"Armor"},
|
||||||
|
"dexterityArmor":{"name":"Dexterity Armor Bonus"},
|
||||||
|
"speed":{"name":"Speed"},
|
||||||
|
"proficiencyBonus":{"name":"Proficiency Bonus"},
|
||||||
|
"ki":{"name":"Ki Points"},
|
||||||
|
"sorceryPoints":{"name":"Sorcery Points"},
|
||||||
|
"rages":{"name":"Rages"},
|
||||||
|
"rageDamage":{"name":"Rage Damage"},
|
||||||
|
"expertiseDice":{"name":"Expertise Dice"},
|
||||||
|
"superiorityDice":{"name":"Superiority Dice"},
|
||||||
|
"level1SpellSlots":{"name":"level 1 Spell Slots"},
|
||||||
|
"level2SpellSlots":{"name":"level 2 Spell Slots"},
|
||||||
|
"level3SpellSlots":{"name":"level 3 Spell Slots"},
|
||||||
|
"level4SpellSlots":{"name":"level 4 Spell Slots"},
|
||||||
|
"level5SpellSlots":{"name":"level 5 Spell Slots"},
|
||||||
|
"level6SpellSlots":{"name":"level 6 Spell Slots"},
|
||||||
|
"level7SpellSlots":{"name":"level 7 Spell Slots"},
|
||||||
|
"level8SpellSlots":{"name":"level 8 Spell Slots"},
|
||||||
|
"level9SpellSlots":{"name":"level 9 Spell Slots"},
|
||||||
|
"d6HitDice":{"name":"d6 Hit Dice"},
|
||||||
|
"d8HitDice":{"name":"d8 Hit Dice"},
|
||||||
|
"d10HitDice":{"name":"d10 Hit Dice"},
|
||||||
|
"d12HitDice":{"name":"d12 Hit Dice"},
|
||||||
|
"acidMultiplier":{"name":"Acid", "group": "Weakness/Resistance"},
|
||||||
|
"bludgeoningMultiplier":{"name":"Bludgeoning", "group": "Weakness/Resistance"},
|
||||||
|
"coldMultiplier":{"name":"Cold", "group": "Weakness/Resistance"},
|
||||||
|
"fireMultiplier":{"name":"Fire", "group": "Weakness/Resistance"},
|
||||||
|
"forceMultiplier":{"name":"Force", "group": "Weakness/Resistance"},
|
||||||
|
"lightningMultiplier":{"name":"Lightning", "group": "Weakness/Resistance"},
|
||||||
|
"necroticMultiplier":{"name":"Necrotic", "group": "Weakness/Resistance"},
|
||||||
|
"piercingMultiplier":{"name":"Piercing", "group": "Weakness/Resistance"},
|
||||||
|
"poisonMultiplier":{"name":"Poison", "group": "Weakness/Resistance"},
|
||||||
|
"psychicMultiplier":{"name":"Psychic", "group": "Weakness/Resistance"},
|
||||||
|
"radiantMultiplier":{"name":"Radiant", "group": "Weakness/Resistance"},
|
||||||
|
"slashingMultiplier":{"name":"Slashing", "group": "Weakness/Resistance"},
|
||||||
|
"thunderMultiplier":{"name":"Thunder", "group": "Weakness/Resistance"}
|
||||||
|
};
|
||||||
|
|
||||||
|
var operations = {
|
||||||
|
base: {name: "Base Value"},
|
||||||
|
proficiency: {name: "Proficiency"},
|
||||||
|
add: {name: "+"},
|
||||||
|
mul: {name: "×"},
|
||||||
|
min: {name: "Min"},
|
||||||
|
max: {name: "Max"},
|
||||||
|
advantage: {name: "Advantage"},
|
||||||
|
disadvantage: {name: "Disadvantage"},
|
||||||
|
passiveAdd: {name: "Passive Bonus"},
|
||||||
|
fail: {name: "Automatically Fail"},
|
||||||
|
conditional: {name: "Conditional Benefit"}
|
||||||
|
};
|
||||||
|
|
||||||
|
var abilities = {
|
||||||
|
strength: {name: "Strength"},
|
||||||
|
dexterity: {name: "Dexterity"},
|
||||||
|
constitution: {name: "Constitution"},
|
||||||
|
intelligence: {name: "Intelligence"},
|
||||||
|
wisdom: {name: "Wisdom"},
|
||||||
|
charisma: {name: "Charisma"},
|
||||||
|
};
|
||||||
|
|
||||||
|
Template.attributeDialogView.created = function(){
|
||||||
|
this.data.char = Characters.findOne(this.data.charId, {fields: {_id : 1}});
|
||||||
|
};
|
||||||
|
|
||||||
|
Template.attributeDialogView.helpers({
|
||||||
|
or: function(a, b, c){
|
||||||
|
return a || b || c;
|
||||||
|
},
|
||||||
|
adjustment: function(){
|
||||||
|
var value = this.char.attributeValue(this.statName);
|
||||||
|
var base = this.char.attributeBase(this.statName);
|
||||||
|
return value - base;
|
||||||
|
},
|
||||||
|
baseEffects: function(){
|
||||||
|
return Effects.find({charId: this.char._id, stat: this.statName, operation: "base"});
|
||||||
|
},
|
||||||
|
addEffects: function(){
|
||||||
|
return Effects.find({charId: this.char._id, stat: this.statName, operation: "add"});
|
||||||
|
},
|
||||||
|
mulEffects: function(){
|
||||||
|
return Effects.find({charId: this.char._id, stat: this.statName, operation: "mul"});
|
||||||
|
},
|
||||||
|
minEffects: function(){
|
||||||
|
return Effects.find({charId: this.char._id, stat: this.statName, operation: "min"});
|
||||||
|
},
|
||||||
|
maxEffects: function(){
|
||||||
|
return Effects.find({charId: this.char._id, stat: this.statName, operation: "max"});
|
||||||
|
},
|
||||||
|
char: function(){
|
||||||
|
return Characters.findOne(this.charId, {fields:{_id: 1}});
|
||||||
|
},
|
||||||
|
sourceName: function(){
|
||||||
|
if (this.parent.collection === "Characters") return "inate";
|
||||||
|
return this.getParent().name;
|
||||||
|
},
|
||||||
|
operationName: function(){
|
||||||
|
var op = operations[this.operation];
|
||||||
|
return op && op.name || "No Operation";
|
||||||
|
},
|
||||||
|
statValue: function(){
|
||||||
|
return evaluate(this.charId, this.calculation) || this.value;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
@@ -1,81 +1,101 @@
|
|||||||
<!-- needs name, char, and skillName -->
|
<!-- needs name, char, and skillName -->
|
||||||
<template name="skillDialog">
|
<template name="skillDialog">
|
||||||
{{#baseDialog title=name class=colorClass hideColor="true" hideDelete="true"}}
|
{{#baseDialog title=name class=colorClass hideEdit=true}}
|
||||||
<!--proficiency-->
|
{{> skillDialogView}}
|
||||||
<div>
|
{{/baseDialog}}
|
||||||
<core-icon icon="{{profIcon}}"></core-icon>
|
</template>
|
||||||
{{#if profSource}}
|
|
||||||
{{#with profSource}}
|
<template name="skillDialogView">
|
||||||
{{statValue}} - {{sourceName}}
|
<div layout vertical center>
|
||||||
{{/with}}
|
<div class="display2">
|
||||||
{{else}}
|
{{char.skillMod skillName}}
|
||||||
Not Proficient
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
<!--numerical value-->
|
|
||||||
<div>
|
|
||||||
<!--Ability Mod-->
|
|
||||||
<div horizontal center-justified layout>
|
|
||||||
<div flex>{{abilityName}}</div>
|
|
||||||
<div class="summaryNumber">{{char.abilityMod ability}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!--Prof bonus-->
|
<div class="subhead">
|
||||||
|
<core-icon icon="{{profIcon}}" class="black54"></core-icon>
|
||||||
|
{{#if profSource}}
|
||||||
|
{{proficiencyValue}} - {{#with profSource}}{{sourceName}}{{/with}}
|
||||||
|
{{else}}
|
||||||
|
Not Proficient
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="vertMargin">
|
||||||
|
|
||||||
|
<table class="summaryTable">
|
||||||
|
<tr>
|
||||||
|
<td>{{abilityName}}</td>
|
||||||
|
<td>{{char.abilityMod ability}}</td>
|
||||||
|
</tr>
|
||||||
{{#if char.proficiency skillName}}
|
{{#if char.proficiency skillName}}
|
||||||
<div horizontal center-justified layout>
|
<tr>
|
||||||
<div flex>{{#with profSource}}{{statValue}}{{/with}}</div>
|
<td>{{proficiencyValue}}</td>
|
||||||
<div class="summaryNumber">{{signedString profBonus}}</div>
|
<td>{{signedString profBonus}}</td>
|
||||||
</div>
|
</tr>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<!--numerical effects-->
|
|
||||||
{{#each addEffects}}
|
{{#each addEffects}}
|
||||||
<div horizontal center-justified layout>
|
<tr>
|
||||||
<div flex>{{sourceName}}</div>
|
<td>{{sourceName}}</td>
|
||||||
<div class="summaryNumber">{{signedString statValue}}</div>
|
<td>{{signedString statValue}}</td>
|
||||||
</div>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#each mulEffects}}
|
{{#each mulEffects}}
|
||||||
<div horizontal center-justified layout>
|
<tr>
|
||||||
<div flex>{{sourceName}}</div>
|
<td>{{sourceName}}</td>
|
||||||
<div class="summaryNumber">×{{statValue}}</div>
|
<td>×{{statValue}}</td>
|
||||||
</div>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#each minEffects}}
|
{{#each minEffects}}
|
||||||
<div horizontal center-justified layout>
|
<tr>
|
||||||
<div flex>{{sourceName}}</div>
|
<td>{{sourceName}}</td>
|
||||||
<div class="summaryNumber">Min: {{statValue}}</div>
|
<td>Min: {{statValue}}</td>
|
||||||
</div>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#each maxEffects}}
|
{{#each maxEffects}}
|
||||||
<div horizontal center-justified layout>
|
<tr>
|
||||||
<div flex>{{sourceName}}</div>
|
<td>{{sourceName}}</td>
|
||||||
<div class="summaryNumber">Max: {{statValue}}</div>
|
<td>Max: {{statValue}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
<tr class="body2">
|
||||||
|
<td>Total</td>
|
||||||
|
<td>{{char.skillMod skillName}}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{{#if or advEffects.count dadvEffects.count conditionalEffects.count}}
|
||||||
|
<hr class="vertMargin">
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<div class="spaceAfter" horizontal center layout>
|
||||||
|
{{#if advEffects.count}}
|
||||||
|
<div class="body2" style="width: 100px;">
|
||||||
|
Advantage
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
<div flex>
|
||||||
<!--Total-->
|
{{#each advEffects}}
|
||||||
<div horizontal center-justified layout>
|
<div>{{sourceName}}</div>
|
||||||
<div flex>Total</div>
|
{{/each}}
|
||||||
<div class="summaryNumber">{{char.skillMod skillName}}</div>
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
<div class="spaceAfter" horizontal center layout>
|
||||||
|
{{#if dadvEffects.count}}
|
||||||
|
<div class="body2" style="width: 100px;">
|
||||||
|
Disadvantage
|
||||||
|
</div>
|
||||||
|
<div flex>
|
||||||
|
{{#each dadvEffects}}
|
||||||
|
<div>{{sourceName}}</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<!--Advantage effects-->
|
|
||||||
{{#if advEffects.count}}
|
|
||||||
Advantage:
|
|
||||||
{{#each advEffects}}
|
|
||||||
<div>{{sourceName}}</div>
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
{{#if dadvEffects.count}}
|
|
||||||
Disadvantage:
|
|
||||||
{{#each dadvEffects}}
|
|
||||||
<div>{{sourceName}}</div>
|
|
||||||
{{/each}}
|
|
||||||
{{/if}}
|
|
||||||
<!--Conditional Benefits-->
|
<!--Conditional Benefits-->
|
||||||
{{#each conditionalEffects}}
|
{{#each conditionalEffects}}
|
||||||
<div>
|
<div class="spaceAfter">
|
||||||
<div>{{sourceName}}</div>
|
<div class="body2">{{sourceName}}</div>
|
||||||
<div>*{{statValue}}</div>
|
<div>*{{statValue}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/baseDialog}}
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ var stats = {
|
|||||||
"initiative":{"name":"Initiative",},
|
"initiative":{"name":"Initiative",},
|
||||||
"hitPoints":{"name":"Hit Points"},
|
"hitPoints":{"name":"Hit Points"},
|
||||||
"armor":{"name":"Armor"},
|
"armor":{"name":"Armor"},
|
||||||
"dexterityArmor":{"name":"Dexterity Armor Bonus"}
|
"dexterityArmor":{"name":"Dexterity Armor Bonus"},
|
||||||
,"speed":{"name":"Speed"},
|
"speed":{"name":"Speed"},
|
||||||
"proficiencyBonus":{"name":"Proficiency Bonus"},
|
"proficiencyBonus":{"name":"Proficiency Bonus"},
|
||||||
"ki":{"name":"Ki Points"},
|
"ki":{"name":"Ki Points"},
|
||||||
"sorceryPoints":{"name":"Sorcery Points"},
|
"sorceryPoints":{"name":"Sorcery Points"},
|
||||||
@@ -90,14 +90,17 @@ var abilities = {
|
|||||||
constitution: {name: "Constitution"},
|
constitution: {name: "Constitution"},
|
||||||
intelligence: {name: "Intelligence"},
|
intelligence: {name: "Intelligence"},
|
||||||
wisdom: {name: "Wisdom"},
|
wisdom: {name: "Wisdom"},
|
||||||
charisma: {name: "Charisma"},
|
charisma: {name: "Charisma"},
|
||||||
}
|
};
|
||||||
|
|
||||||
Template.skillDialog.created = function(){
|
Template.skillDialogView.created = function(){
|
||||||
this.data.char = Characters.findOne(this.data.charId, {fields: {_id : 1}});
|
this.data.char = Characters.findOne(this.data.charId, {fields: {_id : 1}});
|
||||||
};
|
};
|
||||||
|
|
||||||
Template.skillDialog.helpers({
|
Template.skillDialogView.helpers({
|
||||||
|
or: function(a, b, c){
|
||||||
|
return a || b || c;
|
||||||
|
},
|
||||||
profIcon: function(){
|
profIcon: function(){
|
||||||
var prof = this.char.proficiency(this.skillName);
|
var prof = this.char.proficiency(this.skillName);
|
||||||
if(prof > 0 && prof < 1) return "image:brightness-2";
|
if(prof > 0 && prof < 1) return "image:brightness-2";
|
||||||
@@ -106,12 +109,18 @@ Template.skillDialog.helpers({
|
|||||||
return "radio-button-off";
|
return "radio-button-off";
|
||||||
},
|
},
|
||||||
profSource: function(){
|
profSource: function(){
|
||||||
var effs = Effects.find({charId: this.char._id, stat: this.skillName, operation: "proficiency"}, {sort: {value: -1}}).fetch();
|
return Proficiencies.findOne({charId: this.char._id, name: this.skillName}, {sort: {value: -1}});
|
||||||
return effs && effs[0];
|
|
||||||
},
|
},
|
||||||
profBonus: function(){
|
profBonus: function(){
|
||||||
return this.char.proficiency(this.skillName) * this.char.attributeValue("proficiencyBonus");
|
return this.char.proficiency(this.skillName) * this.char.attributeValue("proficiencyBonus");
|
||||||
},
|
},
|
||||||
|
proficiencyValue: function(){
|
||||||
|
var prof = this.char.proficiency(this.skillName);
|
||||||
|
if(prof == 0.5) return "Half Proficiency";
|
||||||
|
if(prof == 1) return "Proficient";
|
||||||
|
if(prof == 2) return "Double Proficiency";
|
||||||
|
return prof + "x Proficiency";
|
||||||
|
},
|
||||||
addEffects: function(){
|
addEffects: function(){
|
||||||
return Effects.find({charId: this.char._id, stat: this.skillName, operation: "add"});
|
return Effects.find({charId: this.char._id, stat: this.skillName, operation: "add"});
|
||||||
},
|
},
|
||||||
@@ -153,30 +162,28 @@ Template.skillDialog.helpers({
|
|||||||
},
|
},
|
||||||
sourceName: function(){
|
sourceName: function(){
|
||||||
if (this.parent.collection === "Characters") return "inate";
|
if (this.parent.collection === "Characters") return "inate";
|
||||||
var parent = this.getParent();
|
return this.getParent().name;
|
||||||
return parent && parent.name;
|
|
||||||
},
|
},
|
||||||
operationName: function(){
|
operationName: function(){
|
||||||
if(this.operation === "proficiency") return null;
|
|
||||||
if(stats[this.stat].group === "Weakness/Resistance") return null;
|
if(stats[this.stat].group === "Weakness/Resistance") return null;
|
||||||
return operations[this.operation] && operations[this.operation].name || "No Operation";
|
return operations[this.operation] &&
|
||||||
|
operations[this.operation].name ||
|
||||||
|
"No Operation";
|
||||||
},
|
},
|
||||||
statValue: function(){
|
statValue: function(){
|
||||||
if(this.operation === "advantage" ||
|
if(
|
||||||
this.operation === "disadvantage" ||
|
this.operation === "advantage" ||
|
||||||
this.operation === "fail"){
|
this.operation === "disadvantage" ||
|
||||||
|
this.operation === "fail"
|
||||||
|
){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(this.operation === "proficiency"){
|
|
||||||
if(this.value == 0.5 || this.calculation == 0.5) return "Half Proficiency";
|
|
||||||
if(this.value == 1 || this.calculation == 1) return "Proficiency";
|
|
||||||
if(this.value == 2 || this.calculation == 2) return "Double Proficiency";
|
|
||||||
}
|
|
||||||
if(stats[this.stat].group === "Weakness/Resistance"){
|
if(stats[this.stat].group === "Weakness/Resistance"){
|
||||||
if(this.value == 0.5 || this.calculation == 0.5) return "Resistance";
|
if(this.value === 0.5) return "Resistance";
|
||||||
if(this.value == 2 || this.calculation == 2) return "Vulnerability";
|
if(this.value === 2) return "Vulnerability";
|
||||||
if(this.value == 0 || this.calculation == 0) return "Immunity";
|
if(this.value === 0) return "Immunity";
|
||||||
|
return " Damage x"+ this.value;
|
||||||
}
|
}
|
||||||
return this.calculation || this.value;
|
return evaluate(this.charId, this.calculation) || this.value;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
Template.stats.events({
|
Template.stats.events({
|
||||||
"tap .statCard": function(event, instance){
|
"tap .statCard": function(event, instance){
|
||||||
//TODO reimplement this when the dialog is nice
|
var charId = instance.data._id;
|
||||||
return;
|
|
||||||
if(this.isSkill){
|
if(this.isSkill){
|
||||||
var charId = instance.data._id;
|
|
||||||
GlobalUI.setDetail({
|
GlobalUI.setDetail({
|
||||||
template: "skillDialog",
|
template: "skillDialog",
|
||||||
data: {name: this.name, skillName: this.stat, charId: charId},
|
data: {name: this.name, skillName: this.stat, charId: charId},
|
||||||
heroId: charId + this.stat
|
heroId: charId + this.stat
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
GlobalUI.setDetail({
|
||||||
|
template: "attributeDialog",
|
||||||
|
data: {name: this.name, statName: this.stat, charId: charId},
|
||||||
|
heroId: charId + this.stat
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tap .skillRow": function(event, instance){
|
"tap .skillRow": function(event, instance){
|
||||||
//TODO reimplement this when the dialog is nice
|
|
||||||
return;
|
|
||||||
var skill = this.skill;
|
var skill = this.skill;
|
||||||
var charId = instance.data._id;
|
var charId = instance.data._id;
|
||||||
GlobalUI.setDetail({
|
GlobalUI.setDetail({
|
||||||
|
|||||||
Reference in New Issue
Block a user