Skip to content

Commit 657931d

Browse files
authored
Merge pull request #71 from battlecode/trap_changes
v1.0.8
2 parents 5c42ca2 + 1dd193b commit 657931d

5 files changed

Lines changed: 14 additions & 11 deletions

File tree

client/src/components/sidebar/map-editor/map-editor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export const MapEditorPage: React.FC<Props> = (props) => {
187187
}
188188

189189
useEffect(() => {
190+
if (!canvasMouseDown || !hoveredTile) return;
190191
if (canvasMouseDown && hoveredTile) applyBrush(hoveredTile)
191192
// added defensive checks just in case stuff is null for some reason
192193
if (canvasMouseDown && hoveredTile && typeof hoveredTile.x === 'number' && typeof hoveredTile.y === 'number') {

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,15 @@ public class GameConstants {
150150
public static final int SQUEAK_RADIUS_SQUARED = 16;
151151

152152
/** The base damage a thrown rat takes upon hitting the ground */
153-
public static final int THROW_DAMAGE = 20;
153+
public static final int THROW_DAMAGE = 10;
154154

155155
/**
156156
* The damage a thrown rat takes per tile it impacts early (i.e. rats that hit a
157157
* wall after 1 turn take 20+3*5=35 damage)
158158
*/
159-
public static final int THROW_DAMAGE_PER_TILE = 5;
159+
public static final int THROW_DAMAGE_PER_TILE = 4;
160+
161+
public static final int TILES_FLOWN_PER_TURN = 2; // how many tiles the flying rat travels per turn
160162

161163
/** The damage a robot takes after being bitten by a rat */
162164
public static final int RAT_BITE_DAMAGE = 10;
@@ -167,12 +169,6 @@ public class GameConstants {
167169
/** The distance squared a cat can pounce to */
168170
public static final int CAT_POUNCE_MAX_DISTANCE_SQUARED = 9;
169171

170-
/**
171-
* Percent damage a rat takes when a cat pounces to an adjacent location (eg. 50
172-
* = 50% damage)
173-
*/
174-
public static final int CAT_POUNCE_ADJACENT_DAMAGE_PERCENT = 50;
175-
176172
public static final int CAT_DIG_ADDITIONAL_COOLDOWN = 5;
177173

178174
/**
@@ -250,11 +246,16 @@ public class GameConstants {
250246
*/
251247
public static final int THROW_DURATION = 4;
252248

249+
/**
250+
* Incurred cooldown for throwing a rat
251+
*/
252+
public static final int THROW_RAT_COOLDOWN = 20;
253+
253254
/** The stun cooldown after hitting the ground after being thrown */
254-
public static final int HIT_GROUND_COOLDOWN = 10;
255+
public static final int HIT_GROUND_COOLDOWN = 10;
255256

256257
/** The stun cooldown after hitting the target after being thrown */
257-
public static final int HIT_TARGET_COOLDOWN = 30;
258+
public static final int HIT_TARGET_COOLDOWN = 20;
258259

259260
/** Amount of rounds a cat sleeps for when fed */
260261
public static final int CAT_SLEEP_TIME = 2;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public void hitGround() {
748748

749749
public void hitTarget(boolean isSecondMove) {
750750
int damage = GameConstants.THROW_DAMAGE
751-
+ GameConstants.THROW_DAMAGE_PER_TILE * (2 * this.remainingThrowDuration + (isSecondMove ? 0 : 1));
751+
+ GameConstants.THROW_DAMAGE_PER_TILE * (GameConstants.TILES_FLOWN_PER_TURN * this.remainingThrowDuration + (isSecondMove ? 0 : 1));
752752

753753
if (this.gameWorld.getRobot(this.getLocation().add(this.thrownDir)) != null) {
754754
InternalRobot robot = this.gameWorld.getRobot(this.getLocation().add(this.thrownDir));

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@ public boolean canThrowRat() {
13221322
@Override
13231323
public void throwRat() throws GameActionException {
13241324
assertCanThrowRat(this.robot.getDirection());
1325+
this.robot.addActionCooldownTurns(GameConstants.THROW_RAT_COOLDOWN);
13251326
this.robot.throwRobot();
13261327
}
13271328

specs/specs.pdf

51.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)