diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 5ff02e218..88448fb09 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -2433,11 +2433,11 @@ function Entity:overlaps_with(other) end ---@field freeze fun(self, framecount: integer): nil ---@field light_on_fire fun(self, time: integer): nil @Does not damage entity ---@field set_cursed fun(self, b: boolean): nil - ---@field drop fun(self, entity_to_drop: Entity): nil + ---@field drop fun(self, entity_to_drop: Entity): nil @Called when dropping or throwing ---@field pick_up fun(self, entity_to_pick_up: Entity): nil - ---@field can_jump fun(self): boolean + ---@field can_jump fun(self): boolean @Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. ---@field standing_on fun(self): Entity - ---@field add_money fun(self, money: integer): nil @Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. + ---@field collect_treasure fun(self, value: integer, treasure: ENT_TYPE): nil @Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. ---@field is_on_fire fun(self): boolean ---@field damage fun(self, damage_dealer_uid: integer, damage_amount: integer, stun_time: integer, velocity_x: number, velocity_y: number, iframes: integer): boolean @Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? ---@field get_all_behaviors fun(self): integer[] @Get all avaible behavior ids @@ -2453,14 +2453,56 @@ function Entity:overlaps_with(other) end ---@field set_pre_virtual fun(self, entry: ENTITY_OVERRIDE, fun: function): CallbackId @Hooks before the virtual function at index `entry`. ---@field set_post_virtual fun(self, entry: ENTITY_OVERRIDE, fun: function): CallbackId @Hooks after the virtual function at index `entry`. ---@field clear_virtual fun(self, callback_id: CallbackId): nil @Clears the hook given by `callback_id`, alternatively use `clear_callback()` inside the hook. + ---@field set_pre_can_jump fun(self, fun: fun(self: Movable): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional can_jump(Movable self)`
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. + ---@field set_post_can_jump fun(self, fun: fun(self: Movable): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil can_jump(Movable self)`
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. + ---@field set_pre_stomp_damage fun(self, fun: fun(self: Movable): integer?): CallbackId @Hooks before the virtual function.
The callback signature is `optional stomp_damage(Movable self)` + ---@field set_post_stomp_damage fun(self, fun: fun(self: Movable): integer?): CallbackId @Hooks after the virtual function.
The callback signature is `nil stomp_damage(Movable self)` + ---@field set_pre_is_on_fire fun(self, fun: fun(self: Movable): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional is_on_fire(Movable self)` + ---@field set_post_is_on_fire fun(self, fun: fun(self: Movable): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil is_on_fire(Movable self)` ---@field set_pre_damage fun(self, fun: fun(self: Movable, damage_dealer_uid: integer, damage_amount: integer, stun_time: integer, velocity_x: number, velocity_y: number, iframes: integer): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional damage(Movable self, integer damage_dealer_uid, integer damage_amount, integer stun_time, number velocity_x, number velocity_y, integer iframes)`
Virtual function docs:
Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? ---@field set_post_damage fun(self, fun: fun(self: Movable, damage_dealer_uid: integer, damage_amount: integer, stun_time: integer, velocity_x: number, velocity_y: number, iframes: integer): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil damage(Movable self, integer damage_dealer_uid, integer damage_amount, integer stun_time, number velocity_x, number velocity_y, integer iframes)`
Virtual function docs:
Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? - ---@field set_pre_apply_movement fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool apply_movement(Movable self)` - ---@field set_post_apply_movement fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil apply_movement(Movable self)` - ---@field set_pre_check_is_falling fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool check_is_falling(Movable self)` - ---@field set_post_check_is_falling fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil check_is_falling(Movable self)` + ---@field set_pre_on_hit fun(self, fun: fun(self: Movable, damage_dealer: Entity): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool on_hit(Movable self, Entity damage_dealer)`
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. + ---@field set_post_on_hit fun(self, fun: fun(self: Movable, damage_dealer: Entity): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil on_hit(Movable self, Entity damage_dealer)`
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. + ---@field set_pre_stun fun(self, fun: fun(self: Movable, framecount: integer): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool stun(Movable self, integer framecount)` + ---@field set_post_stun fun(self, fun: fun(self: Movable, framecount: integer): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil stun(Movable self, integer framecount)` + ---@field set_pre_freeze fun(self, fun: fun(self: Movable, framecount: integer): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool freeze(Movable self, integer framecount)` + ---@field set_post_freeze fun(self, fun: fun(self: Movable, framecount: integer): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil freeze(Movable self, integer framecount)` + ---@field set_pre_light_on_fire fun(self, fun: fun(self: Movable, time: integer): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool light_on_fire(Movable self, integer time)`
Virtual function docs:
Does not damage entity + ---@field set_post_light_on_fire fun(self, fun: fun(self: Movable, time: integer): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil light_on_fire(Movable self, integer time)`
Virtual function docs:
Does not damage entity + ---@field set_pre_set_cursed fun(self, fun: fun(self: Movable, b: boolean): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool set_cursed(Movable self, boolean b)` + ---@field set_post_set_cursed fun(self, fun: fun(self: Movable, b: boolean): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil set_cursed(Movable self, boolean b)` + ---@field set_pre_web_collision fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool web_collision(Movable self)` + ---@field set_post_web_collision fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil web_collision(Movable self)` + ---@field set_pre_check_out_of_bounds fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool check_out_of_bounds(Movable self)` + ---@field set_post_check_out_of_bounds fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil check_out_of_bounds(Movable self)` + ---@field set_pre_standing_on fun(self, fun: fun(self: Movable): Entity?): CallbackId @Hooks before the virtual function.
The callback signature is `optional standing_on(Movable self)` + ---@field set_post_standing_on fun(self, fun: fun(self: Movable): Entity?): CallbackId @Hooks after the virtual function.
The callback signature is `nil standing_on(Movable self)` + ---@field set_pre_stomped_by fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool stomped_by(Movable self, Entity*)` + ---@field set_post_stomped_by fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil stomped_by(Movable self, Entity*)` + ---@field set_pre_thrown_by fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool thrown_by(Movable self, Entity*)` + ---@field set_post_thrown_by fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil thrown_by(Movable self, Entity*)` + ---@field set_pre_cloned_to fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool cloned_to(Movable self, Entity*)` + ---@field set_post_cloned_to fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil cloned_to(Movable self, Entity*)` + ---@field set_pre_pick_up fun(self, fun: fun(self: Movable, entity_to_pick_up: Entity): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool pick_up(Movable self, Entity entity_to_pick_up)` + ---@field set_post_pick_up fun(self, fun: fun(self: Movable, entity_to_pick_up: Entity): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil pick_up(Movable self, Entity entity_to_pick_up)` + ---@field set_pre_picked_up_by fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool picked_up_by(Movable self, Entity*)` + ---@field set_post_picked_up_by fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil picked_up_by(Movable self, Entity*)` + ---@field set_pre_drop fun(self, fun: fun(self: Movable, entity_to_drop: Entity): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool drop(Movable self, Entity entity_to_drop)`
Virtual function docs:
Called when dropping or throwing + ---@field set_post_drop fun(self, fun: fun(self: Movable, entity_to_drop: Entity): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil drop(Movable self, Entity entity_to_drop)`
Virtual function docs:
Called when dropping or throwing + ---@field set_pre_collect_treasure fun(self, fun: fun(self: Movable, value: integer, treasure: ENT_TYPE): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool collect_treasure(Movable self, integer value, ENT_TYPE treasure)`
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. + ---@field set_post_collect_treasure fun(self, fun: fun(self: Movable, value: integer, treasure: ENT_TYPE): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil collect_treasure(Movable self, integer value, ENT_TYPE treasure)`
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. + ---@field set_pre_initialize fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool initialize(Movable self)` + ---@field set_post_initialize fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil initialize(Movable self)` ---@field set_pre_process_input fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool process_input(Movable self)` ---@field set_post_process_input fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil process_input(Movable self)` + ---@field set_pre_picked_up fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool picked_up(Movable self)` + ---@field set_post_picked_up fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil picked_up(Movable self)` + ---@field set_pre_fall fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool fall(Movable self)` + ---@field set_post_fall fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil fall(Movable self)` + ---@field set_pre_apply_friction fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool apply_friction(Movable self)` + ---@field set_post_apply_friction fun(self, fun: fun(self: Movable): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil apply_friction(Movable self)` + ---@field set_pre_crush fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool crush(Movable self, Entity*)` + ---@field set_post_crush fun(self, fun: fun(self: Movable, Entity*: ): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil crush(Movable self, Entity*)` local Movable = nil ---Move a movable according to its velocity, update physics, gravity, etc. ---Will also update `movable.animation_frame` and various timers and counters @@ -2573,9 +2615,26 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@class Door : Floor ---@field counter integer ---@field fx_button Entity - ---@field enter fun(self, who: Entity): integer - ---@field is_unlocked fun(self): boolean @Will alwyas return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function + ---@field enter fun(self, who: Entity): integer @Returns the entity state / behavior id to set the entity to after the entering animation. + ---@field light_level fun(self): number @Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + ---@field is_unlocked fun(self): boolean @Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function + ---@field can_enter fun(self, player: Entity): boolean @Can the door actually be entered by player. Overrides the button prompt too if false. ---@field unlock fun(self, unlock: boolean): nil @Lock/Unlock doors + ---@field set_pre_virtual fun(self, entry: ENTITY_OVERRIDE, fun: function): CallbackId @Hooks before the virtual function at index `entry`. + ---@field set_post_virtual fun(self, entry: ENTITY_OVERRIDE, fun: function): CallbackId @Hooks after the virtual function at index `entry`. + ---@field clear_virtual fun(self, callback_id: CallbackId): nil @Clears the hook given by `callback_id`, alternatively use `clear_callback()` inside the hook. + ---@field set_pre_enter_attempt fun(self, fun: fun(self: Door, Entity*: ): number?): CallbackId @Hooks before the virtual function.
The callback signature is `optional enter_attempt(Door self, Entity*)` + ---@field set_post_enter_attempt fun(self, fun: fun(self: Door, Entity*: ): number?): CallbackId @Hooks after the virtual function.
The callback signature is `nil enter_attempt(Door self, Entity*)` + ---@field set_pre_hide_hud fun(self, fun: fun(self: Door, Entity*: ): number?): CallbackId @Hooks before the virtual function.
The callback signature is `optional hide_hud(Door self, Entity*)` + ---@field set_post_hide_hud fun(self, fun: fun(self: Door, Entity*: ): number?): CallbackId @Hooks after the virtual function.
The callback signature is `nil hide_hud(Door self, Entity*)` + ---@field set_pre_enter fun(self, fun: fun(self: Door, who: Entity): integer?): CallbackId @Hooks before the virtual function.
The callback signature is `optional enter(Door self, Entity who)`
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. + ---@field set_post_enter fun(self, fun: fun(self: Door, who: Entity): integer?): CallbackId @Hooks after the virtual function.
The callback signature is `nil enter(Door self, Entity who)`
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. + ---@field set_pre_light_level fun(self, fun: fun(self: Door): number?): CallbackId @Hooks before the virtual function.
The callback signature is `optional light_level(Door self)`
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + ---@field set_post_light_level fun(self, fun: fun(self: Door): number?): CallbackId @Hooks after the virtual function.
The callback signature is `nil light_level(Door self)`
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + ---@field set_pre_is_unlocked fun(self, fun: fun(self: Door): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional is_unlocked(Door self)`
Virtual function docs:
Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function + ---@field set_post_is_unlocked fun(self, fun: fun(self: Door): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil is_unlocked(Door self)`
Virtual function docs:
Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function + ---@field set_pre_can_enter fun(self, fun: fun(self: Door, player: Entity): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional can_enter(Door self, Entity player)`
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. + ---@field set_post_can_enter fun(self, fun: fun(self: Door, player: Entity): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil can_enter(Door self, Entity player)`
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. ---@class ExitDoor : Door ---@field entered boolean @if true entering it does not load the transition diff --git a/docs/index.html b/docs/index.html index 292aa8fd7..1c04b0631 100644 --- a/docs/index.html +++ b/docs/index.html @@ -17754,18 +17754,103 @@

Door

int enter(Entity who) - +Returns the entity state / behavior id to set the entity to after the entering animation. + + +float +light_level() +Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change bool is_unlocked() -Will alwyas return true for exits, layers and others that the game never locks, even if you lock it with unlock function +Should we display the button prompt when collided by player. Will always return true for exits, layers and others that the game never locks, even if you lock it with unlock function + + +bool +can_enter(Entity player) +Can the door actually be entered by player. Overrides the button prompt too if false. nil unlock(bool unlock) Lock/Unlock doors + +CallbackId +set_pre_virtual(ENTITY_OVERRIDE entry, function fun) +Hooks before the virtual function at index entry. + + +CallbackId +set_post_virtual(ENTITY_OVERRIDE entry, function fun) +Hooks after the virtual function at index entry. + + +nil +clear_virtual(CallbackId callback_id) +Clears the hook given by callback_id, alternatively use clear_callback() inside the hook. + + +CallbackId +set_pre_enter_attempt(function fun) +Hooks before the virtual function.
The callback signature is optional<float> enter_attempt(Door self, Entity*) + + +CallbackId +set_post_enter_attempt(function fun) +Hooks after the virtual function.
The callback signature is nil enter_attempt(Door self, Entity*) + + +CallbackId +set_pre_hide_hud(function fun) +Hooks before the virtual function.
The callback signature is optional<float> hide_hud(Door self, Entity*) + + +CallbackId +set_post_hide_hud(function fun) +Hooks after the virtual function.
The callback signature is nil hide_hud(Door self, Entity*) + + +CallbackId +set_pre_enter(function fun) +Hooks before the virtual function.
The callback signature is optional<int> enter(Door self, Entity who)
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. + + +CallbackId +set_post_enter(function fun) +Hooks after the virtual function.
The callback signature is nil enter(Door self, Entity who)
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. + + +CallbackId +set_pre_light_level(function fun) +Hooks before the virtual function.
The callback signature is optional<float> light_level(Door self)
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + + +CallbackId +set_post_light_level(function fun) +Hooks after the virtual function.
The callback signature is nil light_level(Door self)
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + + +CallbackId +set_pre_is_unlocked(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> is_unlocked(Door self)
Virtual function docs:
Should we display the button prompt when collided by player. Will always return true for exits, layers and others that the game never locks, even if you lock it with unlock function + + +CallbackId +set_post_is_unlocked(function fun) +Hooks after the virtual function.
The callback signature is nil is_unlocked(Door self)
Virtual function docs:
Should we display the button prompt when collided by player. Will always return true for exits, layers and others that the game never locks, even if you lock it with unlock function + + +CallbackId +set_pre_can_enter(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> can_enter(Door self, Entity player)
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. + + +CallbackId +set_post_can_enter(function fun) +Hooks after the virtual function.
The callback signature is nil can_enter(Door self, Entity player)
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. +

EggShipDoor

Derived from Entity Floor Door

@@ -25428,7 +25513,7 @@

Movable

nil drop(Entity entity_to_drop) - +Called when dropping or throwing nil @@ -25438,7 +25523,7 @@

Movable

bool can_jump() - +Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. Entity @@ -25447,8 +25532,8 @@

Movable

nil -add_money(int money) -Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. +collect_treasure(int value, ENT_TYPE treasure) +Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. bool @@ -25542,6 +25627,36 @@

Movable

CallbackId +set_pre_can_jump(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> can_jump(Movable self)
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. + + +CallbackId +set_post_can_jump(function fun) +Hooks after the virtual function.
The callback signature is nil can_jump(Movable self)
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. + + +CallbackId +set_pre_stomp_damage(function fun) +Hooks before the virtual function.
The callback signature is optional<int> stomp_damage(Movable self) + + +CallbackId +set_post_stomp_damage(function fun) +Hooks after the virtual function.
The callback signature is nil stomp_damage(Movable self) + + +CallbackId +set_pre_is_on_fire(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> is_on_fire(Movable self) + + +CallbackId +set_post_is_on_fire(function fun) +Hooks after the virtual function.
The callback signature is nil is_on_fire(Movable self) + + +CallbackId set_pre_damage(function fun) Hooks before the virtual function.
The callback signature is optional<bool> damage(Movable self, int damage_dealer_uid, int damage_amount, int stun_time, float velocity_x, float velocity_y, int iframes)
Virtual function docs:
Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? @@ -25552,23 +25667,163 @@

Movable

CallbackId -set_pre_apply_movement(function fun) -Hooks before the virtual function.
The callback signature is bool apply_movement(Movable self) +set_pre_on_hit(function fun) +Hooks before the virtual function.
The callback signature is bool on_hit(Movable self, Entity damage_dealer)
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. + + +CallbackId +set_post_on_hit(function fun) +Hooks after the virtual function.
The callback signature is nil on_hit(Movable self, Entity damage_dealer)
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. + + +CallbackId +set_pre_stun(function fun) +Hooks before the virtual function.
The callback signature is bool stun(Movable self, int framecount) + + +CallbackId +set_post_stun(function fun) +Hooks after the virtual function.
The callback signature is nil stun(Movable self, int framecount) + + +CallbackId +set_pre_freeze(function fun) +Hooks before the virtual function.
The callback signature is bool freeze(Movable self, int framecount) + + +CallbackId +set_post_freeze(function fun) +Hooks after the virtual function.
The callback signature is nil freeze(Movable self, int framecount) + + +CallbackId +set_pre_light_on_fire(function fun) +Hooks before the virtual function.
The callback signature is bool light_on_fire(Movable self, int time)
Virtual function docs:
Does not damage entity + + +CallbackId +set_post_light_on_fire(function fun) +Hooks after the virtual function.
The callback signature is nil light_on_fire(Movable self, int time)
Virtual function docs:
Does not damage entity + + +CallbackId +set_pre_set_cursed(function fun) +Hooks before the virtual function.
The callback signature is bool set_cursed(Movable self, bool b) + + +CallbackId +set_post_set_cursed(function fun) +Hooks after the virtual function.
The callback signature is nil set_cursed(Movable self, bool b) + + +CallbackId +set_pre_web_collision(function fun) +Hooks before the virtual function.
The callback signature is bool web_collision(Movable self) + + +CallbackId +set_post_web_collision(function fun) +Hooks after the virtual function.
The callback signature is nil web_collision(Movable self) + + +CallbackId +set_pre_check_out_of_bounds(function fun) +Hooks before the virtual function.
The callback signature is bool check_out_of_bounds(Movable self) + + +CallbackId +set_post_check_out_of_bounds(function fun) +Hooks after the virtual function.
The callback signature is nil check_out_of_bounds(Movable self) + + +CallbackId +set_pre_standing_on(function fun) +Hooks before the virtual function.
The callback signature is optional<Entity> standing_on(Movable self) + + +CallbackId +set_post_standing_on(function fun) +Hooks after the virtual function.
The callback signature is nil standing_on(Movable self) + + +CallbackId +set_pre_stomped_by(function fun) +Hooks before the virtual function.
The callback signature is bool stomped_by(Movable self, Entity*) + + +CallbackId +set_post_stomped_by(function fun) +Hooks after the virtual function.
The callback signature is nil stomped_by(Movable self, Entity*) + + +CallbackId +set_pre_thrown_by(function fun) +Hooks before the virtual function.
The callback signature is bool thrown_by(Movable self, Entity*) + + +CallbackId +set_post_thrown_by(function fun) +Hooks after the virtual function.
The callback signature is nil thrown_by(Movable self, Entity*) + + +CallbackId +set_pre_cloned_to(function fun) +Hooks before the virtual function.
The callback signature is bool cloned_to(Movable self, Entity*) + + +CallbackId +set_post_cloned_to(function fun) +Hooks after the virtual function.
The callback signature is nil cloned_to(Movable self, Entity*) + + +CallbackId +set_pre_pick_up(function fun) +Hooks before the virtual function.
The callback signature is bool pick_up(Movable self, Entity entity_to_pick_up) + + +CallbackId +set_post_pick_up(function fun) +Hooks after the virtual function.
The callback signature is nil pick_up(Movable self, Entity entity_to_pick_up) + + +CallbackId +set_pre_picked_up_by(function fun) +Hooks before the virtual function.
The callback signature is bool picked_up_by(Movable self, Entity*) CallbackId -set_post_apply_movement(function fun) -Hooks after the virtual function.
The callback signature is nil apply_movement(Movable self) +set_post_picked_up_by(function fun) +Hooks after the virtual function.
The callback signature is nil picked_up_by(Movable self, Entity*) CallbackId -set_pre_check_is_falling(function fun) -Hooks before the virtual function.
The callback signature is bool check_is_falling(Movable self) +set_pre_drop(function fun) +Hooks before the virtual function.
The callback signature is bool drop(Movable self, Entity entity_to_drop)
Virtual function docs:
Called when dropping or throwing CallbackId -set_post_check_is_falling(function fun) -Hooks after the virtual function.
The callback signature is nil check_is_falling(Movable self) +set_post_drop(function fun) +Hooks after the virtual function.
The callback signature is nil drop(Movable self, Entity entity_to_drop)
Virtual function docs:
Called when dropping or throwing + + +CallbackId +set_pre_collect_treasure(function fun) +Hooks before the virtual function.
The callback signature is bool collect_treasure(Movable self, int value, ENT_TYPE treasure)
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. + + +CallbackId +set_post_collect_treasure(function fun) +Hooks after the virtual function.
The callback signature is nil collect_treasure(Movable self, int value, ENT_TYPE treasure)
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. + + +CallbackId +set_pre_initialize(function fun) +Hooks before the virtual function.
The callback signature is bool initialize(Movable self) + + +CallbackId +set_post_initialize(function fun) +Hooks after the virtual function.
The callback signature is nil initialize(Movable self) CallbackId @@ -25580,6 +25835,46 @@

Movable

set_post_process_input(function fun) Hooks after the virtual function.
The callback signature is nil process_input(Movable self) + +CallbackId +set_pre_picked_up(function fun) +Hooks before the virtual function.
The callback signature is bool picked_up(Movable self) + + +CallbackId +set_post_picked_up(function fun) +Hooks after the virtual function.
The callback signature is nil picked_up(Movable self) + + +CallbackId +set_pre_fall(function fun) +Hooks before the virtual function.
The callback signature is bool fall(Movable self) + + +CallbackId +set_post_fall(function fun) +Hooks after the virtual function.
The callback signature is nil fall(Movable self) + + +CallbackId +set_pre_apply_friction(function fun) +Hooks before the virtual function.
The callback signature is bool apply_friction(Movable self) + + +CallbackId +set_post_apply_friction(function fun) +Hooks after the virtual function.
The callback signature is nil apply_friction(Movable self) + + +CallbackId +set_pre_crush(function fun) +Hooks before the virtual function.
The callback signature is bool crush(Movable self, Entity*) + + +CallbackId +set_post_crush(function fun) +Hooks after the virtual function.
The callback signature is nil crush(Movable self, Entity*) +

MovingIcon

Derived from Entity Movable

@@ -28008,23 +28303,128 @@

ENTITY_OVERRIDE

+CAN_JUMP +37 + + + +STOMP_DAMAGE +43 + + + +IS_ON_FIRE +45 + + + DAMAGE 48 -APPLY_MOVEMENT -71 +ON_HIT +49 + + + +STUN +51 + + + +FREEZE +52 + + + +LIGHT_ON_FIRE +53 + + + +SET_CURSED +54 + + + +WEB_COLLISION +55 + + + +CHECK_OUT_OF_BOUNDS +58 -CHECK_IS_FALLING +STANDING_ON +60 + + + +STOMPED_BY +61 + + + +THROWN_BY +62 + + + +CLONED_TO +63 + + + +PICK_UP +67 + + + +PICKED_UP_BY +68 + + + +DROP +69 + + + +COLLECT_TREASURE +70 + + + +INITIALIZE 75 PROCESS_INPUT -77 +78 + + + +PICKED_UP +80 + + + +FALL +83 + + + +APPLY_FRICTION +84 + + + +CRUSH +90 @@ -28032,6 +28432,36 @@

ENTITY_OVERRIDE

38 + +ENTER_ATTEMPT +40 + + + +HIDE_HUD +41 + + + +ENTER +42 + + + +LIGHT_LEVEL +44 + + + +IS_UNLOCKED +45 + + + +CAN_ENTER +46 + +

ENT_FLAG

diff --git a/docs/light.html b/docs/light.html index 6d4989f1b..31cccca70 100644 --- a/docs/light.html +++ b/docs/light.html @@ -17754,18 +17754,103 @@

Door

int enter(Entity who) - +Returns the entity state / behavior id to set the entity to after the entering animation. + + +float +light_level() +Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change bool is_unlocked() -Will alwyas return true for exits, layers and others that the game never locks, even if you lock it with unlock function +Should we display the button prompt when collided by player. Will always return true for exits, layers and others that the game never locks, even if you lock it with unlock function + + +bool +can_enter(Entity player) +Can the door actually be entered by player. Overrides the button prompt too if false. nil unlock(bool unlock) Lock/Unlock doors + +CallbackId +set_pre_virtual(ENTITY_OVERRIDE entry, function fun) +Hooks before the virtual function at index entry. + + +CallbackId +set_post_virtual(ENTITY_OVERRIDE entry, function fun) +Hooks after the virtual function at index entry. + + +nil +clear_virtual(CallbackId callback_id) +Clears the hook given by callback_id, alternatively use clear_callback() inside the hook. + + +CallbackId +set_pre_enter_attempt(function fun) +Hooks before the virtual function.
The callback signature is optional<float> enter_attempt(Door self, Entity*) + + +CallbackId +set_post_enter_attempt(function fun) +Hooks after the virtual function.
The callback signature is nil enter_attempt(Door self, Entity*) + + +CallbackId +set_pre_hide_hud(function fun) +Hooks before the virtual function.
The callback signature is optional<float> hide_hud(Door self, Entity*) + + +CallbackId +set_post_hide_hud(function fun) +Hooks after the virtual function.
The callback signature is nil hide_hud(Door self, Entity*) + + +CallbackId +set_pre_enter(function fun) +Hooks before the virtual function.
The callback signature is optional<int> enter(Door self, Entity who)
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. + + +CallbackId +set_post_enter(function fun) +Hooks after the virtual function.
The callback signature is nil enter(Door self, Entity who)
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. + + +CallbackId +set_pre_light_level(function fun) +Hooks before the virtual function.
The callback signature is optional<float> light_level(Door self)
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + + +CallbackId +set_post_light_level(function fun) +Hooks after the virtual function.
The callback signature is nil light_level(Door self)
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change + + +CallbackId +set_pre_is_unlocked(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> is_unlocked(Door self)
Virtual function docs:
Should we display the button prompt when collided by player. Will always return true for exits, layers and others that the game never locks, even if you lock it with unlock function + + +CallbackId +set_post_is_unlocked(function fun) +Hooks after the virtual function.
The callback signature is nil is_unlocked(Door self)
Virtual function docs:
Should we display the button prompt when collided by player. Will always return true for exits, layers and others that the game never locks, even if you lock it with unlock function + + +CallbackId +set_pre_can_enter(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> can_enter(Door self, Entity player)
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. + + +CallbackId +set_post_can_enter(function fun) +Hooks after the virtual function.
The callback signature is nil can_enter(Door self, Entity player)
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. +

EggShipDoor

Derived from Entity Floor Door

@@ -25428,7 +25513,7 @@

Movable

nil drop(Entity entity_to_drop) - +Called when dropping or throwing nil @@ -25438,7 +25523,7 @@

Movable

bool can_jump() - +Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. Entity @@ -25447,8 +25532,8 @@

Movable

nil -add_money(int money) -Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. +collect_treasure(int value, ENT_TYPE treasure) +Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. bool @@ -25542,6 +25627,36 @@

Movable

CallbackId +set_pre_can_jump(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> can_jump(Movable self)
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. + + +CallbackId +set_post_can_jump(function fun) +Hooks after the virtual function.
The callback signature is nil can_jump(Movable self)
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. + + +CallbackId +set_pre_stomp_damage(function fun) +Hooks before the virtual function.
The callback signature is optional<int> stomp_damage(Movable self) + + +CallbackId +set_post_stomp_damage(function fun) +Hooks after the virtual function.
The callback signature is nil stomp_damage(Movable self) + + +CallbackId +set_pre_is_on_fire(function fun) +Hooks before the virtual function.
The callback signature is optional<bool> is_on_fire(Movable self) + + +CallbackId +set_post_is_on_fire(function fun) +Hooks after the virtual function.
The callback signature is nil is_on_fire(Movable self) + + +CallbackId set_pre_damage(function fun) Hooks before the virtual function.
The callback signature is optional<bool> damage(Movable self, int damage_dealer_uid, int damage_amount, int stun_time, float velocity_x, float velocity_y, int iframes)
Virtual function docs:
Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? @@ -25552,23 +25667,163 @@

Movable

CallbackId -set_pre_apply_movement(function fun) -Hooks before the virtual function.
The callback signature is bool apply_movement(Movable self) +set_pre_on_hit(function fun) +Hooks before the virtual function.
The callback signature is bool on_hit(Movable self, Entity damage_dealer)
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. + + +CallbackId +set_post_on_hit(function fun) +Hooks after the virtual function.
The callback signature is nil on_hit(Movable self, Entity damage_dealer)
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. + + +CallbackId +set_pre_stun(function fun) +Hooks before the virtual function.
The callback signature is bool stun(Movable self, int framecount) + + +CallbackId +set_post_stun(function fun) +Hooks after the virtual function.
The callback signature is nil stun(Movable self, int framecount) + + +CallbackId +set_pre_freeze(function fun) +Hooks before the virtual function.
The callback signature is bool freeze(Movable self, int framecount) + + +CallbackId +set_post_freeze(function fun) +Hooks after the virtual function.
The callback signature is nil freeze(Movable self, int framecount) + + +CallbackId +set_pre_light_on_fire(function fun) +Hooks before the virtual function.
The callback signature is bool light_on_fire(Movable self, int time)
Virtual function docs:
Does not damage entity + + +CallbackId +set_post_light_on_fire(function fun) +Hooks after the virtual function.
The callback signature is nil light_on_fire(Movable self, int time)
Virtual function docs:
Does not damage entity + + +CallbackId +set_pre_set_cursed(function fun) +Hooks before the virtual function.
The callback signature is bool set_cursed(Movable self, bool b) + + +CallbackId +set_post_set_cursed(function fun) +Hooks after the virtual function.
The callback signature is nil set_cursed(Movable self, bool b) + + +CallbackId +set_pre_web_collision(function fun) +Hooks before the virtual function.
The callback signature is bool web_collision(Movable self) + + +CallbackId +set_post_web_collision(function fun) +Hooks after the virtual function.
The callback signature is nil web_collision(Movable self) + + +CallbackId +set_pre_check_out_of_bounds(function fun) +Hooks before the virtual function.
The callback signature is bool check_out_of_bounds(Movable self) + + +CallbackId +set_post_check_out_of_bounds(function fun) +Hooks after the virtual function.
The callback signature is nil check_out_of_bounds(Movable self) + + +CallbackId +set_pre_standing_on(function fun) +Hooks before the virtual function.
The callback signature is optional<Entity> standing_on(Movable self) + + +CallbackId +set_post_standing_on(function fun) +Hooks after the virtual function.
The callback signature is nil standing_on(Movable self) + + +CallbackId +set_pre_stomped_by(function fun) +Hooks before the virtual function.
The callback signature is bool stomped_by(Movable self, Entity*) + + +CallbackId +set_post_stomped_by(function fun) +Hooks after the virtual function.
The callback signature is nil stomped_by(Movable self, Entity*) + + +CallbackId +set_pre_thrown_by(function fun) +Hooks before the virtual function.
The callback signature is bool thrown_by(Movable self, Entity*) + + +CallbackId +set_post_thrown_by(function fun) +Hooks after the virtual function.
The callback signature is nil thrown_by(Movable self, Entity*) + + +CallbackId +set_pre_cloned_to(function fun) +Hooks before the virtual function.
The callback signature is bool cloned_to(Movable self, Entity*) + + +CallbackId +set_post_cloned_to(function fun) +Hooks after the virtual function.
The callback signature is nil cloned_to(Movable self, Entity*) + + +CallbackId +set_pre_pick_up(function fun) +Hooks before the virtual function.
The callback signature is bool pick_up(Movable self, Entity entity_to_pick_up) + + +CallbackId +set_post_pick_up(function fun) +Hooks after the virtual function.
The callback signature is nil pick_up(Movable self, Entity entity_to_pick_up) + + +CallbackId +set_pre_picked_up_by(function fun) +Hooks before the virtual function.
The callback signature is bool picked_up_by(Movable self, Entity*) CallbackId -set_post_apply_movement(function fun) -Hooks after the virtual function.
The callback signature is nil apply_movement(Movable self) +set_post_picked_up_by(function fun) +Hooks after the virtual function.
The callback signature is nil picked_up_by(Movable self, Entity*) CallbackId -set_pre_check_is_falling(function fun) -Hooks before the virtual function.
The callback signature is bool check_is_falling(Movable self) +set_pre_drop(function fun) +Hooks before the virtual function.
The callback signature is bool drop(Movable self, Entity entity_to_drop)
Virtual function docs:
Called when dropping or throwing CallbackId -set_post_check_is_falling(function fun) -Hooks after the virtual function.
The callback signature is nil check_is_falling(Movable self) +set_post_drop(function fun) +Hooks after the virtual function.
The callback signature is nil drop(Movable self, Entity entity_to_drop)
Virtual function docs:
Called when dropping or throwing + + +CallbackId +set_pre_collect_treasure(function fun) +Hooks before the virtual function.
The callback signature is bool collect_treasure(Movable self, int value, ENT_TYPE treasure)
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. + + +CallbackId +set_post_collect_treasure(function fun) +Hooks after the virtual function.
The callback signature is nil collect_treasure(Movable self, int value, ENT_TYPE treasure)
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. + + +CallbackId +set_pre_initialize(function fun) +Hooks before the virtual function.
The callback signature is bool initialize(Movable self) + + +CallbackId +set_post_initialize(function fun) +Hooks after the virtual function.
The callback signature is nil initialize(Movable self) CallbackId @@ -25580,6 +25835,46 @@

Movable

set_post_process_input(function fun) Hooks after the virtual function.
The callback signature is nil process_input(Movable self) + +CallbackId +set_pre_picked_up(function fun) +Hooks before the virtual function.
The callback signature is bool picked_up(Movable self) + + +CallbackId +set_post_picked_up(function fun) +Hooks after the virtual function.
The callback signature is nil picked_up(Movable self) + + +CallbackId +set_pre_fall(function fun) +Hooks before the virtual function.
The callback signature is bool fall(Movable self) + + +CallbackId +set_post_fall(function fun) +Hooks after the virtual function.
The callback signature is nil fall(Movable self) + + +CallbackId +set_pre_apply_friction(function fun) +Hooks before the virtual function.
The callback signature is bool apply_friction(Movable self) + + +CallbackId +set_post_apply_friction(function fun) +Hooks after the virtual function.
The callback signature is nil apply_friction(Movable self) + + +CallbackId +set_pre_crush(function fun) +Hooks before the virtual function.
The callback signature is bool crush(Movable self, Entity*) + + +CallbackId +set_post_crush(function fun) +Hooks after the virtual function.
The callback signature is nil crush(Movable self, Entity*) +

MovingIcon

Derived from Entity Movable

@@ -28008,23 +28303,128 @@

ENTITY_OVERRIDE

+CAN_JUMP +37 + + + +STOMP_DAMAGE +43 + + + +IS_ON_FIRE +45 + + + DAMAGE 48 -APPLY_MOVEMENT -71 +ON_HIT +49 + + + +STUN +51 + + + +FREEZE +52 + + + +LIGHT_ON_FIRE +53 + + + +SET_CURSED +54 + + + +WEB_COLLISION +55 + + + +CHECK_OUT_OF_BOUNDS +58 -CHECK_IS_FALLING +STANDING_ON +60 + + + +STOMPED_BY +61 + + + +THROWN_BY +62 + + + +CLONED_TO +63 + + + +PICK_UP +67 + + + +PICKED_UP_BY +68 + + + +DROP +69 + + + +COLLECT_TREASURE +70 + + + +INITIALIZE 75 PROCESS_INPUT -77 +78 + + + +PICKED_UP +80 + + + +FALL +83 + + + +APPLY_FRICTION +84 + + + +CRUSH +90 @@ -28032,6 +28432,36 @@

ENTITY_OVERRIDE

38 + +ENTER_ATTEMPT +40 + + + +HIDE_HUD +41 + + + +ENTER +42 + + + +LIGHT_LEVEL +44 + + + +IS_UNLOCKED +45 + + + +CAN_ENTER +46 + +

ENT_FLAG

diff --git a/docs/src/includes/_enums.md b/docs/src/includes/_enums.md index 0853597b3..426806b5f 100644 --- a/docs/src/includes/_enums.md +++ b/docs/src/includes/_enums.md @@ -245,11 +245,38 @@ Name | Data | Description [LEDGE_GRAB](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.LEDGE_GRAB) | 31 | [STOOD_ON](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.STOOD_ON) | 32 | [INIT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.INIT) | 36 | +[CAN_JUMP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.CAN_JUMP) | 37 | +[STOMP_DAMAGE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.STOMP_DAMAGE) | 43 | +[IS_ON_FIRE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.IS_ON_FIRE) | 45 | [DAMAGE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.DAMAGE) | 48 | -[APPLY_MOVEMENT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.APPLY_MOVEMENT) | 71 | -[CHECK_IS_FALLING](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.CHECK_IS_FALLING) | 75 | -[PROCESS_INPUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.PROCESS_INPUT) | 77 | +[ON_HIT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.ON_HIT) | 49 | +[STUN](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.STUN) | 51 | +[FREEZE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.FREEZE) | 52 | +[LIGHT_ON_FIRE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.LIGHT_ON_FIRE) | 53 | +[SET_CURSED](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.SET_CURSED) | 54 | +[WEB_COLLISION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.WEB_COLLISION) | 55 | +[CHECK_OUT_OF_BOUNDS](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.CHECK_OUT_OF_BOUNDS) | 58 | +[STANDING_ON](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.STANDING_ON) | 60 | +[STOMPED_BY](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.STOMPED_BY) | 61 | +[THROWN_BY](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.THROWN_BY) | 62 | +[CLONED_TO](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.CLONED_TO) | 63 | +[PICK_UP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.PICK_UP) | 67 | +[PICKED_UP_BY](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.PICKED_UP_BY) | 68 | +[DROP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.DROP) | 69 | +[COLLECT_TREASURE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.COLLECT_TREASURE) | 70 | +[INITIALIZE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.INITIALIZE) | 75 | +[PROCESS_INPUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.PROCESS_INPUT) | 78 | +[PICKED_UP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.PICKED_UP) | 80 | +[FALL](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.FALL) | 83 | +[APPLY_FRICTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.APPLY_FRICTION) | 84 | +[CRUSH](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.CRUSH) | 90 | [FLOOR_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.FLOOR_UPDATE) | 38 | +[ENTER_ATTEMPT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.ENTER_ATTEMPT) | 40 | +[HIDE_HUD](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.HIDE_HUD) | 41 | +[ENTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.ENTER) | 42 | +[LIGHT_LEVEL](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.LIGHT_LEVEL) | 44 | +[IS_UNLOCKED](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.IS_UNLOCKED) | 45 | +[CAN_ENTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ENTITY_OVERRIDE.CAN_ENTER) | 46 | ## ENT_FLAG diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index 05a4faed6..a68b17f33 100644 --- a/docs/src/includes/_types.md +++ b/docs/src/includes/_types.md @@ -3333,9 +3333,26 @@ Type | Name | Description ---- | ---- | ----------- int | [counter](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=counter) | [Entity](#Entity) | [fx_button](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=fx_button) | -int | [enter(Entity who)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=enter) | -bool | [is_unlocked()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_unlocked) | Will alwyas return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function +int | [enter(Entity who)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=enter) | Returns the entity state / behavior id to set the entity to after the entering animation. +float | [light_level()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=light_level) | Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change +bool | [is_unlocked()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_unlocked) | Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function +bool | [can_enter(Entity player)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=can_enter) | Can the door actually be entered by player. Overrides the button prompt too if false. nil | [unlock(bool unlock)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=unlock) | Lock/Unlock doors +[CallbackId](#Aliases) | [set_pre_virtual(ENTITY_OVERRIDE entry, function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_virtual) | Hooks before the virtual function at index `entry`. +[CallbackId](#Aliases) | [set_post_virtual(ENTITY_OVERRIDE entry, function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_virtual) | Hooks after the virtual function at index `entry`. +nil | [clear_virtual(CallbackId callback_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=clear_virtual) | Clears the hook given by `callback_id`, alternatively use `clear_callback()` inside the hook. +[CallbackId](#Aliases) | [set_pre_enter_attempt(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_enter_attempt) | Hooks before the virtual function.
The callback signature is `optional enter_attempt(Door self, Entity*)` +[CallbackId](#Aliases) | [set_post_enter_attempt(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_enter_attempt) | Hooks after the virtual function.
The callback signature is `nil enter_attempt(Door self, Entity*)` +[CallbackId](#Aliases) | [set_pre_hide_hud(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_hide_hud) | Hooks before the virtual function.
The callback signature is `optional hide_hud(Door self, Entity*)` +[CallbackId](#Aliases) | [set_post_hide_hud(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_hide_hud) | Hooks after the virtual function.
The callback signature is `nil hide_hud(Door self, Entity*)` +[CallbackId](#Aliases) | [set_pre_enter(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_enter) | Hooks before the virtual function.
The callback signature is `optional enter(Door self, Entity who)`
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. +[CallbackId](#Aliases) | [set_post_enter(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_enter) | Hooks after the virtual function.
The callback signature is `nil enter(Door self, Entity who)`
Virtual function docs:
Returns the entity state / behavior id to set the entity to after the entering animation. +[CallbackId](#Aliases) | [set_pre_light_level(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_light_level) | Hooks before the virtual function.
The callback signature is `optional light_level(Door self)`
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change +[CallbackId](#Aliases) | [set_post_light_level(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_light_level) | Hooks after the virtual function.
The callback signature is `nil light_level(Door self)`
Virtual function docs:
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change +[CallbackId](#Aliases) | [set_pre_is_unlocked(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_is_unlocked) | Hooks before the virtual function.
The callback signature is `optional is_unlocked(Door self)`
Virtual function docs:
Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function +[CallbackId](#Aliases) | [set_post_is_unlocked(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_is_unlocked) | Hooks after the virtual function.
The callback signature is `nil is_unlocked(Door self)`
Virtual function docs:
Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function +[CallbackId](#Aliases) | [set_pre_can_enter(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_can_enter) | Hooks before the virtual function.
The callback signature is `optional can_enter(Door self, Entity player)`
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. +[CallbackId](#Aliases) | [set_post_can_enter(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_can_enter) | Hooks after the virtual function.
The callback signature is `nil can_enter(Door self, Entity player)`
Virtual function docs:
Can the door actually be entered by player. Overrides the button prompt too if false. ### EggShipDoor @@ -6416,11 +6433,11 @@ nil | [stun(int framecount)](https://github.com/spelunky-fyi/overlunky/search?l= nil | [freeze(int framecount)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=freeze) | nil | [light_on_fire(int time)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=light_on_fire) | Does not damage entity nil | [set_cursed(bool b)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_cursed) | -nil | [drop(Entity entity_to_drop)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=drop) | +nil | [drop(Entity entity_to_drop)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=drop) | Called when dropping or throwing nil | [pick_up(Entity entity_to_pick_up)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=pick_up) | -bool | [can_jump()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=can_jump) | +bool | [can_jump()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=can_jump) | Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. [Entity](#Entity) | [standing_on()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=standing_on) | -nil | [add_money(int money)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=add_money) | Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. +nil | [collect_treasure(int value, ENT_TYPE treasure)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collect_treasure) | Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. bool | [is_on_fire()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_on_fire) | bool | [damage(int damage_dealer_uid, int damage_amount, int stun_time, float velocity_x, float velocity_y, int iframes)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=damage) | Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? array<int> | [get_all_behaviors()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_all_behaviors) | Get all avaible behavior ids @@ -6439,14 +6456,56 @@ nil | [generic_update_world(Vec2 move, float sprint_factor, bool disable_gravity [CallbackId](#Aliases) | [set_pre_virtual(ENTITY_OVERRIDE entry, function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_virtual) | Hooks before the virtual function at index `entry`. [CallbackId](#Aliases) | [set_post_virtual(ENTITY_OVERRIDE entry, function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_virtual) | Hooks after the virtual function at index `entry`. nil | [clear_virtual(CallbackId callback_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=clear_virtual) | Clears the hook given by `callback_id`, alternatively use `clear_callback()` inside the hook. +[CallbackId](#Aliases) | [set_pre_can_jump(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_can_jump) | Hooks before the virtual function.
The callback signature is `optional can_jump(Movable self)`
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. +[CallbackId](#Aliases) | [set_post_can_jump(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_can_jump) | Hooks after the virtual function.
The callback signature is `nil can_jump(Movable self)`
Virtual function docs:
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently. +[CallbackId](#Aliases) | [set_pre_stomp_damage(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_stomp_damage) | Hooks before the virtual function.
The callback signature is `optional stomp_damage(Movable self)` +[CallbackId](#Aliases) | [set_post_stomp_damage(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_stomp_damage) | Hooks after the virtual function.
The callback signature is `nil stomp_damage(Movable self)` +[CallbackId](#Aliases) | [set_pre_is_on_fire(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_is_on_fire) | Hooks before the virtual function.
The callback signature is `optional is_on_fire(Movable self)` +[CallbackId](#Aliases) | [set_post_is_on_fire(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_is_on_fire) | Hooks after the virtual function.
The callback signature is `nil is_on_fire(Movable self)` [CallbackId](#Aliases) | [set_pre_damage(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_damage) | Hooks before the virtual function.
The callback signature is `optional damage(Movable self, int damage_dealer_uid, int damage_amount, int stun_time, float velocity_x, float velocity_y, int iframes)`
Virtual function docs:
Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? [CallbackId](#Aliases) | [set_post_damage(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_damage) | Hooks after the virtual function.
The callback signature is `nil damage(Movable self, int damage_dealer_uid, int damage_amount, int stun_time, float velocity_x, float velocity_y, int iframes)`
Virtual function docs:
Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities
Returns: true if entity was affected, damage_dealer should break etc. false if the event should be ignored by damage_dealer? -[CallbackId](#Aliases) | [set_pre_apply_movement(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_apply_movement) | Hooks before the virtual function.
The callback signature is `bool apply_movement(Movable self)` -[CallbackId](#Aliases) | [set_post_apply_movement(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_apply_movement) | Hooks after the virtual function.
The callback signature is `nil apply_movement(Movable self)` -[CallbackId](#Aliases) | [set_pre_check_is_falling(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_check_is_falling) | Hooks before the virtual function.
The callback signature is `bool check_is_falling(Movable self)` -[CallbackId](#Aliases) | [set_post_check_is_falling(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_check_is_falling) | Hooks after the virtual function.
The callback signature is `nil check_is_falling(Movable self)` +[CallbackId](#Aliases) | [set_pre_on_hit(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_on_hit) | Hooks before the virtual function.
The callback signature is `bool on_hit(Movable self, Entity damage_dealer)`
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. +[CallbackId](#Aliases) | [set_post_on_hit(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_on_hit) | Hooks after the virtual function.
The callback signature is `nil on_hit(Movable self, Entity damage_dealer)`
Virtual function docs:
Hit by broken arrows etc that don't deal damage, calls on_damage with 0 damage. +[CallbackId](#Aliases) | [set_pre_stun(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_stun) | Hooks before the virtual function.
The callback signature is `bool stun(Movable self, int framecount)` +[CallbackId](#Aliases) | [set_post_stun(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_stun) | Hooks after the virtual function.
The callback signature is `nil stun(Movable self, int framecount)` +[CallbackId](#Aliases) | [set_pre_freeze(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_freeze) | Hooks before the virtual function.
The callback signature is `bool freeze(Movable self, int framecount)` +[CallbackId](#Aliases) | [set_post_freeze(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_freeze) | Hooks after the virtual function.
The callback signature is `nil freeze(Movable self, int framecount)` +[CallbackId](#Aliases) | [set_pre_light_on_fire(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_light_on_fire) | Hooks before the virtual function.
The callback signature is `bool light_on_fire(Movable self, int time)`
Virtual function docs:
Does not damage entity +[CallbackId](#Aliases) | [set_post_light_on_fire(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_light_on_fire) | Hooks after the virtual function.
The callback signature is `nil light_on_fire(Movable self, int time)`
Virtual function docs:
Does not damage entity +[CallbackId](#Aliases) | [set_pre_set_cursed(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_set_cursed) | Hooks before the virtual function.
The callback signature is `bool set_cursed(Movable self, bool b)` +[CallbackId](#Aliases) | [set_post_set_cursed(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_set_cursed) | Hooks after the virtual function.
The callback signature is `nil set_cursed(Movable self, bool b)` +[CallbackId](#Aliases) | [set_pre_web_collision(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_web_collision) | Hooks before the virtual function.
The callback signature is `bool web_collision(Movable self)` +[CallbackId](#Aliases) | [set_post_web_collision(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_web_collision) | Hooks after the virtual function.
The callback signature is `nil web_collision(Movable self)` +[CallbackId](#Aliases) | [set_pre_check_out_of_bounds(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_check_out_of_bounds) | Hooks before the virtual function.
The callback signature is `bool check_out_of_bounds(Movable self)` +[CallbackId](#Aliases) | [set_post_check_out_of_bounds(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_check_out_of_bounds) | Hooks after the virtual function.
The callback signature is `nil check_out_of_bounds(Movable self)` +[CallbackId](#Aliases) | [set_pre_standing_on(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_standing_on) | Hooks before the virtual function.
The callback signature is `optional standing_on(Movable self)` +[CallbackId](#Aliases) | [set_post_standing_on(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_standing_on) | Hooks after the virtual function.
The callback signature is `nil standing_on(Movable self)` +[CallbackId](#Aliases) | [set_pre_stomped_by(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_stomped_by) | Hooks before the virtual function.
The callback signature is `bool stomped_by(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_post_stomped_by(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_stomped_by) | Hooks after the virtual function.
The callback signature is `nil stomped_by(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_pre_thrown_by(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_thrown_by) | Hooks before the virtual function.
The callback signature is `bool thrown_by(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_post_thrown_by(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_thrown_by) | Hooks after the virtual function.
The callback signature is `nil thrown_by(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_pre_cloned_to(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_cloned_to) | Hooks before the virtual function.
The callback signature is `bool cloned_to(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_post_cloned_to(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_cloned_to) | Hooks after the virtual function.
The callback signature is `nil cloned_to(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_pre_pick_up(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_pick_up) | Hooks before the virtual function.
The callback signature is `bool pick_up(Movable self, Entity entity_to_pick_up)` +[CallbackId](#Aliases) | [set_post_pick_up(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_pick_up) | Hooks after the virtual function.
The callback signature is `nil pick_up(Movable self, Entity entity_to_pick_up)` +[CallbackId](#Aliases) | [set_pre_picked_up_by(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_picked_up_by) | Hooks before the virtual function.
The callback signature is `bool picked_up_by(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_post_picked_up_by(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_picked_up_by) | Hooks after the virtual function.
The callback signature is `nil picked_up_by(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_pre_drop(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_drop) | Hooks before the virtual function.
The callback signature is `bool drop(Movable self, Entity entity_to_drop)`
Virtual function docs:
Called when dropping or throwing +[CallbackId](#Aliases) | [set_post_drop(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_drop) | Hooks after the virtual function.
The callback signature is `nil drop(Movable self, Entity entity_to_drop)`
Virtual function docs:
Called when dropping or throwing +[CallbackId](#Aliases) | [set_pre_collect_treasure(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_collect_treasure) | Hooks before the virtual function.
The callback signature is `bool collect_treasure(Movable self, int value, ENT_TYPE treasure)`
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. +[CallbackId](#Aliases) | [set_post_collect_treasure(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_collect_treasure) | Hooks after the virtual function.
The callback signature is `nil collect_treasure(Movable self, int value, ENT_TYPE treasure)`
Virtual function docs:
Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. +[CallbackId](#Aliases) | [set_pre_initialize(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_initialize) | Hooks before the virtual function.
The callback signature is `bool initialize(Movable self)` +[CallbackId](#Aliases) | [set_post_initialize(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_initialize) | Hooks after the virtual function.
The callback signature is `nil initialize(Movable self)` [CallbackId](#Aliases) | [set_pre_process_input(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_process_input) | Hooks before the virtual function.
The callback signature is `bool process_input(Movable self)` [CallbackId](#Aliases) | [set_post_process_input(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_process_input) | Hooks after the virtual function.
The callback signature is `nil process_input(Movable self)` +[CallbackId](#Aliases) | [set_pre_picked_up(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_picked_up) | Hooks before the virtual function.
The callback signature is `bool picked_up(Movable self)` +[CallbackId](#Aliases) | [set_post_picked_up(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_picked_up) | Hooks after the virtual function.
The callback signature is `nil picked_up(Movable self)` +[CallbackId](#Aliases) | [set_pre_fall(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_fall) | Hooks before the virtual function.
The callback signature is `bool fall(Movable self)` +[CallbackId](#Aliases) | [set_post_fall(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_fall) | Hooks after the virtual function.
The callback signature is `nil fall(Movable self)` +[CallbackId](#Aliases) | [set_pre_apply_friction(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_apply_friction) | Hooks before the virtual function.
The callback signature is `bool apply_friction(Movable self)` +[CallbackId](#Aliases) | [set_post_apply_friction(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_apply_friction) | Hooks after the virtual function.
The callback signature is `nil apply_friction(Movable self)` +[CallbackId](#Aliases) | [set_pre_crush(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_crush) | Hooks before the virtual function.
The callback signature is `bool crush(Movable self, Entity*)` +[CallbackId](#Aliases) | [set_post_crush(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_crush) | Hooks after the virtual function.
The callback signature is `nil crush(Movable self, Entity*)` ### MovingIcon