# --Bomb-- 11/18/2017 10:46:44 PM once # Set up image(s). You NEED to set image layer to Ships, otherwise your module will render behind ships. Self "ShipModule.prpl" "Ship" GetScriptVar ->Ship <-Ship.ShipIsEnemy ->IsEnemy <-IsEnemy eq0 if Self "main" "Custom3" SetImage else Self "main" "Custom0" SetImage endif Self "main" "Ships" SetImageLayer Self "main" 1 SetImageOrder Self "main" 1 1 SetImageScale -1 ->target 1 ->lock endonce #The heading of the ship the module is attached to. Self "ShipModule.prpl" "ShipAngle" GetScriptVar ->ShipAngle #The amount the heading has changed in the last frame (in radians) Self "ShipModule.prpl" "delta" GetScriptVar ->Delta #Whether the module exists. #0 = hull destroyed #1 = under construction #2 = built Self "ShipModule.prpl" "exist" GetScriptVar ->Exist #If the module is destroyed, make it invisible and prevent the rest of the script from running. <-Exist eq0 if self "main" 0 0 0 0 SetImageColor <-lock eq0 if @EmitParticles 1 ->lock endif return endif #make module align with ship self "main" <-ShipAngle SetImageRotation IsPaused if return endif <-Exist 1 eq if # if under construction, make the module semi transparent. # also use this for things like resetting turret rotation or cooldown if the module is destroyed and rebuilt self "main" 255 255 255 128 SetImageColor else self "main" 255 255 255 255 SetImageColor # I don't know of a way to read the Fire Multiple property on some enemy ships, which increases their fire rate. # Instead, this script pretends that all enemy ships have amp gems. <-Ship.ShipHasAmp <-IsEnemy or ->GemPresent #code your module's abilities here <-lock 1 eq if 0 ->lock endif endif :EmitParticles "Explosion6" 10 PlaySoundWithVolume 0 ->Number 0 ->PAmt 15 201 RandInt ->PAmt <-PAmt 0 do <-Number 0.5 add ->Number CurrentPixelCoords <-Number 1 0 <-IsEnemy CreateParticle loop :destroyed <-lock eq0 if @EmitParticles endif :awake # I dunno, I like to have all my scrpts OWP and exit partway through, I doubt it's caused by the brain chip. 1 OperateWhilePaused