ForbodingAngel

Untitled

Sep 16th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. base, turret, nanos, nanopoint1, nanopoint2, dirt = piece('base', 'turret', 'nanos', 'nanopoint1', 'nanopoint2', 'dirt')
  2. local SIG_AIM = {}
  3.  
  4. -- state variables
  5. isMoving = "isMoving"
  6. terrainType = "terrainType"
  7.  
  8. function script.Create()
  9. StartThread(common.SmokeUnit, {base, turret, barrel1})
  10. StartThread(doYouEvenLift)
  11. end
  12.  
  13. common = include("headers/common_includes_lus.lua")
  14.  
  15. function script.StartMoving()
  16. isMoving = true
  17. StartThread(thrust)
  18. end
  19.  
  20. function script.StopMoving()
  21. isMoving = false
  22. end
  23.  
  24. function doYouEvenLift()
  25. common.HbotLift()
  26. end
  27.  
  28. function thrust()
  29. common.DirtTrail()
  30. end
  31.  
  32. local function RestoreAfterDelay()
  33. Sleep(2000)
  34. Turn(turret, y_axis, 0, 5)
  35. end
  36.  
  37. function script.AimFromWeapon(weaponID)
  38. --Spring.Echo("AimFromWeapon: FireWeapon")
  39. return turret
  40. end
  41.  
  42. local firepoints = {firepoint1, firepoint2}
  43. local currentFirepoint = 1
  44.  
  45. function script.QueryWeapon(weaponID)
  46. return firepoints[currentFirepoint]
  47. end
  48.  
  49. function script.FireWeapon(weaponID)
  50. currentFirepoint = 3 - currentFirepoint
  51. EmitSfx (firepoints[currentFirepoint], 1024)
  52. end
  53.  
  54. function script.AimWeapon(weaponID, heading, pitch)
  55. Signal(SIG_AIM)
  56. SetSignalMask(SIG_AIM)
  57. Turn(turret, y_axis, heading, 100)
  58. Turn(barrel1, x_axis, -pitch, 100)
  59. WaitForTurn(turret, y_axis)
  60. WaitForTurn(barrel1, x_axis)
  61. StartThread(RestoreAfterDelay)
  62. --Spring.Echo("AimWeapon: FireWeapon")
  63. return true
  64. end
  65.  
  66. function script.Killed()
  67. Explode(nanos, SFX.EXPLODE_ON_HIT)
  68. Explode(turret, SFX.EXPLODE_ON_HIT)
  69. Explode(base, SFX.EXPLODE_ON_HIT)
  70. return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos
  71. end
Advertisement
Add Comment
Please, Sign In to add comment