aboutsummaryrefslogtreecommitdiff
path: root/internal/player/player.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-09 22:15:54 -0400
committerhistoria <[not public]>2026-07-09 22:15:54 -0400
commitecba7f726f70b37126d852c38c7e3eec7b04d730 (patch)
tree9129215c6e5015336fde1116395336d82bb952d1 /internal/player/player.go
parentb3d4c616f59ad2519f3a0b77e3b47d6571cd2486 (diff)
downloadthehouseoficarus-ecba7f726f70b37126d852c38c7e3eec7b04d730.tar.gz
feat: old standalone trigger systems completely unified into trigger->condition->action system
Diffstat (limited to 'internal/player/player.go')
-rw-r--r--internal/player/player.go28
1 files changed, 20 insertions, 8 deletions
diff --git a/internal/player/player.go b/internal/player/player.go
index f56521e..5ffea6d 100644
--- a/internal/player/player.go
+++ b/internal/player/player.go
@@ -172,7 +172,7 @@ type Player struct {
Prompt string `yaml:"prompt"`
Options map[string]any `yaml:"-"`
Flags map[string]any `yaml:"flags"`
- EnterSeqRoom int `yaml:"enter_seq_room,omitempty"`
+ PendingSequence *PendingSequence `yaml:"pending_sequence,omitempty"`
RegenerateTick int
AmmoQty int `yaml:"ammo_qty,omitempty"`
Action *behavior.Action `yaml:"-"`
@@ -180,13 +180,13 @@ type Player struct {
WalkSequence []string `yaml:"-"`
ConsumeCooldown int `yaml:"-"`
HomeTransportCooldown int `yaml:"-"`
- MoveTicks int `yaml:"-"`
+ MoveTicks int `yaml:"-"`
MoveDirection string `yaml:"-"`
- MoveTarget int `yaml:"-"`
- MovePendingInteraction *behavior.Interaction `yaml:"-"`
- VisualTickCurrent int `yaml:"-"`
- AutotriggerMod string `yaml:"-"`
- QueuedTrigger string `yaml:"-"`
+ MoveTarget int `yaml:"-"`
+ MovePendingTrigger *behavior.Trigger `yaml:"-"`
+ VisualTickCurrent int `yaml:"-"`
+ AutotriggerMod string `yaml:"-"`
+ QueuedTrigger string `yaml:"-"`
AttackTimer int `yaml:"-"`
HazardTimer int `yaml:"-"`
PendingDangerDir string `yaml:"-"`
@@ -208,6 +208,18 @@ type MapSymbolData struct {
Color string `yaml:"color,omitempty"`
}
+// PendingSequence is the persisted snapshot of an in-flight LOCKED trigger
+// sequence (Trigger.Lock == true). Unlocked sequences are never persisted.
+// On reconnect, the game rebuilds a sequence from this snapshot and resumes
+// it from the saved Wait offset.
+type PendingSequence struct {
+ Key string `yaml:"key"`
+ RoomID int `yaml:"room_id"`
+ Steps []behavior.Step `yaml:"steps"`
+ Wait int `yaml:"wait"`
+ FlagVal any `yaml:"flag_val,omitempty"`
+}
+
type PotionBuff struct {
Stat string
BonusPercent int
@@ -218,7 +230,7 @@ func (p *Player) ClearMoveState() {
p.MoveTicks = 0
p.MoveDirection = ""
p.MoveTarget = 0
- p.MovePendingInteraction = nil
+ p.MovePendingTrigger = nil
}
func (p *Player) OptionBool(name string) bool {