Sha256: 4a4295ef3087726917103249b710fbc2bc8e66dbd5eeb124af67ce19c3cf62b2

Contents?: true

Size: 396 Bytes

Versions: 2

Compression:

Stored size: 396 Bytes

Contents

# @gamefic.script standard/edible

module Edibility
  attr_writer :edible
  def edible?
    @edible ||= false
  end
end

class Thing
  include Edibility
end

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

  respond :eat, Use.available(:edible?) do |actor, item|
    actor.tell "You eat #{the item}."
    destroy item
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gamefic-standard-2.1.0 lib/gamefic-standard/edible.rb
gamefic-standard-2.0.0 lib/gamefic-standard/edible.rb