Echo Hollow

Because Pr0n is the Highest Form of Art.

User Tools

Site Tools


libecho:classes:start

This is an old revision of the document!


LibEcho Class Reference

I was originally doing this automagically with JSDoc, but it made the source code a mess. So here it all is redone by hand in markdown.

I do my best to keep this up-to-date, but the source code is the ultimate reference.

This file is meant to be dry technical documentation of the class implementation for reference purposes. For a more friendly treatise on using the library, please see the Tutorial.

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.

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.

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.

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

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).

Apparel Types

LibEcho.Apparel.GenericApparel

LibEcho.Apparel.GenericMenswear

LibEcho.Apparel.GenericWomenswear

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/start.1653008305.txt.gz · Last modified: 2022/05/19 17:58 by lee