|  |  | @@ -118,22 +118,26 @@ export class Creature extends Vore implements Combatant { | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | takeDamage (damage: Damage): LogEntry { | 
		
	
		
			
			|  |  |  | // first, we record health to decide if the entity just died | 
		
	
		
			
			|  |  |  | const startHealth = this.vigors.Health | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | damage.damages.forEach(instance => { | 
		
	
		
			
			|  |  |  | const factor = instance.type === DamageType.Heal ? -1 : 1 | 
		
	
		
			
			|  |  |  | const resistance: number|undefined = this.resistances.get(instance.type) | 
		
	
		
			
			|  |  |  | if (resistance !== undefined) { | 
		
	
		
			
			|  |  |  | if (instance.target in Vigor) { | 
		
	
		
			
			|  |  |  | this.vigors[instance.target as Vigor] -= instance.amount * factor * resistance | 
		
	
		
			
			|  |  |  | } else if (instance.target in Stat) { | 
		
	
		
			
			|  |  |  | this.stats[instance.target as Stat] -= instance.amount * factor * resistance | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | } else { | 
		
	
		
			
			|  |  |  | if (instance.target in Vigor) { | 
		
	
		
			
			|  |  |  | this.vigors[instance.target as Vigor] -= instance.amount * factor | 
		
	
		
			
			|  |  |  | } else if (instance.target in Stat) { | 
		
	
		
			
			|  |  |  | this.stats[instance.target as Stat] -= instance.amount * factor | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | const effectiveResistance: number|undefined = this.resistances.get(instance.type) | 
		
	
		
			
			|  |  |  | const resistance = effectiveResistance === undefined ? factor : effectiveResistance * factor | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | if (instance.target in Vigor) { | 
		
	
		
			
			|  |  |  | // just deal damage | 
		
	
		
			
			|  |  |  | this.vigors[instance.target as Vigor] -= instance.amount * factor * resistance | 
		
	
		
			
			|  |  |  | } else if (instance.target in Stat) { | 
		
	
		
			
			|  |  |  | // drain the stats, then deal damage to match | 
		
	
		
			
			|  |  |  | const startVigors = this.maxVigors | 
		
	
		
			
			|  |  |  | this.stats[instance.target as Stat] -= instance.amount * factor * resistance | 
		
	
		
			
			|  |  |  | const endVigors = this.maxVigors | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | Object.keys(Vigor).map(vigor => { | 
		
	
		
			
			|  |  |  | this.vigors[vigor as Vigor] -= startVigors[vigor as Vigor] - endVigors[vigor as Vigor] | 
		
	
		
			
			|  |  |  | }) | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | }) | 
		
	
		
			
			|  |  |  | 
 | 
		
	
	
		
			
				|  |  | 
 |