---@meta -- Generated by docs-digger from overlunky's sources: do not edit, regenerate. ---Axis-Aligned-Bounding-Box, represents for example a hitbox of an entity or the size of a gui element ---@class AABB ---@field bottom number ---@field left number ---@field right number ---@field top number AABB = {} ---Create a new axis aligned bounding box - defaults to all zeroes ---@return AABB ---@overload fun(other: AABB): AABB ---@overload fun(top_left: Vec2, bottom_right: Vec2): AABB ---@overload fun(left_: number, top_: number, right_: number, bottom_: number): AABB function AABB.new() end ---Fixes the AABB if any of the sides have negative length ---@return AABB function AABB:abs() end ---Compute area of the AABB, can be zero if one dimension is zero or negative if one dimension is inverted. ---@return number function AABB:area() end ---Short for `(aabb.left + aabb.right) / 2.0f, (aabb.top + aabb.bottom) / 2.0f`. ---@return number ---@return number function AABB:center() end ---Grows or shrinks the AABB by the given amount in all directions. ---If `amount < 0` and `abs(amount) > right/top - left/bottom` the respective dimension of the AABB will become `0`. ---@param amount number ---@return AABB ---@overload fun(self: AABB, amount_x: number, amount_y: number): AABB function AABB:extrude(amount) end ---Short for `aabb.top - aabb.bottom`. ---@return number function AABB:height() end ---Checks if point lies between left/right and top/bottom ---@param p Vec2 ---@return boolean ---@overload fun(self: AABB, x: number, y: number): boolean function AABB:is_point_inside(p) end ---Offsets the AABB by the given offset. ---@param off_x number ---@param off_y number ---@return AABB function AABB:offset(off_x, off_y) end ---@param other AABB ---@return boolean function AABB:overlaps_with(other) end ---@param other AABB ---@return AABB function AABB:set(other) end ---@return number ---@return number ---@return number ---@return number function AABB:split() end ---Short for `aabb.right - aabb.left`. ---@return number function AABB:width() end ---@class AcidBubble : Entity, Movable ---@field float_counter number ---@field speed_x number ---@field speed_y number AcidBubble = {} ---Used in Player ---@class Ai ---@field last_state integer ---@field state integer @AI state (patrol, sleep, attack, aggro...) ---@field target Entity|nil ---@field target_uid integer ---@field timer integer ---@field trust integer @Levels completed with, 0..3 ---@field walk_pause_timer integer @positive: walking, negative: waiting/idle ---@field whipped integer @Number of times whipped by player Ai = {} ---@class Alien : Entity, Movable, PowerupCapable, Monster ---@field jump_timer integer ---@field leg_shake_timer integer ---@field shudder_timer integer Alien = {} ---@class Altar : Entity, Floor ---@field timer integer @for normal altar: counts from 0 to 20 then 0, then 1 then 0 and sacrifice happens Altar = {} ---@class Ammit : Entity, Movable, PowerupCapable, Monster ---@field particle ParticleEmitterInfo|nil ---@field walk_pause_timer integer Ammit = {} ---Used in EntityDB ---@class Animation ---@field first_tile integer ---@field id integer ---@field interval integer ---@field num_tiles integer ---@field repeat_mode REPEAT_TYPE Animation = {} ---@class AnkhPowerup : Entity, Movable, Powerup ---@field fx_glow Entity|nil ---@field music_on_off boolean ---@field player Entity|nil ---@field sound SoundMeta|nil ---@field timer1 integer ---@field timer2 integer ---@field timer3 integer AnkhPowerup = {} ---@class Anubis : Entity, Movable, PowerupCapable, Monster ---@field ai_timer integer ---@field attack_proximity_x number ---@field attack_proximity_y number ---@field awake boolean ---@field next_attack_timer integer ---@field psychic_orbs_counter integer ---@field spawn_x number ---@field spawn_y number Anubis = {} ---@class ApepHead : Entity, Movable, PowerupCapable, Monster, ApepPart ---@field distance_traveled number ---@field fx_mouthpiece1_uid integer ---@field fx_mouthpiece2_uid integer ---@field sound1 SoundMeta|nil ---@field sound2 SoundMeta|nil ---@field tail_uid integer ApepHead = {} ---@class ApepPart : Entity, Movable, PowerupCapable, Monster ---@field sine_angle number ---@field sync_timer integer @or pause timer, used to sync the body parts moving up and down ---@field y_pos number ApepPart = {} ---Used in ArenaState ---@class ArenaConfigArenas ---@field dwelling_1 boolean ---@field dwelling_2 boolean ---@field dwelling_3 boolean ---@field dwelling_4 boolean ---@field dwelling_5 boolean ---@field icecaves_1 boolean ---@field icecaves_2 boolean ---@field icecaves_3 boolean ---@field icecaves_4 boolean ---@field icecaves_5 boolean ---@field jungle_1 boolean ---@field jungle_2 boolean ---@field jungle_3 boolean ---@field jungle_4 boolean ---@field jungle_5 boolean ---@field list boolean[] ---@field neobabylon_1 boolean ---@field neobabylon_2 boolean ---@field neobabylon_3 boolean ---@field neobabylon_4 boolean ---@field neobabylon_5 boolean ---@field sunkencity_1 boolean ---@field sunkencity_2 boolean ---@field sunkencity_3 boolean ---@field sunkencity_4 boolean ---@field sunkencity_5 boolean ---@field temple_1 boolean ---@field temple_2 boolean ---@field temple_3 boolean ---@field temple_4 boolean ---@field temple_5 boolean ---@field tidepool_1 boolean ---@field tidepool_2 boolean ---@field tidepool_3 boolean ---@field tidepool_4 boolean ---@field tidepool_5 boolean ---@field volcana_1 boolean ---@field volcana_2 boolean ---@field volcana_3 boolean ---@field volcana_4 boolean ---@field volcana_5 boolean ArenaConfigArenas = {} ---Used in ArenaState ---@class ArenaConfigEquippedItems ---@field climbing_gloves boolean ---@field kapala boolean ---@field parachute boolean ---@field paste boolean ---@field pitchers_mitt boolean ---@field scepter boolean ---@field spike_shoes boolean ---@field spring_shoes boolean ArenaConfigEquippedItems = {} ---Used in ArenaState ---@class ArenaConfigItems ---@field bombbag boolean ---@field bombbox boolean ---@field boomerang boolean ---@field camera boolean ---@field cape boolean ---@field climbing_gloves boolean ---@field cooked_turkey boolean ---@field crossbow boolean ---@field excalibur boolean ---@field freezeray boolean ---@field hoverpack boolean ---@field jetpack boolean ---@field kapala boolean ---@field machete boolean ---@field mattock boolean ---@field metal_shield boolean ---@field mine boolean ---@field parachute boolean ---@field paste boolean ---@field pickup_12bag boolean ---@field pickup_24bag boolean ---@field pitchers_mitt boolean ---@field plasma_cannon boolean ---@field pot boolean ---@field powerpack boolean ---@field rock boolean ---@field ropepile boolean ---@field royal_jelly boolean ---@field scepter boolean ---@field shotgun boolean ---@field snaptrap boolean ---@field spike_shoes boolean ---@field spring_shoes boolean ---@field telepack boolean ---@field teleporter boolean ---@field torch boolean ---@field true_crown boolean ---@field vlads_cape boolean ---@field webgun boolean ---@field wooden_shield boolean ArenaConfigItems = {} ---Used in StateMemory ---@class ArenaState ---@field arena_select integer ---@field arenas ArenaConfigArenas ---@field bombs integer ---@field breath_cooldown integer ---@field crate_frequency integer ---@field current_arena integer ---@field dark_level_chance integer ---@field equipped_backitem integer ---@field equipped_items ArenaConfigEquippedItems ---@field final_ghost boolean ---@field format integer ---@field health integer ---@field held_item integer ---@field items_enabled ArenaConfigItems ---@field items_in_crate ArenaConfigItems ---@field lives integer ---@field mount integer ---@field player_idolheld_countdown integer[] ---@field player_lives integer[] ---@field player_teams integer[] ---@field player_totalwins integer[] ---@field player_won boolean[] ---@field punish_ball boolean ---@field ropes integer ---@field ruleset integer ---@field stun_time integer ---@field time_to_win integer ---@field timer integer @The menu selection for timer, default values 0..20 where 0 == 30 seconds, 19 == 10 minutes and 20 == infinite. Can go higher, although this will glitch the menu text. Actual time (seconds) = (state.arena.timer + 1) x 30 ---@field timer_ending integer ---@field whip_damage integer ---@field wins integer ArenaState = {} ---@class Arrow : Entity, Movable, Purchasable ---@field flame_uid integer ---@field is_on_fire boolean ---@field is_poisoned boolean ---@field shot_from_trap boolean Arrow = {} ---@param lit boolean function Arrow:light_up(lit) end ---@param poisoned boolean function Arrow:poison_arrow(poisoned) end ---@class Arrowtrap : Entity, Floor ---@field arrow_shot boolean Arrowtrap = {} function Arrowtrap:rearm() end ---The uid must be movable entity for ownership transfers ---@param who_uid integer function Arrowtrap:trigger(who_uid) end ---@class Axolotl : Entity, Movable, PowerupCapable, Mount ---@field attack_cooldown integer ---@field can_teleport boolean Axolotl = {} ---@class AxolotlShot : Entity, Movable, Projectile ---@field distance_after_capture number ---@field size number ---@field swing number ---@field swing_periodicity number ---@field trapped_uid integer AxolotlShot = {} ---@class BGBackLayerDoor : Entity ---@field illumination1 Illumination|nil ---@field illumination2 Illumination|nil BGBackLayerDoor = {} ---@class BGEggshipRoom : Entity ---@field fx_door Entity|nil ---@field fx_shell Entity|nil ---@field platform_left Entity|nil ---@field platform_middle Entity|nil ---@field platform_right Entity|nil ---@field player_in boolean ---@field sound SoundMeta|nil BGEggshipRoom = {} ---@class BGFloatingDebris : Entity, BGSurfaceLayer ---@field distance number @Distance it travels up and down from spawn position ---@field sine_angle number ---@field speed number BGFloatingDebris = {} ---@class BGMovingStar : Entity, BGSurfaceStar ---@field falling_speed number @Can make it rise if set to negative BGMovingStar = {} ---@class BGRelativeElement : Entity ---@field relative_x number ---@field relative_y number BGRelativeElement = {} ---@class BGShootingStar : Entity, BGRelativeElement ---@field max_timer integer ---@field size number @Gets smaller as the timer gets close to the max_timer ---@field timer integer ---@field x_increment number ---@field y_increment number BGShootingStar = {} ---@class BGShopEntrance : Entity ---@field on_entering boolean BGShopEntrance = {} ---@class BGShopKeeperPrime : Entity ---@field bubble_spawn_delay integer ---@field bubble_spawn_trigger boolean ---@field bubbles_timer integer ---@field normal_y number ---@field sine_pos number BGShopKeeperPrime = {} ---@class BGSurfaceLayer : Entity, BGRelativeElement ---@field relative_offset_x number ---@field relative_offset_y number BGSurfaceLayer = {} ---@class BGSurfaceStar : Entity ---@field blink_timer integer ---@field relative_x number ---@field relative_y number BGSurfaceStar = {} ---@class BGTutorialSign : Entity ---@field is_shown boolean BGTutorialSign = {} ---Used in GameManager ---@class BackgroundMusic ---@field angered_shopkeeper BackgroundSound|nil ---@field arena BackgroundSound|nil ---@field arena_intro_and_win BackgroundSound|nil ---@field backlayer BackgroundSound|nil ---@field basecamp BackgroundSound|nil ---@field dark_level BackgroundSound|nil ---@field death_transition BackgroundSound|nil ---@field game_startup BackgroundSound|nil ---@field inside_sunken_city_pipe BackgroundSound|nil ---@field level_gameplay BackgroundSound|nil ---@field level_transition BackgroundSound|nil ---@field main_backgroundtrack BackgroundSound|nil ---@field pause_menu BackgroundSound|nil ---@field shop BackgroundSound|nil ---@field win_scene BackgroundSound|nil BackgroundMusic = {} ---@class BackgroundSound : SoundMeta BackgroundSound = {} ---@class Backpack : Entity, Movable, Powerup ---@field explosion_timer integer ---@field explosion_trigger boolean @More like on fire trigger, the explosion happens when the timer reaches > 29 Backpack = {} ---@param callback_id integer function Backpack:clear_virtual(callback_id) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Backpack:set_post_trigger_explosion(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Backpack:set_post_virtual(index, fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Backpack:set_pre_trigger_explosion(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Backpack:set_pre_virtual(index, fun) end function Backpack:trigger_explosion() end ---@class Bat : Entity, Movable, PowerupCapable, Monster ---@field spawn_x number ---@field spawn_y number Bat = {} ---@class Bee : Entity, Movable, PowerupCapable, Monster ---@field can_rest boolean ---@field fly_hang_timer integer ---@field sound SoundMeta|nil ---@field targeting_timer integer ---@field walk_end_time integer ---@field walk_start_time integer ---@field wobble_x number ---@field wobble_y number Bee = {} ---@class Beg : Entity, Movable, PowerupCapable, Monster, NPC ---@field disappear_timer integer ---@field walk_pause_timer integer Beg = {} ---@class BigSpearTrap : Entity, Floor ---@field left_part boolean @setting the left part to 0 or right part to 1 destroys the trap ---@field spear_uid integer BigSpearTrap = {} ---The uid must be movable entity for ownership transfers, has to be called on the left part of the trap, ---@param who_uid integer ---@param left boolean function BigSpearTrap:trigger(who_uid, left) end ---@class Birdies : Entity, Movable Birdies = {} ---@class Bodyguard : Entity, Movable, PowerupCapable, Monster, NPC ---@field message_shown boolean ---@field position_state integer @0 - none, 1 - Tusk dice shop, 2 - Entrance to pleasure palace, 3 - Basement entrance to pleasure palace Bodyguard = {} ---@class Bomb : Entity, Movable ---@field is_big_bomb boolean @is bomb from powerpack ---@field scale_hor number @1.25 = default regular bomb, 1.875 = default giant bomb, > 1.25 generates ENT_TYPE_FX_POWEREDEXPLOSION ---@field scale_ver number ---@field sound SoundMeta|nil Bomb = {} ---@class BoneBlock : Entity, Movable BoneBlock = {} ---@class Boombox : Entity, Movable ---@field fx_button Entity|nil ---@field jump_state integer ---@field jump_timer integer ---@field music_note1 ParticleEmitterInfo|nil ---@field music_note2 ParticleEmitterInfo|nil ---@field spawn_y number ---@field station integer ---@field station_change_delay integer Boombox = {} ---@class Boomerang : Entity, Movable, Purchasable ---@field distance number ---@field returns_to_uid integer ---@field rotation number ---@field sound SoundMeta|nil ---@field trail ParticleEmitterInfo|nil Boomerang = {} ---@class Boulder : Entity, Movable ---@field is_rolling integer @is set to 1 when the boulder first hits the ground Boulder = {} ---@class BoulderSpawner : Entity ---@field owner_uid integer @UID of entity that triggered the trap. ---@field sound SoundMeta|nil ---@field timer integer @Can be set negative for longer time period, spawns boulder at 150, setting it higher with count to overflow BoulderSpawner = {} ---@class Bow : Entity, Movable, Purchasable Bow = {} ---When laying on the ground ---@return number function Bow:get_arrow_special_offset() end ---Shared memory structure used for Playlunky-Overlunky interoperability ---@class Bucket ---@field count integer @Number of API instances present ---@field custom_strings table @Holds all the custom strings added thru [add_string](https://spelunky-fyi.github.io/overlunky/#add_string), read only ---@field data table @You can store arbitrary simple values here in Playlunky to be read in on Overlunky script for example. ---@field io SharedIO|nil @Shared part of ImGuiIO to block keyboard/mouse input across API instances. ---@field overlunky Overlunky|nil @Access Overlunky options here, nil if Overlunky is not loaded. ---@field pause PauseAPI|nil @PauseAPI is used by Overlunky and can be used to control the Overlunky pause options from scripts. Can be accessed from the global `pause` more easily. Bucket = {} ---@class Bullet : Entity, Movable, Projectile Bullet = {} ---@class BurningRopeEffect : Entity ---@field illumination Illumination|nil ---@field sound SoundMeta|nil BurningRopeEffect = {} ---@class Button : Entity, Movable ---@field button_sprite integer @Only one can be set: 1 - pad: A, key: Z 2 - pad: X, key: X 4 - pad: B, key: C 8 - pad: Y, key: D 16 - pad: LB, key: L Shift 32 - pad: RB, key: A 64 - pad: menu?, key: (none) 128 - pad: copy?, key: Tab ---@field is_visible boolean @It's false for selldialog used in shops ---@field player_trigger boolean @It's set true even if player does not see the button, like the drill or COG door ---@field seen integer @-1 - hasn't been seen 0 - last seen by player 1 1 - last seen by player 2 2 - last seen by player 3 3 - last seen by player 4 ---@field visibility number Button = {} ---@class Camera ---@field adjusted_focus_x number ---@field adjusted_focus_y number ---@field bounds_bottom number ---@field bounds_left number ---@field bounds_right number ---@field bounds_top number ---@field calculated_focus_x number ---@field calculated_focus_y number ---@field focus_offset_x number ---@field focus_offset_y number ---@field focus_x number ---@field focus_y number ---@field focused_entity_uid integer @if set to -1, you have free control over camera focus through focus_x, focus_y ---@field inertia number @This is a bad name, but it represents the camera tweening speed. [0..5] where 0=still, 1=default (move 20% of distance per frame), 5=max (move 5*20% or 100% aka instantly to destination per frame) ---@field peek_layer integer ---@field peek_timer integer @amount of frames to freeze camera in place and move to the peek_layer during the peek you can freely set camera position no matter if focused_entity_uid is set to -1 or not ---@field shake_amplitude number ---@field shake_countdown integer ---@field shake_countdown_start integer ---@field shake_multiplier_x number ---@field shake_multiplier_y number ---@field uniform_shake boolean ---@field vertical_pan number Camera = {} ---@return AABB function Camera:get_bounds() end ---@param bounds AABB function Camera:set_bounds(bounds) end ---@class CameraFlash : Entity ---@field illumination1 Illumination|nil ---@field illumination2 Illumination|nil ---@field timer integer CameraFlash = {} ---@class Cape : Entity, Movable, Powerup, Backpack ---@field floating_down boolean Cape = {} ---@class CatMummy : Entity, Movable, PowerupCapable, Monster ---@field attack_timer integer ---@field jump_height_multiplier integer @Set in process_input when jump is triggered to be used when applying velocity for the jump. CatMummy = {} ---@class Caveman : Entity, Movable, PowerupCapable, Monster, WalkingMonster ---@field aggro_timer integer @keeps resetting when angry and a player is nearby ---@field can_pick_up_timer integer @0 = can pick something up, when holding forced to 179, after tripping and regaining consciousness counts down to 0 ---@field wake_up_timer integer Caveman = {} ---@class CavemanShopkeeper : Entity, Movable, PowerupCapable, Monster, WalkingMonster ---@field shop_entered boolean ---@field tripping boolean CavemanShopkeeper = {} ---@class Chain : Entity, Movable ---@field attached_to_uid integer ---@field timer integer Chain = {} ---@class ChainedPushBlock : Entity, Movable, PushBlock ---@field is_chained boolean ChainedPushBlock = {} ---@class Chest : Entity, Movable ---@field bomb boolean @size of the bomb is random, if set both true only leprechaun spawns ---@field leprechaun boolean Chest = {} ---@class CinematicAnchor : Entity ---@field blackbar_bottom Entity|nil ---@field blackbar_top Entity|nil ---@field roll_in number @0.0 to 1.0 CinematicAnchor = {} ---@class CityOfGoldDoor : Entity, Floor, Door, ExitDoor, DecoratedDoor ---@field unlocked boolean CityOfGoldDoor = {} ---@class ClamBase : Entity, Movable ---@field top_part_uid integer ---@field treasure_type ENT_TYPE ---@field treasure_uid integer ---@field treasure_x_pos number ---@field treasure_y_pos number ClamBase = {} ---@class Claw : Entity, Movable ---@field crabman_uid integer ---@field spawn_x number ---@field spawn_y number Claw = {} ---@class ClimbableRope : Entity, Movable ---@field above_part Entity|nil ---@field below_part Entity|nil ---@field burn_timer integer @entity is killed after 20 ---@field segment_nr integer ---@field segment_nr_inverse integer ClimbableRope = {} ---@class CloneGunShot : Entity, Movable, Projectile, LightShot ---@field spawn_y number ---@field timer integer CloneGunShot = {} ---@class Cobra : Entity, Movable, PowerupCapable, Monster ---@field spit_timer integer Cobra = {} ---@class Coffin : Entity, Movable ---@field inside ENT_TYPE ---@field player_respawn boolean ---@field timer integer Coffin = {} ---@class Coin : Entity, Movable ---@field nominal_price integer Coin = {} ---@class Color ---@field a number ---@field b number ---@field g number ---@field r number Color = {} ---Create a new color - defaults to black ---@return Color ---@overload fun(other: Color): Color ---@overload fun(r_: number, g_: number, b_: number, a_: number): Color ---@overload fun(color_name: string, alpha: integer|nil): Color function Color.new() end ---@return Color function Color.aqua() end ---@return Color function Color.black() end ---@return Color function Color.blue() end ---@return Color function Color.fuchsia() end ---Returns RGBA colors in 0..255 range ---@return integer ---@return integer ---@return integer ---@return integer function Color:get_rgba() end ---Returns the `uColor` used in `GuiDrawContext` drawing functions ---@return uColor function Color:get_ucolor() end ---@return Color function Color.gray() end ---@return Color function Color.green() end ---@return Color function Color.lime() end ---@return Color function Color.maroon() end ---@return Color function Color.navy() end ---@return Color function Color.olive() end ---@return Color function Color.purple() end ---@return Color function Color.red() end ---Copies the values of different Color to this one ---@param other Color ---@return Color function Color:set(other) end ---Changes color based on given RGBA colors in 0..255 range ---@param red integer ---@param green integer ---@param blue integer ---@param alpha integer ---@return Color function Color:set_rgba(red, green, blue, alpha) end ---Changes color based on given uColor ---@param color integer ---@return Color function Color:set_ucolor(color) end ---@return Color function Color.silver() end ---@return Color function Color.teal() end ---@return Color function Color.white() end ---@return Color function Color.yellow() end ---@class Constellation ---@field line_count integer ---@field line_red_intensity number ---@field lines ConstellationLine[] ---@field scale number ---@field star_count integer ---@field stars ConstellationStar[] Constellation = {} ---@class ConstellationLine ---@field from integer ---@field to integer ConstellationLine = {} ---@class ConstellationStar ---@field alpha number ---@field blue number ---@field canis_ring boolean ---@field fidelis_ring boolean ---@field green number ---@field halo_alpha number ---@field halo_blue number ---@field halo_green number ---@field halo_red number ---@field red number ---@field size number ---@field type integer ---@field x number ---@field y number ConstellationStar = {} ---@class Container : Entity, Movable ---@field inside ENT_TYPE Container = {} ---@class ControllerButton ---@field down boolean @Button is being held ---@field pressed boolean @Button was just pressed down this frame ControllerButton = {} ---@class ControllerInput ---@field buttons ControllerButton[] @Zero-based indexing. Use PlayerSlot.input_mapping_controller or RAW_BUTTON (or RAW_DUALSHOCK) to index this. ControllerInput = {} ---@class ConveyorBelt : Entity, Floor, TransferFloor ---@field timer integer ConveyorBelt = {} ---@class CookFire : Entity, Movable, Torch ---@field emitted_light Illumination|nil ---@field particles_flames ParticleEmitterInfo|nil ---@field particles_smoke ParticleEmitterInfo|nil ---@field particles_warp ParticleEmitterInfo|nil ---@field sound SoundMeta|nil CookFire = {} ---@class Crabman : Entity, Movable, PowerupCapable, Monster ---@field at_maximum_attack boolean ---@field attacking_claw_uid integer ---@field invincibility_timer integer ---@field poison_attack_timer integer ---@field walk_pause_timer integer Crabman = {} ---@class Critter : Entity, Movable, PowerupCapable, Monster ---@field holding_state integer ---@field last_picked_up_by_uid integer Critter = {} ---@class CritterBeetle : Entity, Movable, PowerupCapable, Monster, Critter ---@field pause boolean @used when he's getting eaten CritterBeetle = {} ---@class CritterButterfly : Entity, Movable, PowerupCapable, Monster, Critter ---@field change_direction_timer integer ---@field vertical_flight_direction integer CritterButterfly = {} ---@class CritterCrab : Entity, Movable, PowerupCapable, Monster, Critter ---@field unfriendly boolean @moves away from its target instead of towards it ---@field walk_pause_timer integer ---@field walking_left boolean CritterCrab = {} ---@class CritterDrone : Entity, Movable, PowerupCapable, Monster, Critter ---@field applied_hor_momentum number ---@field applied_ver_momentum number ---@field emitted_light Illumination|nil ---@field move_timer integer ---@field sound SoundMeta|nil ---@field unfriendly boolean @moves away from its target instead of towards it CritterDrone = {} ---@class CritterFirefly : Entity, Movable, PowerupCapable, Monster, Critter ---@field change_direction_timer integer ---@field sine_amplitude number ---@field sine_angle number ---@field sine_frequency number ---@field sit_cooldown_timer integer ---@field sit_timer integer CritterFirefly = {} ---@class CritterFish : Entity, Movable, PowerupCapable, Monster, Critter ---@field player_in_proximity boolean ---@field swim_pause_timer integer CritterFish = {} ---@class CritterLocust : Entity, Movable, PowerupCapable, Monster, Critter ---@field jump_timer integer ---@field sound SoundMeta|nil CritterLocust = {} ---@class CritterPenguin : Entity, Movable, PowerupCapable, Monster, Critter ---@field jump_timer integer ---@field walk_pause_timer integer CritterPenguin = {} ---@class CritterSlime : Entity, Movable, PowerupCapable, Monster, Critter ---@field pos_x number ---@field pos_y number ---@field rotation_angle number ---@field rotation_center_x number ---@field rotation_center_y number ---@field rotation_speed number ---@field walk_pause_timer integer ---@field x_direction number ---@field y_direction number CritterSlime = {} ---@class CritterSnail : Entity, Movable, PowerupCapable, Monster, Critter ---@field pos_x number ---@field pos_y number ---@field rotation_angle number ---@field rotation_center_x number ---@field rotation_center_y number ---@field rotation_speed number ---@field x_direction number ---@field y_direction number CritterSnail = {} ---@class Crocman : Entity, Movable, PowerupCapable, Monster, WalkingMonster ---@field teleport_cooldown integer Crocman = {} ---@class CrossBeam : Entity ---@field attached_to_side_uid integer ---@field attached_to_top_uid integer CrossBeam = {} ---@class CrushElevator : Entity, Movable ---@field speed number @This is custom variable, you need [activate_crush_elevator_hack](https://spelunky-fyi.github.io/overlunky/#activate_crush_elevator_hack) to use it ---@field y_limit number @This is custom variable, you need [activate_crush_elevator_hack](https://spelunky-fyi.github.io/overlunky/#activate_crush_elevator_hack) to use it CrushElevator = {} ---@class Crushtrap : Entity, Movable ---@field bounce_back_timer integer @counts from 7 to 0 after it hits the wall and moves away until the timer hits 0, then moves back and counts from 255 until it hits the wall again, if needed it will start the counter again for another bounce ---@field dirx number ---@field diry number ---@field timer integer @counts from 30 to 0 before moving, after it stops, counts from 60 to 0 before it can be triggered again Crushtrap = {} ---@class CursedEffect : Entity ---@field particle ParticleEmitterInfo|nil ---@field sound SoundMeta|nil CursedEffect = {} ---@class CursedPot : Entity, Movable ---@field smoke ParticleEmitterInfo|nil ---@field smoke2 ParticleEmitterInfo|nil CursedPot = {} ---Handle to a loaded FMOD Bank. Unloading a bank will destroy all objects loaded from it, and unload all sample data. ---Can be used to load and unload the non-streaming sample data of all events in the bank. However you can also ---control the loading state of non-streaming sample data for individual events with a `CustomEventDescription`. ---@class CustomBank CustomBank = {} ---@return integer|nil function CustomBank:get_loading_state() end ---@return integer|nil function CustomBank:get_sample_loading_state() end ---@return boolean function CustomBank:is_valid() end ---@return boolean function CustomBank:load_sample_data() end ---@return boolean function CustomBank:unload() end ---@return boolean function CustomBank:unload_sample_data() end ---Handle to an FMOD event description, can be used to create a `CustomEventInstance` with ---`CustomEventDescription:create_instance()`. Also can be used to load and unload non-streaming ---sample data for the Event, and release all instances of the event. You can also get parameter ---IDs using `CustomEventDescription:get_parameter_description_by_name()`. ---@class CustomEventDescription CustomEventDescription = {} ---@return CustomEventInstance function CustomEventDescription:create_instance() end ---@param index integer ---@return ParameterDescription|nil function CustomEventDescription:get_parameter_description_by_index(index) end ---@param name string ---@return ParameterDescription|nil function CustomEventDescription:get_parameter_description_by_name(name) end ---@return integer|nil function CustomEventDescription:get_parameter_description_count() end ---@param name string ---@return ParameterId|nil function CustomEventDescription:get_parameter_id_by_name(name) end ---@return integer|nil function CustomEventDescription:get_sample_loading_state() end ---@return boolean function CustomEventDescription:is_valid() end ---@return boolean function CustomEventDescription:load_sample_data() end ---@return boolean function CustomEventDescription:release_all_instances() end ---@return boolean function CustomEventDescription:unload_sample_data() end ---Handle to an FMOD event instance. Can be used to start and stop an event, or set the events parameters. Once you ---are done with an event instance and no longer need to change its playback state or parameters, you should call ---`CustomEventInstance:release()` so the event is marked for release and released when it stops playing to free resources. ---Generally though, it is best practice to call `CustomEventInstance:release()` immediately after `CustomEventInstance:start()` ---unless you want to play the event instance multiple times or explicitly start and stop it later. ---@class CustomEventInstance CustomEventInstance = {} ---@param id ParameterId ---@return number|nil function CustomEventInstance:get_parameter_by_id(id) end ---@param name string ---@return number|nil function CustomEventInstance:get_parameter_by_name(name) end ---@return boolean|nil function CustomEventInstance:get_pause() end ---@return number|nil function CustomEventInstance:get_pitch() end ---@return integer|nil function CustomEventInstance:get_playback_state() end ---@return integer|nil function CustomEventInstance:get_timeline_position() end ---@return number|nil function CustomEventInstance:get_volume() end ---@return boolean function CustomEventInstance:is_valid() end ---@return boolean function CustomEventInstance:key_off() end ---@return boolean function CustomEventInstance:release() end ---@param id ParameterId ---@param value number ---@return boolean ---@overload fun(self: CustomEventInstance, id: ParameterId, value: number, ignoreseekspeed: boolean): boolean function CustomEventInstance:set_parameter_by_id(id, value) end ---@param id ParameterId ---@param label string ---@return boolean ---@overload fun(self: CustomEventInstance, id: ParameterId, label: string, ignoreseekspeed: boolean): boolean function CustomEventInstance:set_parameter_by_id_with_label(id, label) end ---@param name string ---@param value number ---@return boolean ---@overload fun(self: CustomEventInstance, name: string, value: number, ignoreseekspeed: boolean): boolean function CustomEventInstance:set_parameter_by_name(name, value) end ---@param name string ---@param label string ---@return boolean ---@overload fun(self: CustomEventInstance, name: string, label: string, ignoreseekspeed: boolean): boolean function CustomEventInstance:set_parameter_by_name_with_label(name, label) end ---@param pause boolean ---@return boolean function CustomEventInstance:set_pause(pause) end ---@param pitch number ---@return boolean function CustomEventInstance:set_pitch(pitch) end ---@param position integer ---@return boolean function CustomEventInstance:set_timeline_position(position) end ---@param volume number ---@return boolean function CustomEventInstance:set_volume(volume) end ---@return boolean function CustomEventInstance:start() end ---@return boolean ---@overload fun(self: CustomEventInstance, mode: integer): boolean function CustomEventInstance:stop() end ---Opaque handle to a custom movable behavior from a script mod ---@class CustomMovableBehavior : MovableBehavior ---@field base_behavior VanillaMovableBehavior|nil CustomMovableBehavior = {} ---Set the `force_state` function of a `CustomMovableBehavior`, this will be called every frame when ---the movable is updated. If an `force_state` is already set it will be overridden. The signature ---of the function is `bool force_state(Movable movable, function base_fun)`, when the function returns `true` the movable will ---enter this behavior. If no base behavior is set `base_fun` will be `nil`. ---@param behavior CustomMovableBehavior|nil ---@param force_state fun(movable: Movable|nil, base_fun: fun(p1: Movable|nil): boolean): boolean|nil @Returning nil: treated as false. function CustomMovableBehavior.set_force_state(behavior, force_state) end ---Set the `get_next_state_id` function of a `CustomMovableBehavior`, this will be called every frame when ---the movable is updated. If an `get_next_state_id` is already set it will be overridden. The signature ---of the function is `int get_next_state_id(Movable movable, function base_fun))`, use this to move to another state, return `nil`. ---or this behaviors `state_id` to remain in this behavior. If no base behavior is set `base_fun` will be `nil`. ---@param behavior CustomMovableBehavior|nil ---@param get_next_state_id fun(movable: Movable|nil, base_fun: fun(p1: Movable|nil): integer): integer|nil @Returning nil: treated as behavior->state_id. function CustomMovableBehavior.set_get_next_state_id(behavior, get_next_state_id) end ---Set the `on_enter` function of a `CustomMovableBehavior`, this will be called when the movable ---enters the state. If an `on_enter` is already set it will be overridden. The signature of the ---function is `nil on_enter(Movable movable, function base_fun))`. If no base behavior is set `base_fun` will be `nil`. ---@param behavior CustomMovableBehavior|nil ---@param on_enter fun(movable: Movable|nil, base_fun: fun(p1: Movable|nil)) @Returning nil: ignored. function CustomMovableBehavior.set_on_enter(behavior, on_enter) end ---Set the `on_exit` function of a `CustomMovableBehavior`, this will be called when the movable ---leaves the state. If an `on_exit` is already set it will be overridden. The signature of the ---function is `nil on_exit(Movable movable, function base_fun))`. If no base behavior is set `base_fun` will be `nil`. ---@param behavior CustomMovableBehavior|nil ---@param on_exit fun(movable: Movable|nil, base_fun: fun(p1: Movable|nil)) @Returning nil: ignored. function CustomMovableBehavior.set_on_exit(behavior, on_exit) end ---Set the `update_logic` function of a `CustomMovableBehavior`, this will be called every frame when ---the movable is updated. If an `update_logic` is already set it will be overridden. The signature ---of the function is `nil update_logic(Movable movable, function base_fun))`, use it to change the color, texture, ---some timers, etc. of the movable. If no base behavior is set `base_fun` will be `nil`. ---@param behavior CustomMovableBehavior|nil ---@param update_logic fun(movable: Movable|nil, base_fun: fun(p1: Movable|nil)) @Returning nil: ignored. function CustomMovableBehavior.set_update_logic(behavior, update_logic) end ---Set the `update_world` function of a `CustomMovableBehavior`, this will be called every frame when ---the movable is updated. If an `update_world` is already set it will be overridden. The signature ---of the function is `nil update_world(Movable movable, function base_fun))`, use this to update the move, velocity, ---current_animation, etc. of the movable, then call `mov:generic_update_world` to update the movable. If no ---base behavior is set `base_fun` will be `nil`. ---@param behavior CustomMovableBehavior|nil ---@param update_world fun(movable: Movable|nil, base_fun: fun(p1: Movable|nil)) @Returning nil: ignored. function CustomMovableBehavior.set_update_world(behavior, update_world) end ---Handle to a loaded sound, can be used to play the sound and receive a `PlayingSound` for more control ---It is up to you to not release this as long as any sounds returned by `CustomSound:play()` are still playing ---@class CustomSound CustomSound = {} ---@return table function CustomSound:get_parameters() end ---@return PlayingSound ---@overload fun(self: CustomSound, paused: boolean): PlayingSound ---@overload fun(self: CustomSound, paused: boolean, sound_type: SOUND_TYPE): PlayingSound function CustomSound:play() end ---Customizable ThemeInfo with ability to override certain theming functions from different themes or write custom functions. Check ThemeInfo for some notes on the vanilla theme functions. Warning: We WILL change these function names, especially the unknown ones, when you figure out what they do. ---@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. ---@field textures table @Add TEXTUREs here to override different dynamic textures. ---@field theme integer @Theme index. Probably shouldn't collide with the vanilla ones. Purpose unknown. CustomTheme = {} ---Create a new theme with base dwelling and id 100. ---@return CustomTheme ---@overload fun(theme_id_: integer, base_theme_: integer): CustomTheme ---@overload fun(theme_id_: integer, base_theme_: integer, defaults: boolean): CustomTheme function CustomTheme.new() end ---To disable or enable theme functions using the base_theme. ---@param index THEME_OVERRIDE ---@param enabled_ boolean ---@overload fun(self: CustomTheme, index: THEME_OVERRIDE, theme_: integer) ---@overload fun(self: CustomTheme, index: THEME_OVERRIDE, func_: function) function CustomTheme:override(index, enabled_) end ---Set a callback to be called after this theme function, to fix some changes it did for example. ---@param index THEME_OVERRIDE ---@param func_ function function CustomTheme:post(index, func_) end ---Set a callback to be called before this theme function. ---@param index THEME_OVERRIDE ---@param func_ function function CustomTheme:pre(index, func_) end ---@class CutsceneBehavior CutsceneBehavior = {} ---@class DMAlienBlast : Entity ---@field owner_uid integer ---@field reticule_external Entity|nil ---@field reticule_internal Entity|nil ---@field sound SoundMeta|nil ---@field timer integer DMAlienBlast = {} ---@class DMSpawning : Entity ---@field sine_pos number ---@field spawn_x number ---@field spawn_y number ---@field timer integer DMSpawning = {} ---@class DecoRegeneratingBlock : Entity DecoRegeneratingBlock = {} ---@class DecoratedDoor : Entity, Floor, Door, ExitDoor ---@field special_bg Entity|nil DecoratedDoor = {} ---@class DestructibleBG : Entity DestructibleBG = {} ---@class Door : Entity, Floor ---@field counter integer ---@field fx_button Entity|nil Door = {} ---Can the door actually be entered by player. Overrides the button prompt too if false. ---@param player Entity|nil ---@return boolean function Door:can_enter(player) end ---@param callback_id integer function Door:clear_virtual(callback_id) end ---Returns the entity state / behavior id to set the entity to after the entering animation. ---@param who Entity|nil ---@return integer function Door:enter(who) end ---Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function ---@return boolean function Door:is_unlocked() end ---Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change ---@return number function Door:light_level() end ---Can the door actually be entered by player. Overrides the button prompt too if false. ---@param fun fun(self: Entity|nil, player: Entity|nil) @Returning nil: ignored. ---@return integer function Door:set_post_can_enter(fun) end ---Returns the entity state / behavior id to set the entity to after the entering animation. ---@param fun fun(self: Entity|nil, who: Entity|nil) @Returning nil: ignored. ---@return integer function Door:set_post_enter(fun) end ---@param fun fun(self: Entity|nil, who: Entity|nil) @Returning nil: ignored. ---@return integer function Door:set_post_enter_attempt(fun) end ---@param fun fun(self: Entity|nil, who: Entity|nil) @Returning nil: ignored. ---@return integer function Door:set_post_hide_hud(fun) end ---Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Door:set_post_is_unlocked(fun) end ---Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Door:set_post_light_level(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Door:set_post_virtual(index, fun) end ---Can the door actually be entered by player. Overrides the button prompt too if false. ---@param fun fun(self: Entity|nil, player: Entity|nil): boolean|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Door:set_pre_can_enter(fun) end ---Returns the entity state / behavior id to set the entity to after the entering animation. ---@param fun fun(self: Entity|nil, who: Entity|nil): integer|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Door:set_pre_enter(fun) end ---@param fun fun(self: Entity|nil, who: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Door:set_pre_enter_attempt(fun) end ---@param fun fun(self: Entity|nil, who: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Door:set_pre_hide_hud(fun) end ---Should we display the button prompt when collided by player. Will always return `true` for exits, layers and others that the game never locks, even if you lock it with `unlock` function ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Door:set_pre_is_unlocked(fun) end ---Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change ---@param fun fun(self: Entity|nil): number|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Door:set_pre_light_level(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Door:set_pre_virtual(index, fun) end ---Lock/Unlock doors ---@param unlock boolean function Door:unlock(unlock) end ---@class DoorCoords ---@class Drill : Entity, Movable ---@field sound1 SoundMeta|nil ---@field sound2 SoundMeta|nil ---@field top_chain_piece Entity|nil Drill = {} ---@param play_sound_effect boolean|nil function Drill:trigger(play_sound_effect) end ---@class DummyPurchasableEntity : Entity, Movable, Purchasable ---@field exploding boolean ---@field explosion_timer integer @Explodes when timer reaches 30 ---@field replace_entity Entity|nil DummyPurchasableEntity = {} ---@param callback_id integer function DummyPurchasableEntity:clear_virtual(callback_id) end ---Transfers ownership etc. for who to blame, sets the exploding bool ---@param fun fun(self: Entity|nil, who: Entity|nil) @Returning nil: ignored. ---@return integer function DummyPurchasableEntity:set_post_trigger_explosion(fun) end ---@param index integer ---@param fun function ---@return integer|nil function DummyPurchasableEntity:set_post_virtual(index, fun) end ---Transfers ownership etc. for who to blame, sets the exploding bool ---@param fun fun(self: Entity|nil, who: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function DummyPurchasableEntity:set_pre_trigger_explosion(fun) end ---@param index integer ---@param fun function ---@return integer|nil function DummyPurchasableEntity:set_pre_virtual(index, fun) end ---Transfers ownership etc. for who to blame, sets the exploding bool ---@param who Entity|nil function DummyPurchasableEntity:trigger_explosion(who) end ---@class DustWallApep : Entity ---@field particle ParticleEmitterInfo|nil DustWallApep = {} ---@class EggSac : Entity, Movable ---@field timer integer EggSac = {} ---@class EggShipDoor : Entity, Floor, Door ---@field timer integer EggShipDoor = {} ---@class EggShipDoorS : Entity, Floor, Door, EggShipDoor ---@field entered boolean EggShipDoorS = {} ---@class EggplantMinister : Entity, Movable, PowerupCapable, Monster ---@field sound SoundMeta|nil ---@field squish_timer integer ---@field walk_pause_timer integer EggplantMinister = {} ---@class EggplantThrower : Entity EggplantThrower = {} ---@class EggshipCenterJetFlame : Entity, Movable ---@field emitted_light Illumination|nil ---@field particle ParticleEmitterInfo|nil ---@field smoke_on boolean ---@field sound SoundMeta|nil EggshipCenterJetFlame = {} ---@class Elevator : Entity, Movable ---@field emitted_light Illumination|nil ---@field moving_up boolean ---@field timer integer @pause timer, counts down 60 to 0 Elevator = {} ---@class EmpressGrave : Entity, Movable ---@field fx_button Entity|nil ---@field ghost Entity|nil EmpressGrave = {} ---@class Entity ---@field abs_x number @Absolute position in the world, even if overlaid. Might be a frame off since it's updated with `apply_movement` function and so it does not update if game moves the entity in different way after movement is processed. Use `get_absolute_position` for precise. Read only. ---@field abs_y number @Absolute position in the world, even if overlaid. Might be a frame off since it's updated with `apply_movement` function and so it does not update if game moves the entity in different way after movement is processed. Use `get_absolute_position` for precise. Read only. ---@field angle number ---@field animation_frame integer @Number (id) of the sprite in the texture ---@field color Color ---@field draw_depth integer @Depth level that this entity is drawn on. Don't edit this directly, use `set_draw_depth` function ---@field flags ENT_FLAG @see [flags.hpp](https://github.com/spelunky-fyi/overlunky/blob/main/src/game_api/flags.hpp) entity_flags ---@field height number @Height of the sprite ---@field hitbox_enabled boolean ---@field hitboxx number @Half of the width of the hitbox ---@field hitboxy number @Half of the height of the hitbox ---@field layer integer @Use `set_layer` to change ---@field more_flags ENT_MORE_FLAG @see [flags.hpp](https://github.com/spelunky-fyi/overlunky/blob/main/src/game_api/flags.hpp) more_flags ---@field offsetx number @Offset of the hitbox in relation to the entity position ---@field offsety number @Offset of the hitbox in relation to the entity position ---@field overlay any ---@field rendering_info RenderInfo|nil ---@field shape SHAPE ---@field special_offsetx number @Special offset used for entities attached to others (or picked by others) that need to flip to the other side when the parent flips sides ---@field special_offsety number @Special offset used for entities attached to others (or picked by others) that need to flip to the other side when the parent flips sides ---@field tile_height number @Size of the sprite in the texture ---@field tile_width number @Size of the sprite in the texture ---@field type EntityDB|nil @Type of the entity, contains special properties etc. If you want to edit them just for this entity look at the EntityDB ---@field uid integer @Unique id of the entity, save it to variable to check this entity later (don't use the whole Entity type as it will be replaced with a different one when this is destroyed) ---@field user_data any @You can put any arbitrary lua object here for custom entities or player stats, which is then saved across level transitions for players and carried items, mounts etc... This field is local to the script and multiple scripts can write different things in the same entity. The data is saved right before ON.PRE_LOAD_SCREEN from a level and loaded right before ON.POST_LOAD_SCREEN to a level or transition. It is not available yet in post_entity_spawn, but that is a good place to initialize it for new custom entities. See example for more. ---@field width number @Width of the sprite ---@field x number @Position of the entity in the world, or relative to overlay if attached to something. Use `get_absolute_position` to get real position of anything in the game world. ---@field y number @Position of the entity in the world, or relative to overlay if attached to something. Use `get_absolute_position` to get real position of anything in the game world. Entity = {} ---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) ---@param activator Entity|nil function Entity:activate(activator) end ---Applies changes made in `entity.type` function Entity:apply_db() end ---Adds the entity to its own layer, to add it to entity lookup tables without waiting for a state update function Entity:apply_layer() end ---@param metadata integer function Entity:apply_metadata(metadata) end ---@return AcidBubble|nil function Entity.as_acidbubble() end ---@return Alien|nil function Entity.as_alien() end ---@return Altar|nil function Entity.as_altar() end ---@return Ammit|nil function Entity.as_ammit() end ---@return AnkhPowerup|nil function Entity.as_ankhpowerup() end ---@return Anubis|nil function Entity.as_anubis() end ---@return ApepHead|nil function Entity.as_apephead() end ---@return ApepPart|nil function Entity.as_apeppart() end ---@return Arrow|nil function Entity.as_arrow() end ---@return Arrowtrap|nil function Entity.as_arrowtrap() end ---@return Axolotl|nil function Entity.as_axolotl() end ---@return AxolotlShot|nil function Entity.as_axolotlshot() end ---@return Backpack|nil function Entity.as_backpack() end ---@return Bat|nil function Entity.as_bat() end ---@return Bee|nil function Entity.as_bee() end ---@return Beg|nil function Entity.as_beg() end ---@return BGBackLayerDoor|nil function Entity.as_bgbacklayerdoor() end ---@return BGEggshipRoom|nil function Entity.as_bgeggshiproom() end ---@return BGFloatingDebris|nil function Entity.as_bgfloatingdebris() end ---@return BGMovingStar|nil function Entity.as_bgmovingstar() end ---@return BGRelativeElement|nil function Entity.as_bgrelativeelement() end ---@return BGShootingStar|nil function Entity.as_bgshootingstar() end ---@return BGShopEntrance|nil function Entity.as_bgshopentrance() end ---@return BGShopKeeperPrime|nil function Entity.as_bgshopkeeperprime() end ---@return BGSurfaceLayer|nil function Entity.as_bgsurfacelayer() end ---@return BGSurfaceStar|nil function Entity.as_bgsurfacestar() end ---@return BGTutorialSign|nil function Entity.as_bgtutorialsign() end ---@return BigSpearTrap|nil function Entity.as_bigspeartrap() end ---@return Birdies|nil function Entity.as_birdies() end ---@return Bodyguard|nil function Entity.as_bodyguard() end ---@return Bomb|nil function Entity.as_bomb() end ---@return BoneBlock|nil function Entity.as_boneblock() end ---@return Boombox|nil function Entity.as_boombox() end ---@return Boomerang|nil function Entity.as_boomerang() end ---@return Boulder|nil function Entity.as_boulder() end ---@return BoulderSpawner|nil function Entity.as_boulderspawner() end ---@return Bow|nil function Entity.as_bow() end ---@return Bullet|nil function Entity.as_bullet() end ---@return BurningRopeEffect|nil function Entity.as_burningropeeffect() end ---@return Button|nil function Entity.as_button() end ---@return CameraFlash|nil function Entity.as_cameraflash() end ---@return Cape|nil function Entity.as_cape() end ---@return CatMummy|nil function Entity.as_catmummy() end ---@return Caveman|nil function Entity.as_caveman() end ---@return CavemanShopkeeper|nil function Entity.as_cavemanshopkeeper() end ---@return Chain|nil function Entity.as_chain() end ---@return ChainedPushBlock|nil function Entity.as_chainedpushblock() end ---@return Chest|nil function Entity.as_chest() end ---@return CinematicAnchor|nil function Entity.as_cinematicanchor() end ---@return CityOfGoldDoor|nil function Entity.as_cityofgolddoor() end ---@return ClamBase|nil function Entity.as_clambase() end ---@return Claw|nil function Entity.as_claw() end ---@return ClimbableRope|nil function Entity.as_climbablerope() end ---@return CloneGunShot|nil function Entity.as_clonegunshot() end ---@return Cobra|nil function Entity.as_cobra() end ---@return Coffin|nil function Entity.as_coffin() end ---@return Coin|nil function Entity.as_coin() end ---@return Container|nil function Entity.as_container() end ---@return ConveyorBelt|nil function Entity.as_conveyorbelt() end ---@return CookFire|nil function Entity.as_cookfire() end ---@return Crabman|nil function Entity.as_crabman() end ---@return Critter|nil function Entity.as_critter() end ---@return CritterBeetle|nil function Entity.as_critterbeetle() end ---@return CritterButterfly|nil function Entity.as_critterbutterfly() end ---@return CritterCrab|nil function Entity.as_crittercrab() end ---@return CritterDrone|nil function Entity.as_critterdrone() end ---@return CritterFirefly|nil function Entity.as_critterfirefly() end ---@return CritterFish|nil function Entity.as_critterfish() end ---@return CritterLocust|nil function Entity.as_critterlocust() end ---@return CritterPenguin|nil function Entity.as_critterpenguin() end ---@return CritterSlime|nil function Entity.as_critterslime() end ---@return CritterSnail|nil function Entity.as_crittersnail() end ---@return Crocman|nil function Entity.as_crocman() end ---@return CrossBeam|nil function Entity.as_crossbeam() end ---@return CrushElevator|nil function Entity.as_crushelevator() end ---@return Crushtrap|nil function Entity.as_crushtrap() end ---@return CursedEffect|nil function Entity.as_cursedeffect() end ---@return CursedPot|nil function Entity.as_cursedpot() end ---@return DecoratedDoor|nil function Entity.as_decorateddoor() end ---@return DecoRegeneratingBlock|nil function Entity.as_decoregeneratingblock() end ---@return DestructibleBG|nil function Entity.as_destructiblebg() end ---@return DMAlienBlast|nil function Entity.as_dmalienblast() end ---@return DMSpawning|nil function Entity.as_dmspawning() end ---@return Door|nil function Entity.as_door() end ---@return Drill|nil function Entity.as_drill() end ---@return DummyPurchasableEntity|nil function Entity.as_dummypurchasableentity() end ---@return DustWallApep|nil function Entity.as_dustwallapep() end ---@return EggplantMinister|nil function Entity.as_eggplantminister() end ---@return EggplantThrower|nil function Entity.as_eggplantthrower() end ---@return EggSac|nil function Entity.as_eggsac() end ---@return EggshipCenterJetFlame|nil function Entity.as_eggshipcenterjetflame() end ---@return EggShipDoor|nil function Entity.as_eggshipdoor() end ---@return EggShipDoorS|nil function Entity.as_eggshipdoors() end ---@return Elevator|nil function Entity.as_elevator() end ---@return EmpressGrave|nil function Entity.as_empressgrave() end ---@return Entity|nil function Entity.as_entity() end ---@return Excalibur|nil function Entity.as_excalibur() end ---@return ExitDoor|nil function Entity.as_exitdoor() end ---@return Explosion|nil function Entity.as_explosion() end ---@return FallingPlatform|nil function Entity.as_fallingplatform() end ---@return Fireball|nil function Entity.as_fireball() end ---@return Firebug|nil function Entity.as_firebug() end ---@return FirebugUnchained|nil function Entity.as_firebugunchained() end ---@return FireFrog|nil function Entity.as_firefrog() end ---@return Fish|nil function Entity.as_fish() end ---@return Flame|nil function Entity.as_flame() end ---@return FlameSize|nil function Entity.as_flamesize() end ---@return Floor|nil function Entity.as_floor() end ---@return Fly|nil function Entity.as_fly() end ---@return FlyHead|nil function Entity.as_flyhead() end ---@return ForceField|nil function Entity.as_forcefield() end ---@return ForestSister|nil function Entity.as_forestsister() end ---@return Frog|nil function Entity.as_frog() end ---@return FrostBreathEffect|nil function Entity.as_frostbreatheffect() end ---@return FrozenLiquid|nil function Entity.as_frozenliquid() end ---@return FxAlienBlast|nil function Entity.as_fxalienblast() end ---@return FxAnkhBrokenPiece|nil function Entity.as_fxankhbrokenpiece() end ---@return FxAnkhRotatingSpark|nil function Entity.as_fxankhrotatingspark() end ---@return FxCompass|nil function Entity.as_fxcompass() end ---@return FxEmpress|nil function Entity.as_fxempress() end ---@return FxFireflyLight|nil function Entity.as_fxfireflylight() end ---@return FxHundunNeckPiece|nil function Entity.as_fxhundunneckpiece() end ---@return FxJellyfishStar|nil function Entity.as_fxjellyfishstar() end ---@return FxJetpackFlame|nil function Entity.as_fxjetpackflame() end ---@return FxKinguSliding|nil function Entity.as_fxkingusliding() end ---@return FxLamassuAttack|nil function Entity.as_fxlamassuattack() end ---@return FxMainExitDoor|nil function Entity.as_fxmainexitdoor() end ---@return FxNecromancerANKH|nil function Entity.as_fxnecromancerankh() end ---@return FxOuroboroDragonPart|nil function Entity.as_fxouroborodragonpart() end ---@return FxOuroboroOccluder|nil function Entity.as_fxouroborooccluder() end ---@return FxPickupEffect|nil function Entity.as_fxpickupeffect() end ---@return FxPlayerIndicator|nil function Entity.as_fxplayerindicator() end ---@return FxQuickSand|nil function Entity.as_fxquicksand() end ---@return FxSaleContainer|nil function Entity.as_fxsalecontainer() end ---@return FxShotgunBlast|nil function Entity.as_fxshotgunblast() end ---@return FxSorceressAttack|nil function Entity.as_fxsorceressattack() end ---@return FxSparkSmall|nil function Entity.as_fxsparksmall() end ---@return FxSpringtrapRing|nil function Entity.as_fxspringtrapring() end ---@return FxTiamatHead|nil function Entity.as_fxtiamathead() end ---@return FxTiamatTail|nil function Entity.as_fxtiamattail() end ---@return FxTiamatTorso|nil function Entity.as_fxtiamattorso() end ---@return FxTornJournalPage|nil function Entity.as_fxtornjournalpage() end ---@return FxUnderwaterBubble|nil function Entity.as_fxunderwaterbubble() end ---@return FxVatBubble|nil function Entity.as_fxvatbubble() end ---@return FxWaterDrop|nil function Entity.as_fxwaterdrop() end ---@return FxWebbedEffect|nil function Entity.as_fxwebbedeffect() end ---@return FxWitchdoctorHint|nil function Entity.as_fxwitchdoctorhint() end ---@return Generator|nil function Entity.as_generator() end ---@return Ghist|nil function Entity.as_ghist() end ---@return Ghost|nil function Entity.as_ghost() end ---@return GhostBreath|nil function Entity.as_ghostbreath() end ---@return GiantClamTop|nil function Entity.as_giantclamtop() end ---@return GiantFish|nil function Entity.as_giantfish() end ---@return GiantFly|nil function Entity.as_giantfly() end ---@return GiantFrog|nil function Entity.as_giantfrog() end ---@return Goldbar|nil function Entity.as_goldbar() end ---@return GoldMonkey|nil function Entity.as_goldmonkey() end ---@return Grub|nil function Entity.as_grub() end ---@return Gun|nil function Entity.as_gun() end ---@return HangAnchor|nil function Entity.as_hanganchor() end ---@return HangSpider|nil function Entity.as_hangspider() end ---@return HangStrand|nil function Entity.as_hangstrand() end ---@return Hermitcrab|nil function Entity.as_hermitcrab() end ---@return Honey|nil function Entity.as_honey() end ---@return HorizontalForceField|nil function Entity.as_horizontalforcefield() end ---@return HornedLizard|nil function Entity.as_hornedlizard() end ---@return Hoverpack|nil function Entity.as_hoverpack() end ---@return Hundun|nil function Entity.as_hundun() end ---@return HundunChest|nil function Entity.as_hundunchest() end ---@return HundunHead|nil function Entity.as_hundunhead() end ---@return IceSlidingSound|nil function Entity.as_iceslidingsound() end ---@return Idol|nil function Entity.as_idol() end ---@return Imp|nil function Entity.as_imp() end ---@return Jetpack|nil function Entity.as_jetpack() end ---@return Jiangshi|nil function Entity.as_jiangshi() end ---@return JumpDog|nil function Entity.as_jumpdog() end ---@return JungleSpearCosmetic|nil function Entity.as_junglespearcosmetic() end ---@return JungleSpearTrap|nil function Entity.as_junglespeartrap() end ---@return JungleTrapTrigger|nil function Entity.as_jungletraptrigger() end ---@return KapalaPowerup|nil function Entity.as_kapalapowerup() end ---@return Kingu|nil function Entity.as_kingu() end ---@return Lahamu|nil function Entity.as_lahamu() end ---@return Lamassu|nil function Entity.as_lamassu() end ---@return LampFlame|nil function Entity.as_lampflame() end ---@return Landmine|nil function Entity.as_landmine() end ---@return LaserBeam|nil function Entity.as_laserbeam() end ---@return LaserTrap|nil function Entity.as_lasertrap() end ---@return Lava|nil function Entity.as_lava() end ---@return Lavamander|nil function Entity.as_lavamander() end ---@return Leaf|nil function Entity.as_leaf() end ---@return Leprechaun|nil function Entity.as_leprechaun() end ---@return LightArrow|nil function Entity.as_lightarrow() end ---@return LightArrowPlatform|nil function Entity.as_lightarrowplatform() end ---@return LightEmitter|nil function Entity.as_lightemitter() end ---@return LightShot|nil function Entity.as_lightshot() end ---@return LimbAnchor|nil function Entity.as_limbanchor() end ---@return Liquid|nil function Entity.as_liquid() end ---@return LiquidSurface|nil function Entity.as_liquidsurface() end ---@return LockedDoor|nil function Entity.as_lockeddoor() end ---@return LogicalAnchovyFlock|nil function Entity.as_logicalanchovyflock() end ---@return LogicalConveyorbeltSound|nil function Entity.as_logicalconveyorbeltsound() end ---@return LogicalDoor|nil function Entity.as_logicaldoor() end ---@return LogicalDrain|nil function Entity.as_logicaldrain() end ---@return LogicalLiquidStreamSound|nil function Entity.as_logicalliquidstreamsound() end ---@return LogicalMiniGame|nil function Entity.as_logicalminigame() end ---@return LogicalRegeneratingBlock|nil function Entity.as_logicalregeneratingblock() end ---@return LogicalSound|nil function Entity.as_logicalsound() end ---@return LogicalStaticSound|nil function Entity.as_logicalstaticsound() end ---@return LogicalTrapTrigger|nil function Entity.as_logicaltraptrigger() end ---@return MagmaMan|nil function Entity.as_magmaman() end ---@return MainExit|nil function Entity.as_mainexit() end ---@return Mantrap|nil function Entity.as_mantrap() end ---@return Mattock|nil function Entity.as_mattock() end ---@return Mech|nil function Entity.as_mech() end ---@return MegaJellyfish|nil function Entity.as_megajellyfish() end ---@return MegaJellyfishEye|nil function Entity.as_megajellyfisheye() end ---@return MiniGameAsteroid|nil function Entity.as_minigameasteroid() end ---@return MiniGameShip|nil function Entity.as_minigameship() end ---@return MiniGameShipOffset|nil function Entity.as_minigameshipoffset() end ---@return Mole|nil function Entity.as_mole() end ---@return Monkey|nil function Entity.as_monkey() end ---@return Monster|nil function Entity.as_monster() end ---@return Mosquito|nil function Entity.as_mosquito() end ---@return MotherStatue|nil function Entity.as_motherstatue() end ---@return Mount|nil function Entity.as_mount() end ---@return Movable|nil function Entity.as_movable() end ---@return MovingIcon|nil function Entity.as_movingicon() end ---@return Mummy|nil function Entity.as_mummy() end ---@return MummyFliesSound|nil function Entity.as_mummyfliessound() end ---@return Necromancer|nil function Entity.as_necromancer() end ---@return NPC|nil function Entity.as_npc() end ---@return Octopus|nil function Entity.as_octopus() end ---@return Olmec|nil function Entity.as_olmec() end ---@return OlmecCannon|nil function Entity.as_olmeccannon() end ---@return OlmecFloater|nil function Entity.as_olmecfloater() end ---@return OlmecShip|nil function Entity.as_olmecship() end ---@return Olmite|nil function Entity.as_olmite() end ---@return OnFireEffect|nil function Entity.as_onfireeffect() end ---@return Orb|nil function Entity.as_orb() end ---@return OsirisHand|nil function Entity.as_osirishand() end ---@return OsirisHead|nil function Entity.as_osirishead() end ---@return OuroboroCameraAnchor|nil function Entity.as_ouroborocameraanchor() end ---@return OuroboroCameraZoomin|nil function Entity.as_ouroborocamerazoomin() end ---@return PalaceSign|nil function Entity.as_palacesign() end ---@return ParachutePowerup|nil function Entity.as_parachutepowerup() end ---@return Pet|nil function Entity.as_pet() end ---@return Pipe|nil function Entity.as_pipe() end ---@return PipeTravelerSound|nil function Entity.as_pipetravelersound() end ---@return Player|nil function Entity.as_player() end ---@return PlayerBag|nil function Entity.as_playerbag() end ---@return PlayerGhost|nil function Entity.as_playerghost() end ---@return PoisonedEffect|nil function Entity.as_poisonedeffect() end ---@return PoleDeco|nil function Entity.as_poledeco() end ---@return Portal|nil function Entity.as_portal() end ---@return Pot|nil function Entity.as_pot() end ---@return Powerup|nil function Entity.as_powerup() end ---@return PowerupCapable|nil function Entity.as_powerupcapable() end ---@return Present|nil function Entity.as_present() end ---@return PrizeDispenser|nil function Entity.as_prizedispenser() end ---@return Projectile|nil function Entity.as_projectile() end ---@return ProtoShopkeeper|nil function Entity.as_protoshopkeeper() end ---@return PunishBall|nil function Entity.as_punishball() end ---@return Purchasable|nil function Entity.as_purchasable() end ---@return PushBlock|nil function Entity.as_pushblock() end ---@return Qilin|nil function Entity.as_qilin() end ---@return QuickSand|nil function Entity.as_quicksand() end ---@return QuickSandSound|nil function Entity.as_quicksandsound() end ---@return Quillback|nil function Entity.as_quillback() end ---@return RegenBlock|nil function Entity.as_regenblock() end ---@return Robot|nil function Entity.as_robot() end ---@return Rockdog|nil function Entity.as_rockdog() end ---@return RollingItem|nil function Entity.as_rollingitem() end ---@return RoomLight|nil function Entity.as_roomlight() end ---@return RoomOwner|nil function Entity.as_roomowner() end ---@return Rubble|nil function Entity.as_rubble() end ---@return Scarab|nil function Entity.as_scarab() end ---@return Scepter|nil function Entity.as_scepter() end ---@return ScepterShot|nil function Entity.as_sceptershot() end ---@return Scorpion|nil function Entity.as_scorpion() end ---@return Shield|nil function Entity.as_shield() end ---@return ShootingStarSpawner|nil function Entity.as_shootingstarspawner() end ---@return Shopkeeper|nil function Entity.as_shopkeeper() end ---@return Skeleton|nil function Entity.as_skeleton() end ---@return SkullDropTrap|nil function Entity.as_skulldroptrap() end ---@return SleepBubble|nil function Entity.as_sleepbubble() end ---@return SlidingWallCeiling|nil function Entity.as_slidingwallceiling() end ---@return SnapTrap|nil function Entity.as_snaptrap() end ---@return Sorceress|nil function Entity.as_sorceress() end ---@return SoundShot|nil function Entity.as_soundshot() end ---@return Spark|nil function Entity.as_spark() end ---@return SparkTrap|nil function Entity.as_sparktrap() end ---@return Spear|nil function Entity.as_spear() end ---@return SpecialShot|nil function Entity.as_specialshot() end ---@return Spider|nil function Entity.as_spider() end ---@return SpikeballTrap|nil function Entity.as_spikeballtrap() end ---@return SplashBubbleGenerator|nil function Entity.as_splashbubblegenerator() end ---@return StickyTrap|nil function Entity.as_stickytrap() end ---@return StretchChain|nil function Entity.as_stretchchain() end ---@return Switch|nil function Entity.as_switch() end ---@return Tadpole|nil function Entity.as_tadpole() end ---@return Teleporter|nil function Entity.as_teleporter() end ---@return TeleporterBackpack|nil function Entity.as_teleporterbackpack() end ---@return TeleportingBorder|nil function Entity.as_teleportingborder() end ---@return Telescope|nil function Entity.as_telescope() end ---@return Tentacle|nil function Entity.as_tentacle() end ---@return TentacleBottom|nil function Entity.as_tentaclebottom() end ---@return Terra|nil function Entity.as_terra() end ---@return ThinIce|nil function Entity.as_thinice() end ---@return Tiamat|nil function Entity.as_tiamat() end ---@return TiamatShot|nil function Entity.as_tiamatshot() end ---@return TimedForceField|nil function Entity.as_timedforcefield() end ---@return TimedPowderkeg|nil function Entity.as_timedpowderkeg() end ---@return TimedShot|nil function Entity.as_timedshot() end ---@return Torch|nil function Entity.as_torch() end ---@return TorchFlame|nil function Entity.as_torchflame() end ---@return TotemTrap|nil function Entity.as_totemtrap() end ---@return TransferFloor|nil function Entity.as_transferfloor() end ---@return TrapPart|nil function Entity.as_trappart() end ---@return Treasure|nil function Entity.as_treasure() end ---@return TreasureHook|nil function Entity.as_treasurehook() end ---@return TrueCrownPowerup|nil function Entity.as_truecrownpowerup() end ---@return Tun|nil function Entity.as_tun() end ---@return TV|nil function Entity.as_tv() end ---@return UdjatSocket|nil function Entity.as_udjatsocket() end ---@return UFO|nil function Entity.as_ufo() end ---@return UnchainedSpikeBall|nil function Entity.as_unchainedspikeball() end ---@return Ushabti|nil function Entity.as_ushabti() end ---@return Vampire|nil function Entity.as_vampire() end ---@return VanHorsing|nil function Entity.as_vanhorsing() end ---@return Vlad|nil function Entity.as_vlad() end ---@return VladsCape|nil function Entity.as_vladscape() end ---@return Waddler|nil function Entity.as_waddler() end ---@return WalkingMonster|nil function Entity.as_walkingmonster() end ---@return WallTorch|nil function Entity.as_walltorch() end ---@return Web|nil function Entity.as_web() end ---@return WebGun|nil function Entity.as_webgun() end ---@return WebShot|nil function Entity.as_webshot() end ---@return WetEffect|nil function Entity.as_weteffect() end ---@return Whip|nil function Entity.as_whip() end ---@return WitchDoctor|nil function Entity.as_witchdoctor() end ---@return WitchDoctorSkull|nil function Entity.as_witchdoctorskull() end ---@return WoodenlogTrap|nil function Entity.as_woodenlogtrap() end ---@return Yama|nil function Entity.as_yama() end ---@return Yang|nil function Entity.as_yang() end ---@return YellowCape|nil function Entity.as_yellowcape() end ---@return YetiKing|nil function Entity.as_yetiking() end ---@return YetiQueen|nil function Entity.as_yetiqueen() end ---Attach to other entity (at the current relative position to it) ---@param new_overlay Entity|nil function Entity:attach(new_overlay) end ---@return boolean function Entity:can_be_pushed() end ---@param callback_id integer function Entity:clear_virtual(callback_id) end ---Completely removes the entity from existence function Entity:destroy() end ---Short for using RECURSIVE_MODE.NONE ---@overload fun(self: Entity, mask: MASK|nil, ent_types: ENT_TYPE[], rec_mode: RECURSIVE_MODE) function Entity:destroy_recursive() end ---Detach from overlay ---@param check_autokill boolean|nil function Entity:detach(check_autokill) end ---@param left boolean function Entity:flip(left) end ---Friction of this entity, affects it's contact with other entities (how fast it slows down on the floor, how fast it can move but also the other way around for floors/activefloors: how other entities can move on it) ---@return number function Entity:friction() end ---Get the absolute position of an entity in the game world ---@return Vec2 function Entity:get_absolute_position() end ---Get's the velocity relative to the game world, only for movable or liquid entities ---@return Vec2 function Entity:get_absolute_velocity() end ---@return Entity|nil function Entity:get_held_entity() end ---`use_render_pos` default is `false` ---@param use_render_pos boolean|nil ---@return AABB function Entity:get_hitbox(use_render_pos) end ---@return integer[] function Entity:get_items() end ---e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred) ---@return integer function Entity:get_metadata() end ---@return TEXTURE function Entity:get_texture() end ---@return boolean function Entity:is_cursed() end ---Returns true if entity is in water/lava ---@return boolean function Entity:is_in_liquid() end ---@return boolean function Entity:is_movable() end ---Kills the entity, you can set responsible to `nil` to ignore it ---@param destroy_corpse boolean ---@param responsible Entity|nil function Entity:kill(destroy_corpse, responsible) end ---Short for using RECURSIVE_MODE.NONE ---@param destroy_corpse boolean ---@param responsible Entity|nil ---@overload fun(self: Entity, destroy_corpse: boolean, responsible: Entity|nil, mask: MASK|nil, ent_types: ENT_TYPE[], rec_mode: RECURSIVE_MODE) function Entity:kill_recursive(destroy_corpse, responsible) end ---It's not called when item is bought. It does not remove the item from StateMemory`.room_owners.owned_items` ---Parameter `clear_parent` used only for CHAR_* entities, sets the `linked_companion_parent` to -1. ---@param clear_parent boolean ---@overload fun(self: Entity) function Entity:liberate_from_shop(clear_parent) end ---@param other Entity|nil ---@return boolean ---@overload fun(self: Entity, hitbox: AABB): boolean ---@overload fun(self: Entity, rect_left: number, rect_bottom: number, rect_right: number, rect_top: number): boolean function Entity:overlaps_with(other) end ---Performs a teleport as if the entity had a teleporter and used it. The delta coordinates are where you want the entity to teleport to relative to its current position, in tiles (so integers, not floats). Positive numbers = to the right and up, negative left and down. ---@param delta_x integer ---@param delta_y integer function Entity:perform_teleport(delta_x, delta_y) end ---Moves the entity to the limbo-layer where it can later be retrieved from again via `respawn` function Entity:remove() end ---Can be called multiple times for the same entity (for example when play throws/drops entity from it's hands) ---@param entity Entity|nil ---@param autokill_check boolean function Entity:remove_item(entity, autokill_check) end function Entity:reset_draw_depth() end ---Moves the entity from the limbo-layer (where it was previously put by `remove`) to `layer` ---@param layer_to LAYER function Entity:respawn(layer_to) end ---optional unknown - game usually sets it to 0, doesn't appear to have any special effect (needs more reverse engineering) ---@param draw_depth integer ---@param unknown integer|nil function Entity:set_draw_depth(draw_depth, unknown) end ---@param enabled boolean function Entity:set_enable_turning(enabled) end ---@param value boolean function Entity:set_invisible(value) end ---Moves the entity to specified layer with all it's items, nothing else happens, so this does not emulate a door transition ---@param layer LAYER function Entity:set_layer(layer) end ---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) ---@param fun fun(self: Entity|nil, activator: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_activate(fun) end ---@param fun fun(self: Entity|nil, metadata: integer) @Returning nil: ignored. ---@return integer function Entity:set_post_apply_metadata(fun) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_can_be_pushed(fun) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_create_rendering_info(fun) end ---Completely removes the entity from existence ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_destroy(fun) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_dtor(fun) end ---@param fun fun(self: Entity|nil, left: boolean) @Returning nil: ignored. ---@return integer function Entity:set_post_flip(fun) end ---Friction of this entity, affects it's contact with other entities (how fast it slows down on the floor, how fast it can move but also the other way around for floors/activefloors: how other entities can move on it) ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_friction(fun) end ---@param fun fun(self: Entity|nil, victim: Entity|nil, damage: integer, killing: boolean) @Returning nil: ignored. ---@return integer function Entity:set_post_generate_damage_particles(fun) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_get_held_entity(fun) end ---e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred) ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_get_metadata(fun) end ---Applies changes made in `entity.type` ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_init(fun) end ---Returns true if entity is in water/lava ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_is_in_liquid(fun) end ---Kills the entity, you can set responsible to `nil` to ignore it ---@param fun fun(self: Entity|nil, destroy_corpse: boolean, responsible: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_kill(fun) end ---@param fun fun(self: Entity|nil, who: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_ledge_grab(fun) end ---It's not called when item is bought. It does not remove the item from StateMemory`.room_owners.owned_items` ---Parameter `clear_parent` used only for CHAR_* entities, sets the `linked_companion_parent` to -1. ---@param fun fun(self: Entity|nil, clear_parent: boolean) @Returning nil: ignored. ---@return integer function Entity:set_post_liberate_from_shop(fun) end ---Collisions with stuff that blocks you, like walls, floors, etc. Triggers for entities in it's EntityDB.collision_mask ---@param fun fun(self: Entity|nil, other_entity: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_on_collision1(fun) end ---More like on_overlap, triggers when entities touch/overlap each other. Triggers for entities in it's EntityDB.collision2_mask ---@param fun fun(self: Entity|nil, other_entity: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_on_collision2(fun) end ---Can be called multiple times for the same entity (for example when play throws/drops entity from it's hands) ---@param fun fun(self: Entity|nil, entity: Entity|nil, autokill_check: boolean) @Returning nil: ignored. ---@return integer function Entity:set_post_remove_item(fun) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_reset_draw_depth(fun) end ---@param fun fun(self: Entity|nil, p2: SoundMeta|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_set_as_sound_source(fun) end ---@param fun fun(self: Entity|nil, draw_depth: integer, b3f: integer) @Returning nil: ignored. ---@return integer function Entity:set_post_set_draw_depth(fun) end ---@param fun fun(self: Entity|nil, value: boolean) @Returning nil: ignored. ---@return integer function Entity:set_post_set_invisible(fun) end ---@param fun fun(self: Entity|nil, entity: Entity|nil, p3: Vec2|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_stood_on(fun) end ---Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) ---@param fun fun(self: Entity|nil, user: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_trigger_action(fun) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_update_state_machine(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Entity:set_post_virtual(index, fun) end ---@param fun fun(self: Entity|nil, walker: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_walked_off(fun) end ---@param fun fun(self: Entity|nil, walker: Entity|nil) @Returning nil: ignored. ---@return integer function Entity:set_post_walked_on(fun) end ---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) ---@param fun fun(self: Entity|nil, activator: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_activate(fun) end ---@param fun fun(self: Entity|nil, metadata: integer): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_apply_metadata(fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Entity:set_pre_can_be_pushed(fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_create_rendering_info(fun) end ---Completely removes the entity from existence ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_destroy(fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_dtor(fun) end ---@param fun fun(self: Entity|nil, left: boolean): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_flip(fun) end ---Friction of this entity, affects it's contact with other entities (how fast it slows down on the floor, how fast it can move but also the other way around for floors/activefloors: how other entities can move on it) ---@param fun fun(self: Entity|nil): number|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Entity:set_pre_friction(fun) end ---@param fun fun(self: Entity|nil, victim: Entity|nil, damage: integer, killing: boolean): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_generate_damage_particles(fun) end ---@param fun fun(self: Entity|nil): Entity|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Entity:set_pre_get_held_entity(fun) end ---e.g. for turkey: stores health, poison/curse state, for mattock: remaining swings (returned value is transferred) ---@param fun fun(self: Entity|nil): integer|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Entity:set_pre_get_metadata(fun) end ---Applies changes made in `entity.type` ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_init(fun) end ---Returns true if entity is in water/lava ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Entity:set_pre_is_in_liquid(fun) end ---Kills the entity, you can set responsible to `nil` to ignore it ---@param fun fun(self: Entity|nil, destroy_corpse: boolean, responsible: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_kill(fun) end ---@param fun fun(self: Entity|nil, who: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_ledge_grab(fun) end ---It's not called when item is bought. It does not remove the item from StateMemory`.room_owners.owned_items` ---Parameter `clear_parent` used only for CHAR_* entities, sets the `linked_companion_parent` to -1. ---@param fun fun(self: Entity|nil, clear_parent: boolean): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_liberate_from_shop(fun) end ---Collisions with stuff that blocks you, like walls, floors, etc. Triggers for entities in it's EntityDB.collision_mask ---@param fun fun(self: Entity|nil, other_entity: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_on_collision1(fun) end ---More like on_overlap, triggers when entities touch/overlap each other. Triggers for entities in it's EntityDB.collision2_mask ---@param fun fun(self: Entity|nil, other_entity: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_on_collision2(fun) end ---Can be called multiple times for the same entity (for example when play throws/drops entity from it's hands) ---@param fun fun(self: Entity|nil, entity: Entity|nil, autokill_check: boolean): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_remove_item(fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_reset_draw_depth(fun) end ---@param fun fun(self: Entity|nil, p2: SoundMeta|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_set_as_sound_source(fun) end ---@param fun fun(self: Entity|nil, draw_depth: integer, b3f: integer): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_set_draw_depth(fun) end ---@param fun fun(self: Entity|nil, value: boolean): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_set_invisible(fun) end ---@param fun fun(self: Entity|nil, entity: Entity|nil, p3: Vec2|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_stood_on(fun) end ---Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) ---@param fun fun(self: Entity|nil, user: Entity|nil): boolean|nil @Returning nil: the original function runs (a value replaces its result and skips it). ---@return integer function Entity:set_pre_trigger_action(fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_update_state_machine(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Entity:set_pre_virtual(index, fun) end ---@param fun fun(self: Entity|nil, walker: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_walked_off(fun) end ---@param fun fun(self: Entity|nil, walker: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Entity:set_pre_walked_on(fun) end ---Changes the entity texture, check the [textures.txt](game_data/textures.txt) for available vanilla textures or use [define_texture](https://spelunky-fyi.github.io/overlunky/#define_texture) to make custom one ---@param texture_id TEXTURE ---@return boolean function Entity:set_texture(texture_id) end ---Returns the top entity in a chain (overlay) ---@return any function Entity:topmost() end ---@return any function Entity:topmost_mount() end ---Triggers weapons and other held items like teleporter, mattock etc. You can check the [virtual-availability.md](https://github.com/spelunky-fyi/overlunky/blob/main/docs/virtual-availability.md), if entity has `open` in the `on_open` you can use this function, otherwise it does nothing. Returns false if action could not be performed (cooldown is not 0, no arrow loaded in etc. the animation could still be played thou) ---@param user Entity|nil ---@return boolean function Entity:trigger_action(user) end function Entity:update() end ---Used in Entity and [get_type](https://spelunky-fyi.github.io/overlunky/#get_type) ---Stores static common data for an ENT_TYPE. You can also clone entity types with the copy constructor to create new custom entities with different common properties. [This tool](https://dregu.github.io/Spelunky2ls/animation.html) can be helpful when messing with the animations. The default values are also listed in [entities.json](https://github.com/spelunky-fyi/overlunky/blob/main/docs/game_data/entities.json). ---@class EntityDB ---@field acceleration number ---@field animations table ---@field blood_content integer ---@field collision2_mask integer @MASK, will only call collision2 when colliding with entities that match this mask. ---@field collision_mask integer @MASK used for collision with floors, walls etc. ---@field damage integer ---@field default_color Color ---@field default_flags integer ---@field default_hitbox_enabled boolean ---@field default_more_flags integer ---@field default_shape SHAPE ---@field default_special_offsetx number ---@field default_special_offsety number ---@field description STRINGID ---@field draw_depth integer ---@field elasticity number ---@field friction number ---@field glow_alpha number ---@field glow_blue number ---@field glow_green number ---@field glow_red number ---@field height number ---@field hitboxx number @Half of the width of the hitbox ---@field hitboxy number @Half of the height of the hitbox ---@field id ENT_TYPE ---@field jump number ---@field leaves_corpse_behind boolean ---@field life integer ---@field max_speed number ---@field offsetx number @Offset of the hitbox in relation to the entity position ---@field offsety number @Offset of the hitbox in relation to the entity position ---@field properties_flags integer ---@field sacrifice_value integer @Favor for sacrificing alive. Halved when dead (health == 0). ---@field search_flags MASK @MASK ---@field sound_killed_by_other SOUNDID ---@field sound_killed_by_player SOUNDID ---@field sprint_factor number ---@field texture TEXTURE ---@field tilex integer ---@field tiley integer ---@field weight number ---@field width number EntityDB = {} ---@param p1 EntityDB ---@return EntityDB ---@overload fun(p1: integer): EntityDB function EntityDB.new(p1) end ---@class Excalibur : Entity, Movable ---@field in_stone boolean Excalibur = {} ---@class ExitDoor : Entity, Floor, Door ---@field entered boolean @if true entering it does not load the transition ---@field level integer ---@field special_door boolean @use provided world/level/theme ---@field theme integer ---@field timer integer ---@field world integer ExitDoor = {} ---Get target world, level, theme of this door. If the `special_door` is false, it returns the StateMemory world_next, level_next, theme_next ---@return integer ---@return integer ---@return integer function ExitDoor:get_target() end ---@param ww integer ---@param l integer ---@param t integer function ExitDoor:set_target(ww, l, t) end ---@class Explosion : Entity, Movable ---@field emitted_light Illumination|nil Explosion = {} ---An `FMODguidMap` can be used to resolve FMOD GUIDs for events and snapshots from paths using the GUIDs.txt exported ---from an FMOD Studio Project. By default FMOD studio uses a strings bank to do this, however the games master bank and ---strings bank cannot be rebuilt to include the names and paths of new events or snapshots. `FMODguidMap` is a ---workaround for this, and allows you to get a `CustomEventDescription` from a path with `FMODguidMap:get_event()`. ---`FMODguidMap:get_event()` expects the path to be formatted similarly to event:/UI/Cancel or snapshot:/IngamePause. ---@class FMODguidMap FMODguidMap = {} ---@param path string ---@return CustomEventDescription|nil function FMODguidMap:get_event(path) end ---@class FallingPlatform : Entity, Movable ---@field shaking_factor number ---@field timer integer ---@field y_pos number FallingPlatform = {} ---@class FireFrog : Entity, Movable, PowerupCapable, Monster, Frog ---@field sound SoundMeta|nil FireFrog = {} ---@class Fireball : Entity, Movable, Projectile, LightShot, SoundShot ---@field particle ParticleEmitterInfo|nil Fireball = {} ---@class Firebug : Entity, Movable, PowerupCapable, Monster ---@field detached_from_chain boolean ---@field fire_timer integer ---@field going_up boolean ---@field sound SoundMeta|nil Firebug = {} ---@class FirebugUnchained : Entity, Movable, PowerupCapable, Monster ---@field ai_timer integer ---@field max_flight_height number ---@field sound SoundMeta|nil ---@field walking_timer integer FirebugUnchained = {} ---@class Fish : Entity, Movable, PowerupCapable, Monster ---@field change_direction_timer integer Fish = {} ---@class Flame : Entity, Movable ---@field emitted_light Illumination|nil ---@field sound SoundMeta|nil Flame = {} ---@class FlameSize : Entity, Movable, Flame ---@field flame_size number @if changed, gradually goes down (0.03 per frame) to the default size, it's the base value for `entity.width` and `entity.height` FlameSize = {} ---@class Floor : Entity ---@field deco_bottom integer ---@field deco_left integer ---@field deco_right integer ---@field deco_top integer Floor = {} ---Explicitly add a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. ---@param side FLOOR_SIDE function Floor:add_decoration(side) end ---@param callback_id integer function Floor:clear_virtual(callback_id) end function Floor:decorate_internal() end ---Sets `animation_frame` of the floor for types `FLOOR_BORDERTILE`, `FLOOR_BORDERTILE_METAL` and `FLOOR_BORDERTILE_OCTOPUS`. function Floor:fix_border_tile_animation() end ---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. ---@param fix_also_neighbors boolean ---@param fix_styled_floor boolean function Floor:fix_decorations(fix_also_neighbors, fix_styled_floor) end ---Returns it's ENT_TYPE except for FLOOR_PEN (returns FLOORSTYLED_MINEWOOD) and FLOOR_QUICKSAND, FLOOR_TOMB, FLOOR_EMPRESS_GRAVE which return FLOOR_GENERIC ---@return ENT_TYPE function Floor:get_floor_type() end ---Explicitly remove a decoration on the given side. Corner decorations only exist for `FLOOR_BORDERTILE` and `FLOOR_BORDERTILE_OCTOPUS`. ---@param side FLOOR_SIDE function Floor:remove_decoration(side) end ---@param fun fun(self: Entity|nil) @Returning nil: ignored. ---@return integer function Floor:set_post_floor_update(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Floor:set_post_virtual(index, fun) end ---@param fun fun(self: Entity|nil): boolean|nil @Returning nil: treated as false: the original function runs (true skips it). ---@return integer function Floor:set_pre_floor_update(fun) end ---@param index integer ---@param fun function ---@return integer|nil function Floor:set_pre_virtual(index, fun) end ---@class Fly : Entity, Movable ---@field timer integer Fly = {} ---@class FlyHead : Entity, Movable ---@field vored_entity_uid integer FlyHead = {} ---@class FlyingThing ---@field amplitude number ---@field entity_type ENT_TYPE ---@field frequency number ---@field sinewave_angle number ---@field spritesheet_animation_length number ---@field spritesheet_column number ---@field spritesheet_row number ---@field texture_info TextureRenderingInfo ---@field velocity_x number FlyingThing = {} ---@class ForceField : Entity, Floor ---@field emitted_light Illumination|nil ---@field first_item_beam Entity|nil ---@field fx Entity|nil ---@field is_on boolean ---@field sound SoundMeta|nil ForceField = {} ---@param turn_on boolean function ForceField:activate_laserbeam(turn_on) end ---@class ForestSister : Entity, Movable, PowerupCapable, Monster, NPC ---@field walk_pause_timer integer ForestSister = {} ---@class Frog : Entity, Movable, PowerupCapable, Monster ---@field grub_being_eaten_uid integer ---@field jump_timer integer ---@field pause boolean Frog = {} ---@class FrostBreathEffect : Entity ---@field timer integer FrostBreathEffect = {} ---@class FrozenLiquid : Entity, Movable FrozenLiquid = {} ---@class FxAlienBlast : Entity, Movable FxAlienBlast = {} ---@class FxAnkhBrokenPiece : Entity, Movable FxAnkhBrokenPiece = {} ---@class FxAnkhRotatingSpark : Entity, Movable ---@field inclination number ---@field radius number ---@field sine_angle number ---@field size number ---@field speed number @0 - 1.0 FxAnkhRotatingSpark = {} ---@class FxCompass : Entity, Movable ---@field is_active boolean @Player has compass ---@field sine_angle number @Counts form 0 to 2*pi, responsible for moving back and forth ---@field visibility number FxCompass = {} ---@class FxEmpress : Entity, Movable ---@field sine_angle number FxEmpress = {} ---@class FxFireflyLight : Entity, Movable ---@field cooldown_timer integer @Timer between light flashes ---@field illumination Illumination|nil ---@field light_timer integer FxFireflyLight = {} ---@class FxHundunNeckPiece : Entity, Movable ---@field kill_timer integer @Short timer after the head is dead FxHundunNeckPiece = {} ---@class FxJellyfishStar : Entity, Movable ---@field radius number ---@field rotation_angle number ---@field speed number FxJellyfishStar = {} ---@class FxJetpackFlame : Entity, Movable ---@field illumination Illumination|nil ---@field particle_flame ParticleEmitterInfo|nil ---@field particle_smoke ParticleEmitterInfo|nil ---@field sound SoundMeta|nil FxJetpackFlame = {} ---@class FxKinguSliding : Entity, Movable ---@field particle ParticleEmitterInfo|nil FxKinguSliding = {} ---@class FxLamassuAttack : Entity, Movable ---@field attack_angle number FxLamassuAttack = {} ---@class FxMainExitDoor : Entity, Movable ---@field emitted_light Illumination|nil ---@field timer integer @When breaking open in tutorial FxMainExitDoor = {} ---@class FxNecromancerANKH : Entity, Movable FxNecromancerANKH = {} ---@class FxOuroboroDragonPart : Entity, Movable ---@field particle ParticleEmitterInfo|nil ---@field speed number ---@field timer integer FxOuroboroDragonPart = {} ---@class FxOuroboroOccluder : Entity, Movable FxOuroboroOccluder = {} ---@class FxPickupEffect : Entity, Movable ---@field spawn_y number ---@field visibility number FxPickupEffect = {} ---@class FxPlayerIndicator : Entity, Movable ---@field attached_to integer ---@field pos_x number ---@field pos_y number FxPlayerIndicator = {} ---@class FxQuickSand : Entity, Movable FxQuickSand = {} ---@class FxSaleContainer : Entity, Movable ---@field fx_button Entity|nil ---@field fx_icon Entity|nil ---@field fx_value Entity|nil ---@field pop_in_out_procentage integer ---@field shake_amplitude number @For effect when you don't have enough money ---@field sound_trigger boolean @Also sound_played, keeps re-triggering from time to time FxSaleContainer = {} ---@class FxShotgunBlast : Entity, Movable ---@field illumination Illumination|nil FxShotgunBlast = {} ---@class FxSorceressAttack : Entity, Movable ---@field size number FxSorceressAttack = {} ---@class FxSparkSmall : Entity, Movable ---@field timer integer FxSparkSmall = {} ---@class FxSpringtrapRing : Entity, Movable ---@field illumination Illumination|nil ---@field timer integer FxSpringtrapRing = {} ---@class FxTiamatHead : Entity, Movable ---@field timer integer FxTiamatHead = {} ---@class FxTiamatTail : Entity, Movable ---@field angle_two number @Added _two just to not shadow angle in entity, it's angle but the pivot point is at the edge ---@field x_pos number ---@field y_pos number FxTiamatTail = {} ---@class FxTiamatTorso : Entity, Movable ---@field timer integer ---@field torso_target_size number @Slowly increases/decreases to the given value FxTiamatTorso = {} ---@class FxTornJournalPage : Entity, Movable ---@field page_number integer @Only in tutorial FxTornJournalPage = {} ---@class FxUnderwaterBubble : Entity, Movable ---@field bubble_source_uid integer ---@field direction integer @1 / -1 ---@field inverted boolean ---@field pop boolean @Setting it true makes it disappear/fade away FxUnderwaterBubble = {} ---@class FxVatBubble : Entity, Movable ---@field max_y number FxVatBubble = {} ---@class FxWaterDrop : Entity, Movable ---@field droplet_source_uid integer ---@field inverted boolean FxWaterDrop = {} ---@class FxWebbedEffect : Entity, Movable ---@field visible boolean FxWebbedEffect = {} ---@class FxWitchdoctorHint : Entity, Movable FxWitchdoctorHint = {} ---Can be accessed via global [game_manager](https://spelunky-fyi.github.io/overlunky/#game_manager) ---@class GameManager ---@field buttons_controls integer[] @Yet another place to get player inputs, in some format ---@field buttons_movement integer[] @Yet another place to get player inputs, in some format ---@field game_props GameProps|nil ---@field journal_ui JournalUI|nil ---@field main_menu_music BackgroundSound|nil ---@field music BackgroundMusic|nil ---@field pause_ui PauseUI|nil ---@field save_related SaveRelated|nil ---@field screen_arena_level Screen|nil ---@field screen_arena_score Screen|nil ---@field screen_camp ScreenCamp|nil ---@field screen_intro ScreenIntro|nil ---@field screen_leaderboards Screen|nil @All handled by the Online ---@field screen_level ScreenLevel|nil ---@field screen_logo ScreenLogo|nil ---@field screen_menu ScreenMenu|nil ---@field screen_online_loading ScreenOnlineLoading|nil ---@field screen_online_lobby ScreenOnlineLobby|nil ---@field screen_options ScreenOptions|nil ---@field screen_player_profile Screen|nil @It just opens journal ---@field screen_prologue ScreenPrologue|nil ---@field screen_seed_input ScreenCodeInput|nil ---@field screen_title ScreenTitle|nil ---@field screen_transition Screen|nil GameManager = {} ---@class GameProps ---@field game_has_focus boolean ---@field input integer[] @Used for player input and might be used for some menu inputs not found in buttons_menu. You can probably capture and edit this in ON.POST_PROCESS_INPUT. These are raw inputs, without things like autorun applied. ---@field input_index integer[] @Input index for players 1-4 and maybe for the menu controls. -1: disabled, 0..3: keyboards, 4..7: Xinput, 8..11: other controllers ---@field input_menu MENU_INPUT @Inputs used to control all the menus, separate from player inputs. You can probably capture and edit this in ON.POST_PROCESS_INPUT ---@field input_menu_previous MENU_INPUT @Previous state of buttons_menu ---@field input_previous integer[] ---@field menu_open boolean GameProps = {} ---Used in ImGuiIO ---@class Gamepad ---@field buttons integer ---@field enabled boolean ---@field lt number ---@field lx number ---@field ly number ---@field rt number ---@field rx number ---@field ry number Gamepad = {} ---@class Generator : Entity, Floor ---@field on_off boolean @Applicable only for ENT_TYPE`.FLOOR_SUNCHALLENGE_GENERATOR` ---@field set_timer integer ---@field spawned_uid integer ---@field start_counter integer @Applicable only for ENT_TYPE`.FLOOR_SUNCHALLENGE_GENERATOR` ---@field timer integer Generator = {} ---@class Ghist : Entity, Movable, PowerupCapable, Monster ---@field body_uid integer ---@field fadeout integer ---@field idle_timer integer ---@field sound SoundMeta|nil ---@field transparency integer Ghist = {} ---@class Ghost : Entity, Movable, PowerupCapable, Monster ---@field blown_by_player boolean ---@field emitted_light Illumination|nil ---@field ghost_behaviour GHOST_BEHAVIOR ---@field happy_dancing_clockwise boolean ---@field linked_ghost Entity|nil ---@field pace_timer integer @Controls ghost pacing when all players are dead. ---@field sound SoundMeta|nil ---@field split_timer integer @for SMALL_HAPPY this is also the sequence timer of its various states ---@field target_dist_visibility_factor number ---@field target_layer_visibility_factor number ---@field velocity_multiplier number ---@field wobble_timer integer Ghost = {} ---@class GhostBreath : Entity, Movable, Projectile ---@field big_cloud boolean ---@field timer integer GhostBreath = {} ---@class GiantClamTop : Entity, Movable ---@field close_timer integer ---@field open_timer integer GiantClamTop = {} ---@class GiantFish : Entity, Movable, PowerupCapable, Monster ---@field change_direction_timer integer @when bouncing into a wall ---@field lose_interest_timer integer @delay in-between attacks ---@field sound SoundMeta|nil GiantFish = {} ---@class GiantFly : Entity, Movable, PowerupCapable, Monster ---@field delta_y_angle number ---@field head_entity Entity|nil ---@field particle ParticleEmitterInfo|nil ---@field sine_amplitude number ---@field sine_counter integer ---@field sine_frequency number ---@field sound SoundMeta|nil GiantFly = {} ---@class GiantFrog : Entity, Movable, PowerupCapable, Monster ---@field attack_timer integer ---@field door_back_layer Entity|nil ---@field door_front_layer Entity|nil ---@field frogs_ejected_in_cycle integer ---@field invincibility_timer integer ---@field mouth_close_timer integer ---@field mouth_open_trigger boolean @opens the mouth and starts mouth_close_timer, used when detecting grub in the mouth area ---@field platform Entity|nil GiantFrog = {} ---@class GoldMonkey : Entity, Movable, PowerupCapable, Monster ---@field jump_timer integer ---@field poop_count integer ---@field poop_timer integer GoldMonkey = {} ---@class Goldbar : Entity, Movable Goldbar = {} ---@class Grub : Entity, Movable, PowerupCapable, Monster ---@field drop boolean ---@field particle ParticleEmitterInfo|nil ---@field rotation_delta number ---@field rotation_direction boolean @Counter-clockwise if true. ---@field rotation_timer integer @Will randomly pick a new direction and angle when this timer elapses. ---@field sound SoundMeta|nil ---@field turn_into_fly_timer integer ---@field walk_pause_timer integer @alternates between walking and pausing every time it reaches zero. ---@field wall_collision_cooldown integer @Delay after colliding into a wall before it will change its movement direction again. Grub = {} ---Used in [register_option_callback](https://spelunky-fyi.github.io/overlunky/#register_option_callback) and [set_callback](https://spelunky-fyi.github.io/overlunky/#set_callback) with ON.GUIFRAME ---@class GuiDrawContext GuiDrawContext = {} ---Draws a cubic bezier curve on screen. ---@param p1 Vec2 ---@param p2 Vec2 ---@param p3 Vec2 ---@param p4 Vec2 ---@param thickness number ---@param color uColor function GuiDrawContext:draw_bezier_cubic(p1, p2, p3, p4, thickness, color) end ---Draws a quadratic bezier curve on screen. ---@param p1 Vec2 ---@param p2 Vec2 ---@param p3 Vec2 ---@param thickness number ---@param color uColor function GuiDrawContext:draw_bezier_quadratic(p1, p2, p3, thickness, color) end ---Draws a circle on screen ---@param x number ---@param y number ---@param radius number ---@param thickness number ---@param color uColor function GuiDrawContext:draw_circle(x, y, radius, thickness, color) end ---Draws a filled circle on screen ---@param x number ---@param y number ---@param radius number ---@param color uColor function GuiDrawContext:draw_circle_filled(x, y, radius, color) end ---Draws an image on screen from top-left to bottom-right. Use UV coordinates `0, 0, 1, 1` to just draw the whole image. ---@param image IMAGE ---@param left number ---@param top number ---@param right number ---@param bottom number ---@param uvx1 number ---@param uvy1 number ---@param uvx2 number ---@param uvy2 number ---@param color uColor ---@overload fun(self: GuiDrawContext, image: IMAGE, rect: AABB, uv_rect: AABB, color: uColor) function GuiDrawContext:draw_image(image, left, top, right, bottom, uvx1, uvy1, uvx2, uvy2, color) end ---Same as `draw_image` but rotates the image by angle in radians around the pivot offset from the center of the rect (meaning `px=py=0` rotates around the center) ---@param image IMAGE ---@param left number ---@param top number ---@param right number ---@param bottom number ---@param uvx1 number ---@param uvy1 number ---@param uvx2 number ---@param uvy2 number ---@param color uColor ---@param angle number ---@param px number ---@param py number ---@overload fun(self: GuiDrawContext, image: IMAGE, rect: AABB, uv_rect: AABB, color: uColor, angle: number, px: number, py: number) function GuiDrawContext:draw_image_rotated(image, left, top, right, bottom, uvx1, uvy1, uvx2, uvy2, color, angle, px, py) end ---Draw on top of UI windows, including platform windows that may be outside the game area, or only in current widget window. Defaults to main viewport background. ---@param layer DRAW_LAYER function GuiDrawContext:draw_layer(layer) end ---Draws a line on screen ---@param x1 number ---@param y1 number ---@param x2 number ---@param y2 number ---@param thickness number ---@param color uColor function GuiDrawContext:draw_line(x1, y1, x2, y2, thickness, color) end ---Draws a polyline on screen. ---@param points Vec2[] ---@param thickness number ---@param color uColor function GuiDrawContext:draw_poly(points, thickness, color) end ---Draws a filled convex polyline on screen. ---@param points Vec2[] ---@param color uColor function GuiDrawContext:draw_poly_filled(points, color) end ---Draws a rectangle on screen from top-left to bottom-right. ---@param left number ---@param top number ---@param right number ---@param bottom number ---@param thickness number ---@param rounding number ---@param color uColor ---@overload fun(self: GuiDrawContext, rect: AABB, thickness: number, rounding: number, color: uColor) function GuiDrawContext:draw_rect(left, top, right, bottom, thickness, rounding, color) end ---Draws a filled rectangle on screen from top-left to bottom-right. ---@param left number ---@param top number ---@param right number ---@param bottom number ---@param rounding number ---@param color uColor ---@overload fun(self: GuiDrawContext, rect: AABB, rounding: number, color: uColor) function GuiDrawContext:draw_rect_filled(left, top, right, bottom, rounding, color) end ---Draws text in screen coordinates `x`, `y`, anchored top-left. Text size 0 uses the default 18. ---@param x number ---@param y number ---@param size number ---@param text string ---@param color uColor function GuiDrawContext:draw_text(x, y, size, text, color) end ---Draws a triangle on screen. ---@param p1 Vec2 ---@param p2 Vec2 ---@param p3 Vec2 ---@param thickness number ---@param color uColor function GuiDrawContext:draw_triangle(p1, p2, p3, thickness, color) end ---Draws a filled triangle on screen. ---@param p1 Vec2 ---@param p2 Vec2 ---@param p3 Vec2 ---@param color uColor function GuiDrawContext:draw_triangle_filled(p1, p2, p3, color) end ---Returns KEY flags including held OL_MOD modifiers, or -1 before any key has been pressed and released, or mouse button pressed. Also returns -1 before all initially held keys are released before the picker was opened, or if another key picker is already waiting for keys. If a modifier is released, that modifier is returned as an actual keycode (e.g. `KEY.LSHIFT`) while the other held modifiers are returned as `KEY.OL_MOD_...` flags. ---Shows a fullscreen key picker with a message, with the accepted input type (keyboard/mouse) filtered by flags. The picker won't show before all previously held keys have been released and other key pickers have returned a valid key. ---@param message string ---@param flags KEY_TYPE ---@return integer function GuiDrawContext:key_picker(message, flags) end ---Add a button ---@param text string ---@return boolean function GuiDrawContext:win_button(text) end ---Add a checkbox ---@param label string ---@param value boolean ---@return boolean function GuiDrawContext:win_check(label, value) end ---Add a combo box ---@param label string ---@param selected integer ---@param opts string ---@return integer function GuiDrawContext:win_combo(label, selected, opts) end ---Add an float dragfield ---@param label string ---@param value number ---@param min number ---@param max number ---@return number function GuiDrawContext:win_drag_float(label, value, min, max) end ---Add an integer dragfield ---@param label string ---@param value integer ---@param min integer ---@param max integer ---@return integer function GuiDrawContext:win_drag_int(label, value, min, max) end ---Draw image to window. ---@param image IMAGE ---@param width number ---@param height number function GuiDrawContext:win_image(image, width, height) end ---Draw imagebutton to window. ---@param label string ---@param image IMAGE ---@param width number ---@param height number ---@param uvx1 number ---@param uvy1 number ---@param uvx2 number ---@param uvy2 number ---@return boolean function GuiDrawContext:win_imagebutton(label, image, width, height, uvx1, uvy1, uvx2, uvy2) end ---Indent contents, or unindent if negative ---@param width number function GuiDrawContext:win_indent(width) end ---Add next thing on the same line. This is same as `win_sameline(0, -1)` function GuiDrawContext:win_inline() end ---Add a float field ---@param label string ---@param value number ---@return number function GuiDrawContext:win_input_float(label, value) end ---Add an integer field ---@param label string ---@param value integer ---@return integer function GuiDrawContext:win_input_int(label, value) end ---Add a text field ---@param label string ---@param value string ---@return string function GuiDrawContext:win_input_text(label, value) end ---Pop unique identifier from the stack. Put after the input. function GuiDrawContext:win_popid() end ---Add unique identifier to the stack, to distinguish identical inputs from each other. Put before the input. ---@param id integer ---@overload fun(self: GuiDrawContext, id: string) function GuiDrawContext:win_pushid(id) end ---Add next thing on the same line, with an offset ---@param offset number ---@param spacing number function GuiDrawContext:win_sameline(offset, spacing) end ---Add a collapsing accordion section, put contents in the callback function. ---@param title string ---@param callback fun() @Returning nil: ignored. function GuiDrawContext:win_section(title, callback) end ---Add a separator line to window function GuiDrawContext:win_separator() end ---Add a separator text line to window ---@param text string function GuiDrawContext:win_separator_text(text) end ---Add an float slider ---@param label string ---@param value number ---@param min number ---@param max number ---@return number function GuiDrawContext:win_slider_float(label, value, min, max) end ---Add an integer slider ---@param label string ---@param value integer ---@param min integer ---@param max integer ---@return integer function GuiDrawContext:win_slider_int(label, value, min, max) end ---Add some text to window, automatically wrapped ---@param text string function GuiDrawContext:win_text(text) end ---Sets next item width (width>1: width in pixels, width<0: to the right of window, -1