Merge branch 'dev' into 'dev'
apply incapacitated if character's fatigue goes beyond endurance, simplify... See merge request teaml5r/l5r5e!46
This commit is contained in:
@@ -130,9 +130,14 @@ export class ActorL5r5e extends Actor {
|
|||||||
if (this.isCharacterType) {
|
if (this.isCharacterType) {
|
||||||
// apply compromised condition if strife goes beyond max
|
// apply compromised condition if strife goes beyond max
|
||||||
const strife = changes.system?.strife?.value ?? this.system.strife.value;
|
const strife = changes.system?.strife?.value ?? this.system.strife.value;
|
||||||
const maxStrife = changes.system?.strife?.max ?? this.system.strife.max;
|
const isCompromised = strife > this.system.composure;
|
||||||
const isCompromised = strife > maxStrife;
|
// apply incapacitated if fatigue goes beyond max endurance
|
||||||
await this.toggleStatusEffect('compromised', {active: isCompromised});
|
const fatigue = changes.system?.fatigue?.value ?? this.system.fatigue.value;
|
||||||
|
const isIncapacitated = fatigue > this.system.endurance;
|
||||||
|
await Promise.all([
|
||||||
|
this.toggleStatusEffect('compromised', {active: isCompromised}),
|
||||||
|
this.toggleStatusEffect('incapacitated', {active: isIncapacitated}),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user