Minor fixes

This commit is contained in:
sladecraven 2022-09-12 23:06:13 +02:00
parent cdf2248afa
commit f57b57e57f
6 changed files with 83 additions and 65 deletions

4
images/.directory Normal file
View File

@ -0,0 +1,4 @@
[Dolphin]
Timestamp=2022,9,12,23,3,3.4699999999999998
Version=4
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

View File

@ -1,6 +1,5 @@
[Dolphin]
SortOrder=1
Timestamp=2022,7,27,18,56,49.607
Timestamp=2022,9,12,23,4,32.409
Version=4
ViewMode=1
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

View File

@ -158,6 +158,9 @@ export class CrucibleActorSheet extends ActorSheet {
html.find('.roll-shield-die').click((event) => {
this.actor.rollShieldDie()
});
html.find('.roll-target-die').click((event) => {
this.actor.rollDefenseRanged()
});
html.find('.roll-save').click((event) => {
const saveKey = $(event.currentTarget).data("save-key")

View File

@ -63,6 +63,7 @@ export class CrucibleActor extends Actor {
/* -------------------------------------------- */
computeHitPoints() {
if (this.type == "character") {
let hp = duplicate(this.system.secondary.hp)
let max = (this.system.abilities.str.value + this.system.abilities.con.value) * 6
if (max != hp.max || hp.value > max) {
@ -71,8 +72,10 @@ export class CrucibleActor extends Actor {
this.update({ 'system.secondary.hp': hp })
}
}
}
/* -------------------------------------------- */
computeEffortPoints() {
if (this.type == "character") {
let effort = duplicate(this.system.secondary.effort)
let max = (this.system.abilities.con.value + this.system.abilities.int.value) * 6
if (max != effort.max || effort.value > max) {
@ -81,6 +84,7 @@ export class CrucibleActor extends Actor {
this.update({ 'system.secondary.effort': effort })
}
}
}
/* -------------------------------------------- */
prepareDerivedData() {
@ -687,10 +691,12 @@ export class CrucibleActor extends Actor {
let rollData = this.getCommonRollData()
rollData.defenderTokenId = undefined // Cleanup
rollData.mode = "rangeddefense"
if ( attackRollData) {
rollData.attackRollData = duplicate(attackRollData)
rollData.sizeDice = CrucibleUtility.getSizeDice( this.system.biodata.size )
rollData.effectiveRange = CrucibleUtility.getWeaponRange(attackRollData.weapon)
rollData.tokensDistance = attackRollData.tokensDistance // QoL copy
}
rollData.sizeDice = CrucibleUtility.getSizeDice(this.system.biodata.size)
rollData.distanceBonusDice = 0 //Math.max(0, Math.floor((rollData.tokensDistance - rollData.effectiveRange) + 0.5))
rollData.hasCover = "none"
rollData.situational = "none"
@ -752,10 +758,10 @@ export class CrucibleActor extends Actor {
let diceColor = armor.system.absorprionroll
let armorResult = await CrucibleUtility.getRollTableFromDiceColor(diceColor, false)
console.log("Armor log", armorResult)
let armorValue = (Number(armorResult.text) + reduce) * multiply
let armorValue = Math.max(0, (Number(armorResult.text) + reduce) * multiply)
if (advantage || disadvantage) {
let armorResult2 = await CrucibleUtility.getRollTableFromDiceColor(diceColor, false)
let armorValue2 = (Number(armorResult2.text) + reduce) * multiply
let armorValue2 = Math.max(0, (Number(armorResult2.text) + reduce) * multiply)
if (advantage) {
armorValue = (armorValue2 > armorValue) ? armorValue2 : armorValue
messages.push(`Armor advantage - Roll 1 = ${armorValue} - Roll 2 = ${armorValue2}`)

View File

@ -199,15 +199,15 @@
"styles": [
"styles/simple.css"
],
"version": "10.0.10",
"version": "10.0.11",
"compatibility": {
"minimum": "10",
"verified": "10.279",
"verified": "10.285",
"maximum": "10"
},
"title": "Crucible RPG",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/raw/master/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v10.0.10.zip",
"download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v10.0.11.zip",
"url": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg",
"background": "images/ui/crucible_welcome_page.webp",
"id": "fvtt-crucible-rpg"

View File

@ -59,6 +59,12 @@
</span>
</li>
{{/if}}
<li class="item flexrow list-item" data-attr-key="class">
<img class="sheet-competence-img" src="systems/fvtt-crucible-rpg/images/icons/feats/Marksman (Ballistic).webp" />
<span class="ability-label " name="rollTarget">
<h4 class="ability-text-white ability-margin"><a class="roll-target-die ability-margin">Target Roll</a></h4>
</span>
</li>
</ul>
</div>