Created Starship size as "class"

This will be used to automatically upgrade Tier and Dice.  Need to build in logic still
This commit is contained in:
supervj 2021-05-02 00:53:46 -04:00
parent 6ecf1e7b96
commit d0eae64241
4 changed files with 144 additions and 3 deletions

View file

@ -14,12 +14,12 @@ export const preloadHandlebarsTemplates = async function() {
"systems/sw5e/templates/actors/oldActor/parts/actor-inventory.html",
"systems/sw5e/templates/actors/oldActor/parts/actor-features.html",
"systems/sw5e/templates/actors/oldActor/parts/actor-powerbook.html",
"systems/sw5e/templates/actors/oldActor/parts/actor-notes.html",
"systems/sw5e/templates/actors/oldActor/parts/actor-notes.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-biography.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-core.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-crew.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-active-effects.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-active-effects.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-features.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-inventory.html",
"systems/sw5e/templates/actors/newActor/parts/swalt-force-powerbook.html",

View file

@ -136,7 +136,7 @@ Hooks.once("init", function() {
});
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("sw5e", ItemSheet5e, {
types: ['weapon', 'equipment', 'consumable', 'tool', 'loot', 'class', 'power', 'feat', 'species', 'backpack', 'archetype', 'classfeature', 'background', 'fightingmastery', 'fightingstyle', 'lightsaberform', 'deployment', 'deploymentfeature', 'starshipfeature', 'starshipmod', 'venture'],
types: ['weapon', 'equipment', 'consumable', 'tool', 'loot', 'class', 'power', 'feat', 'species', 'backpack', 'archetype', 'classfeature', 'background', 'fightingmastery', 'fightingstyle', 'lightsaberform', 'deployment', 'deploymentfeature', 'starship', 'starshipfeature', 'starshipmod', 'venture'],
makeDefault: true,
label: "SW5E.SheetClassItem"
});

View file

@ -624,6 +624,7 @@
"loot",
"power",
"species",
"starship",
"starshipfeature",
"starshipmod",
"tool",
@ -815,6 +816,11 @@
"conditions": ""
}
},
"starshipDescription": {
"description": {
"value": ""
}
},
"starshipEquipment": {
"capx": {
"value": null
@ -993,6 +999,19 @@
"formula": null
}
},
"starship": {
"templates": ["starshipDescription"],
"size": "",
"tier": 0,
"hullDice": "d6",
"hullDiceStart": 1,
"hullDiceUsed": 0,
"shldDice": "d6",
"shldDiceStart": 1,
"shldDiceUsed": 0,
"pwrDice": "1",
"source": "SotG"
},
"starshipfeature": {
"templates": ["itemDescription", "activatedEffect", "action"],
"size": "med",

View file

@ -0,0 +1,122 @@
<form class="{{cssClass}} flexcol" autocomplete="off">
{{!-- Item Sheet Header --}}
<header class="sheet-header flexrow">
<img class="profile" src="{{item.img}}" title="{{item.name}}" data-edit="img"/>
<div class="header-details flexrow">
<h1 class="charname">
<input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'SW5E.ClassName' }}"/>
</h1>
<div class="item-subtitle">
<h4 class="item-type">{{itemType}}</h4>
<span class="item-status">{{itemStatus}}</span>
</div>
<ul class="summary flexrow">
<li>
<input type="text" name="data.source" value="{{data.source}}" placeholder="{{ localize 'SW5E.Source' }}"/>
</li>
</ul>
</div>
</header>
{{!-- Item Sheet Navigation --}}
<nav class="sheet-navigation tabs" data-group="primary">
<a class="item active" data-tab="description">{{ localize "SW5E.Description" }}</a>
<a class="item" data-tab="details">{{ localize "SW5E.Details" }}</a>
</nav>
{{!-- Item Sheet Body --}}
<section class="sheet-body">
{{!-- Description Tab --}}
<div class="tab flexrow active" data-group="primary" data-tab="description">
{{editor content=data.description.value target="data.description.value" button=true owner=owner editable=editable}}
</div>
{{!-- Details Tab --}}
<div class="tab details" data-group="primary" data-tab="details">
{{!-- Tier --}}
<div class="form-group">
<label>{{ localize "SW5E.StarshipTier" }}</label>
<div class="form-fields">
<input type="text" name="data.tier" value="{{data.tier}}" data-dtype="Number"/>
</div>
</div>
{{!-- Hull Dice --}}
<div class="form-group">
<label>{{localize "SW5E.HullDice"}}</label>
<div class="form-fields">
<select name="data.hullDice">
{{#select data.hullDice}}
{{#each config.hitDieTypes}}
<option value="{{this}}">{{this}}</option>
{{/each}}
{{/select}}
</select>
</div>
</div>
<div class="form-group">
<label>{{localize "SW5E.HullDiceStart"}}</label>
<div class="form-fields">
<input type="text" placeholder="0" name="data.hullDiceStart" value="{{data.hullDiceStart}}" data-dtype="Number"/>
</div>
</div>
<div class="form-group">
<label>{{localize "SW5E.HullDiceUsed"}}</label>
<div class="form-fields">
<input type="text" placeholder="0" name="data.hullDiceUsed" value="{{data.hullDiceUsed}}" data-dtype="Number"/>
</div>
</div>
{{!-- Shield Dice --}}
<div class="form-group">
<label>{{localize "SW5E.ShieldDice"}}</label>
<div class="form-fields">
<select name="data.shldDice">
{{#select data.shldDice}}
{{#each config.hitDieTypes}}
<option value="{{this}}">{{this}}</option>
{{/each}}
{{/select}}
</select>
</div>
</div>
<div class="form-group">
<label>{{localize "SW5E.ShieldDiceStart"}}</label>
<div class="form-fields">
<input type="text" placeholder="0" name="data.shldDiceStart" value="{{data.shldDiceStart}}" data-dtype="Number"/>
</div>
</div>
<div class="form-group">
<label>{{localize "SW5E.ShieldDiceUsed"}}</label>
<div class="form-fields">
<input type="text" placeholder="0" name="data.shldDiceUsed" value="{{data.shldDiceUsed}}" data-dtype="Number"/>
</div>
</div>
{{!-- Power Dice --}}
<div class="form-group">
<label>{{localize "SW5E.PowerDice"}}</label>
<div class="form-fields">
<select name="data.pwrDice">
{{#select data.pwrDice}}
{{#each config.powerDieTypes}}
<option value="{{this}}">{{this}}</option>
{{/each}}
{{/select}}
</select>
</div>
</div>
</div>
</section>
</form>