Skip to content

Commit c1401ed

Browse files
committed
Merge branch 'master' of github.com:battlecode/battlecode26 into trap_changes
2 parents e8d385c + 5c42ca2 commit c1401ed

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Note, Competitors
66
This is the development repo! You most likely won't need anything in here; do not clone this.
7-
Instead, follow the instructions [here](https://play.battlecode.org/bc26java/quick_start) to get started.
7+
Instead, follow the instructions [here](https://play.battlecode.org/bc26/quick_start) to get started.
88

99
## Repository Structure
1010

engine/src/main/battlecode/world/GameWorld.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -887,11 +887,11 @@ public boolean setWinnerIfMorePoints() {
887887

888888
for (Team team : List.of(Team.A, Team.B)) {
889889

890-
float proportion_rat_kings = total_num_rat_kings != 0 ? teamInfo.getNumRatKings(team) / total_num_rat_kings : 0;
891-
float proportion_cheese_transferred = total_amount_cheese_transferred != 0 ? teamInfo.getCheeseTransferred(team) / total_amount_cheese_transferred : 0;
892-
float proportion_cat_damage = total_amount_cat_damage != 0 ? teamInfo.getDamageToCats(team) / total_amount_cat_damage : 0;
890+
float proportion_rat_kings = total_num_rat_kings != 0 ? (float)teamInfo.getNumRatKings(team) / total_num_rat_kings : 0.0f;
891+
float proportion_cheese_transferred = total_amount_cheese_transferred != 0 ? (float)teamInfo.getCheeseTransferred(team) / total_amount_cheese_transferred : 0.0f;
892+
float proportion_cat_damage = total_amount_cat_damage != 0 ? (float)teamInfo.getDamageToCats(team) / total_amount_cat_damage : 0.0f;
893893

894-
int points = (int) (cat_weight * 100 * (proportion_cat_damage) + king_weight * 100 * proportion_rat_kings
894+
int points = (int) (cat_weight * 100 * proportion_cat_damage + king_weight * 100 * proportion_rat_kings
895895
+ cheese_transfer_weight * 100 * proportion_cheese_transferred);
896896
this.teamInfo.addPoints(team, points);
897897
teamPoints.add(points);

engine/src/main/battlecode/world/RobotControllerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,9 @@ public void becomeRatKing() throws GameActionException {
11481148
this.gameWorld.getTeamInfo().addCheese(this.getTeam(), -GameConstants.RAT_KING_UPGRADE_CHEESE_COST);
11491149
health = Math.min(health, UnitType.RAT_KING.health);
11501150

1151-
robot.becomeRatKing(health);
1151+
this.gameWorld.getTeamInfo().addCheese(this.getTeam(), robot.getCheese());
1152+
this.robot.addCheese(-this.robot.getCheese());
1153+
this.robot.becomeRatKing(health);
11521154

11531155

11541156
for (Direction d : Direction.allDirections()) {

maps/cheeseguardians.map26

11.5 KB
Binary file not shown.

maps/evileye.map26

1.47 KB
Binary file not shown.

0 commit comments

Comments
 (0)