Open bountygiver opened 7 years ago
OK I had the idea of using game state override of making this a separate mod, end up scraping it because of privatewrite variables, so basically this can only be done in highlander
Are you sure the source is XComGameState_DestructionSphere
? The unit damage should be triggered by XComDestructibleActor_Action_RadialDamage
, which is native code unfortunately.
XComGameState_DestructionSphere
seems like a leftover thing where units could trigger explosions by using an ability (see X2TargetingMethod_ExplosiveDeviceDetonate
, 'ExplosiveDeviceDetonate'
).
A simple Script Trace should clear that up.
the thing is XComDestructibleActor_Action_RadialDamage
is not really called by anything really, there's just a visualization code and 2 more places which called it is silence destruction which also sets the damage to 0. While XComGameState_DestructionSphere
does have proper activation code from XComDestructionSphere
which is a proper placable (which means it can be added by maps not just scripts), and it is also still actively used by explodeit
cheat code
I will run a test with my scrapped mod project to trace which one is the actual one called
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 inXCOmGameState_Unit.TakeDamage
, causing units with fortress to still take damage from exploding cars/gas canisters.Fix: Instead of calling
TakeDamage()
directly, apply aX2Effect_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 inExplode()
function ofXComGameState_DestructionSphere
code to apply effects without triggering ability can be found in
EverVigilantTurnEndListener
inXComGameState_Ability