Door
Floor entitiessource
Derived types: EggShipDoor, ExitDoor, LockedDoor
--If you want the locked door to look like the closed exit door at Hundun
function close_hundun_door(door) door:unlock(false) for _, uid in pairs(get_entities_overlapping_grid(door.x, door.y, door.layer)) do ent = get_entity(uid) if ent.type.id == ENT_TYPE.BG_DOOR then ent:set_texture(TEXTURE.DATA_TEXTURES_DECO_EGGPLANT_0) return end endendFields
Methods
can_enter
function Door:can_enter(player?: Entity): booleanplayer?:Entityoptional
Returns boolean
set_post_can_enter
function Door:set_post_can_enter(fun: fun(self: Entity?, player: Entity?)): integerReturns integer
Can the door actually be entered by player. Overrides the button prompt too if false.
sourceset_post_enter
function Door:set_post_enter(fun: fun(self: Entity?, who: Entity?)): integerReturns integer
Returns the entity state / behavior id to set the entity to after the entering animation.
sourceset_post_enter_attempt
function Door:set_post_enter_attempt(fun: fun(self: Entity?, who: Entity?)): integerReturns integer
set_post_hide_hud
function Door:set_post_hide_hud(fun: fun(self: Entity?, who: Entity?)): integerReturns integer
set_post_is_unlocked
function Door:set_post_is_unlocked(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
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
set_post_light_level
function Door:set_post_light_level(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change
sourceset_post_virtual
function Door:set_post_virtual(index: integer, fun: function): integer?index:integerfun:function- Callback signature not known from the code.
Returns integer? (may be nil)
set_pre_can_enter
function Door:set_pre_can_enter(fun: fun(self: Entity?, player: Entity?): boolean?): integerfun:fun(self: Entity?, player: Entity?): boolean?- Returning nil (or nothing): the original function runs (a value replaces its result and skips it).
Returns integer
Can the door actually be entered by player. Overrides the button prompt too if false.
sourceset_pre_enter
function Door:set_pre_enter(fun: fun(self: Entity?, who: Entity?): integer?): integerfun:fun(self: Entity?, who: Entity?): integer?- Returning nil (or nothing): the original function runs (a value replaces its result and skips it).
Returns integer
Returns the entity state / behavior id to set the entity to after the entering animation.
sourceset_pre_enter_attempt
function Door:set_pre_enter_attempt(fun: fun(self: Entity?, who: Entity?): boolean): integerfun:fun(self: Entity?, who: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_hide_hud
function Door:set_pre_hide_hud(fun: fun(self: Entity?, who: Entity?): boolean): integerfun:fun(self: Entity?, who: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_is_unlocked
function Door:set_pre_is_unlocked(fun: fun(self: Entity?): boolean?): integerfun:fun(self: Entity?): boolean?- Returning nil (or nothing): the original function runs (a value replaces its result and skips it).
Returns integer
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
set_pre_light_level
function Door:set_pre_light_level(fun: fun(self: Entity?): number?): integerfun:fun(self: Entity?): number?- Returning nil (or nothing): the original function runs (a value replaces its result and skips it).
Returns integer
Returns the darkest light level used to fade the entity when entering or exiting. 0 = black, 1 = no change
sourceset_pre_virtual
function Door:set_pre_virtual(index: integer, fun: function): integer?index:integerfun:function- Callback signature not known from the code.
Returns integer? (may be nil)