Echo Hollow

Gender-Bending Interactive Stories! :D

User Tools

Site Tools


libecho:classes:apparel

This is an old revision of the document!


LibEcho.Apparel

Apparel in LibEcho is defined as anything that a Person can wear. This includes clothing, jewelry, and perhaps even naughty toys in some cases.

The Apparel system also provides the Wardrobe and WornApparel classes, which is a special subclasses of GeneralInventory that only deal with Apparel. Wardrobe is a lightly modified GeneralInventory that modifies the sorting implementation to make it more clothing-specific (although it can still contain any PersistentObject, non Apparel objects will all be lumped into the “Other” category). WornApparel is used by the Person classes to track what a Person is wearing, and provides the auto-removal functionality mentioned above.

In general, you may use a Wardrobe interchangeably with a GeneralInventory with the InventoryUI macro. For the wearing and removing of Apparel by a Person, however, a modified version (ApparelUI) is provided. The left-hand inventory provided to ApparelUI should always be a Person (not a WornApparel, but the higher-level Person object that is dressing/undressing). The right-hand inventory should always be a Wardrobe.

FIXME: Document how WornApparel and Wardrobe interact as far as items technically remaining in the Wardrobe while they are worn by a Person.

Clothing Slots

An article of Apparel may occupy one or more ClothingSlots. This prevents a character from wearing a dozen coats at the same time, for example. A shirt would occupy ClothingSlot.TORSO and a pair of pants would occupy ClothingSlot.LEGS. A dress would occupy both ClothingSlot.TORSO and ClothingSlot.LEGS. The ClothingSlots occupied by an article of clothing are baked into the GenericApparel subclasses, but you may derive your own subclasses to define new types of Apparel, or override the default ClothingSlots in your object defaults JS file.

When a Person wears a particular article of Apparel, any currently worn articles that occupy the same ClothingSlots are removed. This prevents the player from equipping, say, 10 pairs of underpants at the same time.

Certain ClothingSlots can cover other ClothingSlots, concealing them. This allows a Person to, for example, hide some racy underpants under their normal clothes, or a whole racy outfit under a long coat. The details of what covers what and how are below.

In general, you probably needn't ever worry about ClothingSlots. If you just define your specific articles of Apparel using the various Apparel subclasses, all of the ClothingSlot magic will be taken care of for you well, magically.

LibEcho.Apparel.ClothingSlot

ClothingSlot is an enumeration that describes what “slots” an article of Apparel occupies on a Person when worn. Only one article of Apparel may occupy a particular ClothingSlot.

ClothingSlot.UNDERPANTS

Boxers, briefs, panties, etc.

  • Covers: Nothing.
  • Covered By: LEGS, TORSO (if long), OVER (if long).

ClothingSlot.UNDERSHIRT

Bras and such; T-shirts should use TORSO.

  • Covers: Nothing.
  • Covered By: TORSO (if not low - FIXME), OVER (if not low - FIXME).
  • (Under which is - FIXME): TORSO (if low), OVER (if low).

ClothingSlot.UNDERLEGS

Socks and hosiery.

  • Covers: Nothing.
  • Covered By: LEGS+FEET (if LEGS are long and FEET are tall), OVER+FEET (if OVER is long and FEET are tall).

ClothingSlot.TORSO

Shirts and tops.

  • Covers: UNDERSHIRT, UNDERPANTS (if long), NECK (if tall).
  • Covered By: OVER.

ClothingSlot.LEGS

Pants, skirts, and bottoms; Socks and hosiery should use UNDERLEGS

  • Covers: UNDERPANTS, UNDERLEGS (if long and FEET slot contains something tall).
  • Covered By: OVER (if long).

ClothingSlot.FEET

Shoes. Socks and hosiery should use UNDERLEGS.

  • Covers: UNDERLEGS (if tall and LEGS slot contains something long).
  • Covered By: OVER (if long).

ClothingSlot.OVER

Coats and shawls.

  • Covers: TORSO, UNDERSHIRT, LEGS (if long), UNDERPANTS (if long), UNDERLEGS (if long and FEET slot contains something tall), NECK (if tall).
  • Covered By: Nothing.

ClothingSlot.GLOVES

Gloves.

  • Covers: FINGER, WRIST (if long).
  • Covered By: Nothing.

ClothingSlot.HEAD

Hats and helmets.

  • Covers: Ears (if long).
  • Covered By: Nothing.

ClothingSlot.EARS

Earrings. Something like earmuffs probably should use HEAD.

  • Covers: Nothing.
  • Covered By: HEAD (if long).

ClothingSlot.NECK

Necklaces and ties.

  • Covers: Nothing.
  • Covered By: TORSO (if tall), OVER (if tall).

ClothingSlot.WRIST

Bracelets, watches.

  • Covers: Nothing.
  • Covered By: GLOVES (if long).

ClothingSlot.FINGER

Rings.

  • Covers: Nothing.
  • Covered By: GLOVES.

ClothingSlot.???

  • FIXME Other piercing slots?
  • FIXME Should there be slots for sex toys?

Apparel Types

A couple of generic Apparel types are provided. GenericApparel provides a bare-bones Apparel implementation from which which all other Apparel types are derived. GenericMenswear and GenericWomenswear provide implementations which reference the potential wearer's femininity stat to determine whether or not they can be worn, and provide some default adjustments to that stat (currently unimplemented).

Articles of Apparel may also be given various properties.

The “long” and/or “tall” properties interact with the ClothingSlots, providing additional concealment. For example, a turtleneck sweater might be “tall”, concealing the neck as well as anything worn beneath it on the torso. A “long” coat occupying ClothingSlot.OVER would conceal the legs as well as the torso.

The “low” property currently only applies to items occupying ClothingSlot.TORSO, and will reveal what is worn on ClothingSlot.UNDERSHIRT, unless that item is also “low”. A low-cut off-shoulder top revealing a tank top or bra worn beneath it, for example.

The “transparent” property will cause an article of Apparel to reveal whatever is worn beneath it regardless. A fishnet top or translucent wraparound, for example.

The “thin” property is used to denote tight-fitting articles of Apparel made with thin fabric. A tight-fitting t-shirt, for example. The articles of apparel worn below will “show an outline” through this article of Apparel, and will be listed with their genericName when looking at a Person, without showing the specific details of the item below. For example, wearing a “pink polka-dot bra” beneath a “tight red t-shirt” will list in descriptions as “a tight red t-shirt and a bra (printing through the tight red t-shirt),” rather than specifically as a “pink polka-dot bra”.

Several specific Apparel types are provided, which ought to cover most use-cases, simplifying the structure of the defaults files. Details of these specific types are listed below.

Generic Apparel

Unless you are actually extending the library, you probably don't need to use any of these GenericApparel classes. If you are just using the library in your game, you're probably better off using the specific Apparel classes. * * This is the generic {@link LibEcho.Apparel|Apparel} type from which all other {@link LibEcho.Apparel|Apparel} is derived. {@link LibEcho.Persistence.PersistentObject|PersistentObjects} that specify this type in their defaults must also explicitly provide a slots section.

LibEcho.Apparel.GenericApparel

LibEcho.Apparel.GenericMenswear

LibEcho.Apparel.GenericWomenswear

Specific Apparel Types

LibEcho.Apparel.Unisex.NNN

LibEcho.Apparel.Menswear.NNN

LibEcho.Apparel.Womenswear.NNN

LibEcho.Apparel.Jewelry.NNN

Wardrobes

LibEcho.Apparel.Wardrobe

Worn Apparel

LibEcho.Apparel.WornApparel

The Apparel UI

LibEcho.Apparel.ApparelUI

libecho/classes/apparel.1653012087.txt.gz · Last modified: 2022/05/19 19:01 by lee