minor improvements

This commit is contained in:
The Last Scrub
2020-07-03 22:55:07 -07:00
parent 82c0f109ec
commit 74e8be4c59
7 changed files with 37 additions and 20 deletions
+4
View File
@@ -302,6 +302,10 @@ export class DeltaGreenActorSheet extends ActorSheet {
// damage roll, not a skill check
label = dataset.label ? `Rolling damage for ${dataset.label.toUpperCase()}` : '';
}
else if(dataset.target === "lethality"){
// a lethality roll
label = dataset.label ? `Rolling LETHALITY for ${dataset.label.toUpperCase()}` : '';
}
roll.roll().toMessage({
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
+9
View File
@@ -66,6 +66,15 @@ Hooks.once('init', async function() {
}
});
Handlebars.registerHelper('formatLethality', function(lethality) {
if (lethality > 0) {
return lethality.toString() + "%";
}
else {
return "";
}
});
Handlebars.registerHelper('getActorSkillProp', function(actorData, skillName, prop) {
if(skillName != "" && prop != ""){
let skills = actorData.skills;
+2 -2
View File
@@ -1,8 +1,8 @@
{
"name": "deltagreen",
"title": "Delta Green (Unofficial)",
"description": "Delta Green: The RPG system for Foundry VTT (unaffiliated with Arc Dream Publishing or the Delta Green Partnership).",
"version": "0.6.2",
"description": "Delta Green: The RPG system for Foundry VTT (unaffiliated with Arc Dream Publishing or the Delta Green Partnership). Based on the updated rules in the Agent's Handbook.",
"version": "0.6.3",
"minimumCoreVersion": "0.6.4",
"compatibleCoreVersion": "0.6.2",
"templateVersion": 2,
+2 -1
View File
@@ -383,7 +383,8 @@
"base"
],
"disorder":"",
"crossedOut": false
"crossedOut": false,
"disorderCured": false
}
}
}
+4 -1
View File
@@ -158,11 +158,14 @@
<h4 style="word-wrap: break-word;" class="item-name">{{item.name}}</h4>
<span class="item-name rollable" data-roll="d100" data-target="{{getActorSkillProp ../data item.data.skill 'proficiency'}}" data-label="{{getActorSkillProp ../data item.data.skill 'label'}}">{{getActorSkillProp ../data item.data.skill 'label'}}</span>
<span class="rollable" data-target="damage" data-label="{{toUpperCase item.name}}" data-roll="{{toUpperCase item.data.damage}}" >{{toUpperCase item.data.damage}}</span>
<span>{{item.data.lethality}}%</span>
<span class="rollable" data-target="lethality" data-label="{{toUpperCase item.name}}" data-roll="d100">{{formatLethality item.data.lethality}}</span>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/if_eq}}
+16 -11
View File
@@ -7,12 +7,10 @@
/>
</div>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Attributes Tab --}}
<div class=" attributes" data-group="primary" data-tab="attributes">
<div class="resource">
@@ -20,37 +18,44 @@
<input type="text" name="name" value="{{item.name}}" data-dtype="String"
title="Something that drives the character."
{{#if data.crossedOut}}
{{!-- If a motivation has been crossed off after a breaking point, do a strikeout on it and disable it. --}}
{{#if data.crossedOut}}
style="text-decoration: line-through;"
disabled
{{/if}}
{{/if}}
/>
</div>
{{!-- Only Show the Disorders Section if Motivation Lost Checked --}}
{{#if data.crossedOut}}
<div class="resource">
<label class="resource-label">Disorder</label>
<input type="text" name="data.disorder" value="{{data.disorder}}" data-dtype="String"
title="A disorder replaces a motivation after hitting a break point."
title="A disorder replaces a motivation after hitting a break point."
/>
</div>
<div class="motivation-section">
<label class="resource-label">Disorder Has Been Cured: </label>
<input class="" type="checkbox" name="data.disorderCured" {{checked data.disorderCured}} data-dtype="Boolean"
title="A critical success on a therapy luck roll can cure a disorder. It may return the next time a breaking point is hit however."
/>
</div>
{{/if}}
<div class="motivation-section">
<label class="resource-label">Details</label>
</div>
<div style="height: 300px;">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
</section>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</form>
-5
View File
@@ -59,10 +59,5 @@
<div class="tab" data-group="primary" data-tab="description">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
{{!-- Attributes Tab --}}
<div class="tab attributes" data-group="primary" data-tab="attributes">
{{!-- As you add new fields, add them in here! --}}
</div>
</section>
</form>