Description
Environmental explosions currently just damage the affected unit for a set amount, ignoring all effects except armor and shields. This is due to damage reductions/immunities are only checked in X2Effect_ApplyWeaponDamage
but not in XCOmGameState_Unit.TakeDamage
, causing units with fortress to still take damage from exploding cars/gas canisters.
Fix: Instead of calling TakeDamage()
directly, apply a X2Effect_ApplyWeaponDamage
effect instead, dynamically generate an x2effect right before dealing damage should be OK as without references from template managers it should be garbage collected, otherwise extend the effect with a new effect that takes in the destructible source. The code is in Explode()
function of XComGameState_DestructionSphere
code to apply effects without triggering ability can be found in EverVigilantTurnEndListener
in XComGameState_Ability