diff options
Diffstat (limited to 'internal/game/cmd_trigger_transport.go')
| -rw-r--r-- | internal/game/cmd_trigger_transport.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/game/cmd_trigger_transport.go b/internal/game/cmd_trigger_transport.go index f6c9c77..1aa3089 100644 --- a/internal/game/cmd_trigger_transport.go +++ b/internal/game/cmd_trigger_transport.go @@ -44,6 +44,14 @@ func (g *Game) executeTransportEffect(sess *net.Session, p *player.Player, mod * } } + // A transport changes rooms just like a walk or teleport, so it must + // clear any safespot cover: the safespot predicates are room-agnostic, + // so leaving the state active would grant melee/hazard immunity in the + // destination and keep the player as a phantom occupant of the old cover. + if ss, ok := g.safespot.Get(p.Name); ok { + g.forceLeaveSafespot(sess, p, &ss, "") + } + sess.WriteLine(fmt.Sprintf("You activate %s...", mod.Name)) p.RoomID = mod.Destination @@ -53,6 +61,12 @@ func (g *Game) executeTransportEffect(sess *net.Session, p *player.Player, mod * g.Hub.EnterRoom(sess, p.RoomID) } + // Seed the destination exactly as the other teleport paths do, or the + // room's mobs, objects and ground spawns never appear. + g.World.SeedGroundItems(p.RoomID) + g.seedRoomMobs(p.RoomID) + g.seedRoomObjects(p.RoomID) + room, _ := g.World.LoadRoom(p.RoomID) destName := fmt.Sprintf("room %d", p.RoomID) if room != nil { @@ -61,4 +75,6 @@ func (g *Game) executeTransportEffect(sess *net.Session, p *player.Player, mod * sess.WriteLine(fmt.Sprintf("You arrive at %s.", destName)) g.saveCharacter(p) g.doLook(sess) + g.runEnterSteps(sess, p.RoomID) + g.writePrompt(sess) } |
