# -- GeassWeapon -- once Self "main" "Custom7" SetImage # OR Custom 7 Self "main" "Ships" SetImageLayer Self "main" 1 SetImageOrder Self "main" 2.25 2.25 SetImageScale Self "barrel" "Custom6" SetImage Self "barrel" "Ships" SetImageLayer Self "barrel" 1 SetImageOrder Self "barrel" -0.05 SetImagePositionZ Self "barrel" 3.15 4.33 SetImageScale Self "energyPoint" "Custom3_128" SetImage Self "energyPoint" "Ships" SetImageLayer Self "energyPoint" 1 SetImageOrder Self "energyPoint" -0.10 SetImagePositionZ Self "energyPoint" 0 0 SetImageScale Self "ShipModule.prpl" "Ship" GetScriptVar ->Ship <-Ship.ShipIsEnemy ->IsEnemy -1 ->target self "RadiusDisplay.prpl" AddScriptToUnit self "RadiusDisplay.prpl" "SCRIPT_NAME" "GeassWeapon.prpl" SetScriptVar self "RadiusDisplay.prpl" "RADIUS_VARNAME" "range" SetScriptVar self "RadiusDisplay.prpl" "IMAGE" "Custom8_256" SetScriptVar #Light Blue circle range 0 ->mode endonce Self "ShipModule.prpl" "ShipAngle" GetScriptVar ->ShipAngle Self "ShipModule.prpl" "delta" GetScriptVar ->Delta Self "ShipModule.prpl" "exist" GetScriptVar ->Exist <-Exist eq0 if self "main" 0 0 0 0 SetImageColor self "barrel" 0 0 0 0 SetImageColor self "barrel" 0 0 -0.05 SetImagePosition self "energyPoint" 0 0 0 0 SetImageColor self "energyPoint" 0 0 -0.10 SetImagePosition 0 ->recoil 0 ->cooldown return endif self "main" <-ShipAngle SetImageRotation IsPaused GetUpdateCount eq0 and if return endif <-Exist 1 eq if self "main" 255 255 255 128 SetImageColor self "barrel" 255 255 255 128 SetImageColor self "barrel" <-ShipAngle SetImageRotation <-ShipAngle ->BarrelAngle else self "main" 255 255 255 255 SetImageColor <-GemPresent if self "barrel" "Custom1_128" SetImage self "barrel" 255 255 255 255 SetImageColor self "barrel" 3.0 3.0 SetImageScale else self "barrel" "Custom6" SetImage self "barrel" 3.15 4.33 SetImageScale self "barrel" 255 255 255 255 SetImageColor endif <-Ship GetShipHasAmp ->GemPresent <-GemPresent if 270 ->range else <-IsEnemy if 124 ->range else 135 ->range endif endif <-BarrelAngle <-Delta add ->BarrelAngle <-recoil if <-recoil 1 sub ->recoil endif <-target -1 eq if <-cooldown if <-cooldown 1 sub ->cooldown else @findTarget endif else CurrentPixelCoords ->y ->x <-mode 2 eq if <-target GetShipPixelCoords ->py ->px endif <-mode 3 eq if <-target GetUnitPixelCoordX ->px <-target GetUnitPixelCoordY ->py endif <-px <-py <-x <-y Distance <-range 2 mul gt if -1 ->target @findTarget else 1 ->validate <-mode 2 eq if <-target GetShipIsDestroyed not ->validate endif <-mode 3 eq if <-target.UnitIsDestroyed not ->validate endif <-validate eq0 if -1 ->target else <-py <-y sub <-px <-x sub atan2 ->targetAngle <-targetAngle <-BarrelAngle ShortestAngle ->dist <-px 0 gte <-py 0 gte or not if @findTarget endif <-GemPresent if 0.05 ->value else <-IsEnemy if 0.04 ->value else 0.1 ->value endif endif <-dist abs <-value lt if <-targetAngle ->BarrelAngle CurrentCoords GetLand eq0 if 0 ->energy_use <-GemPresent if 15 ->energy_use else 20 ->energy_use endif <-px 0 gte <-py 0 gte or if <-Ship GetShipEnergy <-energy_use gte <-IsEnemy or if <-Ship GetShipEnergy <-energy_use sub ->energy <-Ship <-energy SetShipEnergy <-GemPresent if 40 ->cooldown 16 ->recoil else <-IsEnemy if 35 ->cooldown 15 ->recoil else 60 ->cooldown 18 ->recoil endif endif <-GemPresent if "PRPLCORE" 0 0 CreateUnit ->beam <-px ->beam.UnitPixelCoordX <-py ->beam.UnitPixelCoordY <-beam "GeassEffect.prpl" AddScriptToUnit <-beam "GeassEffect.prpl" "Duration" 30 SetScriptVar <-beam "main" "Custom1" SetImage <-beam "main" <-x <-y <-px <-py Distance 12 div 7 SetImageScale <-beam "main" <-targetAngle SetImageRotation <-beam "main" "Ships" SetImageLayer <-beam "main" 1 SetImageOrder <-beam "GeassEffect.prpl" "R" 255 SetScriptVar # =============================== <-beam "GeassEffect.prpl" "G" 64 SetScriptVar # =============================== <-beam "GeassEffect.prpl" "B" 64 SetScriptVar # =============================== <-beam "main" 255 64 64 255 SetImageColor # =============================== <-beam "main" <-x <-px sub 2 div <-y <-py sub 2 div -0.025 SetImagePosition else "PRPLCORE" 0 0 CreateUnit ->beam <-px ->beam.UnitPixelCoordX <-py ->beam.UnitPixelCoordY <-beam "BeamEffect.prpl" AddScriptToUnit <-beam "BeamEffect.prpl" "Duration" 30 SetScriptVar <-beam "main" "Custom1" SetImage <-beam "main" <-x <-y <-px <-py Distance 12 div 1 SetImageScale <-beam "main" <-targetAngle SetImageRotation <-beam "main" "Ships" SetImageLayer <-beam "main" 1 SetImageOrder <-beam "BeamEffect.prpl" "R" 255 SetScriptVar # =============================== <-beam "BeamEffect.prpl" "G" 64 SetScriptVar # =============================== <-beam "BeamEffect.prpl" "B" 64 SetScriptVar # =============================== <-beam "main" 255 64 64 255 SetImageColor # =============================== <-beam "main" <-x <-px sub 2 div <-y <-py sub 2 div -0.025 SetImagePosition endif "Misc7" PlaySound @Damage -1 ->target endif endif endif else <-dist 0 gt if <-GemPresent if <-BarrelAngle 0.05 sub ->BarrelAngle #was 0.025 else <-IsEnemy if <-BarrelAngle 0.04 sub ->BarrelAngle #was 0.035 else <-BarrelAngle 0.10 sub ->BarrelAngle #was 0.015 endif endif else <-GemPresent if <-BarrelAngle 0.05 add ->BarrelAngle #was 0.025 else <-IsEnemy if <-BarrelAngle 0.04 add ->BarrelAngle #was 0.035 else <-BarrelAngle 0.10 add ->BarrelAngle #was 0.015 endif endif endif endif endif endif endif Self "barrel" <-BarrelAngle SetImageRotation Self "barrel" <-BarrelAngle cos <-recoil mul -0.5 mul <-BarrelAngle sin <-recoil mul -0.5 mul -0.05 SetImagePosition <-GemPresent if 40.0 ->cooldownInterval else 60.0 ->cooldownInterval endif <-GemPresent if 40.0 ->cooldownInterval <-cooldownInterval <-cooldown sub <-cooldownInterval div ->percentReady Self "energyPoint" 255 64 64 255 <-percentReady mul SetImageColor Self "energyPoint" 1.66 <-percentReady mul 1.66 <-percentReady mul SetImageScale Self "energyPoint" dup2 GetImageRotation Pi 2 sqrt div <-percentReady mul add SetImageRotation Self "energyPoint" 0 0 -0.10 SetImagePosition else 60.0 ->cooldownInterval <-cooldownInterval <-cooldown sub <-cooldownInterval div ->percentReady Self "energyPoint" 255 64 64 255 <-percentReady mul SetImageColor Self "energyPoint" 1.0 <-percentReady mul 1.0 <-percentReady mul SetImageScale Self "energyPoint" 20.0 <-BarrelAngle cos mul 20.0 <-BarrelAngle sin mul -0.03 SetImagePosition Self "energyPoint" dup2 GetImageRotation Pi 2 sqrt div <-percentReady mul add SetImageRotation endif endif :findTarget 0 ->mode CurrentPixelCoords ->y ->x -1 ->target <-range 2 div ->range_2 <-range_2 ->minDist CurrentCoords <-range_2 0 GetAllShipsInRange ->Ships <-Ships GetListCount 0 do <-Ships[I] ->TargetableShip <-TargetableShip GetShipIsEnemy if <-TargetableShip GetShipPixelCoords PixelToCell <-x <-y PixelToCell Distance <-minDist lte if <-TargetableShip ->target <-TargetableShip GetShipPixelCoords PixelToCell <-x <-y PixelToCell Distance ->minDist 2 ->mode endif endif loop CurrentCoords <-range_2 0 GetAllUnitsInRange ->Units <-Units GetListCount 0 do <-Units[I] ->unit <-unit GetUnitIsEnemy if <-unit @CheckUnit if <-unit GetUnitCoordX <-unit GetUnitCoordY <-x <-y PixelToCell Distance <-minDist lte if <-unit ->target <-unit GetUnitCoordX <-unit GetUnitCoordY <-x <-y PixelToCell Distance ->minDist 3 ->mode endif endif endif loop :Damage <-GemPresent if 17 ->initialRadius else 1 ->initialRadius endif # Convert Ships <-px <-py PixelToCell <-initialRadius 0 GetAllShipsInRange ->Ships <-Ships GetListCount 0 do <-Ships[I] ->targetShip <-targetShip GetShipIsEnemy if 1 ->r <-targetShip GetShipPixelCoords PixelToCell ->y0 ->x0 <-r 1 add 0 <-r sub do <-r 1 add 0 <-r sub do I <-x0 add J <-y0 add CellToPixel 0 0 2 <-IsEnemy CreateParticle ->instantDeath 100 ->instantDeath.ParticleHealth <-instantDeath 1 SetParticleDestroyAtEdge <-instantDeath 0 SetParticleMaxSpeed <-instantDeath 2 SetParticleMaxAge loop loop endif loop # Convert Units <-px <-py PixelToCell <-initialRadius 0 GetAllUnitsInRange ->Units <-Units GetListCount 0 do <-Units[I] ->unit <-unit GetUnitIsEnemy if <-unit @CheckUnit if <-unit @CheckUnitLatheProtected if <-unit 1 SetUnitLatheTargets endif <-unit @CheckInstantDeathUnit if <-unit.UnitHealth 1.0 sub ->unit.UnitHealth else <-unit <-IsEnemy SetUnitIsEnemy endif endif endif loop :CheckInstantDeathUnit GetUnitType ->type 0 ->value <-type "Stunner" eq if 1 ->value endif <-type "Stunner(Clone)" eq if 1 ->value endif <-type "Omni" eq if 1 ->value endif <-type "Fighter" eq if 1 ->value endif <-type "Fighter(Clone)" eq if 1 ->value endif <-value :CheckUnit GetUnitType ->type 0 ->value <-type "Emitter" eq if 1 ->value endif <-type "Emitter(Clone)" eq if 1 ->value endif <-type "MireSpawner" eq if 1 ->value endif <-type "DoppelSpawner" eq if 1 ->value endif <-type "ShipSpawner" eq if 1 ->value endif <-type "StunnerSpawner" eq if 1 ->value endif <-type "PhalanxGun" eq if 1 ->value endif <-type "PhalanxGun(Clone)" eq if 1 ->value endif <-type "TiconGun" eq if 1 ->value endif <-type "TiconGun(Clone)" eq if 1 ->value endif <-type "Stunner" eq if 1 ->value endif <-type "Stunner(Clone)" eq if 1 ->value endif <-type "Fighter" eq if 1 ->value endif <-type "Fighter(Clone)" eq if 1 ->value endif <-type "Doppel" eq if 1 ->value endif <-type "Doppel(Clone)" eq if 1 ->value endif <-type "EnergyMine" eq if 1 ->value endif <-type "EnergyMine(Clone)" eq if 1 ->value endif <-type "Omni" eq if 1 ->value endif <-value :CheckUnitLatheProtected GetUnitType ->type 0 ->value <-type "Emitter" eq if 1 ->value endif <-type "MireSpawner" eq if 1 ->value endif <-type "DoppelSpawner" eq if 1 ->value endif <-type "ShipSpawner" eq if 1 ->value endif <-type "StunnerSpawner" eq if 1 ->value endif <-value :destroyed ClearLocals