# BaseScript.crpl # Created on: 12/19/2017 1:51:44 PM # ------------------------------------------ once CurrentCoords ->Y ->X CreateList ->SpawnList CreateList ->XArray <-XArray <-X Appendtolist CreateList ->YArray <-YArray <-Y Appendtolist CreateList ->BaseDirections <-BaseDirections "R" Appendtolist <-BaseDirections "L" Appendtolist <-BaseDirections "U" Appendtolist <-BaseDirections "D" Appendtolist CreateList ->Directions <-BaseDirections GetListCount 0 do <-Directions <-BaseDirections I GetListElement Appendtolist loop $freq:18 $freqmax:6 $Load:50 $LoadJump:5 $LoadMax:200 $SpawnLoadMul:1.0 #Multiplier Self ->DadID 0 ->Count 0 ->SpawnCount 0 ->SpawnWin endonce <-SpawnWin 1 eq if @EndLine 0 ->SpawnWin endif GetGameTimeFrames <-freq mod eq0 if RANDINT(0 <-Directions GetListCount) ->Index <-Directions <-Index GetListElement ->Direction <-Direction "R" eq if 1 ->Xmod 0 ->Ymod endif <-Direction "L" eq if -1 ->Xmod 0 ->Ymod endif <-Direction "U" eq if 0 ->Xmod -1 ->Ymod endif <-Direction "D" eq if 0 ->Xmod 1 ->Ymod endif <-XArray <-XArray GetListCount 1 sub GetListElement ->Xo <-YArray <-YArray GetListCount 1 sub GetListElement ->Yo <-Xo <-Xmod add ->X <-Yo <-Ymod add ->Y <-Count 1 add ->Count <-Count 5 eq if <-Directions <-Direction Appendtolist 0 ->Count endif <-Directions GetListCount 20 gt if <-Directions 0 RemoveListElement endif <-SpawnCount 1 add ->SpawnCount <-SpawnCount 15 eq if 0 ->SpawnCount "CRPLCORE" <-X <-Y CreateUnit ->Spawn <-Spawn "SpawnScript.crpl" AddScriptToUnit <-Spawn "SpawnScript.crpl" "DadID" <-DadID SetScriptVar <-Spawn "SpawnScript.crpl" "freq" <-freq SetScriptVar <-Spawn "SpawnScript.crpl" "Load" <-Load <-SpawnLoadMul mul SetScriptVar <-Spawn CONST_CREATEPZ 0 SetUnitAttribute <-SpawnList <-Spawn Appendtolist endif <-XArray <-X Appendtolist <-YArray <-Y Appendtolist <-X <-Y <-Load SetCreeperNoLower <-X <-Y 1 0 SetPinFieldCell endif <-X eq0 <-X MapWidth 1 sub eq or <-Y eq0 or <-Y MapHeight 1 sub eq or if @EndLine endif :EndLine <-XArray GetListCount 0 do <-XArray I GetListElement ->Xo <-YArray I GetListElement ->Yo <-Xo <-Yo 0 0 SetPinFieldCell loop --Directions CreateList ->Directions <-BaseDirections GetListCount 0 do <-Directions <-BaseDirections I GetListElement Appendtolist loop --XArray CreateList ->XArray <-XArray CurrentX Appendtolist --YArray CreateList ->YArray <-YArray CurrentY Appendtolist <-freq 1 sub ->freq <-freq <-freqmax lt if <-freqmax ->freq endif <-Load <-LoadJump add ->Load <-Load <-LoadMax gt if <-LoadMax ->Load endif 0 ->Count <-SpawnList GetListCount 0 do <-SpawnList I GetListElement ->SL <-SL 0 Destroy loop --SpawnList CreateList ->SpawnList 0 ->SpawnCount :Awake Self CONST_NULLIFIERDAMAGES 0 SetUnitAttribute Self CONST_COUNTSFORVICTORY 0 SetUnitAttribute #Self "main" "Custom1" SetImage #Self "main" PI SetImageRotation Self "main" 2 2 SetImageScale Self "main" 255 150 150 255 SetImageColor Self CONST_CELLHEIGHT 5 SetUnitAttribute Self CONST_CELLWIDTH 5 SetUnitAttribute