Skip to content

Commit 498cd53

Browse files
Merge branch 'client'
2 parents 6bed4c8 + ead41a7 commit 498cd53

File tree

15 files changed

+48
-39
lines changed

15 files changed

+48
-39
lines changed

client/icons/icon.ico

164 KB
Binary file not shown.

client/src/components/sidebar/queue/queue-game.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export const QueuedGame: React.FC<Props> = (props) => {
3232
return 'by resignation '
3333
case schema.WinType.MAJORITY_PAINTED:
3434
return 'by having paint majority '
35+
case schema.WinType.ALL_UNITS_DESTROYED:
36+
return 'by destroying all enemy units '
3537
case schema.WinType.AREA_PAINTED:
3638
return 'by painting more territory '
3739
case schema.WinType.MORE_TOWERS:

client/src/components/sidebar/runner/scaffold.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ async function dispatchMatch(
376376
break
377377
}
378378
case SupportedLanguage.Python: {
379-
options = [`run.py`, `run`, `--p1=${teamA}`, `--p2=${teamB}`, `--map=${[...selectedMaps][0]}`]
379+
options = [`run.py`, `run`, `--p1=${teamA}`, `--p2=${teamB}`, `--maps=${[...selectedMaps].join(',')}`]
380380
break
381381
}
382382
}

client/src/components/sidebar/update-warning.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const UpdateWarning = () => {
3333
<p className="text-yellow-800 text-xs">
3434
<b>NEW VERSION AVAILABLE!</b>
3535
<br />
36-
download with <code>gradle update</code> followed by <code>gradle build</code>, and then restart the
37-
client: v{update.latest}
36+
download with (<code>gradle update</code> followed by <code>gradle build</code>) for java and (
37+
<code>python run.py update</code>) for python, and then restart the client: v{update.latest}
3838
</p>
3939
</div>
4040
)

client/src/playback/Actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
9393
const target = round.bodies.getById(this.actionData.id())
9494

9595
// Apply damage to the target
96-
target.hp -= this.actionData.damage()
96+
target.hp = Math.max(target.hp - this.actionData.damage(), 0)
9797
}
9898
},
9999
[schema.Action.SplashAction]: class SplashAction extends Action<schema.SplashAction> {

client/src/playback/Bodies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default class Bodies {
115115

116116
// Update properties
117117
body.pos = { x: turn.x(), y: turn.y() }
118-
body.hp = turn.health()
118+
body.hp = Math.max(turn.health(), 0)
119119
body.paint = turn.paint()
120120
body.moveCooldown = turn.moveCooldown()
121121
body.actionCooldown = turn.actionCooldown()

client/src/playback/Match.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ export default class Match {
108108
for (let i = 0; i < footer.timelineMarkersLength(); i++) {
109109
const marker = footer.timelineMarkers(i)!
110110

111+
// Add one to round so that the visualizer properly shows the action completed state
111112
this.timelineMarkers.push({
112-
round: marker.round(),
113+
round: marker.round() + 1,
113114
team: marker.team(),
114115
colorHex: marker.colorHex(),
115116
label: marker.label() ?? 'Unknown'

schema/java/battlecode/schema/WinType.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ public final class WinType {
77
private WinType() { }
88
public static final byte RESIGNATION = 0;
99
public static final byte MAJORITY_PAINTED = 1;
10-
public static final byte AREA_PAINTED = 2;
11-
public static final byte MORE_TOWERS = 3;
12-
public static final byte MORE_MONEY = 4;
13-
public static final byte MORE_STORED_PAINT = 5;
14-
public static final byte MORE_ROBOTS = 6;
15-
public static final byte COIN_FLIP = 7;
10+
public static final byte ALL_UNITS_DESTROYED = 2;
11+
public static final byte AREA_PAINTED = 3;
12+
public static final byte MORE_TOWERS = 4;
13+
public static final byte MORE_MONEY = 5;
14+
public static final byte MORE_STORED_PAINT = 6;
15+
public static final byte MORE_ROBOTS = 7;
16+
public static final byte COIN_FLIP = 8;
1617

17-
public static final String[] names = { "RESIGNATION", "MAJORITY_PAINTED", "AREA_PAINTED", "MORE_TOWERS", "MORE_MONEY", "MORE_STORED_PAINT", "MORE_ROBOTS", "COIN_FLIP", };
18+
public static final String[] names = { "RESIGNATION", "MAJORITY_PAINTED", "ALL_UNITS_DESTROYED", "AREA_PAINTED", "MORE_TOWERS", "MORE_MONEY", "MORE_STORED_PAINT", "MORE_ROBOTS", "COIN_FLIP", };
1819

1920
public static String name(int e) { return names[e]; }
2021
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
export declare enum WinType {
22
RESIGNATION = 0,
33
MAJORITY_PAINTED = 1,
4-
AREA_PAINTED = 2,
5-
MORE_TOWERS = 3,
6-
MORE_MONEY = 4,
7-
MORE_STORED_PAINT = 5,
8-
MORE_ROBOTS = 6,
9-
COIN_FLIP = 7
4+
ALL_UNITS_DESTROYED = 2,
5+
AREA_PAINTED = 3,
6+
MORE_TOWERS = 4,
7+
MORE_MONEY = 5,
8+
MORE_STORED_PAINT = 6,
9+
MORE_ROBOTS = 7,
10+
COIN_FLIP = 8
1011
}

schema/js/battlecode/schema/win-type.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ var WinType;
77
(function (WinType) {
88
WinType[WinType["RESIGNATION"] = 0] = "RESIGNATION";
99
WinType[WinType["MAJORITY_PAINTED"] = 1] = "MAJORITY_PAINTED";
10-
WinType[WinType["AREA_PAINTED"] = 2] = "AREA_PAINTED";
11-
WinType[WinType["MORE_TOWERS"] = 3] = "MORE_TOWERS";
12-
WinType[WinType["MORE_MONEY"] = 4] = "MORE_MONEY";
13-
WinType[WinType["MORE_STORED_PAINT"] = 5] = "MORE_STORED_PAINT";
14-
WinType[WinType["MORE_ROBOTS"] = 6] = "MORE_ROBOTS";
15-
WinType[WinType["COIN_FLIP"] = 7] = "COIN_FLIP";
10+
WinType[WinType["ALL_UNITS_DESTROYED"] = 2] = "ALL_UNITS_DESTROYED";
11+
WinType[WinType["AREA_PAINTED"] = 3] = "AREA_PAINTED";
12+
WinType[WinType["MORE_TOWERS"] = 4] = "MORE_TOWERS";
13+
WinType[WinType["MORE_MONEY"] = 5] = "MORE_MONEY";
14+
WinType[WinType["MORE_STORED_PAINT"] = 6] = "MORE_STORED_PAINT";
15+
WinType[WinType["MORE_ROBOTS"] = 7] = "MORE_ROBOTS";
16+
WinType[WinType["COIN_FLIP"] = 8] = "COIN_FLIP";
1617
})(WinType || (exports.WinType = WinType = {}));

0 commit comments

Comments
 (0)