[Feature] DeathMove Condition Improvement (#1562)

* Added DeathMove condition and automated changing to the correct condition depending on the result of death moves

* .

* Update module/data/settings/Automation.mjs

Co-authored-by: Chris Ryan <73275196+chrisryan10@users.noreply.github.com>

* Update lang/en.json

Co-authored-by: Chris Ryan <73275196+chrisryan10@users.noreply.github.com>

* Fixed DefeatedCondition localizations

---------

Co-authored-by: Chris Ryan <73275196+chrisryan10@users.noreply.github.com>
This commit is contained in:
WBHarry 2026-01-20 11:03:52 +01:00 committed by GitHub
parent 77bac647a8
commit cc998bffa7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 60 additions and 15 deletions

View file

@ -549,7 +549,18 @@ export default class DhCharacter extends BaseDataActor {
}
get deathMoveViable() {
return this.resources.hitPoints.max > 0 && this.resources.hitPoints.value >= this.resources.hitPoints.max;
const { characterDefault } = game.settings.get(
CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.Automation
).defeated;
const deathMoveOutcomeStatuses = Object.keys(CONFIG.DH.GENERAL.defeatedConditionChoices).filter(
key => key !== characterDefault
);
const deathMoveNotResolved = this.parent.statuses.every(status => !deathMoveOutcomeStatuses.includes(status));
const allHitPointsMarked =
this.resources.hitPoints.max > 0 && this.resources.hitPoints.value >= this.resources.hitPoints.max;
return deathMoveNotResolved && allHitPointsMarked;
}
get armorApplicableDamageTypes() {

View file

@ -58,7 +58,7 @@ export default class DhAutomation extends foundry.abstract.DataModel {
defeated: new fields.SchemaField({
enabled: new fields.BooleanField({
required: true,
initial: false,
initial: true,
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.enabled.label'
}),
overlay: new fields.BooleanField({
@ -69,7 +69,7 @@ export default class DhAutomation extends foundry.abstract.DataModel {
characterDefault: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.defeatedConditionChoices,
initial: CONFIG.DH.GENERAL.defeatedConditionChoices.unconscious.id,
initial: CONFIG.DH.GENERAL.defeatedConditionChoices.deathMove.id,
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.characterDefault.label'
}),
adversaryDefault: new fields.StringField({
@ -84,23 +84,29 @@ export default class DhAutomation extends foundry.abstract.DataModel {
initial: CONFIG.DH.GENERAL.defeatedConditionChoices.defeated.id,
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.companionDefault.label'
}),
deathMoveIcon: new fields.FilePathField({
initial: 'icons/magic/life/heart-cross-purple-orange.webp',
categories: ['IMAGE'],
base64: false,
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.deathMove.label'
}),
deadIcon: new fields.FilePathField({
initial: 'icons/magic/death/grave-tombstone-glow-teal.webp',
categories: ['IMAGE'],
base64: false,
label: 'Dead'
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.dead.label'
}),
defeatedIcon: new fields.FilePathField({
initial: 'icons/magic/control/fear-fright-mask-orange.webp',
categories: ['IMAGE'],
base64: false,
label: 'Defeated'
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.defeated.label'
}),
unconsciousIcon: new fields.FilePathField({
initial: 'icons/magic/control/sleep-bubble-purple.webp',
categories: ['IMAGE'],
base64: false,
label: 'Unconcious'
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.defeated.unconscious.label'
})
}),
roll: new fields.SchemaField({