Help with MobjDamage coding

SlainLBS

Legend with Blue Stripes
Im making a power up work like the goggles from Sonic 1 but something abot the Damage system its a bit messed up and i dont quite understand how i can fix it. The way im using is like this
addHook("MobjDamage", do
for player in players.iterate
if player.rnggoggles == true and not (player.powers[pw_shield] & SH_STACK or player.powers[pw_shield] & SH_NOSTACK)
if P_PlayerRingBurst then
player.rnggoggles = false
end
end
end
end)

When the player gets hit without any shield, the powerup is lost but the problem is.... when i destroy badniks without the shield the powerup disappears and while having shields does not. Maybe the hook i made is like confusing who's dealing the damage and whats makes it lose the power up in certain condition. Can someone please give me a hand with it???
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top