local function RingLoss (me, bomb, bombguy, pain)
if not me.player
return false // this used to limit it to one skn, I guess I can use this as a validity check?
end
local player = me.player // let's make things easier and use this as a shortcut to writing me.player.anything!
P_DoPlayerPain(player, bombguy, bomb) // send yourself into the pain animation
S_StartSound(player.mo, sfx_s3kb9) //hurt sound
player.health = max($1 - pain, 0) // remove damage from health, set to 0 if this goes under 0!
me.health = $1 - pain // do the same for the mobj part of the player, doesn't matter about keeping it above 0 apparently
P_PlayerRingBurst(player,1) //spill a ring
if me.health < 1
P_DamageMobj(me, bomb, bombguy,10000)
P_KillMobj(me,bomb,bombguy)
return true // you're dead, that's it, no point to continuing!
end
return true // that's it, we just end P_DamageMobj right here, nothing else happens with damaging after this
end
addHook("MobjDamage", RingLoss, MT_PLAYER)