Added ActiveEffects to Beastbound features

This commit is contained in:
WBHarry 2026-01-19 22:42:43 +01:00
parent bd5ef8e8d7
commit 0660939cec
5 changed files with 108 additions and 13 deletions

View file

@ -725,17 +725,14 @@ export default class DhCharacter extends BaseDataActor {
};
}
}
}
_onUpdate(changes, options, userId) {
super._onUpdate(changes, options, userId);
if (game.user.id === userId) {
/* Companion updates */
if (this.companion) {
if (changes.system.levelData?.level?.current !== undefined) {
this.companion.update(this.companion.toObject(), { diff: false, recursive: false });
}
/* Force companion data prep */
if (this.companion) {
if (
changes.system?.levelData?.level?.current !== undefined &&
changes.system.levelData.level.current !== this._source.levelData.level.current
) {
this.companion.update(this.companion.toObject(), { diff: false, recursive: false });
}
}
}

View file

@ -177,6 +177,16 @@ export default class DhCompanion extends BaseDataActor {
changes.system.experiences[experience].core = true;
}
}
/* Force partner data prep */
if (this.partner) {
if (
changes.system?.levelData?.level?.current !== undefined &&
changes.system.levelData.level.current !== this._source.levelData.level.current
) {
this.partner.update(this.partner.toObject(), { diff: false, recursive: false });
}
}
}
async _preDelete() {

View file

@ -16,7 +16,51 @@
"artist": ""
}
},
"effects": [],
"effects": [
{
"name": "Advanced Training",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "bKOuMxhB2Jth3j2T",
"img": "icons/creatures/mammals/wolf-howl-moon-gray.webp",
"changes": [
{
"key": "system.companionData.levelupChoices",
"mode": 2,
"value": "2",
"priority": null
}
],
"disabled": false,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<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.565);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">Choose two additional level-up options for your companion.</span></p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!uGcs785h94RMtueH.bKOuMxhB2Jth3j2T"
}
],
"sort": 0,
"ownership": {
"default": 0,

View file

@ -16,7 +16,51 @@
"artist": ""
}
},
"effects": [],
"effects": [
{
"name": "Expert Training",
"type": "base",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "rknTONvaUDZ2Yz1W",
"img": "icons/creatures/mammals/dog-husky-white-blue.webp",
"changes": [
{
"key": "system.companionData.levelupChoices",
"mode": 2,
"value": "1",
"priority": null
}
],
"disabled": false,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
},
"description": "<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.565);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">Choose an additional level-up option for your companion.</span></p>",
"origin": null,
"tint": "#ffffff",
"transfer": true,
"statuses": [],
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!iCXtOWBKv1FdKdWz.rknTONvaUDZ2Yz1W"
}
],
"sort": 0,
"ownership": {
"default": 0,

View file

@ -41,7 +41,7 @@
</button>
{{/if}}
<span {{#unless document.system.partner}}data-tooltip="{{localize "DAGGERHEART.UI.Tooltip.companionPartnerLevelBlock"}}"{{/unless}}>
{{document.system.levelData.level.current}}
{{document.system.levelData.level.changed}}
</span>
</div>
</h3>