Buffs

The game's status effects, your own buffs, and which kinds of effect the server decides. To give and remove buffs on a player, use Player.addBuff and removeBuff. Events are playerBuffAdded, playerBuffRemoved, and playerBuffBlocked, when a player's game tried to apply an effect of a claimed kind.

buffs.classes

classes

The buff classes the server can decide with Buffs.claim, such as injury, heal, poison, alcohol and potion.

buffs.tags

tags

The game's buff tags, one of which Player.clearBuffs takes.

buffs.modifiers

modifiers

Names a custom buff's modifiers can use: health, stamina, exhaust, hunger; the per-second rates healthRegeneration, hungerDrain and energyDrain; and the game's maxStamina, carryCapacity, staminaRegeneration, runSpeed, charisma, strength, agility, vitality, speech and the progression tracks. A new array each time.

buffs.find()

Buffs.find(query)

A game or custom buff by name or GUID, or null: { name, class, aiTag, duration, custom, displayName, description }. A game buff has custom false and null texts.

buffs.register()

Buffs.register(idOrDefinition, definition = undefined)

Defines your own buff. Buffs.register(id, definition) returns its GUID, the same at each start. Registering the same definition again returns it, and a different definition under that id throws. Instances hold their stat modifiers while they last, take them back at the end, and fire playerCustomBuffApply, playerCustomBuffTick and playerCustomBuffRemove. The simpler Buffs.register(definition) returns an object instead. Either goes to Player.addBuff, removeBuff and hasBuff, and the status list shows it with a game buff's icon.

buffs.claim()

Buffs.claim(classNames)

Makes the server decide kinds of effect. Players' games stop applying buffs of these classes by themselves, each attempt firing playerBuffBlocked, and only Player.addBuff gives them. You can claim injury, heal, poison, perception, overeat, alcohol, potion, foodPoison, unconsciousness, hangover, satisfaction, perfume, punishment, forcedDrunkenness and plague. Pass [] to release all claims. Returns the claimed classes.