From e2d5b081f27141bb3dd89dbe595860b8a1345d55 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 25 Jun 2026 21:23:34 -0400 Subject: feat: on_enter features ported over to triggers, cosmetic fixes with trigger messages --- internal/world/room.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'internal/world') diff --git a/internal/world/room.go b/internal/world/room.go index 22e7f79..aced969 100644 --- a/internal/world/room.go +++ b/internal/world/room.go @@ -103,14 +103,24 @@ type EnterStep struct { Delay int `yaml:"delay"` SetFlags map[string]any `yaml:"set_flags"` SetPlayerFlags map[string]any `yaml:"set_player_flags"` + Broadcast string `yaml:"broadcast"` + BroadcastGlobal string `yaml:"broadcast_global"` + SpawnMob *SpawnMobConfig `yaml:"spawn_mob"` + DespawnMob string `yaml:"despawn_mob"` + GiveItem string `yaml:"give_item"` + TakeItem string `yaml:"take_item"` + Teleport int `yaml:"teleport"` + Heal int `yaml:"heal"` } -// IsTimed reports whether the step carries cutscene semantics: a tick delay or -// a flag mutation. A room whose qualifying on_enter steps are all non-timed is -// printed synchronously; any timed step turns the sequence into a scheduled -// cutscene. +// IsTimed reports whether the step carries enter-sequence semantics (any +// non-zero field means it needs per-tick scheduling rather than synchronous +// printing). func (e EnterStep) IsTimed() bool { - return e.Delay > 0 || len(e.SetFlags) > 0 || len(e.SetPlayerFlags) > 0 + return e.Delay > 0 || len(e.SetFlags) > 0 || len(e.SetPlayerFlags) > 0 || + e.Message != "" || e.Broadcast != "" || e.BroadcastGlobal != "" || + e.SpawnMob != nil || e.DespawnMob != "" || e.GiveItem != "" || + e.TakeItem != "" || e.Teleport != 0 || e.Heal != 0 } type RoomObject struct { -- cgit v1.2.3