package Wave import initlater Boss public vec3 array startPositions public rect array spawnRects public int startPosCount public vec2 middle enum creeptype MELEE MAGE RANGED public class NormalWave int meleeId int mageId int rangedId int amount int bounty creeptype typ = creeptype.MELEE construct(int meleeId, int mageId, int rangedId, int amount, int bounty) this.meleeId = meleeId this.mageId = mageId this.rangedId = rangedId this.amount = amount this.bounty = bounty function spawn() doAfter(0.1, () -> spawnCallback()) function spawnCallback() int id var destroyWave = false switch typ case creeptype.MELEE id = meleeId typ = creeptype.MAGE doAfter(0.8, () -> spawnCallback()) case creeptype.MAGE id = mageId typ = creeptype.RANGED doAfter(0.8, () -> spawnCallback()) case creeptype.RANGED id = rangedId destroyWave = true for i = 0 to amount - 1 doAfter(i.toReal()) -> for j = 0 to startPosCount let spoint = spawnRects[j].randomPoint().toVec3() new Creep(spoint, id, bounty, middle, spoint.angleTo2d(middle)) if destroyWave destroy this public abstract class CreateBoss abstract function create(vec3 startPos, int unitId, int bounty, vec2 middle) public class BossWave int bossId int amount int bounty SoundDefinition s string info CreateBoss boss construct(int bossId, int amount, int bounty, string s, CreateBoss boss) this.bossId = bossId this.amount = amount this.bounty = bounty this.s = new SoundDefinition(s, false) this.boss = boss function spawn() s.play() print("|cffE62121## Attention:|r Boss incoming!") for i = 0 to amount-1 for j = 0 to startPosCount boss.create(spawnRects[j].randomPoint().toVec3(), bossId, bounty, middle) destroy boss public abstract class CreateSpecial abstract function create(vec3 startPos, int unitId, int bounty, vec2 middle) public class SpecialWave int specialId int amount int bounty CreateSpecial special construct(int specialId, int amount, int bounty, CreateSpecial special) this.specialId = specialId this.amount = amount this.bounty = bounty this.special = special function spawn() print("|cffE62121##|r |cff087BB5B|r|cff0C79B1r|r|cff1077ADa|r|cff1475A9c|r|cff1873A5e|r |cff206F9Dy|r|cff246D99o|r|cff286B95u|r|cff2C6991r|r|cff30678Ds|r|cff346589e|r|cff386385l|r|cff3C6181v|r|cff405F7De|r|cff445D79s|r|cff485B75:|r |cff50576DS|r|cff545569p|r|cff585365e|r|cff5C5161c|r|cff604F5Di|r|cff644D59a|r|cff684B55l|r|cff6C4951s|r |cff744549a|r|cff784345r|r|cff7C4141e|r |cff843D39c|r|cff883B35o|r|cff8C3931m|r|cff90372Di|r|cff943529n|r|cff983325g|r|cff9C3121!|r") for i = 0 to amount-1 doAfter(i.toReal()) -> for j = 0 to startPosCount special.create(spawnRects[j].randomPoint().toVec3(), specialId, bounty, middle) doAfter(amount.toReal(), () -> destroy special) public function initCreepStarts(boolean eight) if(eight) startPosCount = 7 startPositions[0] = vec3(7300.,3400.,0) spawnRects[0] = gg_rct_bigLeftTop startPositions[1] = vec3(11100,4200,0) spawnRects[1] = gg_rct_bigTopLeft startPositions[2] = vec3(14000.,4100.,0) spawnRects[2] = gg_rct_bigTopRight startPositions[3] = vec3(17000.,1000.,0) spawnRects[3] = gg_rct_bigRightTop startPositions[4] = vec3(16000.,-2000.,0) spawnRects[4] = gg_rct_bigRightBot startPositions[5] = vec3(14000,-4000.,0) spawnRects[5] = gg_rct_bigBotRight startPositions[6] = vec3(10000.,-4100.,0) spawnRects[6] = gg_rct_bigBotLeft startPositions[7] = vec3(7000.,-600.,0) spawnRects[7] = gg_rct_bigLeftBot middle = vec2( gg_unit_h00E_0007.getX(), gg_unit_h00E_0007.getY() ) else startPosCount = 3 startPositions[0] = vec3(2549.,-700.,0) spawnRects[0] = gg_rct_smallBot startPositions[1] = vec3(-380,1200.,0) spawnRects[1] = gg_rct_smallLeft startPositions[2] = vec3(3600.,4100.,0) spawnRects[2] = gg_rct_smallTop startPositions[3] = vec3(4324.,2261.,0) spawnRects[3] = gg_rct_smallRight middle = vec2( gg_unit_h00E_0008.getX(), gg_unit_h00E_0008.getY() )