réordonner les messages de défense
* jet de défense * jet de recul * détérioration d'arme
This commit is contained in:
parent
95708222dc
commit
fa225f3df9
@ -141,10 +141,10 @@ export class RdDCombat {
|
||||
label: 'Attaque: ' + (arme ? arme.name : competence.name),
|
||||
callbacks: [
|
||||
this.attacker.createCallbackExperience(),
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onAttaqueParticuliere(r) },
|
||||
{ condition: r => (RdDCombat.isReussite(r) && !RdDCombat.isParticuliere(r)), action: r => this._onAttaqueNormale(r) },
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onAttaqueParticuliere(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onAttaqueEchec(r) },
|
||||
{ condition: RdDCombat.isEchecTotal, action: r => this._onAttaqueEchecTotal(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onAttaqueEchec(r) }
|
||||
]
|
||||
} );
|
||||
dialog.render(true);
|
||||
@ -186,11 +186,6 @@ export class RdDCombat {
|
||||
dommagesReels: competence.data.dommages
|
||||
}
|
||||
};
|
||||
|
||||
// rollData.dmg = {
|
||||
// dmgArme: competence.data.dommages,
|
||||
// total: competence.data.dommages
|
||||
// };
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -217,31 +212,30 @@ export class RdDCombat {
|
||||
|
||||
let explications = "";
|
||||
|
||||
// Message spécial pour la rapidité, qui reste difficile à gérer automatiquement
|
||||
if (rollData.particuliereAttaque == 'rapidite') {
|
||||
ChatMessage.create({
|
||||
content: "Vous avez attaqué en Rapidité. Vous pourrez faire une deuxième attaque, ou utiliser votre arme pour vous défendre.",
|
||||
whisper: ChatMessage.getWhisperRecipients(this.attacker.name)
|
||||
});
|
||||
}
|
||||
rollData.dmg = RdDBonus.dmg(rollData, this.attacker.getBonusDegat(), this.defender.isEntiteCauchemar());
|
||||
|
||||
|
||||
if (this.target) {
|
||||
explications += "<br><strong>Cible</strong> : " + this.defender.data.name;
|
||||
}
|
||||
explications += "<br>Encaissement à " + Misc.toSignedString(rollData.dmg.total) + " (" + rollData.dmg.loc.label + ")";
|
||||
|
||||
|
||||
// Save rollData for defender
|
||||
game.system.rdd.rollDataHandler[this.attackerId] = duplicate(rollData);
|
||||
|
||||
// Message spécial pour la rapidité, qui reste difficile à gérer automatiquement
|
||||
if (rollData.particuliereAttaque == 'rapidite') {
|
||||
explications += "<br>Vous avez attaqué en Rapidité. Vous pourrez faire une deuxième attaque, ou utiliser votre arme pour vous défendre.";
|
||||
}
|
||||
|
||||
// Final chat message
|
||||
let chatOptions = {
|
||||
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
|
||||
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat
|
||||
+ RdDResolutionTable.explain(rollData.rolled)
|
||||
+ explications
|
||||
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat
|
||||
+ RdDResolutionTable.explain(rollData.rolled)
|
||||
+ explications
|
||||
}
|
||||
ChatUtility.chatWithRollMode(chatOptions, this.attacker.name)
|
||||
|
||||
if (this.target) {
|
||||
this._messageDefenseur(rollData);
|
||||
}
|
||||
@ -359,10 +353,10 @@ export class RdDCombat {
|
||||
label: 'Parade: ' + (arme ? arme.name : rollData.competence.name),
|
||||
callbacks: [
|
||||
this.defender.createCallbackExperience(),
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onParadeParticuliere(r) },
|
||||
{ condition: RdDCombat.isReussite, action: r => this._onParadeNormale(r) },
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onParadeParticuliere(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onParadeEchec(r) },
|
||||
{ condition: RdDCombat.isEchecTotal, action: r => this._onParadeEchecTotal(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onParadeEchec(r) }
|
||||
]
|
||||
} );
|
||||
dialog.render(true);
|
||||
@ -435,17 +429,16 @@ export class RdDCombat {
|
||||
/* -------------------------------------------- */
|
||||
async _onParadeNormale(rollData) {
|
||||
console.log("RdDCombat._onParadeNormale >>>", rollData);
|
||||
await this.computeDeteriorationArme(rollData);
|
||||
await this.computeRecul(rollData, false);
|
||||
|
||||
|
||||
let chatOptions = {
|
||||
content: "<strong>Test : " + rollData.selectedCarac.label + " / " + rollData.competence.name + "</strong>"
|
||||
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat
|
||||
+ RdDResolutionTable.explain(rollData.rolled)
|
||||
+ "<br><strong>Attaque parée!</strong>"
|
||||
+ "<br>Difficultés <strong>libre : " + rollData.diffLibre + "</strong> / conditions : " + Misc.toSignedString(rollData.diffConditions) + " / état : " + rollData.etat
|
||||
+ RdDResolutionTable.explain(rollData.rolled)
|
||||
+ "<br><strong>Attaque parée!</strong>"
|
||||
}
|
||||
|
||||
ChatUtility.chatWithRollMode(chatOptions, this.defender.name)
|
||||
await this.computeRecul(rollData, false);
|
||||
await this.computeDeteriorationArme(rollData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -498,10 +491,10 @@ export class RdDCombat {
|
||||
label: 'Esquiver',
|
||||
callbacks: [
|
||||
this.defender.createCallbackExperience(),
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onEsquiveParticuliere(r) },
|
||||
{ condition: RdDCombat.isReussite, action: r => this._onEsquiveNormale(r) },
|
||||
{ condition: RdDCombat.isEchecTotal, action: r => this._onEsquiveEchecTotal(r) },
|
||||
{ condition: RdDCombat.isParticuliere, action: r => this._onEsquiveParticuliere(r) },
|
||||
{ condition: RdDCombat.isEchec, action: r => this._onEsquiveEchec(r) },
|
||||
{ condition: RdDCombat.isEchecTotal, action: r => this._onEsquiveEchecTotal(r) },
|
||||
]
|
||||
});
|
||||
dialog.render(true);
|
||||
|
Loading…
Reference in New Issue
Block a user