From ddb8c0259b25130268f5af4118edb1100245c50b Mon Sep 17 00:00:00 2001 From: Mr-Auto <36127424+Mr-Auto@users.noreply.github.com> Date: Sun, 4 Aug 2024 16:00:18 +0200 Subject: [PATCH] fix spelling --- README.md | 4 +- docs/game_data/spel2.lua | 114 +++++++++--------- docs/src/includes/_casting.md | 2 +- docs/src/includes/_enums.md | 16 +-- docs/src/includes/_events.md | 12 +- docs/src/includes/_globals.md | 34 +++--- docs/src/includes/_types.md | 72 +++++------ src/game_api/bucket.cpp | 2 +- src/game_api/bucket.hpp | 2 +- src/game_api/color.hpp | 2 +- src/game_api/crc32.hpp | 2 +- src/game_api/drops.cpp | 10 +- src/game_api/entities_activefloors.hpp | 2 +- src/game_api/entities_backgrounds.hpp | 2 +- src/game_api/entities_chars.hpp | 8 +- src/game_api/entities_decorations.hpp | 6 +- src/game_api/entities_floors.cpp | 12 +- src/game_api/entities_floors.hpp | 4 +- src/game_api/entities_items.hpp | 8 +- src/game_api/entities_logical.hpp | 8 +- src/game_api/entities_monsters.hpp | 24 ++-- src/game_api/entity.hpp | 8 +- src/game_api/entity_lookup.cpp | 2 +- src/game_api/flags.hpp | 2 +- src/game_api/game_manager.hpp | 6 +- src/game_api/game_patches.cpp | 12 +- src/game_api/items.hpp | 8 +- src/game_api/layer.hpp | 6 +- src/game_api/level_api.cpp | 16 +-- src/game_api/level_api.hpp | 18 +-- src/game_api/math.cpp | 4 +- src/game_api/math.hpp | 6 +- src/game_api/memory.cpp | 4 +- src/game_api/memory.hpp | 6 +- src/game_api/movable.hpp | 6 +- src/game_api/particles.hpp | 4 +- src/game_api/render_api.hpp | 22 ++-- src/game_api/rpc.cpp | 10 +- src/game_api/screen.hpp | 18 +-- src/game_api/screen_arena.hpp | 2 +- src/game_api/script/lua_backend.hpp | 2 +- src/game_api/script/lua_console.cpp | 2 +- src/game_api/script/lua_console.hpp | 2 +- src/game_api/script/lua_vm.cpp | 30 ++--- .../usertypes/entities_backgrounds_lua.cpp | 8 +- .../script/usertypes/entities_items_lua.cpp | 2 +- src/game_api/script/usertypes/level_lua.cpp | 4 +- src/game_api/script/usertypes/socket_lua.cpp | 2 +- src/game_api/script/usertypes/state_lua.cpp | 2 +- .../script/usertypes/vanilla_render_lua.cpp | 8 +- .../script/usertypes/vanilla_render_lua.hpp | 14 +-- src/game_api/search.cpp | 22 ++-- src/game_api/sound_manager.hpp | 2 +- src/game_api/state.hpp | 2 +- src/game_api/state_structs.hpp | 6 +- src/injected/ui.cpp | 66 +++++----- 56 files changed, 338 insertions(+), 342 deletions(-) diff --git a/README.md b/README.md index 61bebca00..634b27623 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ Lua scripting is still buggy and unfinished and the **API might change**, althou + See previous section. + Some entities just crash the game, try to avoid them next time. + Some script mods just crash the game too. Complain to the author of the mod. - - If you have proglems with **Modlunky2 or Playlunky**: + - If you have problems with **Modlunky2 or Playlunky**: + While we try to keep all the modding tools compatible, some things may break sometimes. + Because PL and OL are using the same scripting API, one might inadvertently undo the change you did in the other. Don't expect perfection when using both. - If you're **missing** some overlay **windows** or tabs: @@ -166,7 +166,7 @@ Lua scripting is still buggy and unfinished and the **API might change**, althou + Make sure Windows is not using the keys for [something stupid](https://superuser.com/questions/1367843/how-to-disable-ctrlshift-keyboard-layout-switch-for-the-same-input-language-i). - If it still doesn't work + Stop by #s2-modding-help on the [community Discord](https://discord.gg/spelunky-community) or [submit an issue](https://github.com/spelunky-fyi/overlunky/issues) - + We want to know your OS version, are you using the game on Steam, what you have tried, what tools you are using, how you are using them and all the versions. These can be found in the terminal output or ingame overlays. ("Latest" or WHIP is not a version, but 7f0bc94 or 0.6.1 is.) + + We want to know your OS version, are you using the game on Steam, what you have tried, what tools you are using, how you are using them and all the versions. These can be found in the terminal output or in-game overlays. ("Latest" or WHIP is not a version, but 7f0bc94 or 0.6.1 is.) ## Development diff --git a/docs/game_data/spel2.lua b/docs/game_data/spel2.lua index 8c57890d4..bfd6b877f 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 @@ -997,7 +997,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 @@ -1008,7 +1008,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 @@ -1285,12 +1285,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. @@ -1388,7 +1388,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 @@ -1500,7 +1500,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 @@ -1552,7 +1552,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 @@ -1629,28 +1629,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 @@ -1822,7 +1822,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 @@ -1909,7 +1909,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? @@ -2593,7 +2593,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? @@ -2664,7 +2664,7 @@ function Entity:destroy_recursive() end ---@field collect_treasure fun(self, value: integer, treasure: ENT_TYPE): nil @Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. ---@field is_on_fire fun(self): boolean ---@field damage fun(self, damage_dealer: 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, damage_dealer should break etc. false if the event should be ignored by damage_dealer? - ---@field get_all_behaviors fun(self): integer[] @Get all avaible behavior ids + ---@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 @@ -2775,8 +2775,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) @@ -2784,7 +2784,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 @@ -2802,7 +2802,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 @@ -2832,7 +2832,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 @@ -3134,8 +3134,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 @@ -3197,7 +3197,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 @@ -3318,7 +3318,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 @@ -3353,7 +3353,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 @@ -3379,7 +3379,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 @@ -3585,7 +3585,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 @@ -4328,7 +4328,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 @@ -4476,7 +4476,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 @@ -4626,7 +4626,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. @@ -4730,8 +4730,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. @@ -5179,15 +5179,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 @@ -5230,7 +5230,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 @@ -5319,7 +5319,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 @@ -5405,7 +5405,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 @@ -5438,12 +5438,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 @@ -5468,7 +5468,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 @@ -5537,7 +5537,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 @@ -5627,7 +5627,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 @@ -6079,7 +6079,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/_casting.md b/docs/src/includes/_casting.md index 4510c3e12..a914292b6 100644 --- a/docs/src/includes/_casting.md +++ b/docs/src/includes/_casting.md @@ -31,7 +31,7 @@ For reference, the available `as_` functions are listed below: - as_bgmovingstar - as_bgrelativeelement - as_bgshootingstar -- as_bgshopentrence +- as_bgshopentrance - as_bgshopkeeperprime - as_bgsurfacelayer - as_bgsurfacestar diff --git a/docs/src/includes/_enums.md b/docs/src/includes/_enums.md index c814abaf5..69c8dd018 100644 --- a/docs/src/includes/_enums.md +++ b/docs/src/includes/_enums.md @@ -113,7 +113,7 @@ Name | Data | Description Name | Data | Description ---- | ---- | ----------- -[NONE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.NONE) | CORNER_FINISH::NONE | Don't draw corner at all, will draw lines as separate pieces, overlaping etc.
+[NONE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.NONE) | CORNER_FINISH::NONE | Don't draw corner at all, will draw lines as separate pieces, overlapping etc.
[REAL](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.REAL) | CORNER_FINISH::REAL | Draws a real corner, no matter how far away the "peak" of the corner may end up being
[CUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.CUT) | CORNER_FINISH::CUT | Instead of drawing a sharp point at the end of the corner, it just cuts it flat
[ADAPTIVE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=CORNER_FINISH.ADAPTIVE) | CORNER_FINISH::ADAPTIVE | Default
similar to REAL but for low angles reduces the size of the "peak" of the corner
@@ -897,20 +897,20 @@ Name | Data | Description [TOAST](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.TOAST) | ON::TOAST | Params: string text
Runs before any toast is created, even the one using [toast](#toast) function
Return: if you don't return anything it will execute the toast function normally with default message
if you return empty string, it will not create the toast at all, if you return string, it will use that instead of the original message
The first script to return string (empty or not) will take priority, the rest will receive callback call but the return behavior won't matter
[DEATH_MESSAGE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.DEATH_MESSAGE) | ON::DEATH_MESSAGE | Params: [STRINGID](#Aliases) id
Runs once after death when the death message journal page is shown. The parameter is the [STRINGID](#Aliases) of the title, like 1221 for BLOWN UP.
[PRE_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LOAD_JOURNAL_CHAPTER) | ON::PRE_LOAD_JOURNAL_CHAPTER | Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter
Runs before the journal or any of it's chapter is opened
Return: return true to not load the chapter (or journal as a whole)
-[POST_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LOAD_JOURNAL_CHAPTER) | ON::POST_LOAD_JOURNAL_CHAPTER | Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter, array:int pages
Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it
All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE
Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was aready loaded will result in the standard game page
When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ...
+[POST_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LOAD_JOURNAL_CHAPTER) | ON::POST_LOAD_JOURNAL_CHAPTER | Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter, array:int pages
Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it
All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE
Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was already loaded will result in the standard game page
When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ...
[PRE_GET_FEAT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_GET_FEAT) | ON::PRE_GET_FEAT | Runs before getting performed status for a [FEAT](#Aliases) when rendering the Feats page in journal.
Return: true to override the vanilla feat with your own. Defaults to Steam GetAchievement.
[PRE_SET_FEAT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_SET_FEAT) | ON::PRE_SET_FEAT | Runs before the game sets a vanilla feat performed.
Return: true to block the default behaviour of calling Steam SetAchievement.
-[PRE_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_UPDATE) | ON::PRE_UPDATE | Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS
Return behavior: return true to stop futher PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine)
+[PRE_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_UPDATE) | ON::PRE_UPDATE | Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS
Return behavior: return true to stop further PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine)
[POST_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_UPDATE) | ON::POST_UPDATE | Runs right after the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS
[USER_DATA](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.USER_DATA) | ON::USER_DATA | Params: [Entity](#Entity) ent
Runs on all changes to [Entity](#Entity).user_data, including after loading saved user_data in the next level and transition. Also runs the first time user_data is set back to nil, but nil won't be saved to bother you on future levels.
[PRE_LEVEL_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_CREATION) | ON::PRE_LEVEL_CREATION | Runs right before the front layer is created. Runs in all screens that usually have entities, or when creating a layer manually.
[POST_LEVEL_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_CREATION) | ON::POST_LEVEL_CREATION | Runs right after the back layer has been created and you can start spawning entities in it. Runs in all screens that usually have entities, or when creating a layer manually.
[PRE_LAYER_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_CREATION) | ON::PRE_LAYER_CREATION | Params: [LAYER](#LAYER) layer
Runs right before a layer is created. Runs in all screens that usually have entities, or when creating a layer manually.
[POST_LAYER_CREATION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_CREATION) | ON::POST_LAYER_CREATION | Params: [LAYER](#LAYER) layer
Runs right after a layer has been created and you can start spawning entities in it. Runs in all screens that usually have entities, or when creating a layer manually.
-[PRE_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_DESTRUCTION) | ON::PRE_LEVEL_DESTRUCTION | Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
-[POST_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_DESTRUCTION) | ON::POST_LEVEL_DESTRUCTION | Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
-[PRE_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_DESTRUCTION) | ON::PRE_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer
Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
-[POST_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_DESTRUCTION) | ON::POST_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer
Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
+[PRE_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_DESTRUCTION) | ON::PRE_LEVEL_DESTRUCTION | Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
+[POST_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_DESTRUCTION) | ON::POST_LEVEL_DESTRUCTION | Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
+[PRE_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_DESTRUCTION) | ON::PRE_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer
Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
+[POST_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_DESTRUCTION) | ON::POST_LAYER_DESTRUCTION | Params: [LAYER](#LAYER) layer
Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
[PRE_PROCESS_INPUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_PROCESS_INPUT) | ON::PRE_PROCESS_INPUT | Runs right before the game gets input from various devices and writes to a bunch of buttons-variables. Return true to disable all game input completely.
[POST_PROCESS_INPUT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_PROCESS_INPUT) | ON::POST_PROCESS_INPUT | Runs right after the game gets input from various devices and writes to a bunch of buttons-variables. Probably the first chance you have to capture or edit buttons_gameplay or buttons_menu sort of things.
[PRE_GAME_LOOP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_GAME_LOOP) | ON::PRE_GAME_LOOP | Runs right before the main engine loop. Return true to block state updates and menu updates, i.e. to pause inside menus.
@@ -1677,7 +1677,7 @@ Name | Data | Description [COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.COLOR) | WorldShader::Colors | Renders a solid color
[TEXTURE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE) | WorldShader::Texture | Renders a texture without applying the given color
[TEXTURE_ALPHA_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_ALPHA_COLOR) | WorldShader::TextureAlphaColor | Renders a texture by interpreting its red channel as alpha and applying the given color
-[TEXTURE_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_COLOR) | WorldShader::TextureColor | The default shader to be used, just renders a texture with transparancy and the given color
+[TEXTURE_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_COLOR) | WorldShader::TextureColor | The default shader to be used, just renders a texture with transparency and the given color
[TEXTURE_COLORS_WARP](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.TEXTURE_COLORS_WARP) | WorldShader::TextureColorsWarp | Renders the texture, with "gamma correction" of the color channels and multiplying everything by the input color alpha only
[DEFERRED_COLOR_TRANSPARENT](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.DEFERRED_COLOR_TRANSPARENT) | WorldShader::DeferredColorTransparent | Basically same as COLOR but goes through the deferred pipeline
[DEFERRED_TEXTURE_COLOR](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=WORLD_SHADER.DEFERRED_TEXTURE_COLOR) | WorldShader::DeferredTextureColor | Basically same as TEXTURE_COLOR but goes through the deferred pipeline
diff --git a/docs/src/includes/_events.md b/docs/src/includes/_events.md index 41fa08125..77fbbb384 100644 --- a/docs/src/includes/_events.md +++ b/docs/src/includes/_events.md @@ -513,7 +513,7 @@ Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter
Runs before th > Search script examples for [ON.POST_LOAD_JOURNAL_CHAPTER](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LOAD_JOURNAL_CHAPTER) -Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter, array:int pages
Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it
All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE
Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was aready loaded will result in the standard game page
When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ...
+Params: [JOURNALUI_PAGE_SHOWN](#JOURNALUI_PAGE_SHOWN) chapter, array:int pages
Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it
All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE
Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was already loaded will result in the standard game page
When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ...
## ON.PRE_GET_FEAT @@ -534,7 +534,7 @@ Runs before the game sets a vanilla feat performed.
Return: true to block th > Search script examples for [ON.PRE_UPDATE](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_UPDATE) -Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS
Return behavior: return true to stop futher PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine)
+Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS
Return behavior: return true to stop further PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine)
## ON.POST_UPDATE @@ -583,28 +583,28 @@ Params: [LAYER](#LAYER) layer
Runs right after a layer has been created and > Search script examples for [ON.PRE_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LEVEL_DESTRUCTION) -Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
+Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
## ON.POST_LEVEL_DESTRUCTION > Search script examples for [ON.POST_LEVEL_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LEVEL_DESTRUCTION) -Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
+Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
## ON.PRE_LAYER_DESTRUCTION > Search script examples for [ON.PRE_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.PRE_LAYER_DESTRUCTION) -Params: [LAYER](#LAYER) layer
Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
+Params: [LAYER](#LAYER) layer
Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
## ON.POST_LAYER_DESTRUCTION > Search script examples for [ON.POST_LAYER_DESTRUCTION](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ON.POST_LAYER_DESTRUCTION) -Params: [LAYER](#LAYER) layer
Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last.
+Params: [LAYER](#LAYER) layer
Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last.
## ON.PRE_PROCESS_INPUT diff --git a/docs/src/includes/_globals.md b/docs/src/includes/_globals.md index 56c0f4265..6202c580b 100644 --- a/docs/src/includes/_globals.md +++ b/docs/src/includes/_globals.md @@ -331,7 +331,7 @@ Sets a callback that is called right after the screen is drawn. 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](#ENT_TYPE) entity_type, float x, float y, int layer, [Entity](#Entity) overlay_entity, [SPAWN_TYPE](#SPAWN_TYPE) spawn_flags) ### set_pre_render_screen @@ -689,7 +689,7 @@ This function can be slower than the [get_entities_by](#get_entities_by) with th #### vector<int> get_entities_overlapping_grid(float x, float y, [LAYER](#LAYER) layer) -Get uids of static entities overlaping this grid position (decorations, backgrounds etc.) +Get uids of static entities overlapping this grid position (decorations, backgrounds etc.) ### get_entities_overlapping_hitbox @@ -1284,7 +1284,7 @@ default game value are: y_limit = 98.5, rising_speed_x = 0, rising_speed_y = 0.0 #### [ENT_TYPE](#ENT_TYPE) add_custom_type() 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](#ENT_TYPE) that can be used for custom [EntityDB](#EntityDB) +Use empty array or no parameter to get new unique [ENT_TYPE](#ENT_TYPE) that can be used for custom [EntityDB](#EntityDB) ### add_money @@ -1453,7 +1453,7 @@ Same as `Player.get_heart_color` #### [uColor](#Aliases) get_color(string color_name, optional alpha = nullopt) -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 Format: [name], #RRGGBB, #RRGGBBAA, 0xBBGGRR, 0xAABBGGRR +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 alpha value will be 0xFF, unless it's specified Format: [name], #RRGGBB, #RRGGBBAA, 0xBBGGRR, 0xAABBGGRR ### get_current_money @@ -1653,9 +1653,9 @@ To limit it use the parameters, so x = 10 will only grow chains from ceilings wi > Search script examples for [grow_poles](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=grow_poles) -#### nil grow_poles([LAYER](#LAYER) l, int max_lengh, [AABB](#AABB) area, bool destroy_broken) +#### nil grow_poles([LAYER](#LAYER) l, int max_length, [AABB](#AABB) area, bool destroy_broken) -#### nil grow_poles([LAYER](#LAYER) l, int max_lengh) +#### nil grow_poles([LAYER](#LAYER) l, int max_length) Grow pole from `GROWABLE_CLIMBING_POLE` entities in a level, `area` default is whole level, `destroy_broken` default is false @@ -1664,9 +1664,9 @@ Grow pole from `GROWABLE_CLIMBING_POLE` entities in a level, `area` default is w > Search script examples for [grow_vines](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=grow_vines) -#### nil grow_vines([LAYER](#LAYER) l, int max_lengh, [AABB](#AABB) area, bool destroy_broken) +#### nil grow_vines([LAYER](#LAYER) l, int max_length, [AABB](#AABB) area, bool destroy_broken) -#### nil grow_vines([LAYER](#LAYER) l, int max_lengh) +#### nil grow_vines([LAYER](#LAYER) l, int max_length) Grow vines from `GROWABLE_VINE` and `VINE_TREE_TOP` entities in a level, `area` default is whole level, `destroy_broken` default is false @@ -2030,7 +2030,7 @@ Setting to false disables all player logic in [SCREEN](#SCREEN).LEVEL, mainly th #### nil set_liquid_layer([LAYER](#LAYER) l) 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) ### set_seed @@ -2172,7 +2172,7 @@ Open or close the journal as if pressing the journal button. Will respect visibl #### float two_lines_angle([Vec2](#Vec2) A, [Vec2](#Vec2) common, [Vec2](#Vec2) B) -Mesures angle between two lines with one common point +Measures angle between two lines with one common point #### float two_lines_angle([Vec2](#Vec2) line1_A, [Vec2](#Vec2) line1_B, [Vec2](#Vec2) line2_A, [Vec2](#Vec2) line2_B) @@ -2297,7 +2297,7 @@ Refreshes an [Illumination](#Illumination), keeps it from fading out (updates th #### nil console_prinspect(variadic_args objects) -Prinspect to ingame console. +Prinspect to in-game console. ### console_print @@ -2306,7 +2306,7 @@ Prinspect to ingame console. #### nil console_print(string message) -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. ### log_print @@ -2839,7 +2839,7 @@ Get the current set zoom level #### bool position_is_valid(float x, float y, [LAYER](#LAYER) layer, [POS_TYPE](#POS_TYPE) flags) -Check if position satifies the given [POS_TYPE](#POS_TYPE) flags, to be used in a custom is_valid function procedural for spawns. +Check if position satisfies the given [POS_TYPE](#POS_TYPE) flags, to be used in a custom is_valid function procedural for spawns. ### screen_aabb @@ -3172,7 +3172,7 @@ The function `bool is_valid(float x, float y, LAYER layer)` determines whether t 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. ### define_procedural_spawn @@ -3421,7 +3421,7 @@ If you want to respawn a player that is a ghost, set in his [Inventory](#Invento #### int spawn_playerghost([ENT_TYPE](#ENT_TYPE) char_type, float x, float y, [LAYER](#LAYER) layer) -Spawn the [PlayerGhost](#PlayerGhost) entity, it will not move and not be connected to any player, you can then use [steal_input](#steal_input) and send_input to controll it +Spawn the [PlayerGhost](#PlayerGhost) entity, it will not move and not be connected to any player, you can then use [steal_input](#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 ### spawn_tree @@ -3466,7 +3466,7 @@ This is better alternative to `add_string` but instead of changing the name for #### [STRINGID](#Aliases) add_string(string str) -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](#EntityDB)->description) Returns [STRINGID](#Aliases) of the new string ### change_string @@ -3540,7 +3540,7 @@ Same as `Player.get_short_name` #### string get_string([STRINGID](#Aliases) string_id) -Get string behind [STRINGID](#Aliases), don't use stringid diretcly for vanilla string, use [hash_to_stringid](#hash_to_stringid) first +Get string behind [STRINGID](#Aliases), don't use stringid directly for vanilla string, use [hash_to_stringid](#hash_to_stringid) first Will return the string of currently choosen language ### hash_to_stringid diff --git a/docs/src/includes/_types.md b/docs/src/includes/_types.md index ebdf84372..07f01d775 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 @@ -746,7 +746,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 @@ -909,7 +909,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` @@ -1071,7 +1071,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) | @@ -1409,7 +1409,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 @@ -1995,7 +1995,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 @@ -3127,12 +3127,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 @@ -3167,7 +3167,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) | @@ -3396,7 +3396,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. @@ -3500,8 +3500,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 @@ -3577,7 +3577,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) @@ -3854,7 +3854,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) | @@ -4250,7 +4250,7 @@ nil | [set_invisible(bool value)](https://github.com/spelunky-fyi/overlunky/sear 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 @@ -4502,7 +4502,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 @@ -4657,7 +4657,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 @@ -5096,7 +5096,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) | @@ -5148,7 +5148,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 @@ -5528,8 +5528,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 @@ -5598,7 +5598,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 @@ -5689,7 +5689,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 @@ -6903,7 +6903,7 @@ bool | [can_jump()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=can nil | [collect_treasure(int value, ENT_TYPE treasure)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=collect_treasure) | Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure. bool | [is_on_fire()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=is_on_fire) | bool | [damage(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, damage_dealer should break 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/bucket.cpp b/src/game_api/bucket.cpp index 85dc2c585..6fb10e4f6 100644 --- a/src/game_api/bucket.cpp +++ b/src/game_api/bucket.cpp @@ -34,7 +34,7 @@ void PauseAPI::set_pause(PAUSE_TYPE flags) state->pause = (uint8_t)(((uint32_t)flags) & 0x3f); } -bool PauseAPI::check_trigger(PAUSE_TRIGGER& trigger, PAUSE_SCREEN& screen) +bool PauseAPI::check_trigger(PAUSE_TRIGGER& trigger, PAUSE_SCREEN& screen) const { bool match = false; auto state = State::get().ptr(); diff --git a/src/game_api/bucket.hpp b/src/game_api/bucket.hpp index 0331448db..66d5dd9d6 100644 --- a/src/game_api/bucket.hpp +++ b/src/game_api/bucket.hpp @@ -138,7 +138,7 @@ struct PauseAPI set_pause(pause); } bool event(PAUSE_TYPE event); - bool check_trigger(PAUSE_TRIGGER& trigger, PAUSE_SCREEN& screen); + bool check_trigger(PAUSE_TRIGGER& trigger, PAUSE_SCREEN& screen) const; void pre_loop() { blocked = false; diff --git a/src/game_api/color.hpp b/src/game_api/color.hpp index adebbd022..dc8177194 100644 --- a/src/game_api/color.hpp +++ b/src/game_api/color.hpp @@ -9,7 +9,7 @@ /// 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 uColor get_color(const std::string& color_name, std::optional alpha = std::nullopt); diff --git a/src/game_api/crc32.hpp b/src/game_api/crc32.hpp index 00902d852..057dca2fb 100644 --- a/src/game_api/crc32.hpp +++ b/src/game_api/crc32.hpp @@ -34,7 +34,7 @@ /* order from highest-order term to lowest-order term. UARTs transmit */ /* characters in order from LSB to MSB. By storing the CRC this way, */ /* we hand it to the UART in the order low-byte to high-byte; the UART */ -/* sends each low-bit to hight-bit; and the result is transmission bit */ +/* sends each low-bit to high-bit; and the result is transmission bit */ /* by bit from highest- to lowest-order term without requiring any bit */ /* shuffling on our part. Reception works similarly. */ diff --git a/src/game_api/drops.cpp b/src/game_api/drops.cpp index f5bfb94b9..2085fead0 100644 --- a/src/game_api/drops.cpp +++ b/src/game_api/drops.cpp @@ -124,7 +124,7 @@ std::vector drop_entries{ {"FACTORY_GENERATOR_SCRAP", "\x48\x89\xF9\xBA\xE6\x01\x00\x00"sv, VTABLE_OFFSET::NONE, 0, 4}, /// Keep in mind that shopkeeper generator spawns two types of entities, the second one will be this + 1 {"SHOPKEEPER_GENERATOR_1", "\x81\xCA\x10\x01\x00\x00\x4C\x89\xE1"sv, VTABLE_OFFSET::NONE, 0, 2}, - /* set conditional bp on load_item for spider, break some scrap until you hit bp, execute return, you will see spaider id right above the spawn function + /* set conditional bp on load_item for spider, break some scrap until you hit bp, execute return, you will see spider id right above the spawn function * scroll up to find the same pattern but for snake * just above the snake you can find cobra and scorpion id, with jump to the spawn function after snake * little higher up, same thing for alien */ @@ -163,7 +163,7 @@ std::vector drop_entries{ {"QUILLBACK_COOKEDTURKEY", "\xBA\x06\x02\x00\x00"sv, VTABLE_OFFSET::MONS_CAVEMAN_BOSS, 3, 1}, {"LAVAPOT_MAGMAMAN", "\xBA\xEF\x00\x00\x00"sv, VTABLE_OFFSET::ITEM_LAVAPOT, 3, 1}, /// Always spawns 5 of them - {"LAVAMANDER_RUBY", "\xBA\xF4\x01\x00\x00"sv, VTABLE_OFFSET::MONS_LAVAMANDER, 3, 1}, // 41 80 FE 05 - 05 ammount + {"LAVAMANDER_RUBY", "\xBA\xF4\x01\x00\x00"sv, VTABLE_OFFSET::MONS_LAVAMANDER, 3, 1}, // 41 80 FE 05 - 05 amount {"CATMUMMY_DIAMOND", "\xBA\xF1\x01\x00\x00"sv, VTABLE_OFFSET::MONS_CATMUMMY, 3, 1}, /// Has to be ENT_TYPE_CHAR_* {"HUMPHEAD_HIREDHAND", "\xC7\x44\x24\x20\xD7\x00\x00\x00"sv, VTABLE_OFFSET::MONS_GIANTFISH, 3, 4}, @@ -180,7 +180,7 @@ std::vector drop_entries{ {"CRUSHTRAP_NUGGET", "\xBA\xF5\x01\x00\x00"sv, VTABLE_OFFSET::ACTIVEFLOOR_CRUSH_TRAP_LARGE, 3, 1}, /// COG {"SLIDINGWALL_NUGGET", "\xBA\xF5\x01\x00\x00"sv, VTABLE_OFFSET::ACTIVEFLOOR_SLIDINGWALL, 3, 1}, - /// Can sapwn this + 5 (for NUGGET_SMALL) + /// Can spawn this + 5 (for NUGGET_SMALL) {"EMBED_NUGGET", "\x81\xC2\xF5\x01\x00\x00"sv, VTABLE_OFFSET::EMBED_GOLD, 3, 2}, /// Can be +1 for SAPPHIRE_SMALL {"CHEST_SMALLEMERALD", "\xBA\xF7\x01\x00\x00"sv, VTABLE_OFFSET::ITEM_CHEST, 3, 1}, @@ -306,9 +306,9 @@ std::vector drop_entries{ {"KAPALA_HEALTH", "\xBA\x01\x00\x00\x00\xB8\x01"sv, VTABLE_OFFSET::NONE, 0, 1}, /* can't do elixir as there are some calculations for cursed, poisoned etc. can't do pet, it has some complex calculation for some reason - can't do ankh, made a separete function for that (see modify_ankh_health_gain) + can't do ankh, made a separate function for that (see modify_ankh_health_gain) can't do initial health (camp, level, duat, coffin) as it's a word/byte - can't do drops for: humphead, yetiking, yetiqueen, alien queen, pangxie (gems) those are stored in array, need special funciton for that + can't do drops for: humphead, yetiking, yetiqueen, alien queen, pangxie (gems) those are stored in array, need special function for that */ /// maybe TODO: if someone wants all the explosions (from damage/death/crush), could also be added diff --git a/src/game_api/entities_activefloors.hpp b/src/game_api/entities_activefloors.hpp index 975354d81..c5b14d447 100644 --- a/src/game_api/entities_activefloors.hpp +++ b/src/game_api/entities_activefloors.hpp @@ -75,7 +75,7 @@ class PushBlock : public Movable class BoneBlock : public Movable { public: - float unknown1; // 1.0 when hited from left and -1.0 when hited from right + float unknown1; // 1.0 when whipped from left and -1.0 when whipped from right }; class ChainedPushBlock : public PushBlock diff --git a/src/game_api/entities_backgrounds.hpp b/src/game_api/entities_backgrounds.hpp index 697934239..1b4d6d99f 100644 --- a/src/game_api/entities_backgrounds.hpp +++ b/src/game_api/entities_backgrounds.hpp @@ -72,7 +72,7 @@ class BGShootingStar : public BGRelativeElement float light_size; // UNSURE if you make it the same as size it starts to flicker, making this bigger increases the size as well }; -class BGShopEntrence : public Entity +class BGShopEntrance : public Entity { public: bool on_entering; diff --git a/src/game_api/entities_chars.hpp b/src/game_api/entities_chars.hpp index 38935fe66..5abbd9e4e 100644 --- a/src/game_api/entities_chars.hpp +++ b/src/game_api/entities_chars.hpp @@ -37,7 +37,7 @@ class Ai int16_t unknown11b; int32_t timer; /// AI state (patrol, sleep, attack, aggro...) - int8_t state; // 8 = HH agro + int8_t state; // 8 = HH aggro int8_t last_state; /// Levels completed with, 0..3 uint8_t trust; @@ -45,7 +45,7 @@ class Ai uint8_t whipped; int8_t unknown15; int8_t unknown16; - /// positive: walking, negative: wating/idle + /// positive: walking, negative: waiting/idle int16_t walk_pause_timer; int16_t unknown19; int16_t unknown20; // distance to target? @@ -95,10 +95,10 @@ class PowerupCapable : public Movable /// Returns the uid of the currently worn backitem, or -1 if wearing nothing int32_t worn_backitem(); - // thoes could be wrong becous of the update + // those could be wrong because of the update virtual void on_blood_collision() = 0; // only triggers when player has kapala - // called for stunned entities, check bounch of stuff like state, hold entity, standing on entity etc. runs until returned 1 + // called for stunned entities, check bunch of stuff like state, hold entity, standing on entity etc. runs until returned 1 // this is used to clear the last_owner of stunned entity when it is no longed stunned virtual bool can_clear_last_owner() = 0; }; diff --git a/src/game_api/entities_decorations.hpp b/src/game_api/entities_decorations.hpp index 538cf52c6..043cab627 100644 --- a/src/game_api/entities_decorations.hpp +++ b/src/game_api/entities_decorations.hpp @@ -27,14 +27,14 @@ class DecoRegeneratingBlock : public Entity public: int8_t unknown1; uint8_t unknown2; // timer after self_destruct is triggered, modifies the size depending of the unknown1 - bool self_destruct; // UNSURE have reverse effect of spawning in after the broke is blocken, unsued in the game? + bool self_destruct; // UNSURE have reverse effect of spawning in after the block is broken, unused in the game? }; class DestructibleBG : public Entity { public: - int32_t attached_to_1; // wierd, unsure - int32_t attached_to_2; // wierd, unsure + int32_t attached_to_1; // weird, unsure + int32_t attached_to_2; // weird, unsure bool unknown1; bool unknown2; }; diff --git a/src/game_api/entities_floors.cpp b/src/game_api/entities_floors.cpp index 4f36ea021..4523c5129 100644 --- a/src/game_api/entities_floors.cpp +++ b/src/game_api/entities_floors.cpp @@ -735,7 +735,7 @@ void ForceField::activate_laserbeam(bool turn_on) void Door::unlock(bool unlock) { // TODO: DOOR_EGGSHIP, DOOR_EGGSHIP_ATREZZO, DOOR_EGGSHIP_ROOM, HUNDUN ? - static const ENT_TYPE entrence_door = to_id("ENT_TYPE_FLOOR_DOOR_ENTRANCE"); + static const ENT_TYPE entrance_door = to_id("ENT_TYPE_FLOOR_DOOR_ENTRANCE"); static const ENT_TYPE locked_door = to_id("ENT_TYPE_FLOOR_DOOR_LOCKED"); static const ENT_TYPE COG_door = to_id("ENT_TYPE_FLOOR_DOOR_COG"); static const ENT_TYPE eggchild_room_door = to_id("ENT_TYPE_FLOOR_DOOR_MOAI_STATUE"); @@ -757,7 +757,7 @@ void Door::unlock(bool unlock) door_ent->set_invisible(false); } } - else if (ent_type == EW_door || (ent_type >= entrence_door && ent_type < locked_door)) + else if (ent_type == EW_door || (ent_type >= entrance_door && ent_type < locked_door)) { if (unlock) { @@ -768,8 +768,8 @@ void Door::unlock(bool unlock) this->flags &= ~0x80000; // clr flag 20 (Enable button prompt) } - // entrence, exit, starting exit - if (ent_type == entrence_door || ent_type == entrence_door + 1 || ent_type == entrence_door + 3) + // entrance, exit, starting exit + if (ent_type == entrance_door || ent_type == entrance_door + 1 || ent_type == entrance_door + 3) { static const ENT_TYPE door_bg = to_id("ENT_TYPE_BG_DOOR"); const auto entities = state.layer(this->layer)->get_entities_overlapping_grid_at(x, y); @@ -792,7 +792,7 @@ void Door::unlock(bool unlock) } } } - else if (ent_type == entrence_door + 2) // main exit + else if (ent_type == entrance_door + 2) // main exit { static const ENT_TYPE fx_maindoor = to_id("ENT_TYPE_FX_MAIN_EXIT_DOOR"); static const ENT_TYPE door_bg_large = to_id("ENT_TYPE_BG_DOOR_LARGE"); @@ -804,7 +804,7 @@ void Door::unlock(bool unlock) if (main_door->door_blocker->type->id == fx_maindoor) { main_door->door_blocker->as()->move_state = 5; // this will kill it - main_door->door_blocker = nullptr; // unlock the door, but the backgound still stays + main_door->door_blocker = nullptr; // unlock the door, but the background still stays } else { diff --git a/src/game_api/entities_floors.hpp b/src/game_api/entities_floors.hpp index 89a25dcbc..d2fc85270 100644 --- a/src/game_api/entities_floors.hpp +++ b/src/game_api/entities_floors.hpp @@ -48,7 +48,7 @@ class Floor : public Entity void fix_border_tile_animation(); /// 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_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. void fix_decorations(bool fix_also_neighbors, bool fix_styled_floor); /// Explicitly add a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. @@ -84,7 +84,7 @@ class Door : public Floor /// Lock/Unlock doors void unlock(bool unlock); - // this function doesnt do much, checks if it's CHAR_*, checks if hes holding anything (if yes calls some function), then checks if Player.can_use is equal to 4 calls some other function + // this function doesn't do much, checks if it's CHAR_*, checks if hes holding anything (if yes calls some function), then checks if Player.can_use is equal to 4 calls some other function // can't be bother to look into the functions virtual void on_enter_attempt(Entity* who) = 0; diff --git a/src/game_api/entities_items.hpp b/src/game_api/entities_items.hpp index b4e24d141..cfc8676f0 100644 --- a/src/game_api/entities_items.hpp +++ b/src/game_api/entities_items.hpp @@ -79,7 +79,7 @@ class Cape : public Backpack uint32_t floating_count; // it's per level, not per cape // clear particle? called when using backpack.trigger_explosion when the cape is about to disappear - // it's a common funciton + // it's a common function virtual void v100(size_t unknown) = 0; }; @@ -106,7 +106,7 @@ class Mattock : public Purchasable }; class Gun : public Purchasable -{ // BIG NOTE: scepter is not a Purchasable, but that's the only Gun that isn't so i din't bother to make new type for it +{ // BIG NOTE: scepter is not a Purchasable, but that's the only Gun that isn't so i didn't bother to make new type for it public: uint8_t cooldown; /// used only for webgun @@ -269,7 +269,7 @@ class ScepterShot : public LightEmitter float speed; /// short timer before it goes after target uint16_t idle_timer; - int16_t unknown; // setting it low or high can make it last forever, won't matter if you change it back afterwards, anubis is 300 and player 400 by default + int16_t unknown; // setting it low or high can make it last forever, won't matter if you change it back afterwards, Anubis is 300 and player 400 by default }; class SpecialShot : public LightEmitter @@ -630,7 +630,7 @@ class SkullDropTrap : public Movable class FrozenLiquid : public Movable { public: - int32_t unknown1; // have problem cheeking those, looks like unused memory, but then, it's always zeros on spawn, changing it can crash the game + int32_t unknown1; // have problem checking those, looks like unused memory, but then, it's always zeros on spawn, changing it can crash the game int32_t unknown2; }; diff --git a/src/game_api/entities_logical.hpp b/src/game_api/entities_logical.hpp index 4be0598cd..802a601af 100644 --- a/src/game_api/entities_logical.hpp +++ b/src/game_api/entities_logical.hpp @@ -77,7 +77,7 @@ class LogicalTrapTrigger : public Entity class JungleTrapTrigger : public LogicalTrapTrigger { public: - int32_t counter1; // one of those wierd counters that counts all the traps, not only this single one + int32_t counter1; // one of those weird counters that counts all the traps, not only this single one int32_t counter2; // also there are 3 of them? int32_t counter3; }; @@ -174,8 +174,8 @@ class LimbAnchor : public Entity float y_pos; float hand_feet_x_offset; float hand_feet_y_offset; - float x_unk5; // all of those are offsets/positions of different joints, i'm too lazy to document thme all - float y_unk6; // if anywa wants to, go ahed + float x_unk5; // all of those are offsets/positions of different joints, i'm too lazy to document them all + float y_unk6; // if anyone wants to, go ahead float x_unk7; float y_unk8; float x_unk9; @@ -278,7 +278,7 @@ class EggplantThrower : public Entity class LogicalMiniGame : public Entity { public: - /// Delay between spwning ufo + /// Delay between spawning ufo uint16_t timer; }; diff --git a/src/game_api/entities_monsters.hpp b/src/game_api/entities_monsters.hpp index 06f73b161..a3b9fe63e 100644 --- a/src/game_api/entities_monsters.hpp +++ b/src/game_api/entities_monsters.hpp @@ -42,9 +42,9 @@ class RoomOwner : public Monster uint16_t countdown_timer; // counts down to 0 when a value is forced uint8_t unknown1; bool is_patrolling; // to set off a shopkeeper, combine this with state.shoppie_aggro_levels > 0 - /// setting this makes him angry, if it's shopkeeper you get 2 agrro points + /// setting this makes him angry, if it's shopkeeper you get 2 aggro points bool aggro_trigger; - /// also is set true if you set aggro to true, get's trigger even when whiping + /// also is set true if you set aggro to true, get's trigger even when whipping bool was_hurt; uint16_t padding1; uint32_t padding2; @@ -103,7 +103,7 @@ class NPC : public Monster virtual void on_criminal_act_committed() = 0; virtual bool should_attack_on_sight() = 0; - virtual void v_103() = 0; // take some struct as parameter, sets the first qword to some constant (also returns it?), the first thing in the struct is acutally two floats + virtual void v_103() = 0; // take some struct as parameter, sets the first qword to some constant (also returns it?), the first thing in the struct is actually two floats virtual void on_interaction() = 0; // does the quests stuff etc. virtual Entity* on_spawn_weapon() = 0; virtual ENT_TYPE weapon_type() = 0; @@ -207,10 +207,10 @@ class Spider : public Monster uint8_t jump_timer; uint8_t padding1; uint16_t padding2; - /// only in the x coord + /// only in the x coordinate float trigger_distance; - virtual void spawn_offset_related() = 0; // disabling this function makes the spider spawn in wierd position + virtual void spawn_offset_related() = 0; // disabling this function makes the spider spawn in weird position virtual float v_102() = 0; // for spider returns 0.02, for giant spider 0.025, game does some calculations with this when triggered by player virtual bool on_ceiling() = 0; }; @@ -451,7 +451,7 @@ class Mummy : public Monster class VanHorsing : public NPC { public: - /// if set to true, he will say 'i've been hunting this fiend a long time!' when on screen + /// if set to true, he will say "I've been hunting this fiend a long time!" when on screen bool show_text; /// one way door message has been shown bool special_message_shown; @@ -517,9 +517,9 @@ class Octopus : public WalkingMonster class Bodyguard : public NPC { public: - /// 0 - none, 1 - Tusk dice shop, 2 - Entrence to pleasure palace, 3 - Basement entrance to pleasure palace + /// 0 - none, 1 - Tusk dice shop, 2 - Entrance to pleasure palace, 3 - Basement entrance to pleasure palace uint8_t position_state; - bool message_shown; // entrence and basement entrence + bool message_shown; // entrance and basement entrance }; class Fish : public Monster @@ -567,7 +567,7 @@ class Kingu : public Monster uint16_t climb_pause_timer; uint8_t shell_invincibility_timer; uint8_t monster_spawn_timer; - /// excalibur wipes out immediately, bombs take off 11 points, when 0 vulnerable to whip + /// Excalibur wipes out immediately, bombs take off 11 points, when 0 vulnerable to whip uint8_t initial_shell_health; bool player_seen_by_kingu; // unsure if correct }; @@ -578,7 +578,7 @@ class Anubis : public Monster float spawn_x; float spawn_y; float unknown1; - float attack_proximity_y; // how close you have to be to be attacked; set both to 0 for a pet anubis + float attack_proximity_y; // how close you have to be to be attacked; set both to 0 for a pet Anubis float attack_proximity_x; uint8_t ai_timer; uint8_t next_attack_timer; @@ -942,7 +942,7 @@ class Hundun : public Monster class HundunHead : public Monster { public: - /// Posiotion where the head will move on attack + /// Position where the head will move on attack float attack_position_x; float attack_position_y; int32_t egg_crack_effect_uid; @@ -1010,7 +1010,7 @@ class ProtoShopkeeper : public Monster uint8_t padding2; uint8_t blowup_related; uint32_t animation_timer; - uint16_t walk_pause_explode_timer; // alternates between walking and pausing; when stunned: crawl timer; after crawling: head pulse timer (pulse frequency dependend on timer) + uint16_t walk_pause_explode_timer; // alternates between walking and pausing; when stunned: crawl timer; after crawling: head pulse timer (pulse frequency depended on timer) /// 0 = slow, 4 = fast uint8_t walking_speed; uint8_t padding7; diff --git a/src/game_api/entity.hpp b/src/game_api/entity.hpp index 7e3954c08..28ae26e13 100644 --- a/src/game_api/entity.hpp +++ b/src/game_api/entity.hpp @@ -228,7 +228,7 @@ class Entity /// 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 void kill_recursive(bool destroy_corpse, Entity* responsible, std::optional mask, const std::vector ent_types, RECURSIVE_MODE rec_mode); /// Short for using RECURSIVE_MODE.NONE void kill_recursive(bool destroy_corpse, Entity* responsible) @@ -260,7 +260,7 @@ class Entity inline static std::function)> hook_dtor_impl{}; inline static std::function clear_dtor_impl{}; - virtual ~Entity() = 0; // vritual 0 + virtual ~Entity() = 0; // virtual 0 virtual void create_rendering_info() = 0; // 1 virtual void handle_state_machine() = 0; // 2 @@ -290,13 +290,13 @@ class Entity virtual void set_as_sound_source(SoundMeta*) = 0; // 20, update sound position to entity position? virtual void remove_item_ptr(Entity*) = 0; // 21 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", tiggers use self as the first parameter + 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 /// 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) virtual bool trigger_action(Entity* user) = 0; // 24 /// 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 - virtual void on_collision2(Entity* other_entity) = 0; // 26, needs investigating, difference between this and on_collision1, maybe this is on_hitbox_overlap as it works for logical tiggers + virtual void on_collision2(Entity* other_entity) = 0; // 26, needs investigating, difference between this and on_collision1, maybe this is on_hitbox_overlap as it works for logical triggers /// e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred) virtual uint16_t get_metadata() = 0; // 27 diff --git a/src/game_api/entity_lookup.cpp b/src/game_api/entity_lookup.cpp index 776067628..dfcb2a354 100644 --- a/src/game_api/entity_lookup.cpp +++ b/src/game_api/entity_lookup.cpp @@ -121,7 +121,7 @@ std::vector get_entities_by(std::vector entity_types, uint32 { if (mask == 0) // all entities { - // this exception for small improvments with calling reserve once + // this exception for small improvements with calling reserve once found.reserve(found.size() + (size_t)layer_front->all_entities.size + (size_t)layer_back->all_entities.size); found.insert(found.end(), layer_front->all_entities.uids().begin(), layer_front->all_entities.uids().end()); found.insert(found.end(), layer_back->all_entities.uids().begin(), layer_back->all_entities.uids().end()); diff --git a/src/game_api/flags.hpp b/src/game_api/flags.hpp index f0da45489..4c85c464a 100644 --- a/src/game_api/flags.hpp +++ b/src/game_api/flags.hpp @@ -41,7 +41,7 @@ std::array themes_short{ std::array entity_flags{ "Invisible", - "Indestructable/special floor", + "Indestructible/special floor", "Solid (wall)", "Passes through objects", "Passes through everything", diff --git a/src/game_api/game_manager.hpp b/src/game_api/game_manager.hpp index 2bedc2944..0ac64c11b 100644 --- a/src/game_api/game_manager.hpp +++ b/src/game_api/game_manager.hpp @@ -70,7 +70,7 @@ struct BackgroundMusic uint8_t unknown18; uint8_t unknown19; uint8_t padding_probably; - std::array unknown21; // They continously go from 1 to 0 and back as a one big table, from first one to the last one, each change is one tick counted by the unknown22 + std::array unknown21; // They continuously go from 1 to 0 and back as a one big table, from first one to the last one, each change is one tick counted by the unknown22 float idle_counter; // counts down at the start of a level, then reacts to the player movement controls uint32_t unknown22; // some timer (counts continuously) }; @@ -155,7 +155,7 @@ struct GameProps // uint32_t padding_probably4; size_t* unknown16; - size_t unknwon17; + size_t unknown17; std::array unknown18; // counts time or something? only active when the game window is active when there is a player choosen? int32_t unknown19; int32_t unknown20; // -1 @@ -176,7 +176,7 @@ struct GameManager std::array buttons_movement; GameProps* game_props; - // screen pointers below are most likely in an array and indexed through the screen ID, hence the nullptrs for + // screen pointers below are most likely in an array and indexed through the screen ID, hence the nullptr for // screens that are available in State ScreenLogo* screen_logo; ScreenIntro* screen_intro; diff --git a/src/game_api/game_patches.cpp b/src/game_api/game_patches.cpp index ffd6763a4..3d666c0d2 100644 --- a/src/game_api/game_patches.cpp +++ b/src/game_api/game_patches.cpp @@ -22,8 +22,8 @@ void patch_orbs_limit() /* * The idea: we nuke jump instruction and some nop's after it * in new code we check if the number of orbs is greater than 3 - * if yes we set it as 3 (2 becouse of 0 - 2 range) - * we jump back to the place of oryginal jump + * if yes we set it as 3 (2 because of 0 - 2 range) + * we jump back to the place of original jump */ static bool once = false; if (once) @@ -31,7 +31,7 @@ void patch_orbs_limit() auto& memory = Memory::get(); const auto function_offset = get_virtual_function_address(VTABLE_OFFSET::ITEM_FLOATING_ORB, (uint32_t)VIRT_FUNC::ENTITY_KILL); - // finding exit of the loop that counts orbs, after jump there is unused code so we have enogh space for a our patch + // finding exit of the loop that counts orbs, after jump there is unused code so we have enough space for a our patch auto instance = find_inst(memory.exe(), "\xF3\x75"sv, function_offset, function_offset + 0x622, "patch_orbs_limit"); auto offset = memory.at_exe(instance) + 3; @@ -86,7 +86,7 @@ void patch_olmec_kill_crash() { // find address to escape to size_t rva = offset - memory.exe_address(); - // below the patched code there are two jumps that performe long jump, at the end of it there is 'mov rax,qword ptr ds:[rdi]', + // below the patched code there are two jumps that performs long jump, at the end of it there is 'mov rax,qword ptr ds:[rdi]', // from this point find jump that's jumps over sond meta and fmod stuff, the jump ends up on code `mov eax,dword ptr ss:[rbp+10]`, that's our target for return_addr auto jump_out_lookup = find_inst(memory.exe(), "\x48\xC7\x40\x60\x00\x00\x00\x00"sv, rva, rva + 0x69D, "patch_olmec_kill_crash"); if (jump_out_lookup == 0) @@ -96,7 +96,7 @@ void patch_olmec_kill_crash() } /* The idea: - * if it's not the end of the array it's looking for olmec, jump back to the oryginal code via jump in `new_code` + * if it's not the end of the array it's looking for olmec, jump back to the original code via jump in `new_code` * if it's end of the array (no olmec found) jump to return_addr * the place for return_addr was kind of choosen by feel, as the code is complicated * the whole point of the patched code is to find olmec and check it's faze, maybe for the music? no idea, it's a big function @@ -297,7 +297,7 @@ void set_skip_tiamat_cutscene(bool skip) void patch_ushabti_error() { - // nops MessageBoxA("Number of generated Ushabti statues isn't 100!") + // nop's MessageBoxA("Number of generated Ushabti statues isn't 100!") static bool once = false; if (once) return; diff --git a/src/game_api/items.hpp b/src/game_api/items.hpp index faab1c302..421466dce 100644 --- a/src/game_api/items.hpp +++ b/src/game_api/items.hpp @@ -40,14 +40,14 @@ struct Inventory uint8_t saved_pets_count; int8_t player_slot; - /// Used to transfer information to transition/next level (player rading a mout). Is not updated during a level + /// 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 ENT_TYPE mount_type; /// 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 + /// 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 int16_t mount_metadata; - int16_t unknown_mount_ralated; // unsure, can be padding as well + int16_t unknown_mount_related; // unsure, can be padding as well /// Types of gold/gems collected during this level, used later to display during the transition std::array collected_money; @@ -76,7 +76,7 @@ struct Inventory /// (0..3) 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 std::array companion_trust; - /// Number of companions, it will determinate how many companions will be transfered to next level + /// 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 uint8_t companion_count; /// Used to transfer information to transition/next level. Is not updated during a level diff --git a/src/game_api/layer.hpp b/src/game_api/layer.hpp index 45786f86b..19bc54067 100644 --- a/src/game_api/layer.hpp +++ b/src/game_api/layer.hpp @@ -141,7 +141,7 @@ struct Layer std::map entities_by_mask; // key is the mask - // 4x4 block areas (the edge ones extend to infinity?), each probably contains diffrent mask entities + // 4x4 block areas (the edge ones extend to infinity?), each probably contains different mask entities EntityList entities_by_region1[31][21]; EntityList entities_by_region2[31][21]; // Active floors ? EntityList entities_by_region3[31][21]; @@ -171,13 +171,9 @@ struct Layer // uint32_t unknown17; Entity* spawn_entity(ENT_TYPE id, float x, float y, bool screen, float vx, float vy, bool snap); - Entity* spawn_entity_snap_to_floor(ENT_TYPE id, float x, float y); - Entity* spawn_entity_over(ENT_TYPE id, Entity* overlay, float x, float y); - Entity* spawn_door(float x, float y, uint8_t w, uint8_t l, uint8_t t); - Entity* spawn_apep(float x, float y, bool right); Entity* get_grid_entity_at(float x, float y) const; diff --git a/src/game_api/level_api.cpp b/src/game_api/level_api.cpp index 0cec46932..eb5fc5ddc 100644 --- a/src/game_api/level_api.cpp +++ b/src/game_api/level_api.cpp @@ -2118,7 +2118,7 @@ void force_co_subtheme(COSUBTHEME subtheme) } } -void grow_vines(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) +void grow_vines(LAYER l, uint32_t max_length, AABB area, bool destroy_broken) { area.abs(); @@ -2148,7 +2148,7 @@ void grow_vines(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) if (end_y == 0) end_y = g_level_max_y - (state->h * 8 + 6); - if (end_y >= g_level_max_y) // in case of overflow when someone puts wierd state->h value + if (end_y >= g_level_max_y) // in case of overflow when someone puts weird state->h value end_y = 0; for (uint32_t i_x = start_x; i_x <= end_x; ++i_x) @@ -2174,7 +2174,7 @@ void grow_vines(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) } --i_y; int32_t last_uid = -1; - const int max = (i_y - (int)max_lengh) < 0 ? 0 : i_y - max_lengh; + const int max = (i_y - (int)max_length) < 0 ? 0 : i_y - max_length; for (; i_y > max && (i_y - 1) >= 0; --i_y) { if (state->layers[actual_layer]->grid_entities[i_y - 1][i_x] != nullptr) @@ -2192,11 +2192,11 @@ void grow_vines(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) } if (l == LAYER::BOTH) { - grow_vines(LAYER::BACK, max_lengh, area, destroy_broken); + grow_vines(LAYER::BACK, max_length, area, destroy_broken); } } -void grow_poles(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) +void grow_poles(LAYER l, uint32_t max_length, AABB area, bool destroy_broken) { area.abs(); @@ -2225,7 +2225,7 @@ void grow_poles(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) if (start_y == 0) start_y = g_level_max_y - (state->h * 8 + 6); - if (start_y >= g_level_max_y) // in case of overflow when someone puts wierd state->h value + if (start_y >= g_level_max_y) // in case of overflow when someone puts weird state->h value start_y = 0; for (uint32_t i_x = start_x; i_x <= end_x; ++i_x) @@ -2254,7 +2254,7 @@ void grow_poles(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) ++i_y; int32_t last_uid = -1; - for (uint32_t max = i_y + max_lengh; i_y < max && (i_y + 1) < g_level_max_y; ++i_y) + for (uint32_t max = i_y + max_length; i_y < max && (i_y + 1) < g_level_max_y; ++i_y) { if (state->layers[actual_layer]->grid_entities[i_y + 1][i_x] != nullptr) { @@ -2271,7 +2271,7 @@ void grow_poles(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken) } if (l == LAYER::BOTH) { - grow_poles(LAYER::BACK, max_lengh, area, destroy_broken); + grow_poles(LAYER::BACK, max_length, area, destroy_broken); } } diff --git a/src/game_api/level_api.hpp b/src/game_api/level_api.hpp index ce2fd40e4..ef38e9c66 100644 --- a/src/game_api/level_api.hpp +++ b/src/game_api/level_api.hpp @@ -425,7 +425,7 @@ class ThemeInfo /// Spawns specific extra entities and decorations, like gold key, seaweed, lanterns, banners, signs, wires... virtual void spawn_extra() = 0; - /// Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarb in dark levels etc.) + /// Spawns a single procedural entity, used in spawn_procedural (mostly monsters, scarab in dark levels etc.) virtual void do_procedural_spawn(SpawnInfo* info) = 0; uint32_t get_aux_id() const; @@ -447,7 +447,7 @@ class SpecialLevelGeneration public: virtual ~SpecialLevelGeneration(){}; - // For bees, sets rooms to be behive rooms. + // For bees, sets rooms to be beehive rooms. virtual void set_rooms() = 0; // For bees, spawns the hive background and midbgs. @@ -455,7 +455,7 @@ class SpecialLevelGeneration // For bees, spawns bees and honey. // For leprechauns, spawns leprechaun, pot of gold, and rainbow. - virtual void procedual_spawns() = 0; + virtual void procedural_spawns() = 0; }; enum class SHOP_TYPE : uint8_t @@ -617,16 +617,16 @@ using COSUBTHEME = int8_t; // NoAlias COSUBTHEME get_co_subtheme(); void force_co_subtheme(COSUBTHEME subtheme); -void grow_vines(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken); -inline void grow_vines(LAYER l, uint32_t max_lengh) +void grow_vines(LAYER l, uint32_t max_length, AABB area, bool destroy_broken); +inline void grow_vines(LAYER l, uint32_t max_length) { - grow_vines(l, max_lengh, {0, 0, 0, 0}, false); + grow_vines(l, max_length, {0, 0, 0, 0}, false); } -void grow_poles(LAYER l, uint32_t max_lengh, AABB area, bool destroy_broken); -inline void grow_poles(LAYER l, uint32_t max_lengh) +void grow_poles(LAYER l, uint32_t max_length, AABB area, bool destroy_broken); +inline void grow_poles(LAYER l, uint32_t max_length) { - grow_poles(l, max_lengh, {0, 0, 0, 0}, false); + grow_poles(l, max_length, {0, 0, 0, 0}, false); } bool grow_chain_and_blocks(); diff --git a/src/game_api/math.cpp b/src/game_api/math.cpp index ff430de1f..c10b7dbb1 100644 --- a/src/game_api/math.cpp +++ b/src/game_api/math.cpp @@ -2,8 +2,8 @@ bool Triangle::is_point_inside(const Vec2 p, float epsilon) const noexcept { - // you can compare it eather by area or by angle - // not sure if one if faster thne the order, so i left code for both + // you can compare it either by area or by angle + // not sure if one if faster then the order, so i left code for both // float area1 = Triangle(A, B, p).area(); // float area2 = Triangle(A, C, p).area(); diff --git a/src/game_api/math.hpp b/src/game_api/math.hpp index 90a80d278..b63536609 100644 --- a/src/game_api/math.hpp +++ b/src/game_api/math.hpp @@ -38,7 +38,7 @@ struct Vec2 { return rotate(angle, p.x, p.y); } - /// Just simple pythagoras theorem + /// Just simple Pythagoras theorem float distance_to(const Vec2 other) const noexcept { auto diff{*this - other}; @@ -484,7 +484,7 @@ struct Quad && top_left_x == 0 && top_left_y == 0 && top_right_x == 0 && top_right_y == 0; } - /// Rotates a Quad by an angle, px/py are not offsets, use `:get_AABB():center()` to get approximated center for simetrical quadrangle + /// Rotates a Quad by an angle, px/py are not offsets, use `:get_AABB():center()` to get approximated center for symmetrical quadrangle Quad& rotate(float angle, float px, float py) { const float sin_a{std::sin(angle)}; @@ -578,7 +578,7 @@ struct Quad /// Find intersection point of two lines [A, B] and [C, D], returns INFINITY if the lines don't intersect each other [parallel] Vec2 intersection(const Vec2 A, const Vec2 B, const Vec2 C, const Vec2 D) noexcept; -/// Mesures angle between two lines with one common point +/// Measures angle between two lines with one common point float two_lines_angle(const Vec2 A, const Vec2 common, const Vec2 B) noexcept; /// Gets line1_A, intersection point and line2_B and calls the 3 parameter version of this function diff --git a/src/game_api/memory.cpp b/src/game_api/memory.cpp index 9ac738c5e..cac29720a 100644 --- a/src/game_api/memory.cpp +++ b/src/game_api/memory.cpp @@ -101,7 +101,7 @@ LPVOID alloc_mem_rel32(size_t addr, size_t size) size_t test_addr = addr + 0x10000; // dunno why, without this it can get address that is more than 32bit away - if (test_addr <= INT32_MAX) // redunded check as you probably won't get address that is less than INT32_MAX from "zero" + if (test_addr <= INT32_MAX) // redundant check as you probably won't get address that is less than INT32_MAX from "zero" test_addr = 0x1000; // but i did it just in case so you can't get overflow else test_addr -= INT32_MAX; @@ -180,7 +180,7 @@ void recover_mem(std::string name, size_t addr) } } // else - // DEBUG("Warning: (recover_mem) tried to recover non existing memeory named: {}", name); + // DEBUG("Warning: (recover_mem) tried to recover non existing memory named: {}", name); } bool mem_written(std::string name) diff --git a/src/game_api/memory.hpp b/src/game_api/memory.hpp index 55fcb5892..2ead4a9a1 100644 --- a/src/game_api/memory.hpp +++ b/src/game_api/memory.hpp @@ -86,7 +86,7 @@ void write_mem_prot(size_t addr, std::string_view payload, bool prot); void write_mem_prot(size_t addr, std::string payload, bool prot); void write_mem(size_t addr, std::string payload); size_t function_start(size_t off, uint8_t outside_byte = '\xcc'); -// save copy of the oryginal memory so it can be later recovered via recover_mem +// save copy of the original memory so it can be later recovered via recover_mem void save_mem_recoverable(std::string name, size_t addr, size_t size, bool prot); void write_mem_recoverable(std::string name, size_t addr, std::string_view payload, bool prot); void recover_mem(std::string name, size_t addr = NULL); @@ -94,8 +94,8 @@ bool mem_written(std::string name); std::string get_nop(size_t size, bool true_nop = false); // similar to ExecutableMemory but writes automatic jump from and back, moves the code it replaces etc. -// it needs at least 5 bytes to move, use just_nop = true to nuke the oryginal code -// make sure that the first 5 bytes are not a destination for some jump (it's fine if it's exacly at the addr) +// it needs at least 5 bytes to move, use just_nop = true to nuke the original code +// make sure that the first 5 bytes are not a destination for some jump (it's fine if it's exactly at the addr) size_t patch_and_redirect(size_t addr, size_t replace_size, std::string_view payload, bool just_nop = false, size_t return_to_addr = 0, bool game_code_first = true); template diff --git a/src/game_api/movable.hpp b/src/game_api/movable.hpp index df6706c31..f985fe68a 100644 --- a/src/game_api/movable.hpp +++ b/src/game_api/movable.hpp @@ -130,9 +130,9 @@ class Movable : public Entity // don't use this, it's only to not break backwards compatibility void light_on_fire_broken() { - this->light_on_fire(0x64); // kind of stanrad value that the game uses + this->light_on_fire(0x64); // kind of standard value that the game uses } - /// Get all avaible behavior ids + /// Get all available behavior ids std::vector get_all_behaviors(); /// 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 @@ -163,7 +163,7 @@ class Movable : public Entity virtual float sprint_factor() = 0; // 39 virtual void calculate_jump_height() = 0; // 40, when disabled, jump height is very high virtual std::unordered_map& get_animation_map() = 0; // 41 - virtual void apply_velocity(Vec2* velocities, bool) = 0; // 42, param is pointer to an array of two floats: velocity x and y, could be returninig something + virtual void apply_velocity(Vec2* velocities, bool) = 0; // 42, param is pointer to an array of two floats: velocity x and y, could be returning something /// Returns stomp damage based on shoes and fall time virtual int8_t stomp_damage() = 0; // 43, calculates the amount of stomp damage applied (checks spike shoes, movable.state and stand_counter resulting in different damage values) virtual int8_t stomp_damage_trampoline() = 0; // 44, simply jumps to the 43rd virtual function, aka stomp_damage... diff --git a/src/game_api/particles.hpp b/src/game_api/particles.hpp index a3b4d8ded..27f7d384a 100644 --- a/src/game_api/particles.hpp +++ b/src/game_api/particles.hpp @@ -194,7 +194,7 @@ struct EmittedParticlesInfo } Particle back() { - return (*this)[particle_count - 1]; + return (*this)[particle_count - 1]; // TODO particle_count can be 0 } const Particle front() const { @@ -202,7 +202,7 @@ struct EmittedParticlesInfo } const Particle back() const { - return (*this)[particle_count - 1]; + return (*this)[particle_count - 1]; // TODO particle_count can be 0 } bool empty() const noexcept diff --git a/src/game_api/render_api.hpp b/src/game_api/render_api.hpp index 0ccd13c10..7269b8acf 100644 --- a/src/game_api/render_api.hpp +++ b/src/game_api/render_api.hpp @@ -30,7 +30,7 @@ using VANILLA_FONT_STYLE = uint32_t; enum JOURNAL_VFTABLE { // to get those offsets, find "vftable_JournalPages" then go to each page in journal, then to it's first vtable function address - // and calculate offset diference + // and calculate offset difference PROGRESS = 496, // open journal: page 0 or die, journal: page 2 MENU = 448, // open journal: page 1 PLACES = 672, // open journal > Places: any page > 1 @@ -129,12 +129,12 @@ struct TextRenderingInfo void set_text(const std::u16string text, float x, float y, float scale_x, float scale_y, uint32_t alignment, uint32_t fontstyle); void set_text(const std::string text, float x, float y, float scale_x, float scale_y, uint32_t alignment, uint32_t fontstyle); - /// Returns refrence to the letter coordinates relative to the x,y position + /// Returns reference to the letter coordinates relative to the x,y position std::span get_dest() { return {dest, (dest + text_length)}; } - /// Returns refrence to the letter coordinates in the texture + /// Returns reference to the letter coordinates in the texture std::span get_source() { return {source, (source + text_length)}; @@ -170,7 +170,7 @@ struct TextRenderingInfo float x; float y; - /// You can also just use `#` operator on the whole TextRenderingInfo to get the text lenght + /// You can also just use `#` operator on the whole TextRenderingInfo to get the text length uint32_t text_length; float width; float height; @@ -178,14 +178,14 @@ struct TextRenderingInfo Letter* dest{nullptr}; Letter* source{nullptr}; - // 6 * text_length, just numbers in order 0, 1, 2 ... have some strage effect if you change them + // 6 * text_length, just numbers in order 0, 1, 2 ... have some strange effect if you change them uint16_t* unknown6{nullptr}; uint16_t nof_special_character; // number of special characters, still not sure how the game knows which ones are the special ones? // setting higher value than the `text_length` will crash uint16_t unknown8; // padding probably - /// Used to draw buttons and stuff, default is -1 wich uses the buttons texture + /// Used to draw buttons and stuff, default is -1 which uses the buttons texture TEXTURE special_texture_id; uint8_t shader; // ? changing it can change the text color, or make the text all rectangles? @@ -201,7 +201,7 @@ struct TextureRenderingInfo float x{0}; float y{0}; - /// destination is relative to the x,y centerpoint + /// destination is relative to the x,y center point float destination_bottom_left_x{0}; float destination_bottom_left_y{0}; float destination_bottom_right_x{0}; @@ -313,8 +313,8 @@ struct RenderInfo float tileh; float x_dupe3; float y_dupe3; - float x_dupe4; // this will be writen into x next refresh - float y_dupe4; // this will be writen into y next refresh + float x_dupe4; // this will be written into x next refresh + float y_dupe4; // this will be written into y next refresh float angle1; float angle2; float angle_related; @@ -412,10 +412,10 @@ static_assert(sizeof(HudInventory) == 176); struct HudElement { /// Hide background and dim if using the auto adjust setting. - bool dim; // it acutally 3 states: 0 - bright, 1 - dim, anything above - hide completely + bool dim; // it's actually 3 states: 0 - bright, 1 - dim, anything above - hide completely /// Background will be drawn if this is not 0.5 float opacity; - /// Level time when element should dim again after hilighted, INT_MAX if dimmed on auto adjust. 0 on opaque. + /// Level time when element should dim again after highlighted, INT_MAX if dimmed on auto adjust. 0 on opaque. int32_t time_dim; // it's set to INT_MAX after it was dimmed }; diff --git a/src/game_api/rpc.cpp b/src/game_api/rpc.cpp index caa4df5de..767d9438e 100644 --- a/src/game_api/rpc.cpp +++ b/src/game_api/rpc.cpp @@ -925,7 +925,7 @@ void change_sunchallenge_spawns(std::vector ent_types) static uintptr_t new_code_address; if (offset == 0) { - offset = get_address("sun_chalenge_generator_ent_types"); + offset = get_address("sun_challenge_generator_ent_types"); // just so we can recover the oryginal later save_mem_recoverable("sunchallenge_spawn", offset, 14, true); @@ -1254,7 +1254,7 @@ void add_item_to_shop(int32_t item_uid, int32_t shop_owner_uid) { auto state = State::get().ptr(); item->flags = setflag(item->flags, 23); // shop item - item->flags = setflag(item->flags, 20); // Enable button prompt (flag is problably: show dialogs and other fx) + item->flags = setflag(item->flags, 20); // Enable button prompt (flag is probably: show dialogs and other fx) state->layers[item->layer]->spawn_entity_over(to_id("ENT_TYPE_FX_SALEICON"), item, 0, 0); state->layers[item->layer]->spawn_entity_over(to_id("ENT_TYPE_FX_SALEDIALOG_CONTAINER"), item, 0, 0.5); @@ -1572,7 +1572,7 @@ void activate_hundun_hack(bool activate) offsets[0] = 0; return; } - offsets[5] += 9; // instruction size (din't include the whole thing in pattern, very short distance from previous pattern) + offsets[5] += 9; // instruction size (didn't include the whole thing in pattern, very short distance from previous pattern) offsets[0] = memory.at_exe(offsets[0]); offsets[1] = memory.at_exe(offsets[1]); @@ -1783,7 +1783,7 @@ void set_level_logic_enabled(bool enable) void set_camera_layer_control_enabled(bool enable) { - static const size_t offset = get_address("camera_layer_controll"); + static const size_t offset = get_address("camera_layer_control"); static const size_t offset2 = get_address("player_behavior_layer_switch"); if (enable) @@ -2020,7 +2020,7 @@ void set_liquid_layer(LAYER l) jumps[0] = get_address("layer_check_in_add_liquid_collision"); jumps[1] = get_address("layer_check_in_remove_liquid_collision"); - jumps[2] = get_address("is_entity_in_liquid_check"); // TODO there is also layer offset nerby, test if it's related + jumps[2] = get_address("is_entity_in_liquid_check"); // TODO there is also layer offset nearby, test if it's related jumps[3] = get_address("liquid_render_layer"); jumps[4] = get_address("entity_in_liquid_detection1"); jumps[5] = get_address("entity_in_liquid_detection2"); diff --git a/src/game_api/screen.hpp b/src/game_api/screen.hpp index ce71c790d..d8517594a 100644 --- a/src/game_api/screen.hpp +++ b/src/game_api/screen.hpp @@ -154,7 +154,7 @@ struct MenuOption STRINGID option_name; float y_position; float brigthness; // 1.0 for selected item, 0 for non selected - bool enabled; // only visual thing, locks brigthness at 0 + bool enabled; // only visual thing, locks brightness at 0 // uint8_t padding_probably[3] OptionSelect* select; // called as soon as you hit enter on the selected option @@ -350,7 +350,7 @@ class ScreenOptions : public Screen // ID: 5 /// Shows the red background behind the option, the scarab on the left and left/right arrows bool show_highlight; // uint8_t padding_probably8[5]; - custom_vector unknown50; // holds one 8 byte value, related to choosen opion menu + custom_vector unknown50; // holds one 8 byte value, related to choosen option menu uint8_t unknown51; // probably bool // padding_probably10[7]; custom_vector tooltip_text; @@ -520,7 +520,7 @@ class ScreenCharacterSelect : public Screen // ID: 9 float blackout_transparency; bool start_pressed; bool transition_to_game_started; - bool disable_buttons; /* unsure */ // hides the buttons on the enrances and disables control (without setting the bool below) + bool disable_buttons; /* unsure */ // hides the buttons on the entrances and disables control (without setting the bool below) bool disable_controls; uint32_t unknown72; @@ -757,7 +757,7 @@ class ScreenOnlineLoading : public Screen // ID: 28 struct OnlineLobbyScreenPlayer { /// 16 = PC, 17 = Discord, 18 = Steam, 19 = Xbox, 32 = switch, 48 = PS, 49 = PS again? - uint8_t platform_icon; // werid numbers, anything else results in the startd PC icon, maybe it's some actual id + uint8_t platform_icon; // weird numbers, anything else results in the standard PC icon, maybe it's some actual id /// 0 - Ana Spelunky, 1 - Margaret Tunnel, 2 - Colin Northward, 3 - Roffy D. Sloth.. and so on. Same order as in ENT_TYPE uint8_t character; bool ready; @@ -816,7 +816,7 @@ class ScreenOnlineLobby : public Screen // ID: 29 uint32_t unknown53; // can't put ScreenEnterOnlineCode here as it's abstract class - // no idea how the game code apperently allows this, unless this is some compiler opimaization bullshit + // no idea how the game code apparently allows this, unless this is some compiler optimization bullshit size_t screen_code_input; }; @@ -833,7 +833,7 @@ struct MenuInsert float unknown8; uint32_t unknown9; float unknown10; - std::vector unknown11; // menu options, probably just a bunch of floats, suprisingly it's not TextRenderingInfo + std::vector unknown11; // menu options, probably just a bunch of floats, surprisingly it's not TextRenderingInfo size_t* unknown12; size_t* unknown13; // function uint32_t selected_menu_index; @@ -1065,10 +1065,10 @@ struct JournalUI // uint8_t padding_probably1[3]; - /// 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)) + /// 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)) custom_vector pages; - custom_vector pages_tmp; // pages are constructed in the show_journal function and put here, later transfered to the pages vector + custom_vector pages_tmp; // pages are constructed in the show_journal function and put here, later transferred to the pages vector uint32_t current_page; uint32_t flipping_to_page; uint32_t unknown10; diff --git a/src/game_api/screen_arena.hpp b/src/game_api/screen_arena.hpp index 7079169c0..02432311a 100644 --- a/src/game_api/screen_arena.hpp +++ b/src/game_api/screen_arena.hpp @@ -308,5 +308,5 @@ class ScreenArenaScore : public Screen // ID: 27 // uint32_t padding_probably; std::array particles; std::array lava_bubbles_positions; - std::array unknown45; // only used if one of the players win, probably the flying down confetti/featers + std::array unknown45; // only used if one of the players win, probably the flying down confetti/feathers }; diff --git a/src/game_api/script/lua_backend.hpp b/src/game_api/script/lua_backend.hpp index 54989b654..d0bef1f7a 100644 --- a/src/game_api/script/lua_backend.hpp +++ b/src/game_api/script/lua_backend.hpp @@ -65,7 +65,7 @@ enum class ON CONSTELLATION = 19, RECAP = 20, ARENA_MENU = 21, - ARENA_STAGES = 22, // selecting avaible stages for arena from the menu + ARENA_STAGES = 22, // selecting available stages for arena from the menu ARENA_ITEMS = 23, ARENA_SELECT = 24, // select arena before fight ARENA_INTRO = 25, diff --git a/src/game_api/script/lua_console.cpp b/src/game_api/script/lua_console.cpp index ef692d0ec..cad431057 100644 --- a/src/game_api/script/lua_console.cpp +++ b/src/game_api/script/lua_console.cpp @@ -1127,7 +1127,7 @@ std::string LuaConsole::dump_api() return api; } -unsigned int LuaConsole::get_input_lines() +unsigned int LuaConsole::get_input_lines() const { int num = 1; const char* str; diff --git a/src/game_api/script/lua_console.hpp b/src/game_api/script/lua_console.hpp index 3c268c4dc..8b06510b8 100644 --- a/src/game_api/script/lua_console.hpp +++ b/src/game_api/script/lua_console.hpp @@ -117,7 +117,7 @@ class LuaConsole : public LockableLuaBackend void push_history(std::string history_item, std::vector result_item); std::string dump_api(); - unsigned int get_input_lines(); + unsigned int get_input_lines() const; void set_geometry(float x, float y, float w, float h) { pos = ImVec2(x, y); diff --git a/src/game_api/script/lua_vm.cpp b/src/game_api/script/lua_vm.cpp index 19546ddfe..58b6bbd02 100644 --- a/src/game_api/script/lua_vm.cpp +++ b/src/game_api/script/lua_vm.cpp @@ -382,7 +382,7 @@ end backend->lua["lua_print"](message); }; - /// 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. lua["console_print"] = [&lua](std::string message) -> void { auto backend = LuaBackend::get_calling_backend(); @@ -399,7 +399,7 @@ end backend->console->push_history(fmt::format("--- [{}] at {:%Y-%m-%d %X}", backend->get_id(), time_buf), std::move(messages)); }; - /// Prinspect to ingame console. + /// Prinspect to in-game console. lua["console_prinspect"] = [&lua](sol::variadic_args objects) -> void { if (objects.size() > 0) @@ -918,12 +918,12 @@ end /// Spawn a player in given location, if player of that slot already exist it will spawn clone, the game may crash as this is very unexpected situation /// If you want to respawn a player that is a ghost, set in his Inventory `health` to above 0, and `time_of_death` to 0 and call this function, the ghost entity will be removed automatically lua["spawn_player"] = spawn_player; - /// Spawn the PlayerGhost entity, it will not move and not be connected to any player, you can then use [steal_input](#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](#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 lua["spawn_playerghost"] = spawn_playerghost; /// 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) lua["set_pre_entity_spawn"] = [](sol::function cb, SPAWN_TYPE flags, int mask, sol::variadic_args entity_types) -> CallbackId { @@ -1042,7 +1042,7 @@ end lua["get_type"] = get_type; /// Gets a grid entity, such as floor or spikes, at the given position and layer. lua["get_grid_entity_at"] = get_grid_entity_at; - /// Get uids of static entities overlaping this grid position (decorations, backgrounds etc.) + /// Get uids of static entities overlapping this grid position (decorations, backgrounds etc.) lua["get_entities_overlapping_grid"] = get_entities_overlapping_grid; /// Deprecated /// Use `get_entities_by(0, MASK.ANY, LAYER.BOTH)` instead @@ -1743,7 +1743,7 @@ end /// Check [strings00_hashed.str](https://github.com/spelunky-fyi/overlunky/blob/main/docs/game_data/strings00_hashed.str) for the hash values, or extract assets with modlunky and check those. lua["hash_to_stringid"] = hash_to_stringid; - /// Get string behind STRINGID, don't use stringid diretcly for vanilla string, use [hash_to_stringid](#hash_to_stringid) first + /// Get string behind STRINGID, don't use stringid directly for vanilla string, use [hash_to_stringid](#hash_to_stringid) first /// Will return the string of currently choosen language lua["get_string"] = get_string; @@ -1754,7 +1754,7 @@ end return change_string(id, str); }; - /// 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 lua["add_string"] = add_string; @@ -2148,7 +2148,7 @@ end static_cast(::add_custom_type)); /// 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 lua["add_custom_type"] = add_custom_type; auto get_entities_by_draw_depth = sol::overload( @@ -2267,7 +2267,7 @@ end lua["play_seeded"] = init_seeded; /// 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) lua["set_liquid_layer"] = set_liquid_layer; @@ -2665,7 +2665,7 @@ end // Params: JOURNALUI_PAGE_SHOWN chapter, array:int pages // Runs after the pages for the journal are prepared, but not yet displayed, `pages` is a list of page numbers that the game loaded, if you want to change it, do the changes (remove pages, add new ones, change order) and return it // All new pages will be created as [JournalPageStory](#JournalPageStory), any custom with page number above 9 will be empty, I recommend using above 99 to be sure not to get the game page, you can later use this to recognise and render your own stuff on that page in the RENDER_POST_JOURNAL_PAGE - // Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was aready loaded will result in the standard game page + // Return: return new page array to modify the journal, returning empty array or not returning anything will load the journal normally, any page number that was already loaded will result in the standard game page // When changing the order of game pages make sure that the page that normally is rendered on the left side is on the left in the new order, otherwise you get some messed up result, custom pages don't have this problem. The order is: left, right, left, right ... // PRE_GET_FEAT // Runs before getting performed status for a FEAT when rendering the Feats page in journal. @@ -2675,7 +2675,7 @@ end // Return: true to block the default behaviour of calling Steam SetAchievement. // PRE_UPDATE // Runs before the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS - // Return behavior: return true to stop futher PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine) + // Return behavior: return true to stop further PRE_UPDATE callbacks from executing and don't update the state (this will essentially freeze the game engine) // POST_UPDATE // Runs right after the State is updated, runs always (menu, settings, camp, game, arena, online etc.) with the game engine, typically 60FPS // SCRIPT_ENABLE @@ -2696,15 +2696,15 @@ end // Params: LAYER layer // Runs right after a layer has been created and you can start spawning entities in it. Runs in all screens that usually have entities, or when creating a layer manually. // PRE_LEVEL_DESTRUCTION - // Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last. + // Runs right before the current level is unloaded and any entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last. // POST_LEVEL_DESTRUCTION - // Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last. + // Runs right after the current level has been unloaded and all entities destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last. // PRE_LAYER_DESTRUCTION // Params: LAYER layer - // Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last. + // Runs right before a layer is unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last. // POST_LAYER_DESTRUCTION // Params: LAYER layer - // Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destoyed is in state.screen_last. + // Runs right after a layer has been unloaded and any entities there destroyed. Runs in pretty much all screens, even ones without entities. The screen has already changed at this point, meaning the screen being destroyed is in state.screen_last. // PRE_PROCESS_INPUT // Runs right before the game gets input from various devices and writes to a bunch of buttons-variables. Return true to disable all game input completely. // POST_PROCESS_INPUT diff --git a/src/game_api/script/usertypes/entities_backgrounds_lua.cpp b/src/game_api/script/usertypes/entities_backgrounds_lua.cpp index c6e060874..1ea8c62a5 100644 --- a/src/game_api/script/usertypes/entities_backgrounds_lua.cpp +++ b/src/game_api/script/usertypes/entities_backgrounds_lua.cpp @@ -24,7 +24,7 @@ void register_usertypes(sol::state& lua) lua["Entity"]["as_bgeggshiproom"] = &Entity::as; lua["Entity"]["as_bgbacklayerdoor"] = &Entity::as; lua["Entity"]["as_bgtutorialsign"] = &Entity::as; - lua["Entity"]["as_bgshopentrence"] = &Entity::as; + lua["Entity"]["as_bgshopentrance"] = &Entity::as; lua["Entity"]["as_bgfloatingdebris"] = &Entity::as; lua["Entity"]["as_bgshopkeeperprime"] = &Entity::as; @@ -114,10 +114,10 @@ void register_usertypes(sol::state& lua) sol::base_classes, sol::bases()); - lua.new_usertype( - "BGShopEntrence", + lua.new_usertype( + "BGShopEntrance", "on_entering", - &BGShopEntrence::on_entering, + &BGShopEntrance::on_entering, sol::base_classes, sol::bases()); diff --git a/src/game_api/script/usertypes/entities_items_lua.cpp b/src/game_api/script/usertypes/entities_items_lua.cpp index 8bd8a222b..73cd3b747 100644 --- a/src/game_api/script/usertypes/entities_items_lua.cpp +++ b/src/game_api/script/usertypes/entities_items_lua.cpp @@ -226,7 +226,7 @@ void register_usertypes(sol::state& lua) sol::bases()); /// NoDoc - lua.new_usertype( // left to not break compability + lua.new_usertype( // left to not break combability "WebGun", sol::base_classes, sol::bases()); diff --git a/src/game_api/script/usertypes/level_lua.cpp b/src/game_api/script/usertypes/level_lua.cpp index d52dcb06b..9ade948b6 100644 --- a/src/game_api/script/usertypes/level_lua.cpp +++ b/src/game_api/script/usertypes/level_lua.cpp @@ -992,7 +992,7 @@ void register_usertypes(sol::state& lua) /// Default function in spawn definitions to check whether a spawn is valid or not lua["default_spawn_is_valid"] = default_spawn_is_valid; - /// 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. lua["position_is_valid"] = position_is_valid; /// Add a callback for a specific tile code that is called before the game handles the tile code. @@ -1062,7 +1062,7 @@ void register_usertypes(sol::state& lua) /// 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. lua["define_extra_spawn"] = [](sol::function do_spawn, sol::function is_valid, std::uint32_t num_spawns_frontlayer, std::uint32_t num_spawns_backlayer) -> std::uint32_t { std::function is_valid_call{nullptr}; diff --git a/src/game_api/script/usertypes/socket_lua.cpp b/src/game_api/script/usertypes/socket_lua.cpp index 6cbe79be3..364c31ef6 100644 --- a/src/game_api/script/usertypes/socket_lua.cpp +++ b/src/game_api/script/usertypes/socket_lua.cpp @@ -19,7 +19,7 @@ void register_usertypes(sol::state& lua) /// The server will be closed once the handle is released. lua["udp_listen"] = [](std::string host, in_port_t port, sol::function cb) -> UdpServer* { - // TODO: change the return to std::unique_ptr after fixing the dead lock with the destroctor + // TODO: change the return to std::unique_ptr after fixing the dead lock with the destructor UdpServer* server = new UdpServer(std::move(host), std::move(port), make_safe_cb(std::move(cb))); return server; }; diff --git a/src/game_api/script/usertypes/state_lua.cpp b/src/game_api/script/usertypes/state_lua.cpp index 32d232fa8..d99677bff 100644 --- a/src/game_api/script/usertypes/state_lua.cpp +++ b/src/game_api/script/usertypes/state_lua.cpp @@ -436,7 +436,7 @@ void register_usertypes(sol::state& lua) "as_color", &LightParams::as_color); - /// 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, Player, PlayerGhost, BurningRopeEffect ... auto illumination_type = lua.new_usertype("Illumination"); illumination_type["lights"] = &Illumination::lights; diff --git a/src/game_api/script/usertypes/vanilla_render_lua.cpp b/src/game_api/script/usertypes/vanilla_render_lua.cpp index 5e5f4246f..655fc184a 100644 --- a/src/game_api/script/usertypes/vanilla_render_lua.cpp +++ b/src/game_api/script/usertypes/vanilla_render_lua.cpp @@ -147,7 +147,7 @@ Quad get_corner_quad(Quad& line1, Quad& line2) if (g_angle_style == CORNER_FINISH::NONE) return {}; // save the corners as Vec2 for easier calculations - // and calculate inner and outher corner, we don't know which is which at this point + // and calculate inner and outer corner, we don't know which is which at this point Vec2 A{line1.top_left_x, line1.top_left_y}; Vec2 B{line1.top_right_x, line1.top_right_y}; @@ -238,7 +238,7 @@ Quad get_line_quad(const Vec2 A, const Vec2 B, float thickness, bool world = fal float axis_AB_angle = std::atan2((B.y - A.y), (B.x) - (A.x)); float hypotenuse = (float)std::sqrt(std::pow(B.x - A.x, 2) + std::pow(B.y - A.y, 2)); - // make ractangle and then rotate it because i'm stupid + // make rectangle and then rotate it because i'm stupid Quad dest{AABB{A.x, A.y + thickness / 2, (A.x + hypotenuse), A.y - thickness / 2}}; dest.rotate(axis_AB_angle, A.x, A.y); return dest; @@ -726,7 +726,7 @@ void register_usertypes(sol::state& lua) lua.create_named_table("CORNER_FINISH", "NONE", CORNER_FINISH::NONE, "REAL", CORNER_FINISH::REAL, "CUT", CORNER_FINISH::CUT, "ADAPTIVE", CORNER_FINISH::ADAPTIVE); /* CORNER_FINISH // NONE - // Don't draw corner at all, will draw lines as separate pieces, overlaping etc. + // Don't draw corner at all, will draw lines as separate pieces, overlapping etc. // REAL // Draws a real corner, no matter how far away the "peak" of the corner may end up being // CUT @@ -861,7 +861,7 @@ void register_usertypes(sol::state& lua) // TEXTURE_ALPHA_COLOR // Renders a texture by interpreting its red channel as alpha and applying the given color // TEXTURE_COLOR - // The default shader to be used, just renders a texture with transparancy and the given color + // The default shader to be used, just renders a texture with transparency and the given color // TEXTURE_COLORS_WARP // Renders the texture, with "gamma correction" of the color channels and multiplying everything by the input color alpha only // DEFERRED_COLOR_TRANSPARENT diff --git a/src/game_api/script/usertypes/vanilla_render_lua.hpp b/src/game_api/script/usertypes/vanilla_render_lua.hpp index 88b9f412f..603eb0a29 100644 --- a/src/game_api/script/usertypes/vanilla_render_lua.hpp +++ b/src/game_api/script/usertypes/vanilla_render_lua.hpp @@ -41,7 +41,7 @@ class VanillaRenderContext /// `draw_text_size` works by creating new TextRenderingInfo just to call `:text_size()`, which is not very optimal std::pair draw_text_size(const std::string& text, float scale_x, float scale_y, uint32_t fontstyle); - /// Set the prefered way of drawing corners for the non filled shapes + /// Set the preferred way of drawing corners for the non filled shapes void set_corner_finish(CORNER_FINISH c); /// Draw a texture in screen coordinates from top-left to bottom-right using the built-in renderer @@ -52,7 +52,7 @@ class VanillaRenderContext /// Use in combination with ON.RENDER_✱_HUD/PAUSE_MENU/JOURNAL_PAGE events void draw_screen_texture(TEXTURE texture_id, uint8_t row, uint8_t column, const AABB& rect, Color color); - /// 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 void draw_screen_texture(TEXTURE texture_id, uint8_t row, uint8_t column, const AABB& rect, Color color, float angle, float px, float py); @@ -73,12 +73,12 @@ class VanillaRenderContext void draw_screen_line(const Vec2& A, const Vec2& B, float thickness, Color color); /// 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`) + /// `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 void draw_screen_rect(const AABB& rect, float thickness, Color color, std::optional angle, std::optional px, std::optional py); /// 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. + /// `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 void draw_screen_rect_filled(const AABB& rect, Color color, std::optional angle, std::optional px, std::optional py); @@ -118,7 +118,7 @@ class VanillaRenderContext /// For more control use the version taking a Quad instead void draw_world_texture(TEXTURE texture_id, uint8_t row, uint8_t column, const AABB& dest, Color color); - /// 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 void draw_world_texture(TEXTURE texture_id, uint8_t row, uint8_t column, const AABB& dest, Color color, float angle, float px, float py); @@ -146,12 +146,12 @@ class VanillaRenderContext void draw_world_line(const Vec2& A, const Vec2& B, float thickness, Color color); /// 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`) + /// `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 void draw_world_rect(const AABB& rect, float thickness, Color color, std::optional angle, std::optional px, std::optional py); /// 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. + /// `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 void draw_world_rect_filled(const AABB& rect, Color color, std::optional angle, std::optional px, std::optional py); diff --git a/src/game_api/search.cpp b/src/game_api/search.cpp index d9aca8745..98c7474a7 100644 --- a/src/game_api/search.cpp +++ b/src/game_api/search.cpp @@ -1240,7 +1240,7 @@ std::unordered_map g_address_rules{ }, { "insta_gib"sv, - // This should be just called/jumped to at the end of kill virtual fror the CHAR_* entity + // This should be just called/jumped to at the end of kill virtual for the CHAR_* entity // Put a write bp on player's Entity::flags, conditionally exclude the couple bp's it hits for just being in the level, // Or write bp on Movable::health, the next function after setting it to 0 should be this one // then die to a ghost @@ -1468,7 +1468,7 @@ std::unordered_map g_address_rules{ }, { "sparktrap_angle_increment"sv, - // Put a read bp on Spark:rotatnio_angle, the next instruction adds a hardcoded float from constant, we want address of that constant (not the whole instruction) + // Put a read bp on Spark:rotation_angle, the next instruction adds a hardcoded float from constant, we want address of that constant (not the whole instruction) PatternCommandBuffer{} .find_after_inst("\xF3\x0F\x10\x89\x58\x01\x00\x00"sv) .at_exe(), @@ -1596,7 +1596,7 @@ std::unordered_map g_address_rules{ }, { // Open the journal on any page and find references to its vftable pointer (look at page in game_manager.journal_ui.pages) - // scroll up to the top, find refrence to this address (each page is referenced two times, but the top of vtable is like 10 times) + // scroll up to the top, find reference to this address (each page is referenced two times, but the top of vtable is like 10 times) "vftable_JournalPages"sv, PatternCommandBuffer{} .find_inst("48 89 01 85 D2 74 08"_gh) @@ -1656,7 +1656,7 @@ std::unordered_map g_address_rules{ // execute to the return two times, you should see this array right above the call // It's pointer to array[4]: 0x000000F5 0x000000EB 0x000000FC 0x000000FA // we want the address to the `shift right` instruction since we gonna replace it all, but not mess with PRNG stuff - "sun_chalenge_generator_ent_types"sv, + "sun_challenge_generator_ent_types"sv, PatternCommandBuffer{} .find_inst("\x48\x89\x4A\x38\x48\xC1\xE8\x1C\x83\xE0"sv) .offset(0x4) @@ -1706,7 +1706,7 @@ std::unordered_map g_address_rules{ .function_start(), }, { - // Set conditional bp on load_item for KEY, execute til return, scroll up untill you find instruction writing const into r14 + // Set conditional bp on load_item for KEY, execute til return, scroll up until you find instruction writing const into r14 "waddler_drop_array"sv, PatternCommandBuffer{} .find_after_inst("\x45\x0F\x57\xDB\x4C\x8D\x35"sv) @@ -1894,7 +1894,7 @@ std::unordered_map g_address_rules{ .function_start(), }, { - // find string "%d-%d" go to it's address, look for refrences to that address, one will be inside the render hud funciton + // find string "%d-%d" go to it's address, look for references to that address, one will be inside the render hud function // we want the address of the offset (not whole instruction) "hud_level_text"sv, PatternCommandBuffer{} @@ -2035,7 +2035,7 @@ std::unordered_map g_address_rules{ }, { "hud"sv, - // you can get the address from the render_hud (first parameter), it's global/static, so just find good refrence to it + // you can get the address from the render_hud (first parameter), it's global/static, so just find good reference to it PatternCommandBuffer{} .find_after_inst("41 C6 47 6B 01"_gh) .find_inst("48 8D 0D"_gh) @@ -2068,7 +2068,7 @@ std::unordered_map g_address_rules{ //.from_exe_base(0x228b58f0), }, { - "camera_layer_controll"sv, + "camera_layer_control"sv, // overwrites state.camera_layer every frame PatternCommandBuffer{} .get_address("state_refresh"sv) @@ -2129,7 +2129,7 @@ std::unordered_map g_address_rules{ .from_exe_base(0x22e0d1d0) // TODO }, { - // look into spawn entity function when spawninig activefloor + // look into spawn entity function when spawning activefloor // or set break point on write to the activefloors map in state.liquid_physics.activefloors "add_movable_to_liquid_collision_map"sv, // jump PatternCommandBuffer{} @@ -2228,7 +2228,7 @@ std::unordered_map g_address_rules{ { // when he spews lava, go to hes current behavior, and to function `get_next_state_id` // then find a few writes to stack and then a function call - // one of those writes is byte [+0x50] with value 0 (presumbly layer? or bool that means check both layers?) + // one of those writes is byte [+0x50] with value 0 (presumably layer? or bool that means check both layers?) "lavamander_spewing_lava"sv, // layer byte or bool PatternCommandBuffer{} .from_exe_base(0x22A45F94), // code too generic to find anything unique @@ -2281,7 +2281,7 @@ std::unordered_map g_address_rules{ { // set bp on on_collision2 for plasma cannon (probably any entity works) // execute till return, when in state update function, above the call to the collision virtual should entity lookup - // with the useal stack set, one of the params is byte 0 which we want to edit + // with the usual stack set, one of the params is byte 0 which we want to edit "collision_mask_check_param"sv, // layer byte or bool PatternCommandBuffer{} .get_address("state_refresh") diff --git a/src/game_api/sound_manager.hpp b/src/game_api/sound_manager.hpp index bb59e0ef1..8c21fe4fc 100644 --- a/src/game_api/sound_manager.hpp +++ b/src/game_api/sound_manager.hpp @@ -285,7 +285,7 @@ struct SoundMeta virtual void get_name(char16_t* buffor, uint32_t size) = 0; virtual ~SoundMeta() = 0; virtual void update() = 0; // disabling this function does not progresses the track, does not stop it at the end level etc. - // like if you start a level you have one loop and then after you move, it porgresses to another one + // like if you start a level you have one loop and then after you move, it progresses to another one virtual bool unknown() = 0; }; diff --git a/src/game_api/state.hpp b/src/game_api/state.hpp index cd27820c4..4ff458190 100644 --- a/src/game_api/state.hpp +++ b/src/game_api/state.hpp @@ -221,7 +221,7 @@ struct StateMemory int32_t speechbubble_owner; Dialogue basecamp_dialogue; - // screen pointers below are most likely in an array and indexed through the screen ID (-10), hence the nullptrs for + // screen pointers below are most likely in an array and indexed through the screen ID (-10), hence the nullptr for // screens that are available in GameManager ScreenCharacterSelect* screen_character_select; /// For the arena diff --git a/src/game_api/state_structs.hpp b/src/game_api/state_structs.hpp index 376415265..dfccf900e 100644 --- a/src/game_api/state_structs.hpp +++ b/src/game_api/state_structs.hpp @@ -729,7 +729,7 @@ struct LiquidPhysicsEngine uint32_t allocated_size; uint32_t unk23; // padding probably std::list unk1; // seams to be empty, or have one element 0? - uint32_t resize_value; // used to resive the arrays? + uint32_t resize_value; // used to resize the arrays? uint32_t unk3b; // padding probably // this is actually a pre C++11 version of std::list, which is different from current one! @@ -749,7 +749,7 @@ struct LiquidPhysicsEngine Vec2* entity_velocities; // array int32_t unknown51a; // size related for the array above int32_t unknown51b; // padding - std::pair* unknown52; // not sure about the type, it's defenetly a 64bit + std::pair* unknown52; // not sure about the type, it's definitely a 64bit std::pair* unknown53; size_t unknown54; std::pair* unknown55; @@ -1038,7 +1038,7 @@ struct RoomOwnersInfo struct MultiLineTextRendering { size_t* timer; // some struct? game increments this value and one at +0x40, seam to be related to rendering, touching just the first one freezes the game - std::vector lines; // each line is separete TextRenderingInfo + std::vector lines; // each line is separate TextRenderingInfo float x; // center of the text box? float y; // center of the text box? }; diff --git a/src/injected/ui.cpp b/src/injected/ui.cpp index 0dc393db5..6ab0ac120 100644 --- a/src/injected/ui.cpp +++ b/src/injected/ui.cpp @@ -861,7 +861,7 @@ void refresh_script_files() } } - for (auto file : g_script_files) + for (auto& file : g_script_files) { load_script(file.wstring(), false); } @@ -990,7 +990,7 @@ void save_config(std::string file) std::vector ini_tabs_open; std::vector ini_tabs_detached; - for (auto [name, window] : windows) + for (auto& [name, window] : windows) { if (window->open) ini_tabs_open.push_back(name); @@ -1084,7 +1084,7 @@ void load_config(std::string file) kits.clear(); saved_entities.clear(); saved_entities = toml::find_or>(opts, "kits", {}); - for (auto saved : saved_entities) + for (auto& saved : saved_entities) { kits.push_back(new Kit({saved, false})); } @@ -1186,7 +1186,7 @@ bool toggle(std::string tool) } else if (options["menu_ui"]) { - for (auto [name, window] : windows) + for (auto& [name, window] : windows) window->popup = false; windows[tool]->popup = true; return true; @@ -1196,7 +1196,7 @@ bool toggle(std::string tool) ImGuiWindow* win = ImGui::FindWindowByName("Overlunky"); if (win) win->Collapsed = false; - for (auto window : windows) + for (auto& window : windows) { if (window.first == tool) { @@ -1350,7 +1350,7 @@ void smart_delete(Entity* ent, bool unsafe = false) void reset_windows() { - for (auto [name, window] : windows) + for (auto& [name, window] : windows) { window->detached = false; window->open = true; @@ -1628,7 +1628,7 @@ void spawn_entity_over() auto to_spawn = get_spawn_item(); if (to_spawn.has_value()) { - auto item = to_spawn.value(); + const auto& item = to_spawn.value(); if (item.name.find("ENT_TYPE_LIQUID") != std::string::npos) { auto cpos = UI::click_position(g_x, g_y); @@ -4979,7 +4979,7 @@ void render_messages() { g_ConsoleMessages.push_back(std::move(message)); } - for (auto message : g_ConsoleMessages) + for (auto& message : g_ConsoleMessages) { std::istringstream messages(message.message); while (!messages.eof()) @@ -5019,7 +5019,7 @@ void render_messages() } ImGui::SetWindowPos({base->Pos.x + 30.0f + 0.128f * base->Size.x * io.FontGlobalScale, base->Pos.y + base->Size.y - queue.size() * font_size - 40}); - for (auto message : queue) + for (const auto& message : queue) { float alpha = 1.0f - std::chrono::duration_cast(now - std::get<2>(message)).count() / 12000.0f; if (!options["fade_script_messages"]) @@ -6117,9 +6117,9 @@ void render_options() tooltip("Draw hitboxes for all movable and hovered entities. Also mouse tooltips.", "toggle_hitboxes"); ImGui::SameLine(); ImGui::Checkbox("interpolated##DrawRealBox", &options["draw_hitboxes_interpolated"]); - tooltip("Use interpolated render position for smoother hitboxes on hifps.\nActual game logic is not interpolated like this though."); + tooltip("Use interpolated render position for smoother hitboxes on high fps.\nActual game logic is not interpolated like this though."); ImGui::Checkbox("Draw hovered entity tooltip##DrawEntityTooltip", &options["draw_entity_tooltip"]); - tooltip("Draw entity names, uids and some random stuff for hovered entitites.", "toggle_entity_tooltip"); + tooltip("Draw entity names, uids and some random stuff for hovered entities.", "toggle_entity_tooltip"); ImGui::Checkbox("Draw all entity info##DrawEntityInfo", &options["draw_entity_info"]); tooltip("Draw entity names, uids and some random stuff next to all entities.", "toggle_entity_info"); ImGui::Checkbox("Draw gridlines##DrawTileGrid", &options["draw_grid"]); @@ -6490,7 +6490,7 @@ void render_script_files() { ImGui::PushID("files"); int num = 0; - for (auto file : g_script_files) + for (auto& file : g_script_files) { auto id = file.string(); std::replace(id.begin(), id.end(), '\\', '/'); @@ -6701,7 +6701,7 @@ void render_scripts() ImGui::PopID(); ImGui::PopID(); } - for (auto id : unload_scripts) + for (auto& id : unload_scripts) { auto it = g_scripts.find(id); if (it != g_scripts.end()) @@ -7002,7 +7002,7 @@ void render_savegame() ImGui::PushID("Feats"); if (submenu("Steam Achievements")) { - ImGui::Checkbox("I know what I'm doing, unlock editing!##EditAchiecements", &edit_achievements); + ImGui::Checkbox("I know what I'm doing, unlock editing!##EditAchievements", &edit_achievements); ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.3f, 0.3f, 1.0f)); ImGui::TextWrapped("Warning: Touching anything in here will edit your real Steam Achievements directly. If you're using the Steam emulator, this only affects the achievements saved in the emulator."); if (options["disable_achievements"]) @@ -8065,7 +8065,7 @@ void render_hotbar() else ImGui::PushStyleColor(ImGuiCol_Border, {0, 0, 0, 0.8f}); ImGui::PushID(i); - auto name = entity_names[hotbar[i]]; + std::string name = entity_names[hotbar[i]]; // std::replace(name.begin(), name.end(), '_', '\n'); name = name.substr(name.find_last_of('_') + 1); if (ImGui::Button(fmt::format("{} \n\n\n{}", i + 1, name).c_str(), {iconsize, iconsize})) @@ -8282,7 +8282,7 @@ void render_texture_viewer() if (draw_animations && ent && ent->get_texture() == texture_viewer.id) { std::map, int> overlap; - for (auto [id, anim] : ent->type->animations) + for (const auto& [id, anim] : ent->type->animations) { uint32_t x = def.sub_image_offset_x + def.tile_width * (anim.texture % (def.sub_image_width / def.tile_width)); uint32_t y = def.sub_image_offset_y + def.tile_height * (uint32_t)floor(anim.texture / (def.sub_image_height / def.tile_height)); @@ -8697,7 +8697,7 @@ void render_game_props() ImGui::RadioButton("Spawned in Castle##QuestHorsingVlad", &horsing_state, 3); ImGui::RadioButton("Shot Vlad##QuestHorsingVladShot", &horsing_state, 4); ImGui::RadioButton("Spawned in Temple##QuestHorsingTemple", &horsing_state, 5); - ImGui::RadioButton("Got alien compass##QuestHorsingComplass", &horsing_state, 6); + ImGui::RadioButton("Got alien compass##QuestHorsingCompass", &horsing_state, 6); ImGui::RadioButton("Palace basement ending##QuestHorsingTusk", &horsing_state, 7); g_state->quests->van_horsing_state = static_cast(horsing_state); endmenu(); @@ -8830,7 +8830,7 @@ void render_game_props() render_players(); ImGui::SeparatorText("Player inputs"); ImGui::PushID("PlayerInputIndex"); - for (unsigned int i = 0; i < 5; ++i) + for (uint8_t i = 0; i < 5; ++i) { ImGui::PushID(i); auto label = i < 4 ? fmt::format("Player {}##PlayerInput{}", i + 1, i) : "Menu?"; @@ -8908,7 +8908,7 @@ void render_game_props() { static auto hide_zero = true; ImGui::Checkbox("Hide 0% chances", &hide_zero); - static auto render_procedural_chance = [](uint32_t id, LevelChanceDef& def) + static auto render_procedural_chance = [](uint32_t id, const LevelChanceDef& def) { int inverse_chance = g_state->level_gen->get_procedural_spawn_chance(id); std::string name = std::string(g_state->level_gen->get_procedural_spawn_chance_name(id).value_or(fmt::format("{}", id))); @@ -8938,11 +8938,11 @@ void render_game_props() }; ImGui::SeparatorText("Monster chances"); - for (auto [id, def] : g_state->level_gen->data->level_monster_chances) + for (auto& [id, def] : g_state->level_gen->data->level_monster_chances) render_procedural_chance(id, def); ImGui::SeparatorText("Trap chances"); - for (auto [id, def] : g_state->level_gen->data->level_trap_chances) + for (auto& [id, def] : g_state->level_gen->data->level_trap_chances) render_procedural_chance(id, def); ImGui::SeparatorText("Level chances"); @@ -9379,7 +9379,7 @@ void render_prohud() } g_speedhack_ui_multiplier = UI::get_speedhack(); - auto io = ImGui::GetIO(); + const auto& io = ImGui::GetIO(); auto base = ImGui::GetMainViewport(); ImDrawList* dl = ImGui::GetBackgroundDrawList(base); auto topmargin = 0.0f; @@ -9660,7 +9660,7 @@ void imgui_draw() ImGui::PopStyleVar(); for (size_t i = 0; i < tab_order_main.size(); ++i) { - auto tab = tab_order_main[i]; + const auto& tab = tab_order_main[i]; if (windows[tab]->detached) continue; ImGui::SetNextWindowSizeConstraints({300.0f, 100.0f}, {500.0f, base->Size.y - 50.0f}); @@ -9686,7 +9686,7 @@ void imgui_draw() { for (size_t i = 0; i < tab_order_extra.size(); ++i) { - auto tab = tab_order_extra[i]; + const auto& tab = tab_order_extra[i]; if (ImGui::MenuItem(windows[tab]->name.c_str())) detach(tab); } @@ -9706,7 +9706,7 @@ void imgui_draw() { for (size_t i = 0; i < tab_order.size() - 5; ++i) { - auto tab = tab_order[i]; + const auto& tab = tab_order[i]; if (ImGui::MenuItem(windows[tab]->name.c_str(), key_string(keys[tab]).c_str())) { toggle(tab); @@ -9714,7 +9714,7 @@ void imgui_draw() } for (size_t i = 0; i < tab_order_extra.size(); ++i) { - auto tab = tab_order_extra[i]; + const auto& tab = tab_order_extra[i]; if (ImGui::MenuItem(windows[tab]->name.c_str(), key_string(keys[tab]).c_str())) { toggle(tab); @@ -9734,7 +9734,7 @@ void imgui_draw() ImGui::Separator(); for (size_t i = tab_order.size() - 4; i < tab_order.size(); ++i) { - auto tab = tab_order[i]; + const auto& tab = tab_order[i]; if (ImGui::MenuItem(windows[tab]->name.c_str(), key_string(keys[tab]).c_str())) { toggle(tab); @@ -9773,7 +9773,7 @@ void imgui_draw() if (ImGui::BeginTabBar("##TabBar")) { ImGuiTabItemFlags flags = 0; - for (auto tab : tab_order) + for (const auto& tab : tab_order) { flags = 0; if (activate_tab == tab) @@ -9799,7 +9799,7 @@ void imgui_draw() ImGui::EndTabBar(); } int tabnum = 0; - for (auto window : windows) + for (auto& window : windows) { if (window.second->open && !window.second->detached) ++tabnum; @@ -9809,7 +9809,7 @@ void imgui_draw() ImGui::TextWrapped("Looks like you closed all your tabs. Good thing we have a menubar now!"); if (ImGui::Button("Restore all tabs")) { - for (auto window : windows) + for (auto& window : windows) { window.second->open = true; } @@ -9817,7 +9817,7 @@ void imgui_draw() } ImGui::End(); } - for (auto tab : windows) + for (const auto& tab : windows) { if (!tab.second->detached) continue; @@ -9909,7 +9909,7 @@ void update_bucket() g_bucket->overlunky->selected_uids = g_selected_ids; g_bucket->overlunky->keys = keys; - for (auto [k, v] : g_bucket->overlunky->set_options) + for (const auto& [k, v] : g_bucket->overlunky->set_options) { if (!legal_options.contains(k)) continue; @@ -9973,7 +9973,7 @@ void update_bucket() } g_bucket->overlunky->set_options.clear(); - for (auto [k, v] : options) + for (auto& [k, v] : options) { g_bucket->overlunky->options[k] = options[k]; }