Sha256: 52b6ea3116e0d2789306dfda0c66c5c6327b7544dc233a7c8b51e8b5428c7fdc

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 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.tell "<strong>#{actor.room.name.cap_first}</strong>"
        actor.execute :_describe_destination
        actor.execute :_itemize_room
      end
    end
  end

  meta :_describe_destination do |actor|
    actor.tell actor.room.description if actor.room.has_description?
  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.0.0 lib/gamefic-standard/actions/go.rb