initial commit

This commit is contained in:
icslucas
2025-10-01 18:58:16 +02:00
parent b31200a3ac
commit 42577e8963
41 changed files with 797 additions and 288 deletions
+7 -7
View File
@@ -30,7 +30,7 @@ describe("Shell Random Damage", () => {
);
while (game.inSpawnPhase()) {
game.executeNextTick();
await game.executeNextTick();
}
player1 = game.player("player_1_id");
@@ -89,7 +89,7 @@ describe("Shell Random Damage", () => {
expect(damages.length).toBeGreaterThan(0);
});
test("Warship shell attacks have random damage", () => {
test("Warship shell attacks have random damage", async () => {
player1.buildUnit(UnitType.Port, game.ref(coastX, 10), {});
const warship = player1.buildUnit(
@@ -119,7 +119,7 @@ describe("Shell Random Damage", () => {
while (damages.length < 10 && attempts < maxAttempts) {
const healthBefore = target.health();
game.executeNextTick();
await game.executeNextTick();
const healthAfter = target.health();
if (healthAfter < healthBefore) {
@@ -145,7 +145,7 @@ describe("Shell Random Damage", () => {
});
});
test("Defense post shell attacks have random damage", () => {
test("Defense post shell attacks have random damage", async () => {
const defensePost = new DefensePostExecution(player1, game.ref(coastX, 5));
const target = player2.buildUnit(
@@ -166,7 +166,7 @@ describe("Shell Random Damage", () => {
while (damages.length < 5 && attempts < maxAttempts) {
const healthBefore = target.health();
defensePost.tick(game.ticks());
game.executeNextTick();
await game.executeNextTick();
const healthAfter = target.health();
if (healthAfter < healthBefore) {
@@ -255,7 +255,7 @@ describe("Shell Random Damage", () => {
expect(maxCount - minCount).toBeLessThan(damages.length * 0.8);
});
test("Shell damage is consistent with same random seed", () => {
test("Shell damage is consistent with same random seed", async () => {
const target = player2.buildUnit(
UnitType.Warship,
game.ref(coastX + 5, 10),
@@ -284,7 +284,7 @@ describe("Shell Random Damage", () => {
target,
);
game.executeNextTick();
await game.executeNextTick();
const currentTicks = game.ticks();
shell1.init(game, currentTicks);