There is a damage type, namely electric that is "neglected" - it has no special fx and I decided to change that a bit. Because there is already aura for light damage which happens to be blueish white and aura for fire, and so on I thought adding another aura would be boring... and somewhat laborious. There is however effect that would fit perfectly to what we expect from electricity - electric bolt - so I used already done in GenFX.ElectricDischarge(...) and created electric eels around the victim's body.
Now there is a problem with that - it works to the extent - when these electric eels are still created victim doesn't take any damage, at all.
--code-- @ Lib/Damage.py
def InflictElectricDamage (special, special_resistance, effective_damage, VictimName, AttackerName, WeaponName, DamageType, DamageZone, DamageNode, x, y, z, Shielded):
# halo effect on victim, must be switched off on death
if victim and victim.Person and victim.Data:
#-- electric eels --
ListOfNodes=("Head", "L_Shoulder", "L_Elbow", "L_Hand", "R_Shoulder", "R_Elbow", "R_Hand", "Center", "L_Knee", "L_Foot", "R_Knee", "R_Foot")
if (Bladex.GetEntity("ElectricBoltDmg-" + VictimName) <> None):
Bladex.GetEntity("ElectricBoltDmg-" + VictimName).SubsribeToList("Pin") # delete existing bolt so it won't become permanent zombie
GenFX.ElectricDischarge(VictimName, "ElectricBoltDmg-" + VictimName, 55, 55, 250, 600, ListOfNodes, 5, 0.66)
#-- eof eels --
As you can see it makes list of nodes and makes these bolts between them using GenFX.ElectricDischarge(...)
Seemingly not too much but this effect while on prevents victim from taking any damage. It goes like this: after hit this code generates these ElectricDischarge effects and victim gets damage. Then while they are on it prevents them from taking any more damage. For example normal whirlwind damages 4 times (1A + 3*WW) and when this effect is on it damages twice (1A + 1*WW(3'rd swing - one late enough to happen after electric bolts went off))
I tried to debug it but don't get Damage module very well. I managed to get to the following conclusions ( with PrintFormula=1 ):
(check attachment - it works in 'FugitiveI' )
>> InflictElectricDamage (special=['Electric', 50.0],...)
is called and returns special_damage=50.0
then somewhere in CalculateDamage()
>> Special damage type 'Electric' (resisted at 0.0) adds 50.0 to effective damage. # @ 1459 in original Damage.py
>> Special damage type 'Light' (resisted at 0.0) adds 130.0 to effective damage.
then second hit
>> InflictElectricDamage (special=['Electric', 50.0],...) returns special_damage=50.0
and that's it, it doesn't deal any damage and I have no idea what to actually look for in this file. Even pdb.set_trace() doesn't help - it's even worse than primitive printf.
Someone have any idea what could be a reason of such behaviour?
- (739 Bytes) Downloaded 83 times
vino puro, ...