aboutsummaryrefslogtreecommitdiff
path: root/internal/game/look_entities.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-28 02:40:30 -0400
committerhistoria <[not public]>2026-06-28 02:40:30 -0400
commita1b6613c6c6a2f8d6e1ecd47e766bd40f92ac295 (patch)
tree4ff8fefb029c93f2aa3db7361658b0b4e9805b66 /internal/game/look_entities.go
parent87dacfbb3dd16e7f55a82361eace98f9a39d75c8 (diff)
downloadthehouseoficarus-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.go24
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))
}
}