Sha256: 9fda4c251a60a62d9f79939d95306f39e4b63465810f240fcf61a9d2119f96c3

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

Gamefic.script do
  respond :go, Use.siblings(Portal) do |actor, portal|
    if actor.parent != actor.room
      actor.perform :leave
    end
    if actor.parent == actor.room
      if portal.destination.nil?
        actor.tell "That portal leads nowhere."
      else
        actor.parent = portal.destination
        if !portal.direction.nil?
          actor.tell "You go #{portal.direction}."
        end
        actor.perform :look
      end
    end
  end

  respond :go, Use.text do |actor, string|
    actor.tell "You don't see any exit \"#{string}\" from here."
  end

  respond :go do |actor|
    actor.tell "Where do you want to go?"
  end

  xlate "north", "go north"
  xlate "south", "go south"
  xlate "west", "go west"
  xlate "east", "go east"
  xlate "up", "go up"
  xlate "down", "go down"
  xlate "northwest", "go northwest"
  xlate "northeast", "go northeast"
  xlate "southwest", "go southwest"
  xlate "southeast", "go southeast"

  xlate "n", "go north"
  xlate "s", "go south"
  xlate "w", "go west"
  xlate "e", "go east"
  xlate "u", "go up"
  xlate "d", "go down"
  xlate "nw", "go northwest"
  xlate "ne", "go northeast"
  xlate "sw", "go southwest"
  xlate "se", "go southeast"

  interpret "go to :place", "go :place"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-standard-2.1.0 lib/gamefic-standard/actions/go.rb