Class

RezEffect

RezEffect()

Constructor

# new RezEffect()

Represents an effect in the Rez game engine. Effects are typically applied to or removed from objects when items are equipped, consumed, or used. They can modify object attributes, add temporary abilities, or trigger events.

View Source rez_effect.js, line 5

Extends

Methods

# static apply(ownerId, itemId, locationopt) → {*}

Applies this effect to the specified object by running the on_apply event handler with {owner_id, item_id, inventory_id, slot_id, position}

Parameters:
Name Type Attributes Description
ownerId string

ID of the object this effect is being applied to

itemId string

ID of the item that has this effect

location object <optional>

where the item is, when the effect comes from an item in an inventory: {inventory_id, slot_id, position}

View Source rez_effect.js, line 25

result of the apply event handler

*

# static constructor(id, attributes)

Creates a new effect instance

Parameters:
Name Type Description
id string

unique identifier for this effect

attributes object

effect attributes from Rez compilation

View Source rez_effect.js, line 14

# static remove(ownerId, itemId, locationopt) → {*}

Removes this effect from the specified object by running the on_remove event handler with {owner_id, item_id, inventory_id, slot_id, position}

Parameters:
Name Type Attributes Description
ownerId string

ID of the object this effect is being removed from

itemId string

ID of the item that has this effect

location object <optional>

where the item was, when the effect came from an item in an inventory: {inventory_id, slot_id, position}

View Source rez_effect.js, line 40

result of the remove event handler

*