Sha256: 8512541b0122e38a8dfe0a4f2755e698aaefeee947e9ad1c3b039834a047ba57

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

Gamefic.script do
  respond :place, Use.children, Use.reachable do |actor, thing, supporter|
    actor.tell "You can't put #{the thing} on #{the supporter}."
  end

  respond :place, Use.visible, Use.reachable(Supporter) do |actor, thing, supporter|
    if thing.parent != actor
      actor.perform :take, thing
    end
    if thing.parent == actor
      thing.parent = supporter
      actor.tell "You put #{the thing} on #{the supporter}."
    end
  end

  respond :place, Use.children, Use.reachable(Supporter) do |actor, thing, supporter|
    if thing.sticky?
      actor.tell thing.sticky_message || "You need to keep #{the thing} for now."
    else
      thing.parent = supporter
      actor.tell "You put #{the thing} on #{the supporter}."
    end
  end

  respond :place, Use.visible, Use.text do |actor, thing, supporter|
    actor.tell "You don't see anything called \"#{supporter}\" here."
  end

  respond :place, Use.text, Use.visible do |actor, thing, supporter|
    actor.tell "You don't see anything called \"#{thing}\" here."
  end

  respond :place, Use.text, Use.text do |actor, thing, supporter|
    actor.tell "I don't know what you mean by \"#{thing}\" or \"#{supporter}.\""
  end

  xlate "put :thing on :supporter", "place :thing :supporter"
  xlate "put :thing down on :supporter", "place :thing :supporter"
  xlate "set :thing on :supporter", "place :thing :supporter"
  xlate "set :thing down on :supporter", "place :thing :supporter"
  xlate "drop :thing on :supporter", "place :thing :supporter"
  xlate "place :thing on :supporter", "place :thing :supporter"
end

Version data entries

1 entries across 1 versions & 1 rubygems

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