refactor: update turn start triggers in desert sample

Fixes logic in `defendNext` to ensure effects are applied after
buff updates by calling `next()` before mutation. Also updates
indentation and formatting to match project style guidelines.
This commit is contained in:
2026-04-22 20:13:31 +08:00
parent a5e2e4888e
commit f4c96a4a72
2 changed files with 74 additions and 76 deletions
@@ -26,20 +26,14 @@ import {
InventoryItem,
} from "@/samples/slay-the-spire-like/system/grid-inventory/types";
import { GameItemMeta } from "@/samples/slay-the-spire-like/system/grid-inventory/types";
import { ParsedShape } from "@/samples/slay-the-spire-like/system/utils/parse-shape";
import { Transform2D } from "@/samples/slay-the-spire-like/system/utils/shape-collision";
import {
CardEffect,
getCards,
getEffects,
getEncounters,
getEnemies,
getItems,
} from "@/samples/slay-the-spire-like/data/desert";
const cards = getCards();
const effects = getEffects();
const encounters = getEncounters();
const items = getItems();
const enemies = getEnemies();
function createEffect(
@@ -298,7 +292,7 @@ describe("desert triggers", () => {
});
expect(ctx.value.player.hp).toBe(27);
expect(ctx.value.player.effects.defend?.stacks).toBe(2);
expect(ctx.value.player.effects.defend?.stacks).toBe(undefined);
});
it("should reduce damage with damageReduce", async () => {