Goonstation 13 - Modules - TypesVar Details - Proc Details

/mob

Vars

aiAI controller for this mob - only active if is_npc is TRUE, in which case it's called by the mobAI loop at a frequency depending on mob flags
ai_tick_scheduleused for load balancing mob_ai ticks
ai_typeType path for the ai holder. Set to have the aiHolder instantiated on New()
factionFor assigning mobs various factions, see factions.dm for definitions
last_antag_popupStores the name of the last antag popup shown to the mob
last_radiation_dose_timelast time this mob got dosed with radiation
no_stamina_stunsIf TRUE then this mob won't be fully stunned by stamina stuns
observingset to observed mob if you're currently observing a mob, otherwise null
radiation_dosestores total accumulated radiation dose
radiation_dose_decaynatural decay of radiation exposure
tgui_open_uisglobal
trigger_emotesA list of emotes that trigger a special action for this mob
use_ai_toggleDo we add the special "Toggle AI" ability to this mob?

Procs

UpdateNamemob/proc/get_radiation()
add_stam_mod_maxAdds a stamina max modifier with the given key. This uses unique keys to allow for "categories" of max modifiers - so you can only have one food buff etc. If you get a buff of a category you already have, nothing will happen.
apply_color_matrixAdds a 20-length color matrix to the mob's list of color matrices cmatrix is the color matrix (must be a 16-length list!), label is the string to be used for dupe checks and removal
apply_custom_keybindsApplies the client's custom keybind changelist, fetched from the cloud.
attack_effectsAfter attack
build_keybind_stylesAdditiviely applies keybind styles onto the client's keymap.
calculate_bonus_damageReturns flat bonus damage to unarmed attacks - can also modify the attackResults passed in, e.g. to add to after_effects
calculate_bonus_stam_damagereturns additive adjustment to stamina damage for unarmed attacks (applied before stamina damage multiplier)
cancel_typingHide the typing indicator. The source signifies what action the user was typing for.
check_attack_resistanceTarget damage modifiers
closeContextActionsThe move param specifies whether the close call is generated by the mob moving
clothing_protects_from_chemsoutermost movable atom in the chain our mob is in, used to determine how text will look determines if we're located on a spike for special handling determine if we're atleast in an item held by a mob, such as a backpack
damn////Set up the new body./ Now play the degibbing animation and move them to the turf.
disarmDisarm intent
do_helpHelp intent
double_clickThis proc is called when a mob double clicks on something with the left mouse button. Return TRUE if the click was handled, FALSE otherwise. Handled doubleclicks will suppress the Click() call that follows. (Note that the Click() call for the first click always happens.)
emp_touchyHelper procs
ex_actMBC : I did this. this SUCKS. (pulling behavior is only applied in process_move... and step() doesn't trigger process_move nor is there anyway to override the step() behavior ////////////////////////////////// end suck
fake_damageMISC BULLSHIT
find_radiosearch for any radio device, starting with hands and then equipment anything else is arbitrarily too deeply hidden and stowed away to get the signal (more practically, they won't hear it)
find_tool_in_handGiven a tool flag, returns the src mob's tool in hand that matches the flag, or null
get_ability_hotkeyReturn the ability bound to the pressed ability hotkey combination
get_base_damage_multiplier/////////////////////////////////////////////////// Calculate damage ////////////////////////////////////////// multipler to unarmed attack damage dealt
get_gangReturns the gang datum of this mob, provided they have one. Otherwise returns false.
get_hudReturns the default HUD of the mob, whatever that may be
get_stam_mod_maxReturns the total modifier for stamina max
get_staminaReturns current stamina
get_taken_base_damage_multipliermultipler to unarmed damage received
get_vampire_bloodHelper procs
handle_stamina_critResponsible for executing critical hits to stamina
initializeBioholderdo you want your mob to have custom hairstyles and stuff? don't use spawns but set all of those properties here
make_dizzySorted output list. Could definitely be improved, but is functional enough.
melee_attack_testTargeting checks
notes_aliasshortcut for the Notes - View verb
observeMobset_loc(mob) and set src.observing properly - use this to observe a mob, so it can be handled properly on deletion
parry_or_dodgereturn 1 on successful dodge or parry, 0 on fail
playsound_local_not_inworldlike playsound_local but without a source atom, this just plays at a given volume
remove_color_matrixRemoves whichever matrix is associated with the label. Must be a string!
remove_stam_mod_maxRemoves a stamina max modifier with the given key.
reset_keymapBuilds the mob's keybind styles, checks for valid movement controllers, and finally sets the keymap.
say_wrapperWrappers
set_a_intentused to set the a_intent var of a mob
shared_ui_interactionpublic
stamina_stunChecks if mob should be stunned for being at or below 0 stamina and then does so.
start_typingShow the typing indicator. The source signifies what action the user is typing for.
step_towards_movedelaylike step_towards(), but respects move delay etc.
stopObservingcalled when the observed mob is deleted, override for custom behaviour.
take_radiation_doseabsorb radiation dose in Sieverts (note 0.4Sv is enough to make someone sick. 2Sv is enough to make someone dead without treatment, 4Sv is enough to make them dead.)
update_active_matrixMultiplies all of the mob's color matrices together and puts the result into src.active_color_matrix This matrix will be applied to the mob at the end of this proc, and any time the client logs in
werewolf_attackWerewolf is typically a "temporary" MR, as few people start the round as a wolf. Or TF into a wolf while being a wolf
werewolf_transformHelper procs

Var Details

ai

AI controller for this mob - only active if is_npc is TRUE, in which case it's called by the mobAI loop at a frequency depending on mob flags

ai_tick_schedule

used for load balancing mob_ai ticks

ai_type

Type path for the ai holder. Set to have the aiHolder instantiated on New()

faction

For assigning mobs various factions, see factions.dm for definitions

last_antag_popup

Stores the name of the last antag popup shown to the mob

last_radiation_dose_time

last time this mob got dosed with radiation

no_stamina_stuns

If TRUE then this mob won't be fully stunned by stamina stuns

observing

set to observed mob if you're currently observing a mob, otherwise null

radiation_dose

stores total accumulated radiation dose

radiation_dose_decay

natural decay of radiation exposure

tgui_open_uis

global

Tracks open UIs for a user.

trigger_emotes

A list of emotes that trigger a special action for this mob

use_ai_toggle

Do we add the special "Toggle AI" ability to this mob?

Proc Details

UpdateName

mob/proc/get_radiation()

add_stam_mod_max

Adds a stamina max modifier with the given key. This uses unique keys to allow for "categories" of max modifiers - so you can only have one food buff etc. If you get a buff of a category you already have, nothing will happen.

apply_color_matrix

Adds a 20-length color matrix to the mob's list of color matrices cmatrix is the color matrix (must be a 16-length list!), label is the string to be used for dupe checks and removal

apply_custom_keybinds

Applies the client's custom keybind changelist, fetched from the cloud.

Called by build_keybind_styles if not resetting the custom keybinds of a u

attack_effects

After attack

build_keybind_styles

Additiviely applies keybind styles onto the client's keymap.

To be extended upon in children types that want to have special keybind handling.

Call this proc first, and then do your specific application of keybind styles.

calculate_bonus_damage

Returns flat bonus damage to unarmed attacks - can also modify the attackResults passed in, e.g. to add to after_effects

calculate_bonus_stam_damage

returns additive adjustment to stamina damage for unarmed attacks (applied before stamina damage multiplier)

cancel_typing

Hide the typing indicator. The source signifies what action the user was typing for.

check_attack_resistance

Target damage modifiers

closeContextActions

The move param specifies whether the close call is generated by the mob moving

clothing_protects_from_chems

outermost movable atom in the chain our mob is in, used to determine how text will look determines if we're located on a spike for special handling determine if we're atleast in an item held by a mob, such as a backpack

damn

////Set up the new body./ Now play the degibbing animation and move them to the turf.

disarm

Disarm intent

do_help

Help intent

double_click

This proc is called when a mob double clicks on something with the left mouse button. Return TRUE if the click was handled, FALSE otherwise. Handled doubleclicks will suppress the Click() call that follows. (Note that the Click() call for the first click always happens.)

emp_touchy

Helper procs

ex_act

MBC : I did this. this SUCKS. (pulling behavior is only applied in process_move... and step() doesn't trigger process_move nor is there anyway to override the step() behavior ////////////////////////////////// end suck

fake_damage

MISC BULLSHIT

find_radio

search for any radio device, starting with hands and then equipment anything else is arbitrarily too deeply hidden and stowed away to get the signal (more practically, they won't hear it)

find_tool_in_hand

Given a tool flag, returns the src mob's tool in hand that matches the flag, or null

get_ability_hotkey

Return the ability bound to the pressed ability hotkey combination

get_base_damage_multiplier

/////////////////////////////////////////////////// Calculate damage ////////////////////////////////////////// multipler to unarmed attack damage dealt

get_gang

Returns the gang datum of this mob, provided they have one. Otherwise returns false.

get_hud

Returns the default HUD of the mob, whatever that may be

get_stam_mod_max

Returns the total modifier for stamina max

get_stamina

Returns current stamina

get_taken_base_damage_multiplier

multipler to unarmed damage received

get_vampire_blood

Helper procs

handle_stamina_crit

Responsible for executing critical hits to stamina

initializeBioholder

do you want your mob to have custom hairstyles and stuff? don't use spawns but set all of those properties here

make_dizzy

Sorted output list. Could definitely be improved, but is functional enough.

melee_attack_test

Targeting checks

notes_alias

shortcut for the Notes - View verb

observeMob

set_loc(mob) and set src.observing properly - use this to observe a mob, so it can be handled properly on deletion

parry_or_dodge

return 1 on successful dodge or parry, 0 on fail

playsound_local_not_inworld

like playsound_local but without a source atom, this just plays at a given volume

remove_color_matrix

Removes whichever matrix is associated with the label. Must be a string!

remove_stam_mod_max

Removes a stamina max modifier with the given key.

reset_keymap

Builds the mob's keybind styles, checks for valid movement controllers, and finally sets the keymap.

Called on: Login, Vehicle change, WASD/TG/AZERTY toggle, Keybind menu Reset

say_wrapper

Wrappers

set_a_intent

used to set the a_intent var of a mob

shared_ui_interaction

public

Standard interaction/sanity checks. Different mob types may have overrides.

return UI_state The state of the UI.

stamina_stun

Checks if mob should be stunned for being at or below 0 stamina and then does so.

This is in a proc so we can easily instantly apply the stun from other areas of the game.

For example: You'd put this on a weapon after it removes stamina to make sure the stun applies instantly and not on the next life tick.

start_typing

Show the typing indicator. The source signifies what action the user is typing for.

step_towards_movedelay

like step_towards(), but respects move delay etc.

stopObserving

called when the observed mob is deleted, override for custom behaviour.

take_radiation_dose

absorb radiation dose in Sieverts (note 0.4Sv is enough to make someone sick. 2Sv is enough to make someone dead without treatment, 4Sv is enough to make them dead.)

update_active_matrix

Multiplies all of the mob's color matrices together and puts the result into src.active_color_matrix This matrix will be applied to the mob at the end of this proc, and any time the client logs in

werewolf_attack

Werewolf is typically a "temporary" MR, as few people start the round as a wolf. Or TF into a wolf while being a wolf

werewolf_transform

Helper procs