Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. -- Suppress drowning music
  2. addHook("ThinkFrame", do
  3.     --if not (mapheaderinfo[gamemap] and mapheaderinfo[gamemap].nodrown) then return end -- Uncomment out this line to only make this happen on maps with LUA.nodrown = yes in their level header (disclaimer: I didn't test this particular line)
  4.     for p in players.iterate do
  5.         if p.powers[pw_underwater] == 11*TICRATE+2 then
  6.             p.powers[pw_underwater] = 11*TICRATE
  7.            
  8.             local height
  9.            
  10.             if p.mo.eflags & MFE_VERTICALFLIP then
  11.                 height = p.mo.z - FixedMul(8*FRACUNIT - mobjinfo[MT_DROWNNUMBERS].height, p.mo.scale)
  12.             else
  13.                 height = p.mo.z + p.mo.height + (8*p.mo.scale)
  14.             end
  15.            
  16.             local numbermobj = P_SpawnMobj(p.mo.x, p.mo.y, height, MT_DROWNNUMBERS)
  17.             numbermobj.state = numbermobj.info.spawnstate+5
  18.             numbermobj.target = p.mo
  19.             numbermobj.threshold = 40
  20.             S_StartSound(p.mo, sfx_dwnind)
  21.             numbermobj.scale = p.mo.scale
  22.         end
  23.     end
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement