Global

Methods

combatantString(builder, character)

Description:
  • Remove uninteresting traists from the description.

Source:
Parameters:
Name Type Description
builder
character

(static) createAppearance(character) → {String}

Description:
  • Describe a character's appearance and behavior. This description will be different each time the character is passed to this function.

    atomic.createAppearance({ character })
    => "Long brown hair, short stature"
    
Source:
Parameters:
Name Type Description
character ion.models.Character

The character to describe.

Returns:

A description of the appearance and behavior of the character

Type
String

createBag(paramsopt)

Description:
  • Generate a collection of items.

Source:
Example
let bag = createBag({ totalValue: 500, minValue: 10, tags: 'firearm'});
bag.toString()
=> "2 Browning Automatic Rifles, a M14 Rifle...and a pulse rifle."
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Default Description
tags String <optional>

One or more query tags specifying the items in the bag

minValue Number <optional>
maxValue Number <optional>
minEnc Number <optional>
maxEnc Number <optional>
totalValue Number <optional>
20

The total value of the bag

fillBag Boolean <optional>
true

Should the bag's value be filled with currency if it hasn't been filled any other way? Usually currency has a value of 1 or less, and can cover a gap otherwise caused by search criteria, but this isn't always desirable.

createCharacterName(params) → {CharacterName}

Description:
  • Generate a random name for a mid-century American, of the kind that would be wandering around an atomic era apocalypse. Does not add a nickname.

Source:
Example
createCharacterName({gender: 'female', heritage: 'latino'})
=> {"given": "Elena", "family": "Silva", "gender": "female", "heritage": "latino"}
let girl = createCharacterName({gender: 'female'})
girl.toString()
=> "Ada King"
Parameters:
Name Type Description
params Object
Properties
Name Type Description
gender String

'male' or 'female' name. Optional. If not specified, gender is 50/50.

heritage String

'anglo' or 'latino' (Optional. If not specified, 20% of names are Latino).

given String

set the given name to this name

family String

set the family name to this name

Returns:
Type
CharacterName

createContainer(params) → {Bag}

Description:
  • Create a bag with additional properties (representing a container of some kind, like a lockbox or safe).

Source:
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
type String <optional>

the container type

Returns:

a bag representing a container

Type
Bag

createKit(params) → {Object}

Description:
  • Generate the possessions that would be on the person of an active NPC (e.g. out on patrol, out for a night on the town, out on a raid or in the middle of criminal activity).

Source:
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
profession String | Profession <optional>

profession name or instance

gender String <optional>

gender of character (male or female)

traveling boolean <optional>

should this bag include extended equipment for exploring, and not just walk-abouts?

Returns:

An object of two bags, one under the property "clothing" and another under the bag of "possessions".

Type
Object

createLocation()

Description:
  • Create a location. You must supply the starting point to create a location and all the “contained” sites in that location will be produced in an instance of that location. Note that name here is the name of the location template, not the name that is applied to the location that is created (that can sometimes be quite creative). It’s usually very similar to the ID.

Source:

createMagazineTitle() → {String}

Description:
  • Magazines will be produced as generic items in bags, loot, etc. This method returns a magazine with an auto-generated title, usually pretty silly. The titles are random so these magazines are not considered collectible.

Source:
Returns:

magazine with a title

Type
String

createStockpile(paramsopt) → {Bag}

Description:
  • Like creating a bag but with many more repeated items (purposefully repeated, not accidentally repeated), as if collected for a cache, shop, or storeroom. Honors the totalValue limit (in fact will usually fall short of it), but fillBag will always be treated as false.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Default Description
tags String <optional>

One or more query tags specifying the items in the bag

cluster String <optional>
"medium"

"low", "medium" or "high". Alters the amount of stockpiling from a little to a lot.

minValue Number <optional>
maxValue Number <optional>
minEnc Number <optional>
maxEnc Number <optional>
totalValue Number <optional>
20

The total value of the stockpile. In practice, the stockpile will be worth less than this. Must be at least 20.

Returns:

a bag representing a stockpile

Type
Bag

getContainerTypes() → {Array}

Description:
  • Get container types. One of these values is a valid type to pass to the createContainer(type) method.

Source:
Returns:

an array of container types

Type
Array

getProfessions()

Description:
  • Post collapse professions only.

Source:
Returns:

a list of profession names

newCreateBag(paramsopt)

Description:
  • A simplified bag creation algorithm, currently being tried out with locations at the kibble layer.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
value Number | String <optional>

the total value of the bag. The method will get as close to this value as possible, but it’s not guaranteed. If the value is a string, it is treated as a dice notation.

count Number <optional>

the maximum number of items of the same type that are normally found in this type of bag (defaut: 1). Rarely, the number will be higher than this (Gaussian distribution). Rarity still applies to the items selected.

enc Number <optional>

the total encumbrance of the bag. The method will get as close to this value as possible, but it’s not guaranteed. By default there is no limit to the encumbrance.

tags String <optional>

tags to search for items to put in the bag (default “*“).

Returns:

a bag that meets the above criteria.

parser(line) → {array}

Description:
  • Register one or more items (via a short, string-based item specification format) with this database.

    Specification

    name1; name2!value!tags

    The first tag must always be 'common', 'uncommon' or 'rare'. If a 'br' tag is included, this indicates that the item can be found broken, and it will be added to the database twice (once intact, and once broken).

Source:
Parameters:
Name Type Description
line *
Returns:

results

Type
array

timeSeries(paramsopt) → {Array}

Description:
  • Create a date series for periodicals, in the past.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

params

Properties
Name Type Attributes Default Description
period String <optional>
'weekly'

one of 'weekly', 'monthly', 'biweekly' or 'bimonthly'

dayOfWeek String <optional>

one of 'Saturday' to 'Sunday', if you want the dates to be adjusted to the next day of the week (for example if a periodical is always published on Mondays).

startDate String | Date <optional>
'1956-01-01'

a string (in format 'YYYY-MM-DD') or a date object that is the date on which the sequence will start.

endDate String | Date <optional>
'1958-07-14'

a string (in format 'YYYY-MM-DD') or a date object that is the date before which the sequence will end.

Returns:

an array of string dates in the format 'Monday 2 Jan 1956'.

Type
Array

trait(traitName) → {Number}

Description:
  • Does this character have a trait?

Source:
Parameters:
Name Type Description
traitName String

The name of the trait

Returns:

the value of the trait, or 0 if the character does not have the trait

Type
Number