Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # net_strafer_pad.crpl
- # Created by Clean0nion
- # Some code borrowed from Farbor
- # ------------------------------------------
- # This script controls the enemy stafer pads and by extension, the strafers themselves.
- # 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.
- # Strafers can be destroyed by snipers.
- # It's recommended to use a circular image for the strafer.
- $maxHealth:30
- #The maximum health of the strafer.
- $bombAmount:7
- #The amount of creeper that the strafer bombs.
- $bombDelay:45
- #The delay between each bomb, in frames.
- $padMain:"Custom9"
- #The image for the pad.
- $straferMain:"Custom8"
- #The image for the strafer.
- $straferRot:0.06
- #The rotation rate for the strafer image. Set to 0 if you don't want it to rotate.
- $speed:1.4
- #The movement speed of the strafer in pixels per second.
- once
- Self "main" <-padMain SetImage
- 1 Delay
- Self CONST_COUNTSFORVICTORY FALSE SetUnitAttribute
- Self CONST_NULLIFIERDAMAGES FALSE SetUnitAttribute
- Self CONST_SUPPORTSDIGITALIS FALSE SetUnitAttribute
- Self CONST_TAKEMAPSPACE FALSE SetUnitAttribute
- Self "main" "NONE" SetImage
- 0 ->built
- endonce
- CurrentCoords GetDigitalis if
- Self "main" <-padMain SetImage
- Self CONST_TAKEMAPSPACE TRUE SetUnitAttribute
- 0 <-built eq if
- 1 ->built
- "CRPLCORE" CurrentCoords CreateUnit ->strafer
- <-strafer "net_strafer_fly.crpl" AddScriptToUnit
- <-strafer "net_strafer_fly.crpl" "master" Self SetScriptVar
- <-strafer "net_strafer_fly.crpl" "maxHealth" <-maxHealth SetScriptVar
- <-strafer "net_strafer_fly.crpl" "bombAmount" <-bombAmount SetScriptVar
- <-strafer "net_strafer_fly.crpl" "bombDelay" <-bombDelay SetScriptVar
- <-strafer "net_strafer_fly.crpl" "straferMain" <-straferMain SetScriptVar
- <-strafer "net_strafer_fly.crpl" "straferRot" <-straferRot SetScriptVar
- <-strafer "net_strafer_fly.crpl" "speed" <-speed SetScriptVar
- endif
- else
- <-strafer 2 Destroy
- 0 ->built
- Self "main" "NONE" SetImage
- Self CONST_TAKEMAPSPACE FALSE SetUnitAttribute
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement