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) console.log("DEGATS", arme)
let roll let roll
let bonus = 0
if (rollDataInput?.isHeroique) { 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 { } 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")); await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
let nbEtatPerdus = 0 let nbEtatPerdus = 0

View File

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

View File

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

View File

@ -42,12 +42,19 @@
<li>Total : {{finalResult}}</li> <li>Total : {{finalResult}}</li>
{{#if attaqueCharge}}
<li>Vous avez chargé : vos adversaires bénéficient de +3 pour vous attaquer</li>
{{/if}}
{{#if difficulte}} {{#if difficulte}}
<li>SD : {{difficulte}}</li> <li>SD : {{difficulte}}</li>
{{#if isSuccess}} {{#if isSuccess}}
<li class="chat-success">Succés... <li class="chat-success">Succés...
</li> </li>
{{#if attaqueDesarme}}
<li>Vous désarmez votre adversaire ! Son arme tombe hors de sa portée.</li>
{{/if}}
{{else}} {{else}}
<li class="chat-failure">Echec...</li> <li class="chat-failure">Echec...</li>
{{/if}} {{/if}}
@ -55,6 +62,9 @@
{{#if isHeroique}} {{#if isHeroique}}
<li class="chat-success">Héroïque !!!</li> <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}}
{{#if isDramatique}} {{#if isDramatique}}
<li class="chat-failure">Dramatique !!!</li> <li class="chat-failure">Dramatique !!!</li>

View File

@ -90,6 +90,14 @@
<span class="roll-dialog-label">Défenseur immobilisé (+5)?</span> <span class="roll-dialog-label">Défenseur immobilisé (+5)?</span>
<input type="checkbox" id="defenseur-immobilise" {{checked defenseurImmobilise}} /> <input type="checkbox" id="defenseur-immobilise" {{checked defenseurImmobilise}} />
</div> </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}} {{else}}
<div class="flexrow"> <div class="flexrow">
<span class="roll-dialog-label">Tireur en déplacement ?</span> <span class="roll-dialog-label">Tireur en déplacement ?</span>