refactor(0.1.14-P1): 内核归位——game/ 按引擎架构重排(零行为漂移)
结构(旧 game/core+engine → 新 engine/ 域): - engine/kernel/ 时钟/随机/插件协议/fxqueue/timesense/format/urgency/guide/names(原 core) - engine/narrative/ legacy/报告/列传/谱系/年轴(原 core 叙事族) - engine/runtime/ World/creation/pcgen/ApiFacade/capabilities/pluginManager/boot/clocks + Systems/*(12 系统) - engine/sim/ Market(未来 WorldSim 同行) - 旧 game/core、engine/systems、engine/world.ts 等路径全部废弃(无 re-export 兼容层) 验证:35 套件/967 测试全绿(金钟罩三档零漂移=纯搬迁无行为变化) typecheck 0 error
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { World } from '../engine/world'
|
||||
import type { World } from '../runtime/World'
|
||||
|
||||
/**
|
||||
* 统一时轮调度:所有系统以 phase 注册,由时钟按固定顺序驱动。
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { World } from '../engine/world'
|
||||
import type { World } from '../runtime/World'
|
||||
|
||||
export interface GuideStep {
|
||||
id: string
|
||||
@@ -1,7 +1,7 @@
|
||||
import { GameClock, SystemHook } from './clock'
|
||||
import { DataPack } from '../data/registry'
|
||||
import { EventDef } from '../data/events'
|
||||
import type { World } from '../engine/world'
|
||||
import { DataPack } from '../../data/registry'
|
||||
import { EventDef } from '../../data/events'
|
||||
import type { World } from '../runtime/World'
|
||||
|
||||
export type PluginKind = 'system' | 'data' | 'events' | 'content'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RngState } from '../types/domain'
|
||||
import type { RngState } from '../../types/domain'
|
||||
|
||||
function xmur3(str: string): () => number {
|
||||
let h = 1779033703 ^ str.length
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Season } from '../data/season'
|
||||
import { Season } from '../../data/season'
|
||||
|
||||
export const TIDES: string[] = [
|
||||
'立春', '雨水', '惊蛰', '春分', '清明', '谷雨',
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { World } from '../engine/world'
|
||||
import type { World } from '../runtime/World'
|
||||
|
||||
export interface Urgency {
|
||||
blockedCount: number
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
import { GameState } from '../types/domain'
|
||||
import { TECHNIQUES } from '../data/techniques'
|
||||
import { describeRealm } from '../data/realms'
|
||||
import { aspirationById } from '../data/aspirations'
|
||||
import { postById } from '../data/posts'
|
||||
import { GameState } from '../../types/domain'
|
||||
import { TECHNIQUES } from '../../data/techniques'
|
||||
import { describeRealm } from '../../data/realms'
|
||||
import { aspirationById } from '../../data/aspirations'
|
||||
import { postById } from '../../data/posts'
|
||||
|
||||
export interface BioLine {
|
||||
at?: number
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { Character } from '../types/domain'
|
||||
import type { World } from '../engine/world'
|
||||
import { Character } from '../../types/domain'
|
||||
import type { World } from '../runtime/World'
|
||||
|
||||
export interface FamilyUnit {
|
||||
parents: [Character | undefined, Character | undefined]
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GameState } from '../types/domain'
|
||||
import { MAJOR_ORDER } from '../data/realms'
|
||||
import { GameState } from '../../types/domain'
|
||||
import { MAJOR_ORDER } from '../../data/realms'
|
||||
|
||||
export interface LegacyDims {
|
||||
renXing: number
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { GameState } from '../types/domain'
|
||||
import { GameState } from '../../types/domain'
|
||||
|
||||
export interface LegacyReport {
|
||||
years: number[]
|
||||
@@ -1,4 +1,4 @@
|
||||
import { GameState } from '../types/domain'
|
||||
import { GameState } from '../../types/domain'
|
||||
|
||||
export interface AxisEvent {
|
||||
year: number
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { World } from './world'
|
||||
import { WorldEventBus } from './world'
|
||||
import { YearlyReport, BattleLog, ChronicleEntry, SaveMeta } from '../types/domain'
|
||||
import { marketPrice, buyItem, sellItem, buyTechnique } from './market'
|
||||
import { sendMission, recallAll } from './systems/missions'
|
||||
import { giftNpc, makePeace, marryNpcFamily } from './systems/diplomacy'
|
||||
import { combatPowerOf } from './systems/combat'
|
||||
import type { LogKind } from './world'
|
||||
import { computeLegacy, resolveLegacy, LegacyArch } from '../core/legacy'
|
||||
import { yearAxis, AxisCell } from '../core/yearaxis'
|
||||
import { PACK } from '../data/registry'
|
||||
import type { World } from './World'
|
||||
import { WorldEventBus } from './World'
|
||||
import { YearlyReport, BattleLog, ChronicleEntry, SaveMeta } from '../../types/domain'
|
||||
import { marketPrice, buyItem, sellItem, buyTechnique } from '../sim/Market'
|
||||
import { sendMission, recallAll } from './Systems/missions'
|
||||
import { giftNpc, makePeace, marryNpcFamily } from './Systems/diplomacy'
|
||||
import { combatPowerOf } from './Systems/combat'
|
||||
import type { LogKind } from './World'
|
||||
import { computeLegacy, resolveLegacy, LegacyArch } from '../narrative/legacy'
|
||||
import { yearAxis, AxisCell } from '../narrative/yearaxis'
|
||||
import { PACK } from '../../data/registry'
|
||||
|
||||
export type ActName =
|
||||
| 'head.set'
|
||||
+9
-9
@@ -1,14 +1,14 @@
|
||||
import type { World } from '../world'
|
||||
import { Character, BattleLog } from '../../types/domain'
|
||||
import { basePower, describeRealm } from '../../data/realms'
|
||||
import { pack } from '../../data/registry'
|
||||
import { techniqueById } from '../../data/techniques'
|
||||
import { EnemyDef, LootDef } from '../../data/secrets'
|
||||
import type { World } from '../World'
|
||||
import { Character, BattleLog } from '../../../types/domain'
|
||||
import { basePower, describeRealm } from '../../../data/realms'
|
||||
import { pack } from '../../../data/registry'
|
||||
import { techniqueById } from '../../../data/techniques'
|
||||
import { EnemyDef, LootDef } from '../../../data/secrets'
|
||||
|
||||
import { traitBonuses } from '../pcgen'
|
||||
import { npcById } from '../../data/npcs'
|
||||
import { aspirationById, fitBonusOf } from '../../data/aspirations'
|
||||
import { formationById, FormationId } from '../../data/formations'
|
||||
import { npcById } from '../../../data/npcs'
|
||||
import { aspirationById, fitBonusOf } from '../../../data/aspirations'
|
||||
import { formationById, FormationId } from '../../../data/formations'
|
||||
|
||||
export function combatPowerOf(w: World, c: Character): number {
|
||||
if (!c.alive) return 0
|
||||
+10
-10
@@ -1,16 +1,16 @@
|
||||
import type { World } from '../world'
|
||||
import { Character } from '../../types/domain'
|
||||
import { ROOT_GRADES } from '../../data/elements'
|
||||
import { masteryRateOfMajor } from '../../data/pacing'
|
||||
import { aspirationById, fitBonusOf } from '../../data/aspirations'
|
||||
import { techniqueById } from '../../data/techniques'
|
||||
import { nextRealm, breakthroughBaseChance, realmDeathChance, describeRealm, MAJOR_ORDER } from '../../data/realms'
|
||||
import type { World } from '../World'
|
||||
import { Character } from '../../../types/domain'
|
||||
import { ROOT_GRADES } from '../../../data/elements'
|
||||
import { masteryRateOfMajor } from '../../../data/pacing'
|
||||
import { aspirationById, fitBonusOf } from '../../../data/aspirations'
|
||||
import { techniqueById } from '../../../data/techniques'
|
||||
import { nextRealm, breakthroughBaseChance, realmDeathChance, describeRealm, MAJOR_ORDER } from '../../../data/realms'
|
||||
import { lifespanOf } from './lifecycle'
|
||||
import { traitBonuses } from '../pcgen'
|
||||
import { newCharacter } from '../pcgen'
|
||||
import { MALE_GIVEN, FEMALE_GIVEN } from '../../core/names'
|
||||
import { ASPIRATION_IDS } from '../../data/aspirations'
|
||||
import { seasonMod } from '../../data/season'
|
||||
import { MALE_GIVEN, FEMALE_GIVEN } from '../../kernel/names'
|
||||
import { ASPIRATION_IDS } from '../../../data/aspirations'
|
||||
import { seasonMod } from '../../../data/season'
|
||||
import { needsTribulation, tribulationEventId } from './tribulation'
|
||||
|
||||
export function monthlyRate(w: World, c: Character): number {
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import type { World } from '../world'
|
||||
import { npcById } from '../../data/npcs'
|
||||
import type { World } from '../World'
|
||||
import { npcById } from '../../../data/npcs'
|
||||
import { findEvent, fire } from './events'
|
||||
|
||||
export function diplomacyTick(w: World): void {
|
||||
+7
-7
@@ -1,16 +1,16 @@
|
||||
import type { World } from '../world'
|
||||
import { Character } from '../../types/domain'
|
||||
import { Cond, EffectDef, EventDef, EVENTS, MemberEffect } from '../../data/events'
|
||||
import { MAJOR_ORDER } from '../../data/realms'
|
||||
import type { World } from '../World'
|
||||
import { Character } from '../../../types/domain'
|
||||
import { Cond, EffectDef, EventDef, EVENTS, MemberEffect } from '../../../data/events'
|
||||
import { MAJOR_ORDER } from '../../../data/realms'
|
||||
|
||||
|
||||
import { npcById } from '../../data/npcs'
|
||||
import { npcById } from '../../../data/npcs'
|
||||
import { resolveRaid } from './combat'
|
||||
import { sendMission } from './missions'
|
||||
import { pack } from '../../data/registry'
|
||||
import { pack } from '../../../data/registry'
|
||||
import { findInheritor } from '../creation'
|
||||
import { resolveTribulation } from './tribulation'
|
||||
import { nextRealm, describeRealm } from '../../data/realms'
|
||||
import { nextRealm, describeRealm } from '../../../data/realms'
|
||||
|
||||
const ALL_EVENTS: EventDef[] = [...EVENTS]
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import type { World } from '../world'
|
||||
import { MAJORS } from '../../data/realms'
|
||||
import type { World } from '../World'
|
||||
import { MAJORS } from '../../../data/realms'
|
||||
import { calcLifespan } from '../pcgen'
|
||||
|
||||
export function lifespanOf(w: World, c: { realm: { major: keyof typeof MAJORS }; physique: number }): number {
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
import type { World } from '../world'
|
||||
import { Character } from '../../types/domain'
|
||||
import type { World } from '../World'
|
||||
import { Character } from '../../../types/domain'
|
||||
import { produceOffspring } from './cultivation'
|
||||
import { yearGrowth } from './diplomacy'
|
||||
import { MALE_GIVEN, FEMALE_GIVEN } from '../../core/names'
|
||||
import { aspirationById } from '../../data/aspirations'
|
||||
import { MALE_GIVEN, FEMALE_GIVEN } from '../../kernel/names'
|
||||
import { aspirationById } from '../../../data/aspirations'
|
||||
|
||||
export function yearStartMarriage(w: World): void {
|
||||
yearGrowth(w)
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import type { World } from '../world'
|
||||
import { MissionState } from '../../types/domain'
|
||||
import { FormationId } from '../../data/formations'
|
||||
import { missionById, MissionDef, ENEMIES } from '../../data/secrets'
|
||||
import type { World } from '../World'
|
||||
import { MissionState } from '../../../types/domain'
|
||||
import { FormationId } from '../../../data/formations'
|
||||
import { missionById, MissionDef, ENEMIES } from '../../../data/secrets'
|
||||
import { resolveEncounter, rollWarbooty } from './combat'
|
||||
import { techniqueById } from '../../data/techniques'
|
||||
import { describeRealm } from '../../data/realms'
|
||||
import { techniqueById } from '../../../data/techniques'
|
||||
import { describeRealm } from '../../../data/realms'
|
||||
|
||||
export function missionTick(w: World): void {
|
||||
const active = w.state.missions.filter((m) => !m.done)
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import type { World } from '../world'
|
||||
import { aspirationById } from '../../data/aspirations'
|
||||
import { seasonMod } from '../../data/season'
|
||||
import type { World } from '../World'
|
||||
import { aspirationById } from '../../../data/aspirations'
|
||||
import { seasonMod } from '../../../data/season'
|
||||
|
||||
export function productionTick(w: World): void {
|
||||
const fam = w.state.family
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
import type { World } from '../world'
|
||||
import { Character } from '../../types/domain'
|
||||
import { ENEMIES, EnemyDef } from '../../data/secrets'
|
||||
import type { World } from '../World'
|
||||
import { Character } from '../../../types/domain'
|
||||
import { ENEMIES, EnemyDef } from '../../../data/secrets'
|
||||
import { resolveEncounter } from './combat'
|
||||
import { rankPower } from './events'
|
||||
import { resolveBreakthrough } from './cultivation'
|
||||
import { FormationId } from '../../data/formations'
|
||||
import { FormationId } from '../../../data/formations'
|
||||
|
||||
export const SECTS = ['云栖宗', '太谷书院', '玄微剑阁', '丹霞洞天']
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import type { World } from '../world'
|
||||
import { Character } from '../../types/domain'
|
||||
import { nextRealm, MAJOR_ORDER, realmDeathChance, describeRealm } from '../../data/realms'
|
||||
import type { World } from '../World'
|
||||
import { Character } from '../../../types/domain'
|
||||
import { nextRealm, MAJOR_ORDER, realmDeathChance, describeRealm } from '../../../data/realms'
|
||||
|
||||
export const TRIB_MAJORS: string[] = ['foundation', 'core', 'nascent', 'spirit']
|
||||
|
||||
@@ -7,25 +7,25 @@ import {
|
||||
LogItem,
|
||||
Realm,
|
||||
YearlyReport
|
||||
} from '../types/domain'
|
||||
import { Rng } from '../core/rng'
|
||||
import { BUILDINGS } from '../data/buildings'
|
||||
import { POSTS } from '../data/posts'
|
||||
import { aspirationById as aspirationOf } from '../data/aspirations'
|
||||
import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount, LegacyArch } from '../core/legacy'
|
||||
} from '../../types/domain'
|
||||
import { Rng } from '../kernel/rng'
|
||||
import { BUILDINGS } from '../../data/buildings'
|
||||
import { POSTS } from '../../data/posts'
|
||||
import { aspirationById as aspirationOf } from '../../data/aspirations'
|
||||
import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount, LegacyArch } from '../narrative/legacy'
|
||||
import { createWorldState, findInheritor } from './creation'
|
||||
import { SYSTEM_DEFS, SystemDef } from './capabilities'
|
||||
import { emptyClock } from './clocks'
|
||||
import { CotycPlugin, PluginContext, PluginStatus } from '../core/plugin'
|
||||
import { CotycPlugin, PluginContext, PluginStatus } from '../kernel/plugin'
|
||||
import { PluginManager } from './pluginManager'
|
||||
import { EventDef } from '../data/events'
|
||||
import { pack, DEFAULT_PACK, PACK } from '../data/registry'
|
||||
import { EventDef } from '../../data/events'
|
||||
import { pack, DEFAULT_PACK, PACK } from '../../data/registry'
|
||||
import { CORE_PLUGINS } from './plugin-bootstrap'
|
||||
import { GameClock } from '../core/clock'
|
||||
import { SystemHook } from '../core/clock'
|
||||
import { resolveBreakthrough } from './systems/cultivation'
|
||||
import { applyEventChoice } from './systems/events'
|
||||
import { combatPowerOf } from './systems/combat'
|
||||
import { GameClock } from '../kernel/clock'
|
||||
import { SystemHook } from '../kernel/clock'
|
||||
import { resolveBreakthrough } from './Systems/cultivation'
|
||||
import { applyEventChoice } from './Systems/events'
|
||||
import { combatPowerOf } from './Systems/combat'
|
||||
|
||||
export type LogKind = LogItem['kind']
|
||||
|
||||
@@ -138,7 +138,7 @@ export class World {
|
||||
}
|
||||
}
|
||||
|
||||
private packOverride(partial: Partial<import('../data/registry').DataPack>): void {
|
||||
private packOverride(partial: Partial<import('../../data/registry').DataPack>): void {
|
||||
PACK.override(partial)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { PhaseId } from '../core/clock'
|
||||
import type { PhaseId } from '../kernel/clock'
|
||||
|
||||
export interface SystemDef {
|
||||
id: string
|
||||
@@ -1,13 +1,13 @@
|
||||
import { GameClock } from '../core/clock'
|
||||
import { PluginContext } from '../core/plugin'
|
||||
import type { World } from './world'
|
||||
import { productionTick } from './systems/production'
|
||||
import { deathTick, woundHealTick } from './systems/lifecycle'
|
||||
import { cultivationTick } from './systems/cultivation'
|
||||
import { missionTick } from './systems/missions'
|
||||
import { eventRoll } from './systems/events'
|
||||
import { diplomacyTick } from './systems/diplomacy'
|
||||
import { yearStartMarriage } from './systems/marriage'
|
||||
import { GameClock } from '../kernel/clock'
|
||||
import { PluginContext } from '../kernel/plugin'
|
||||
import type { World } from './World'
|
||||
import { productionTick } from './Systems/production'
|
||||
import { deathTick, woundHealTick } from './Systems/lifecycle'
|
||||
import { cultivationTick } from './Systems/cultivation'
|
||||
import { missionTick } from './Systems/missions'
|
||||
import { eventRoll } from './Systems/events'
|
||||
import { diplomacyTick } from './Systems/diplomacy'
|
||||
import { yearStartMarriage } from './Systems/marriage'
|
||||
|
||||
/** 原语义保留:满门凋零后仅存生产/寿元与收尾 */
|
||||
function ifAlive(fn: (w: World) => void): (w: World) => void {
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Character, GameState, NpcFamilyState, RealmMajor } from '../types/domain'
|
||||
import { Rng, seedToRng } from '../core/rng'
|
||||
import { randomSurname, MALE_GIVEN, FEMALE_GIVEN } from '../core/names'
|
||||
import { Character, GameState, NpcFamilyState, RealmMajor } from '../../types/domain'
|
||||
import { Rng, seedToRng } from '../kernel/rng'
|
||||
import { randomSurname, MALE_GIVEN, FEMALE_GIVEN } from '../kernel/names'
|
||||
import { newCharacter } from './pcgen'
|
||||
import { NPCS } from '../data/npcs'
|
||||
import { World } from './world'
|
||||
import { NPCS } from '../../data/npcs'
|
||||
import { World } from './World'
|
||||
|
||||
export interface NewGameOptions {
|
||||
seed: string
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { CotycPlugin } from '../core/plugin'
|
||||
import { CotycPlugin } from '../kernel/plugin'
|
||||
|
||||
/** 示例内容插件:注入事件池 + 一个护山能力(开发范本) */
|
||||
export const examplePlugin: CotycPlugin = {
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Character, Element, Gender, Realm, RealmMajor } from '../types/domain'
|
||||
import { Rng } from '../core/rng'
|
||||
import { ELEMENT_LIST, ROOT_GRADES } from '../data/elements'
|
||||
import { MAJORS } from '../data/realms'
|
||||
import { TRAIT_POOL, TRAITS } from '../data/traits'
|
||||
import { Character, Element, Gender, Realm, RealmMajor } from '../../types/domain'
|
||||
import { Rng } from '../kernel/rng'
|
||||
import { ELEMENT_LIST, ROOT_GRADES } from '../../data/elements'
|
||||
import { MAJORS } from '../../data/realms'
|
||||
import { TRAIT_POOL, TRAITS } from '../../data/traits'
|
||||
|
||||
export function rollRoots(rng: Rng, parents?: { m?: Character; f?: Character }): { grade: number; primary: Element; secondary: Element[] } {
|
||||
let grade: number
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import { CotycPlugin } from '../core/plugin'
|
||||
import { CotycPlugin } from '../kernel/plugin'
|
||||
import { installCoreSystems } from './clocks'
|
||||
import { EVENTS } from '../data/events'
|
||||
import { DEFAULT_PACK } from '../data/registry'
|
||||
import { EVENTS } from '../../data/events'
|
||||
import { DEFAULT_PACK } from '../../data/registry'
|
||||
|
||||
/** 内置插件一:镇族基石(12 能力卡与时轮钩子) */
|
||||
export function makeCoreSystemsPlugin(): CotycPlugin {
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
import { CotycPlugin, PluginContext, PluginStatus, PluginChange } from '../core/plugin'
|
||||
import { SystemDef, SYSTEM_DEFS } from '../engine/capabilities'
|
||||
import type { World } from '../engine/world'
|
||||
import { SystemHook } from '../core/clock'
|
||||
import { GameClock } from '../core/clock'
|
||||
import { CotycPlugin, PluginContext, PluginStatus, PluginChange } from '../kernel/plugin'
|
||||
import { SystemDef, SYSTEM_DEFS } from './capabilities'
|
||||
import type { World } from './World'
|
||||
import { SystemHook } from '../kernel/clock'
|
||||
import { GameClock } from '../kernel/clock'
|
||||
|
||||
interface RuntimePlugin {
|
||||
plugin: CotycPlugin
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { World } from './world'
|
||||
import { pack } from '../data/registry'
|
||||
import { traitBonuses } from './pcgen'
|
||||
import type { World } from '../runtime/World'
|
||||
import { pack } from '../../data/registry'
|
||||
import { traitBonuses } from '../runtime/pcgen'
|
||||
|
||||
export function marketPrice(w: World, itemId: string): number {
|
||||
const item = pack().items[itemId]
|
||||
@@ -48,7 +48,7 @@ export function techniquePrice(techId: string): number {
|
||||
return TECH_GRADE_BASE[techId] ?? 200
|
||||
}
|
||||
|
||||
import { TECHNIQUES } from '../data/techniques'
|
||||
import { TECHNIQUES } from '../../data/techniques'
|
||||
|
||||
const TECHNIQUE_GRADE_PRICE: Record<number, number> = { 1: 120, 2: 300, 3: 700, 4: 1600 }
|
||||
const TECH_GRADE_BASE: Record<string, number> = Object.fromEntries(
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GameState } from '../types/domain'
|
||||
import { normalizeGameState } from '../engine/world'
|
||||
import { normalizeGameState } from '../engine/runtime/World'
|
||||
|
||||
export const CURRENT_SCHEMA = 2
|
||||
export const APP_ID = 'cotyc'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState } from 'react'
|
||||
import { useGameStore } from '../store'
|
||||
import { applyEventChoice, rankPower } from '../../game/engine/systems/events'
|
||||
import { applyEventChoice, rankPower } from '../../game/engine/runtime/Systems/events'
|
||||
import { eventCategoryName } from '../../game/data/events'
|
||||
import { describeRealm } from '../../game/data/realms'
|
||||
import { Character } from '../../game/types/domain'
|
||||
import { combatPowerOf } from '../../game/engine/systems/combat'
|
||||
import { combatPowerOf } from '../../game/engine/runtime/Systems/combat'
|
||||
import { FORMATIONS, FormationId } from '../../game/data/formations'
|
||||
import { ModalShell } from './ModalShell'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { GUIDE_STEPS, computeGuide, guideAdvance } from '../../game/core/guide'
|
||||
import { GUIDE_STEPS, computeGuide, guideAdvance } from '../../game/engine/kernel/guide'
|
||||
|
||||
export function GuideStrip() {
|
||||
const world = useGameStore((s) => s.world)
|
||||
|
||||
@@ -5,12 +5,12 @@ import { describeRoots, ROOT_GRADE_NAMES } from '../../game/data/elements'
|
||||
import { TRAITS } from '../../game/data/traits'
|
||||
import { TECHNIQUES } from '../../game/data/techniques'
|
||||
import { ITEMS, ARTIFACT_POWER } from '../../game/data/items'
|
||||
import { combatPowerOf } from '../../game/engine/systems/combat'
|
||||
import { lifespanOf } from '../../game/engine/systems/lifecycle'
|
||||
import { perAttemptChance } from '../../game/engine/systems/cultivation'
|
||||
import { combatPowerOf } from '../../game/engine/runtime/Systems/combat'
|
||||
import { lifespanOf } from '../../game/engine/runtime/Systems/lifecycle'
|
||||
import { perAttemptChance } from '../../game/engine/runtime/Systems/cultivation'
|
||||
import { POSTS, POST_ORDER } from '../../game/data/posts'
|
||||
import { ModalShell } from './ModalShell'
|
||||
import { buildBiography } from '../../game/core/biography'
|
||||
import { buildBiography } from '../../game/engine/narrative/biography'
|
||||
|
||||
function aspName(c: Character): string {
|
||||
const map: Record<string, string> = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { LegacyArch } from '../../game/core/legacy'
|
||||
import { LegacyArch } from '../../game/engine/narrative/legacy'
|
||||
import { sBell } from '../sound'
|
||||
import { ModalShell } from './ModalShell'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { computeUrgency } from '../../game/core/urgency'
|
||||
import { computeUrgency } from '../../game/engine/kernel/urgency'
|
||||
|
||||
export function UrgentBadges() {
|
||||
const world = useGameStore((s) => s.world)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FxGate, FxKind } from '../game/core/fxqueue'
|
||||
import { FxGate, FxKind } from '../game/engine/kernel/fxqueue'
|
||||
import { seasonOf } from '../game/data/season'
|
||||
|
||||
let gate: FxGate | null = null
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { npcById } from '../../game/data/npcs'
|
||||
import { giftNpc, makePeace, marryNpcFamily, calcGiftGain, GIFT_TIERS } from '../../game/engine/systems/diplomacy'
|
||||
import { giftNpc, makePeace, marryNpcFamily, calcGiftGain, GIFT_TIERS } from '../../game/engine/runtime/Systems/diplomacy'
|
||||
import { useMemo } from 'react'
|
||||
import { MAJOR_NAMES } from '../../game/data/realms'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { MISSIONS, missionById } from '../../game/data/secrets'
|
||||
import { sendMission, recallAll } from '../../game/engine/systems/missions'
|
||||
import { combatPowerOf } from '../../game/engine/systems/combat'
|
||||
import { sendMission, recallAll } from '../../game/engine/runtime/Systems/missions'
|
||||
import { combatPowerOf } from '../../game/engine/runtime/Systems/combat'
|
||||
import { useState } from 'react'
|
||||
import { describeRealm, MAJOR_ORDER } from '../../game/data/realms'
|
||||
import { FORMATIONS, FormationId } from '../../game/data/formations'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useGameStore } from '../store'
|
||||
import { computeGenealogy } from '../../game/core/genealogy'
|
||||
import { computeGenealogy } from '../../game/engine/narrative/genealogy'
|
||||
import { describeRealm } from '../../game/data/realms'
|
||||
import { Character, FamilyState } from '../../game/types/domain'
|
||||
import { useState } from 'react'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useState } from 'react'
|
||||
import { useGameStore } from '../store'
|
||||
import { computeLegacy, resolveLegacy } from '../../game/core/legacy'
|
||||
import { resolveLegacy as doesIt } from '../../game/core/legacy'
|
||||
import { computeLegacy, resolveLegacy } from '../../game/engine/narrative/legacy'
|
||||
import { resolveLegacy as doesIt } from '../../game/engine/narrative/legacy'
|
||||
import { ResolveModal } from '../components/ResolveModal'
|
||||
import { buildBiography } from '../../game/core/biography'
|
||||
import { yearAxis, decadeLabel } from '../../game/core/yearaxis'
|
||||
import { buildReport, verdictLine } from '../../game/core/legacyreport'
|
||||
import { buildBiography } from '../../game/engine/narrative/biography'
|
||||
import { yearAxis, decadeLabel } from '../../game/engine/narrative/yearaxis'
|
||||
import { buildReport, verdictLine } from '../../game/engine/narrative/legacyreport'
|
||||
|
||||
void doesIt
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useGameStore } from '../store'
|
||||
import { ITEMS } from '../../game/data/items'
|
||||
import { TECHNIQUES } from '../../game/data/techniques'
|
||||
import { techniqueGradeName } from '../../game/data/realms'
|
||||
import { marketPrice, buyItem, sellItem, buyTechnique } from '../../game/engine/market'
|
||||
import { marketPrice, buyItem, sellItem, buyTechnique } from '../../game/engine/sim/Market'
|
||||
import { useMemo, useState } from 'react'
|
||||
|
||||
export default function MarketPanel() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useState } from 'react'
|
||||
import { useGameStore } from '../store'
|
||||
import { examplePlugin } from '../../game/engine/demo-plugins'
|
||||
import { examplePlugin } from '../../game/engine/runtime/demo-plugins'
|
||||
import { ensureFx } from '../fx'
|
||||
import { SYSTEM_DEFS } from '../../game/engine/capabilities'
|
||||
import { buildBiography } from '../../game/core/biography'
|
||||
import { SYSTEM_DEFS } from '../../game/engine/runtime/capabilities'
|
||||
import { buildBiography } from '../../game/engine/narrative/biography'
|
||||
|
||||
export default function SettingsPanel() {
|
||||
const world = useGameStore((s) => s.world)
|
||||
|
||||
@@ -12,9 +12,9 @@ import ChroniclePanel from '../panels/ChroniclePanel'
|
||||
import SettingsPanel from '../panels/SettingsPanel'
|
||||
import { LogFeed } from '../components/LogFeed'
|
||||
import { UrgentBadges } from '../components/UrgentBadges'
|
||||
import { fmt as fmtNum } from '../../game/core/format'
|
||||
import { fmt as fmtNum } from '../../game/engine/kernel/format'
|
||||
import { seasonOf } from '../../game/data/season'
|
||||
import { seasonTint, yearRing, tideOf } from '../../game/core/timesense'
|
||||
import { seasonTint, yearRing, tideOf } from '../../game/engine/kernel/timesense'
|
||||
import landscapeUrl from '../../assets/gen/landscape-gold.svg'
|
||||
import { GuideStrip } from '../components/GuideStrip'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useGameStore } from '../store'
|
||||
import { SURNAME_POOL } from '../../game/core/names'
|
||||
import { RngHub } from '../../game/core/rng'
|
||||
import { SURNAME_POOL } from '../../game/engine/kernel/names'
|
||||
import { RngHub } from '../../game/engine/kernel/rng'
|
||||
|
||||
export default function NewGame() {
|
||||
const go = useGameStore((s) => s.go)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 合成音效:鼓点·钟鸣·纸韵(Web Audio,零素材依赖)
|
||||
import { RngHub } from '../game/core/rng'
|
||||
import { RngHub } from '../game/engine/kernel/rng'
|
||||
let ctx: AudioContext | null = null
|
||||
let enabled = true
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { create } from 'zustand'
|
||||
import { World, WorldEventBus } from '../game/engine/world'
|
||||
import { World, WorldEventBus } from '../game/engine/runtime/World'
|
||||
import { EventDef } from '../game/data/events'
|
||||
import { findEvent, applyEventChoice } from '../game/engine/systems/events'
|
||||
import { findEvent, applyEventChoice } from '../game/engine/runtime/Systems/events'
|
||||
import { BattleLog, ChronicleEntry, GameState, LogItem, SaveMeta, YearlyReport, SnapshotMeta } from '../game/types/domain'
|
||||
import { getSlotManager, getSaveSlot } from '../game/storage/db'
|
||||
import { metaFromState, updateSlotMeta } from './storeHelper'
|
||||
import { GameFacade, ActName } from '../game/engine/api'
|
||||
import { GameFacade, ActName } from '../game/engine/runtime/ApiFacade'
|
||||
import { setSoundEnabled, sPaper, sGood, sBad, sWar, sBell, sGong, sClick, sTick } from './sound'
|
||||
import type { PhaseStat } from '../game/core/clock'
|
||||
import type { PhaseStat } from '../game/engine/kernel/clock'
|
||||
import { seasonOf } from '../game/data/season'
|
||||
|
||||
export type Screen = 'boot' | 'newgame' | 'game'
|
||||
@@ -63,7 +63,7 @@ export interface GameStore {
|
||||
facade?: GameFacade
|
||||
advancing: boolean
|
||||
setNextToast: (msg: string) => void
|
||||
act: (name: ActName, payload: import('../game/engine/api').ActPayload) => boolean
|
||||
act: (name: ActName, payload: import('../game/engine/runtime/ApiFacade').ActPayload) => boolean
|
||||
}
|
||||
|
||||
const LOG_CAP = 260
|
||||
@@ -193,7 +193,7 @@ export const useGameStore = create<GameStore>((set, get) => ({
|
||||
const elapsed = performance.now() - t0
|
||||
try {
|
||||
const nextInv = { ...w.state.family.inventory, stones: w.state.family.stones }
|
||||
const FxGate = (await import('../game/core/fxqueue')).FxGate
|
||||
const FxGate = (await import('../game/engine/kernel/fxqueue')).FxGate
|
||||
const deltas = FxGate.deltas(prevInv, nextInv)
|
||||
const windowRef = window as unknown as { dispatchEvent: (e: Event) => void }
|
||||
windowRef.dispatchEvent(new CustomEvent('fx:drift', { detail: deltas }))
|
||||
@@ -454,7 +454,7 @@ function makeBus(st: GameStore): WorldEventBus {
|
||||
}
|
||||
}
|
||||
|
||||
function actDirect(w: World, name: ActName, payload: import('../game/engine/api').ActPayload): boolean {
|
||||
function actDirect(w: World, name: ActName, payload: import('../game/engine/runtime/ApiFacade').ActPayload): boolean {
|
||||
if (name === 'legacy.resolve') return (w.resolveLegacyNow(), true)
|
||||
if (name === 'estate.rite') return w.ancestralRite()
|
||||
if (name === 'estate.sutra') return w.seekSutra()
|
||||
|
||||
Reference in New Issue
Block a user