From ecba7f726f70b37126d852c38c7e3eec7b04d730 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 9 Jul 2026 22:15:54 -0400 Subject: feat: old standalone trigger systems completely unified into trigger->condition->action system --- internal/player/player.go | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'internal/player') 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 { -- cgit v1.2.3