refactor
This commit is contained in:
parent
0a6148c73f
commit
e8f1d1db1e
60 changed files with 2417 additions and 612 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Architecture
|
||||
# Architecture
|
||||
|
||||
Build target: static browser page. No bundler. Globals and ordered deferred scripts are intentional. Current inspected version: `15.20.11`.
|
||||
Build target: static browser page. No bundler. Globals and ordered deferred scripts are intentional. Current inspected version: `15.20.16`.
|
||||
|
||||
## Load order
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ The old `css/styles.css` compatibility shim and `js/ui_family.js` split marker h
|
|||
- `js/input_mode_manager.js`: touch/mobile classification, mobile mode persistence, and gesture capability policy.
|
||||
- `js/weather_system.js`: weather state transitions and rain-water item spawning.
|
||||
- `js/text_catalog.js`: Japanese UI copy/tooltips. Keep JS strings escaped where existing style uses escapes.
|
||||
- `js/effect_registry.js`: item-effect labels, colors, modifiers, exclusivity/removal metadata, behavior callbacks (`onApply`, `onTick`, `onRemove`), and random-effect candidates.
|
||||
- `js/effect_registry.js`: item-effect labels, colors, modifiers, exclusivity/removal metadata, behavior callbacks (`onApply`, `onTick`, `onRemove`), direct eating context, and random-effect candidates.
|
||||
- `js/sound_pack.js`: canonical sound metadata: IDs, categories, gain multipliers, cooldowns, optional sample paths, and ID-to-category mapping.
|
||||
- `FIELD_TYPES` in `js/data.js`: cage/garden/park field labels, responsive heights, world scale, starting population, and initial grass.
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ The old `css/styles.css` compatibility shim and `js/ui_family.js` split marker h
|
|||
|
||||
`main.js` starts asset preload, world bootstrap, animation loop, deferred image loading, service-worker registration. `World.update(dt)` advances time, weather, items, ants, Tarinai, effects, budgets, terrain dirtiness. `render()` draws cached background/terrain, visible entities, weather overlay, cards, HUD, and debug overlays.
|
||||
|
||||
World time is `CONFIG.dayLength` seconds per day. Version `15.20.11` uses 120 seconds/day and weather changes every 46-96 seconds. The phase boundary rules live in `World.phaseName()`.
|
||||
World time is `CONFIG.dayLength` seconds per day. Version `15.20.16` uses 120 seconds/day and weather changes every 46-96 seconds. The phase boundary rules live in `World.phaseName()`.
|
||||
|
||||
Domain events are emitted at central mutation points: placement, eating, decay, effect apply/remove, disease infect/cure, damage/death/birth, fight hit/loss/end, ant spawn/grab/carry/death, weather changes, and rain item drops. Logs/audio still use direct calls where they already existed; do not add duplicate log or sound side effects when subscribing to these events.
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ Canonical helper mapping:
|
|||
|
||||
- Weather rain overlay: `drawRain` in `render.js`; diagonal blue line streaks only, never item droplets.
|
||||
- Horizontal item droplet: `drawOvalWaterDropSprite`; used by fallen water items, zunda juice, mercury. Same silhouette; recolor only.
|
||||
- Water bowl: `water_bowl` descriptor in `js/item_visual_registry.js`; bowl and inner horizontal water palette are registry-owned.
|
||||
- Sleep drug: `drawSleepTabletSprite`.
|
||||
- Laxative: `drawLaxativeTabletSprite`; zunchi-motif tablet.
|
||||
- Mystery drug: `drawMysteryTabletSprite`; question-mark tablet.
|
||||
|
|
@ -29,25 +30,25 @@ When adding or renaming a tool, update `TOOL_DEFINITIONS`, `TOOL_CATEGORIES`, `T
|
|||
## Gameplay data registries
|
||||
|
||||
- Item effects: `TarinaiEffectRegistry` owns labels, display colors, modifiers, exclusivity/removal metadata, behavior callbacks, and mystery-drug candidates. Tarinai item-effect methods are the integration layer and should route apply/tick/remove behavior through the registry.
|
||||
- Diseases: `TarinaiDiseaseRegistry` owns disease flags, labels, symptoms/display text, cure-rule notes, and mystery-drug eligibility.
|
||||
- Food: `TarinaiFoodRegistry` owns labels, serving classes, decay multipliers, hygiene penalties, and special effect IDs.
|
||||
- Diseases: `TarinaiDiseaseRegistry` owns disease flags, labels, symptoms/display text, base infection chances, cure-rule notes, and mystery-drug eligibility.
|
||||
- Food: `TarinaiFoodRegistry` owns labels, serving classes, nutrition, hunger relief, decay multipliers, hygiene penalties, and special effect IDs. Serving-food eating paths must read nutrition and hunger relief from this registry.
|
||||
- Weather: `TarinaiWeatherSystem` owns weather transitions and rain-spawned water items. Rain visuals are diagonal line streaks only. Rain-spawned water items, water bowls, zunda juice, and mercury are separate item/object concepts.
|
||||
- Ants: `ANT_EXTENSION_HOOKS` documents future ecology slots only. Do not change worker count, queen founding, carrying, or nest removal balance as part of registry/event cleanup.
|
||||
|
||||
## UI copy and labels
|
||||
|
||||
Most visible UI remains Japanese. Keep user-facing naming consistent: `生活` has been renamed to `精神`; selected Tarinai combat summary shows fight win rate, not cumulative defeats.
|
||||
Most visible UI remains Japanese. Keep user-facing naming consistent: the former lifestyle chart label is now the mental-state label; selected Tarinai combat summary shows fight win rate, not cumulative defeats. The selected Tarinai data panel must show both daily personality-change causes and the rolling `recentChangeCauses` history.
|
||||
|
||||
## Bubble text inventory
|
||||
|
||||
Active Tarinai/world bubble texts:
|
||||
Active Tarinai/world bubble text classes:
|
||||
|
||||
- Symbols: `!`, `?`, `♡`, `...`.
|
||||
- Sleep: `Zzz...`.
|
||||
- Eating/poop: `もぐ`, `ぶりゅっ`, `ぶりゅ…`.
|
||||
- Fear/fight: `はぁぁぁ!`, `はうー!`, `はっ...はっ...`.
|
||||
- Disease/recovery: `うぅ…`, `はう`.
|
||||
- Random small voice: `はう`, `はうぅ`, `はうっ`, `はぅ`.
|
||||
- Eating/poop: short munching and poop sounds.
|
||||
- Fear/fight: short panic, shout, and breathing sounds.
|
||||
- Disease/recovery: short weak or relief sounds.
|
||||
- Random small voice: short Tarinai voice variants.
|
||||
- Item effects: `???`.
|
||||
|
||||
When adding bubbles, keep them short; every bubble may also trigger `audio.bubble`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue