Correction sur init + assistance au combat dans la fenetre de dialogue
This commit is contained in:
parent
c34d223d8f
commit
b1966412a0
@ -124,7 +124,7 @@ export class HawkmoonActorSheet extends ActorSheet {
|
||||
})
|
||||
|
||||
html.find('.roll-initiative').click((event) => {
|
||||
this.actor.rollAttribut("pre", true)
|
||||
this.actor.rollAttribut("adr", true)
|
||||
})
|
||||
|
||||
html.find('.roll-attribut').click((event) => {
|
||||
|
@ -77,12 +77,16 @@ export class HawkmoonActor extends Actor {
|
||||
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
|
||||
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense
|
||||
arme.system.isdefense = true
|
||||
arme.system.isMelee = true
|
||||
arme.system.isDistance = false
|
||||
}
|
||||
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
|
||||
arme.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
|
||||
arme.system.attrKey = "adr"
|
||||
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
|
||||
arme.system.totalDegats = arme.system.degats
|
||||
arme.system.isMelee = false
|
||||
arme.system.isDistance = true
|
||||
if (arme.system.isdefense) {
|
||||
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense
|
||||
}
|
||||
@ -588,13 +592,19 @@ export class HawkmoonActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollArmeDegats(armeId, targetVigueur = undefined) {
|
||||
async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) {
|
||||
let arme = this.items.get(armeId)
|
||||
if (arme.type == "arme") {
|
||||
arme = this.prepareArme(arme)
|
||||
}
|
||||
console.log("DEGATS", arme)
|
||||
let roll = new Roll("1d10+" + arme.system.totalDegats).roll({ async: false })
|
||||
let roll
|
||||
if (rollDataInput?.isHeroique) {
|
||||
roll = new Roll("2d10rr10+" + arme.system.totalDegats).roll({ async: false })
|
||||
|
||||
} else {
|
||||
roll = new Roll("1d10+" + arme.system.totalDegats).roll({ async: false })
|
||||
}
|
||||
await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
|
||||
let nbEtatPerdus = 0
|
||||
if (targetVigueur) {
|
||||
|
@ -72,9 +72,39 @@ export class HawkmoonRollDialog extends Dialog {
|
||||
html.find('#competence-talents').change((event) => {
|
||||
this.rollData.selectedTalents = $('#competence-talents').val()
|
||||
})
|
||||
html.find('#taille-cible').change((event) => {
|
||||
this.rollData.tailleCible = String(event.currentTarget.value)
|
||||
})
|
||||
html.find('#tireur-deplacement').change((event) => {
|
||||
this.rollData.tireurDeplacement = String(event.currentTarget.value)
|
||||
})
|
||||
html.find('#cible-couvert').change((event) => {
|
||||
this.rollData.cibleCouvert = String(event.currentTarget.value)
|
||||
})
|
||||
html.find('#distance-tir').change((event) => {
|
||||
this.rollData.distanceTir = String(event.currentTarget.value)
|
||||
})
|
||||
html.find('#bonus-malus-context').change((event) => {
|
||||
this.rollData.bonusMalusContext = Number(event.currentTarget.value)
|
||||
})
|
||||
html.find('#defenseur-au-sol').change((event) => {
|
||||
this.rollData.defenseurAuSol = event.currentTarget.checked
|
||||
})
|
||||
html.find('#defenseur-aveugle').change((event) => {
|
||||
this.rollData.defenseurAveugle = event.currentTarget.checked
|
||||
})
|
||||
html.find('#defenseur-de-dos').change((event) => {
|
||||
this.rollData.defenseurDeDos = event.currentTarget.checked
|
||||
})
|
||||
html.find('#defenseur-restreint').change((event) => {
|
||||
this.rollData.defenseurRestreint = event.currentTarget.checked
|
||||
})
|
||||
html.find('#defenseur-immobilise').change((event) => {
|
||||
this.rollData.defenseurImmobilise = event.currentTarget.checked
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -2,6 +2,12 @@
|
||||
import { HawkmoonCombat } from "./hawkmoon-combat.js";
|
||||
import { HawkmoonCommands } from "./hawkmoon-commands.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const __distanceDifficulte = { "porteecourte": 5, "porteemoyenne": 9, "porteelongue": 14}
|
||||
const __tireurDeplacement = { immobile: 0, lent: 3, rapide: 5}
|
||||
const __cibleCouvert = { aucun: 0, leger: 5, complet: 10}
|
||||
const __tailleCible = { normal: 0, main: 10, enfant: 3, maison: -10}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class HawkmoonUtility {
|
||||
|
||||
@ -145,7 +151,7 @@ export class HawkmoonUtility {
|
||||
let message = game.messages.get(messageId)
|
||||
let rollData = message.getFlag("world", "hawkmoon-roll")
|
||||
let actor = this.getActorFromRollData(rollData)
|
||||
actor.rollArmeDegats(rollData.arme._id, rollData.targetVigueur)
|
||||
actor.rollArmeDegats(rollData.arme._id, rollData.targetVigueur, rollData)
|
||||
})
|
||||
}
|
||||
|
||||
@ -393,7 +399,34 @@ export class HawkmoonUtility {
|
||||
} else {
|
||||
rollData.diceFormula += `+${rollData.attr.value}*${rollData.multiplier}+${rollData.modificateur}+${rollData.bonusMalusContext}`
|
||||
}
|
||||
// Bonus arme naturelle en défense
|
||||
if (rollData.bonusArmeNaturelle) {
|
||||
rollData.diceFormula += `+${rollData.bonusArmeNaturelle}`
|
||||
}
|
||||
if (rollData.defenseurAuSol) {
|
||||
rollData.diceFormula += `+3`
|
||||
}
|
||||
if (rollData.defenseurAveugle) {
|
||||
rollData.diceFormula += `+10`
|
||||
}
|
||||
if (rollData.defenseurDeDos) {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
if (rollData.defenseurRestreint) {
|
||||
rollData.diceFormula += `+3`
|
||||
}
|
||||
if (rollData.defenseurImmobilise) {
|
||||
rollData.diceFormula += `+5`
|
||||
}
|
||||
|
||||
if (rollData.arme && rollData.arme.system.isDistance) {
|
||||
rollData.difficulte = __distanceDifficulte[rollData.distanceTir]
|
||||
rollData.difficulte += __tireurDeplacement[rollData.tireurDeplacement]
|
||||
rollData.difficulte += __cibleCouvert[rollData.cibleCouvert]
|
||||
rollData.difficulte += __tailleCible[rollData.tailleCible]
|
||||
rollData.difficulte += rollData.cibleDeplace ? 3 : 0
|
||||
rollData.difficulte += rollData.cibleCaC ? 3 : 0
|
||||
}
|
||||
// Ajout adversités
|
||||
rollData.diceFormula += `-${rollData.nbAdversites}`
|
||||
|
||||
@ -528,7 +561,17 @@ export class HawkmoonUtility {
|
||||
pointAmeOptions: this.getPointAmeOptions(),
|
||||
difficulte: 0,
|
||||
modificateur: 0,
|
||||
bonusMalusContext: 0
|
||||
bonusMalusContext: 0,
|
||||
bonusArmeNaturelle: 0,
|
||||
defenseurAveugle: false,
|
||||
defenseurDeDos: false,
|
||||
defenseurAuSol: false,
|
||||
defenseurRestreint: false,
|
||||
defenseurImmobilise: false,
|
||||
tailleCible: "normal",
|
||||
tireurDeplacement: "immobile",
|
||||
cibleCouvert: "aucun",
|
||||
distanceTir: "porteemoyenne"
|
||||
}
|
||||
return rollData
|
||||
}
|
||||
@ -541,8 +584,14 @@ export class HawkmoonUtility {
|
||||
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
|
||||
rollData.armeDefense = defender.getBestDefenseValue()
|
||||
rollData.targetVigueur = defender.getVigueur()
|
||||
rollData.protectionDefenseur = defender.getProtection()
|
||||
if (rollData.armeDefense) {
|
||||
rollData.difficulte = rollData.armeDefense.system.totalDefensif
|
||||
if ( !rollData.arme.system.armenaturelle && !rollData.arme.system.armefortune ){
|
||||
if (rollData.armeDefense.system.armenaturelle || rollData.armeDefense.system.armefortune) {
|
||||
rollData.bonusArmeNaturelle = 3
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Aucune arme de défense équipée, difficulté manuelle à positionner.")
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "fvtt-hawkmoon-cyd",
|
||||
"description": "Hawkmoon RPG for FoundryVTT (CYD system - French)",
|
||||
"version": "10.1.12",
|
||||
"version": "10.1.14",
|
||||
"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.12.zip",
|
||||
"download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-10.1.14.zip",
|
||||
"languages": [
|
||||
{
|
||||
"lang": "fr",
|
||||
|
@ -209,6 +209,8 @@
|
||||
},
|
||||
"arme": {
|
||||
"typearme": "",
|
||||
"armenaturelle": false,
|
||||
"armefortune": false,
|
||||
"bonusmaniementoff": 0,
|
||||
"seuildefense": 0,
|
||||
"onlevelonly": false,
|
||||
|
@ -43,6 +43,8 @@
|
||||
<li>Total : {{finalResult}}</li>
|
||||
|
||||
{{#if difficulte}}
|
||||
<li>SD : {{difficulte}}</li>
|
||||
|
||||
{{#if isSuccess}}
|
||||
<li class="chat-success">Succés...
|
||||
</li>
|
||||
|
@ -23,6 +23,14 @@
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
<li class="flexrow item">
|
||||
<label class="generic-label item-field-label-long2">Arme naturelle ? </label>
|
||||
<input type="checkbox" name="system.armenaturelle" {{checked system.armenaturelle}} />
|
||||
</li>
|
||||
<li class="flexrow item">
|
||||
<label class="generic-label item-field-label-long2">Arme de fortune ? </label>
|
||||
<input type="checkbox" name="system.armefortune" {{checked system.armefortune}} />
|
||||
</li>
|
||||
<li class="flexrow item">
|
||||
<label class="generic-label item-field-label-long">Bonus offensif : </label>
|
||||
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.bonusmaniementoff"
|
||||
|
@ -62,6 +62,77 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if arme}}
|
||||
{{#if arme.system.isMelee}}
|
||||
{{#if bonusArmeNaturelle}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Arme naturelle/fortune en défense</span>
|
||||
<span class="small-label roll-dialog-label">{{bonusArmeNaturelle}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">En surplomb ou défenseur au sol (+3)?</span>
|
||||
<input type="checkbox" id="defenseur-au-sol" {{checked defenseurAuSol}} />
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défenseur aveuglé (+10)?</span>
|
||||
<input type="checkbox" id="defenseur-aveugle" {{checked defenseurAveugle}} />
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défenseur de dos (+5)?</span>
|
||||
<input type="checkbox" id="defenseur-de-dos" {{checked defenseurDeDos}} />
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défenseur dans espace restreint (+3)?</span>
|
||||
<input type="checkbox" id="defenseur-restreint" {{checked defenseurRestreint}} />
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défenseur immobilisé (+5)?</span>
|
||||
<input type="checkbox" id="defenseur-immobilise" {{checked defenseurImmobilise}} />
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Tireur en déplacement ?</span>
|
||||
<select class="item-field-label-long" type="text" id="tireur-deplacement" data-dtype="string">
|
||||
{{#select tireurDeplacement}}
|
||||
<option value="immobile">Immobile (SD+0)</option>
|
||||
<option value="lent">Lent (SD+3)</option>
|
||||
<option value="rapide">Rapide (SD+5)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Couvert de la cible ?</span>
|
||||
<select class="item-field-label-long" type="text" id="cible-couvert" data-dtype="string">
|
||||
{{#select cibleCouvert}}
|
||||
<option value="aucun">Aucun</option>
|
||||
<option value="leger">Léger (SD+5)</option>
|
||||
<option value="complet">Quasi complet (SD+10)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Cible se déplace vite (SD+3)?</span>
|
||||
<input type="checkbox" id="tireur-cible-deplace" {{checked cibleDeplace}} />
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Cible corps à corps (SD+3)?</span>
|
||||
<input type="checkbox" id="tireur-cible-cac" {{checked cibleCaC}} />
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Taille de la cible ?</span>
|
||||
<select class="item-field-label-long" type="text" id="taille-cible" data-dtype="string">
|
||||
{{#select tailleCible}}
|
||||
<option value="normal">Normal (SD+0)</option>
|
||||
<option value="main">Main (SD+10)</option>
|
||||
<option value="enfant">Enfant (SD+3)</option>
|
||||
<option value="maison">Maison (SD-10)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Bonus/Malus </span>
|
||||
<select class="roll-dialog-label" id="bonus-malus-context" type="text" value="{{bonusMalusContext}}"
|
||||
@ -81,30 +152,46 @@
|
||||
</div>
|
||||
|
||||
{{#if armeDefense}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défense adversaire : </span>
|
||||
<span class="roll-dialog-label"><strong>{{difficulte}}</strong> </span>
|
||||
</div>
|
||||
|
||||
{{#if arme.system.isDistance}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">SD de distance</span>
|
||||
<select class="item-field-label-long" type="text" id="distance-tir" data-dtype="string">
|
||||
{{#select distanceTir}}
|
||||
<option value="porteecourte">Courte ({{protectionDefenseur}}+5)</option>
|
||||
<option value="porteemoyenne">Moyenne ({{protectionDefenseur}}+9)</option>
|
||||
<option value="porteelongue">Moyenne ({{protectionDefenseur}}+14)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Défense adversaire : </span>
|
||||
<span class="roll-dialog-label"><strong>{{difficulte}}</strong> </span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{else}}
|
||||
|
||||
{{#if isInit}}
|
||||
|
||||
{{else}}
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Difficulté : </span>
|
||||
<select class="roll-dialog-label" id="difficulte" type="text" name="difficulte" value="{{difficulte}}"
|
||||
data-dtype="Number">
|
||||
{{#select difficulte}}
|
||||
<option value="0">Aucune/Inconnue</option>
|
||||
<option value="5">Facile (5)</option>
|
||||
<option value="10">Moyenne (10)</option>
|
||||
<option value="15">Ardue (15)</option>
|
||||
<option value="20">Hasardeuse (20)</option>
|
||||
<option value="25">Insensée (25)</option>
|
||||
<option value="30">Pure Folie (30)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
<div class="flexrow">
|
||||
<span class="roll-dialog-label">Difficulté : </span>
|
||||
<select class="roll-dialog-label" id="difficulte" type="text" name="difficulte" value="{{difficulte}}"
|
||||
data-dtype="Number">
|
||||
{{#select difficulte}}
|
||||
<option value="0">Aucune/Inconnue</option>
|
||||
<option value="5">Facile (5)</option>
|
||||
<option value="10">Moyenne (10)</option>
|
||||
<option value="15">Ardue (15)</option>
|
||||
<option value="20">Hasardeuse (20)</option>
|
||||
<option value="25">Insensée (25)</option>
|
||||
<option value="30">Pure Folie (30)</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user