refactor: reorg

This commit is contained in:
2026-04-17 11:06:09 +08:00
parent 4deebf67c3
commit 3a135a4ad1
8 changed files with 154 additions and 75 deletions
@@ -1,6 +1,7 @@
import {CombatEntity, EffectTable} from "./types";
import {EffectData} from "@/samples/slay-the-spire-like/system/types";
import {PlayerEntity} from "@/samples/slay-the-spire-like/system/combat/types";
import {CombatState} from "./types";
export function addEffect(effects: EffectTable, effect: EffectData, stacks: number){
let current = effects[effect.id];
@@ -43,7 +44,10 @@ export function onPlayerItemEffectUpkeep(entity: PlayerEntity){
}
}
// TODO
export function onDraw(entity: PlayerEntity, cardId:string ){}
// TODO
export function onDiscard(entity: PlayerEntity, cardId: string){}
export function* getAliveEnemies(state: CombatState) {
for (let enemy of state.enemies) {
if (enemy.isAlive) {
yield enemy;
}
}
}