Fix #19 - Horoscope majeur
This commit is contained in:
		| @@ -33,18 +33,20 @@ export class BoLCombatManager extends Combat { | ||||
|  | ||||
|   /************************************************************************************/ | ||||
|   nextRound() { | ||||
|     let combatants = this.combatants.contents | ||||
|     let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char. | ||||
|     for (let c of combatants) { | ||||
|       //let actor = game.actors.get(c.actorId) | ||||
|       c.actor.clearRoundModifiers() | ||||
|       let toRemove = [] | ||||
|       if (autoRemoveDead && c.actor.type == "encounter" && (c.actor.system.chartype == "tough" || c.actor.system.chartype == "creature" || c.actor.system.chartype == "base") && c.actor.system.resources.hp.value <= 0) { | ||||
|         toRemove.push( c.id || c._id) | ||||
|       } | ||||
|       //console.log("REM", autoRemoveDead, toRemove, c.actor) | ||||
|       if (toRemove.length>0) { | ||||
|         this.deleteEmbeddedDocuments('Combatant', toRemove) | ||||
|     if (game.user.isGM) { | ||||
|       let combatants = this.combatants.contents | ||||
|       let autoRemoveDead = game.settings.get("bol", "auto-remove-dead") // Optionnal auto-removal of dead char. | ||||
|       for (let c of combatants) { | ||||
|         //let actor = game.actors.get(c.actorId) | ||||
|         c.actor.clearRoundModifiers() | ||||
|         let toRemove = [] | ||||
|         if (autoRemoveDead && c.actor.type == "encounter" && (c.actor.system.chartype == "tough" || c.actor.system.chartype == "creature" || c.actor.system.chartype == "base") && c.actor.system.resources.hp.value <= 0) { | ||||
|           toRemove.push(c.id || c._id) | ||||
|         } | ||||
|         //console.log("REM", autoRemoveDead, toRemove, c.actor) | ||||
|         if (toRemove.length > 0) { | ||||
|           this.deleteEmbeddedDocuments('Combatant', toRemove) | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|     super.nextRound() | ||||
| @@ -52,21 +54,25 @@ export class BoLCombatManager extends Combat { | ||||
|  | ||||
|   /************************************************************************************/ | ||||
|   startCombat() { | ||||
|     let combatants = this.combatants.contents | ||||
|     for (let c of combatants) { | ||||
|       let actor = game.actors.get(c.actorId) | ||||
|       actor.storeVitaliteCombat() | ||||
|     if (game.user.isGM) { | ||||
|       let combatants = this.combatants.contents | ||||
|       for (let c of combatants) { | ||||
|         let actor = game.actors.get(c.actorId) | ||||
|         actor.storeVitaliteCombat() | ||||
|       } | ||||
|     } | ||||
|     return super.startCombat() | ||||
|   } | ||||
|  | ||||
|   /************************************************************************************/ | ||||
|   _onDelete() { | ||||
|     let combatants = this.combatants.contents | ||||
|     for (let c of combatants) { | ||||
|       let actor = game.actors.get(c.actorId) | ||||
|       actor.clearInitiative() | ||||
|       actor.displayRecuperation() | ||||
|     if (game.user.isGM) { | ||||
|       let combatants = this.combatants.contents | ||||
|       for (let c of combatants) { | ||||
|         let actor = game.actors.get(c.actorId) | ||||
|         actor.clearInitiative() | ||||
|         actor.displayRecuperation() | ||||
|       } | ||||
|     } | ||||
|     super._onDelete() | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user