diff options
Diffstat (limited to 'internal/player')
| -rw-r--r-- | internal/player/player.go | 28 |
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 { |
