add functionality for rolls
This commit is contained in:
@@ -73,19 +73,28 @@ export default class DeltaGreenActorSheet extends ActorSheet {
|
||||
const simplifiedTraining = {
|
||||
name: training.name,
|
||||
id: training.id,
|
||||
key: training.attribute,
|
||||
rollType: "skill",
|
||||
};
|
||||
// Convert the machine-readable name to a human-readable one.
|
||||
switch (true) {
|
||||
case DG.statistics.includes(training.attribute):
|
||||
simplifiedTraining.attribute = training.attribute.toUpperCase();
|
||||
simplifiedTraining.targetNumber =
|
||||
this.actor.system.statistics[training.attribute].value;
|
||||
simplifiedTraining.rollType = "stat";
|
||||
break;
|
||||
case DG.skills.includes(training.attribute):
|
||||
simplifiedTraining.attribute =
|
||||
this.actor.system.skills[training.attribute].label;
|
||||
simplifiedTraining.targetNumber =
|
||||
this.actor.system.skills[training.attribute].proficiency;
|
||||
break;
|
||||
default:
|
||||
simplifiedTraining.attribute =
|
||||
this.actor.system.typedSkills[training.attribute].label;
|
||||
simplifiedTraining.targetNumber =
|
||||
this.actor.system.typedSkills[training.attribute].proficiency;
|
||||
break;
|
||||
}
|
||||
return simplifiedTraining;
|
||||
|
||||
+7
-4
@@ -504,10 +504,13 @@ export class DGDamageRoll extends DGRoll {
|
||||
this.options.rollMode || game.settings.get("core", "rollMode");
|
||||
let label = this.formula;
|
||||
try {
|
||||
label = `${game.i18n.localize("DG.Roll.Rolling",)} <b>${game.i18n.localize("DG.Roll.Damage").
|
||||
toUpperCase()}</b> ${game.i18n.localize("DG.Roll.For",)} ${this.item.name}`;
|
||||
} catch(ex) {
|
||||
//console.log(ex);
|
||||
label = `${game.i18n.localize("DG.Roll.Rolling")} <b>${game.i18n
|
||||
.localize("DG.Roll.Damage")
|
||||
.toUpperCase()}</b> ${game.i18n.localize("DG.Roll.For")} ${
|
||||
this.item.name
|
||||
}`;
|
||||
} catch (ex) {
|
||||
// console.log(ex);
|
||||
label = `Rolling <b>DAMAGE</b> for <b>${label.toUpperCase()}</b>`;
|
||||
}
|
||||
return this.createMessage(this.total, label, rollMode);
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
{{/each}}
|
||||
{{#each specialTraining as |training|}}
|
||||
<div class="item flexrow flex-group-center flex-thin-border">
|
||||
<label class="">
|
||||
{{training.name}} ({{training.attribute}})
|
||||
<label class="{{if_gt training.targetNumber 0 'rollable' 'not-rollable'}}" data-key="{{training.key}}" data-rolltype="{{training.rollType}}">
|
||||
{{training.name}} ({{training.attribute}} - {{training.targetNumber}})
|
||||
</label>
|
||||
<div class="item-controls">
|
||||
<a class="item-control special-training-action" data-action="Edit" data-id="{{training.id}}" title="Edit Training"><i class="fas fa-edit"></i></a>
|
||||
|
||||
Reference in New Issue
Block a user