Skip to content

Commit

Permalink
Bug fixes, minor improvements, auto add other items
Browse files Browse the repository at this point in the history
  • Loading branch information
Aliharu committed Jun 9, 2024
1 parent c137be3 commit 28dfd5f
Show file tree
Hide file tree
Showing 13 changed files with 286 additions and 230 deletions.
2 changes: 1 addition & 1 deletion module/actor/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export class ExaltedThirdActorSheet extends ActorSheet {
endings: 0,
}
// Iterate through items, allocating to containers
for (let i of sheetData.items) {
for (let i of actorData.items) {
i.img = i.img || DEFAULT_TOKEN;
if (i.type === 'item') {
gear.push(i);
Expand Down
2 changes: 1 addition & 1 deletion module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ export async function spendEmbeddedItem(actor, item) {
}
}
}
if (item.system.cost.commitmotes > 0) {
if (item.system.cost.commitmotes > 0 || item.system.activatable) {
updateActive = true;
}
}
Expand Down
9 changes: 4 additions & 5 deletions module/apps/dice-roller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ export class RollForm extends FormApplication {
case 'opposedRolls':
return (this.object.rollType === 'useOpposingCharms');
case 'sameAbility':
return (charm.system.ability === this.object.ability || charm.system.ability === this.object.attribute);
return charm.type === 'charm' && (charm.system.ability === this.object.ability || charm.system.ability === this.object.attribute);
}
if (this.object.rollType === charm.system.autoaddtorolls) {
return true;
Expand All @@ -1065,7 +1065,7 @@ export class RollForm extends FormApplication {
}
for (var charmlist of Object.values(this.object.charmList)) {
for (const charm of charmlist.list.filter(charm => charm.type !== 'charm' || charm.system.diceroller.enabled)) {
var existingAddedCharm = this.object.addedCharms.find((addedCharm) => addedCharm.id === charm._id);
var existingAddedCharm = this.object.addedCharms.find((addedCharm) => addedCharm._id === charm._id);
if (existingAddedCharm) {
charm.charmAdded = true;
charm.timesAdded = existingAddedCharm.timesAdded;
Expand Down Expand Up @@ -3044,19 +3044,18 @@ export class RollForm extends FormApplication {
else {
this.object.thresholdSuccesses = 0;
}
if ((this.object.thresholdSuccesses >= 0 && this.object.rollType !== 'accuracy') || this.object.rollType === 'damage') {
if (this.object.rollType === 'damage' || (this.object.attackSuccesses >= this.object.defense && this.object.rollType !== 'accuracy')) {
if (this.object.rollType === 'damage' && this.object.attackSuccesses < this.object.defense) {
this.object.thresholdSuccesses = this.object.attackSuccesses - this.object.defense;
await this.missAttack(false);
}
else {
await this._damageRoll();
await this._addTriggerBonuses('afterDamageRoll');

}
}
else {
if (this.object.thresholdSuccesses < 0 && this.object.rollType !== 'accuracy') {
if (this.object.attackSuccesses < this.object.defense && this.object.rollType !== 'accuracy') {
await this.missAttack();
}
}
Expand Down
3 changes: 2 additions & 1 deletion module/apps/npc-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export default class NPCGenerator extends FormApplication {
height: 1100,
resizable: true,
submitOnChange: true,
closeOnSubmit: false
closeOnSubmit: false,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }]
});
}

Expand Down
3 changes: 2 additions & 1 deletion module/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ exaltedthird.exaltcharmtypes = {
solar: "Ex3.Solar",
sovereign: "Ex3.Sovereign",
umbral: "Ex3.Umbral",
universal: "Ex3.Universal",
other: "Ex3.Other"
};

Expand Down Expand Up @@ -1842,7 +1843,7 @@ exaltedthird.selects = {
'': "Ex3.None",
'action': "Ex3.CharacterRolls",
'opposedRolls': "Ex3.OpposedRolls",
'sameAbility': "Ex3.NonSameAbilityAttribute",
'sameAbility': "Ex3.SameAbilityAttribute",
'attacks': "Ex3.Attacks",
'command': "Ex3.Command",
'grapple': "Ex3.Grapple",
Expand Down
2 changes: 1 addition & 1 deletion module/item/item-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class ExaltedThirdItemSheet extends ItemSheet {
html.find('.show-roll-triggers-link').click(ev => {
new Dialog({
title: `ReadMe`,
content: '<div><p><a href="https://github.com/Aliharu/Foundry-Ex3/wiki/Charm-Triggers">Instructions and Syntax.</a></p></div>',
content: '<div><p><a href="https://github.com/Aliharu/Foundry-Ex3/wiki/Dice-Roll-Triggers">Instructions and Syntax.</a></p></div>',
buttons: {
cancel: { label: "Close" }
}
Expand Down
3 changes: 3 additions & 0 deletions module/template/item-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export class ItemMeritData extends CommonItemData {
...commonData,
...activatableData(),
...triggerData(),
autoaddtorolls: new fields.StringField({ initial: "" }),
merittype: new fields.StringField({ initial: "story" }),
parentitemid: new fields.StringField({ initial: "" }),
archetypename: new fields.StringField({ initial: "" }),
Expand Down Expand Up @@ -251,6 +252,7 @@ export class ItemSpecialAbilityData extends CommonItemData {
...commonData,
...activatableData(),
...triggerData(),
autoaddtorolls: new fields.StringField({ initial: "" }),
}
}
}
Expand Down Expand Up @@ -344,6 +346,7 @@ export class ItemSpellData extends CommonItemData {
...commonData,
...activatableData(),
...triggerData(),
autoaddtorolls: new fields.StringField({ initial: "" }),
summary: new fields.StringField({ initial: "" }),
circle: new fields.StringField({ initial: "terrestrial" }),
keywords: new fields.StringField({ initial: "" }),
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Unofficial Exalted third edition system module for FoundryVTT! Portions of the materials are the copyrights and trademarks of Paradox Interactive AB, and are used with permission. All rights reserved. For more information please visit worldofdarkness.com.",
"url": "https://github.com/Aliharu/Foundry-Ex3",
"license": "LICENSE.txt",
"version": "2.9.3",
"version": "2.9.4",
"compatibility": {
"minimum": "11",
"verified": "12",
Expand Down Expand Up @@ -49,7 +49,7 @@
],
"relationships": [],
"manifest": "https://raw.githubusercontent.com/Aliharu/Foundry-Ex3/master/system.json",
"download": "https://github.com/Aliharu/Foundry-Ex3/releases/download/v2.9.3/release2.9.3.zip",
"download": "https://github.com/Aliharu/Foundry-Ex3/releases/download/v2.9.4/release2.9.4.zip",
"bugs": "https://github.com/Aliharu/Foundry-Ex3/issues",
"gridDistance": 5,
"gridUnits": "ft",
Expand Down
11 changes: 11 additions & 0 deletions templates/actor/npc-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,17 @@ <h4 class="item-name">{{item.name}}</h4>
{{/each}}
</div>
</div>
<div class="mt-1">
<label class="resource-label">{{localize "Ex3.Languages"}}</label>
<a class="trait-selector" data-options="languages" data-target="system.traits.languages">
<i class="fas fa-edit"></i>
</a>
<div class="mt-1">
{{#each system.traits.languages.selected as |v k|}}
<li class="tag {{k}}">{{v}}</li>
{{/each}}
</div>
</div>
{{> systems/exaltedthird/templates/actor/biography-tab.html}}
</div>
</section>
Expand Down
Loading

0 comments on commit 28dfd5f

Please sign in to comment.