Skip to content

Commit

Permalink
vairous fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Jul 9, 2024
1 parent 50b63e8 commit a66f3e3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scripts/document/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class WrathAndGloryActor extends WNGDocumentMixin(Actor) {
let testData = {
title: ability.name,
speaker: this.speakerData(),
itemId: ability.id,
itemId: ability.uuid,
damage: {},
ed: {},
ap: {}
Expand Down
12 changes: 11 additions & 1 deletion scripts/hooks/combat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function() {
Hooks.on("updateCombat", (combat, data) => {
if (combat.current.round == 1 && combat.current.turn == 0)
if (combat.current.round == 1 && !combat.current.turn)
{
let chatData = {
content : `<div class="wrath-and-glory chat"><h3>New Combat - Battlecries</h3>`
Expand All @@ -15,6 +15,16 @@ export default function() {
chatData.content += `<br><b>${combatant.name}</b> - ${battlecries.map(i => i.name).join(", ")}`
postMessage = true;
}
battlecries.forEach(async b => {
if (b.hasTest)
{
let test = await combatant.actor.setupAbilityRoll(b);
if (test)
{
test.rollTest();
}
}
})
}

chatData.content += "</div>"
Expand Down
2 changes: 1 addition & 1 deletion scripts/model/item/archetype.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ArchetypeModel extends BaseItemModel
schema.journal = new fields.StringField({});
schema.species = new fields.EmbeddedDataField(SingletonItemModel);
schema.faction = new fields.EmbeddedDataField(SingletonItemModel);
schema.influence = new fields.NumberField({min : 0, initial : 0});
schema.influence = new fields.NumberField({initial : 0});
schema.cost = new fields.NumberField({min : 0, initial : 0});
schema.keywords = new fields.ArrayField(new fields.StringField());
schema.attributes = Attributes();
Expand Down
4 changes: 1 addition & 3 deletions scripts/model/item/components/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class BaseItemModel extends foundry.abstract.DataModel
data.traits = {list : data.traits};
}

if (hasProperty(data, "dn") && hasProperty(data, "type") && hasProperty(data, "specification"))
if (!data.test && hasProperty(data, "dn") && hasProperty(data, "type") && hasProperty(data, "specification"))
{
data.test = {
dn : data.dn,
Expand Down Expand Up @@ -135,8 +135,6 @@ export class BaseItemModel extends foundry.abstract.DataModel
data.damage.otherDamage = data.otherDamage;
delete data.otherDamage;
}

delete data.ed;
}
}

Expand Down
1 change: 0 additions & 1 deletion scripts/sheet/actor/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ export class BaseWnGActorSheet extends ActorSheet {
test = await this.actor.setupAbilityRoll(item)

await test.rollTest();
test.sendToChat()
}
else
this._dropdownRightClick(ev)
Expand Down
1 change: 0 additions & 1 deletion scripts/sheet/actor/standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export class StandardActorSheet extends BaseWnGActorSheet {
test = await this.actor.setupAbilityRoll(item)

await test.rollTest();
test.sendToChat()
}
else
this._dropdownRightClick(ev)
Expand Down
2 changes: 1 addition & 1 deletion static/template/actor/vehicle.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<div class="man">
<label>{{localize "HEADER.MAN"}}</label>
<input type="number" value="{{system.mnvr}}" name="system.combat.mnvr" />
<input type="number" value="{{system.mnvr}}" name="system.mnvr" />
</div>
<div class="resilience">
<label>{{localize "HEADER.RESILIENCE"}}</label>
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name" : "wrath-and-glory",
"title": "Warhammer 40,000: Wrath & Glory",
"description": "The official system for Warhammer 40,000 Roleplay: Wrath & Glory! Time is running out in the 41st Millennium. This accursed age needs heroes more than ever before. Will you answer the call?",
"version": "5.1.4",
"version": "5.1.5",
"minimumCoreVersion" : 11,
"compatibility" : {
"minimum" : 11,
Expand Down Expand Up @@ -55,7 +55,7 @@
"url": "https://github.com/moo-man/WrathAndGlory-FoundryVTT",
"socket": true,
"manifest": "https://github.com/moo-man/WrathAndGlory-FoundryVTT/releases/latest/download/system.json",
"download": "https://github.com/moo-man/WrathAndGlory-FoundryVTT/releases/download/5.1.4/wrath-and-glory.zip",
"download": "https://github.com/moo-man/WrathAndGlory-FoundryVTT/releases/download/5.1.5/wrath-and-glory.zip",
"license": "LICENSE.txt"
}

0 comments on commit a66f3e3

Please sign in to comment.