Guest User

Untitled

a guest
Aug 13th, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. freeslot("MT_GLUB")
  2.  
  3. states[MT_GLUB] = {MT_REDRING, 0, 4, nil, 0, 0}
  4.  
  5. addHook("ThinkFrame", do
  6. for player in players.iterate
  7. if player.mo and player.mo.skin == "chaos"
  8. if not (player.mo.firenormaldown)
  9. player.mo.firenormaldown = 0
  10. end
  11. if (player.cmd.buttons & BT_FIRENORMAL)
  12. and not (player.pflags & PF_NIGHTSMODE) //no shooting when NiGHTS Super Sonic!
  13. and not (player.pflags & PF_ROPEHANG) //rope hangs use spin for letting go
  14. and not (player.pflags & PF_MACESPIN) //control chains use spin for shifting angle I think?
  15. and not (player.pflags & PF_TAGGED) //no shooting when tagged
  16. and not (player.pflags & PF_STASIS) //no shooting when in stasis in tag mode either
  17. and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
  18. and player.mo.firenormaldown == 0
  19. player.mo.firenormaldown = 1
  20. local an = player.mo.angle
  21. local slope = player.aiming
  22. S_StartSound(player.mo, sfx_cannon)
  23. local th = P_SpawnMobj(player.mo.x + (1*cos(an)), player.mo.y + (1*sin(an)), player.mo.z+6*FRACUNIT, MT_REDRING)
  24. //Missile copies player's scale
  25. th.scale = player.mo.scale
  26. // missiles can't hurt their targets, note
  27. th.target = player.mo
  28. //Determine speed
  29. local speed = 70*FRACUNIT
  30. if player.mo.eflags & MFE_VERTICALFLIP then
  31. th.flags2 = $1|MF2_OBJECTFLIP // flip gravity!
  32. th.z = $1 - th.height - player.mo.height/3
  33. end
  34. th.angle = an
  35. th.momx = FixedMul(speed, cos(an))
  36. th.momy = FixedMul(speed, sin(an))
  37. th.momx = FixedMul(th.momx, cos(slope))
  38. th.momy = FixedMul(th.momy, cos(slope))
  39. th.momz = FixedMul(speed, sin(slope))
  40. end
  41. if not (player.cmd.buttons & BT_FIRENORMAL)
  42. player.mo.firenormaldown = 0
  43. end
  44. end
  45. end
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment