# Mortar.crpl # Created on: 12/19/2018 9:27:47 PM # ------------------------------------------ once $UnitTarget:-1 $BigMortar:1 Self CONST_CREATEPZ 0 SetUnitAttribute Self CONST_NULLIFIERDAMAGES 0 SetUnitAttribute Self CONST_MAXHEALTH 200 SetUnitAttribute Self CONST_HEALTH 200 SetUnitAttribute Self CONST_HEALRATE 0 SetUnitAttribute Self CONST_SNIPERTARGET 1 SetUnitAttribute Self CONST_SNIPERIGNORELOS 1 SetUnitAttribute Self CONST_SHOWHEALTHBAR 0 SetUnitAttribute Self CONST_DESTROYMODE 1 SetUnitAttribute Self CONST_DESTROYONDAMAGE 1 SetUnitAttribute CurrentPixelCoords ->StartY ->StartX <-BigMortar 1 eq if <-UnitTarget CONST_PIXELCOORDX GetUnitAttribute ->EndX <-UnitTarget CONST_PIXELCOORDY GetUnitAttribute ->EndY <-UnitTarget CONST_COORDX GetUnitAttribute ->DeathX <-UnitTarget CONST_COORDY GetUnitAttribute ->DeathY <-StartX <-EndX sub dup mul <-StartY <-EndY sub dup mul add sqrt ->TotalDistance 0.75 ->Size 6 ->Radius 0.2 ->Rotation else CurrentCoords 17 RandCoordsInRange ->DeathY ->DeathX <-DeathX <-DeathY CellToPixel ->EndY ->EndX <-StartX <-EndX sub dup mul <-StartY <-EndY sub dup mul add sqrt ->TotalDistance 0.25 ->Size 3 ->Radius 0.66 ->Rotation endif Self "main" "Custom6" SetImage Self "main" 120 255 120 255 SetImageColor Self "main" <-Size <-Size SetImageScale Self "Shadow" "Custom6" SetImage Self "Shadow" 0 0 0 120 SetImageColor Self "Shadow" <-Size <-Size SetImageScale Self "Shadow" -5 SetImagePositionZ Self "main" -30 SetImagePositionZ CurrentCoords <-DeathX <-DeathY 2.25 QueueMove endonce CurrentPixelCoords ->CurrentY ->CurrentX <-CurrentX <-EndX sub dup mul <-CurrentY <-EndY sub dup mul add sqrt <-TotalDistance div ->Ratio mul(<-Ratio dup mul -4.0) mul(<-Ratio 4) add ->YShift Self "main" <-YShift 20 mul SetImagePositionY CurrentX <-DeathX eq CurrentY <-DeathY eq and if <-UnitTarget -1 neq if <-UnitTarget CONST_HEALTH dup2 GetUnitAttribute 1 sub SetUnitAttribute <-UnitTarget CONST_HEALTH GetUnitAttribute 0 lte if <-UnitTarget 2 Destroy endif endif CurrentCoords <-Radius 0 GetAllUnitsInRange 0 do ->Unit <-Unit GetUnitType "CRPLCORE" neq <-Unit GetUnitType "TOTEM" neq and <-Unit GetUnitType "EMITTER" neq and <-Unit GetUnitType "POWERZONE" neq and <-Unit GetUnitType "OREDEPOSIT" neq and <-Unit GetUnitType "SPORETOWER" neq and <-Unit GetUnitType "RUNNERNEST" neq and <-Unit GetUnitType "RUNNER" neq and <-Unit CONST_ISLANDED GetUnitAttribute and if <-Unit CONST_HEALTH dup2 GetUnitAttribute <-Size 2.0 div sub SetUnitAttribute <-Unit CONST_HEALTH GetUnitAttribute 0 lte if <-Unit 2 Destroy endif endif loop <-BigMortar 1 eq if 15 0 do "CRPLCORE" CurrentCoords CreateUnit ->CORE <-CORE "Mortar.crpl" AddscripttoUnit <-CORE "Mortar.crpl" "BigMortar" 0 SetScriptVar loop endif Self 2 Destroy endif Self "main" dup2 GetImageRotation <-Rotation add SetImageRotation Self "Shadow" dup2 GetImageRotation <-Rotation add SetImageRotation