Skip to content

Commit

Permalink
Merge pull request #165 from League-of-Fabulous-Developers/feature-sp…
Browse files Browse the repository at this point in the history
…ell-customizer

Feature spell customizer
  • Loading branch information
spyrella authored Oct 24, 2024
2 parents 439ab9a + c730065 commit 5d11779
Show file tree
Hide file tree
Showing 11 changed files with 401 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import { Flags } from '../../../../helpers/flags.mjs';
*/
export class ZeroPowerDataModel extends RollableOptionalFeatureDataModel {
static defineSchema() {
const { SchemaField, StringField, HTMLField, EmbeddedDataField } = foundry.data.fields;
const { SchemaField, StringField, HTMLField, EmbeddedDataField, BooleanField } = foundry.data.fields;
return {
progress: new EmbeddedDataField(ProgressDataModel, {}),
hasClock: new SchemaField({ value: new BooleanField({ initial: true }) }),
zeroTrigger: new SchemaField({
value: new StringField(),
description: new HTMLField(),
Expand Down
10 changes: 5 additions & 5 deletions module/helpers/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,18 @@ FU.statusEffects = {
'wlp-up': 'FU.WLPUp',
'dex-down': 'FU.DEXDown',
'dex-up': 'FU.DEXUp',
'ins-up': 'FU.INSUp',
'ins-down': 'FU.INSDown',
'mig-up': 'FU.MIGUp',
'ins-up': 'FU.INSUp',
'mig-down': 'FU.MIGDown',
'mig-up': 'FU.MIGUp',
};

FU.statusEffectRule = {
aura: 'FU.Aura',
barrier: 'FU.Barrier',
crisis: 'FU.Crisis',
cover: 'FU.Cover',
flying: 'FU.Flying',
crisis: 'FU.CrisisRule',
cover: 'FU.CoverRule',
flying: 'FU.FlyingRule',
guard: 'FU.GuardRule',
provoked: 'FU.Provoked',
slow: 'FU.SlowRule',
Expand Down
320 changes: 232 additions & 88 deletions module/helpers/item-customizer.mjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions module/helpers/statuses.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ export const statusEffects = [
mode: CONST.ACTIVE_EFFECT_MODES.CUSTOM,
value: 'upgrade',
},
{
key: 'system.bonuses.accuracy.opposedCheck',
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
value: '2',
},
],
},
{
Expand Down
2 changes: 2 additions & 0 deletions module/helpers/templates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export const preloadHandlebarsTemplates = async function () {

// Applications
'systems/projectfu/templates/app/item-customizer.hbs',
'systems/projectfu/templates/app/partials/customizer-weapon.hbs',
'systems/projectfu/templates/app/partials/customizer-spell.hbs',
'systems/projectfu/templates/app/app-group-check.hbs',
'systems/projectfu/templates/app/partials/inline-effect-config-modify-attribute.hbs',
'systems/projectfu/templates/app/partials/inline-effect-config-modify-affinity.hbs',
Expand Down
4 changes: 4 additions & 0 deletions module/sheets/actor-standard-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ export class FUStandardActorSheet extends ActorSheet {
if (statusEffect) {
const existing = this.actor.effects.some((e) => isActiveEffectForStatusEffectId(e, statusEffect.id));
const immune = this.actor.system.immunities?.[statusEffect.id]?.base || false;
const ruleKey = FU.statusEffectRule[statusEffect.id] || '';
const rule = game.i18n.localize(ruleKey);
const tooltip = `${game.i18n.localize(statusEffect.name)}<br>${rule}`;
context.statusEffectToggles.push({
...statusEffect,
active: existing,
immune: immune,
tooltip: tooltip,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion templates/actor/partials/actor-clocks.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{!-- Optional Feature Sections --}}
{{#each optionalFeatures}}
{{#each items }}
{{#if (and item.system.isFavored.value item.system.data.progress)}}
{{#if (and item.system.isFavored.value item.system.data.hasClock.value)}}
<li class="item flexcol" data-item-id="{{ item._id }}">
{{!-- Item Name--}}
<h4 class="click-item resource-content">
Expand Down
2 changes: 1 addition & 1 deletion templates/actor/partials/actor-resources.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{#each statusEffectToggles as |statusEffect|}}
<a class="status-effect-toggle {{#if statusEffect.active}}active{{/if}} {{#if statusEffect.immune}}immune{{/if}}"
data-status-id="{{statusEffect.id}}">
<img src="{{statusEffect.icon}}" data-tooltip="{{statusEffect.name}}">
<img src="{{statusEffect.icon}}" data-tooltip="{{statusEffect.tooltip}}">
</a>
{{/each}}
</div>
Expand Down
63 changes: 63 additions & 0 deletions templates/app/partials/customizer-spell.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<form>
<div style="font-weight: bold;">
<div class="desc mb-3">
<div id="base-item" class="inline-desc">{{{baseItemDetails}}}</div>
<div style="text-align: center;"><i class="fas fa-caret-down"></i></div>
<div id="current-item" class="inline-desc">{{{currentItemDetails}}}</div>
</div>

<div class="desc grid grid-2col gap-5 mb-5"><div class="inline-desc grid grid-2col gap-5 mb-5">
<div class="form-group">
<label>{{localize 'FU.Primary'}}</label>
<select id="primary" name="primary">{{{primaryOptions}}}</select>
</div>

<div class="form-group">
<label>{{localize 'FU.Secondary'}}</label>
<select id="secondary" name="secondary">{{{secondaryOptions}}}</select>
</div>
</div>

<div class="inline-desc grid grid-2col gap-5 mb-5">
<div class="row-one">
<div class="form-group">
<label>{{localize 'FU.AccuracyBonus'}}</label>
<input type="number" id="accuracy-mod" name="accuracy-mod" value="0" />
</div>

<div class="form-group">
<label>{{localize 'FU.DamageBonus'}}</label>
<input type="number" id="damage-mod" name="damage-mod" value="0" />
</div>
</div>

<div class="row-two">
<div class="form-group">
<label>{{localize 'FU.Spell'}}</label>
<select id="item-selector" name="item-selector">{{{spellOptions}}}</select>
</div>
<div class="form-group">
<label>{{localize 'FU.DamageType'}}</label>
<select id="damage-type" name="damage-type">{{{damageTypeOptions}}}</select>
</div>
<div class="grid grid-2col">
<div class="form-group">
<label>{{localize 'FU.HRZero'}}</label>
<input type="checkbox" id="hrzero" name="hrzero" />
</div>
<button type="button" class="reset-spell-button"><i class="fas fa-rotate-left"></i></button>
</div>
</div>

</div>
</div>
<hr>
<div class="form-buttons grid grid-2col gap-5">
<button type="button" class="modify-button"><i class="fas fa-pen-to-square icon"></i>{{localize
'FU.Modify'}}</button>
<button type="button" class="clone-button"><i class="fas fa-copy icon"></i>{{localize 'FU.Clone'}}</button>
<button type="button" class="temp-roll-button"><i class="fas fa-dice-d20 icon"></i>{{localize
'FU.TempRoll'}}</button>
<button type="button" class="cancel-button"><i class="fas fa-xmark icon"></i>{{localize 'FU.Cancel'}}</button>
</div>
</form>
74 changes: 74 additions & 0 deletions templates/app/partials/customizer-weapon.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<form>
<div style="font-weight: bold;">
<div class="desc mb-3">
<div id="base-item" class="inline-desc">{{{baseItemDetails}}}</div>
<div style="text-align: center;"><i class="fas fa-caret-down"></i></div>
<div id="current-item" class="inline-desc">{{{currentItemDetails}}}</div>
</div>

<div class="desc grid grid-2col gap-5 mb-5"><div class="inline-desc grid grid-2col gap-5 mb-5">
<div class="form-group">
<label>{{localize 'FU.Primary'}}</label>
<select id="primary" name="primary">{{{primaryOptions}}}</select>
</div>

<div class="form-group">
<label>{{localize 'FU.Secondary'}}</label>
<select id="secondary" name="secondary">{{{secondaryOptions}}}</select>
</div>
</div>

<div class="inline-desc grid grid-2col gap-5 mb-5">
<div class="row-one">
<div class="form-group">
<label>{{localize 'FU.Weapon'}}</label>
<select id="item-selector" name="item-selector">{{{itemOptions}}}</select>
</div>

<div class="form-group">
<label>{{localize 'FU.AccuracyBonus'}}</label>
<input type="number" id="accuracy-mod" name="accuracy-mod" value="0" />
</div>

<div class="form-group">
<label>{{localize 'FU.DamageBonus'}}</label>
<input type="number" id="damage-mod" name="damage-mod" value="0" />
</div>
</div>

<div class="row-two">
<div class="form-group">
<label>{{localize 'FU.DamageType'}}</label>
<select id="damage-type" name="damage-type">{{{damageTypeOptions}}}</select>
</div>

<div class="form-group">
<label>{{localize 'FU.WeaponType'}}</label>
<select id="weapon-type" name="weapon-type">{{{weaponTypeOptions}}}</select>
</div>

<div class="form-group">
<label>{{localize 'FU.DefenseType'}}</label>
<select id="defense-type" name="defense-type">{{{defenseTypeOptions}}}</select>
</div>
<div class="grid grid-2col">
<div class="form-group">
<label>{{localize 'FU.HRZero'}}</label>
<input type="checkbox" id="hrzero" name="hrzero" />
</div>
<button type="button" class="reset-weapon-button"><i class="fas fa-rotate-left"></i></button>
</div>
</div>

</div>
</div>
<hr>
<div class="form-buttons grid grid-2col gap-5">
<button type="button" class="modify-button"><i class="fas fa-pen-to-square icon"></i>{{localize
'FU.Modify'}}</button>
<button type="button" class="clone-button"><i class="fas fa-copy icon"></i>{{localize 'FU.Clone'}}</button>
<button type="button" class="temp-roll-button"><i class="fas fa-dice-d20 icon"></i>{{localize
'FU.TempRoll'}}</button>
<button type="button" class="cancel-button"><i class="fas fa-xmark icon"></i>{{localize 'FU.Cancel'}}</button>
</div>
</form>
13 changes: 12 additions & 1 deletion templates/optional/zeropower/feature-zeroPower-sheet.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<div>
<div class="resource-content">
<div class="item-settings desc">
<label class="checkbox resource-label-m" data-tooltip="{{localize 'FU.ClockStatus'}}">
<span>
{{#if system.data.hasClock.value}}
<i class="fas fa-clock"></i>
{{else}}
<i class="far fa-clock"></i>
{{/if}}
</span><input type="checkbox" name="system.data.hasClock.value" {{ checked system.data.hasClock.value }} />
</label>
</div>
<div class="">
<fieldset class="title-fieldset section-container desc resource-content flexrow">
<div class="resource-content flexcol flex-group-center">
Expand Down

0 comments on commit 5d11779

Please sign in to comment.