Sha256: c3d20394bcc0ab1763109a39e94b957fad08872afa071b9a9b6348ca1c06c39b

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 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 "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

4 entries across 4 versions & 1 rubygems

Version Path
gamefic-standard-3.2.1 lib/gamefic-standard/actions/enter.rb
gamefic-standard-3.2.0 lib/gamefic-standard/actions/enter.rb
gamefic-standard-3.1.0 lib/gamefic-standard/actions/enter.rb
gamefic-standard-3.0.0 lib/gamefic-standard/actions/enter.rb