mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Feature] Become Unstoppable (#1321)
* Added implementation of unstoppable * Forgot to add the updated Unstoppable Feature itself * Added immunity for hidden and SRD additions for immunity
This commit is contained in:
parent
e6a242ba43
commit
b9508e19e8
45 changed files with 502 additions and 122 deletions
|
|
@ -47,6 +47,7 @@ export default class EffectsField extends fields.ArrayField {
|
|||
static async applyEffects(targets) {
|
||||
if (!this.effects?.length || !targets?.length) return;
|
||||
|
||||
const conditions = CONFIG.DH.GENERAL.conditions();
|
||||
let effects = this.effects;
|
||||
const messageTargets = [];
|
||||
targets.forEach(async baseToken => {
|
||||
|
|
@ -56,7 +57,20 @@ export default class EffectsField extends fields.ArrayField {
|
|||
const token =
|
||||
canvas.tokens.get(baseToken.id) ?? foundry.utils.fromUuidSync(baseToken.actorId).prototypeToken;
|
||||
if (!token) return;
|
||||
messageTargets.push(token.document ?? token);
|
||||
|
||||
const messageToken = token.document ?? token;
|
||||
const conditionImmunities = messageToken.actor.system.rules.conditionImmunities ?? {};
|
||||
messageTargets.push({
|
||||
token: messageToken,
|
||||
conditionImmunities: Object.values(conditionImmunities).some(x => x)
|
||||
? game.i18n.format('DAGGERHEART.UI.Chat.effectSummary.immunityTo', {
|
||||
immunities: Object.keys(conditionImmunities)
|
||||
.filter(x => conditionImmunities[x])
|
||||
.map(x => game.i18n.localize(conditions[x].name))
|
||||
.join(', ')
|
||||
})
|
||||
: null
|
||||
});
|
||||
|
||||
effects.forEach(async e => {
|
||||
const effect = this.item.effects.get(e._id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue