ForbodingAngel

Untitled

May 1st, 2014
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. local base, turret, barrel1, firepoint1, dirt = piece('base', 'turret', 'barrel1', 'firepoint1')
  2. local SIG_AIM = {}
  3.  
  4. -- state variables
  5. isMoving = "isMoving"
  6.  
  7. function script.Create()
  8.  
  9. end
  10.  
  11. function setSFXoccupy(setSFXoccupy_argument)
  12. local terrainType = setSFXocupy_argument
  13. if terrainType == 2 then
  14. Move(base, y_axis, -0.85, 50)
  15. local upright = true
  16. else
  17. Move(base, y_axis, 0, 50)
  18. local upright = false
  19. end
  20.  
  21. if terrainType == 4 then
  22. Move(base, y_axis, 0, 50)
  23. local upright = false
  24. else
  25. Move(base, y_axis, -0.85, 50)
  26. local upright = true
  27. end
  28. end
  29.  
  30. function script.StartMoving()
  31. isMoving = true
  32. end
  33.  
  34. function script.StopMoving()
  35. isMoving = false
  36. end
  37.  
  38. function thrust()
  39. while isMoving do
  40. Spring.UnitScript.EmitSfx (dirt, 1025)
  41. Spring.UnitScript.Sleep(400)
  42. end
  43. end
  44.  
  45.  
  46. function script.AimWeapon1(heading, pitch)
  47. Signal(SIG_AIM)
  48. SetSignalMask(SIG_AIM)
  49. Turn(turret, y_axis, heading, 25)
  50. Turn(barrel, x_axis, pitch, 25)
  51. WaitForTurn(turret, y_axis)
  52. WaitForTurn(barrel, x_axis)
  53. return true
  54. end
  55.  
  56. function script.AimFromWeapon1()
  57. return turret
  58. end
  59.  
  60. function script.QueryWeapon1()
  61. return firepoint1
  62. end
  63.  
  64. function script.FireWeapon1()
  65.  
  66. end
  67.  
  68. function script.Killed()
  69. Explode(barrel, SFX.EXPLODE_ON_HIT)
  70. Explode(turret, SFX.EXPLODE_ON_HIT)
  71. return 1 -- spawn ARMSTUMP_DEAD corpse / This is the equivalent of corpsetype = 1; in bos
  72. end
Advertisement
Add Comment
Please, Sign In to add comment