Added Dead/Unconcious

This commit is contained in:
WBHarry 2025-07-16 01:53:23 +02:00
parent b75c83b5fe
commit 6d30c17457
4 changed files with 27 additions and 5 deletions

View file

@ -43,7 +43,7 @@ Hooks.once('init', () => {
); );
CONFIG.statusEffects = [ CONFIG.statusEffects = [
...CONFIG.statusEffects, ...CONFIG.statusEffects.filter(x => !['dead', 'unconscious'].includes(x.id)),
...Object.values(SYSTEM.GENERAL.conditions).map(x => ({ ...Object.values(SYSTEM.GENERAL.conditions).map(x => ({
...x, ...x,
name: game.i18n.localize(x.name), name: game.i18n.localize(x.name),

View file

@ -559,9 +559,9 @@
"twoHanded": "Two-Handed" "twoHanded": "Two-Handed"
}, },
"Condition": { "Condition": {
"vulnerable": { "dead": {
"name": "Vulnerable", "name": "Dead",
"description": "While a creature is Vulnerable, all rolls targeting them have advantage.\nA creature who is already Vulnerable cant be made to take the condition again." "description": "The character is dead"
}, },
"hidden": { "hidden": {
"name": "Hidden", "name": "Hidden",
@ -570,6 +570,14 @@
"restrained": { "restrained": {
"name": "Restrained", "name": "Restrained",
"description": "When an effect makes a creature Restrained, it means they cannot move until this condition is cleared.\nThey can still take actions from their current position." "description": "When an effect makes a creature Restrained, it means they cannot move until this condition is cleared.\nThey can still take actions from their current position."
},
"unconcious": {
"name": "Unconcious",
"description": "Your character cant move or act while unconscious, they cant be targeted by an attack."
},
"vulnerable": {
"name": "Vulnerable",
"description": "While a creature is Vulnerable, all rolls targeting them have advantage.\nA creature who is already Vulnerable cant be made to take the condition again."
} }
}, },
"CountdownType": { "CountdownType": {

View file

@ -110,6 +110,18 @@ export const conditions = {
name: 'DAGGERHEART.CONFIG.Condition.restrained.name', name: 'DAGGERHEART.CONFIG.Condition.restrained.name',
icon: 'icons/magic/control/debuff-chains-shackle-movement-red.webp', icon: 'icons/magic/control/debuff-chains-shackle-movement-red.webp',
description: 'DAGGERHEART.CONFIG.Condition.restrained.description' description: 'DAGGERHEART.CONFIG.Condition.restrained.description'
},
unconcious: {
id: 'unconcious',
name: 'DAGGERHEART.CONFIG.Condition.unconcious.name',
icon: 'icons/magic/control/sleep-bubble-purple.webp',
description: 'DAGGERHEART.CONFIG.Condition.unconcious.description'
},
dead: {
id: 'dead',
name: 'DAGGERHEART.CONFIG.Condition.dead.name',
icon: 'icons/magic/death/grave-tombstone-glow-teal.webp',
description: 'DAGGERHEART.CONFIG.Condition.dead.description'
} }
}; };

View file

@ -192,7 +192,9 @@ export const registerRollDiceHooks = () => {
if (updates.length) { if (updates.length) {
const target = actor.system.partner ?? actor; const target = actor.system.partner ?? actor;
target.modifyResource(updates); if (!['dead', 'unconcious'].some(x => actor.statuses.has(x))) {
target.modifyResource(updates);
}
} }
if (!config.roll.hasOwnProperty('success') && !config.targets?.length) return; if (!config.roll.hasOwnProperty('success') && !config.targets?.length) return;