Add Vevaphon morph form display to Special Rules tab; fix morphForm flag on world items; enlarge REST button

This commit is contained in:
2026-04-15 11:39:20 +01:00
parent 63da87f372
commit f3264d60e2
3 changed files with 40 additions and 2 deletions
+7 -1
View File
@@ -444,6 +444,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
const armors = [];
const conditions = [];
const abilities = [];
const morphForms = [];
const persTraits = [];
let curWeight = 0;
@@ -550,7 +551,11 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
conditions.push(i);
} else if (i.type === 'ability') {
abilities.push(i);
if (i.system?.sla?.morphForm) {
morphForms.push(i);
} else {
abilities.push(i);
}
} else if (i.type === 'persTrait') {
persTraits.push(i);
}
@@ -587,6 +592,7 @@ export class MothershipActorSheet extends foundry.appv1.sheets.ActorSheet {
actorData.weapons = weapons;
actorData.conditions = conditions;
actorData.abilities = abilities;
actorData.slaMorphForms = morphForms;
actorData.persTraits = persTraits.sort((left, right) => String(left?.name ?? "").localeCompare(String(right?.name ?? "")));
}
@@ -904,6 +904,11 @@ export class SLAMothershipGenerator extends FormApplication {
const worldItem = findWorldItem(morph.name, "ability");
if (worldItem) {
const embedded = toEmbeddedData(worldItem);
// Always ensure morphForm flag is set — prevents Ebb enforcement from deleting these
embedded.system ??= {};
embedded.system.sla ??= {};
embedded.system.sla.morphForm = true;
embedded.system.sla.isStartingForm = morph.name === startingMorphForm;
items.push(embedded);
} else {
// Build a minimal ability document so the character isn't empty-handed.
+28 -1
View File
@@ -34,7 +34,7 @@
</div>
<div class="header-field header-field-rest">
<div class="headerinputtext">&nbsp;</div>
<button type="button" class="sla-sheet-action sla-rest-button sla-header-rest-pill" title="Take a short or long rest">Rest</button>
<button type="button" class="sla-sheet-action sla-rest-button sla-header-rest-pill" title="Take a short or long rest" style="font-size: 1rem; padding: 6px 18px; font-weight: 700; letter-spacing: 0.05em;">REST</button>
</div>
<div class="header-field header-field-credits">
<div class="headerinputtext">{{ localize 'Mosh.Credits' }}</div>
@@ -724,6 +724,33 @@
{{/if}}
</div>
</div>
{{#if slaMorphForms.length}}
<div class="sla-card" style="margin-top: 16px;">
<div class="sla-card-label">Vevaphon Morph Forms</div>
<div class="sla-card-copy">This operative can shift between the following morph chassis. Each costs Instability to maintain.</div>
<ol class="items-list sla-ability-list" style="margin-top: 8px;">
<li class="item flexrow item-header">
<div class="item-image"></div>
<div class="skill-stat" style="flex-grow: 2.5;">Form</div>
<div class="skill-stat">Instability</div>
<div class="item-controls"></div>
</li>
{{#each slaMorphForms as |form|}}
<li class="item flexrow dropitem" data-item-id="{{form._id}}">
<div class="item-image"><img src="{{form.img}}" title="{{form.name}}" width="24" height="24" /></div>
<div class="skill-name list-roll ability-use-trigger" style="flex-grow: 2.6;" title="{{form.name}}">{{form.name}}</div>
<div class="skill-stat">{{form.system.sla.instabilityCost}}</div>
<div class="item-controls">
<a class="item-control ability-edit" title="Edit Form"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Form"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
</div>
{{/if}}
</div>
</div>
{{#if isEbbUser}}