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:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user