v10/v11 compatibility

This commit is contained in:
LeRatierBretonnien 2023-05-25 07:23:25 +02:00
parent b1966412a0
commit 189411eef8
6 changed files with 49 additions and 14 deletions

View File

@ -599,11 +599,17 @@ export class HawkmoonActor extends Actor {
}
console.log("DEGATS", arme)
let roll
let bonus = 0
if (rollDataInput?.isHeroique) {
roll = new Roll("2d10rr10+" + arme.system.totalDegats).roll({ async: false })
if (rollDataInput?.attaqueCharge) {
bonus = 5
}
roll = new Roll("2d10rr10+" + arme.system.totalDegats + "+" + bonus).roll({ async: false })
} else {
roll = new Roll("1d10+" + arme.system.totalDegats).roll({ async: false })
if (rollDataInput?.attaqueCharge) {
bonus = 3
}
roll = new Roll("1d10+" + arme.system.totalDegats + "+" + bonus).roll({ async: false })
}
await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
let nbEtatPerdus = 0

View File

@ -102,8 +102,12 @@ export class HawkmoonRollDialog extends Dialog {
html.find('#defenseur-immobilise').change((event) => {
this.rollData.defenseurImmobilise = event.currentTarget.checked
})
html.find('#attaque-charge').change((event) => {
this.rollData.attaqueCharge = event.currentTarget.checked
})
html.find('#attaque-desarme').change((event) => {
this.rollData.attaqueDesarme = event.currentTarget.checked
})
}

View File

@ -325,7 +325,7 @@ export class HawkmoonUtility {
let pa = Math.floor((valueSC - (po * 400)) / 20)
let sc = valueSC - (po * 400) - (pa * 20)
return {
po: po, pa: pa, sc: sc, valueSC: valueSC
po, pa, sc, valueSC
}
}
@ -419,7 +419,7 @@ export class HawkmoonUtility {
rollData.diceFormula += `+5`
}
if (rollData.arme && rollData.arme.system.isDistance) {
if (rollData.arme?.system.isDistance) {
rollData.difficulte = __distanceDifficulte[rollData.distanceTir]
rollData.difficulte += __tireurDeplacement[rollData.tireurDeplacement]
rollData.difficulte += __cibleCouvert[rollData.cibleCouvert]
@ -427,6 +427,10 @@ export class HawkmoonUtility {
rollData.difficulte += rollData.cibleDeplace ? 3 : 0
rollData.difficulte += rollData.cibleCaC ? 3 : 0
}
if (rollData.attaqueDesarme) {
rollData.difficulte += 10
}
// Ajout adversités
rollData.diceFormula += `-${rollData.nbAdversites}`
@ -436,7 +440,7 @@ export class HawkmoonUtility {
let myRoll = new Roll(rollData.diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll
rollData.roll = duplicate(myRoll)
console.log(">>>> ", myRoll)
rollData.finalResult = myRoll.total
@ -457,7 +461,7 @@ export class HawkmoonUtility {
let bonusRoll = new Roll(rollData.bonusFormula).roll({ async: false })
await this.showDiceSoNice(bonusRoll, game.settings.get("core", "rollMode"));
rollData.bonusRoll = bonusRoll
rollData.bonusRoll = duplicate(bonusRoll)
rollData.finalResult += rollData.bonusRoll.total
@ -571,7 +575,9 @@ export class HawkmoonUtility {
tailleCible: "normal",
tireurDeplacement: "immobile",
cibleCouvert: "aucun",
distanceTir: "porteemoyenne"
distanceTir: "porteemoyenne",
attaqueCharge: false,
attaqueDesarme: false
}
return rollData
}

View File

@ -1,7 +1,7 @@
{
"id": "fvtt-hawkmoon-cyd",
"description": "Hawkmoon RPG for FoundryVTT (CYD system - French)",
"version": "10.1.14",
"version": "11.0.0",
"authors": [
{
"name": "Uberwald/LeRatierBretonnien",
@ -35,7 +35,7 @@
"gridUnits": "m",
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-10.1.14.zip",
"download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-11.0.0.zip",
"languages": [
{
"lang": "fr",
@ -156,6 +156,7 @@
"background": "systems/fvtt-hawkmoon-cyd/assets/ui/fond_hawkmoon.webp",
"compatibility": {
"minimum": "10",
"maximum": "11",
"verified": "10"
}
}

View File

@ -42,12 +42,19 @@
<li>Total : {{finalResult}}</li>
{{#if attaqueCharge}}
<li>Vous avez chargé : vos adversaires bénéficient de +3 pour vous attaquer</li>
{{/if}}
{{#if difficulte}}
<li>SD : {{difficulte}}</li>
{{#if isSuccess}}
<li class="chat-success">Succés...
</li>
{{#if attaqueDesarme}}
<li>Vous désarmez votre adversaire ! Son arme tombe hors de sa portée.</li>
{{/if}}
{{else}}
<li class="chat-failure">Echec...</li>
{{/if}}
@ -55,6 +62,9 @@
{{#if isHeroique}}
<li class="chat-success">Héroïque !!!</li>
{{#if attaqueDesarme}}
<li>... Et en plus vous récupérez l'arme de votre adversaire dans votre main (si vous le souhaitez) !.</li>
{{/if}}
{{/if}}
{{#if isDramatique}}
<li class="chat-failure">Dramatique !!!</li>

View File

@ -90,6 +90,14 @@
<span class="roll-dialog-label">Défenseur immobilisé (+5)?</span>
<input type="checkbox" id="defenseur-immobilise" {{checked defenseurImmobilise}} />
</div>
<div class="flexrow">
<span class="roll-dialog-label">Charge ?</span>
<input type="checkbox" id="attaque-charge" {{checked attaqueCharge}} />
</div>
<div class="flexrow">
<span class="roll-dialog-label">Désarmer (SD+10)?</span>
<input type="checkbox" id="attaque-desarme" {{checked attaqueDesarme}} />
</div>
{{else}}
<div class="flexrow">
<span class="roll-dialog-label">Tireur en déplacement ?</span>