Sha256: ac1ef2b92550384204c7f8c255e06298d0caa0f8ad9d7a7373ed461565511358

Contents?: true

Size: 361 Bytes

Versions: 3

Compression:

Stored size: 361 Bytes

Contents

Gamefic.script do
  respond :close, Use.available do |actor, thing|
    actor.tell "You can't close #{the thing}."
  end

  respond :close, Use.available(Openable) do |actor, thing|
    if thing.open?
      actor.tell "You close #{the thing}."
      thing.open = false
    else
      actor.tell "#{The thing} is already closed."
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gamefic-standard-2.4.0 lib/gamefic-standard/actions/close.rb
gamefic-standard-2.3.1 lib/gamefic-standard/actions/close.rb
gamefic-standard-2.3.0 lib/gamefic-standard/actions/close.rb