Fix munition
This commit is contained in:
parent
131629fdb5
commit
0149f49e7c
@ -211,14 +211,19 @@ export class VadentisActor extends Actor {
|
||||
title: `${this.name} encaisse des dégâts !`,
|
||||
msg: `${this.name} encaisse ${damageValue} dégâts !`
|
||||
}
|
||||
if ( game.user.isGM) {
|
||||
msgData.msg += `<br>Ses Points de Vie actuels sont désormais de ${newValue}.`;
|
||||
}
|
||||
|
||||
ChatMessage.create({
|
||||
//whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-vadentis/templates/chat-generic-result.html`, msgData)
|
||||
});
|
||||
|
||||
if ( game.user.isGM) {
|
||||
msgData.msg = `<br>Ses Points de Vie actuels sont désormais de ${newValue}.`;
|
||||
ChatMessage.create({
|
||||
whisper: ChatMessage.getWhisperRecipients( 'GM'),
|
||||
content: await renderTemplate(`systems/foundryvtt-vadentis/templates/chat-generic-result.html`, msgData)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -94,7 +94,13 @@ export class VadentisUtility extends Entity {
|
||||
alias: this.name,
|
||||
title: `${attacker.name} attaque ${defender.name}`
|
||||
}
|
||||
|
||||
|
||||
let tirMsg = "";
|
||||
if ( combatData.arme.type == 'tir') {
|
||||
attacker.decrementeMunition(combatData.arme);
|
||||
tirMsg += `<br>C'est un tir, les munitions de l'attaquant ont été décrémentées`;
|
||||
}
|
||||
|
||||
let formulaTouche = "1d20+"+attaque;
|
||||
let formulaFull = attacker.buildTexteFormula( attacker.data.data.combat.attaque );
|
||||
let myRoll = await this.processRoll(formulaTouche);
|
||||
@ -103,16 +109,12 @@ export class VadentisUtility extends Entity {
|
||||
let formula = combatData.arme.data.damage.toLowerCase();
|
||||
msgData.msg = `${attacker.name} a réussi son attaque sur ${defender.name} (${formulaFull} => ${myRoll.total} / ${defense}) !<br> Les dégâts sont ${degats}.`;
|
||||
|
||||
if ( combatData.arme.type == 'tir') {
|
||||
attacker.decrementeMunition(combatData.arme);
|
||||
msgData.msg += `<br>C'est un tir, les munitions de l'attaquant ont été décrémentées`;
|
||||
}
|
||||
|
||||
msgData.msg += tirMsg;
|
||||
if ( myRoll.results[0] >= combatData.arme.data.valuecritical ) {
|
||||
degats = `critiques : ${combatData.arme.data.criticaldamage}`;
|
||||
formula = combatData.arme.data.criticaldamage.toLowerCase();
|
||||
msgData.msg += `<br>C'est une <strong>réussite critique</strong> !`;
|
||||
}
|
||||
}
|
||||
msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_attaque_réussie.webp'
|
||||
|
||||
formula = this.processDamageString( formula, attacker );
|
||||
@ -126,6 +128,7 @@ export class VadentisUtility extends Entity {
|
||||
} else {
|
||||
msgData.msg = `${attacker.name} a raté son attaque sur ${defender.name} (${myRoll.total} / ${defense}) !`;
|
||||
}
|
||||
msgData.msg += tirMsg;
|
||||
}
|
||||
ChatMessage.create({
|
||||
//whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "foundryvtt-vadentis",
|
||||
"title": "Vadentis",
|
||||
"description": "Système Vadentis pour FoundryVTT",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"manifestPlusVersion": "1.0.0",
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.7.9",
|
||||
|
Loading…
Reference in New Issue
Block a user