Fix #109 IDR dice

This commit is contained in:
sladecraven 2022-10-06 17:47:56 +02:00
parent eb951f188f
commit 5e3e50535c
3 changed files with 29 additions and 13 deletions

View File

@ -334,7 +334,7 @@ export class PegasusActor extends Actor {
if (item.system.resistance) {
item.system.resistanceDice = PegasusUtility.getDiceFromLevel(item.system.resistance)
}
if (item.system.idr) {
if (item.system.idr && Number(item.system.idr) > 0) {
item.system.idrDice = PegasusUtility.getDiceFromLevel(item.system.idr)
}
if (item.system.damage) {

View File

@ -51,8 +51,8 @@ export class PegasusVehicleSheet extends ActorSheet {
vehicleHull: duplicate(this.actor.getVehicleHull()),
mobilityModules: duplicate(this.actor.getMobilityModules()),
propulsionModules: duplicate(this.actor.getPropulsionModules()),
vehicleModules: duplicate(this.actor.getVehicleModules()),
vehicleWeaponModules: duplicate(this.actor.getVehicleWeaponModules()),
vehicleModules: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getVehicleModules())),
vehicleWeaponModules: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getVehicleWeaponModules())),
cargos: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getCargos()) ),
cargoCurrent: this.actor.getCurrentCargoCapacity(),
moneys: duplicate(this.actor.getMoneys()),

View File

@ -456,10 +456,10 @@
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Vehicles modules</label></h3>
</span>
<span class="item-field-label-long">
<span class="item-field-label-medium">
<label class="short-label">Category</label>
</span>
<span class="item-field-label-long">
<span class="item-field-label-medium">
<label class="short-label">Location</label>
</span>
<span class="item-field-label-long">
@ -480,12 +480,20 @@
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{vehiclemod.img}}" /></a>
<span class="item-name-label-long"><a class="roll-spec">{{vehiclemod.name}}</a></span>
<span class="item-field-label-long">{{vehiclemod.system.category}}</span>
<span class="item-field-label-long">{{vehiclemod.system.location}}</span>
<span class="item-field-label-medium">{{vehiclemod.system.category}}</span>
<span class="item-field-label-medium">{{vehiclemod.system.location}}</span>
<span class="item-field-label-long">{{vehiclemod.system.security}}</span>
<span class="item-field-label-short">{{vehiclemod.system.nrg}}</span>
<span class="item-field-label-medium">{{vehiclemod.system.range}}</span>
<span class="item-field-label-short">{{vehiclemod.system.idr}}</span>
<span class="item-field-label-short">
{{#if vehiclemod.system.idrDice}}
<a class="roll-idr" data-dice-value="{{vehiclemod.system.idrDice}}">{{vehiclemod.system.idrDice}}</a>
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control vehicle-module-activate" title="Activated">{{#if vehiclemod.system.activated}}<i
@ -501,10 +509,10 @@
<span class="item-name-label-header-long">
<h3><label class="items-title-text">Vehicles weapons</label></h3>
</span>
<span class="item-field-label-long">
<span class="item-field-label-medium">
<label class="short-label">Site</label>
</span>
<span class="item-field-label-long">
<span class="item-field-label-medium">
<label class="short-label">Location</label>
</span>
<span class="item-field-label-short">
@ -528,13 +536,21 @@
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{weapon.img}}" /></a>
<span class="item-name-label-long"><a class="roll-spec">{{weapon.name}}</a></span>
<span class="item-field-label-long">{{weapon.system.site}}</span>
<span class="item-field-label-long">{{weapon.system.location}}</span>
<span class="item-field-label-medium">{{weapon.system.site}}</span>
<span class="item-field-label-medium">{{weapon.system.location}}</span>
<span class="item-field-label-short">{{weapon.system.dmg}}</span>
<span class="item-field-label-medium">{{weapon.system.aoe}}</span>
<span class="item-field-label-medium">{{weapon.system.turrent}}</span>
<span class="item-field-label-short">{{weapon.system.nrg}}</span>
<span class="item-field-label-short">{{weapon.system.idr}}</span>
<span class="item-field-label-short">
{{#if weapon.system.idrDice}}
<a class="roll-idr" data-dice-value="{{weapon.system.idrDice}}">{{weapon.system.idrDice}}</a>
{{else}}
&nbsp;-&nbsp;
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control vehicle-weapon-activate" title="Activated">{{#if weapon.system.activated}}<i