Sha256: fb0a210fcc360c03f97a4377e0da644bf6341405a2e8311f296ea7098ec3a262

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

Gamefic.script do
  respond :wear, Use.available(Clothing) do |actor, clothing|
    if clothing.parent != actor
      actor.tell "You don't have #{the clothing}."
    end
    if clothing.attached?
      actor.tell "You're already wearing #{the clothing}."
    else
      already = actor.children.that_are(clothing.class).that_are(:attached?)
      if already.length == 0
        clothing.attached = true
        actor.tell "You put on #{the clothing}."
      else
        actor.tell "You're already wearing #{an already[0]}."
      end
    end
  end

  xlate "put on :clothing", "wear :clothing"
  xlate "put :clothing on", "wear :clothing"
  xlate "don :clothing", "wear :clothing"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-standard-2.1.0 lib/gamefic-standard/clothing/actions/wear.rb