Purchasable
Movable entitiessource
Derived types: Arrow, Boomerang, Bow, DummyPurchasableEntity, Gun, Mattock, Pot, Present, RollingItem, Shield, Teleporter
Methods
set_post_equip
function Purchasable:set_post_equip(fun: fun(self: Entity?, who: Entity?)): integerReturns integer
Is called after purchase, changes the DummyPurchasableEntity into the real entity plus tries to equip it, or pick it up (for stuff like weapons), or give the powerup. Nothing else happens, by itself it does not remove item from shop etc.
sourceset_post_virtual
function Purchasable:set_post_virtual(index: integer, fun: function): integer?index:integerfun:function- Callback signature not known from the code.
Returns integer? (may be nil)
set_pre_equip
function Purchasable:set_pre_equip(fun: fun(self: Entity?, who: Entity?): boolean): integerfun:fun(self: Entity?, who: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
Is called after purchase, changes the DummyPurchasableEntity into the real entity plus tries to equip it, or pick it up (for stuff like weapons), or give the powerup. Nothing else happens, by itself it does not remove item from shop etc.
sourceset_pre_virtual
function Purchasable:set_pre_virtual(index: integer, fun: function): integer?index:integerfun:function- Callback signature not known from the code.
Returns integer? (may be nil)