Buffs
constBuffs:object
Defined in: server/api.d.ts:7283
The game’s status-effect table, and which of it this server decides.
Type Declaration
Section titled “Type Declaration”classes
Section titled “classes”
readonlyclasses:string[]
The kinds of effect a server can take over, which is what claim accepts: the ones carrying state nobody can work out for themselves – potions, poison, injury, drunkenness, illness, unconsciousness. The game has other kinds, and they read back in BuffInfo.class, but they either shadow something that already replicates or are the game’s own plumbing, so there is no decision in them to take.
readonlytags:string[]
The families the game groups effects into, which is what player.clearBuffs takes: poison, bleed, alcohol_drunk, unconscious and nineteen more. These are the game’s own words, and its own AI reasons in them.
claim()
Section titled “claim()”claim(
classNames):string[]
Takes over whole kinds of effect. Every client then turns down an effect of that kind the game tried to give its own player, and raises playerBuffBlocked instead – which is where the resource decides what really happens, usually player.addBuff with its own rule applied. A claim nothing listens to does not move the gameplay here, it removes it.
Two things to plan around. The refusal covers the game’s follow-on effects too: claim alcohol and the six alcoholism_level* steps stop arriving along with the drink, so the resource owns the whole progression. And an effect has no strength – the handler can block it, swap it for another, or let it through, but it cannot make the drink half as strong.
Replaces the previous claim rather than adding to it, and reaches every connected client at once.
Parameters
Section titled “Parameters”classNames
Section titled “classNames”string[]
The kinds of effect to decide, from Buffs.classes. [] hands them all back. Throws for anything else.
Returns
Section titled “Returns”string[]
The kinds now claimed.
find()
Section titled “find()”find(
query):BuffInfo|null
Looks a status effect up, so a resource can check a name is real before handing it to a player and can see what the effect is before applying it.
Parameters
Section titled “Parameters”string
An effect’s name, as the game’s buff tables spell it, or its GUID.
Returns
Section titled “Returns”BuffInfo | null
What the tables say about it, or null for a name they do not carry.