Skip to content

Commit

Permalink
bug fixes, charm display
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliharu committed Dec 11, 2021
1 parent fc41344 commit add3377
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 29 deletions.
4 changes: 1 addition & 3 deletions module/apps/dice-roller.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,11 @@ export async function openAttackDialogue(actor, attribute = "dexterity", ability
}
}
else {
let damage = parseInt(html.find('#damage').val()) || 0;
let diceModifier = parseInt(html.find('#dice-modifier').val()) || 0;
let dice = parseInt(html.find('#damage').val()) || 0;
let successModifier = parseInt(html.find('#damage-successes').val()) || 0;
let doubleSuccess = parseInt(html.find('#damage-double-success').val()) || 11;
let targetNumber = parseInt(html.find('#damage-target-number').val()) || 7;

let dice = damage + diceModifier;
let baseDamage = dice;

if (attackType === 'decisive') {
Expand Down
4 changes: 4 additions & 0 deletions module/exaltedthird.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ Handlebars.registerHelper('ifEquals', function(arg1, arg2, options) {
return (arg1 == arg2) ? options.fn(this) : options.inverse(this);
});

Handlebars.registerHelper('ifGreater', function(arg1, arg2, options) {
return (arg1 > arg2) ? options.fn(this) : options.inverse(this);
});

$(document).ready(() => {
const diceIconSelector = '#chat-controls .chat-control-icon .fa-dice-d20';

Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/Aliharu/Foundry-Ex3",
"license": "LICENSE.txt",
"flags": {},
"version": "0.6.2",
"version": "0.6.3",
"minimumCoreVersion": "0.8.5",
"compatibleCoreVersion": "0.8.9",
"scripts": [],
Expand All @@ -29,7 +29,7 @@
"dependencies": [],
"socket": false,
"manifest": "https://raw.githubusercontent.com/Aliharu/Foundry-Ex3/master/system.json",
"download": "https://github.com/Aliharu/Foundry-Ex3/releases/download/v0.6.2/release0.6.2.zip",
"download": "https://github.com/Aliharu/Foundry-Ex3/releases/download/v0.6.3/release0.6.3.zip",
"protected": false,
"gridDistance": 5,
"gridUnits": "ft",
Expand Down
2 changes: 1 addition & 1 deletion template.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
"requirement": 0,
"essence": 0,
"cost": {
"mote": 0,
"motes": 0,
"initiative": 0,
"anima": 0,
"willpower": 0,
Expand Down
6 changes: 5 additions & 1 deletion templates/actor/charm-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ <h4 class="item-name">{{item.name}}</h4>
</li>
<li class="item-description">
<div>
<b>Cost</b>: {{ item.data.cost.mote }}m, {{ item.data.cost.willpower }}wp, {{ item.data.cost.anima }}a, {{ item.data.cost.anima }}a, {{ item.data.cost.initiative }}i, {{ item.data.cost.silverxp }}sxp, {{ item.data.cost.goldxp }}gxp, {{ item.data.cost.whitexp }}wxp;
<b>Cost</b>: {{#ifGreater item.data.cost.motes 0}}{{ item.data.cost.motes }}m,{{/ifGreater}} {{#ifGreater item.data.cost.willpower 0}} {{ item.data.cost.willpower }}wp, {{/ifGreater}} {{#ifGreater item.data.cost.anima 0}}{{ item.data.cost.anima }}a, {{/ifGreater}}
{{#ifGreater item.data.cost.initiative 0}}{{ item.data.cost.initiative }}i, {{/ifGreater}} {{#ifGreater item.data.cost.silverxp 0}}{{ item.data.cost.silverxp }}sxp, {{/ifGreater}} {{#ifGreater item.data.cost.goldxp 0}} {{
item.data.cost.goldxp }}gxp, {{/ifGreater}} {{#ifGreater item.data.cost.whitexp 0}}{{ item.data.cost.whitexp }}wxp; {{/ifGreater}}
</div>
{{#ifGreater item.data.cost.health 0}}
<div>
<b>Health cost</b>: {{ item.data.cost.health }} {{ item.data.cost.healthtype }}
</div>
{{/ifGreater}}
<div>
<b>Mins</b>: {{item.data.ability}} {{item.data.requirement}}, Essence {{item.data.essence}}
</div>
Expand Down
48 changes: 26 additions & 22 deletions templates/chat/item-card.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
<div class="exaltedthird chat-card item-card" data-actor-id="{{actor.id}}" data-item-id="{{item.id}}"
{{#if tokenId}}data-token-id="{{tokenId}}"{{/if}}>
<div class="exaltedthird chat-card item-card" data-actor-id="{{actor.id}}" data-item-id="{{item.id}}" {{#if
tokenId}}data-token-id="{{tokenId}}" {{/if}}>
<header class="card-header flexrow item-row">
<img src="{{item.img}}" title="{{item.name}}" width="36" height="36"/>
<img src="{{item.img}}" title="{{item.name}}" width="36" height="36" />
<h3 class="item-name">{{item.name}}</h3>
</header>

<div class="card-content item-description">
{{#ifEquals item.type 'charm'}}
<div>
<b>Cost</b>: {{ item.data.cost.mote }}m, {{ item.data.cost.willpower }}wp, {{ item.data.cost.anima }}a, {{ item.data.cost.anima }}a, {{ item.data.cost.initiative }}i, {{ item.data.cost.silverxp }}sxp, {{ item.data.cost.goldxp }}gxp, {{ item.data.cost.whitexp }}wxp;
</div>
<div>
<b>Health cost</b>: {{ item.data.cost.health }} {{ item.data.cost.healthtype }}
</div>
<div>
<b>Mins</b>: {{item.data.ability}} {{item.data.requirement}}, Essence {{item.data.essence}}
</div>
<div>
<b>Type</b>: {{item.data.type}}
</div>
<div>
<b>Keywords</b>: {{item.data.keywords}}
</div>
<div>
<b>Duration</b>: {{item.data.duration}}
</div>
<div>
<b>Cost</b>: {{#ifGreater item.data.cost.motes 0}}{{ item.data.cost.motes }}m,{{/ifGreater}} {{#ifGreater item.data.cost.willpower 0}} {{ item.data.cost.willpower }}wp, {{/ifGreater}} {{#ifGreater item.data.cost.anima 0}}{{ item.data.cost.anima }}a, {{/ifGreater}}
{{#ifGreater item.data.cost.initiative 0}}{{ item.data.cost.initiative }}i, {{/ifGreater}} {{#ifGreater item.data.cost.silverxp 0}}{{ item.data.cost.silverxp }}sxp, {{/ifGreater}} {{#ifGreater item.data.cost.goldxp 0}} {{
item.data.cost.goldxp }}gxp, {{/ifGreater}} {{#ifGreater item.data.cost.whitexp 0}}{{ item.data.cost.whitexp }}wxp; {{/ifGreater}}
</div>
{{#ifGreater item.data.cost.health 0}}
<div>
<b>Health cost</b>: {{ item.data.cost.health }} {{ item.data.cost.healthtype }}
</div>
{{/ifGreater}}
<div>
<b>Mins</b>: {{item.data.ability}} {{item.data.requirement}}, Essence {{item.data.essence}}
</div>
<div>
<b>Type</b>: {{item.data.type}}
</div>
<div>
<b>Keywords</b>: {{item.data.keywords}}
</div>
<div>
<b>Duration</b>: {{item.data.duration}}
</div>
{{/ifEquals}}
{{{item.data.description}}}
</div>
</div>
</div>

0 comments on commit add3377

Please sign in to comment.