diff --git a/daggerheart.mjs b/daggerheart.mjs index 533691f5..6fb6cc40 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -43,7 +43,7 @@ Hooks.once('init', () => { ); CONFIG.statusEffects = [ - ...CONFIG.statusEffects, + ...CONFIG.statusEffects.filter(x => !['dead', 'unconscious'].includes(x.id)), ...Object.values(SYSTEM.GENERAL.conditions).map(x => ({ ...x, name: game.i18n.localize(x.name), diff --git a/lang/en.json b/lang/en.json index b9e0fefa..11afac01 100755 --- a/lang/en.json +++ b/lang/en.json @@ -559,9 +559,9 @@ "twoHanded": "Two-Handed" }, "Condition": { - "vulnerable": { - "name": "Vulnerable", - "description": "While a creature is Vulnerable, all rolls targeting them have advantage.\nA creature who is already Vulnerable can’t be made to take the condition again." + "dead": { + "name": "Dead", + "description": "The character is dead" }, "hidden": { "name": "Hidden", @@ -570,6 +570,14 @@ "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." + }, + "unconcious": { + "name": "Unconcious", + "description": "Your character can’t move or act while unconscious, they can’t 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 can’t be made to take the condition again." } }, "CountdownType": { diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 54430860..704a5401 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -110,6 +110,18 @@ export const conditions = { name: 'DAGGERHEART.CONFIG.Condition.restrained.name', icon: 'icons/magic/control/debuff-chains-shackle-movement-red.webp', 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' } }; diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index e25dba85..68901b35 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -407,7 +407,8 @@ export default class DhCharacter extends BaseDataActor { } prepareDerivedData() { - this.resources.hope.value = Math.min(this.resources.hope.value, this.resources.hope.max); + const baseHope = this.resources.hope.value + (this.companion?.system?.resources?.hope ?? 0); + this.resources.hope.value = Math.min(baseHope, this.resources.hope.max); } getRollData() { diff --git a/module/data/actor/companion.mjs b/module/data/actor/companion.mjs index 005d7a83..fc8195d8 100644 --- a/module/data/actor/companion.mjs +++ b/module/data/actor/companion.mjs @@ -60,8 +60,7 @@ export default class DhCompanion extends BaseDataActor { }, roll: { type: 'attack', - bonus: 0, - trait: 'instinct' + bonus: 0 }, damage: { parts: [ @@ -87,20 +86,12 @@ export default class DhCompanion extends BaseDataActor { }; } - get traits() { - return { - instinct: { value: this.attack.roll.bonus } - }; - } - get proficiency() { return this.partner?.system?.proficiency ?? 1; } prepareBaseData() { - const partnerSpellcastingModifier = this.partner?.system?.spellcastModifier; - const spellcastingModifier = this.partner?.system?.traits?.[partnerSpellcastingModifier]?.value; - this.attack.roll.bonus = spellcastingModifier ?? 0; // Needs to expand on which modifier it is that should be used because of multiclassing; + this.attack.roll.bonus = this.partner?.system?.spellcastModifier ?? 0; for (let levelKey in this.levelData.levelups) { const level = this.levelData.levelups[levelKey]; @@ -133,12 +124,6 @@ export default class DhCompanion extends BaseDataActor { } } - prepareDerivedData() { - if (this.partner) { - this.partner.system.resources.hope.max += this.resources.hope; - } - } - async _preDelete() { if (this.partner) { await this.partner.update({ 'system.companion': null }); diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index 004e4806..0c29fc42 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -130,9 +130,9 @@ export default class D20Roll extends DHRoll { value: this.options.roll.bonus }); - modifiers.push(...this.getBonus(`roll.${this.options.type}`, `${this.options.type.capitalize()} Bonus`)); + modifiers.push(...this.getBonus(`roll.${this.options.type}`, `${this.options.type?.capitalize()} Bonus`)); modifiers.push( - ...this.getBonus(`roll.${this.options.roll.type}`, `${this.options.roll.type.capitalize()} Bonus`) + ...this.getBonus(`roll.${this.options.roll.type}`, `${this.options.roll.type?.capitalize()} Bonus`) ); return modifiers; diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index 27288f15..33de251b 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -190,7 +190,12 @@ export const registerRollDiceHooks = () => { if (config.roll.isCritical) updates.push({ key: 'stress', value: -1 }); if (config.roll.result.duality === -1) updates.push({ key: 'fear', value: 1 }); - if (updates.length) actor.modifyResource(updates); + if (updates.length) { + const target = actor.system.partner ?? actor; + if (!['dead', 'unconcious'].some(x => actor.statuses.has(x))) { + target.modifyResource(updates); + } + } if (!config.roll.hasOwnProperty('success') && !config.targets?.length) return;