diff options
| author | historia <[not public]> | 2026-06-28 02:40:30 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-28 02:40:30 -0400 |
| commit | a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295 (patch) | |
| tree | 4ff8fefb029c93f2aa3db7361658b0b4e9805b66 /internal/game/look_entities.go | |
| parent | 87dacfbb3dd16e7f55a82361eace98f9a39d75c8 (diff) | |
| download | thehouseoficarus-a1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295.tar.gz | |
feat: admin accounts, god mode, OLC commands like dig/room, 'inline' objects changed to 'local' objects
Diffstat (limited to 'internal/game/look_entities.go')
| -rw-r--r-- | internal/game/look_entities.go | 24 |
1 files changed, 19 insertions, 5 deletions
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)) } } |
