Skip to content

Commit

Permalink
Merge branch 'master' into release-config
Browse files Browse the repository at this point in the history
  • Loading branch information
TheApplePieGod committed Jan 18, 2024
2 parents 4593750 + b4798f1 commit 951f04e
Show file tree
Hide file tree
Showing 16 changed files with 334 additions and 226 deletions.
2 changes: 1 addition & 1 deletion client/src/components/sidebar/game/team-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const UnitsTable: React.FC<UnitsTableProps> = ({ teamStat, teamIdx }) =>

const GlobalUpgradeSection: React.FC<{ teamStat: TeamTurnStat | undefined }> = ({ teamStat }) => {
const upgradeTypes: [schema.GlobalUpgradeType, string][] = [
[schema.GlobalUpgradeType.ACTION_UPGRADE, 'Global Action Upgrade'],
[schema.GlobalUpgradeType.ACTION_UPGRADE, 'Global Attack Upgrade'],
[schema.GlobalUpgradeType.CAPTURING_UPGRADE, 'Global Capturing Upgrade'],
[schema.GlobalUpgradeType.HEALING_UPGRADE, 'Global Healing Upgrade']
]
Expand Down
4 changes: 2 additions & 2 deletions client/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { schema } from 'battlecode-schema'

export const GAME_VERSION = '1.2.5'
export const SPEC_VERSION = '1.2.5'
export const GAME_VERSION = '2.0.0'
export const SPEC_VERSION = '2.0.0'
export const BATTLECODE_YEAR: number = 2024
export const MAP_SIZE_RANGE = {
min: 30,
Expand Down
8 changes: 4 additions & 4 deletions engine/src/main/battlecode/common/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GameConstants {
/**
* The current spec version the server compiles with.
*/
public static final String SPEC_VERSION = "1.2.5";
public static final String SPEC_VERSION = "2.0.0";

// *********************************
// ****** MAP CONSTANTS ************
Expand Down Expand Up @@ -72,7 +72,7 @@ public class GameConstants {
public static final int DIG_COST = 20;

/** Crumbs cost for filling */
public static final int FILL_COST = 10;
public static final int FILL_COST = 30;

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

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

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

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

}
31 changes: 19 additions & 12 deletions engine/src/main/battlecode/common/GlobalUpgrade.java
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
package battlecode.common;

/**
* Enumerates the possible types of global updates. More information about each update
* are available in the game specs.
* Enumerates the possible types of global updates. More information about each
* update
* are available in the game specs.
*/

public enum GlobalUpgrade {

/**
* Action upgrade increases the amount cooldown drops per round by 4.
* Attack upgrade increases the base attack by 75.
*/
ACTION(4, 0, 0),
ATTACK(75, 0, 0, 0),

/**
* Healing increases base heal by 50.
*/
HEALING(0, 50, 0),
HEALING(0, 50, 0, 0),

/**
* Capture upgrade increases the dropped flag delay from 4 rounds to 12 rounds.
* 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.
*/
CAPTURING(0, 0, 8);
CAPTURING(0, 0, 8, -8);

/**
* How much cooldown reduction changes
* How much base attack changes
*/
public final int cooldownReductionChange;
public final int baseAttackChange;

/**
* How much base heal changes
*/
public final int baseHealChange;

/**
* how much dropped flag return delay changes
* How much dropped flag return delay changes
*/
public final int flagReturnDelayChange;

GlobalUpgrade(int cooldownReductionChange, int baseHealChange, int flagReturnDelayChange){
this.cooldownReductionChange = cooldownReductionChange;
/**
* How much the movement penalty for holding a flag changes.
*/
public final int movementDelayChange;

GlobalUpgrade(int baseAttackChange, int baseHealChange, int flagReturnDelayChange, int movementDelayChange) {
this.baseAttackChange = baseAttackChange;
this.baseHealChange = baseHealChange;
this.flagReturnDelayChange = flagReturnDelayChange;
this.movementDelayChange = movementDelayChange;
}
}
10 changes: 4 additions & 6 deletions engine/src/main/battlecode/common/MapInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,14 @@ public boolean isSpawnZone() {
}

/**
* Returns 1 if this square is a Team A spawn zone,
* 2 if this square is a Team B spawn zone, and
* 0 if this square is not a spawn zone.
* Returns the team that owns that spawn zone at this location, or Team.NEUTRAL if the location is not a spawn zone.
*
* @return 1 or 2 if the square is a Team A or B spawn zone, respectively; 0 otherwise
* @return The team that owns the spawn zone, or Team.NEUTRAL
*
* @battlecode.doc.costlymethod
*/
public int getSpawnZoneTeam() {
return spawnZone;
public Team getSpawnZoneTeam() {
return spawnZone == 0 ? Team.NEUTRAL : (spawnZone == 1 ? Team.A : Team.B);
}

/**
Expand Down
35 changes: 32 additions & 3 deletions engine/src/main/battlecode/common/RobotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,7 @@ public strictfp interface RobotController {

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

/**
* Gets the true attack damage of this robot accounting for all effects.
*
* @return The attack damage
*
* @battlecode.doc.costlymethod
*/
int getAttackDamage();

/**
* Tests whether this robot can attack the given location. Robots can only attack
* enemy robots, and attacks cannot miss.
Expand All @@ -622,6 +629,15 @@ public strictfp interface RobotController {
*/
void attack(MapLocation loc) throws GameActionException;

/**
* Gets the true healing amount of this robot accounting for all effects.
*
* @return The heal amount
*
* @battlecode.doc.costlymethod
*/
int getHealAmount();

/**
* Tests whether this robot can heal a nearby friendly unit.
*
Expand All @@ -630,6 +646,8 @@ public strictfp interface RobotController {
*
* @param loc location of friendly unit to be healed
* @return whether it is possible for this robot to heal
*
* @battlecode.doc.costlymethod
*/
boolean canHeal(MapLocation loc);

Expand Down Expand Up @@ -771,6 +789,17 @@ public strictfp interface RobotController {
* @battlecode.doc.costlymethod
**/
void buyGlobal(GlobalUpgrade ug) throws GameActionException;

/**
* Returns the global upgrades that the given team has
*
* @param team the team to get global upgrades for
*
* @return The global upgrades that the team has
*
* @battlecode.doc.costlymethod
*/
GlobalUpgrade[] getGlobalUpgrades(Team team);

/**
* Causes your team to lose the game. It's like typing "gg."
Expand Down
14 changes: 7 additions & 7 deletions engine/src/main/battlecode/common/SkillType.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public enum SkillType{
* @battlecode.doc.costlymethod
*/
public int getExperience(int level){
int[] attackExperience = {0, 20, 40, 70, 100, 140, 180};
int[] attackExperience = {0, 15, 30, 45, 75, 110, 150};
int[] buildExperience = {0, 5, 10, 15, 20, 25, 30};
int[] healExperience = {0, 15, 30, 45, 75, 110, 150};
int[] healExperience = {0, 20, 40, 70, 100, 140, 180};
switch(this){
case ATTACK: return attackExperience[level];
case BUILD: return buildExperience[level];
Expand All @@ -57,7 +57,7 @@ public int getExperience(int level){
* @battlecode.doc.costlymethod
*/
public int getCooldown(int level){
int[] attackCooldown = {0, -5, -10, -15, -20, -30, -40};
int[] attackCooldown = {0, -5, -7, -10, -20, -35, -60};
int[] buildCooldown = {0, -5, -10, -15, -20, -30, -50};
int[] healCooldown = {0, -5, -10, -15, -15, -15, -25};
switch(this){
Expand All @@ -79,7 +79,7 @@ public int getCooldown(int level){
* @battlecode.doc.costlymethod
*/
public int getSkillEffect(int level){
int[] attackSkill = {0, 5, 10, 15, 20, 30, 50};
int[] attackSkill = {0, 5, 7, 10, 30, 35, 60};
int[] buildSkill = {0, -10, -15, -20, -30, -40, -50};
int[] healSkill = {0, 3, 5, 7, 10, 15, 25};
switch(this){
Expand All @@ -99,9 +99,9 @@ public int getSkillEffect(int level){
* @battlecode.doc.costlymethod
*/
public int getPenalty(int level){
int[] attackPenalty = {-1, -5, -5, -10, -10, -15, -15};
int[] buildPenalty = {-1, -2, -2, -5, -5, -10, -10};
int[] healPenalty = {-1, -2, -2, -5, -5, -10, -10};
int[] attackPenalty = {-1, -2, -2, -5, -5, -10, -12};
int[] buildPenalty = {-1, -2, -2, -3, -3, -4, -6};
int[] healPenalty = {-1, -5, -5, -10, -10, -15, -18};
switch(this){
case ATTACK: return attackPenalty[level];
case BUILD: return buildPenalty[level];
Expand Down
8 changes: 4 additions & 4 deletions engine/src/main/battlecode/common/TrapType.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ public enum TrapType {
* When an opponent enters, explosive traps deal 750 damage to all opponents within a sqrt 13 radius
* If an opponent digs/breaks under the trap, it deals 500 damage to all opponnets in radius sqrt 9
*/
EXPLOSIVE (250, 0, 13, 9, 750, 500, false, 5, true, 0),
EXPLOSIVE (250, 0, 4, 2, 750, 200, false, 5, true, 0),

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

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

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

Expand Down Expand Up @@ -92,4 +92,4 @@ public enum TrapType {
this.isInvisible = isInvisible;
this.opponentCooldown = opponentCooldown;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ battlecode/common/MapLocation/valueOf 25 fal
battlecode/common/RobotController/adjacentLocation 1 true
battlecode/common/RobotController/attack 0 true
battlecode/common/RobotController/canAttack 5 true
battlecode/common/RobotController/getAttackDamage 1 true
battlecode/common/RobotController/canMove 10 true
battlecode/common/RobotController/canSenseLocation 5 true
battlecode/common/RobotController/canSenseRobot 5 true
Expand Down Expand Up @@ -76,13 +77,15 @@ battlecode/common/RobotController/canBuild 10 tru
battlecode/common/RobotController/build 0 true
battlecode/common/RobotController/canHeal 10 true
battlecode/common/RobotController/heal 0 true
battlecode/common/RobotController/getHealAmount 1 true
battlecode/common/RobotController/hasFlag 5 true
battlecode/common/RobotController/canPickupFlag 10 true
battlecode/common/RobotController/pickupFlag 0 true
battlecode/common/RobotController/canDropFlag 10 true
battlecode/common/RobotController/dropFlag 0 true
battlecode/common/RobotController/canBuyGlobal 10 true
battlecode/common/RobotController/buyGlobal 0 true
battlecode/common/RobotController/getGlobalUpgrades 10 true
battlecode/common/Team/opponent 1 false
battlecode/common/Team/isPlayer 1 false
battlecode/common/MapInfo/getMapLocation 1 false
Expand Down
Loading

0 comments on commit 951f04e

Please sign in to comment.