From a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sun, 28 Jun 2026 02:40:30 -0400 Subject: feat: admin accounts, god mode, OLC commands like dig/room, 'inline' objects changed to 'local' objects --- internal/game/look_entities.go | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'internal/game/look_entities.go') diff --git a/internal/game/look_entities.go b/internal/game/look_entities.go index def505a..2a9a360 100644 --- a/internal/game/look_entities.go +++ b/internal/game/look_entities.go @@ -88,12 +88,12 @@ func (g *Game) showRoomObjects(sess *net.Session, p *player.Player, room *world. } for _, objID := range order { count := grouped[objID] - def, err := g.resolveObjectDef(p.RoomID, objID) + def, isLocal, err := g.resolveObjectDef(p.RoomID, objID) if err != nil { continue } - if def.Hidden { + if def.Hidden && !p.GodMode { continue } @@ -101,6 +101,20 @@ func (g *Game) showRoomObjects(sess *net.Session, p *player.Player, room *world. continue } + var godPrefix string + if p.GodMode { + var tags []string + if isLocal { + tags = append(tags, color.Render(g.colorMode(sess), color.ColorSpec{Bold: true}, "[LOCAL]")) + } else { + tags = append(tags, color.Render(g.colorMode(sess), color.ColorSpec{Bold: true}, "[GLOBAL]")) + } + if def.Hidden { + tags = append(tags, color.Render(g.colorMode(sess), color.ColorSpec{Bold: true}, "(HIDDEN)")) + } + godPrefix = strings.Join(tags, " ") + " " + } + type instInfo struct { idx int depleted bool @@ -163,7 +177,7 @@ func (g *Game) showRoomObjects(sess *net.Session, p *player.Player, room *world. if showTimers && len(instances) > 0 && instances[0].quality > 0 { qualityTimer = fmt.Sprintf(" (Burning for %d more ticks)", instances[0].quality) } - lines = append(lines, fmt.Sprintf("%s%s%s", line, suffix, qualityTimer)) + lines = append(lines, fmt.Sprintf("%s%s%s%s", godPrefix, line, suffix, qualityTimer)) } for _, ins := range timed { @@ -181,7 +195,7 @@ func (g *Game) showRoomObjects(sess *net.Session, p *player.Player, room *world. if showTimers { timer = fmt.Sprintf(" (despawn: %d/%d)", ins.sharedCur, ins.sharedMax) } - lines = append(lines, fmt.Sprintf("%s%s%s", line, tag, timer)) + lines = append(lines, fmt.Sprintf("%s%s%s%s", godPrefix, line, tag, timer)) } for _, ins := range depleted { @@ -199,7 +213,7 @@ func (g *Game) showRoomObjects(sess *net.Session, p *player.Player, room *world. if showTimers { timer = fmt.Sprintf(" (respawns in %d ticks)", ins.respawnIn) } - lines = append(lines, fmt.Sprintf("%s (depleted)%s%s", line, tag, timer)) + lines = append(lines, fmt.Sprintf("%s%s (depleted)%s%s", godPrefix, line, tag, timer)) } } -- cgit v1.2.3