add deflection

This commit is contained in:
Mike Bloy 2024-05-15 21:35:22 -05:00
parent 57caeccad2
commit 8c373fcc8b
2 changed files with 59 additions and 57 deletions

View File

@ -0,0 +1,58 @@
import { PowerEffect } from './basePowers.js';
export class DeflectionEffect extends PowerEffect {
get name() {
return 'Deflection';
}
get icon() {
return 'icons/magic/defensive/shield-barrier-deflect-teal.webp';
}
get duration() {
return 5;
}
get basePowerPoints() {
return 2;
}
get isTargeted() {
return true;
}
get hasAdditionalRecipients() {
return true;
}
get additionalRecipientCost() {
return 1;
}
get menuButtons() {
const data = [
{ label: 'Melee', value: 'melee' },
{ label: 'Ranged', value: 'ranged' },
{ label: 'Raise (both)', value: 'raise' },
{ label: 'Cancel', value: 'cancel' },
];
return data;
}
async parseValues() {
await super.parseValues();
this.data.affects = this.data.button === 'raise' ? 'all' : this.data.button;
}
get effectName() {
return `Deflection (${this.data.affects})`;
}
get description() {
return (
super.description +
`<p>Attackers subtract -2 from ${this.data.affects}
attacks when targeting this creature.</p>`
);
}
}

View File

@ -15,63 +15,7 @@ import { ConfusionEffect } from './confusion.js';
import { CurseEffect } from './curse.js';
import { DamageFieldEffect } from './damageField.js';
import { DarksightEffect } from './darksight.js';
class DeflectionEffect extends PowerEffect {
get name() {
return 'Deflection';
}
get icon() {
return 'icons/magic/defensive/shield-barrier-deflect-teal.webp';
}
get duration() {
return 5;
}
get basePowerPoints() {
return 2;
}
get isTargeted() {
return true;
}
get hasAdditionalRecipients() {
return true;
}
get additionalRecipientCost() {
return 1;
}
get menuButtons() {
const data = [
{ label: 'Melee', value: 'melee' },
{ label: 'Ranged', value: 'vulnerable' },
{ label: 'Raise (both)', value: 'raise' },
{ label: 'Cancel', value: 'cancel' },
];
return data;
}
async parseValues() {
await super.parseValues();
this.data.affects = this.data.button === 'raise' ? 'all' : this.data.button;
}
get effectName() {
return `Deflection (${this.data.affects})`;
}
get description() {
return (
super.description +
`<p>Attackers subtract -2 from ${this.data.affects}
attacks when targeting this creature.</p>`
);
}
}
import { DeflectionEffect } from './deflection.js';
class DetectConcealArcanaEffect extends PowerEffect {
get name() {