Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. # net_strafer_pad.crpl
  2. # Created by Clean0nion
  3. # Some code borrowed from Farbor
  4. # ------------------------------------------
  5.  
  6. # This script controls the enemy stafer pads and by extension, the strafers themselves.
  7. # Strafers go to a random player unit, go to another whilst bombing creeper, go back to the first unit while bombing creeper, then go back to the base. Rinse and repeat.
  8. # Strafers can be destroyed by snipers.
  9. # It's recommended to use a circular image for the strafer.
  10.  
  11. $maxHealth:30
  12. #The maximum health of the strafer.
  13.  
  14. $bombAmount:7
  15. #The amount of creeper that the strafer bombs.
  16.  
  17. $bombDelay:45
  18. #The delay between each bomb, in frames.
  19.  
  20. $padMain:"Custom9"
  21. #The image for the pad.
  22.  
  23. $straferMain:"Custom8"
  24. #The image for the strafer.
  25.  
  26. $straferRot:0.06
  27. #The rotation rate for the strafer image. Set to 0 if you don't want it to rotate.
  28.  
  29. $speed:1.4
  30. #The movement speed of the strafer in pixels per second.
  31.  
  32. once
  33. Self "main" <-padMain SetImage
  34. 1 Delay
  35. Self CONST_COUNTSFORVICTORY FALSE SetUnitAttribute
  36. Self CONST_NULLIFIERDAMAGES FALSE SetUnitAttribute
  37. Self CONST_SUPPORTSDIGITALIS FALSE SetUnitAttribute
  38. Self CONST_TAKEMAPSPACE FALSE SetUnitAttribute
  39. Self "main" "NONE" SetImage
  40. 0 ->built
  41. endonce
  42.  
  43. CurrentCoords GetDigitalis if
  44. Self "main" <-padMain SetImage
  45. Self CONST_TAKEMAPSPACE TRUE SetUnitAttribute
  46. 0 <-built eq if
  47. 1 ->built
  48. "CRPLCORE" CurrentCoords CreateUnit ->strafer
  49. <-strafer "net_strafer_fly.crpl" AddScriptToUnit
  50. <-strafer "net_strafer_fly.crpl" "master" Self SetScriptVar
  51. <-strafer "net_strafer_fly.crpl" "maxHealth" <-maxHealth SetScriptVar
  52. <-strafer "net_strafer_fly.crpl" "bombAmount" <-bombAmount SetScriptVar
  53. <-strafer "net_strafer_fly.crpl" "bombDelay" <-bombDelay SetScriptVar
  54. <-strafer "net_strafer_fly.crpl" "straferMain" <-straferMain SetScriptVar
  55. <-strafer "net_strafer_fly.crpl" "straferRot" <-straferRot SetScriptVar
  56. <-strafer "net_strafer_fly.crpl" "speed" <-speed SetScriptVar
  57. endif
  58. else
  59. <-strafer 2 Destroy
  60. 0 ->built
  61. Self "main" "NONE" SetImage
  62. Self CONST_TAKEMAPSPACE FALSE SetUnitAttribute
  63. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement