Skip to content

Commit fd0d28f

Browse files
authored
Condition Tweaks (#2507)
* fix blinded and deafened going off the same round they were applied * automatic roll dialog to remove Stunned at the end of round * automatic roll dialog for Fear Extended Test at the end of round
1 parent fa8b504 commit fd0d28f

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

src/system/combat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export default class CombatHelpersWFRP {
288288
for (let cond of conditions) {
289289
// I swear to god whoever thought it was a good idea for these conditions to reduce every *other* round...
290290
if (cond.conditionId == "deafened" || cond.conditionId == "blinded" && Number.isNumeric(cond.flags.wfrp4e.roundReceived)) {
291-
if ((combat.round - 1) % 2 == cond.flags.wfrp4e.roundReceived % 2) {
291+
if ((combat.round) % 2 == cond.flags.wfrp4e.roundReceived % 2) {
292292
await turn.actor.removeCondition(cond.conditionId)
293293
removedConditions.push(
294294
game.i18n.format("CHAT.RemovedConditions", {

src/system/config-wfrp4e.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,18 @@ WFRP4E.PrepareSystemItems = function() {
13431343
this.item.updateSource({name : this.item.name + " (" + name + ")" })
13441344
}
13451345
`
1346+
},
1347+
{
1348+
trigger: "endRound",
1349+
label: "Roll to remove Fear",
1350+
script: `
1351+
const test = await this.actor.setupExtendedTest(this.effect.item, {
1352+
fields: {difficulty: "challenging"},
1353+
skipTargets: true,
1354+
appendTitle : \` - \${this.effect.name}\`,
1355+
});
1356+
await test.roll();
1357+
`,
13461358
}
13471359
]
13481360
}
@@ -2101,7 +2113,19 @@ WFRP4E.PrepareSystemItems = function() {
21012113
trigger: "prePrepareData",
21022114
label: "Half Movement",
21032115
script: `args.actor.system.details.move.value /= 2`
2104-
}
2116+
},
2117+
{
2118+
trigger: "endRound",
2119+
label: "Roll to remove Stunned",
2120+
script: `
2121+
const test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty: "challenging"}, skipTargets: true, appendTitle : \` - \${this.effect.name}\`, context: {success: "Removed SL + 1 Conditions.", failure: "Failed to remove Conditions."}});
2122+
await test.roll();
2123+
if (test.succeeded) {
2124+
const toRemove = 1 + Number(test.result.SL);
2125+
this.actor.removeCondition("stunned", toRemove);
2126+
}
2127+
`,
2128+
},
21052129
// { // Not sure what to do about this
21062130
// trigger: "dialog",
21072131
// label : "Bonus to Melee Attacks",

0 commit comments

Comments
 (0)