Files
2026-06-11 20:42:08 -05:00

31 lines
1.6 KiB
Markdown

# System Conventions
## Battle
- Fighters live in `BATTLE.fighterMap: Dictionary[BattlePosition, BattleFighter]`
- `BattleFighter` is pure data (no Node); `BattleFighterScene` is the 3D visual
- Battle flow is driven by `BattleCutsceneAction.playerDecisionCallable` which loops via `CUTSCENE_ADD_END`
- New moves → add static preset in [battle/fighter/BattleMove.gd](../../battle/fighter/BattleMove.gd), add `perform()` logic in [battle/action/BattleMove.gd](../../battle/action/BattleMove.gd)
## Entities (Overworld)
See [Overworld](overworld.md) for the full reference (scene structure, interaction types, camera, map transitions).
- All interactable world objects extend `Entity` (CharacterBody3D)
- Interaction type set via `@export var interactType:InteractType`
- Interaction routing lives in `EntityInteractableArea.onInteract()` — add new `InteractType` values there
- NPC conversation entities: set `interactType = CONVERSATION`, assign `dialogueResource` (a `.dialogue` file) and `dialogueTitle` (section to start from, default `"start"`)
## Items
- Register new items in [item/Item.gd](../../item/Item.gd) — add to `Id` enum and call `itemDefine()`
- Item ID order in the enum **must match** insertion order into `ITEM_DATA`
## UI
See [UI](ui.md) for the full reference (VNTextbox, ClosableMenu, pause/debug/settings menus, AdvancedRichText, adding new menus).
- `UI.TEXTBOX.setTextAndWait(text)` — show dialogue and await player dismiss (use `await`)
- Movement is blocked automatically when `UI.TEXTBOX` is visible (`EntityMovement._canMove()` checks this)
- Menus extend `ClosableMenu` for open/close/toggle + `closed`/`opened` signals