문서 수정: 레거시 엔진 문서에 aux 및 penalty 동작 관련 내용 추가

This commit is contained in:
2025-12-27 03:49:08 +00:00
parent ef07f7f7d7
commit f1af2717c3
4 changed files with 33 additions and 2 deletions
@@ -9,6 +9,7 @@ exposes trigger hooks. The main reference is `legacy/hwe/sammo/General.php`.
- `last_turn` is parsed into `LastTurn`, and a separate `resultTurn` is
maintained for updates.
- `penalty` JSON is decoded into `PenaltyKey -> value` map.
- `aux` JSON is lazily decoded and only written when aux values change.
- Rank data is tracked with:
- `rankVarRead` (current read view)
- `rankVarIncrease` (increment queue)
@@ -53,6 +54,16 @@ Convenience wrappers:
`BaseCommand::addTermStack()` to advance multi-turn commands.
- `applyDB()` persists updated fields and writes `last_turn` if it changed.
## Aux and Penalty Behavior
- `aux` is loaded on demand (`unpackAux()`), and `setAuxVar()` writes through to
`general.aux` only when values changed.
- Setting an aux value to `null` deletes the key from JSON.
- Command constraints that require aux values trigger `General::unpackAux()`
before evaluation.
- `penalty` is used in both `General` logic (AI and permission checks) and
API flows (messages, nation tools); runtime expiration is not automatic.
## Trigger and Modifier Hooks
`General` delegates calculations and trigger lists through action objects: