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
|
||||
ddp@1.1.0
|
||||
deps@1.0.7
|
||||
differential:vulcanize@0.0.4
|
||||
differential:vulcanize@0.0.5
|
||||
ejson@1.0.6
|
||||
email@1.0.6
|
||||
fastclick@1.0.3
|
||||
@@ -46,15 +46,16 @@ logging@1.0.7
|
||||
matb33:collection-hooks@0.7.11
|
||||
meteor@1.1.6
|
||||
meteor-platform@1.2.2
|
||||
mike:mocha@0.5.2
|
||||
mike:mocha@0.5.3
|
||||
minifiers@1.1.5
|
||||
minimongo@1.0.8
|
||||
mobile-status-bar@1.0.3
|
||||
momentjs:moment@2.10.0
|
||||
momentjs:moment@2.10.3
|
||||
mongo@1.1.0
|
||||
npm-bcrypt@0.7.8_2
|
||||
observe-sequence@1.0.6
|
||||
ordered-dict@1.0.3
|
||||
package-version-parser@3.0.3
|
||||
percolate:migrations@0.7.3
|
||||
practicalmeteor:chai@1.9.2_3
|
||||
practicalmeteor:loglevel@1.1.0_3
|
||||
@@ -64,6 +65,9 @@ reactive-var@1.0.5
|
||||
reload@1.1.3
|
||||
retry@1.0.3
|
||||
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
|
||||
session@1.1.0
|
||||
sha@1.0.3
|
||||
@@ -75,11 +79,11 @@ tracker@1.0.7
|
||||
ui@1.0.6
|
||||
underscore@1.0.3
|
||||
url@1.0.4
|
||||
velocity:core@0.4.5
|
||||
velocity:html-reporter@0.3.2
|
||||
velocity:node-soft-mirror@0.3.1
|
||||
velocity:chokidar@0.12.6_1
|
||||
velocity:core@0.6.0
|
||||
velocity:html-reporter@0.5.3
|
||||
velocity:meteor-internals@1.1.0_7
|
||||
velocity:shim@0.1.0
|
||||
velocity:test-proxy@0.0.4
|
||||
webapp@1.2.0
|
||||
webapp-hashing@1.0.3
|
||||
zimme:collection-behaviours@1.0.4
|
||||
|
||||
@@ -33,6 +33,16 @@ table {
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.summaryTable td{
|
||||
text-align: right;
|
||||
padding: 4px;
|
||||
min-width: 80px;
|
||||
}
|
||||
|
||||
.summaryTable td:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
hr {
|
||||
background-color: #444;
|
||||
opacity: 0.12;
|
||||
@@ -94,12 +104,12 @@ paper-button {
|
||||
color: rgba(0, 0, 0, 0.54);
|
||||
}
|
||||
|
||||
.clickable {
|
||||
.clickable, .statCard {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.skillRow {
|
||||
cursor: initial;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.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">
|
||||
<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>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>
|
||||
|
||||
@@ -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 -->
|
||||
<template name="skillDialog">
|
||||
{{#baseDialog title=name class=colorClass hideColor="true" hideDelete="true"}}
|
||||
<!--proficiency-->
|
||||
<div>
|
||||
<core-icon icon="{{profIcon}}"></core-icon>
|
||||
{{#if profSource}}
|
||||
{{#with profSource}}
|
||||
{{statValue}} - {{sourceName}}
|
||||
{{/with}}
|
||||
{{else}}
|
||||
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>
|
||||
{{#baseDialog title=name class=colorClass hideEdit=true}}
|
||||
{{> skillDialogView}}
|
||||
{{/baseDialog}}
|
||||
</template>
|
||||
|
||||
<template name="skillDialogView">
|
||||
<div layout vertical center>
|
||||
<div class="display2">
|
||||
{{char.skillMod skillName}}
|
||||
</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}}
|
||||
<div horizontal center-justified layout>
|
||||
<div flex>{{#with profSource}}{{statValue}}{{/with}}</div>
|
||||
<div class="summaryNumber">{{signedString profBonus}}</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>{{proficiencyValue}}</td>
|
||||
<td>{{signedString profBonus}}</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
<!--numerical effects-->
|
||||
{{#each addEffects}}
|
||||
<div horizontal center-justified layout>
|
||||
<div flex>{{sourceName}}</div>
|
||||
<div class="summaryNumber">{{signedString statValue}}</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>{{sourceName}}</td>
|
||||
<td>{{signedString statValue}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
{{#each mulEffects}}
|
||||
<div horizontal center-justified layout>
|
||||
<div flex>{{sourceName}}</div>
|
||||
<div class="summaryNumber">×{{statValue}}</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>{{sourceName}}</td>
|
||||
<td>×{{statValue}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
{{#each minEffects}}
|
||||
<div horizontal center-justified layout>
|
||||
<div flex>{{sourceName}}</div>
|
||||
<div class="summaryNumber">Min: {{statValue}}</div>
|
||||
</div>
|
||||
<tr>
|
||||
<td>{{sourceName}}</td>
|
||||
<td>Min: {{statValue}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
{{#each maxEffects}}
|
||||
<div horizontal center-justified layout>
|
||||
<div flex>{{sourceName}}</div>
|
||||
<div class="summaryNumber">Max: {{statValue}}</div>
|
||||
<tr>
|
||||
<td>{{sourceName}}</td>
|
||||
<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>
|
||||
{{/each}}
|
||||
<!--Total-->
|
||||
<div horizontal center-justified layout>
|
||||
<div flex>Total</div>
|
||||
<div class="summaryNumber">{{char.skillMod skillName}}</div>
|
||||
</div>
|
||||
<div flex>
|
||||
{{#each advEffects}}
|
||||
<div>{{sourceName}}</div>
|
||||
{{/each}}
|
||||
</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>
|
||||
<!--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-->
|
||||
{{#each conditionalEffects}}
|
||||
<div>
|
||||
<div>{{sourceName}}</div>
|
||||
<div class="spaceAfter">
|
||||
<div class="body2">{{sourceName}}</div>
|
||||
<div>*{{statValue}}</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/baseDialog}}
|
||||
</template>
|
||||
|
||||
@@ -33,8 +33,8 @@ var stats = {
|
||||
"initiative":{"name":"Initiative",},
|
||||
"hitPoints":{"name":"Hit Points"},
|
||||
"armor":{"name":"Armor"},
|
||||
"dexterityArmor":{"name":"Dexterity Armor Bonus"}
|
||||
,"speed":{"name":"Speed"},
|
||||
"dexterityArmor":{"name":"Dexterity Armor Bonus"},
|
||||
"speed":{"name":"Speed"},
|
||||
"proficiencyBonus":{"name":"Proficiency Bonus"},
|
||||
"ki":{"name":"Ki Points"},
|
||||
"sorceryPoints":{"name":"Sorcery Points"},
|
||||
@@ -90,14 +90,17 @@ var abilities = {
|
||||
constitution: {name: "Constitution"},
|
||||
intelligence: {name: "Intelligence"},
|
||||
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}});
|
||||
};
|
||||
|
||||
Template.skillDialog.helpers({
|
||||
Template.skillDialogView.helpers({
|
||||
or: function(a, b, c){
|
||||
return a || b || c;
|
||||
},
|
||||
profIcon: function(){
|
||||
var prof = this.char.proficiency(this.skillName);
|
||||
if(prof > 0 && prof < 1) return "image:brightness-2";
|
||||
@@ -106,12 +109,18 @@ Template.skillDialog.helpers({
|
||||
return "radio-button-off";
|
||||
},
|
||||
profSource: function(){
|
||||
var effs = Effects.find({charId: this.char._id, stat: this.skillName, operation: "proficiency"}, {sort: {value: -1}}).fetch();
|
||||
return effs && effs[0];
|
||||
return Proficiencies.findOne({charId: this.char._id, name: this.skillName}, {sort: {value: -1}});
|
||||
},
|
||||
profBonus: function(){
|
||||
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(){
|
||||
return Effects.find({charId: this.char._id, stat: this.skillName, operation: "add"});
|
||||
},
|
||||
@@ -153,30 +162,28 @@ Template.skillDialog.helpers({
|
||||
},
|
||||
sourceName: function(){
|
||||
if (this.parent.collection === "Characters") return "inate";
|
||||
var parent = this.getParent();
|
||||
return parent && parent.name;
|
||||
return this.getParent().name;
|
||||
},
|
||||
operationName: function(){
|
||||
if(this.operation === "proficiency") 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(){
|
||||
if(this.operation === "advantage" ||
|
||||
this.operation === "disadvantage" ||
|
||||
this.operation === "fail"){
|
||||
if(
|
||||
this.operation === "advantage" ||
|
||||
this.operation === "disadvantage" ||
|
||||
this.operation === "fail"
|
||||
){
|
||||
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(this.value == 0.5 || this.calculation == 0.5) return "Resistance";
|
||||
if(this.value == 2 || this.calculation == 2) return "Vulnerability";
|
||||
if(this.value == 0 || this.calculation == 0) return "Immunity";
|
||||
if(this.value === 0.5) return "Resistance";
|
||||
if(this.value === 2) return "Vulnerability";
|
||||
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({
|
||||
"tap .statCard": function(event, instance){
|
||||
//TODO reimplement this when the dialog is nice
|
||||
return;
|
||||
var charId = instance.data._id;
|
||||
if(this.isSkill){
|
||||
var charId = instance.data._id;
|
||||
GlobalUI.setDetail({
|
||||
template: "skillDialog",
|
||||
data: {name: this.name, skillName: this.stat, charId: charId},
|
||||
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){
|
||||
//TODO reimplement this when the dialog is nice
|
||||
return;
|
||||
var skill = this.skill;
|
||||
var charId = instance.data._id;
|
||||
GlobalUI.setDetail({
|
||||
|
||||
Reference in New Issue
Block a user