Sha256: 7184ec8aebcf49826fca16c3c3787ced8f0fdc8c7764d49b667effe64974df04

Contents?: true

Size: 607 Bytes

Versions: 2

Compression:

Stored size: 607 Bytes

Contents

Gamefic.script do
  respond :give, Use.available, Gamefic::Query::Children.new do |actor, _character, _gift|
    actor.tell 'Nothing happens.'
  end

  respond :give, Use.available(Character), Use.available do |actor, character, gift|
    actor.tell "#{The character} doesn't want #{the gift}."
  end

  respond :give, Use.available(Character), Use.available do |actor, _character, gift|
    if gift.parent != actor
      actor.perform :take, gift
    end
    if gift.parent == actor
      actor.proceed
    end
  end

  interpret 'give :gift to :character', 'give :character :gift'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gamefic-standard-2.3.1 lib/gamefic-standard/give.rb
gamefic-standard-2.3.0 lib/gamefic-standard/give.rb