Sha256: ad9e77b89d344e619738f5b0854ee72262d38eedd6eb43655093fe19e59aae5d

Contents?: true

Size: 607 Bytes

Versions: 1

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.execute :take, gift
    end
    if gift.parent == actor
      actor.proceed
    end
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-standard-2.4.0 lib/gamefic-standard/give.rb