Sha256: b54488e5aa8b9bb6a86c8e7599c445ffd7c01318a3934cd0087b5bb871b9b609

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

module Gamefic
  module Standard
    script do
      respond :enter, siblings do |actor, thing|
        actor.tell "#{The thing} can't accommodate you."
      end

      respond :enter, siblings(Enterable, proc(&:enterable?)) do |actor, supporter|
        actor.parent = supporter
        actor.tell "You get in #{the supporter}."
      end

      respond :enter, parent do |actor, container|
        actor.tell "You're already in #{the container}."
      end

      respond :enter, parent(Supporter) do |actor, supporter|
        actor.tell "You're inside #{the supporter} already."
      end

      respond :enter, siblings(Container, proc(&:enterable?), proc(&:closed?)) do |actor, container|
        actor.tell "#{The container} is closed."
      end

      interpret "get on :thing", "enter :thing"
      interpret "get in :thing", "enter :thing"
      interpret "get inside :thing", "enter :thing"
      interpret "sit on :thing", "enter :thing"
      interpret "sit in :thing", "enter :thing"
      interpret "lie on :thing", "enter :thing"
      interpret "lie in :thing", "enter :thing"
      interpret "stand on :thing", "enter :thing"
      interpret "stand in :thing", "enter :thing"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gamefic-standard-3.2.4 lib/gamefic-standard/actions/enter.rb
gamefic-standard-3.2.3 lib/gamefic-standard/actions/enter.rb
gamefic-standard-3.2.2 lib/gamefic-standard/actions/enter.rb