Sha256: 4dd2c6d000939acf8f4079c0da767204f88f09f10eb4ac3e03543269890ac15c

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

module Gamefic
  module Standard
    module Actions
      module Close
        extend Gamefic::Scriptable

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

        respond :close, 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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gamefic-standard-4.0.0 lib/gamefic/standard/actions/close.rb
gamefic-standard-3.3.0 lib/gamefic-standard/actions/close.rb