Skip to content

Commit 42d8431

Browse files
committed
Fix end combat reminders not showing
close #2732
1 parent a42a208 commit 42d8431

2 files changed

Lines changed: 35 additions & 28 deletions

File tree

src/system/combat.js

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -67,28 +67,6 @@ export default class CombatHelpersWFRP {
6767
}
6868
}
6969

70-
static async endCombat(combat) {
71-
if (!game.user.isUniqueGM)
72-
return
73-
74-
let content = ""
75-
let scriptResult = "";
76-
for (let script of CombatHelpersWFRP.scripts.endCombat) {
77-
scriptResult = await script(combat);
78-
if (scriptResult) {
79-
content += scriptResult + "<br><br>";
80-
}
81-
}
82-
if (content) {
83-
content = `<h2>${game.i18n.localize("CHAT.EndCombat")}</h3>` + content;
84-
ChatMessage.create({ content, whisper: ChatMessage.getWhisperRecipients("GM") })
85-
}
86-
for (let turn of combat.turns) {
87-
await Promise.all(turn.actor.runScripts("endCombat", {combat}, true));
88-
Hooks.callAll("wfrp4e:endCombat", combat);
89-
}
90-
}
91-
9270
static async checkFearTerror(combat) {
9371
if (!game.user.isUniqueGM)
9472
return
@@ -123,7 +101,7 @@ export default class CombatHelpersWFRP {
123101
msg += CombatHelpersWFRP.checkSizeFearTerror(combat)
124102

125103
if (msg)
126-
await ChatMessage.create(game.wfrp4e.utility.chatDataSetup(msg, "gmroll"))
104+
await ChatMessage.create(game.wfrp4e.utility.chatDataSetup(msg, "gmroll", false, {alias: "Fear & Terror"}))
127105
}
128106

129107
static checkSizeFearTerror(combat) {
@@ -220,7 +198,17 @@ export default class CombatHelpersWFRP {
220198
content += game.i18n.localize("CHAT.CorruptionTest");
221199
content += `<br>@Corruption[Minor]<br>@Corruption[Moderate]<br>@Corruption[Major]`
222200
}
223-
return content
201+
202+
if (content)
203+
{
204+
ChatMessage.implementation.create({
205+
content,
206+
speaker: {
207+
alias: "End Combat - Corruption"
208+
},
209+
whisper: ChatMessage.getWhisperRecipients("GM")
210+
})
211+
}
224212
}
225213

226214
static async checkInfection(combat) {
@@ -235,7 +223,16 @@ export default class CombatHelpersWFRP {
235223
content += `<br><b>${actor}</b>`
236224
}
237225
}
238-
return content
226+
if (content)
227+
{
228+
ChatMessage.implementation.create({
229+
content,
230+
speaker: {
231+
alias: "End Combat - Infections"
232+
},
233+
whisper: ChatMessage.getWhisperRecipients("GM")
234+
})
235+
}
239236
}
240237

241238
static async checkDiseases(combat) {
@@ -263,7 +260,17 @@ export default class CombatHelpersWFRP {
263260

264261
content += game.i18n.localize("CHAT.DiseasesRules");
265262
}
266-
return content
263+
264+
if (content)
265+
{
266+
ChatMessage.implementation.create({
267+
content,
268+
speaker: {
269+
alias: "End Combat - Diseases"
270+
},
271+
whisper: ChatMessage.getWhisperRecipients("GM")
272+
})
273+
}
267274
}
268275

269276
static async checkEndRoundConditions(combat) {

system.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "wfrp4e",
33
"title": "Warhammer Fantasy Roleplay 4th Edition",
44
"description": "A comprehensive system for running grim and perilous games of Warhammer Fantasy Roleplay in the Foundry VTT environment.",
5-
"version": "9.4.0",
5+
"version": "9.4.1",
66
"authors" : [
77
{
88
"name": "Moo Man",
@@ -72,6 +72,6 @@
7272
},
7373
"socket": true,
7474
"manifest" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/latest/download/system.json",
75-
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/9.4.0/wfrp4e.zip",
75+
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/9.4.1/wfrp4e.zip",
7676
"url" : "https://github.com/moo-man/WFRP4e-FoundryVTT"
7777
}

0 commit comments

Comments
 (0)