Jet de compétence V2

This commit is contained in:
2025-10-03 01:42:10 +02:00
parent 10a89cc268
commit 6886f19921
6 changed files with 35 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ export default class ChatRollResult {
'partial-encaissement': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-encaissement.hbs',
'partial-recul-choc': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-recul-choc.hbs',
'partial-info-appel-moral': 'systems/foundryvtt-reve-de-dragon/templates/roll/result/partial-info-appel-moral.hbs',
})
})
}
async display(roll) {
@@ -44,7 +44,7 @@ export default class ChatRollResult {
roll.show.chance = this.isAppelChancePossible(roll)
roll.show.encaissement = this.isShowEncaissement(roll)
roll.show.recul = this.getRecul(roll)
roll.show.particuliere = roll.show.particuliere ?? []
//roll.show.particuliere = roll.show.particuliere ?? []
}
isAppelChancePossible(roll) {
@@ -54,12 +54,16 @@ export default class ChatRollResult {
}
isShowEncaissement(roll) {
return roll.rolled.isEchec &&
roll.attackerRoll?.dmg.mortalite != 'empoignade'
switch (roll.type.current) {
case ROLL_TYPE_DEFENSE:
return roll.rolled.isEchec &&
roll.attackerRoll?.dmg.mortalite != 'empoignade'
}
return false
}
getRecul(roll, defender = roll.active.actor, attacker = roll.opponent.actor) {
getRecul(roll, defender = roll.active.actor, attacker = roll.opponent?.actor) {
switch (roll.type.current) {
case ROLL_TYPE_DEFENSE:
{