/tg/ Station 13 - Modules - TypesVar Details - Proc Details

robot_defines

Definitions for /mob/living/silicon/robot and its children, including AI shells.

Vars

can_ride_typecacheWhat types of mobs are allowed to ride/buckle to this mob
cellIf this is a path, this gets created as an object in Initialize.
disabled_modulesFor checking which modules are disabled or not.
identRandom serial number generated for each cyborg upon its initialization
ion_trailIonpulse effect.
ionpulseJetpack-like effect.
ionpulse_onJetpack-like effect.
lampButtonLamp button reference
lamp_colorSet lamp color
lamp_doomSet to true if a doomsday event is locking our lamp to on and RED
lamp_enabledIf the lamp is turned on
lamp_functionalIf the lamp isn't broken.
lamp_intensityLamp brightness. Starts at 3, but can be 1 - 5.
lockchargeBoolean of whether the borg is locked down or not
low_power_modeWhether the robot has no charge left.
magpulseMagboot-like effect.
modelRepresents the cyborg's model (engineering, medical, etc.)
modularInterfaceThe reference to the built-in tablet that borgs carry.
previous_healththe last health before updating - to check net change in health
robot_suitUsed for deconstruction to remember what the borg was constructed out of.
scrambledcodesUsed to determine if a borg shows up on the robotics console. Setting to TRUE hides them.
shown_robot_modulesUsed to determine whether they have the module menu shown or not
spark_systemSo they can initialize sparks whenever/N

Procs

ExitedChecking Exited() to detect if a hat gets up and walks off. Drones and pAIs might do this, after all.
activate_moduleFinds the first available slot and attemps to put item item_module in it.
activatedChecks if the item is currently in a slot.
add_to_upgradesUse this to add upgrades to robots. It'll register signals for when the upgrade is moved or deleted, if not single use.
break_all_cyborg_slotsBreaks all of a cyborg's slots.
break_cyborg_slotBreaks the slot number, changing the icon.
cycle_modulesCycles through the list of enabled modules, deselecting the current one and selecting the next one.
deploy_initdeploy_init: Deploys AI unit into AI shell
deselect_moduleDeselects the module in the slot module_num. Arguments
equip_module_to_slotWhat's the first free slot for the borg? Is passed an item and a module slot. Equips the item to that borg slot.
get_active_held_itemReturns the thing in our active hand (whatever is in our active module-slot, in this case)
get_selected_moduleThe number of module slots we're checking Returns the slot number of the selected module, or zero if no modules are selected.
is_invalid_module_numberChecks if the provided module number is a valid number.
logeventRecords an IC event log entry in the cyborg's internal tablet.
make_shellmake_shell: Makes an AI shell out of a cyborg unit
observer_screen_updateUpdates the observers's screens with cyborg itemss. Arguments
on_light_eaterSpecial handling for getting hit with a light eater
on_upgrade_deletedCalled when an applied upgrade is deleted.
remove_from_upgradesCalled when an upgrade is moved outside the robot. So don't call this directly, use forceMove etc.
repair_all_cyborg_slotsRepairs all slots. Unbroken slots are unaffected.
repair_cyborg_slotRepairs the slot number, updating the icon.
revert_shellrevert_shell: Reverts AI shell back into a normal cyborg unit
select_moduleSelects the module in the slot module_num. Arguments
set_lockchargeReports the event of the change in value of the lockcharge variable.
setup_default_nameUsed to setup the a basic and (somewhat) unique name for the robot.
smash_headlampHandles headlamp smashing
toggle_headlampHandles headlamp toggling, disabling, and color setting.
toggle_moduleToggles selection of the module in the slot module_num. Arguments
uneq_activeUnequips the active held item, if there is one.
uneq_allUnequips all held items.
unequip_module_from_slotUnequips item item_module from slot module_num. Deletes it if delete_after = TRUE.
update_sightthe current percent health of the robot (-1 to 1)
updatenameUpdates the borg name taking the client preferences into account.

Var Details

can_ride_typecache

What types of mobs are allowed to ride/buckle to this mob

cell

If this is a path, this gets created as an object in Initialize.

disabled_modules

For checking which modules are disabled or not.

ident

Random serial number generated for each cyborg upon its initialization

ion_trail

Ionpulse effect.

ionpulse

Jetpack-like effect.

ionpulse_on

Jetpack-like effect.

lampButton

Lamp button reference

lamp_color

Set lamp color

lamp_doom

Set to true if a doomsday event is locking our lamp to on and RED

lamp_enabled

If the lamp is turned on

lamp_functional

If the lamp isn't broken.

lamp_intensity

Lamp brightness. Starts at 3, but can be 1 - 5.

lockcharge

Boolean of whether the borg is locked down or not

low_power_mode

Whether the robot has no charge left.

magpulse

Magboot-like effect.

model

Represents the cyborg's model (engineering, medical, etc.)

modularInterface

The reference to the built-in tablet that borgs carry.

previous_health

the last health before updating - to check net change in health

robot_suit

Used for deconstruction to remember what the borg was constructed out of.

scrambledcodes

Used to determine if a borg shows up on the robotics console. Setting to TRUE hides them.

shown_robot_modules

Used to determine whether they have the module menu shown or not

spark_system

So they can initialize sparks whenever/N

Proc Details

Exited

Checking Exited() to detect if a hat gets up and walks off. Drones and pAIs might do this, after all.

activate_module

Finds the first available slot and attemps to put item item_module in it.

Arguments

activated

Checks if the item is currently in a slot.

If the item is found in a slot, this returns TRUE. Otherwise, it returns FALSE Arguments

add_to_upgrades

Use this to add upgrades to robots. It'll register signals for when the upgrade is moved or deleted, if not single use.

break_all_cyborg_slots

Breaks all of a cyborg's slots.

break_cyborg_slot

Breaks the slot number, changing the icon.

Arguments

cycle_modules

Cycles through the list of enabled modules, deselecting the current one and selecting the next one.

deploy_init

deploy_init: Deploys AI unit into AI shell

Arguments:

deselect_module

Deselects the module in the slot module_num. Arguments

equip_module_to_slot

What's the first free slot for the borg? Is passed an item and a module slot. Equips the item to that borg slot.

Arguments

get_active_held_item

Returns the thing in our active hand (whatever is in our active module-slot, in this case)

get_selected_module

The number of module slots we're checking Returns the slot number of the selected module, or zero if no modules are selected.

is_invalid_module_number

Checks if the provided module number is a valid number.

If the number is between 1 and 3 (if check_all_slots is true) or between 1 and the number of disabled modules (if check_all_slots is false), then it returns FALSE. Otherwise, it returns TRUE. Arguments

logevent

Records an IC event log entry in the cyborg's internal tablet.

Creates an entry in the borglog list of the cyborg's internal tablet, listing the current in-game time followed by the message given. These logs can be seen by the cyborg in their BorgUI tablet app. By design, logging fails if the cyborg is dead.

Arguments: arg1: a string containing the message to log.

make_shell

make_shell: Makes an AI shell out of a cyborg unit

Arguments:

observer_screen_update

Updates the observers's screens with cyborg itemss. Arguments

on_light_eater

Special handling for getting hit with a light eater

on_upgrade_deleted

Called when an applied upgrade is deleted.

remove_from_upgrades

Called when an upgrade is moved outside the robot. So don't call this directly, use forceMove etc.

repair_all_cyborg_slots

Repairs all slots. Unbroken slots are unaffected.

repair_cyborg_slot

Repairs the slot number, updating the icon.

Arguments

revert_shell

revert_shell: Reverts AI shell back into a normal cyborg unit

select_module

Selects the module in the slot module_num. Arguments

set_lockcharge

Reports the event of the change in value of the lockcharge variable.

setup_default_name

Used to setup the a basic and (somewhat) unique name for the robot.

smash_headlamp

Handles headlamp smashing

When called (such as by the shadowperson lighteater's attack), this proc will break the borg's headlamp and then call toggle_headlamp to disable the light. It also plays a sound effect of glass breaking, and tells the borg what happened to its chat. Broken lights can be repaired by using a flashlight on the borg.

toggle_headlamp

Handles headlamp toggling, disabling, and color setting.

The initial if statment is a bit long, but the gist of it is that should the lamp be on AND the update_color arg be true, we should simply change the color of the lamp but not disable it. Otherwise, should the turn_off arg be true, the lamp already be enabled, any of the normal reasons the lamp would turn off happen, or the update_color arg be passed with the lamp not on, we should set the lamp off. The update_color arg is only ever true when this proc is called from the borg tablet, when the color selection feature is used.

Arguments:

toggle_module

Toggles selection of the module in the slot module_num. Arguments

uneq_active

Unequips the active held item, if there is one.

uneq_all

Unequips all held items.

unequip_module_from_slot

Unequips item item_module from slot module_num. Deletes it if delete_after = TRUE.

Arguments

update_sight

the current percent health of the robot (-1 to 1)

updatename

Updates the borg name taking the client preferences into account.