From 38f0d5b91e6ad09d9c29d2dafdf8714b2f6fd2c1 Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:11:45 +0200 Subject: [PATCH] some post merge changes, update docs --- docs/game_data/spel2.lua | 124 ++++++++++++++--------------- docs/src/includes/_types.md | 82 +++++++++---------- src/game_api/entities_items.hpp | 2 +- src/game_api/entities_monsters.hpp | 6 +- src/game_api/entity.hpp | 4 +- src/game_api/movable.hpp | 2 +- 6 files changed, 110 insertions(+), 110 deletions(-) diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index c9a979bbb..f07860d8e 100644 --- a/docs/game_data/spel2.lua +++ b/docs/game_data/spel2.lua @@ -78,11 +78,11 @@ function lua_print() end ---@param message string ---@return nil function print(message) end ----Print a log message to ingame console with a comment identifying the script that sent it. +---Print a log message to in-game console with a comment identifying the script that sent it. ---@param message string ---@return nil function console_print(message) end ----Prinspect to ingame console. +---Prinspect to in-game console. ---@vararg any ---@return nil function console_prinspect(...) end @@ -418,7 +418,7 @@ function spawn_unrolled_player_rope(x, y, layer, texture, max_length) end ---@param layer LAYER? ---@return integer function spawn_player(player_slot, x, y, layer) end ----Spawn the PlayerGhost entity, it will not move and not be connected to any player, you can then use [steal_input](https://spelunky-fyi.github.io/overlunky/#steal_input) and send_input to controll it +---Spawn the PlayerGhost entity, it will not move and not be connected to any player, you can then use [steal_input](https://spelunky-fyi.github.io/overlunky/#steal_input) and send_input to control it ---or change it's `player_inputs` to the `input` of real player so he can control it directly ---@param char_type ENT_TYPE ---@param x number @@ -428,7 +428,7 @@ function spawn_player(player_slot, x, y, layer) end function spawn_playerghost(char_type, x, y, layer) end ---Add a callback for a spawn of specific entity types or mask. Set `mask` to `MASK.ANY` to ignore that. ---This is run before the entity is spawned, spawn your own entity and return its uid to replace the intended spawn. ----In many cases replacing the intended entity won't have the indended effect or will even break the game, so use only if you really know what you're doing. +---In many cases replacing the intended entity won't have the intended effect or will even break the game, so use only if you really know what you're doing. ---The callback signature is optional pre_entity_spawn(ENT_TYPE entity_type, float x, float y, int layer, Entity overlay_entity, SPAWN_TYPE spawn_flags) ---@param cb fun(entity_type: ENT_TYPE, x: number, y: number, layer: integer, overlay_entity: Entity, spawn_flags: SPAWN_TYPE): integer? ---@param flags SPAWN_TYPE @@ -544,7 +544,7 @@ function get_type(id) end ---@param layer LAYER ---@return integer function get_grid_entity_at(x, y, layer) end ----Get uids of static entities overlaping this grid position (decorations, backgrounds etc.) +---Get uids of static entities overlapping this grid position (decorations, backgrounds etc.) ---@param x number ---@param y number ---@param layer LAYER @@ -998,7 +998,7 @@ function raise() end ---@param hash integer ---@return STRINGID function hash_to_stringid(hash) end ----Get string behind STRINGID, don't use stringid diretcly for vanilla string, use [hash_to_stringid](https://spelunky-fyi.github.io/overlunky/#hash_to_stringid) first +---Get string behind STRINGID, don't use stringid directly for vanilla string, use [hash_to_stringid](https://spelunky-fyi.github.io/overlunky/#hash_to_stringid) first ---Will return the string of currently choosen language ---@param string_id STRINGID ---@return string @@ -1009,7 +1009,7 @@ function get_string(string_id) end ---@param str string ---@return nil function change_string(id, str) end ----Add custom string, currently can only be used for names of shop items (Entitydb->description) +---Add custom string, currently can only be used for names of shop items (EntityDB->description) ---Returns STRINGID of the new string ---@param str string ---@return STRINGID @@ -1286,12 +1286,12 @@ function set_frametime_unfocused(frametime) end ---@return double function get_frametime_unfocused() end ---Adds new custom type (group of ENT_TYPE) that can be later used in functions like get_entities_by or set_(pre/post)_entity_spawn ----Use empty array or no parameter to get new uniqe ENT_TYPE that can be used for custom EntityDB +---Use empty array or no parameter to get new unique ENT_TYPE that can be used for custom EntityDB ---@param types ENT_TYPE[] ---@return ENT_TYPE function add_custom_type(types) end ---Adds new custom type (group of ENT_TYPE) that can be later used in functions like get_entities_by or set_(pre/post)_entity_spawn ----Use empty array or no parameter to get new uniqe ENT_TYPE that can be used for custom EntityDB +---Use empty array or no parameter to get new unique ENT_TYPE that can be used for custom EntityDB ---@return ENT_TYPE function add_custom_type() end ---Get uids of entities by draw_depth. Can also use table of draw_depths. @@ -1389,7 +1389,7 @@ function play_adventure() end ---@return nil function play_seeded(seed) end ---Change layer at which the liquid spawns in, THIS FUNCTION NEEDS TO BE CALLED BEFORE THE LEVEL IS BUILD, otherwise collisions and other stuff will be wrong for the newly spawned liquid ----This sadly also makes lavamanders extinct, since the logic for their spawn is harcoded to front layer with bunch of other unrelated stuff (you can still spawn them with script or place them directly in level files) +---This sadly also makes lavamanders extinct, since the logic for their spawn is hardcoded to front layer with bunch of other unrelated stuff (you can still spawn them with script or place them directly in level files) ---Everything should be working more or less correctly (report on community discord if you find something unusual) ---@param l LAYER ---@return nil @@ -1501,7 +1501,7 @@ function extinguish_particles(particle_emitter) end ---@param layer LAYER ---@return boolean function default_spawn_is_valid(x, y, layer) end ----Check if position satifies the given POS_TYPE flags, to be used in a custom is_valid function procedural for spawns. +---Check if position satisfies the given POS_TYPE flags, to be used in a custom is_valid function procedural for spawns. ---@param x number ---@param y number ---@param layer LAYER @@ -1553,7 +1553,7 @@ function define_procedural_spawn(procedural_spawn, do_spawn, is_valid) end ---Use for example when you can spawn only on the ceiling, under water or inside a shop. ---Set `is_valid` to `nil` in order to use the default rule (aka. on top of floor and not obstructed). ---To change the number of spawns use `PostRoomGenerationContext:set_num_extra_spawns` during `ON.POST_ROOM_GENERATION` ----No name is attached to the extra spawn since it is not modified from level files, instead every call to this function will return a new uniqe id. +---No name is attached to the extra spawn since it is not modified from level files, instead every call to this function will return a new unique id. ---@param do_spawn fun(x: number, y: number, layer: LAYER): nil ---@param is_valid fun(x: number, y: number, layer: LAYER): boolean ---@param num_spawns_frontlayer integer @@ -1630,28 +1630,28 @@ function get_level_config(config) end function set_level_config(config, value) end ---Grow vines from `GROWABLE_VINE` and `VINE_TREE_TOP` entities in a level, `area` default is whole level, `destroy_broken` default is false ---@param l LAYER ----@param max_lengh integer +---@param max_length integer ---@param area AABB ---@param destroy_broken boolean ---@return nil -function grow_vines(l, max_lengh, area, destroy_broken) end +function grow_vines(l, max_length, area, destroy_broken) end ---Grow vines from `GROWABLE_VINE` and `VINE_TREE_TOP` entities in a level, `area` default is whole level, `destroy_broken` default is false ---@param l LAYER ----@param max_lengh integer +---@param max_length integer ---@return nil -function grow_vines(l, max_lengh) end +function grow_vines(l, max_length) end ---Grow pole from `GROWABLE_CLIMBING_POLE` entities in a level, `area` default is whole level, `destroy_broken` default is false ---@param l LAYER ----@param max_lengh integer +---@param max_length integer ---@param area AABB ---@param destroy_broken boolean ---@return nil -function grow_poles(l, max_lengh, area, destroy_broken) end +function grow_poles(l, max_length, area, destroy_broken) end ---Grow pole from `GROWABLE_CLIMBING_POLE` entities in a level, `area` default is whole level, `destroy_broken` default is false ---@param l LAYER ----@param max_lengh integer +---@param max_length integer ---@return nil -function grow_poles(l, max_lengh) end +function grow_poles(l, max_length) end ---Grow chains from `ENT_TYPE_FLOOR_CHAIN_CEILING` and chain with blocks on it from `ENT_TYPE_FLOOR_CHAINANDBLOCKS_CEILING`, it starts looking for the ceilings from the top left corner of a level. ---To limit it use the parameters, so x = 10 will only grow chains from ceilings with x < 10, with y = 10 it's ceilings that have y > (level bound top - 10) ---@return boolean @@ -1823,7 +1823,7 @@ function screen_aabb(box) end ---@param D Vec2 ---@return Vec2 function intersection(A, B, C, D) end ----Mesures angle between two lines with one common point +---Measures angle between two lines with one common point ---@param A Vec2 ---@param common Vec2 ---@param B Vec2 @@ -1910,7 +1910,7 @@ function get_bucket() end function rgba(r, g, b, a) end ---Convert a string to a color, you can use the HTML color names, or even HTML color codes, just prefix them with '#' symbol ---You can also convert hex string into a color, prefix it with '0x', but use it only if you need to since lua allows for hex values directly too. ----Default apha value will be 0xFF, unless it's specified +---Default alpha value will be 0xFF, unless it's specified ---Format: [name], #RRGGBB, #RRGGBBAA, 0xBBGGRR, 0xAABBGGRR ---@param color_name string ---@param alpha integer? @@ -2528,7 +2528,7 @@ function PRNG:random(min, max) end ---@field destroy fun(self): nil @Completely removes the entity from existence ---@field activate fun(self, activator: Entity): nil @Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) ---@field perform_teleport fun(self, delta_x: integer, delta_y: integer): nil @Performs a teleport as if the entity had a teleporter and used it. The delta coordinates are where you want the entity to teleport to relative to its current position, in tiles (so integers, not floats). Positive numbers = to the right and up, negative left and down. - ---@field trigger_action fun(self, user: Entity): boolean @Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) + ---@field trigger_action fun(self, user: Entity): boolean @Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) ---@field get_metadata fun(self): integer @e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred) ---@field apply_metadata fun(self, metadata: integer): nil ---@field set_invisible fun(self, value: boolean): nil @@ -2575,8 +2575,8 @@ function PRNG:random(min, max) end ---@field set_post_remove_item fun(self, fun: fun(self: Entity, entity: Entity, autokill_check: boolean): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil remove_item(Entity self, Entity entity, boolean autokill_check)` ---@field set_pre_get_held_entity fun(self, fun: fun(self: Entity): Entity?): CallbackId @Hooks before the virtual function.
The callback signature is `optional get_held_entity(Entity self)` ---@field set_post_get_held_entity fun(self, fun: fun(self: Entity): Entity?): CallbackId @Hooks after the virtual function.
The callback signature is `nil get_held_entity(Entity self)` - ---@field set_pre_trigger_action fun(self, fun: fun(self: Entity, user: Entity): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) - ---@field set_post_trigger_action fun(self, fun: fun(self: Entity, user: Entity): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) + ---@field set_pre_trigger_action fun(self, fun: fun(self: Entity, user: Entity): boolean?): CallbackId @Hooks before the virtual function.
The callback signature is `optional trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) + ---@field set_post_trigger_action fun(self, fun: fun(self: Entity, user: Entity): boolean?): CallbackId @Hooks after the virtual function.
The callback signature is `nil trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) ---@field set_pre_activate fun(self, fun: fun(self: Entity, activator: Entity): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool activate(Entity self, Entity activator)`
Virtual function docs:
Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) ---@field set_post_activate fun(self, fun: fun(self: Entity, activator: Entity): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil activate(Entity self, Entity activator)`
Virtual function docs:
Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) ---@field set_pre_on_collision2 fun(self, fun: fun(self: Entity, other_entity: Entity): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool on_collision2(Entity self, Entity other_entity)`
Virtual function docs:
More like on_overlap, triggers when entities touch/overlap each other. Triggers for entities in it's EntityDB.collision2_mask @@ -2614,7 +2614,7 @@ function Entity:overlaps_with(rect_left, rect_bottom, rect_right, rect_top) end function Entity:overlaps_with(other) end ---Kill entity along with all entities attached to it. Be aware that for example killing push block with this function will also kill anything on top of it, any items, players, monsters etc. ---To avoid that, you can inclusively or exclusively limit certain MASK and ENT_TYPE. Note: the function will first check mask, if the entity doesn't match, it will look in the provided ENT_TYPE's ----destroy_corpse and responsible are the standard parameters for the kill funciton +---destroy_corpse and responsible are the standard parameters for the kill function ---@param destroy_corpse boolean ---@param responsible Entity ---@param mask integer? @@ -2686,7 +2686,7 @@ function Entity:destroy_recursive() end ---@field is_on_fire fun(self): boolean ---@field is_powerup_capable fun(self): boolean ---@field damage fun(self, damage_dealer: Entity, damage_amount: integer, damage_flags: DAMAGE_TYPE, velocity: Vec2, unknown_damage_phase: integer, stun_amount: integer, iframes: integer, unknown_is_final: boolean): boolean @Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities. `damage_dealer` can be set to nil.
Returns: true if entity was affected (for stuff like pot that should break after hit etc.), false if the event should be ignored by damage_dealer - ---@field get_all_behaviors fun(self): integer[] @Get all avaible behavior ids + ---@field get_all_behaviors fun(self): integer[] @Get all available behavior ids ---@field set_behavior fun(self, behavior_id: integer): boolean @Set behavior, this is more than just state as it's an active function, for example climbing ladder is a behavior and it doesn't actually need ladder/rope entity
Returns false if entity doesn't have this behavior id ---@field get_behavior fun(self): integer @Get the current behavior id ---@field set_gravity fun(self, gravity: number): nil @Force the gravity for this entity. Will override anything set by special states like swimming too, unless you reset it. Default 1.0 @@ -2811,8 +2811,8 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field held_item ENT_TYPE @Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this ---@field held_item_metadata integer @Metadata of the held item (health, is cursed etc.)
Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this ---@field saved_pets_count integer - ---@field mount_type ENT_TYPE @Used to transfer information to transition/next level (player rading a mout). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this - ---@field mount_metadata integer @Metadata of the mount (health, is cursed etc.)
Used to transfer information to transition/next level (player rading a mout). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this + ---@field mount_type ENT_TYPE @Used to transfer information to transition/next level (player riding a mount). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this + ---@field mount_metadata integer @Metadata of the mount (health, is cursed etc.)
Used to transfer information to transition/next level (player riding a mount). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this ---@field kills_level integer ---@field kills_total integer ---@field collected_money_total integer @Total money collected during previous levels (so excluding the current one) @@ -2820,7 +2820,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field collected_money ENT_TYPE[] @size: 512 @Types of gold/gems collected during this level, used later to display during the transition ---@field collected_money_values integer[] @size: 512 @Values of gold/gems collected during this level, used later to display during the transition ---@field killed_enemies ENT_TYPE[] @size: 256 @Types of enemies killed during this level, used later to display during the transition - ---@field companion_count integer @Number of companions, it will determinate how many companions will be transfered to next level
Increments when player acquires new companion, decrements when one of them dies + ---@field companion_count integer @Number of companions, it will determinate how many companions will be transferred to next level
Increments when player acquires new companion, decrements when one of them dies ---@field companions ENT_TYPE[] @size: 8 @Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this ---@field companion_held_items ENT_TYPE[] @size: 8 @Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this ---@field companion_held_item_metadatas integer[] @size: 8 @Metadata of items held by companions (health, is cursed etc.)
Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this @@ -2838,7 +2838,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field last_state integer ---@field trust integer @Levels completed with, 0..3 ---@field whipped integer @Number of times whipped by player - ---@field walk_pause_timer integer @positive: walking, negative: wating/idle + ---@field walk_pause_timer integer @positive: walking, negative: waiting/idle ---@class Player : PowerupCapable ---@field inventory Inventory @@ -2868,7 +2868,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field deco_left integer ---@field deco_right integer ---@field fix_border_tile_animation fun(self): nil @Sets `animation_frame` of the floor for types `FLOOR_BORDERTILE`, `FLOOR_BORDERTILE_METAL` and `FLOOR_BORDERTILE_OCTOPUS`. - ---@field fix_decorations fun(self, fix_also_neighbors: boolean, fix_styled_floor: boolean): nil @Used to add decoration to a floor entity after it was spawned outside of level gen, is not necessary when spawning during level gen.
Set `fix_also_neighbours` to `true` to fix the neighbouring floor tile decorations on the border of the two tiles.
Set `fix_styled_floor` to `true` to fix decorations on `FLOORSTYLED_*` entities, those usually only have decorations when broken. + ---@field fix_decorations fun(self, fix_also_neighbors: boolean, fix_styled_floor: boolean): nil @Used to add decoration to a floor entity after it was spawned outside of level gen, is not necessary when spawning during level gen.
Set `fix_also_neighbors` to `true` to fix the neighboring floor tile decorations on the border of the two tiles.
Set `fix_styled_floor` to `true` to fix decorations on `FLOORSTYLED_*` entities, those usually only have decorations when broken. ---@field add_decoration fun(self, side: FLOOR_SIDE): nil @Explicitly add a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. ---@field remove_decoration fun(self, side: FLOOR_SIDE): nil @Explicitly remove a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. ---@field decorate_internal fun(self): nil @@ -3170,8 +3170,8 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field lose_interest_timer integer ---@field countdown_timer integer @can't shot when the timer is running ---@field is_patrolling boolean - ---@field aggro_trigger boolean @setting this makes him angry, if it's shopkeeper you get 2 agrro points - ---@field was_hurt boolean @also is set true if you set aggro to true, get's trigger even when whiping + ---@field aggro_trigger boolean @setting this makes him angry, if it's shopkeeper you get 2 aggro points + ---@field was_hurt boolean @also is set true if you set aggro to true, get's trigger even when whipping ---@class WalkingMonster : Monster ---@field chatting_to_uid integer @@ -3233,7 +3233,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field ceiling_pos_x number ---@field ceiling_pos_y number ---@field jump_timer integer @For the giant spider, some times he shot web instead of jumping - ---@field trigger_distance number @only in the x coord + ---@field trigger_distance number @only in the x coordinate ---@class HangSpider : Monster ---@field dangle_jump_timer integer @@ -3317,7 +3317,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field jump_pause_timer integer ---@field lava_detection_timer integer ---@field is_hot boolean - ---@field player_detect_state integer @0 - didnt_saw_player, 1 - saw_player, 2 - spited_lava; probably used so he won't spit imminently after seeing the player + ---@field player_detect_state integer @0 - didn't saw player, 1 - saw player, 2 - spited lava; probably used so he won't spit imminently after seeing the player ---@class Firebug : Monster ---@field sound SoundMeta @@ -3355,7 +3355,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field walk_pause_timer integer ---@class VanHorsing : NPC - ---@field show_text boolean @if set to true, he will say 'i've been hunting this fiend a long time!' when on screen + ---@field show_text boolean @if set to true, he will say "I've been hunting this fiend a long time!" when on screen ---@field special_message_shown boolean @one way door message has been shown ---@class WitchDoctor : WalkingMonster @@ -3390,7 +3390,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@class Octopus : WalkingMonster ---@class Bodyguard : NPC - ---@field position_state integer @0 - none, 1 - Tusk dice shop, 2 - Entrence to pleasure palace, 3 - Basement entrance to pleasure palace + ---@field position_state integer @0 - none, 1 - Tusk dice shop, 2 - Entrance to pleasure palace, 3 - Basement entrance to pleasure palace ---@field message_shown boolean ---@class Fish : Monster @@ -3416,7 +3416,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field climb_pause_timer integer ---@field shell_invincibility_timer integer ---@field monster_spawn_timer integer - ---@field initial_shell_health integer @excalibur wipes out immediately, bombs take off 11 points, when 0 vulnerable to whip + ---@field initial_shell_health integer @Excalibur wipes out immediately, bombs take off 11 points, when 0 vulnerable to whip ---@field player_seen_by_kingu boolean ---@class Anubis : Monster @@ -3622,7 +3622,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field snake_head_spawn_y number @This is custom variable, you need [activate_hundun_hack](#activate_hundun_hack) to use it ---@class HundunHead : Monster - ---@field attack_position_x number @Posiotion where the head will move on attack + ---@field attack_position_x number @Position where the head will move on attack ---@field attack_position_y number ---@field egg_crack_effect_uid integer ---@field targeted_player_uid integer @@ -3756,7 +3756,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@class DummyPurchasableEntity : Purchasable ---@class Bow : Purchasable - ---@field get_arrow_special_offset fun(self): number @When lain on the ground + ---@field get_arrow_special_offset fun(self): number @When lying on the ground ---@class Present : Purchasable ---@field inside ENT_TYPE @@ -4365,7 +4365,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@field max_timer integer ---@field size number @Gets smaller as the timer gets close to the max_timer ----@class BGShopEntrence : Entity +---@class BGShopEntrance : Entity ---@field on_entering boolean ---@class BGFloatingDebris : BGSurfaceLayer @@ -4513,7 +4513,7 @@ function Movable:generic_update_world(move, sprint_factor, disable_gravity, on_r ---@class EggplantThrower : Entity ---@class LogicalMiniGame : Entity - ---@field timer integer @Delay between spwning ufo + ---@field timer integer @Delay between spawning ufo ---@class DMSpawning : Entity ---@field spawn_x number @@ -4663,7 +4663,7 @@ function MovableBehavior:get_state_id() end ---@field spawn_decoration fun(self): nil @Spawns some specific decoration, e.g. Vlad's big banner ---@field spawn_decoration2 fun(self): nil @Spawns some other specific decorations, e.g. grass, flowers, udjat room decal ---@field spawn_extra fun(self): nil @Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... - ---@field do_procedural_spawn fun(self, info: SpawnInfo): nil @Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) + ---@field do_procedural_spawn fun(self, info: SpawnInfo): nil @Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) ---@field set_pre_virtual fun(self, entry: THEME_OVERRIDE, fun: function): CallbackId @Hooks before the virtual function at index `entry`. ---@field set_post_virtual fun(self, entry: THEME_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. @@ -4767,8 +4767,8 @@ function MovableBehavior:get_state_id() end ---@field set_post_spawn_decoration2 fun(self, fun: fun(self: ThemeInfo): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil spawn_decoration2(ThemeInfo self)`
Virtual function docs:
Spawns some other specific decorations, e.g. grass, flowers, udjat room decal ---@field set_pre_spawn_extra fun(self, fun: fun(self: ThemeInfo): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool spawn_extra(ThemeInfo self)`
Virtual function docs:
Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... ---@field set_post_spawn_extra fun(self, fun: fun(self: ThemeInfo): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil spawn_extra(ThemeInfo self)`
Virtual function docs:
Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... - ---@field set_pre_do_procedural_spawn fun(self, fun: fun(self: ThemeInfo, info: SpawnInfo): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) - ---@field set_post_do_procedural_spawn fun(self, fun: fun(self: ThemeInfo, info: SpawnInfo): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) + ---@field set_pre_do_procedural_spawn fun(self, fun: fun(self: ThemeInfo, info: SpawnInfo): boolean): CallbackId @Hooks before the virtual function.
The callback signature is `bool do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) + ---@field set_post_do_procedural_spawn fun(self, fun: fun(self: ThemeInfo, info: SpawnInfo): boolean): CallbackId @Hooks after the virtual function.
The callback signature is `nil do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) ---@class CustomTheme : ThemeInfo ---@field level_file string @Level file to load. Probably doesn't do much in custom themes, especially if you're forcing them in PRE_LOAD_LEVEL_FILES. @@ -5216,15 +5216,15 @@ function GuiDrawContext:win_pushid(id) end ---@class VanillaRenderContext ---@field draw_text_size fun(self, text: string, scale_x: number, scale_y: number, fontstyle: integer): number, number @Measure the provided text using the built-in renderer
If you can, consider creating your own TextRenderingInfo instead
You can then use `:text_size()` and `draw_text` with that one object
`draw_text_size` works by creating new TextRenderingInfo just to call `:text_size()`, which is not very optimal - ---@field set_corner_finish fun(self, c: CORNER_FINISH): nil @Set the prefered way of drawing corners for the non filled shapes + ---@field set_corner_finish fun(self, c: CORNER_FINISH): nil @Set the preferred way of drawing corners for the non filled shapes ---@field draw_screen_line fun(self, A: Vec2, B: Vec2, thickness: number, color: Color): nil @Draws a line on screen using the built-in renderer from point `A` to point `B`.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events - ---@field draw_screen_rect fun(self, rect: AABB, thickness: number, color: Color, angle: number?, px: number?, py: number?): nil @Draw rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events - ---@field draw_screen_rect_filled fun(self, rect: AABB, color: Color, angle: number?, px: number?, py: number?): nil @Draw filled rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events + ---@field draw_screen_rect fun(self, rect: AABB, thickness: number, color: Color, angle: number?, px: number?, py: number?): nil @Draw rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events + ---@field draw_screen_rect_filled fun(self, rect: AABB, color: Color, angle: number?, px: number?, py: number?): nil @Draw filled rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events ---@field draw_screen_triangle fun(self, triangle: Triangle, thickness: number, color: Color): nil @Draw triangle in screen coordinates using the built-in renderer.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events ---@field draw_screen_triangle_filled fun(self, triangle: Triangle, color: Color): nil @Draw filled triangle in screen coordinates using the built-in renderer.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events ---@field draw_world_line fun(self, A: Vec2, B: Vec2, thickness: number, color: Color): nil @Draws a line in world coordinates using the built-in renderer from point `A` to point `B`.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event - ---@field draw_world_rect fun(self, rect: AABB, thickness: number, color: Color, angle: number?, px: number?, py: number?): nil @Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event - ---@field draw_world_rect_filled fun(self, rect: AABB, color: Color, angle: number?, px: number?, py: number?): nil @Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event + ---@field draw_world_rect fun(self, rect: AABB, thickness: number, color: Color, angle: number?, px: number?, py: number?): nil @Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event + ---@field draw_world_rect_filled fun(self, rect: AABB, color: Color, angle: number?, px: number?, py: number?): nil @Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event ---@field draw_world_triangle fun(self, triangle: Triangle, thickness: number, color: Color): nil @Draw triangle in world coordinates using the built-in renderer.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event ---@field draw_world_triangle_filled fun(self, triangle: Triangle, color: Color): nil @Draw filled triangle in world coordinates using the built-in renderer.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event ---@field bounding_box AABB @@ -5267,7 +5267,7 @@ function VanillaRenderContext:draw_screen_texture(texture_id, row, column, left, ---@param color Color ---@return nil function VanillaRenderContext:draw_screen_texture(texture_id, row, column, rect, color) end ----Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc. +---Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotation where 0,0 is center 1,1 is top right corner etc. ---Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events ---@param texture_id TEXTURE ---@param row integer @@ -5356,7 +5356,7 @@ function VanillaRenderContext:draw_world_texture(texture_id, row, column, left, ---@param color Color ---@return nil function VanillaRenderContext:draw_world_texture(texture_id, row, column, dest, color) end ----Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc. +---Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotation where 0,0 is center 1,1 is top right corner etc. ---Use in combination with ON.RENDER_PRE_DRAW_DEPTH event ---For more control use the version taking a Quad instead ---@param texture_id TEXTURE @@ -5442,7 +5442,7 @@ function VanillaRenderContext:draw_world_poly_filled(points, color) end ---@field new any @constructors{} ---@field x number ---@field y number - ---@field destination_bottom_left_x number @destination is relative to the x,y centerpoint + ---@field destination_bottom_left_x number @destination is relative to the x,y center point ---@field destination_bottom_left_y number ---@field destination_bottom_right_x number ---@field destination_bottom_right_y number @@ -5475,12 +5475,12 @@ function VanillaRenderContext:draw_world_poly_filled(points, color) end ---@field new any @initializers(TextRenderingInfo_ctor, TextRenderingInfo_ctor2) ---@field x number ---@field y number - ---@field text_length integer @You can also just use `#` operator on the whole TextRenderingInfo to get the text lenght + ---@field text_length integer @You can also just use `#` operator on the whole TextRenderingInfo to get the text length ---@field width number ---@field height number - ---@field special_texture_id TEXTURE @Used to draw buttons and stuff, default is -1 wich uses the buttons texture - ---@field get_dest fun(self): Letter[] @Returns refrence to the letter coordinates relative to the x,y position - ---@field get_source fun(self): Letter[] @Returns refrence to the letter coordinates in the texture + ---@field special_texture_id TEXTURE @Used to draw buttons and stuff, default is -1 which uses the buttons texture + ---@field get_dest fun(self): Letter[] @Returns reference to the letter coordinates relative to the x,y position + ---@field get_source fun(self): Letter[] @Returns reference to the letter coordinates in the texture ---@field text_size fun(self): number, number @{width, height}, is only updated when you set/change the text. This is equivalent to draw_text_size ---@field rotate fun(self, angle: number, px: number?, py: number?): nil @Rotates the text around the pivot point (default 0), pivot is relative to the text position (x, y), use px and py to offset it ---@field set_text fun(self, text: string, scale_x: number, scale_y: number, alignment: VANILLA_TEXT_ALIGNMENT, fontstyle: VANILLA_FONT_STYLE): nil @Changes the text, only position stays the same, everything else (like rotation) is reset or set according to the parameters @@ -5505,7 +5505,7 @@ function VanillaRenderContext:draw_world_poly_filled(points, color) end ---@class HudElement ---@field dim boolean @Hide background and dim if using the auto adjust setting. ---@field opacity number @Background will be drawn if this is not 0.5 - ---@field time_dim integer @Level time when element should dim again after hilighted, INT_MAX if dimmed on auto adjust. 0 on opaque. + ---@field time_dim integer @Level time when element should dim again after highlighted, INT_MAX if dimmed on auto adjust. 0 on opaque. ---@class HudPlayer : HudElement ---@field health integer @@ -5574,7 +5574,7 @@ function VanillaRenderContext:draw_world_poly_filled(points, color) end ---@class Vec2 ---@field x number ---@field y number - ---@field distance_to fun(self, other: Vec2): number @Just simple pythagoras theorem + ---@field distance_to fun(self, other: Vec2): number @Just simple Pythagoras theorem ---@field set fun(self, other: Vec2): Vec2 ---@field split fun(self): number, number local Vec2 = nil @@ -5664,7 +5664,7 @@ function Triangle:is_point_inside(x, y, epsilon) end ---@field top_left_x number ---@field top_left_y number ---@field get_AABB fun(self): AABB @Returns the max/min values of the Quad - ---@field rotate fun(self, angle: number, px: number, py: number): Quad @Rotates a Quad by an angle, px/py are not offsets, use `:get_AABB():center()` to get approximated center for simetrical quadrangle + ---@field rotate fun(self, angle: number, px: number, py: number): Quad @Rotates a Quad by an angle, px/py are not offsets, use `:get_AABB():center()` to get approximated center for symmetrical quadrangle ---@field flip_horizontally fun(self): Quad ---@field flip_vertically fun(self): Quad ---@field set fun(self, other: Quad): Quad @@ -6116,7 +6116,7 @@ function Quad:is_point_inside(x, y, epsilon) end ---@field fade_timer integer ---@field page_timer integer ---@field opacity number - ---@field pages JournalPage[] @Stores pages loaded into memeory. It's not cleared after the journal is closed or when you go back to the main (menu) page.
Use `:get_type()` to chcek page type and cast it correctly (see ON.[RENDER_PRE_JOURNAL_PAGE](#ON-RENDER_PRE_JOURNAL_PAGE)) + ---@field pages JournalPage[] @Stores pages loaded into memory. It's not cleared after the journal is closed or when you go back to the main (menu) page.
Use `:get_type()` to check page type and cast it correctly (see ON.[RENDER_PRE_JOURNAL_PAGE](#ON-RENDER_PRE_JOURNAL_PAGE)) ---@class JournalPage ---@field background TextureRenderingInfo diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index 22a811152..1099f5cc9 100644 --- a/docs/src/includes/_types.md +++ b/docs/src/includes/_types.md @@ -320,14 +320,14 @@ nil | [draw_text(TextRenderingInfo tri, Color color)](https://github.com/spelunk tuple<float, float> | [draw_text_size(string text, float scale_x, float scale_y, int fontstyle)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_text_size) | Measure the provided text using the built-in renderer
If you can, consider creating your own [TextRenderingInfo](#TextRenderingInfo) instead
You can then use `:text_size()` and `draw_text` with that one object
`draw_text_size` works by creating new TextRenderingInfo just to call `:text_size()`, which is not very optimal nil | [draw_screen_texture(TEXTURE texture_id, int row, int column, float left, float top, float right, float bottom, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_texture(TEXTURE texture_id, int row, int column, AABB rect, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events -nil | [draw_screen_texture(TEXTURE texture_id, int row, int column, AABB rect, Color color, float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc.
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events +nil | [draw_screen_texture(TEXTURE texture_id, int row, int column, AABB rect, Color color, float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotation where 0,0 is center 1,1 is top right corner etc.
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_texture(TEXTURE texture_id, int row, int column, Quad dest, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_texture(TEXTURE texture_id, Quad source, Quad dest, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer. `source` - the coordinates in the texture, `dest` - the coordinates on the screen
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_texture(TEXTURE texture_id, TextureRenderingInfo tri, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_texture) | Draw a texture in screen coordinates using [TextureRenderingInfo](#TextureRenderingInfo)
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events -nil | [set_corner_finish(CORNER_FINISH c)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_corner_finish) | Set the prefered way of drawing corners for the non filled shapes +nil | [set_corner_finish(CORNER_FINISH c)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_corner_finish) | Set the preferred way of drawing corners for the non filled shapes nil | [draw_screen_line(Vec2 A, Vec2 B, float thickness, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_line) | Draws a line on screen using the built-in renderer from point `A` to point `B`.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events -nil | [draw_screen_rect(AABB rect, float thickness, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_rect) | Draw rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events -nil | [draw_screen_rect_filled(AABB rect, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_rect_filled) | Draw filled rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events +nil | [draw_screen_rect(AABB rect, float thickness, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_rect) | Draw rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events +nil | [draw_screen_rect_filled(AABB rect, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_rect_filled) | Draw filled rectangle in screen coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_triangle(Triangle triangle, float thickness, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_triangle) | Draw triangle in screen coordinates using the built-in renderer.
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_triangle_filled(Triangle triangle, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_triangle_filled) | Draw filled triangle in screen coordinates using the built-in renderer.
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_screen_poly(array points, float thickness, Color color, bool closed)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_poly) | Draw a polyline on screen from points using the built-in renderer
Draws from the first to the last point, use `closed` to connect first and last as well
Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events @@ -336,14 +336,14 @@ nil | [draw_screen_poly_filled(array points, Color color)](https://github. nil | [draw_screen_poly_filled(Quad points, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_screen_poly_filled) | Draw filled quadrilateral in screen coordinates from top-left to bottom-right using the built-in renderer.
Use in combination with [ON](#ON).RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events nil | [draw_world_texture(TEXTURE texture_id, int row, int column, float left, float top, float right, float bottom, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event
For more control use the version taking a [Quad](#Quad) instead nil | [draw_world_texture(TEXTURE texture_id, int row, int column, AABB dest, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event
For more control use the version taking a [Quad](#Quad) instead -nil | [draw_world_texture(TEXTURE texture_id, int row, int column, AABB dest, Color color, float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc.
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event
For more control use the version taking a [Quad](#Quad) instead +nil | [draw_world_texture(TEXTURE texture_id, int row, int column, AABB dest, Color color, float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer with angle, px/py is pivot for the rotation where 0,0 is center 1,1 is top right corner etc.
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event
For more control use the version taking a [Quad](#Quad) instead nil | [draw_world_texture(TEXTURE texture_id, int row, int column, Quad dest, Color color, WORLD_SHADER shader)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer
The `shader` parameter controls how to render the texture
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event nil | [draw_world_texture(TEXTURE texture_id, int row, int column, Quad dest, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event nil | [draw_world_texture(TEXTURE texture_id, Quad source, Quad dest, Color color, WORLD_SHADER shader)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer. `source` - the coordinates in the texture, `dest` - the coordinates on the screen
The `shader` parameter controls how to render the texture
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event nil | [draw_world_texture(TEXTURE texture_id, Quad source, Quad dest, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_texture) | Draw a texture in world coordinates from top-left to bottom-right using the built-in renderer. `source` - the coordinates in the texture, `dest` - the coordinates on the screen
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event nil | [draw_world_line(Vec2 A, Vec2 B, float thickness, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_line) | Draws a line in world coordinates using the built-in renderer from point `A` to point `B`.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event -nil | [draw_world_rect(AABB rect, float thickness, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_rect) | Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event -nil | [draw_world_rect_filled(AABB rect, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_rect_filled) | Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotatnion where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event +nil | [draw_world_rect(AABB rect, float thickness, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_rect) | Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc. (corner from the AABB, not the visible one from adding the `thickness`)
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event +nil | [draw_world_rect_filled(AABB rect, Color color, optional angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_rect_filled) | Draw rectangle in world coordinates from top-left to bottom-right using the built-in renderer with optional `angle`.
`px`/`py` is pivot for the rotation where 0,0 is center 1,1 is top right corner etc.
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event nil | [draw_world_triangle(Triangle triangle, float thickness, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_triangle) | Draw triangle in world coordinates using the built-in renderer.
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event nil | [draw_world_triangle_filled(Triangle triangle, Color color)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_triangle_filled) | Draw filled triangle in world coordinates using the built-in renderer.
Use in combination with [ON](#ON).RENDER_PRE_DRAW_DEPTH event nil | [draw_world_poly(array points, float thickness, Color color, bool closed)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=draw_world_poly) | Draw a polyline in world coordinates from points using the built-in renderer
Draws from the first to the last point, use `closed` to connect first and last as well
Use in combination with ON.RENDER_PRE_DRAW_DEPTH event @@ -369,7 +369,7 @@ int | [state](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=state) | int | [last_state](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=last_state) | int | [trust](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trust) | Levels completed with, 0..3 int | [whipped](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=whipped) | Number of times whipped by player -int | [walk_pause_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=walk_pause_timer) | positive: walking, negative: wating/idle +int | [walk_pause_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=walk_pause_timer) | positive: walking, negative: waiting/idle ### Animation @@ -525,8 +525,8 @@ int | [time_of_death](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=t [ENT_TYPE](#ENT_TYPE) | [held_item](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=held_item) | Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this int | [held_item_metadata](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=held_item_metadata) | Metadata of the held item (health, is cursed etc.)
Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this int | [saved_pets_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=saved_pets_count) | -[ENT_TYPE](#ENT_TYPE) | [mount_type](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=mount_type) | Used to transfer information to transition/next level (player rading a mout). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this -int | [mount_metadata](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=mount_metadata) | Metadata of the mount (health, is cursed etc.)
Used to transfer information to transition/next level (player rading a mout). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this +[ENT_TYPE](#ENT_TYPE) | [mount_type](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=mount_type) | Used to transfer information to transition/next level (player riding a mount). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this +int | [mount_metadata](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=mount_metadata) | Metadata of the mount (health, is cursed etc.)
Used to transfer information to transition/next level (player riding a mount). Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this int | [kills_level](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kills_level) | int | [kills_total](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kills_total) | int | [collected_money_total](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collected_money_total) | Total money collected during previous levels (so excluding the current one) @@ -534,7 +534,7 @@ int | [collected_money_count](https://github.com/spelunky-fyi/overlunky/search?l array<[ENT_TYPE](#ENT_TYPE), 512> | [collected_money](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collected_money) | Types of gold/gems collected during this level, used later to display during the transition array<int, 512> | [collected_money_values](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collected_money_values) | Values of gold/gems collected during this level, used later to display during the transition array<[ENT_TYPE](#ENT_TYPE), 256> | [killed_enemies](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=killed_enemies) | Types of enemies killed during this level, used later to display during the transition -int | [companion_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=companion_count) | Number of companions, it will determinate how many companions will be transfered to next level
Increments when player acquires new companion, decrements when one of them dies +int | [companion_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=companion_count) | Number of companions, it will determinate how many companions will be transferred to next level
Increments when player acquires new companion, decrements when one of them dies array<[ENT_TYPE](#ENT_TYPE), 8> | [companions](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=companions) | Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this array<[ENT_TYPE](#ENT_TYPE), 8> | [companion_held_items](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=companion_held_items) | Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this array<int, 8> | [companion_held_item_metadatas](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=companion_held_item_metadatas) | Metadata of items held by companions (health, is cursed etc.)
Used to transfer information to transition/next level. Is not updated during a level
You can use `ON.PRE_LEVEL_GENERATION` to access/edit this @@ -747,7 +747,7 @@ Type | Name | Description ---- | ---- | ----------- bool | [dim](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=dim) | Hide background and dim if using the auto adjust setting. float | [opacity](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=opacity) | Background will be drawn if this is not 0.5 -int | [time_dim](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=time_dim) | Level time when element should dim again after hilighted, INT_MAX if dimmed on auto adjust. 0 on opaque. +int | [time_dim](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=time_dim) | Level time when element should dim again after highlighted, INT_MAX if dimmed on auto adjust. 0 on opaque. ### HudMoney @@ -910,7 +910,7 @@ float | [top_left_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=to [AABB](#AABB) | [get_AABB()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_AABB) | Returns the max/min values of the [Quad](#Quad) [Quad](#Quad) | [offset(Vec2 off)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=offset) | [Quad](#Quad) | [offset(float off_x, float off_y)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=offset) | -[Quad](#Quad) | [rotate(float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=rotate) | Rotates a [Quad](#Quad) by an angle, px/py are not offsets, use `:get_AABB():center()` to get approximated center for simetrical quadrangle +[Quad](#Quad) | [rotate(float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=rotate) | Rotates a [Quad](#Quad) by an angle, px/py are not offsets, use `:get_AABB():center()` to get approximated center for symmetrical quadrangle [Quad](#Quad) | [flip_horizontally()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=flip_horizontally) | [Quad](#Quad) | [flip_vertically()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=flip_vertically) | bool | [is_point_inside(Vec2 p, optional epsilon)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_point_inside) | Check if point lies inside of triangle
Because of the imprecise nature of floating point values, the `epsilon` value is needed to compare the floats, the default value is `0.00001` @@ -1072,7 +1072,7 @@ float | [x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=x) | float | [y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=y) | [Vec2](#Vec2) | [rotate(float angle, float px, float py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=rotate) | [Vec2](#Vec2) | [rotate(float angle, Vec2 p)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=rotate) | -float | [distance_to(Vec2 other)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=distance_to) | Just simple pythagoras theorem +float | [distance_to(Vec2 other)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=distance_to) | Just simple Pythagoras theorem [Vec2](#Vec2) | [set(Vec2 other)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set) | tuple<float, float> | [split()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=split) | @@ -1410,7 +1410,7 @@ array<int, 17> | [level_config](https://github.com/spelunky-fyi/overlunky/ ### Illumination -Generic obcject for lights in the game, you can make your own with [create_illumination](#create_illumination)
+Generic object for lights in the game, you can make your own with [create_illumination](#create_illumination)
Used in [StateMemory](#StateMemory), [Player](#Player), [PlayerGhost](#PlayerGhost), [BurningRopeEffect](#BurningRopeEffect) ... Type | Name | Description @@ -1996,7 +1996,7 @@ int | [max_page_count](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q= int | [fade_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=fade_timer) | int | [page_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=page_timer) | float | [opacity](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=opacity) | -vector<[JournalPage](#JournalPage)> | [pages](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=pages) | Stores pages loaded into memeory. It's not cleared after the journal is closed or when you go back to the main (menu) page.
Use `:get_type()` to chcek page type and cast it correctly (see ON.[RENDER_PRE_JOURNAL_PAGE](#ON-RENDER_PRE_JOURNAL_PAGE)) +vector<[JournalPage](#JournalPage)> | [pages](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=pages) | Stores pages loaded into memory. It's not cleared after the journal is closed or when you go back to the main (menu) page.
Use `:get_type()` to check page type and cast it correctly (see ON.[RENDER_PRE_JOURNAL_PAGE](#ON-RENDER_PRE_JOURNAL_PAGE)) ### MenuScreenPanels @@ -3128,12 +3128,12 @@ Type | Name | Description | [new](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=new) | [TextRenderingInfo](#TextRenderingInfo):new(string text, float scale_x, float scale_y, [VANILLA_TEXT_ALIGNMENT](#VANILLA_TEXT_ALIGNMENT) alignment, [VANILLA_FONT_STYLE](#VANILLA_FONT_STYLE) fontstyle)
[TextRenderingInfo](#TextRenderingInfo):new(string text, float x, float y, float scale_x, float scale_y, [VANILLA_TEXT_ALIGNMENT](#VANILLA_TEXT_ALIGNMENT) alignment, [VANILLA_FONT_STYLE](#VANILLA_FONT_STYLE) fontstyle)
Creates new [TextRenderingInfo](#TextRenderingInfo) that can be used in [VanillaRenderContext](#VanillaRenderContext) draw_text
For static text, it is better to use one object and call draw_text with it, instead of relaying on draw_text creating this object for you
float | [x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=x) | float | [y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=y) | -int | [text_length](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=text_length) | You can also just use `#` operator on the whole TextRenderingInfo to get the text lenght +int | [text_length](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=text_length) | You can also just use `#` operator on the whole TextRenderingInfo to get the text length float | [width](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=width) | float | [height](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=height) | -[TEXTURE](#TEXTURE) | [special_texture_id](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=special_texture_id) | Used to draw buttons and stuff, default is -1 wich uses the buttons texture -span<[Letter](#Letter)> | [get_dest()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_dest) | Returns refrence to the letter coordinates relative to the x,y position -span<[Letter](#Letter)> | [get_source()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_source) | Returns refrence to the letter coordinates in the texture +[TEXTURE](#TEXTURE) | [special_texture_id](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=special_texture_id) | Used to draw buttons and stuff, default is -1 which uses the buttons texture +span<[Letter](#Letter)> | [get_dest()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_dest) | Returns reference to the letter coordinates relative to the x,y position +span<[Letter](#Letter)> | [get_source()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_source) | Returns reference to the letter coordinates in the texture tuple<float, float> | [text_size()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=text_size) | {width, height}, is only updated when you set/change the text. This is equivalent to draw_text_size nil | [rotate(float angle, optional px, optional py)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=rotate) | Rotates the text around the pivot point (default 0), pivot is relative to the text position (x, y), use px and py to offset it nil | [set_text(string text, float scale_x, float scale_y, VANILLA_TEXT_ALIGNMENT alignment, VANILLA_FONT_STYLE fontstyle)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_text) | Changes the text, only position stays the same, everything else (like rotation) is reset or set according to the parameters @@ -3168,7 +3168,7 @@ Type | Name | Description | [new](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=new) | float | [x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=x) | float | [y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=y) | -float | [destination_bottom_left_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destination_bottom_left_x) | destination is relative to the x,y centerpoint +float | [destination_bottom_left_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destination_bottom_left_x) | destination is relative to the x,y center point float | [destination_bottom_left_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destination_bottom_left_y) | float | [destination_bottom_right_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destination_bottom_right_x) | float | [destination_bottom_right_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destination_bottom_right_y) | @@ -3397,7 +3397,7 @@ int | [get_shop_chance()](https://github.com/spelunky-fyi/overlunky/search?l=Lua nil | [spawn_decoration()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_decoration) | Spawns some specific decoration, e.g. [Vlad](#Vlad)'s big banner nil | [spawn_decoration2()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_decoration2) | Spawns some other specific decorations, e.g. grass, flowers, udjat room decal nil | [spawn_extra()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_extra) | Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... -nil | [do_procedural_spawn(SpawnInfo info)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=do_procedural_spawn) | Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) +nil | [do_procedural_spawn(SpawnInfo info)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=do_procedural_spawn) | Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) [CallbackId](#Aliases) | [set_pre_virtual(THEME_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(THEME_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. @@ -3501,8 +3501,8 @@ nil | [clear_virtual(CallbackId callback_id)](https://github.com/spelunky-fyi/ov [CallbackId](#Aliases) | [set_post_spawn_decoration2(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_spawn_decoration2) | Hooks after the virtual function.
The callback signature is `nil spawn_decoration2(ThemeInfo self)`
Virtual function docs:
Spawns some other specific decorations, e.g. grass, flowers, udjat room decal [CallbackId](#Aliases) | [set_pre_spawn_extra(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_spawn_extra) | Hooks before the virtual function.
The callback signature is `bool spawn_extra(ThemeInfo self)`
Virtual function docs:
Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... [CallbackId](#Aliases) | [set_post_spawn_extra(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_spawn_extra) | Hooks after the virtual function.
The callback signature is `nil spawn_extra(ThemeInfo self)`
Virtual function docs:
Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... -[CallbackId](#Aliases) | [set_pre_do_procedural_spawn(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_do_procedural_spawn) | Hooks before the virtual function.
The callback signature is `bool do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) -[CallbackId](#Aliases) | [set_post_do_procedural_spawn(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_do_procedural_spawn) | Hooks after the virtual function.
The callback signature is `nil do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) +[CallbackId](#Aliases) | [set_pre_do_procedural_spawn(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_do_procedural_spawn) | Hooks before the virtual function.
The callback signature is `bool do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) +[CallbackId](#Aliases) | [set_post_do_procedural_spawn(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_do_procedural_spawn) | Hooks after the virtual function.
The callback signature is `nil do_procedural_spawn(ThemeInfo self, SpawnInfo info)`
Virtual function docs:
Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) # Entity types @@ -3578,7 +3578,7 @@ int | [timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=timer) | int | [max_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=max_timer) | float | [size](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=size) | Gets smaller as the timer gets close to the max_timer -### BGShopEntrence +### BGShopEntrance Derived from [Entity](#Entity) @@ -3855,7 +3855,7 @@ int | [deco_bottom](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=dec int | [deco_left](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=deco_left) | int | [deco_right](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=deco_right) | nil | [fix_border_tile_animation()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=fix_border_tile_animation) | Sets `animation_frame` of the floor for types `FLOOR_BORDERTILE`, `FLOOR_BORDERTILE_METAL` and `FLOOR_BORDERTILE_OCTOPUS`. -nil | [fix_decorations(bool fix_also_neighbors, bool fix_styled_floor)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=fix_decorations) | Used to add decoration to a floor entity after it was spawned outside of level gen, is not necessary when spawning during level gen.
Set `fix_also_neighbours` to `true` to fix the neighbouring floor tile decorations on the border of the two tiles.
Set `fix_styled_floor` to `true` to fix decorations on `FLOORSTYLED_*` entities, those usually only have decorations when broken. +nil | [fix_decorations(bool fix_also_neighbors, bool fix_styled_floor)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=fix_decorations) | Used to add decoration to a floor entity after it was spawned outside of level gen, is not necessary when spawning during level gen.
Set `fix_also_neighbors` to `true` to fix the neighboring floor tile decorations on the border of the two tiles.
Set `fix_styled_floor` to `true` to fix decorations on `FLOORSTYLED_*` entities, those usually only have decorations when broken. nil | [add_decoration(FLOOR_SIDE side)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=add_decoration) | Explicitly add a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. nil | [remove_decoration(FLOOR_SIDE side)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=remove_decoration) | Explicitly remove a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. nil | [decorate_internal()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=decorate_internal) | @@ -4244,14 +4244,14 @@ nil | [kill(bool destroy_corpse, Entity responsible)](https://github.com/spelunk nil | [destroy()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy) | Completely removes the entity from existence nil | [activate(Entity activator)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=activate) | Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) nil | [perform_teleport(int delta_x, int delta_y)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=perform_teleport) | Performs a teleport as if the entity had a teleporter and used it. The delta coordinates are where you want the entity to teleport to relative to its current position, in tiles (so integers, not floats). Positive numbers = to the right and up, negative left and down. -bool | [trigger_action(Entity user)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trigger_action) | Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) +bool | [trigger_action(Entity user)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trigger_action) | Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) int | [get_metadata()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_metadata) | e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred) nil | [apply_metadata(int metadata)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=apply_metadata) | nil | [set_invisible(bool value)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_invisible) | vector<int> | [get_items()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_items) | bool | [is_in_liquid()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_in_liquid) | Returns true if entity is in water/lava bool | [is_cursed()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_cursed) | -nil | [kill_recursive(bool destroy_corpse, Entity responsible, optional mask, array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kill_recursive) | Kill entity along with all entities attached to it. Be aware that for example killing push block with this function will also kill anything on top of it, any items, players, monsters etc.
To avoid that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s
destroy_corpse and responsible are the standard parameters for the kill funciton +nil | [kill_recursive(bool destroy_corpse, Entity responsible, optional mask, array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kill_recursive) | Kill entity along with all entities attached to it. Be aware that for example killing push block with this function will also kill anything on top of it, any items, players, monsters etc.
To avoid that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s
destroy_corpse and responsible are the standard parameters for the kill function nil | [kill_recursive(bool destroy_corpse, Entity responsible)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=kill_recursive) | Short for using [RECURSIVE_MODE](#RECURSIVE_MODE).NONE nil | [destroy_recursive(optional mask, array ent_types, RECURSIVE_MODE rec_mode)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_recursive) | Destroy entity along with all entities attached to it. Be aware that for example destroying push block with this function will also destroy anything on top of it, any items, players, monsters etc.
To avoid that, you can inclusively or exclusively limit certain [MASK](#MASK) and [ENT_TYPE](#ENT_TYPE). Note: the function will first check the mask, if the entity doesn't match, it will look in the provided [ENT_TYPE](#ENT_TYPE)'s nil | [destroy_recursive()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_recursive) | Short for using [RECURSIVE_MODE](#RECURSIVE_MODE).NONE @@ -4295,8 +4295,8 @@ nil | [clear_virtual(CallbackId callback_id)](https://github.com/spelunky-fyi/ov [CallbackId](#Aliases) | [set_post_remove_item(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_remove_item) | Hooks after the virtual function.
The callback signature is `nil remove_item(Entity self, Entity entity, bool autokill_check)` [CallbackId](#Aliases) | [set_pre_get_held_entity(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_get_held_entity) | Hooks before the virtual function.
The callback signature is `optional get_held_entity(Entity self)` [CallbackId](#Aliases) | [set_post_get_held_entity(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_get_held_entity) | Hooks after the virtual function.
The callback signature is `nil get_held_entity(Entity self)` -[CallbackId](#Aliases) | [set_pre_trigger_action(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_trigger_action) | Hooks before the virtual function.
The callback signature is `optional trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) -[CallbackId](#Aliases) | [set_post_trigger_action(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_trigger_action) | Hooks after the virtual function.
The callback signature is `nil trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) +[CallbackId](#Aliases) | [set_pre_trigger_action(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_trigger_action) | Hooks before the virtual function.
The callback signature is `optional trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) +[CallbackId](#Aliases) | [set_post_trigger_action(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_trigger_action) | Hooks after the virtual function.
The callback signature is `nil trigger_action(Entity self, Entity user)`
Virtual function docs:
Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) [CallbackId](#Aliases) | [set_pre_activate(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_activate) | Hooks before the virtual function.
The callback signature is `bool activate(Entity self, Entity activator)`
Virtual function docs:
Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) [CallbackId](#Aliases) | [set_post_activate(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_activate) | Hooks after the virtual function.
The callback signature is `nil activate(Entity self, Entity activator)`
Virtual function docs:
Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) [CallbackId](#Aliases) | [set_pre_on_collision2(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_on_collision2) | Hooks before the virtual function.
The callback signature is `bool on_collision2(Entity self, Entity other_entity)`
Virtual function docs:
More like on_overlap, triggers when entities touch/overlap each other. Triggers for entities in it's EntityDB.collision2_mask @@ -4523,7 +4523,7 @@ Derived from [Entity](#Entity) Type | Name | Description ---- | ---- | ----------- -int | [timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=timer) | Delay between spwning ufo +int | [timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=timer) | Delay between spawning ufo ### LogicalRegeneratingBlock @@ -4678,7 +4678,7 @@ Derived from [Entity](#Entity) [Movable](#Movable) [PowerupCapable](#PowerupCapa Type | Name | Description ---- | ---- | ----------- -int | [position_state](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=position_state) | 0 - none, 1 - Tusk dice shop, 2 - Entrence to pleasure palace, 3 - Basement entrance to pleasure palace +int | [position_state](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=position_state) | 0 - none, 1 - Tusk dice shop, 2 - Entrance to pleasure palace, 3 - Basement entrance to pleasure palace bool | [message_shown](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=message_shown) | ### CatMummy @@ -5117,7 +5117,7 @@ Derived from [Entity](#Entity) [Movable](#Movable) [PowerupCapable](#PowerupCapa Type | Name | Description ---- | ---- | ----------- -float | [attack_position_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=attack_position_x) | Posiotion where the head will move on attack +float | [attack_position_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=attack_position_x) | Position where the head will move on attack float | [attack_position_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=attack_position_y) | int | [egg_crack_effect_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=egg_crack_effect_uid) | int | [targeted_player_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=targeted_player_uid) | @@ -5169,7 +5169,7 @@ float | [climb_direction_y](https://github.com/spelunky-fyi/overlunky/search?l=L int | [climb_pause_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=climb_pause_timer) | int | [shell_invincibility_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=shell_invincibility_timer) | int | [monster_spawn_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=monster_spawn_timer) | -int | [initial_shell_health](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=initial_shell_health) | excalibur wipes out immediately, bombs take off 11 points, when 0 vulnerable to whip +int | [initial_shell_health](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=initial_shell_health) | [Excalibur](#Excalibur) wipes out immediately, bombs take off 11 points, when 0 vulnerable to whip bool | [player_seen_by_kingu](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=player_seen_by_kingu) | ### Lahamu @@ -5211,7 +5211,7 @@ int | [shoot_lava_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua& int | [jump_pause_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=jump_pause_timer) | int | [lava_detection_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=lava_detection_timer) | bool | [is_hot](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_hot) | -int | [player_detect_state](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=player_detect_state) | 0 - didnt_saw_player, 1 - saw_player, 2 - spited_lava; probably used so he won't spit imminently after seeing the player +int | [player_detect_state](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=player_detect_state) | 0 - didn't saw player, 1 - saw player, 2 - spited lava; probably used so he won't spit imminently after seeing the player ### Leprechaun @@ -5550,8 +5550,8 @@ int | [patrol_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=pa int | [lose_interest_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=lose_interest_timer) | int | [countdown_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=countdown_timer) | can't shot when the timer is running bool | [is_patrolling](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_patrolling) | -bool | [aggro_trigger](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=aggro_trigger) | setting this makes him angry, if it's shopkeeper you get 2 agrro points -bool | [was_hurt](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=was_hurt) | also is set true if you set aggro to true, get's trigger even when whiping +bool | [aggro_trigger](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=aggro_trigger) | setting this makes him angry, if it's shopkeeper you get 2 aggro points +bool | [was_hurt](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=was_hurt) | also is set true if you set aggro to true, get's trigger even when whipping ### Scarab @@ -5620,7 +5620,7 @@ Type | Name | Description float | [ceiling_pos_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ceiling_pos_x) | float | [ceiling_pos_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ceiling_pos_y) | int | [jump_timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=jump_timer) | For the giant spider, some times he shot web instead of jumping -float | [trigger_distance](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trigger_distance) | only in the x coord +float | [trigger_distance](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=trigger_distance) | only in the x coordinate ### Tadpole @@ -5711,7 +5711,7 @@ Derived from [Entity](#Entity) [Movable](#Movable) [PowerupCapable](#PowerupCapa Type | Name | Description ---- | ---- | ----------- -bool | [show_text](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=show_text) | if set to true, he will say 'i've been hunting this fiend a long time!' when on screen +bool | [show_text](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=show_text) | if set to true, he will say "I've been hunting this fiend a long time!" when on screen bool | [special_message_shown](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=special_message_shown) | one way door message has been shown ### Vlad @@ -5951,7 +5951,7 @@ Derived from [Entity](#Entity) [Movable](#Movable) [Purchasable](#Purchasable) Type | Name | Description ---- | ---- | ----------- -float | [get_arrow_special_offset()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_arrow_special_offset) | When lain on the ground +float | [get_arrow_special_offset()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_arrow_special_offset) | When lying on the ground ### Bullet @@ -6926,7 +6926,7 @@ bool | [can_jump()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=can bool | [is_on_fire()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_on_fire) | bool | [is_powerup_capable()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_powerup_capable) | bool | [damage(Entity damage_dealer, int damage_amount, DAMAGE_TYPE damage_flags, Vec2 velocity, int unknown_damage_phase, int stun_amount, int iframes, bool unknown_is_final)](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. `damage_dealer` can be set to nil.
Returns: true if entity was affected (for stuff like pot that should break after hit etc.), false if the event should be ignored by damage_dealer -vector<int> | [get_all_behaviors()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_all_behaviors) | Get all avaible behavior ids +vector<int> | [get_all_behaviors()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_all_behaviors) | Get all available behavior ids bool | [set_behavior(int behavior_id)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_behavior) | Set behavior, this is more than just state as it's an active function, for example climbing ladder is a behavior and it doesn't actually need ladder/rope entity
Returns false if entity doesn't have this behavior id int | [get_behavior()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=get_behavior) | Get the current behavior id nil | [set_gravity(float gravity)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_gravity) | Force the gravity for this entity. Will override anything set by special states like swimming too, unless you reset it. Default 1.0 diff --git a/src/game_api/entities_items.hpp b/src/game_api/entities_items.hpp index 03cdce022..cc1fe74bf 100644 --- a/src/game_api/entities_items.hpp +++ b/src/game_api/entities_items.hpp @@ -861,7 +861,7 @@ class PrizeDispenser : public Movable class Bow : public Purchasable { public: - /// When lain on the ground + /// When lying on the ground virtual float get_arrow_special_offset() = 0; }; diff --git a/src/game_api/entities_monsters.hpp b/src/game_api/entities_monsters.hpp index 19aadb62f..33064b43a 100644 --- a/src/game_api/entities_monsters.hpp +++ b/src/game_api/entities_monsters.hpp @@ -25,7 +25,7 @@ class Monster : public PowerupCapable virtual bool update_target(Entity* ent, float&) = 0; // 100, float from the function above, also works as an output? }; -// RoomOwner and NPC may have common subclass for the first two virtuals, but they later dirvarge, wepon type is the same spot, but they probably just made one first then copied over the virtuals +// RoomOwner and NPC may have common subclass for the first two virtuals, but they later diverge, weapon type is the same spot, but they probably just made one first then copied over the virtuals class RoomOwner : public Monster { public: @@ -89,7 +89,7 @@ class NPC : public Monster virtual ENT_TYPE weapon_type() = 0; /// For weapons, checks if the entity should hit the trigger or not virtual bool should_attack(std::tuple target) = 0; - virtual void on_criminal_act_committed2(void*) = 0; // calls the on_criminal_act_committed except for bodyguard which calls the should_attack_on_sight and turns off any speechbubble + virtual void on_criminal_act_committed2(void*) = 0; // calls the on_criminal_act_committed except for bodyguard which calls the should_attack_on_sight and turns off any speech-bubble }; class WalkingMonster : public Monster @@ -378,7 +378,7 @@ class Lavamander : public Monster uint16_t jump_pause_timer; // jump pause when cool; runs continuously when hot uint8_t lava_detection_timer; bool is_hot; - /// 0 - didnt_saw_player, 1 - saw_player, 2 - spited_lava; probably used so he won't spit imminently after seeing the player + /// 0 - didn't saw player, 1 - saw player, 2 - spited lava; probably used so he won't spit imminently after seeing the player uint8_t player_detect_state; uint8_t padding2; }; diff --git a/src/game_api/entity.hpp b/src/game_api/entity.hpp index 3acbc823c..ab21a4815 100644 --- a/src/game_api/entity.hpp +++ b/src/game_api/entity.hpp @@ -283,7 +283,7 @@ class Entity /// Returns true if entity is in water/lava virtual bool is_in_liquid() = 0; // 12, drill always returns false virtual bool check_type_properties_flags_19() = 0; // 13, checks (properties_flags >> 0x12) & 1; for hermitcrab checks if he's invisible; can't get it to trigger - virtual uint8_t get_type_field_60() = 0; // 14, the value is compared to entity state and used in some bahavior function + virtual uint8_t get_type_field_60() = 0; // 14, the value is compared to entity state and used in some behavior function virtual void set_invisible(bool value) = 0; // 15 virtual void flip(bool left) = 0; // 16 virtual void set_draw_depth(uint8_t draw_depth, uint8_t b3f) = 0; // 17 @@ -293,7 +293,7 @@ class Entity virtual void remove_item(Entity* entity, bool autokill_check) = 0; // 21, if autokill_check is true, it will check if the entity has the "kill if overlay lost" flag and kill it if it's set virtual Entity* get_held_entity() = 0; // 22 virtual void v23(Entity* logical_trigger, Entity* who_triggered_it) = 0; // 23, spawns LASERTRAP_SHOT from LASERTRAP, also some trigger entities use this, seam to be called right after "on_collision2", triggers use self as the first parameter. Called when there is entity overlapping trigger entity, even if they don't move - /// Triggers weapons and other held items like teleportter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) + /// Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) virtual bool trigger_action(Entity* user) = 0; // 24, also used for throwables, disabling this for bomb make it always spawn an the ground, but you can still pick it up and throw it /// Activates a button prompt (with the Use door/Buy button), e.g. buy shop item, activate drill, read sign, interact in camp, ... `get_entity():activate(players[1])` (make sure player 1 has the udjat eye though) virtual void activate(Entity* activator) = 0; // 25 diff --git a/src/game_api/movable.hpp b/src/game_api/movable.hpp index 9fced6fd6..312420b81 100644 --- a/src/game_api/movable.hpp +++ b/src/game_api/movable.hpp @@ -216,7 +216,7 @@ class Movable : public Entity virtual void initialize() = 0; // 75, e.g. cobra: set random spit_timer; bat: set random stand_counter; emerald: set price virtual void check_is_falling() = 0; // 76, sets more_flags.falling by comparing velocityy to 0, sets i120a to FF, clears owner_uid, can call remove_rider on mounts, for player updates the extra y_pos, for bosses clears lock input timer virtual void v77() = 0; // 77 - virtual void process_input() = 0; // 78, more like: handle_movment + virtual void process_input() = 0; // 78, more like: handle_movement virtual void post_collision_damage_related() = 0; // 79, used for enemies attacks as well? 3 versions for: eggplant minister, players and the rest virtual void on_picked_up() = 0; // 80, plays pickup sound depending on the entity mask/type etc. set stun for pets and mounts etc. virtual void on_release() = 0; // 81, only for hired hands and lava pots