Skip to content

Commit

Permalink
Merge branch 'release-0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaumRystra committed Jun 25, 2015
2 parents 612e127 + af57326 commit 946fada
Show file tree
Hide file tree
Showing 34 changed files with 476 additions and 305 deletions.
403 changes: 237 additions & 166 deletions rpg-docs/Model/Character/Characters.js

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions rpg-docs/Model/Character/SubSchemas/Adjustment.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
* Damage, healing and resource cost/recovery are all adjustments
*/
Schemas.Adjustment = new SimpleSchema({
name: {
type: String,
optional: true,
},
//which stat the adjustment is applied to
stat: {
type: String,
Expand Down
2 changes: 1 addition & 1 deletion rpg-docs/client/style/cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ $thinColumnWidth: 240px;
}

/* undo pointer cursor on detail box heading */
#globalDetail .card .top {
#globalDetail.card .top {
cursor: auto;
}
8 changes: 7 additions & 1 deletion rpg-docs/client/style/tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ td {
width: 250px;
}
}
}
}

.summaryTable {
&:nth-child(3){
text-align: right;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template name="characterSettings">
{{#with character}}
<div>
<table>
<div style="height: 100px;">
<table style="width: 100%;">
<tr>
<td>Hide Spells tab</td>
<td>
Expand All @@ -23,4 +23,5 @@
</table>
</div>
{{/with}}
<paper-button id="doneButton" affirmative> Done </paper-button>
</template>
2 changes: 1 addition & 1 deletion rpg-docs/client/views/character/characterSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Template.characterSheet.helpers({
hideSpellcasting: function() {
var char = Characters.findOne(this._id);
return char && char.settings.hideSpellcasting;
}
},
});

Template.characterSheet.events({
Expand Down
4 changes: 2 additions & 2 deletions rpg-docs/client/views/character/features/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
</template>

<template name="resource">
{{#if char.attributeBase name}}
{{#if characterCalculate "attributeBase" char._id name}}
<paper-shadow class="card"
hero-id="main" {{detailHero name char._id}}
layout horizontal>
Expand All @@ -152,7 +152,7 @@
disabled={{cantDecrement}}>
</paper-icon-button>
</div>
<div>{{char.attributeValue name}}</div>
<div>{{characterCalculate "attributeValue" char._id name}}</div>
<!--<div>/{{char.attributeBase name}}</div>-->
</div>
<div class="right clickable"
Expand Down
15 changes: 10 additions & 5 deletions rpg-docs/client/views/character/features/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ Template.features.events({

Template.resource.helpers({
cantIncrement: function(){
var baseBigger = this.char.attributeValue(this.name) <
this.char.attributeBase(this.name);
var value = Characters.calculate.attributeValue(this.char._id, this.name);
var base = Characters.calculate.attributeBase(this.char._id, this.name);
var baseBigger = value < base;
return !baseBigger;
},
cantDecrement: function(){
var valuePositive = this.char.attributeValue(this.name) > 0;
var value = Characters.calculate.attributeValue(this.char._id, this.name);
var valuePositive = value > 0;
return !valuePositive;
},
getColor: function(){
Expand All @@ -115,14 +117,17 @@ Template.resource.helpers({

Template.resource.events({
"tap .resourceUp": function(event){
if (this.char.attributeValue(this.name) < this.char.attributeBase(this.name)){
var value = Characters.calculate.attributeValue(this.char._id, this.name);
var base = Characters.calculate.attributeBase(this.char._id, this.name);
if (value < base){
var modifier = {$inc: {}};
modifier.$inc[this.name + ".adjustment"] = 1;
Characters.update(this.char._id, modifier, {validate: false});
}
},
"tap .resourceDown": function(event){
if (this.char.attributeValue(this.name) > 0){
var value = Characters.calculate.attributeValue(this.char._id, this.name);
if (value > 0){
var modifier = {$inc: {}};
modifier.$inc[this.name + ".adjustment"] = -1;
Characters.update(this.char._id, modifier, {validate: false});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var getFractionCarried = function(char) {
weight += item.totalWeight();
});
//get strength
var strength = char.attributeValue("strength");
var strength = Characters.calculate.attributeValue(char._id, "strength");
var capacity = strength * 15;
return weight / capacity;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<template name="containerView">
<div layout horizontal wrap center justified>
<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>
<tr><td>Container</td><td>{{round weight}}lbs</td><td>{{longValueString value}}</td></tr>
<tr><td>Contents</td><td>{{round contentsWeight}}lbs</td><td>{{longValueString contentsValue}}</td></tr>
<tr class="body2"><td>Total</td><td>{{round totalWeight}}lbs</td><td>{{longValueString totalValue}}</td></tr>
</table>
</div>
{{#if description}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Template.experienceDialog.onRendered(function(){
updatePolymerInputs(this);
});

Template.experienceDialog.helpers({
experience: function(){
Experiences.findOne(this.experienceId);
Expand Down
4 changes: 2 additions & 2 deletions rpg-docs/client/views/character/journal/journal.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
hero-id="toolbar" {{detailHero}}
layout horizontal center>
<div flex>Experience</div>
<div >{{experience}} XP</div>
<div >{{characterCalculate "experience" _id}} XP</div>
<paper-icon-button class="black54" id="addXP" icon="add"></paper-icon-button>
</div>
<div class="bottom list">
Expand Down Expand Up @@ -45,7 +45,7 @@
layout horizontal center>
<div flex>
<div class="containerName subhead">
Level {{level}}
Level {{characterCalculate "level" _id}}
</div>
{{#if nextLevelXP}}
<div class="caption">
Expand Down
2 changes: 1 addition & 1 deletion rpg-docs/client/views/character/journal/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Template.journal.helpers({
return Levels.find({charId: charId, classId: this._id}, {sort: {value: 1}});
},
nextLevelXP: function(){
var currentLevel = this.level();
var currentLevel = Characters.calculate.level(this._id);
if (currentLevel < 20){
return XP_TABLE[currentLevel];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,30 @@
</template>

<template name="spellDetails">
<div class="caption">
<div class="body2">
Level {{level}} {{school}}, {{preparedString}}
</div>
<div class="vertMargin">
<div style="margin: 16px 0 16px 0;">
{{#if castingTime}}
<div>
<span class="body2">Casting Time: </span><span>{{castingTime}}</span>
</div>
{{/if}}
{{#if range}}
<div>
<span class="body2">Range: </span><span>{{range}}</span>
</div>
{{/if}}
{{#if getComponents}}
<div>
<span class="body2">Components: </span><span>{{getComponents}}</span>
</div>
{{/if}}
{{#if duration}}
<div>
<span class="body2">Duration: </span><span>{{duration}}</span>
</div>
{{/if}}
</div>
<div class="pre-wrap">{{evaluateString charId description}}</div>
{{> attacksViewList charId=charId parentId=_id}}
Expand Down
24 changes: 10 additions & 14 deletions rpg-docs/client/views/character/spells/spells.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,28 @@ Template.spells.helpers({
},
cantCast: function(level, char){
for (var i = level; i <= 9; i++){
if (char.attributeValue("level" + i + "SpellSlots") > 0){
if (Characters.calculate.attributeValue(char._id, "level" + i + "SpellSlots") > 0){
return false;
}
}
return true;
},
baseSlots: function(char){
return char.attributeBase("level" + this.level + "SpellSlots");
},
slots: function(char){
return char.attributeValue("level" + this.level + "SpellSlots");
},
showSlots: function(char){
return this.level && char.attributeBase("level" + this.level + "SpellSlots");
return this.level && Characters.calculate.attributeBase(
char._id, "level" + this.level + "SpellSlots"
);
},
hasSlots: function(){
for (var i = 1; i <= 9; i += 1){
if (this.attributeBase("level" + i + "SpellSlots")){
if (Characters.calculate.attributeBase(this._id, "level" + i + "SpellSlots")){
return true;
}
}
return false;
},
slotBubbles: function(char){
var baseSlots = char.attributeBase("level" + this.level + "SpellSlots");
var currentSlots = char.attributeValue("level" + this.level + "SpellSlots");
var baseSlots = Characters.calculate.attributeBase(char._id, "level" + this.level + "SpellSlots");
var currentSlots = Characters.calculate.attributeValue(char._id, "level" + this.level + "SpellSlots");
var slotsUsed = baseSlots - currentSlots;
var bubbles = [];
var i;
Expand Down Expand Up @@ -143,15 +139,15 @@ Template.spells.events({
var char = Characters.findOne(this.charId);
if (event.currentTarget.icon === "radio-button-off"){
if (
char.attributeValue(this.attribute) <
char.attributeBase(this.attribute)
Characters.calculate.attributeValue(char._id, this.attribute) <
Characters.calculate.attributeBase(char._id, this.attribute)
){
modifier = {$inc: {}};
modifier.$inc[this.attribute + ".adjustment"] = 1;
Characters.update(this.charId, modifier, {validate: false});
}
} else {
if (char.attributeValue(this.attribute) > 0){
if (Characters.calculate.attributeValue(char._id, this.attribute) > 0){
modifier = {$inc: {}};
modifier.$inc[this.attribute + ".adjustment"] = -1;
Characters.update(this.charId, modifier, {validate: false});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
layout horizontal>
<div class="left white-text {{color}}"
hero-id="toolbar" {{detailHero ability ../_id}}>
<div class="display1">{{../attributeValue ability}}</div>
<div class="title">{{../abilityMod ability}}</div>
<div class="display1">{{characterCalculate "attributeValue" ../_id ability}}</div>
<div class="title">{{abilityMod}}</div>
</div>
<div class="right subhead" layout horizontal center>
{{title}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Template.abilityMiniCard.helpers({
abilityMod: function() {
return signedString(
Characters.calculate.abilityMod(
Template.parentData()._id, this.ability
)
);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ Template.attributeDialogView.helpers({
return a || b || c;
},
adjustment: function(){
var char = Characters.findOne(this.charId);
if (!char) return;
var value = char.attributeValue(this.statName);
var base = char.attributeBase(this.statName);
var value = Characters.calculate.attributeValue(this.charId, this.statName);
var base = Characters.calculate.attributeBase(this.charId, this.statName);
return value - base;
},
baseEffects: function(){
Expand Down Expand Up @@ -138,14 +136,10 @@ Template.attributeDialogView.helpers({
);
},
attributeBase: function(){
var char = Characters.findOne(this.charId);
if (!char) throw "character is " + char;
return char.attributeBase(this.statName);
return Characters.calculate.attributeBase(this.charId, this.statName);
},
attributeValue: function() {
var char = Characters.findOne(this.charId);
if (!char) throw "character is " + char;
return char.attributeValue(this.statName);
return Characters.calculate.attributeValue(this.charId, this.statName);
},
sourceName: function(){
if (this.parent.group === "racial"){
Expand Down
28 changes: 20 additions & 8 deletions rpg-docs/client/views/character/stats/healthCard/healthCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<div class="right" flex layout vertical center-justified style="min-width: 180px;">
<div layout horizontal>
<paper-diff-slider id="hitPointSlider"
value={{attributeValue "hitPoints"}}
max={{attributeBase "hitPoints"}}
editable pin
role="slider"
></paper-diff-slider>
value={{characterCalculate "attributeValue" _id "hitPoints"}}
max={{characterCalculate "attributeBase" _id "hitPoints"}}
editable pin
role="slider">
</paper-diff-slider>
</div>
{{#each tempHitPoints}}
<div>
Expand All @@ -35,9 +35,21 @@
</div>
{{/each}}
<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}}
{{#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}}
Expand Down
Loading

0 comments on commit 946fada

Please sign in to comment.