Fix #73 : Power damage type

This commit is contained in:
sladecraven 2022-09-28 20:21:04 +02:00
parent 18a69ba993
commit 9394e0e851
4 changed files with 19 additions and 10 deletions

View File

@ -1758,7 +1758,7 @@ export class PegasusActor extends Actor {
processSizeBonus( rollData) { processSizeBonus( rollData) {
if ( rollData.defenderTokenId) { if ( rollData.defenderTokenId) {
let diffSize = rollData.defenderSize - this.system.biodata.sizenum+this.system.biodata.sizebonus let diffSize = rollData.defenderSize - this.system.biodata.sizenum+this.system.biodata.sizebonus
console.log("Diffsize", diffSize) //console.log("Diffsize", diffSize)
if( rollData.subKey == "melee-atk" || rollData.subKey == "ranged-atk") { if( rollData.subKey == "melee-atk" || rollData.subKey == "ranged-atk") {
if ( diffSize > 0) { if ( diffSize > 0) {
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: diffSize }) rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: diffSize })
@ -1774,7 +1774,7 @@ export class PegasusActor extends Actor {
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) }) rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) })
} }
} }
if( rollData.subKey == "melee-dmg" || rollData.subKey == "ranged-dmg") { if( rollData.subKey == "melee-dmg" || rollData.subKey == "ranged-dmg" || rollData.subKey == "power-dmg") {
if ( diffSize < 0) { if ( diffSize < 0) {
rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) }) rollData.effectsList.push({ label: "Size Bonus", type: "effect", applied: false, isdynamic: true, value: Math.abs(diffSize) })
} }

View File

@ -566,6 +566,7 @@
"activatedtext": "", "activatedtext": "",
"deactivatedtext": "", "deactivatedtext": "",
"powerlevelcost": "", "powerlevelcost": "",
"powerdamagetype": "",
"dmgroll": false, "dmgroll": false,
"dmgstatistic": "", "dmgstatistic": "",
"description": "" "description": ""

View File

@ -45,6 +45,10 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if power}}
<li>Power Damage type : {{power.system.powerdamagetype}}</li>
{{/if}}
{{#if isResistance}} {{#if isResistance}}
<li><strong>Defense Result : {{finalScore}}</strong> <li><strong>Defense Result : {{finalScore}}</strong>
{{else}} {{else}}

View File

@ -104,14 +104,18 @@
data.dmgroll}} /></label> data.dmgroll}} /></label>
</li> </li>
{{#if data.dmgroll}} {{#if data.dmgroll}}
<li class="flexrow"><label class="generic-label">Related DMG Statistic </label> <li class="flexrow"><label class="generic-label">Related DMG Statistic </label>
<select class="competence-base flexrow" type="text" name="system.dmgstatistic" value="{{data.dmgstatistic}}" <select class="competence-base flexrow" type="text" name="system.dmgstatistic" value="{{data.dmgstatistic}}"
data-dtype="String"> data-dtype="String">
{{#select data.dmgstatistic}} {{#select data.dmgstatistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}} {{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}} {{/select}}
</select> </select>
</li> </li>
<li class="flexrow"><label class="generic-label">Power Damage Type</label>
<input type="text" class="padd-right" name="system.powerdamagetype" value="{{data.powerdamagetype}}"
data-dtype="String" />
</li>
{{/if}} {{/if}}
<li class="flexrow"><label class="generic-label">When purchased display text</label> <li class="flexrow"><label class="generic-label">When purchased display text</label>