Fix #6 Crew limits
This commit is contained in:
parent
b185a3902d
commit
857f36387a
@ -1122,7 +1122,7 @@ export class PegasusActor extends Actor {
|
|||||||
modifyHeroLevelRemaining(incDec) {
|
modifyHeroLevelRemaining(incDec) {
|
||||||
let biodata = duplicate(this.system.biodata)
|
let biodata = duplicate(this.system.biodata)
|
||||||
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining + incDec, 0)
|
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining + incDec, 0)
|
||||||
this.update({ "data.biodata": biodata })
|
this.update({ "system.biodata": biodata })
|
||||||
ChatMessage.create({ content: `${this.name} has used a Hero Level to reroll !` })
|
ChatMessage.create({ content: `${this.name} has used a Hero Level to reroll !` })
|
||||||
return biodata.currentlevelremaining
|
return biodata.currentlevelremaining
|
||||||
}
|
}
|
||||||
@ -2063,6 +2063,10 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
addCrew(actorId) {
|
addCrew(actorId) {
|
||||||
|
if ( this.system.crew.length >= this.system.crewmax) {
|
||||||
|
ui.notifications.warn("Vehicle crew is already full.")
|
||||||
|
return
|
||||||
|
}
|
||||||
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
||||||
crewList.push({ id: actorId })
|
crewList.push({ id: actorId })
|
||||||
this.update({ 'system.crew': crewList })
|
this.update({ 'system.crew': crewList })
|
||||||
|
@ -201,6 +201,8 @@
|
|||||||
},
|
},
|
||||||
"vehicle": {
|
"vehicle": {
|
||||||
"crew": [],
|
"crew": [],
|
||||||
|
"crewmax": 0,
|
||||||
|
"crewmin": 0,
|
||||||
"statistics": {
|
"statistics": {
|
||||||
"fc": {
|
"fc": {
|
||||||
"label": "FC",
|
"label": "FC",
|
||||||
|
@ -11,7 +11,11 @@
|
|||||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.level"
|
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.level"
|
||||||
value="{{stat.level}}" data-dtype="Number" disabled>
|
value="{{stat.level}}" data-dtype="Number" disabled>
|
||||||
{{#select stat.level}}
|
{{#select stat.level}}
|
||||||
{{{@root.optionsDiceList}}}
|
{{#if (eq key "ad")}}
|
||||||
|
{{{@root.optionsLevel}}}
|
||||||
|
{{else}}
|
||||||
|
{{{@root.optionsDiceList}}}
|
||||||
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -20,8 +24,12 @@
|
|||||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.currentlevel"
|
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.currentlevel"
|
||||||
value="{{stat.currentlevel}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
value="{{stat.currentlevel}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
||||||
{{#select stat.currentlevel}}
|
{{#select stat.currentlevel}}
|
||||||
{{{@root.optionsDiceList}}}
|
{{#if (eq key "ad")}}
|
||||||
{{/select}}
|
{{{@root.optionsLevel}}}
|
||||||
|
{{else}}
|
||||||
|
{{{@root.optionsDiceList}}}
|
||||||
|
{{/if}}
|
||||||
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{{#if (eq key "man")}}
|
{{#if (eq key "man")}}
|
||||||
@ -30,7 +38,7 @@
|
|||||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.turningarc45"
|
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.turningarc45"
|
||||||
value="{{stat.turningarc45}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
value="{{stat.turningarc45}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
||||||
{{#select stat.turningarc45}}
|
{{#select stat.turningarc45}}
|
||||||
{{{@root.optionsDiceList}}}
|
{{{@root.optionsLevel}}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -553,6 +553,20 @@
|
|||||||
|
|
||||||
{{!-- Crew Tab --}}
|
{{!-- Crew Tab --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="crew">
|
<div class="tab items" data-group="primary" data-tab="crew">
|
||||||
|
|
||||||
|
<div class="stat-item">
|
||||||
|
<ul class="stat-list alternate-list">
|
||||||
|
<li class="item stat flexrow list-item">
|
||||||
|
<span class="generic-label small-label "><strong>Maximum Crew Capacity</strong></span>
|
||||||
|
<input type="text" class="input-numeric-short padd-right" name="system.crewmax" value="{{data.crewmax}}"
|
||||||
|
data-dtype="Number" />
|
||||||
|
<span class="generic-label small-label"><strong>Minimum Crew Required</strong></span>
|
||||||
|
<input type="text" class="input-numeric-short" name="system.crewmin" value="{{data.crewmin}}"
|
||||||
|
data-dtype="Number" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul class="item-list alternate-list">
|
<ul class="item-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
<span class="item-name-label-header">
|
<span class="item-name-label-header">
|
||||||
|
Loading…
Reference in New Issue
Block a user