aboutsummaryrefslogtreecommitdiff
path: root/internal/game
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game')
-rw-r--r--internal/game/cmd_room_insert.go4
-rw-r--r--internal/game/cmd_room_remove.go4
-rw-r--r--internal/game/sys_safespot.go13
3 files changed, 7 insertions, 14 deletions
diff --git a/internal/game/cmd_room_insert.go b/internal/game/cmd_room_insert.go
index 09b2e74..8087cca 100644
--- a/internal/game/cmd_room_insert.go
+++ b/internal/game/cmd_room_insert.go
@@ -81,7 +81,7 @@ func (g *Game) roomInsert(sess *net.Session, args []string) {
if len(conflicts) > 0 {
for _, c := range conflicts {
switch c.Kind {
- case "twist":
+ case world.GridConflictTwist:
room, _ := g.World.LoadRoom(c.Target)
conflictName := fmt.Sprintf("#%d", c.Target)
if room != nil {
@@ -90,7 +90,7 @@ func (g *Game) roomInsert(sess *net.Session, args []string) {
sess.WriteLine(fmt.Sprintf(
"Cannot insert: room %s would have an ambiguous grid position after insertion (reachable via an alternate path from here).",
conflictName))
- case "overlap":
+ case world.GridConflictOverlap:
occRoom, _ := g.World.LoadRoom(c.Occupier)
occName := fmt.Sprintf("#%d", c.Occupier)
if occRoom != nil {
diff --git a/internal/game/cmd_room_remove.go b/internal/game/cmd_room_remove.go
index c84e747..d31f02d 100644
--- a/internal/game/cmd_room_remove.go
+++ b/internal/game/cmd_room_remove.go
@@ -138,7 +138,7 @@ func (g *Game) roomRemove(sess *net.Session, args []string) {
if len(conflicts) > 0 {
for _, c := range conflicts {
switch c.Kind {
- case "twist":
+ case world.GridConflictTwist:
room, _ := g.World.LoadRoom(c.Target)
name := fmt.Sprintf("#%d", c.Target)
if room != nil {
@@ -147,7 +147,7 @@ func (g *Game) roomRemove(sess *net.Session, args []string) {
sess.WriteLine(fmt.Sprintf(
"Cannot remove: pulling the far end would give room %s an ambiguous grid position.",
name))
- case "overlap":
+ case world.GridConflictOverlap:
occRoom, _ := g.World.LoadRoom(c.Occupier)
occName := fmt.Sprintf("#%d", c.Occupier)
if occRoom != nil {
diff --git a/internal/game/sys_safespot.go b/internal/game/sys_safespot.go
index 7876b38..539f69d 100644
--- a/internal/game/sys_safespot.go
+++ b/internal/game/sys_safespot.go
@@ -11,13 +11,6 @@ import (
"thehouseoficarus/internal/world"
)
-var sizeRank = map[string]int{
- "small": 1,
- "medium": 2,
- "large": 3,
- "massive": 4,
-}
-
func (g *Game) isSafespotted(playerName string) bool {
return g.safespot.IsActive(playerName)
}
@@ -34,10 +27,10 @@ func blocksMob(maxBlockSize, mobSize string) bool {
if maxBlockSize == "" {
return true
}
- max := sizeRank[maxBlockSize]
- mob := sizeRank[mobSize]
+ max := object.MobSizeRank[maxBlockSize]
+ mob := object.MobSizeRank[mobSize]
if mob == 0 {
- mob = sizeRank["medium"]
+ mob = object.MobSizeRank["medium"]
}
return mob <= max
}