Sha256: a22658e94b3a5fb564b4ebc1e4adf1fecbdaddd82f6ddb8ff8764b720b575683

Contents?: true

Size: 833 Bytes

Versions: 1

Compression:

Stored size: 833 Bytes

Contents

Gamefic.script do
  respond :search, Use.available(Thing) do |actor, thing|
    actor.execute :look, thing
  end

  respond :search, Use.available(Receptacle) do |actor, thing|
    if thing.accessible?
      itemized = thing.children.that_are_not(:attached?).that_are(:itemized?)
      if itemized.empty?
        actor.tell "There's nothing inside #{the thing}."
      else
        actor.tell "You see #{itemized.join_and} in #{the thing}." unless itemized.empty?
      end
    else
      actor.tell "You can't see inside #{the thing}."
    end
  end

  respond :search, Use.available(Container, :closed?) do |actor, container|
    actor.execute :open, container
    actor.proceed if container.open?
  end

  interpret 'look inside :thing', 'search :thing'
  interpret 'look in :thing', 'search :thing'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-standard-2.4.0 lib/gamefic-standard/actions/search.rb