disabled improvement checkbox for unnatural skill

This commit is contained in:
Nick Eimers
2020-06-21 11:49:14 -07:00
parent f166ebf5a7
commit 3c5e002f5b
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -33,7 +33,19 @@ export class DeltaGreenActor extends Actor {
// the x5 is just whatever the raw statistic is x 5 to turn it into a d100 percentile
statistic.x5 = statistic.value * 5;
}
//console.log(data.statistics);
// The unnatural skill is sort of special
// It cannot be improved via failure, so add in a special property to reflect this
// Mostly to make it easy to deactivate the failure checkbox in the GUI
for (let [key, skill] of Object.entries(data.skills)){
if(key === 'unnatural'){
skill.cannotBeImprovedByFailure = true;
}
else{
skill.cannotBeImprovedByFailure = false;
}
}
console.log(actorData);
actorData.data.wp.max = actorData.data.statistics.pow.value;
+1 -1
View File
@@ -99,7 +99,7 @@
<div class="statistic flexrow flex-group-center">
<label class="rollable skill-label" data-roll="d100" data-target="{{skill.proficiency}}" data-label="{{skill.label}}" title="Click to roll a skill check." for="data.skills.{{key}}.value" class="resource-label">{{skill.label}}</label>
<input type="text" name="data.skills.{{key}}.proficiency" value="{{skill.proficiency}}" data-dtype="Number"/>
<input type="checkbox" name="data.skills.{{key}}.failure" {{checked skill.failure}} data-dtype="Boolean" />
<input type="checkbox" name="data.skills.{{key}}.failure" {{checked skill.failure}} data-dtype="Boolean" {{#if skill.cannotBeImprovedByFailure}} disabled {{/if}} }} />
</div>
{{/each}}
</div>