-- TEN 1.11.1.1 API -- This file is auto-generated and for IntelliSense purposes only! -- Any changes made here will not be reflected in the engine. ---@meta ---Logic module for Tomb Engine ---@class Logic Logic = {} ---Points in the game flow where level scripts can hook into. ---@enum CallbackPoint CallbackPoint = { ---Will be called immediately before LevelFuncs.OnStart. PRE_START = "PRE_START", ---Will be called immediately after LevelFuncs.OnStart. POST_START = "POST_START", ---Will be called immediately before LevelFuncs.OnLoad. PRE_LOAD = "PRE_LOAD", ---Will be called immediately after LevelFuncs.OnLoad. POST_LOAD = "POST_LOAD", ---Will be called in the beginning of game loop (LevelFuncs.OnLoop). PRE_LOOP = "PRE_LOOP", ---Will be called at the end of game loop (LevelFuncs.OnLoop). POST_LOOP = "POST_LOOP", ---Will be called immediately before LevelFuncs.OnSave. PRE_SAVE = "PRE_SAVE", ---Will be called immediately after LevelFuncs.OnSave. POST_SAVE = "POST_SAVE", ---Will be called immediately before LevelFuncs.OnEnd. PRE_END = "PRE_END", ---Will be called immediately after LevelFuncs.OnEnd. POST_END = "POST_END", ---Will be called immediately before LevelFuncs.OnUseItem. PRE_USE_ITEM = "PRE_USE_ITEM", ---Will be called immediately after LevelFuncs.OnUseItem. POST_USE_ITEM = "POST_USE_ITEM", ---Will be called immediately before LevelFuncs.OnFreeze. PRE_FREEZE = "PRE_FREEZE", ---Will be called immediately after LevelFuncs.OnFreeze. POST_FREEZE = "POST_FREEZE", } ---Module-prefixed alias for CallbackPoint Logic.CallbackPoint = CallbackPoint ---Events that can be handled in level scripts. ---@enum EventType EventType = { ---Triggered when an activator enters the volume. ENTER = "ENTER", ---Triggered while an activator is inside the volume. INSIDE = "INSIDE", ---Triggered when an activator leaves the volume. LEAVE = "LEAVE", ---Triggered each game loop. LOOP = "LOOP", ---Triggered when a saved game is loaded. LOAD = "LOAD", ---Triggered when the game is saved. SAVE = "SAVE", ---Triggered when the level starts. START = "START", ---Triggered when the level ends. END = "END", ---Triggered when an item is used from inventory. USE_ITEM = "USE_ITEM", ---Triggered when any of the Freeze modes are activated. FREEZE = "FREEZE", } ---Module-prefixed alias for EventType Logic.EventType = EventType ---Reasons why a level ended. ---@enum EndReason EndReason = { ---Will be called when the level is completed successfully. LEVEL_COMPLETE = "LEVEL_COMPLETE", ---Will be called when the level ends due to loading a saved game. LOAD_GAME = "LOAD_GAME", ---Will be called when the level ends due to exiting to the title screen. EXIT_TO_TITLE = "EXIT_TO_TITLE", ---Will be called when the level ends due to the player's death. DEATH = "DEATH", ---Will be called when the level ends for any other reason. OTHER = "OTHER", } ---Module-prefixed alias for EndReason Logic.EndReason = EndReason ---Register a function as a callback. ---@param point CallbackPoint # When should the callback be called? ---@param func function # The function to be called (must be in the `LevelFuncs` hierarchy). Will receive, as an argument, the time in seconds since the last frame. function Logic.AddCallback(point, func) end ---Deregister a function as a callback. ---Will have no effect if the function was not registered as a callback. ---@param point CallbackPoint # The callback point the function was registered with. See AddCallback ---@param func function # The function to remove; must be in the `LevelFuncs` hierarchy. function Logic.RemoveCallback(point, func) end ---Attempt to find an event set and execute a particular event from it. ---@param name string # Name of the event set to find. ---@param type EventType # Event to execute. ---@param activator Moveable? # Optional activator. (default: `Lara`) function Logic.HandleEvent(name, type, activator) end ---Attempt to find an event set and enable specified event in it. ---@param name string # Name of the event set to find. ---@param type EventType # Event to enable. function Logic.EnableEvent(name, type) end ---Attempt to find an event set and disable specified event in it. ---@param name string # Name of the event set to find. ---@param type EventType # Event to disable. function Logic.DisableEvent(name, type) end return Logic