refactor(slay-the-spire-like): rename getNeighborItems to

getAdjacentItems
This commit is contained in:
2026-04-21 23:22:19 +08:00
parent 113d240f71
commit 270b9b744e
5 changed files with 5 additions and 5 deletions
@@ -66,7 +66,7 @@ export function addCardEventTriggers(triggers: Triggers, run: IRunContext) {
if (!card) return;
const playedItemId = card.itemId;
const adjacent = run.getNeighborItems(playedItemId);
const adjacent = run.getAdjacentItems(playedItemId);
for (const adjItemId of adjacent) {
const adjEffects = ctx.game.value.player.itemEffects[adjItemId];
if (!adjEffects) continue;
@@ -174,7 +174,7 @@ export function createTriggers(run: IRunContext) {
if (ctx.effect.lifecycle.startsWith("item")) {
if (ctx.cardId) {
const card = ctx.game.value.player.deck.cards[ctx.cardId];
const nearby = run.getNeighborItems(card.itemId);
const nearby = run.getAdjacentItems(card.itemId);
for (const itemId of nearby) {
await ctx.game.produceAsync((draft) => {
addItemEffect(draft.player, itemId, ctx.effect, ctx.stacks);
@@ -73,7 +73,7 @@ export type CombatState = {
export interface IRunContext {
getItemData(id: string): ItemData | null;
getNeighborItems(id: string): Iterable<string>;
getAdjacentItems(id: string): Iterable<string>;
getConsumedUses(id: string): number;
setConsumedUsesAsync(id: string, uses: number): Promise<void>;