|  |  |  | @@ -106,8 +106,8 @@ export class RdDCombatManager extends Combat { | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |       //console.log("Combatat", c); | 
		
	
		
			
				|  |  |  |  |       const roll = combatant.getInitiativeRoll(rollFormula); | 
		
	
		
			
				|  |  |  |  |       if ( !roll.total) { | 
		
	
		
			
				|  |  |  |  |         roll.evaluate( {async: false}); | 
		
	
		
			
				|  |  |  |  |       if (!roll.total) { | 
		
	
		
			
				|  |  |  |  |         roll.evaluate({ async: false }); | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |       if (roll.total <= 0) roll.total = 0.00; | 
		
	
		
			
				|  |  |  |  |       console.log("Compute init for", rollFormula, roll.total, combatant); | 
		
	
	
		
			
				
					
					|  |  |  | @@ -187,7 +187,7 @@ export class RdDCombatManager extends Combat { | 
		
	
		
			
				|  |  |  |  |             action.data.dommagesReels = Number(tableauDegats[0]); | 
		
	
		
			
				|  |  |  |  |             arme2main.data.dommagesReels = Number(tableauDegats[1]); | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |           else{ | 
		
	
		
			
				|  |  |  |  |           else { | 
		
	
		
			
				|  |  |  |  |             ui.notifications.info("Les dommages de l'arme à 1/2 mains " + action.name + " ne sont pas corrects (ie sous la forme X/Y)"); | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
	
		
			
				
					
					|  |  |  | @@ -197,8 +197,7 @@ export class RdDCombatManager extends Combat { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |   static listActionsPossessions(actor) { | 
		
	
		
			
				|  |  |  |  |     return RdDCombatManager._indexActions(actor.getPossessions().map(p => | 
		
	
		
			
				|  |  |  |  |       { | 
		
	
		
			
				|  |  |  |  |     return RdDCombatManager._indexActions(actor.getPossessions().map(p => { | 
		
	
		
			
				|  |  |  |  |       return { | 
		
	
		
			
				|  |  |  |  |         name: p.name, | 
		
	
		
			
				|  |  |  |  |         action: 'conjurer', | 
		
	
	
		
			
				
					
					|  |  |  | @@ -214,7 +213,7 @@ export class RdDCombatManager extends Combat { | 
		
	
		
			
				|  |  |  |  |   static listActionsCombat(combatant) { | 
		
	
		
			
				|  |  |  |  |     const actor = combatant.actor; | 
		
	
		
			
				|  |  |  |  |     let actions = RdDCombatManager.listActionsPossessions(actor); | 
		
	
		
			
				|  |  |  |  |     if (actions.length>0) { | 
		
	
		
			
				|  |  |  |  |     if (actions.length > 0) { | 
		
	
		
			
				|  |  |  |  |       return actions; | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     let items = actor.data.items; | 
		
	
	
		
			
				
					
					|  |  |  | @@ -372,7 +371,7 @@ export class RdDCombatManager extends Combat { | 
		
	
		
			
				|  |  |  |  |   static displayInitiativeMenu(html, combatantId) { | 
		
	
		
			
				|  |  |  |  |     console.log("Combatant ; ", combatantId); | 
		
	
		
			
				|  |  |  |  |     const combatant = game.combat.combatants.get(combatantId); | 
		
	
		
			
				|  |  |  |  |     if (! (combatant?.actor) ) { | 
		
	
		
			
				|  |  |  |  |     if (!(combatant?.actor)) { | 
		
	
		
			
				|  |  |  |  |       ui.notifications.warn(`Le combatant ${combatant.name ?? combatantId} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`) | 
		
	
		
			
				|  |  |  |  |       return; | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
	
		
			
				
					
					|  |  |  | @@ -457,7 +456,7 @@ export class RdDCombat { | 
		
	
		
			
				|  |  |  |  |     else { | 
		
	
		
			
				|  |  |  |  |       const defender = target?.actor; | 
		
	
		
			
				|  |  |  |  |       const defenderTokenId = target?.data._id; | 
		
	
		
			
				|  |  |  |  |       if ( defender.type == 'entite' && defender.data.data.definition.typeentite == ENTITE_NONINCARNE) { | 
		
	
		
			
				|  |  |  |  |       if (defender.type == 'entite' && defender.data.data.definition.typeentite == ENTITE_NONINCARNE) { | 
		
	
		
			
				|  |  |  |  |         ui.notifications.warn("Vous ne pouvez pas cibler une entité non incarnée !!!!"); | 
		
	
		
			
				|  |  |  |  |       } else { | 
		
	
		
			
				|  |  |  |  |         return this.create(attacker, defender, defenderTokenId, target) | 
		
	
	
		
			
				
					
					|  |  |  | @@ -567,7 +566,7 @@ export class RdDCombat { | 
		
	
		
			
				|  |  |  |  |   async onEvent(button, event) { | 
		
	
		
			
				|  |  |  |  |     const chatMessage = ChatUtility.getChatMessage(event); | 
		
	
		
			
				|  |  |  |  |     const defenderRoll = ChatUtility.getMessageData(chatMessage, 'defender-roll'); | 
		
	
		
			
				|  |  |  |  |     const attackerRoll = defenderRoll?.attackerRoll ?? ChatUtility.getMessageData(chatMessage, 'attacker-roll') ; | 
		
	
		
			
				|  |  |  |  |     const attackerRoll = defenderRoll?.attackerRoll ?? ChatUtility.getMessageData(chatMessage, 'attacker-roll'); | 
		
	
		
			
				|  |  |  |  |     console.log('RdDCombat', attackerRoll, defenderRoll); | 
		
	
		
			
				|  |  |  |  |     const defenderTokenId = event.currentTarget.attributes['data-defenderTokenId']?.value; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
	
		
			
				
					
					|  |  |  | @@ -817,7 +816,7 @@ export class RdDCombat { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |   /* -------------------------------------------- */ | 
		
	
		
			
				|  |  |  |  |   isPossession( attackerRoll) { | 
		
	
		
			
				|  |  |  |  |   isPossession(attackerRoll) { | 
		
	
		
			
				|  |  |  |  |     return attackerRoll.selectedCarac.label.toLowerCase() == 'possession'; | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
	
		
			
				
					
					|  |  |  | @@ -962,9 +961,8 @@ export class RdDCombat { | 
		
	
		
			
				|  |  |  |  |     const arme = this.defender.getArmeParade(armeParadeId); | 
		
	
		
			
				|  |  |  |  |     console.log("RdDCombat.parade >>>", attackerRoll, armeParadeId, arme); | 
		
	
		
			
				|  |  |  |  |     const competence = Misc.templateData(arme)?.competence; | 
		
	
		
			
				|  |  |  |  |     if (competence == undefined) | 
		
	
		
			
				|  |  |  |  |     { | 
		
	
		
			
				|  |  |  |  |       console.error("Pas de compétence de parade associée à ", arme) ; | 
		
	
		
			
				|  |  |  |  |     if (competence == undefined) { | 
		
	
		
			
				|  |  |  |  |       console.error("Pas de compétence de parade associée à ", arme); | 
		
	
		
			
				|  |  |  |  |       return; | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
	
		
			
				
					
					|  |  |  | @@ -1247,6 +1245,8 @@ export class RdDCombat { | 
		
	
		
			
				|  |  |  |  |   /* -------------------------------------------- */ | 
		
	
		
			
				|  |  |  |  |   /* retourne true si on peut continuer, false si on ne peut pas continuer */ | 
		
	
		
			
				|  |  |  |  |   async accorderEntite(when = 'avant-encaissement') { | 
		
	
		
			
				|  |  |  |  |     console.log("TETETET", game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar"), this.defender.isEntite([ENTITE_INCARNE]), this.defender.isEntiteAccordee(this.attacker)) | 
		
	
		
			
				|  |  |  |  |      | 
		
	
		
			
				|  |  |  |  |     if (when != game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar") | 
		
	
		
			
				|  |  |  |  |       || this.defender == undefined | 
		
	
		
			
				|  |  |  |  |       || !this.defender.isEntite([ENTITE_INCARNE]) | 
		
	
	
		
			
				
					
					|  |  |  |   |