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
dont_damage_owner_timer
integer
When > 0, will not deal damage to the owner_uid, so that throwing an object does not harm yourself.
sourceexit_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.
sourceknockback_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.
sourcelock_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
sourcemovex
number
Move directions (-1.0 to 1.0) that represent in whit direction the entity want's to move
sourcemovey
number
Move directions (-1.0 to 1.0) that represent in whit direction the entity want's to move
sourcepoison_tick_timer
integer
Used to apply damage from poison, can be set to -1 to cure poison, to set poison use poison_entity
sourcevelocityx
number
speed, can be relative to the platform you standing on (pushblocks, elevators), use get_velocity to get accurate speed in the game world
sourcevelocityy
number
speed, can be relative to the platform you standing on (pushblocks, elevators), use get_velocity to get accurate speed in the game world
sourceMethods
add_behavior
function Movable.add_behavior(movable?: Movable, behavior?: MovableBehavior)movable?:Movableoptionalbehavior?:MovableBehavioroptional
apply_velocity
function Movable:apply_velocity(velocities: Vec2?, ignore_weight: boolean)velocities:Vec2?ignore_weight:boolean
break_block
function Movable:break_block(camera_shake: boolean, block?: Entity)camera_shake:booleanblock?:Entityoptional
calculate_jump_velocity
function Movable:calculate_jump_velocity(dont_ignore_liquid: boolean): numberdont_ignore_liquid:boolean
Returns number
can_be_picked_up_by
function Movable:can_be_picked_up_by(entity_picking_up: Entity?, p2: boolean): booleanentity_picking_up:Entity?p2:boolean
Returns boolean
can_break_block
function Movable:can_break_block(horizontal: boolean, block?: Entity): booleanhorizontal:booleanblock?:Entityoptional
Returns boolean
clear_behavior
function Movable.clear_behavior(movable?: Movable, behavior?: MovableBehavior)movable?:Movableoptionalbehavior?:MovableBehavioroptional
collect_treasure
function Movable:collect_treasure(value: integer, treasure: ENT_TYPE): booleanvalue:integertreasure:ENT_TYPE
Returns boolean
copy_extra_info
function Movable:copy_extra_info(clone: Entity?, some_entity_uid: integer)clone:Entity?some_entity_uid:integer
damage
function Movable:damage(damage_dealer_uid: integer, damage_amount: integer, stun_time: integer, velocity_x: number, velocity_y: number, iframes?: integer): booleandamage_dealer_uid:integerdamage_amount:integerstun_time:integervelocity_x:numbervelocity_y:numberiframes?: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): booleandamage_dealer:Entity?damage_amount:integerdamage_flags:DAMAGE_TYPEvelocity:Vec2?unknown_damage_phase:integerstun_amount:integeriframes:integerunknown_is_final:boolean
Returns boolean
freeze
function Movable:freeze(framecount: integer, ignore_lava: boolean)framecount:integerignore_lava:boolean
function Movable:freeze(frame_count: integer)frame_count:integer
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)sourceget_base_behavior
function Movable.get_base_behavior(movable: Movable?, state_id: integer): VanillaMovableBehavior?movable:Movable?state_id:integer
Returns VanillaMovableBehavior? (may be nil)
get_damage_sound
function Movable:get_damage_sound(damage: DAMAGE_TYPE): SOUNDIDdamage:DAMAGE_TYPE
Returns SOUNDID
is_button_held
function Movable:is_button_held(button: BUTTON): booleanbutton:BUTTON
Returns boolean
is_button_pressed
function Movable:is_button_pressed(button: BUTTON): booleanbutton:BUTTON
Returns boolean
is_button_released
function Movable:is_button_released(button: BUTTON): booleanbutton:BUTTON
Returns boolean
light_on_fire
function Movable:light_on_fire()function Movable:light_on_fire(time: integer)time:integer
set_behavior
function Movable:set_behavior(behavior_id: integer): booleanbehavior_id:integer
Returns boolean
set_cursed
function Movable:set_cursed(b: boolean, effect: boolean)b:booleaneffect:boolean
function Movable:set_cursed(b: boolean)b:boolean
set_post_apply_friction
function Movable:set_post_apply_friction(fun: fun(self: Entity?, p2: number, vertical: boolean, p4: number)): integerfun:fun(self: Entity?, p2: number, vertical: boolean, p4: number)
Returns integer
set_post_apply_movement
function Movable:set_post_apply_movement(fun: fun(self: Entity?, p2: integer, p3: integer, p4: integer)): integerfun:fun(self: Entity?, p2: integer, p3: integer, p4: integer)
Returns integer
set_post_apply_velocity
function Movable:set_post_apply_velocity(fun: fun(self: Entity?, velocities: Vec2?, ignore_weight: boolean)): integerReturns integer
Mostly used for ragdoll by the game
sourceset_post_attack
function Movable:set_post_attack(fun: fun(self: Entity?, victim: Entity?)): integerReturns 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)
sourceset_post_body_destruction
function Movable:set_post_body_destruction(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_break_block
function Movable:set_post_break_block(fun: fun(self: Entity?, camera_shake: boolean, block: Entity?)): integerReturns integer
set_post_calculate_jump_velocity
function Movable:set_post_calculate_jump_velocity(fun: fun(self: Entity?, dont_ignore_liquid: boolean)): integerfun:fun(self: Entity?, dont_ignore_liquid: boolean)
Returns integer
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)): integerReturns integer
set_post_can_break_block
function Movable:set_post_can_break_block(fun: fun(self: Entity?, horizontal: boolean, block: Entity?)): integerReturns integer
set_post_can_jump
function Movable:set_post_can_jump(fun: fun(self: Entity?)): integerfun: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.
sourceset_post_check_out_of_bounds
function Movable:set_post_check_out_of_bounds(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
Disable to not get killed outside level bounds.
sourceset_post_cloned_to
function Movable:set_post_cloned_to(fun: fun(self: Entity?, clone: Entity?, some_entity_uid: integer)): integerReturns integer
Entities must be of the same type!
sourceset_post_collect_treasure
function Movable:set_post_collect_treasure(fun: fun(self: Entity?, value: integer, treasure: integer)): integerfun: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.
sourceset_post_crush
function Movable:set_post_crush(fun: fun(self: Entity?, p2: Entity?)): integerReturns integer
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)): integerfun: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
set_post_drop
function Movable:set_post_drop(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
Called when dropping or throwing
sourceset_post_fall
function Movable:set_post_fall(fun: fun(self: Entity?, p2: number)): integerfun:fun(self: Entity?, p2: number)
Returns integer
Applies gravity to entity. Disable to float like on hoverpack.
sourceset_post_freeze
function Movable:set_post_freeze(fun: fun(self: Entity?, framecount: integer, ignore_lava: boolean)): integerfun: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
set_post_generate_landing_effects
function Movable:set_post_generate_landing_effects(fun: fun(self: Entity?)): integerfun: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)
sourceset_post_get_damage
function Movable:set_post_get_damage(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
Returns the damage that the entity deals
sourceset_post_get_damage_sound
function Movable:set_post_get_damage_sound(fun: fun(self: Entity?, damage: integer)): integerfun:fun(self: Entity?, damage: integer)
Returns integer
returns sound id for the damage taken, return 0 to make it silence
sourceset_post_initialize
function Movable:set_post_initialize(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_is_on_fire
function Movable:set_post_is_on_fire(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_is_powerup_capable
function Movable:set_post_is_powerup_capable(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_light_on_fire
function Movable:set_post_light_on_fire(fun: fun(self: Entity?, time: integer)): integerfun:fun(self: Entity?, time: integer)
Returns integer
Does not damage entity
sourceset_post_on_hit
function Movable:set_post_on_hit(fun: fun(self: Entity?, damage_dealer: Entity?)): integerReturns integer
Hit by broken arrows etc that don't deal damage, calls damage with 0 damage.
sourceset_post_pick_up
function Movable:set_post_pick_up(fun: fun(self: Entity?, entity_to_pick_up: Entity?)): integerReturns integer
set_post_picked_up
function Movable:set_post_picked_up(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
Called for entity that just has been picked up
sourceset_post_process_input
function Movable:set_post_process_input(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_release
function Movable:set_post_release(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
Called for entity that just has been thrown/dropped
sourceset_post_set_cursed
function Movable:set_post_set_cursed(fun: fun(self: Entity?, b: boolean, effect: boolean)): integerfun:fun(self: Entity?, b: boolean, effect: boolean)
Returns integer
set_post_set_standing_on
function Movable:set_post_set_standing_on(fun: fun(self: Entity?, entity_uid: integer)): integerfun:fun(self: Entity?, entity_uid: integer)
Returns integer
set_post_sprint_factor
function Movable:set_post_sprint_factor(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_standing_on
function Movable:set_post_standing_on(fun: fun(self: Entity?)): integerfun:fun(self: Entity?)
Returns integer
set_post_stomped_by
function Movable:set_post_stomped_by(fun: fun(self: Entity?, stomper: Entity?)): integerReturns integer
set_post_stun
function Movable:set_post_stun(fun: fun(self: Entity?, framecount: integer)): integerfun:fun(self: Entity?, framecount: integer)
Returns integer
set_post_thrown_by
function Movable:set_post_thrown_by(fun: fun(self: Entity?, thrower: Entity?)): integerReturns integer
set_post_thrown_into
function Movable:set_post_thrown_into(fun: fun(self: Entity?, victim: Entity?)): integerReturns integer
Same as above, but for being thrown into something and potentially dealing damage that way
sourceset_post_virtual
function Movable:set_post_virtual(index: integer, fun: function): integer?index:integerfun:function- Callback signature not known from the code.
Returns integer? (may be nil)
set_post_web_collision
function Movable:set_post_web_collision(fun: fun(self: Entity?, p2: boolean)): integerfun:fun(self: Entity?, p2: boolean)
Returns integer
set_pre_apply_friction
function Movable:set_pre_apply_friction(fun: fun(self: Entity?, p2: number, vertical: boolean, p4: number): boolean): integerfun: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
set_pre_apply_movement
function Movable:set_pre_apply_movement(fun: fun(self: Entity?, p2: integer, p3: integer, p4: integer): boolean?): integerfun: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
set_pre_apply_velocity
function Movable:set_pre_apply_velocity(fun: fun(self: Entity?, velocities: Vec2?, ignore_weight: boolean): boolean): integerfun: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
sourceset_pre_attack
function Movable:set_pre_attack(fun: fun(self: Entity?, victim: Entity?): boolean?): integerfun: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)
sourceset_pre_body_destruction
function Movable:set_pre_body_destruction(fun: fun(self: Entity?): boolean): integerfun:fun(self: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_break_block
function Movable:set_pre_break_block(fun: fun(self: Entity?, camera_shake: boolean, block: Entity?): boolean): integerfun: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
set_pre_calculate_jump_velocity
function Movable:set_pre_calculate_jump_velocity(fun: fun(self: Entity?, dont_ignore_liquid: boolean): number?): integerfun: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
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?): integerfun: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
set_pre_can_break_block
function Movable:set_pre_can_break_block(fun: fun(self: Entity?, horizontal: boolean, block: Entity?): boolean?): integerfun: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
set_pre_can_jump
function Movable:set_pre_can_jump(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
Return true if the entity is allowed to jump, even midair. Return false and can't jump, except from ladders apparently.
sourceset_pre_check_out_of_bounds
function Movable:set_pre_check_out_of_bounds(fun: fun(self: Entity?): boolean): integerfun: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.
sourceset_pre_cloned_to
function Movable:set_pre_cloned_to(fun: fun(self: Entity?, clone: Entity?, some_entity_uid: integer): boolean): integerfun: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!
sourceset_pre_collect_treasure
function Movable:set_pre_collect_treasure(fun: fun(self: Entity?, value: integer, treasure: integer): boolean?): integerfun: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.
sourceset_pre_crush
function Movable:set_pre_crush(fun: fun(self: Entity?, p2: Entity?): boolean): integerfun:fun(self: Entity?, p2: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
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?): integerfun: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
set_pre_drop
function Movable:set_pre_drop(fun: fun(self: Entity?): boolean): integerfun: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
sourceset_pre_fall
function Movable:set_pre_fall(fun: fun(self: Entity?, p2: number): boolean): integerfun: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.
sourceset_pre_freeze
function Movable:set_pre_freeze(fun: fun(self: Entity?, framecount: integer, ignore_lava: boolean): boolean): integerfun: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
set_pre_generate_landing_effects
function Movable:set_pre_generate_landing_effects(fun: fun(self: Entity?): boolean): integerfun: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)
sourceset_pre_get_damage
function Movable:set_pre_get_damage(fun: fun(self: Entity?): integer?): integerfun: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
sourceset_pre_get_damage_sound
function Movable:set_pre_get_damage_sound(fun: fun(self: Entity?, damage: integer): integer?): integerfun: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
sourceset_pre_initialize
function Movable:set_pre_initialize(fun: fun(self: Entity?): boolean): integerfun:fun(self: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_is_on_fire
function Movable:set_pre_is_on_fire(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
set_pre_is_powerup_capable
function Movable:set_pre_is_powerup_capable(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
set_pre_light_on_fire
function Movable:set_pre_light_on_fire(fun: fun(self: Entity?, time: integer): boolean): integerfun: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
sourceset_pre_on_hit
function Movable:set_pre_on_hit(fun: fun(self: Entity?, damage_dealer: Entity?): boolean): integerfun: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.
sourceset_pre_pick_up
function Movable:set_pre_pick_up(fun: fun(self: Entity?, entity_to_pick_up: Entity?): boolean): integerfun: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
set_pre_picked_up
function Movable:set_pre_picked_up(fun: fun(self: Entity?): boolean): integerfun: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
sourceset_pre_process_input
function Movable:set_pre_process_input(fun: fun(self: Entity?): boolean): integerfun:fun(self: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_release
function Movable:set_pre_release(fun: fun(self: Entity?): boolean): integerfun: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
sourceset_pre_set_cursed
function Movable:set_pre_set_cursed(fun: fun(self: Entity?, b: boolean, effect: boolean): boolean): integerfun:fun(self: Entity?, b: boolean, effect: boolean): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_set_standing_on
function Movable:set_pre_set_standing_on(fun: fun(self: Entity?, entity_uid: integer): boolean): integerfun:fun(self: Entity?, entity_uid: integer): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_sprint_factor
function Movable:set_pre_sprint_factor(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
set_pre_standing_on
function Movable:set_pre_standing_on(fun: fun(self: Entity?): Entity?): integerfun:fun(self: Entity?): Entity?- Returning nil (or nothing): the original function runs (a value replaces its result and skips it).
Returns integer
set_pre_stomped_by
function Movable:set_pre_stomped_by(fun: fun(self: Entity?, stomper: Entity?): boolean?): integerfun:fun(self: Entity?, stomper: Entity?): boolean?- Returning nil (or nothing): the original function runs (a value replaces its result and skips it).
Returns integer
set_pre_stun
function Movable:set_pre_stun(fun: fun(self: Entity?, framecount: integer): boolean): integerfun:fun(self: Entity?, framecount: integer): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_thrown_by
function Movable:set_pre_thrown_by(fun: fun(self: Entity?, thrower: Entity?): boolean): integerfun:fun(self: Entity?, thrower: Entity?): boolean- Returning nil (or nothing): treated as false: the original function runs (true skips it).
Returns integer
set_pre_thrown_into
function Movable:set_pre_thrown_into(fun: fun(self: Entity?, victim: Entity?): boolean?): integerfun: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
sourceset_pre_virtual
function Movable:set_pre_virtual(index: integer, fun: function): integer?index:integerfun:function- Callback signature not known from the code.
Returns integer? (may be nil)