Added immunity for hidden and SRD additions for immunity

This commit is contained in:
WBHarry 2025-11-22 23:23:24 +01:00
parent 397879d39d
commit f810653059
10 changed files with 131 additions and 21 deletions

View file

@ -2728,7 +2728,8 @@
"rightClickExtand": "Right-Click to extand", "rightClickExtand": "Right-Click to extand",
"companionPartnerLevelBlock": "The companion needs an assigned partner to level up.", "companionPartnerLevelBlock": "The companion needs an assigned partner to level up.",
"configureAttribution": "Configure Attribution", "configureAttribution": "Configure Attribution",
"deleteItem": "Delete Item" "deleteItem": "Delete Item",
"immune": "Immune"
} }
} }
} }

View file

@ -33,7 +33,10 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
: context.canToggleCombat; : context.canToggleCombat;
context.systemStatusEffects = Object.keys(context.statusEffects).reduce((acc, key) => { context.systemStatusEffects = Object.keys(context.statusEffects).reduce((acc, key) => {
const effect = context.statusEffects[key]; const effect = context.statusEffects[key];
if (effect.systemEffect) acc[key] = effect; if (effect.systemEffect) {
const disabled = !effect.isActive && this.actor.system.rules.conditionImmunities[key];
acc[key] = { ...effect, disabled };
}
return acc; return acc;
}, {}); }, {});

View file

@ -59,8 +59,9 @@ export default class DhpAdversary extends BaseDataActor {
}), }),
rules: new fields.SchemaField({ rules: new fields.SchemaField({
conditionImmunities: new fields.SchemaField({ conditionImmunities: new fields.SchemaField({
vulnerable: new fields.BooleanField({ initial: false }), hidden: new fields.BooleanField({ initial: false }),
restrained: new fields.BooleanField({ initial: false }) restrained: new fields.BooleanField({ initial: false }),
vulnerable: new fields.BooleanField({ initial: false })
}) })
}), }),
attack: new ActionField({ attack: new ActionField({

View file

@ -284,8 +284,9 @@ export default class DhCharacter extends BaseDataActor {
}) })
}), }),
conditionImmunities: new fields.SchemaField({ conditionImmunities: new fields.SchemaField({
vulnerable: new fields.BooleanField({ initial: false }), hidden: new fields.BooleanField({ initial: false }),
restrained: new fields.BooleanField({ initial: false }) restrained: new fields.BooleanField({ initial: false }),
vulnerable: new fields.BooleanField({ initial: false })
}), }),
runeWard: new fields.BooleanField({ initial: false }), runeWard: new fields.BooleanField({ initial: false }),
burden: new fields.SchemaField({ burden: new fields.SchemaField({

View file

@ -53,8 +53,9 @@ export default class DhCompanion extends BaseDataActor {
), ),
rules: new fields.SchemaField({ rules: new fields.SchemaField({
conditionImmunities: new fields.SchemaField({ conditionImmunities: new fields.SchemaField({
vulnerable: new fields.BooleanField({ initial: false }), hidden: new fields.BooleanField({ initial: false }),
restrained: new fields.BooleanField({ initial: false }) restrained: new fields.BooleanField({ initial: false }),
vulnerable: new fields.BooleanField({ initial: false })
}) })
}), }),
attack: new ActionField({ attack: new ActionField({

View file

@ -239,7 +239,59 @@
}, },
"_id": "m6uPm4vujrUjSFPw", "_id": "m6uPm4vujrUjSFPw",
"img": "icons/magic/air/fog-gas-smoke-blue-gray.webp", "img": "icons/magic/air/fog-gas-smoke-blue-gray.webp",
"effects": [], "effects": [
{
"name": "Levitation",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "k6iaQVfMZhrpwYQj",
"img": "icons/magic/air/fog-gas-smoke-blue-gray.webp",
"changes": [
{
"key": "system.rules.conditionImmunities.restrained",
"mode": 5,
"value": "1",
"priority": null
}
],
"disabled": false,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<p>The Skull levitates several feet off the ground and cant be <em>Restrained</em>.</p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null,
"duplicateSource": null,
"exportSource": null,
"coreVersion": "13.351",
"systemId": "daggerheart",
"systemVersion": "1.2.4",
"createdTime": 1763845938979,
"modifiedTime": 1763846023794,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
},
"_key": "!actors.items.effects!jDmHqGvzg5wjgmxE.m6uPm4vujrUjSFPw.k6iaQVfMZhrpwYQj"
}
],
"folder": null, "folder": null,
"sort": 0, "sort": 0,
"ownership": { "ownership": {

View file

@ -355,7 +355,14 @@
"range": "melee" "range": "melee"
} }
}, },
"changes": [], "changes": [
{
"key": "system.rules.conditionImmunities.hidden",
"mode": 5,
"value": "1",
"priority": null
}
],
"disabled": false, "disabled": false,
"duration": { "duration": {
"startTime": null, "startTime": null,
@ -366,7 +373,7 @@
"startRound": null, "startRound": null,
"startTurn": null "startTurn": null
}, },
"description": "<p> You Glow until the end of the scene and cant become <em>Hidden</em>. Attack rolls made against you have advantage.</p>", "description": "<p>You Glow until the end of the scene and cant become <em>Hidden</em>. Attack rolls made against you have advantage.</p>",
"tint": "#ffffff", "tint": "#ffffff",
"statuses": [], "statuses": [],
"sort": 0, "sort": 0,
@ -375,12 +382,12 @@
"compendiumSource": null, "compendiumSource": null,
"duplicateSource": null, "duplicateSource": null,
"exportSource": null, "exportSource": null,
"coreVersion": "13.346", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "0.0.1", "systemVersion": "0.0.1",
"createdTime": 1754079525282, "createdTime": 1754079525282,
"modifiedTime": 1754079558712, "modifiedTime": 1763847816177,
"lastModifiedBy": "MQSznptE5yLT7kj8" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items.effects!8mJYMpbLTb8qIOrr.NepVGKOo1lHYjA1F.bYBrgiSwHwYfQyjn" "_key": "!actors.items.effects!8mJYMpbLTb8qIOrr.NepVGKOo1lHYjA1F.bYBrgiSwHwYfQyjn"
} }

View file

@ -122,6 +122,12 @@
"mode": 2, "mode": 2,
"value": "10", "value": "10",
"priority": null "priority": null
},
{
"key": "system.rules.conditionImmunities.restrained",
"mode": 5,
"value": "1",
"priority": null
} }
], ],
"disabled": false, "disabled": false,
@ -134,7 +140,7 @@
"startRound": null, "startRound": null,
"startTurn": null "startTurn": null
}, },
"description": "<ul><li><p><span class=\"vertical-card-list\" style=\"box-sizing:border-box;margin:0px 0px 0.25rem;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);font-family:Montserrat, sans-serif\">When you succeed on an attack or Spellcast Roll, gain a +10 bonus to the damage roll.</p></li><li><p><span class=\"vertical-card-list\" style=\"box-sizing:border-box;margin:0px 0px 0.25rem;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);font-family:Montserrat, sans-serif\">When you deal enough damage to defeat a creature within Close range, you absorb them and clear an Armor Slot.</p></li><li><p><span class=\"vertical-card-list\" style=\"box-sizing:border-box;margin:0px 0px 0.25rem;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);font-family:Montserrat, sans-serif\">You cant be <em style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0)\">Restrained</em>.</p></li><li><p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">Before you make an action roll, you must </span><span style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">spend a Hope</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">. If you cant, you revert to your normal form.</p></li></ul>", "description": "<ul><li><p><span class=\"vertical-card-list\" style=\"box-sizing:border-box;margin:0px 0px 0.25rem;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);font-family:Montserrat, sans-serif\">When you succeed on an attack or Spellcast Roll, gain a +10 bonus to the damage roll.</span></p></li><li><p><span class=\"vertical-card-list\" style=\"box-sizing:border-box;margin:0px 0px 0.25rem;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);font-family:Montserrat, sans-serif\">When you deal enough damage to defeat a creature within Close range, you absorb them and clear an Armor Slot.</span></p></li><li><p><span class=\"vertical-card-list\" style=\"box-sizing:border-box;margin:0px 0px 0.25rem;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);font-family:Montserrat, sans-serif\">You cant be <em style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0)\">Restrained</em>.</span></p></li><li><p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">Before you make an action roll, you must </span><span style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">spend a Hope</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">. If you cant, you revert to your normal form.</span></p></li></ul>",
"tint": "#ffffff", "tint": "#ffffff",
"statuses": [], "statuses": [],
"sort": 0, "sort": 0,
@ -143,12 +149,12 @@
"compendiumSource": null, "compendiumSource": null,
"duplicateSource": null, "duplicateSource": null,
"exportSource": null, "exportSource": null,
"coreVersion": "13.346", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "0.0.1", "systemVersion": "0.0.1",
"createdTime": 1754120504134, "createdTime": 1754120504134,
"modifiedTime": 1754340362524, "modifiedTime": 1763846303087,
"lastModifiedBy": "Q9NoTaEarn3VMS6Z" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!items.effects!LzVpMkD5I4QeaIHf.ptBC882plZW39Ld9" "_key": "!items.effects!LzVpMkD5I4QeaIHf.ptBC882plZW39Ld9"
} }

View file

@ -1,6 +1,18 @@
.theme-light .daggerheart.placeable-hud { .theme-light .daggerheart.placeable-hud {
.status-effects .effect-control { .status-effects {
filter: none; .effect-control {
filter: none;
}
.effect-control-container {
.effect-control {
filter: none;
}
.effect-control-disabled-marker {
color: @red;
}
}
} }
} }
@ -21,4 +33,25 @@
} }
} }
} }
.status-effects {
.effect-control-container {
position: relative;
.effect-control-disabled-marker {
position: absolute;
height: 100%;
width: 100%;
top: -1px;
left: 1px;
color: @medium-red;
font-weight: 700;
font-size: 2.1em;
rotate: 29deg;
display: flex;
align-items: center;
justify-content: center;
}
}
}
} }

View file

@ -46,7 +46,12 @@
</button> </button>
<div class="palette status-effects" data-palette="effects"> <div class="palette status-effects" data-palette="effects">
{{#each systemStatusEffects as |status|}} {{#each systemStatusEffects as |status|}}
<img class="effect-control {{status.cssClass}}" src="{{status.src}}" data-action="effect" data-status-id="{{status.id}}" {{#if status.title}}data-tooltip-text="{{status.title}}"{{/if}}> <div class="effect-control-container" {{#if status.disabled}}data-tooltip="{{localize "DAGGERHEART.UI.Tooltip.immune"}}"{{/if}}>
<img class="effect-control {{status.cssClass}} {{#if status.disabled}}disabled{{/if}}" src="{{status.src}}" data-action="effect" data-status-id="{{status.id}}" {{#if status.title}}data-tooltip-text="{{status.title}}"{{/if}}>
{{#if status.disabled}}
<span class="effect-control-disabled-marker">/</span>
{{/if}}
</div>
{{/each}} {{/each}}
{{#if genericStatusEffects}} {{#if genericStatusEffects}}
<label class="palette-category-title">{{localize "DAGGERHEART.APPLICATIONS.HUD.tokenHUD.genericEffects"}}</label> <label class="palette-category-title">{{localize "DAGGERHEART.APPLICATIONS.HUD.tokenHUD.genericEffects"}}</label>