✨Feature: implement town market functionality with treasure selling and stashing
This commit is contained in:
@@ -10,6 +10,7 @@ import { findCreatureById } from "@/data/contentHelpers";
|
||||
|
||||
import { startCombatFromRoom } from "./combat";
|
||||
import { resolveCombatLoot } from "./loot";
|
||||
import { createInitialTownState } from "./town";
|
||||
import {
|
||||
resolveEnemyTurn,
|
||||
resolvePlayerAttack,
|
||||
@@ -164,6 +165,13 @@ function cloneRun(run: RunState): RunState {
|
||||
globalFlags: [...run.dungeon.globalFlags],
|
||||
},
|
||||
activeCombat: run.activeCombat ? cloneCombat(run.activeCombat) : undefined,
|
||||
townState: {
|
||||
...run.townState,
|
||||
knownServices: [...run.townState.knownServices],
|
||||
stash: run.townState.stash.map((entry) => ({ ...entry })),
|
||||
pendingSales: run.townState.pendingSales.map((entry) => ({ ...entry })),
|
||||
serviceFlags: [...run.townState.serviceFlags],
|
||||
},
|
||||
defeatedCreatureIds: [...run.defeatedCreatureIds],
|
||||
xpGained: run.xpGained,
|
||||
goldGained: run.goldGained,
|
||||
@@ -336,6 +344,7 @@ export function createRunState(options: CreateRunOptions): RunState {
|
||||
globalFlags: [],
|
||||
},
|
||||
adventurerSnapshot: options.adventurer,
|
||||
townState: createInitialTownState(),
|
||||
defeatedCreatureIds: [],
|
||||
xpGained: 0,
|
||||
goldGained: 0,
|
||||
|
||||
Reference in New Issue
Block a user