package PlayerData import Wave import PhysicsProjectile import initlater Selector import Builder import initlater EndGame import LumberAndCoinSystem public constant allPlayers = new LinkedList() public PlayerData array pDatas public boolean bigArena public enum BuilderType SLIM FAT ELVEN public class PlayerData player p int kills = 0 boolean alive = true int deaths = 0 Builder builder = null Selector select = null BuilderType btype construct(player p) this.p = p pDatas[p.getId()] = this allPlayers.add(this) SetPlayerTechMaxAllowed(p, 'h028', 0) ondestroy allPlayers.remove(this) if allPlayers.size() > 0 let goldSplit = ((p.getGold() / allPlayers.size()) * 1.15).round() for pd in allPlayers pd.p.addGold(goldSplit) let lumberSplit = ((p.getLumber() / allPlayers.size()) * 1.15).round() for pd in allPlayers pd.p.addGold(lumberSplit) if builder != null builder.terminate() if select != null select.terminate() pDatas[p.getId()] = null p..setGold(0) ..setLumber(0) if not gameOver printTimed(p.getNameColored() + " has left! Their resources have been distributed.", 10.) public function initPlayers() EventListener.add(EVENT_PLAYER_LEAVE, () -> destroy pDatas[GetTriggerPlayer().getId()]) for int i = 0 to 7 if players[i].getSlotState() == PLAYER_SLOT_STATE_PLAYING and players[i].getController() == MAP_CONTROL_USER new PlayerData(players[i]) real gold if allPlayers.size() > 4 bigArena = true WOOD_REDISTRIBUTE_THRESHOLD += 7 initCreepStarts(true) gold = 1245 gg_cam_Camera_003.applyForceDuration(true, 0.) gg_cam_Camera_004.applyForceDuration(true, 1.5) else bigArena = false initCreepStarts(false) gold = 490 gg_cam_Camera_001.applyForceDuration(true, 0.) gg_cam_Camera_002.applyForceDuration(true, 1.5) let anglePerP = 360/allPlayers.size() var current = GetRandomInt(0, allPlayers.size()) * anglePerP + GetRandomInt(0, 4) * 90 for p in allPlayers p.select = new Selector(middle.polarOffset((current).asAngleDegrees(), 285.).toVec3(), p.p) current += anglePerP p.p.addGold((gold/allPlayers.size()).toInt()) createFText(middle.toVec3() - vec3(80,0,0), "Item Shop", 17.5)