fixes for banish

This commit is contained in:
Mike Bloy 2024-05-13 18:29:54 -05:00
parent b5b0ad01f6
commit f962ee785e
4 changed files with 56 additions and 74 deletions

View File

@ -29,58 +29,40 @@ export class BanishEffect extends PowerEffect {
return true; return true;
} }
get menuInputs() { get modifiers() {
const inputs = super.menuInputs; const mods = super.modifiers;
inputs.push({ mods.push({
type: 'select', type: 'select',
label: '⭐ Area of Effect', default: 'none',
options: [ name: 'Area of Effect',
{ html: 'None', value: 0, selected: true }, id: 'aoe',
{ html: 'Small Blast Template (+1)', value: 1, selected: false }, epic: true,
{ html: 'Medium Blast Template (+2)', value: 2, selected: false }, choices: {
{ html: 'Large Blast Template (+3)', value: 3, selected: false }, none: 'None',
], sbt: 'Small Blast Template',
mbt: 'Medium Blast Template',
lbt: 'Large Blast Template',
},
effects: { none: null, sbt: null, mbt: null, lbt: null },
values: { none: 0, sbt: 1, mbt: 2, lbt: 3 },
}); });
return inputs; return mods;
}
get powerPoints() {
let total = super.powerPoints;
total += this.data.aoe;
return total;
} }
get description() { get description() {
return ( return (
super.description + super.description +
` `<p>An opposed roll of the caster's skill vs the target's Spirit.
<p>An opposed roll of the caster's skill vs the target's Spirit. <strong>Success:</strong> Shaken, <strong>each Raise:</strong> 1 Wound
<strong>Success:</strong> Shaken, <strong>each Raise:</strong> 1 Wound Incapacitation results in banishment to home plane.</p>`
Incapacitation results in banishment to home plane.</p>
`
); );
} }
get chatMessageEffects() { get chatMessageEffects() {
const list = super.chatMessageEffects; const list = super.chatMessageEffects;
switch (this.data.aoe) { if (this.data.aoe !== 'none') {
case 0: list.push(this.data.aoe.toUpperCase());
break;
case 1:
list.push('SBT');
break;
case 2:
list.push('MBT');
break;
case 3:
list.push('LBT');
break;
} }
return list; return list;
} }
async parseValues() {
await super.parseValues();
this.data.aoe = this.data.values.shift();
}
} }

View File

@ -12,7 +12,7 @@ export class PowerFormApplication extends FormApplication {
static get defaultOptions() { static get defaultOptions() {
return mergeObject(super.defaultOptions, { return mergeObject(super.defaultOptions, {
classes: ['sheet', 'mbSwadePowerEffectsForm'], classes: ['sheet', 'mbSwadeForm', 'mbSwadePowerEffectsForm'],
popOut: true, popOut: true,
template: templates['powerDialog.html'], template: templates['powerDialog.html'],
id: ['mbSwadePowerEffectsApplication'], id: ['mbSwadePowerEffectsApplication'],
@ -255,7 +255,6 @@ export class PowerEffect {
}, },
}, },
epic: false, epic: false,
effect: true,
}); });
if (this.isDamaging) { if (this.isDamaging) {
mods.push({ mods.push({
@ -297,7 +296,6 @@ export class PowerEffect {
default: 'none', default: 'none',
value: 1, value: 1,
epic: false, epic: false,
effect: true,
choices: { none: 'None', hinder: 'Hinder', hurry: 'Hurry' }, choices: { none: 'None', hinder: 'Hinder', hurry: 'Hurry' },
values: { none: 0, hinder: 1, hurry: 1 }, values: { none: 0, hinder: 1, hurry: 1 },
isGlobal: true, isGlobal: true,
@ -379,6 +377,7 @@ export class PowerEffect {
async applyEffect() { async applyEffect() {
await this.parseValues(); await this.parseValues();
await this.apply(); await this.apply();
await this.chatMessage();
await this.sideEffects(); await this.sideEffects();
} }
@ -532,7 +531,7 @@ export class PowerEffect {
list.push('Different Trapping (Adaptable Caster)'); list.push('Different Trapping (Adaptable Caster)');
} }
if (this.data.fatigue) { if (this.data.fatigue) {
list.push('Fatigue (applied to targets'); list.push('Fatigue (applied to targets)');
} }
if (this.data.heavyweapon) { if (this.data.heavyweapon) {
list.push('Heavy Weapon'); list.push('Heavy Weapon');

View File

@ -1,4 +1,5 @@
/* ---------------------------- */ .mbSwadeForm {
/* Sass */ label.checkbox {
/* This is your Sass entry file */ font-size: var(--font-size-14);
/* ---------------------------- */ }
}

View File

@ -1,4 +1,4 @@
<form class="flexcol"> <form class="flexcol"><!-- vim: set ft=handlebars: -->
<header class="sheet-header flexrow"> <header class="sheet-header flexrow">
<img src="{{icon}}" height="64" width="64" title="{{name}} Effect" alt=" " /> <img src="{{icon}}" height="64" width="64" title="{{name}} Effect" alt=" " />
<section class="flexcol"> <section class="flexcol">
@ -6,38 +6,38 @@
<p>Apply the affects of {{name}}.</p> <p>Apply the affects of {{name}}.</p>
</section> </section>
</header> </header>
{{#if targets.length}} {{#if basePowerPoints}}
<p> <p><strong>Base Power Points</strong>: {{basePowerPoints}}
<strong>Targets</strong>:
{{#each targets}}{{#if @index}}, {{/if}}{{this}}{{/each}}
{{#if recipients.cost}}
<br>(Additional Recipients {{recipients.cost}}pp each × {{recipients.count}} = {{recipients.total}})
{{/if}} {{/if}}
</p> {{#if targets.length}}
<p>
<strong>Targets</strong>:
{{#each targets}}{{#if @index}}, {{/if}}{{this}}{{/each}}
{{#if recipients.cost}}
<br>(Additional Recipients {{recipients.cost}}pp each × {{recipients.count}} = {{recipients.total}})
{{/if}}
</p>
{{/if}} {{/if}}
{{#each modifiers}} {{#each modifiers}}
<div class="form-group"> <div class="form-group">
{{#if isCheckbox}} {{#if isCheckbox}}
<input type="checkbox" name="{{id}}" {{checked default}} /> <label class="checkbox">
<label for="{{id}}"> <input type="checkbox" name="{{id}}" {{checked default}} />
{{#if epic}}⭐ {{/if}}{{name}} ({{numberFormat value decimals=0 sign=true}}) {{#if epic}}⭐ {{/if}}{{name}} ({{numberFormat value decimals=0 sign=true}})
</label> </label>
{{/if}} {{/if}}
{{#if isSelect}} {{#if isSelect}}
<label>{{#if epic}}⭐ {{/if}}{{name}}:</label> <label>{{#if epic}}⭐ {{/if}}{{name}}:</label>
<select name="{{id}}"> <select name="{{id}}">{{selectOptions choices selected=default}}</select>
{{selectOptions choices selected=default}} {{/if}}
</select> {{#if isRadio}}
{{/if}} <label>{{#if epic}}⭐ {{/if}}{{name}}:</label> {{radioBoxes id choices checked=default}}
{{#if isRadio}} {{/if}}
<label>{{#if epic}}⭐ {{/if}}{{name}}:</label> </div>
{{radioBoxes id choices checked=default}}
{{/if}}
</div>
{{/each}} {{/each}}
<footer class="sheet-footer flexrow"> <footer class="sheet-footer flexrow">
{{#each buttons}} {{#each buttons}}
<button type="submit" name="submit" value="{{value}}">{{label}}</button> <button type="submit" name="submit" value="{{value}}">{{label}}</button>
{{/each}} {{/each}}
</footer> </footer>
</form> </form>