Skip to content

Movable

Movable entitiessource

Derived from Entity

Derived types: AcidBubble, Birdies, Bomb, BoneBlock, Boombox, Boulder, Button, Chain, Chest, ClamBase, Claw, ClimbableRope, Coffin, Coin, Container, CrushElevator, Crushtrap, CursedPot, Drill, EggSac, EggshipCenterJetFlame, Elevator, EmpressGrave, Excalibur, Explosion, FallingPlatform, Flame, Fly, FlyHead, FrozenLiquid, FxAlienBlast, FxAnkhBrokenPiece, FxAnkhRotatingSpark, FxCompass, FxEmpress, FxFireflyLight, FxHundunNeckPiece, FxJellyfishStar, FxJetpackFlame, FxKinguSliding, FxLamassuAttack, FxMainExitDoor, FxNecromancerANKH, FxOuroboroDragonPart, FxOuroboroOccluder, FxPickupEffect, FxPlayerIndicator, FxQuickSand, FxSaleContainer, FxShotgunBlast, FxSorceressAttack, FxSparkSmall, FxSpringtrapRing, FxTiamatHead, FxTiamatTail, FxTiamatTorso, FxTornJournalPage, FxUnderwaterBubble, FxVatBubble, FxWaterDrop, FxWebbedEffect, FxWitchdoctorHint, GiantClamTop, Goldbar, HangAnchor, HangStrand, Honey, Idol, JungleSpearCosmetic, LaserBeam, Leaf, LightArrowPlatform, LightEmitter, LiquidSurface, MegaJellyfishEye, MiniGameAsteroid, MiniGameShip, MiniGameShipOffset, MovingIcon, Olmec, OlmecCannon, OlmecFloater, OlmecShip, Orb, PlayerBag, Powerup, PowerupCapable, PrizeDispenser, Projectile, PunishBall, Purchasable, PushBlock, RegenBlock, Rubble, Scepter, SkullDropTrap, SleepBubble, SnapTrap, Spear, StretchChain, Switch, TV, Telescope, ThinIce, Torch, TrapPart, Treasure, TreasureHook, UdjatSocket, UnchainedSpikeBall, Ushabti, Web, Whip, WoodenlogTrap

Fields

buttons_previous

BUTTON

source

current_animation

Animation?

source

cutscene

CutsceneBehavior?read only

source

dark_shadow_timer

integer

source

dont_damage_owner_timer

integer

When > 0, will not deal damage to the owner_uid, so that throwing an object does not harm yourself.

source

exit_gold_invincibility_timer

integer

When > 0, money intersecting a door or at a pipe entrance will not be collected. Also gives iframes from monster collision.

source

exit_invincibility_timer

integer

source

falling_timer

integer

source

frozen_timer

integer

source

health

integer

source

holding_uid

integer

source

idle_counter

integer

source

invincibility_frames_timer

integer

source

jump_height_multiplier

number

EntityDB.jump gets multiplied by this to get the jump

source

knockback_invincibility_timer

integer

Will not apply velocity from various sources when >0. Can be ignored by certain damage flags, so will not be invincible from knockback of all damage types.

source

last_owner_uid

integer

source

last_state

integer

source

lock_input_timer

integer

Related to taking damage, also drops you from ladder/rope, can't be set while on the ground unless you're on a mount

source

move

Vec2

{movex, movey}

source

move_state

integer

source

movex

number

Move directions (-1.0 to 1.0) that represent in whit direction the entity want's to move

source

movey

number

Move directions (-1.0 to 1.0) that represent in whit direction the entity want's to move

source

onfire_effect_timer

integer

source

owner_uid

integer

source

poison_tick_timer

integer

Used to apply damage from poison, can be set to -1 to cure poison, to set poison use poison_entity

source

price

integer

source

reset_owner_timer

integer

Timer for resetting owner_uid.

source

some_state

integer

source

stand_counter

integer

source

standing_on_uid

integer

source

state

integer

source

stun_state

integer

source

stun_timer

integer

source

velocityx

number

speed, can be relative to the platform you standing on (pushblocks, elevators), use get_velocity to get accurate speed in the game world

source

velocityy

number

speed, can be relative to the platform you standing on (pushblocks, elevators), use get_velocity to get accurate speed in the game world

source

wet_effect_timer

integer

source

Methods

add_behavior

function Movable.add_behavior(movable?: Movable, behavior?: MovableBehavior)
movable?: Movableoptional
behavior?: MovableBehavioroptional
source

apply_velocity

function Movable:apply_velocity(velocities: Vec2?, ignore_weight: boolean)
velocities: Vec2?
ignore_weight: boolean
source

attack

function Movable:attack(victim?: Entity): boolean
victim?: Entityoptional

Returns boolean

source

break_block

function Movable:break_block(camera_shake: boolean, block?: Entity)
camera_shake: boolean
block?: Entityoptional
source

calculate_jump_velocity

function Movable:calculate_jump_velocity(dont_ignore_liquid: boolean): number
dont_ignore_liquid: boolean

Returns number

source

can_be_picked_up_by

function Movable:can_be_picked_up_by(entity_picking_up: Entity?, p2: boolean): boolean
entity_picking_up: Entity?
p2: boolean

Returns boolean

source

can_break_block

function Movable:can_break_block(horizontal: boolean, block?: Entity): boolean
horizontal: boolean
block?: Entityoptional

Returns boolean

source

can_jump

function Movable:can_jump(): boolean

Returns boolean

source

clear_behavior

function Movable.clear_behavior(movable?: Movable, behavior?: MovableBehavior)
movable?: Movableoptional
behavior?: MovableBehavioroptional
source

clear_behaviors

function Movable.clear_behaviors(movable?: Movable)
movable?: Movableoptional
source

clear_cutscene

function Movable:clear_cutscene()
source

clear_virtual

function Movable:clear_virtual(callback_id: integer)
callback_id: integer
source

collect_treasure

function Movable:collect_treasure(value: integer, treasure: ENT_TYPE): boolean
value: integer
treasure: ENT_TYPE

Returns boolean

source

copy_extra_info

function Movable:copy_extra_info(clone: Entity?, some_entity_uid: integer)
clone: Entity?
some_entity_uid: integer
source

damage

function Movable:damage(damage_dealer_uid: integer, damage_amount: integer, stun_time: integer, velocity_x: number, velocity_y: number, iframes?: integer): boolean
damage_dealer_uid: integer
damage_amount: integer
stun_time: integer
velocity_x: number
velocity_y: number
iframes?: integeroptional

Returns boolean

function Movable:damage(damage_dealer: Entity?, damage_amount: integer, damage_flags: DAMAGE_TYPE, velocity: Vec2?, unknown_damage_phase: integer, stun_amount: integer, iframes: integer, unknown_is_final: boolean): boolean
damage_dealer: Entity?
damage_amount: integer
damage_flags: DAMAGE_TYPE
velocity: Vec2?
unknown_damage_phase: integer
stun_amount: integer
iframes: integer
unknown_is_final: boolean

Returns boolean

source

drop

function Movable:drop()
source

freeze

function Movable:freeze(framecount: integer, ignore_lava: boolean)
framecount: integer
ignore_lava: boolean
function Movable:freeze(frame_count: integer)
frame_count: integer
source

generic_update_world

function Movable.generic_update_world(movable?: Movable)
movable?: Movableoptional
function Movable.generic_update_world(movable: Movable?, disable_gravity: boolean)
movable: Movable?
disable_gravity: boolean
function Movable.generic_update_world(movable: Movable?, move: Vec2, sprint_factor: number, disable_gravity: boolean, on_rope: boolean)
movable: Movable?
move: Vec2
sprint_factor: number
disable_gravity: boolean
on_rope: boolean
source

get_all_behaviors

function Movable:get_all_behaviors(): integer[]

Returns integer[]

source

get_base_behavior

function Movable.get_base_behavior(movable: Movable?, state_id: integer): VanillaMovableBehavior?
movable: Movable?
state_id: integer

Returns VanillaMovableBehavior? (may be nil)

source

get_behavior

function Movable:get_behavior(): integer

Returns integer

source

get_damage

function Movable:get_damage(): integer

Returns integer

source

get_damage_sound

function Movable:get_damage_sound(damage: DAMAGE_TYPE): SOUNDID
damage: DAMAGE_TYPE

Returns SOUNDID

source

is_button_held

function Movable:is_button_held(button: BUTTON): boolean
button: BUTTON

Returns boolean

source

is_button_pressed

function Movable:is_button_pressed(button: BUTTON): boolean
button: BUTTON

Returns boolean

source

is_button_released

function Movable:is_button_released(button: BUTTON): boolean
button: BUTTON

Returns boolean

source

is_on_fire

function Movable:is_on_fire(): boolean

Returns boolean

source

is_poisoned

function Movable:is_poisoned(): boolean

Returns boolean

source

is_powerup_capable

function Movable:is_powerup_capable(): boolean

Returns boolean

source

light_on_fire

function Movable:light_on_fire()
function Movable:light_on_fire(time: integer)
time: integer
source

pick_up

function Movable:pick_up(entity_to_pick_up?: Entity)
entity_to_pick_up?: Entityoptional
source

poison

function Movable:poison(frames: integer)
frames: integer
source

process_input

function Movable:process_input()
source

reset_gravity

function Movable:reset_gravity()
source

set_behavior

function Movable:set_behavior(behavior_id: integer): boolean
behavior_id: integer

Returns boolean

source

set_cursed

function Movable:set_cursed(b: boolean, effect: boolean)
b: boolean
effect: boolean
function Movable:set_cursed(b: boolean)
b: boolean
source

set_gravity

function Movable:set_gravity(gravity: number)
gravity: number
source

set_position

function Movable:set_position(to_x: number, to_y: number)
to_x: number
to_y: number
source

set_post_apply_friction

function Movable:set_post_apply_friction(fun: fun(self: Entity?, p2: number, vertical: boolean, p4: number)): integer
fun: fun(self: Entity?, p2: number, vertical: boolean, p4: number)

Returns integer

source

set_post_apply_movement

function Movable:set_post_apply_movement(fun: fun(self: Entity?, p2: integer, p3: integer, p4: integer)): integer
fun: fun(self: Entity?, p2: integer, p3: integer, p4: integer)

Returns integer

source

set_post_apply_velocity

function Movable:set_post_apply_velocity(fun: fun(self: Entity?, velocities: Vec2?, ignore_weight: boolean)): integer
fun: fun(self: Entity?, velocities: Vec2?, ignore_weight: boolean)

Returns integer

Mostly used for ragdoll by the game

source

set_post_attack

function Movable:set_post_attack(fun: fun(self: Entity?, victim: Entity?)): integer
fun: fun(self: Entity?, victim: Entity?)

Returns integer

Runs on contact damage, returns false if there wasn't any interaction (called from on_collision2, will be called as long as the hitboxes overlap)

source

set_post_body_destruction

function Movable:set_post_body_destruction(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_break_block

function Movable:set_post_break_block(fun: fun(self: Entity?, camera_shake: boolean, block: Entity?)): integer
fun: fun(self: Entity?, camera_shake: boolean, block: Entity?)

Returns integer

source

set_post_calculate_jump_velocity

function Movable:set_post_calculate_jump_velocity(fun: fun(self: Entity?, dont_ignore_liquid: boolean)): integer
fun: fun(self: Entity?, dont_ignore_liquid: boolean)

Returns integer

source

set_post_can_be_picked_up_by

function Movable:set_post_can_be_picked_up_by(fun: fun(self: Entity?, entity_picking_up: Entity?, p3: boolean)): integer
fun: fun(self: Entity?, entity_picking_up: Entity?, p3: boolean)

Returns integer

source

set_post_can_break_block

function Movable:set_post_can_break_block(fun: fun(self: Entity?, horizontal: boolean, block: Entity?)): integer
fun: fun(self: Entity?, horizontal: boolean, block: Entity?)

Returns integer

source

set_post_can_jump

function Movable:set_post_can_jump(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently.

source

set_post_check_out_of_bounds

function Movable:set_post_check_out_of_bounds(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Disable to not get killed outside level bounds.

source

set_post_cloned_to

function Movable:set_post_cloned_to(fun: fun(self: Entity?, clone: Entity?, some_entity_uid: integer)): integer
fun: fun(self: Entity?, clone: Entity?, some_entity_uid: integer)

Returns integer

Entities must be of the same type!

source

set_post_collect_treasure

function Movable:set_post_collect_treasure(fun: fun(self: Entity?, value: integer, treasure: integer)): integer
fun: fun(self: Entity?, value: integer, treasure: integer)

Returns integer

Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure.

source

set_post_crush

function Movable:set_post_crush(fun: fun(self: Entity?, p2: Entity?)): integer
fun: fun(self: Entity?, p2: Entity?)

Returns integer

source

set_post_damage

function Movable:set_post_damage(fun: fun(self: Entity?, damage_dealer: Entity?, damage_amount: integer, damage_flags: integer, velocity: Vec2?, unknown_damage_phase: integer, stun_amount: integer, iframes: integer, unknown_is_final: boolean)): integer
fun: fun(self: Entity?, damage_dealer: Entity?, damage_amount: integer, damage_flags: integer, velocity: Vec2?, unknown_damage_phase: integer, stun_amount: integer, iframes: integer, unknown_is_final: boolean)

Returns integer

Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities. damage_dealer can be set to nil. Returns: true if entity was affected (for stuff like: if pot was thrown into entity, should that pot break after hit), false if the event should be ignored by damage_dealer

source

set_post_drop

function Movable:set_post_drop(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Called when dropping or throwing

source

set_post_fall

function Movable:set_post_fall(fun: fun(self: Entity?, p2: number)): integer
fun: fun(self: Entity?, p2: number)

Returns integer

Applies gravity to entity. Disable to float like on hoverpack.

source

set_post_freeze

function Movable:set_post_freeze(fun: fun(self: Entity?, framecount: integer, ignore_lava: boolean)): integer
fun: fun(self: Entity?, framecount: integer, ignore_lava: boolean)

Returns integer

Sets the frozen_timer, the param ignore_lava doesn't do much, just skips the liquid check, if in lava the game will set frozen_timer to 0 immediately most of the time

source

set_post_generate_landing_effects

function Movable:set_post_generate_landing_effects(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Only for landing on the floor or activefloor, generates "poof" particle and plays sfx (note: when stunned, sfx is played by the damage function)

source

set_post_get_damage

function Movable:set_post_get_damage(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Returns the damage that the entity deals

source

set_post_get_damage_sound

function Movable:set_post_get_damage_sound(fun: fun(self: Entity?, damage: integer)): integer
fun: fun(self: Entity?, damage: integer)

Returns integer

returns sound id for the damage taken, return 0 to make it silence

source

set_post_initialize

function Movable:set_post_initialize(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_is_on_fire

function Movable:set_post_is_on_fire(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_is_powerup_capable

function Movable:set_post_is_powerup_capable(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_light_on_fire

function Movable:set_post_light_on_fire(fun: fun(self: Entity?, time: integer)): integer
fun: fun(self: Entity?, time: integer)

Returns integer

Does not damage entity

source

set_post_on_hit

function Movable:set_post_on_hit(fun: fun(self: Entity?, damage_dealer: Entity?)): integer
fun: fun(self: Entity?, damage_dealer: Entity?)

Returns integer

Hit by broken arrows etc that don't deal damage, calls damage with 0 damage.

source

set_post_pick_up

function Movable:set_post_pick_up(fun: fun(self: Entity?, entity_to_pick_up: Entity?)): integer
fun: fun(self: Entity?, entity_to_pick_up: Entity?)

Returns integer

source

set_post_picked_up

function Movable:set_post_picked_up(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Called for entity that just has been picked up

source

set_post_process_input

function Movable:set_post_process_input(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_release

function Movable:set_post_release(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

Called for entity that just has been thrown/dropped

source

set_post_set_cursed

function Movable:set_post_set_cursed(fun: fun(self: Entity?, b: boolean, effect: boolean)): integer
fun: fun(self: Entity?, b: boolean, effect: boolean)

Returns integer

source

set_post_set_standing_on

function Movable:set_post_set_standing_on(fun: fun(self: Entity?, entity_uid: integer)): integer
fun: fun(self: Entity?, entity_uid: integer)

Returns integer

source

set_post_sprint_factor

function Movable:set_post_sprint_factor(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_standing_on

function Movable:set_post_standing_on(fun: fun(self: Entity?)): integer
fun: fun(self: Entity?)

Returns integer

source

set_post_stomped_by

function Movable:set_post_stomped_by(fun: fun(self: Entity?, stomper: Entity?)): integer
fun: fun(self: Entity?, stomper: Entity?)

Returns integer

source

set_post_stun

function Movable:set_post_stun(fun: fun(self: Entity?, framecount: integer)): integer
fun: fun(self: Entity?, framecount: integer)

Returns integer

source

set_post_thrown_by

function Movable:set_post_thrown_by(fun: fun(self: Entity?, thrower: Entity?)): integer
fun: fun(self: Entity?, thrower: Entity?)

Returns integer

source

set_post_thrown_into

function Movable:set_post_thrown_into(fun: fun(self: Entity?, victim: Entity?)): integer
fun: fun(self: Entity?, victim: Entity?)

Returns integer

Same as above, but for being thrown into something and potentially dealing damage that way

source

set_post_virtual

function Movable:set_post_virtual(index: integer, fun: function): integer?
index: integer
fun: function
Callback signature not known from the code.

Returns integer? (may be nil)

source

set_post_web_collision

function Movable:set_post_web_collision(fun: fun(self: Entity?, p2: boolean)): integer
fun: fun(self: Entity?, p2: boolean)

Returns integer

source

set_pre_apply_friction

function Movable:set_pre_apply_friction(fun: fun(self: Entity?, p2: number, vertical: boolean, p4: number): boolean): integer
fun: fun(self: Entity?, p2: number, vertical: boolean, p4: number): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_apply_movement

function Movable:set_pre_apply_movement(fun: fun(self: Entity?, p2: integer, p3: integer, p4: integer): boolean?): integer
fun: fun(self: Entity?, p2: integer, p3: integer, p4: integer): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_apply_velocity

function Movable:set_pre_apply_velocity(fun: fun(self: Entity?, velocities: Vec2?, ignore_weight: boolean): boolean): integer
fun: fun(self: Entity?, velocities: Vec2?, ignore_weight: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Mostly used for ragdoll by the game

source

set_pre_attack

function Movable:set_pre_attack(fun: fun(self: Entity?, victim: Entity?): boolean?): integer
fun: fun(self: Entity?, victim: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Runs on contact damage, returns false if there wasn't any interaction (called from on_collision2, will be called as long as the hitboxes overlap)

source

set_pre_body_destruction

function Movable:set_pre_body_destruction(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_break_block

function Movable:set_pre_break_block(fun: fun(self: Entity?, camera_shake: boolean, block: Entity?): boolean): integer
fun: fun(self: Entity?, camera_shake: boolean, block: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_calculate_jump_velocity

function Movable:set_pre_calculate_jump_velocity(fun: fun(self: Entity?, dont_ignore_liquid: boolean): number?): integer
fun: fun(self: Entity?, dont_ignore_liquid: boolean): number?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_can_be_picked_up_by

function Movable:set_pre_can_be_picked_up_by(fun: fun(self: Entity?, entity_picking_up: Entity?, p3: boolean): boolean?): integer
fun: fun(self: Entity?, entity_picking_up: Entity?, p3: boolean): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_can_break_block

function Movable:set_pre_can_break_block(fun: fun(self: Entity?, horizontal: boolean, block: Entity?): boolean?): integer
fun: fun(self: Entity?, horizontal: boolean, block: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_can_jump

function Movable:set_pre_can_jump(fun: fun(self: Entity?): boolean?): integer
fun: fun(self: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently.

source

set_pre_check_out_of_bounds

function Movable:set_pre_check_out_of_bounds(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Disable to not get killed outside level bounds.

source

set_pre_cloned_to

function Movable:set_pre_cloned_to(fun: fun(self: Entity?, clone: Entity?, some_entity_uid: integer): boolean): integer
fun: fun(self: Entity?, clone: Entity?, some_entity_uid: integer): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Entities must be of the same type!

source

set_pre_collect_treasure

function Movable:set_pre_collect_treasure(fun: fun(self: Entity?, value: integer, treasure: integer): boolean?): integer
fun: fun(self: Entity?, value: integer, treasure: integer): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Adds or subtracts the specified amount of money to the movable's (player's) inventory. Shows the calculation animation in the HUD. Adds treasure to the inventory list shown on transition. Use the global add_money to add money without adding specific treasure.

source

set_pre_crush

function Movable:set_pre_crush(fun: fun(self: Entity?, p2: Entity?): boolean): integer
fun: fun(self: Entity?, p2: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_damage

function Movable:set_pre_damage(fun: fun(self: Entity?, damage_dealer: Entity?, damage_amount: integer, damage_flags: integer, velocity: Vec2?, unknown_damage_phase: integer, stun_amount: integer, iframes: integer, unknown_is_final: boolean): boolean?): integer
fun: fun(self: Entity?, damage_dealer: Entity?, damage_amount: integer, damage_flags: integer, velocity: Vec2?, unknown_damage_phase: integer, stun_amount: integer, iframes: integer, unknown_is_final: boolean): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Damage the movable by the specified amount, stuns and gives it invincibility for the specified amount of frames and applies the velocities. damage_dealer can be set to nil. Returns: true if entity was affected (for stuff like: if pot was thrown into entity, should that pot break after hit), false if the event should be ignored by damage_dealer

source

set_pre_drop

function Movable:set_pre_drop(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Called when dropping or throwing

source

set_pre_fall

function Movable:set_pre_fall(fun: fun(self: Entity?, p2: number): boolean): integer
fun: fun(self: Entity?, p2: number): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Applies gravity to entity. Disable to float like on hoverpack.

source

set_pre_freeze

function Movable:set_pre_freeze(fun: fun(self: Entity?, framecount: integer, ignore_lava: boolean): boolean): integer
fun: fun(self: Entity?, framecount: integer, ignore_lava: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Sets the frozen_timer, the param ignore_lava doesn't do much, just skips the liquid check, if in lava the game will set frozen_timer to 0 immediately most of the time

source

set_pre_generate_landing_effects

function Movable:set_pre_generate_landing_effects(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Only for landing on the floor or activefloor, generates "poof" particle and plays sfx (note: when stunned, sfx is played by the damage function)

source

set_pre_get_damage

function Movable:set_pre_get_damage(fun: fun(self: Entity?): integer?): integer
fun: fun(self: Entity?): integer?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Returns the damage that the entity deals

source

set_pre_get_damage_sound

function Movable:set_pre_get_damage_sound(fun: fun(self: Entity?, damage: integer): integer?): integer
fun: fun(self: Entity?, damage: integer): integer?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

returns sound id for the damage taken, return 0 to make it silence

source

set_pre_initialize

function Movable:set_pre_initialize(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_is_on_fire

function Movable:set_pre_is_on_fire(fun: fun(self: Entity?): boolean?): integer
fun: fun(self: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_is_powerup_capable

function Movable:set_pre_is_powerup_capable(fun: fun(self: Entity?): boolean?): integer
fun: fun(self: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_light_on_fire

function Movable:set_pre_light_on_fire(fun: fun(self: Entity?, time: integer): boolean): integer
fun: fun(self: Entity?, time: integer): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Does not damage entity

source

set_pre_on_hit

function Movable:set_pre_on_hit(fun: fun(self: Entity?, damage_dealer: Entity?): boolean): integer
fun: fun(self: Entity?, damage_dealer: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Hit by broken arrows etc that don't deal damage, calls damage with 0 damage.

source

set_pre_pick_up

function Movable:set_pre_pick_up(fun: fun(self: Entity?, entity_to_pick_up: Entity?): boolean): integer
fun: fun(self: Entity?, entity_to_pick_up: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_picked_up

function Movable:set_pre_picked_up(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Called for entity that just has been picked up

source

set_pre_process_input

function Movable:set_pre_process_input(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_release

function Movable:set_pre_release(fun: fun(self: Entity?): boolean): integer
fun: fun(self: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

Called for entity that just has been thrown/dropped

source

set_pre_set_cursed

function Movable:set_pre_set_cursed(fun: fun(self: Entity?, b: boolean, effect: boolean): boolean): integer
fun: fun(self: Entity?, b: boolean, effect: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_set_standing_on

function Movable:set_pre_set_standing_on(fun: fun(self: Entity?, entity_uid: integer): boolean): integer
fun: fun(self: Entity?, entity_uid: integer): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_sprint_factor

function Movable:set_pre_sprint_factor(fun: fun(self: Entity?): number?): integer
fun: fun(self: Entity?): number?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_standing_on

function Movable:set_pre_standing_on(fun: fun(self: Entity?): Entity?): integer
fun: fun(self: Entity?): Entity?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_stomped_by

function Movable:set_pre_stomped_by(fun: fun(self: Entity?, stomper: Entity?): boolean?): integer
fun: fun(self: Entity?, stomper: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

source

set_pre_stun

function Movable:set_pre_stun(fun: fun(self: Entity?, framecount: integer): boolean): integer
fun: fun(self: Entity?, framecount: integer): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_thrown_by

function Movable:set_pre_thrown_by(fun: fun(self: Entity?, thrower: Entity?): boolean): integer
fun: fun(self: Entity?, thrower: Entity?): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

set_pre_thrown_into

function Movable:set_pre_thrown_into(fun: fun(self: Entity?, victim: Entity?): boolean?): integer
fun: fun(self: Entity?, victim: Entity?): boolean?
Returning nil (or nothing): the original function runs (a value replaces its result and skips it).

Returns integer

Same as above, but for being thrown into something and potentially dealing damage that way

source

set_pre_virtual

function Movable:set_pre_virtual(index: integer, fun: function): integer?
index: integer
fun: function
Callback signature not known from the code.

Returns integer? (may be nil)

source

set_pre_web_collision

function Movable:set_pre_web_collision(fun: fun(self: Entity?, p2: boolean): boolean): integer
fun: fun(self: Entity?, p2: boolean): boolean
Returning nil (or nothing): treated as false: the original function runs (true skips it).

Returns integer

source

standing_on

function Movable:standing_on(): Entity?

Returns Entity? (may be nil)

source

stun

function Movable:stun(framecount: integer)
framecount: integer
source

thrown_into

function Movable:thrown_into(victim?: Entity): boolean
victim?: Entityoptional

Returns boolean

source