Sha256: 4f4984d9e4a11b5c5e213413398d09d7816fcb82445089579bbc51c1ef9d1f70

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

Gamefic.script do
  respond :drop, Use.family() do |actor, thing|
    if thing.parent != actor
      actor.tell "You're not carrying #{the thing}."
    else
      actor.proceed
    end
  end

  respond :drop, Use.children do |actor, thing|
    if thing.sticky?
      actor.tell thing.sticky_message || "You need to keep #{the thing} for now."
    else
      thing.parent = actor.parent
      actor.tell "You drop #{the thing}."
    end
  end

  interpret "put down :thing", "drop :thing"
  interpret "put :thing down", "drop :thing"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-standard-2.0.0 lib/gamefic-standard/actions/drop.rb