159 - Companion (#224)

* Initial datamodel

* Fixed attack

* Temp

* Fixed normal levelup

* Fixed showing summary of new experiences

* Touchups

* level sync fixes

* Reworked Action storage

* Companions now take stress when damaged

* Fixed Feature flow

* Removed retroactive companion levelup

* Restored delevel on partner removal

* PR fixes

* Added a check for card duplicates on character
This commit is contained in:
WBHarry 2025-07-01 17:19:41 +02:00 committed by GitHub
parent 6f1529fefe
commit b7e4169079
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1682 additions and 1012 deletions

View file

@ -25,17 +25,20 @@ export class DHActionRollData extends foundry.abstract.DataModel {
initial: 'above',
label: 'Should be'
}),
treshold: new fields.NumberField({ initial: 1, integer: true, min: 1, label: 'Treshold' }),
treshold: new fields.NumberField({ initial: 1, integer: true, min: 1, label: 'Treshold' })
})
};
}
getFormula() {
if(!this.type) return;
if (!this.type) return;
let formula = '';
switch (this.type) {
case 'diceSet':
const multiplier = this.diceRolling.multiplier === 'flat' ? this.diceRolling.flatMultiplier : `@${this.diceRolling.multiplier}`;
const multiplier =
this.diceRolling.multiplier === 'flat'
? this.diceRolling.flatMultiplier
: `@${this.diceRolling.multiplier}`;
formula = `${multiplier}${this.diceRolling.dice}cs${SYSTEM.ACTIONS.diceCompare[this.diceRolling.compare].operator}${this.diceRolling.treshold}`;
break;
default:
@ -75,9 +78,7 @@ export class DHActionDiceData extends foundry.abstract.DataModel {
: `${multiplier ?? 1}${this.dice}${this.bonus ? (this.bonus < 0 ? ` - ${Math.abs(this.bonus)}` : ` + ${this.bonus}`) : ''}`; */
const multiplier = this.multiplier === 'flat' ? this.flatMultiplier : `@${this.multiplier}`,
bonus = this.bonus ? (this.bonus < 0 ? ` - ${Math.abs(this.bonus)}` : ` + ${this.bonus}`) : '';
return this.custom.enabled
? this.custom.formula
: `${multiplier ?? 1}${this.dice}${bonus}`;
return this.custom.enabled ? this.custom.formula : `${multiplier ?? 1}${this.dice}${bonus}`;
}
}
@ -105,9 +106,12 @@ export class DHDamageData extends foundry.abstract.DataModel {
nullable: false,
required: true
}),
resultBased: new fields.BooleanField({ initial: false, label: "DAGGERHEART.Actions.Settings.ResultBased.label" }),
resultBased: new fields.BooleanField({
initial: false,
label: 'DAGGERHEART.Actions.Settings.ResultBased.label'
}),
value: new fields.EmbeddedDataField(DHActionDiceData),
valueAlt: new fields.EmbeddedDataField(DHActionDiceData),
valueAlt: new fields.EmbeddedDataField(DHActionDiceData)
};
}
}