mob

Vars | |
logout_time | Integer or null. Stores the world.time value at the time of Logout() . If null , the mob is either considered logged in or has never logged out. |
---|---|
renderers | Renderers on /mob We attach renderers to mobs for their lifespan. Only mobs with clients get renderers, and they are removed again when the mob loses its client. Mobs get their own unique renderer instances but it would not be inconceivable to share them globally. The list of renderers associated with this mob. |
Procs | |
AltClickOn | Called when the mob alt+clicks on an atom. By default, this calls the targeted atom's on_click/alt extension's on_click() proc, or the atom's AltClick() proc. |
CreateRenderers | Creates the mob's renderers on /Login() |
CtrlAltClickOn | Called when the mob ctrl+alt+clicks on an atom. By default, this calls the atom's CtrlAltClick() proc or calls the mob's pointed() proc. |
CtrlClickOn | Called when the mob ctrl+clicks on an atom. By default, this calls the targeted atom's CtrlClick() proc. |
CtrlShiftClickOn | Called when the mob ctrl+shift+clicks on an atom. By default, calls the atom's CtrlShiftClick() proc. |
GetAllHeld | Fetches all held items of the given path. |
HandsEmpty | Whether or not the mob's hands or other holding slots are empty. Returns boolean. |
HasFreeHand | Whether or not the mob has any free hands/holding slots. |
IsHolding | Checks if a given item or path is in any of the mob's hands or other holding slots. |
MiddleClickOn | Called when a mob middle-clicks on an object. By default, this is used only as a hotkey to call swap_hand() . |
RangedAttack | Called when a mob attmepts to interact with an object that it is not adjacent to. For complex mobs, this includes interacting with an empty hand or empty module. |
RemoveRenderers | Removes the mob's renderers on /Logout() |
RestrainedClickOn | Called when a mob attempts to interact with an atom while handcuffed or otherwise restrained. Not currently used. |
ShiftClickOn | Called when the mob shift+clicks on an atom. By default, this calls the targeted atom's ShiftClick() proc. |
ShowMemories | Verbs |
UnarmedAttack | Called when the mob interacts with something it is adjacent to. For complex mobs, this includes interacting with an empty hand or empty module. Generally, this translates to attack_hand() , attack_robot() , etc. |
add_to_living_mob_list | Life Handling |
attack_empty_hand | Called when a mob attempts to use an empty hand on itself. |
direct_machine_interface | Whether or not the mob can directly interact with the machine regardless of screen and input status. Checked in CanUseTopic() . |
drop_item | Drops the item in our active hand. TODO: rename this to drop_active_hand or something Make sure you are ABSOLUTELY CERTAIN you need to drop this and ignore unequip checks (For example, grabs can be "dropped" but only willingly) Else use unequip_item |
equip_to_appropriate_slot | Place I into the first slot it fits in the order of slots_by_priority, returning the slot or falsy. |
equip_to_slot | UNSAFELY place I into this mob's inventory at slot if existentially possible. Generally, use the _if_possible version. |
equip_to_slot_if_possible | Attempt to place I into this mob's inventory at slot. See TRYEQUIP_* flags for behavior modifiers. |
get_attack_speed | Used to get how fast a mob should attack, and influences click delay. This is just for inheritance. |
has_danger_grab | Checks if the target has a grab from the user |
isEquipped | Returns truthy when item is in the mobs inventory slots, or in slot if specified. |
is_species | Determine if the mob is the supplied species by text name, species path, or species instance name |
set_see_in_dark | See In Dark Set Handling |
set_see_invisible | See Invisible Set Handling |
set_sight | Sight Set Handling |
Var Details
logout_time

Integer or null. Stores the world.time
value at the time of Logout()
. If null
, the mob is either considered logged in or has never logged out.
renderers

Renderers on /mob We attach renderers to mobs for their lifespan. Only mobs with clients get renderers, and they are removed again when the mob loses its client. Mobs get their own unique renderer instances but it would not be inconceivable to share them globally. The list of renderers associated with this mob.
Proc Details
AltClickOn
Called when the mob alt+clicks on an atom. By default, this calls the targeted atom's on_click/alt
extension's on_click()
proc, or the atom's AltClick()
proc.
Parameters:
A
- The atom that was clicked on.
CreateRenderers
Creates the mob's renderers on /Login()
CtrlAltClickOn
Called when the mob ctrl+alt+clicks on an atom. By default, this calls the atom's CtrlAltClick()
proc or calls the mob's pointed()
proc.
Parameters:
A
- The atom that was clicked on.
CtrlClickOn
Called when the mob ctrl+clicks on an atom. By default, this calls the targeted atom's CtrlClick()
proc.
Parameters:
A
- The atom that was clicked on.
Returns boolean - Whether or not the action was handled.
CtrlShiftClickOn
Called when the mob ctrl+shift+clicks on an atom. By default, calls the atom's CtrlShiftClick()
proc.
Parameters:
A
- The atom that was clicked on.
GetAllHeld
Fetches all held items of the given path.
If not passed any parameters, will simply fetch all held items.
Parameters:
item_path
(path) - Path to the item type to fetch. Must be a type of/obj/item
.
Returns list of found instances, or null.
HandsEmpty
Whether or not the mob's hands or other holding slots are empty. Returns boolean.
HasFreeHand
Whether or not the mob has any free hands/holding slots.
IsHolding
Checks if a given item or path is in any of the mob's hands or other holding slots.
Parameters:
item
- The item to check for. Either a reference or a path. If a path, will check for any instance of path or its subtypes.
Returns instance of /obj/item
or null
. the item found in the mob's hands.
MiddleClickOn
Called when a mob middle-clicks on an object. By default, this is used only as a hotkey to call swap_hand()
.
Parameters:
A
- The atom that was clicked on.
RangedAttack
Called when a mob attmepts to interact with an object that it is not adjacent to. For complex mobs, this includes interacting with an empty hand or empty module.
Exception: Telekinesis will call UnarmedAttack([target], 0)
instead.
Parameters:
A
- The atom that was clicked on/interacted with.params
- List of click parameters. See BYOND'sCLick()
documentation.
Returns boolean - Whether or not the mob was able to perform the interaction.
RemoveRenderers
Removes the mob's renderers on /Logout()
RestrainedClickOn
Called when a mob attempts to interact with an atom while handcuffed or otherwise restrained. Not currently used.
Parameters:
A
- The atom that was clicked on/interacted with.
ShiftClickOn
Called when the mob shift+clicks on an atom. By default, this calls the targeted atom's ShiftClick()
proc.
Parameters:
A
- The atom that was clicked on.
ShowMemories
Verbs
UnarmedAttack
Called when the mob interacts with something it is adjacent to. For complex mobs, this includes interacting with an empty hand or empty module. Generally, this translates to attack_hand()
, attack_robot()
, etc.
Exception: This is also called when telekinesis is used, even if not adjacent to the target.
Parameters:
A
- The atom that was clicked on/interacted with.proximity_flag
- Whether or not the mob was at range from the targeted atom. Generally, this is always1
unless telekinesis was used, where this will be0
. This is not currently passed to attack_hand, and is instead used in human click code to allow glove touches only at melee range.
Returns boolean - Whether or not the mob was able to perform the interaction.
add_to_living_mob_list
Life Handling
attack_empty_hand
Called when a mob attempts to use an empty hand on itself.
Parameters:
bp_hand
(string,BP_R_HAND
orBP_L_HAND
) - The targeted and used hand's bodypart slot.
direct_machine_interface
Whether or not the mob can directly interact with the machine regardless of screen and input status. Checked in CanUseTopic()
.
drop_item
Drops the item in our active hand. TODO: rename this to drop_active_hand or something Make sure you are ABSOLUTELY CERTAIN you need to drop this and ignore unequip checks (For example, grabs can be "dropped" but only willingly) Else use unequip_item
equip_to_appropriate_slot
Place I into the first slot it fits in the order of slots_by_priority, returning the slot or falsy.
equip_to_slot
UNSAFELY place I into this mob's inventory at slot if existentially possible. Generally, use the _if_possible version.
equip_to_slot_if_possible
Attempt to place I into this mob's inventory at slot. See TRYEQUIP_* flags for behavior modifiers.
get_attack_speed
Used to get how fast a mob should attack, and influences click delay. This is just for inheritance.
Parameters:
W
- The item being used in the attack, if any.
Returns a number indicating the determined attack cooldown/speed.
has_danger_grab
Checks if the target has a grab from the user
isEquipped
Returns truthy when item is in the mobs inventory slots, or in slot if specified.
is_species
Determine if the mob is the supplied species by text name, species path, or species instance name
set_see_in_dark
See In Dark Set Handling
set_see_invisible
See Invisible Set Handling
set_sight
Sight Set Handling