diff --git a/engine/src/main/battlecode/world/InternalRobot.java b/engine/src/main/battlecode/world/InternalRobot.java index 50d12f37..b2fcf2fb 100644 --- a/engine/src/main/battlecode/world/InternalRobot.java +++ b/engine/src/main/battlecode/world/InternalRobot.java @@ -59,6 +59,7 @@ public InternalRobot(GameWorld gw, int id, RobotType type, MapLocation loc, Team this.type = type; this.location = loc; this.level = 1; + if (this.type == RobotType.ARCHON) { this.mode = RobotMode.TURRET; } else if (this.type.isBuilding()) { @@ -66,7 +67,13 @@ public InternalRobot(GameWorld gw, int id, RobotType type, MapLocation loc, Team } else { this.mode = RobotMode.DROID; } - this.health = (int) ((this.mode == RobotMode.PROTOTYPE ? GameConstants.PROTOTYPE_HP_PERCENTAGE : 1) * this.type.getMaxHealth(this.level)); + + this.health = this.type.getMaxHealth(this.level); + if (this.mode == RobotMode.PROTOTYPE) { + int newHealth = (int) (GameConstants.PROTOTYPE_HP_PERCENTAGE * this.health); + this.gameWorld.getMatchMaker().addAction(getID(), Action.CHANGE_HEALTH, newHealth - this.health); + this.health = newHealth; + } this.controlBits = 0; this.currentBytecodeLimit = type.bytecodeLimit;