@@ -261,7 +261,7 @@ private void assertCanRemoveDirt(MapLocation loc) throws GameActionException {
261261 assertIsRobotType (this .robot .getType ());
262262 assertCanActLocation (loc , GameConstants .BUILD_DISTANCE_SQUARED );
263263
264- if ((this .robot .getType ().isRatType ()
264+ if ((this .robot .getType ().isBabyRatType ()
265265 || this .robot .getType ().isRatKingType ()) && (this .getAllCheese () < GameConstants .DIG_DIRT_CHEESE_COST ))
266266 throw new GameActionException (CANT_DO_THAT , "Insufficient cheese to remove dirt!" );
267267
@@ -413,7 +413,7 @@ public void removeDirt(MapLocation loc) throws GameActionException {
413413 assertCanRemoveDirt (loc );
414414 this .gameWorld .setDirt (loc , false );
415415 this .gameWorld .getTeamInfo ().updateDirt (this .robot .getTeam (), false );
416- if (this .robot .getType ().isRatType () || this .robot .getType ().isRatKingType ())
416+ if (this .robot .getType ().isBabyRatType () || this .robot .getType ().isRatKingType ())
417417 this .robot .addCheese (-1 * GameConstants .DIG_DIRT_CHEESE_COST );
418418
419419 this .robot .addActionCooldownTurns (GameConstants .DIG_COOLDOWN );
@@ -427,7 +427,7 @@ private void assertCanPickUpCheese(MapLocation loc) throws GameActionException {
427427
428428 if (this .gameWorld .getCheeseAmount (loc ) <= 0 )
429429 throw new GameActionException (CANT_DO_THAT , "No cheese at this location!" );
430- if (this .robot .getType () != UnitType .RAT && this .robot .getType () != UnitType .RAT_KING )
430+ if (this .robot .getType () != UnitType .BABY_RAT && this .robot .getType () != UnitType .RAT_KING )
431431 throw new GameActionException (CANT_DO_THAT , "Only rats can pick up cheese" );
432432 }
433433
@@ -750,7 +750,7 @@ private void assertCanMove(Direction d) throws GameActionException {
750750 InternalRobot occupyingRobot = this .gameWorld .getRobot (loc );
751751 if ((occupyingRobot != null ) && (occupyingRobot .getID () != this .robot .getID ())) {
752752
753- if (occupyingRobot .getType ().isRatType () && this .getType ().isCatType ()) {
753+ if (occupyingRobot .getType ().isBabyRatType () && this .getType ().isCatType ()) {
754754 System .out .println ("Cat killed a rat by stepping on it" );
755755 } else {
756756 System .out .println ("DEBUGGING: " + this .robot .getID () + " collision with robot of type "
@@ -807,7 +807,7 @@ public void processTrapsAtLocation(MapLocation loc) {
807807 for (int j = this .gameWorld .getTrapTriggers (loc ).size () - 1 ; j >= 0 ; j --) {
808808 Trap trap = this .gameWorld .getTrapTriggers (loc ).get (j );
809809 TrapType type = trap .getType ();
810- boolean wrongTrapType = ((this .getType ().isRatType () || this .getType ().isRatKingType ())
810+ boolean wrongTrapType = ((this .getType ().isBabyRatType () || this .getType ().isRatKingType ())
811811 && type == TrapType .CAT_TRAP )
812812 || (this .getType ().isCatType () && type == TrapType .RAT_TRAP );
813813
@@ -830,7 +830,7 @@ public void move(Direction d) throws GameActionException {
830830 MapLocation newLoc = curLocs [i ].add (d );
831831 InternalRobot crushedRobot = this .gameWorld .getRobot (newLoc );
832832 if (crushedRobot != null && this .getID () != crushedRobot .getID () && this .getType ().isCatType ()
833- && crushedRobot .getType ().isRatType ()) {
833+ && crushedRobot .getType ().isBabyRatType ()) {
834834 // kill this rat
835835 crushedRobot .addHealth (-crushedRobot .getHealth ());
836836 }
@@ -873,7 +873,7 @@ public void turn(Direction d) throws GameActionException {
873873 @ Override
874874 public int getCurrentRatCost () {
875875 return GameConstants .BUILD_ROBOT_BASE_COST +
876- GameConstants .BUILD_ROBOT_COST_INCREASE * (this .gameWorld .getTeamInfo ().getNumRats (getTeam ())
876+ GameConstants .BUILD_ROBOT_COST_INCREASE * (this .gameWorld .getTeamInfo ().getNumBabyRats (getTeam ())
877877 / GameConstants .NUM_ROBOTS_FOR_COST_INCREASE );
878878 }
879879
@@ -919,13 +919,13 @@ public boolean canBuildRobot(MapLocation loc) {
919919 public void buildRobot (MapLocation loc ) throws GameActionException {
920920 assertCanBuildRobot (loc );
921921 this .robot .addActionCooldownTurns (GameConstants .BUILD_ROBOT_COOLDOWN );
922- this .gameWorld .spawnRobot (UnitType .RAT , loc , this .getDirection (), this .robot .getChirality (),
922+ this .gameWorld .spawnRobot (UnitType .BABY_RAT , loc , this .getDirection (), this .robot .getChirality (),
923923 this .robot .getTeam ());
924924 int cost = getCurrentRatCost ();
925925 this .robot .addCheese (-cost );
926926 InternalRobot robotSpawned = this .gameWorld .getRobot (loc );
927927 this .gameWorld .getMatchMaker ().addSpawnAction (robotSpawned .getID (), loc , this .robot .getDirection (),
928- this .robot .getChirality (), getTeam (), UnitType .RAT );
928+ this .robot .getChirality (), getTeam (), UnitType .BABY_RAT );
929929 }
930930
931931 public void buildTrap (TrapType type , MapLocation loc ) throws GameActionException {
@@ -964,7 +964,7 @@ private void assertCanAttack(MapLocation loc) throws GameActionException {
964964 }
965965
966966 switch (this .robot .getType ()) {
967- case RAT , RAT_KING :
967+ case BABY_RAT , RAT_KING :
968968 assertCanAttackRat (loc );
969969 break ;
970970 case CAT :
@@ -1014,10 +1014,10 @@ public void assertCanBecomeRatKing() throws GameActionException {
10141014 for (Direction d : Direction .allDirections ()) {
10151015 MapLocation curLoc = this .adjacentLocation (d );
10161016 InternalRobot curRobot = this .gameWorld .getRobot (curLoc );
1017- if (curRobot != null && curRobot .getTeam () == this .robot .getTeam () && curRobot .getType () == UnitType .RAT ) {
1017+ if (curRobot != null && curRobot .getTeam () == this .robot .getTeam () && curRobot .getType () == UnitType .BABY_RAT ) {
10181018 numAllyRats += 1 ;
10191019 }
1020- if (curRobot != null && !curRobot .getType ().isRatType ()) {
1020+ if (curRobot != null && !curRobot .getType ().isBabyRatType ()) {
10211021 throw new GameActionException (CANT_DO_THAT ,
10221022 "Can't become a rat king when there are nearby cats or rat kings!" );
10231023 }
@@ -1159,7 +1159,7 @@ private void assertCanTransferCheese(MapLocation loc, int amount) throws GameAct
11591159 if (robot .getTeam () != this .robot .getTeam ()) {
11601160 throw new GameActionException (CANT_DO_THAT , "Cannot transfer resources to the enemy team!" );
11611161 }
1162- if (!this .robot .getType ().isRatType ()) {
1162+ if (!this .robot .getType ().isBabyRatType ()) {
11631163 throw new GameActionException (CANT_DO_THAT , "Only rats can transfer cheese!" );
11641164 }
11651165 if (!robot .getType ().isRatKingType ()) {
@@ -1195,7 +1195,7 @@ public void transferCheese(MapLocation loc, int amount) throws GameActionExcepti
11951195 public void assertCanThrowRat (Direction dir ) throws GameActionException {
11961196 assertIsActionReady ();
11971197 MapLocation nextLoc = this .getLocation ().add (dir );
1198- if (!this .robot .getType ().isRatType ()) {
1198+ if (!this .robot .getType ().isBabyRatType ()) {
11991199 throw new GameActionException (CANT_DO_THAT , "Only rats can throw other rats!" );
12001200 }
12011201 if (!this .robot .isCarryingRobot ())
@@ -1211,7 +1211,7 @@ public void assertCanThrowRat(Direction dir) throws GameActionException {
12111211 public void assertCanDropRat (Direction dir ) throws GameActionException {
12121212 assertIsActionReady ();
12131213 MapLocation nextLoc = this .getLocation ().add (dir );
1214- if (!this .robot .getType ().isRatType ()) {
1214+ if (!this .robot .getType ().isBabyRatType ()) {
12151215 throw new GameActionException (CANT_DO_THAT , "Only rats can drop other rats!" );
12161216 }
12171217 if (!this .robot .isCarryingRobot ())
@@ -1261,7 +1261,7 @@ public void assertCanCarryRat(MapLocation loc) throws GameActionException {
12611261 assertIsActionReady ();
12621262
12631263 // Must be a rat-type
1264- if (!this .robot .getType ().isRatType ()) {
1264+ if (!this .robot .getType ().isBabyRatType ()) {
12651265 throw new GameActionException (CANT_DO_THAT , "Only rats can grab other rats!" );
12661266 }
12671267
0 commit comments