Difference between revisions of "Modding:ItemSet"

From DoomRL Wiki

Jump to: navigation, search
(wow that was fast)

Revision as of 20:29, 27 January 2012

Along with items are the possibility to form sets with certain items. These are formed with the ItemSet object and can be created to produce unique possibilities with gear.

Prototype

The ItemSet prototype is fairly small, because almost all of the importance of an item set lies in its engine hooks. The prototype keys are merely there to make sure that such hooks are trigger at the appropriate time.

ItemSet Prototype
string name This is the item's name. Currently it has no use.
string id This is the item's sid. It must be distinct from other string ids.
integer trigger This value determines how many items must be equipped before the set bonus can be added.

Engine Hooks

ItemSet hooks are not always triggered: instead, they rely on the number of set items currently equipped.

ItemSet Hooks
void OnEquip(Item self, Being equipper)
void OnRemove(Item self, Being wearer)

OnEquip(Item self, Being equipper)
This hook is called when the item is equipped in any equipment slot. It is only added to items of the item set if trigger-1 items have already been equipped (that is, all set items but one).

OnRemove(Item self, Being wearer)
This hook is called when a being unequips the item, or when the item is otherwise removed from the being's equipment. This includes armor being destroyed by damage. It is only added to items of the item set if trigger items have been equipped (that is, the entire set).
Personal tools