Feature/200 beastform (#255)

* Temp

* Dialog setup

* Fixed basic beastform

* Reworked beastform to hold it's data entirely in the beastformEffect

* UpdateActorTokens fix

* Removed hardcoded tierlimit on beastform

* PR fixes
This commit is contained in:
WBHarry 2025-07-04 02:02:14 +02:00 committed by GitHub
parent c4448226e0
commit d071fadf7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 1102 additions and 298 deletions

View file

@ -14,11 +14,6 @@
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=action type=../type}}
{{/if}}
{{/each}}
{{#each document.system.ancestry.system.actions as |action|}}
{{#if (or (eq ../type 'ancestry'))}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=action type=../type}}
{{/if}}
{{/each}}
{{#each document.system.class.value.system.classFeatures as |classFeature|}}
{{#if (or (eq ../type 'class'))}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=classFeature type=../type}}

View file

@ -1,4 +1,4 @@
<li class="inventory-item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-companion="{{companion}}" {{#if (not noTooltip)}}data-tooltip="{{concat "#item#" item.uuid}}"{{/if}}>
<li class="inventory-item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-type="{{type}}" data-companion="{{companion}}" {{#if (not noTooltip)}}data-tooltip="{{concat "#item#" item.uuid}}"{{/if}}>
<img src="{{item.img}}" class="item-img {{#if isActor}}actor-img{{/if}}" data-action="useItem"/>
<div class="item-label">
{{#if isCompanion}}

View file

@ -0,0 +1,23 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<fieldset class="one-column drop-section">
<legend>{{localize "DAGGERHEART.Sheets.Global.Features"}}</legend>
<div class="features-list">
{{#each document.system.features as |feature index|}}
<div class="feature-item"
data-action="editFeature"
data-index="{{index}}"
>
<img class="image" src="{{feature.img}}" />
<span>{{feature.name}}</span>
<div class="controls">
<a data-action="removeFeature" data-index="{{index}}"><i class="fa-solid fa-trash"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
</section>

View file

@ -0,0 +1,10 @@
<header class='item-sheet-header'>
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
<div class='item-info'>
<line-div></line-div>
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
<div class='item-description'>
<h3>{{localize 'TYPES.Item.beastform'}}</h3>
</div>
</div>
</header>

View file

@ -0,0 +1,27 @@
<section
class='tab {{tabs.settings.cssClass}} {{tabs.settings.id}}'
data-tab='{{tabs.settings.id}}'
data-group='{{tabs.settings.group}}'
>
<div class="two-columns">
{{formGroup systemFields.tier value=source.system.tier localize=true}}
{{formGroup systemFields.examples value=source.system.examples localize=true}}
</div>
<fieldset class="two-columns">
<legend>{{localize "DAGGERHEART.Sheets.Beastform.FIELDS.advantageOn.label"}}</legend>
{{!-- {{formGroup systemFields.examples value=source.system.examples localize=true}} --}}
</fieldset>
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Beastform.tokenTitle"}}</legend>
<div class="full-width">
{{formGroup systemFields.tokenImg value=source.system.tokenImg localize=true}}
</div>
{{formGroup systemFields.tokenSize.fields.height value=source.system.tokenSize.height localize=true placeholder=(localize "DAGGERHEART.Sheets.Beastform.FIELDS.tokenSize.placeholder") }}
{{formGroup systemFields.tokenSize.fields.width value=source.system.tokenSize.width localize=true placeholder=(localize "DAGGERHEART.Sheets.Beastform.FIELDS.tokenSize.placeholder")}}
</fieldset>
</section>

View file

@ -0,0 +1,6 @@
<div>
<div>{{name}}</div>
<img src="{{system.tokenImg}}" />
<div>{{{system.examples}}}</div>
<div>{{system.advantageOn}}</div>
</div>

View file

@ -44,7 +44,8 @@
{{#if fields.healing}}{{> 'systems/daggerheart/templates/views/actionTypes/healing.hbs' fields=fields.healing.fields source=source.healing}}{{/if}}
{{#if fields.resource}}{{> 'systems/daggerheart/templates/views/actionTypes/resource.hbs' fields=fields.resource.fields source=source.resource}}{{/if}}
{{#if fields.documentUUID}}{{> 'systems/daggerheart/templates/views/actionTypes/uuid.hbs' fields=fields.documentUUID source=source.documentUUID}}{{/if}}
{{#if fields.effects}}{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}}
{{#if fields.effects}}{{> 'systems/daggerheart/templates/views/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}}
{{#if fields.beastform}}{{> 'systems/daggerheart/templates/views/actionTypes/beastform.hbs' fields=fields.effects.element.fields source=source.beastform}}{{/if}}
</div>
</section>
</div>

View file

@ -0,0 +1,17 @@
<fieldset class="action-category">
<legend class="action-category-label">
<div>{{localize "DAGGERHEART.Actions.Config.Beastform.label"}}</div>
</legend>
<div class="action-category-data open">
<div class="hint-group">
<div class="form-fields">
<label>{{localize "DAGGERHEART.Actions.Config.Beastform.exact"}}</label>
<select name="beastform.tierAccess.exact" data-dtype="Number">
{{selectOptions tierOptions selected=@root.source.beastform.tierAccess.exact labelAttr="label" valueAttr="key" blank="" }}
</select>
</div>
<p class="hint">{{localize "DAGGERHEART.Actions.Config.Beastform.exactHint"}}</p>
</div>
</div>
</fieldset>

View file

@ -0,0 +1,18 @@
<div>
<div class="beastforms-container">
{{#each beastformTiers as |tier tierKey|}}
<fieldset class="beastforms-tier">
<legend>{{tier.label}}</legend>
{{#each tier.values as |form uuid|}}
<div data-action="selectBeastform" data-uuid="{{uuid}}" data-tooltip="{{concat "#item#" uuid}}" class="beastform-container {{#if (and @root.canSubmit (not form.selected))}}inactive{{/if}}">
<img src="{{form.value.img}}" />
<div class="beastform-title">{{form.value.name}}</div>
</div>
{{/each}}
</fieldset>
{{/each}}
</div>
<footer>
<button type="button" data-action="submitBeastform" {{#if (not canSubmit)}}disabled{{/if}}>{{localize "DAGGERHEART.Sheets.Beastform.transform"}}</button>
</footer>
</div>