Sha256: 70a99507f4ebca9bb6df4cbe5636fd76ff5c8dc70bd875857bfbda2be3d78735

Contents?: true

Size: 911 Bytes

Versions: 3

Compression:

Stored size: 911 Bytes

Contents

Gamefic.script do
  respond :take, Use.available do |actor, thing|
    if thing.parent == actor
      actor.tell "You're already carrying #{the thing}."
    elsif thing.portable?
      if actor.parent != thing.parent
        actor.tell "You take #{the thing} from #{the thing.parent}."
      else
        actor.tell "You take #{the thing}."
      end
      thing.parent = actor
    else
      actor.tell "You can't take #{the thing}."
    end
  end

  respond :take, Use.available(:attached?) do |actor, thing|
    actor.tell "#{The thing} is attached to #{the thing.parent}."
  end

  respond :take, Use.available(Rubble) do |actor, rubble|
    actor.tell "You don't have any use for #{the rubble}."
  end

  interpret "get :thing", "take :thing"
  interpret "pick up :thing", "take :thing"
  interpret "pick :thing up", "take :thing"
  interpret "carry :thing", "take :thing"
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gamefic-standard-2.4.0 lib/gamefic-standard/actions/take.rb
gamefic-standard-2.3.1 lib/gamefic-standard/actions/take.rb
gamefic-standard-2.3.0 lib/gamefic-standard/actions/take.rb