Skip to content

Commit 951f04e

Browse files
Merge branch 'master' into release-config
2 parents 4593750 + b4798f1 commit 951f04e

File tree

16 files changed

+334
-226
lines changed

16 files changed

+334
-226
lines changed

client/src/components/sidebar/game/team-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const UnitsTable: React.FC<UnitsTableProps> = ({ teamStat, teamIdx }) =>
161161

162162
const GlobalUpgradeSection: React.FC<{ teamStat: TeamTurnStat | undefined }> = ({ teamStat }) => {
163163
const upgradeTypes: [schema.GlobalUpgradeType, string][] = [
164-
[schema.GlobalUpgradeType.ACTION_UPGRADE, 'Global Action Upgrade'],
164+
[schema.GlobalUpgradeType.ACTION_UPGRADE, 'Global Attack Upgrade'],
165165
[schema.GlobalUpgradeType.CAPTURING_UPGRADE, 'Global Capturing Upgrade'],
166166
[schema.GlobalUpgradeType.HEALING_UPGRADE, 'Global Healing Upgrade']
167167
]

client/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { schema } from 'battlecode-schema'
22

3-
export const GAME_VERSION = '1.2.5'
4-
export const SPEC_VERSION = '1.2.5'
3+
export const GAME_VERSION = '2.0.0'
4+
export const SPEC_VERSION = '2.0.0'
55
export const BATTLECODE_YEAR: number = 2024
66
export const MAP_SIZE_RANGE = {
77
min: 30,

engine/src/main/battlecode/common/GameConstants.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class GameConstants {
99
/**
1010
* The current spec version the server compiles with.
1111
*/
12-
public static final String SPEC_VERSION = "1.2.5";
12+
public static final String SPEC_VERSION = "2.0.0";
1313

1414
// *********************************
1515
// ****** MAP CONSTANTS ************
@@ -72,7 +72,7 @@ public class GameConstants {
7272
public static final int DIG_COST = 20;
7373

7474
/** Crumbs cost for filling */
75-
public static final int FILL_COST = 10;
75+
public static final int FILL_COST = 30;
7676

7777
/** Number of rounds between updating the random noisy flag broadcast location */
7878
public static final int FLAG_BROADCAST_UPDATE_INTERVAL = 100;
@@ -96,7 +96,7 @@ public class GameConstants {
9696
public static final int SETUP_ROUNDS = 200;
9797

9898
/** Number of rounds between adding a global upgrade point */
99-
public static final int GLOBAL_UPGRADE_ROUNDS = 750;
99+
public static final int GLOBAL_UPGRADE_ROUNDS = 600;
100100

101101
/** Number of rounds robots must spend in jail before respawning */
102102
public static final int JAILED_ROUNDS = 25;
@@ -142,6 +142,6 @@ public class GameConstants {
142142
public static final int DIG_COOLDOWN = 20;
143143

144144
/** The amount added to the action cooldown counter after filling */
145-
public static final int FILL_COOLDOWN = 20;
145+
public static final int FILL_COOLDOWN = 30;
146146

147147
}
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
11
package battlecode.common;
22

33
/**
4-
* Enumerates the possible types of global updates. More information about each update
5-
* are available in the game specs.
4+
* Enumerates the possible types of global updates. More information about each
5+
* update
6+
* are available in the game specs.
67
*/
78

89
public enum GlobalUpgrade {
910

1011
/**
11-
* Action upgrade increases the amount cooldown drops per round by 4.
12+
* Attack upgrade increases the base attack by 75.
1213
*/
13-
ACTION(4, 0, 0),
14+
ATTACK(75, 0, 0, 0),
1415

1516
/**
1617
* Healing increases base heal by 50.
1718
*/
18-
HEALING(0, 50, 0),
19+
HEALING(0, 50, 0, 0),
1920

2021
/**
21-
* Capture upgrade increases the dropped flag delay from 4 rounds to 12 rounds.
22+
* Capture upgrade increases the dropped flag delay from 4 rounds to 12 rounds. It also decreases the movement penalty for holding a flag by 8.
2223
*/
23-
CAPTURING(0, 0, 8);
24+
CAPTURING(0, 0, 8, -8);
2425

2526
/**
26-
* How much cooldown reduction changes
27+
* How much base attack changes
2728
*/
28-
public final int cooldownReductionChange;
29+
public final int baseAttackChange;
2930

3031
/**
3132
* How much base heal changes
3233
*/
3334
public final int baseHealChange;
3435

3536
/**
36-
* how much dropped flag return delay changes
37+
* How much dropped flag return delay changes
3738
*/
3839
public final int flagReturnDelayChange;
3940

40-
GlobalUpgrade(int cooldownReductionChange, int baseHealChange, int flagReturnDelayChange){
41-
this.cooldownReductionChange = cooldownReductionChange;
41+
/**
42+
* How much the movement penalty for holding a flag changes.
43+
*/
44+
public final int movementDelayChange;
45+
46+
GlobalUpgrade(int baseAttackChange, int baseHealChange, int flagReturnDelayChange, int movementDelayChange) {
47+
this.baseAttackChange = baseAttackChange;
4248
this.baseHealChange = baseHealChange;
4349
this.flagReturnDelayChange = flagReturnDelayChange;
50+
this.movementDelayChange = movementDelayChange;
4451
}
4552
}

engine/src/main/battlecode/common/MapInfo.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,14 @@ public boolean isSpawnZone() {
7878
}
7979

8080
/**
81-
* Returns 1 if this square is a Team A spawn zone,
82-
* 2 if this square is a Team B spawn zone, and
83-
* 0 if this square is not a spawn zone.
81+
* Returns the team that owns that spawn zone at this location, or Team.NEUTRAL if the location is not a spawn zone.
8482
*
85-
* @return 1 or 2 if the square is a Team A or B spawn zone, respectively; 0 otherwise
83+
* @return The team that owns the spawn zone, or Team.NEUTRAL
8684
*
8785
* @battlecode.doc.costlymethod
8886
*/
89-
public int getSpawnZoneTeam() {
90-
return spawnZone;
87+
public Team getSpawnZoneTeam() {
88+
return spawnZone == 0 ? Team.NEUTRAL : (spawnZone == 1 ? Team.A : Team.B);
9189
}
9290

9391
/**

engine/src/main/battlecode/common/RobotController.java

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,7 @@ public strictfp interface RobotController {
379379

380380
/**
381381
* Checks if the given location within vision radius is a legal starting flag placement. This is true when the
382-
* location is in range for dropping the flag, is passable, and is far enough away from other placed friendly flags.
383-
* Note that if the third condition is false, the flag can still be placed but will be teleported back to the spawn zone
384-
* at the end of the setup phase.
382+
* location is passable and is far enough away from other placed friendly flags.
385383
*
386384
* @param loc The location to check
387385
* @return Whether the location is a valid flag placement
@@ -601,6 +599,15 @@ public strictfp interface RobotController {
601599
// ***** ATTACK / HEAL ********
602600
// ****************************
603601

602+
/**
603+
* Gets the true attack damage of this robot accounting for all effects.
604+
*
605+
* @return The attack damage
606+
*
607+
* @battlecode.doc.costlymethod
608+
*/
609+
int getAttackDamage();
610+
604611
/**
605612
* Tests whether this robot can attack the given location. Robots can only attack
606613
* enemy robots, and attacks cannot miss.
@@ -622,6 +629,15 @@ public strictfp interface RobotController {
622629
*/
623630
void attack(MapLocation loc) throws GameActionException;
624631

632+
/**
633+
* Gets the true healing amount of this robot accounting for all effects.
634+
*
635+
* @return The heal amount
636+
*
637+
* @battlecode.doc.costlymethod
638+
*/
639+
int getHealAmount();
640+
625641
/**
626642
* Tests whether this robot can heal a nearby friendly unit.
627643
*
@@ -630,6 +646,8 @@ public strictfp interface RobotController {
630646
*
631647
* @param loc location of friendly unit to be healed
632648
* @return whether it is possible for this robot to heal
649+
*
650+
* @battlecode.doc.costlymethod
633651
*/
634652
boolean canHeal(MapLocation loc);
635653

@@ -771,6 +789,17 @@ public strictfp interface RobotController {
771789
* @battlecode.doc.costlymethod
772790
**/
773791
void buyGlobal(GlobalUpgrade ug) throws GameActionException;
792+
793+
/**
794+
* Returns the global upgrades that the given team has
795+
*
796+
* @param team the team to get global upgrades for
797+
*
798+
* @return The global upgrades that the team has
799+
*
800+
* @battlecode.doc.costlymethod
801+
*/
802+
GlobalUpgrade[] getGlobalUpgrades(Team team);
774803

775804
/**
776805
* Causes your team to lose the game. It's like typing "gg."

engine/src/main/battlecode/common/SkillType.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public enum SkillType{
3535
* @battlecode.doc.costlymethod
3636
*/
3737
public int getExperience(int level){
38-
int[] attackExperience = {0, 20, 40, 70, 100, 140, 180};
38+
int[] attackExperience = {0, 15, 30, 45, 75, 110, 150};
3939
int[] buildExperience = {0, 5, 10, 15, 20, 25, 30};
40-
int[] healExperience = {0, 15, 30, 45, 75, 110, 150};
40+
int[] healExperience = {0, 20, 40, 70, 100, 140, 180};
4141
switch(this){
4242
case ATTACK: return attackExperience[level];
4343
case BUILD: return buildExperience[level];
@@ -57,7 +57,7 @@ public int getExperience(int level){
5757
* @battlecode.doc.costlymethod
5858
*/
5959
public int getCooldown(int level){
60-
int[] attackCooldown = {0, -5, -10, -15, -20, -30, -40};
60+
int[] attackCooldown = {0, -5, -7, -10, -20, -35, -60};
6161
int[] buildCooldown = {0, -5, -10, -15, -20, -30, -50};
6262
int[] healCooldown = {0, -5, -10, -15, -15, -15, -25};
6363
switch(this){
@@ -79,7 +79,7 @@ public int getCooldown(int level){
7979
* @battlecode.doc.costlymethod
8080
*/
8181
public int getSkillEffect(int level){
82-
int[] attackSkill = {0, 5, 10, 15, 20, 30, 50};
82+
int[] attackSkill = {0, 5, 7, 10, 30, 35, 60};
8383
int[] buildSkill = {0, -10, -15, -20, -30, -40, -50};
8484
int[] healSkill = {0, 3, 5, 7, 10, 15, 25};
8585
switch(this){
@@ -99,9 +99,9 @@ public int getSkillEffect(int level){
9999
* @battlecode.doc.costlymethod
100100
*/
101101
public int getPenalty(int level){
102-
int[] attackPenalty = {-1, -5, -5, -10, -10, -15, -15};
103-
int[] buildPenalty = {-1, -2, -2, -5, -5, -10, -10};
104-
int[] healPenalty = {-1, -2, -2, -5, -5, -10, -10};
102+
int[] attackPenalty = {-1, -2, -2, -5, -5, -10, -12};
103+
int[] buildPenalty = {-1, -2, -2, -3, -3, -4, -6};
104+
int[] healPenalty = {-1, -5, -5, -10, -10, -15, -18};
105105
switch(this){
106106
case ATTACK: return attackPenalty[level];
107107
case BUILD: return buildPenalty[level];

engine/src/main/battlecode/common/TrapType.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ public enum TrapType {
1212
* When an opponent enters, explosive traps deal 750 damage to all opponents within a sqrt 13 radius
1313
* If an opponent digs/breaks under the trap, it deals 500 damage to all opponnets in radius sqrt 9
1414
*/
15-
EXPLOSIVE (250, 0, 13, 9, 750, 500, false, 5, true, 0),
15+
EXPLOSIVE (250, 0, 4, 2, 750, 200, false, 5, true, 0),
1616

1717
/**
1818
* When an opponent enters, water traps dig all unoccupied tiles within a radius of sqrt 9
1919
*/
20-
WATER (100, 1, 9, 0, 0, 0, true, 5, true, 0),
20+
WATER (100, 2, 9, 0, 0, 0, true, 5, true, 0),
2121

2222
/**
2323
* When an opponent enters, all opponent robots movement and action cooldowns are set to 40.
2424
*/
25-
STUN (100, 1, 13, 0, 0, 0, false, 5, true, 40),
25+
STUN (100, 2, 13, 0, 0, 0, false, 5, true, 50),
2626

2727
NONE (100, 0, 0, 0, 0, 0, false, 0, false, 0);
2828

@@ -92,4 +92,4 @@ public enum TrapType {
9292
this.isInvisible = isInvisible;
9393
this.opponentCooldown = opponentCooldown;
9494
}
95-
}
95+
}

engine/src/main/battlecode/instrumenter/bytecode/resources/MethodCosts.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ battlecode/common/MapLocation/valueOf 25 fal
2525
battlecode/common/RobotController/adjacentLocation 1 true
2626
battlecode/common/RobotController/attack 0 true
2727
battlecode/common/RobotController/canAttack 5 true
28+
battlecode/common/RobotController/getAttackDamage 1 true
2829
battlecode/common/RobotController/canMove 10 true
2930
battlecode/common/RobotController/canSenseLocation 5 true
3031
battlecode/common/RobotController/canSenseRobot 5 true
@@ -76,13 +77,15 @@ battlecode/common/RobotController/canBuild 10 tru
7677
battlecode/common/RobotController/build 0 true
7778
battlecode/common/RobotController/canHeal 10 true
7879
battlecode/common/RobotController/heal 0 true
80+
battlecode/common/RobotController/getHealAmount 1 true
7981
battlecode/common/RobotController/hasFlag 5 true
8082
battlecode/common/RobotController/canPickupFlag 10 true
8183
battlecode/common/RobotController/pickupFlag 0 true
8284
battlecode/common/RobotController/canDropFlag 10 true
8385
battlecode/common/RobotController/dropFlag 0 true
8486
battlecode/common/RobotController/canBuyGlobal 10 true
8587
battlecode/common/RobotController/buyGlobal 0 true
88+
battlecode/common/RobotController/getGlobalUpgrades 10 true
8689
battlecode/common/Team/opponent 1 false
8790
battlecode/common/Team/isPlayer 1 false
8891
battlecode/common/MapInfo/getMapLocation 1 false

0 commit comments

Comments
 (0)