mecha

WELCOME TO MECHA.DM, ENJOY YOUR STAY
Mechs are now (finally) vehicles, this means you can make them multicrew They can also grant select ability buttons based on occupant bitflags
Movement is handled through vehicle_move() which is called by relaymove Clicking is done by way of signals registering to the entering mob NOTE: MMIS are NOT mobs but instead contain a brain that is, so you need special checks AI also has special checks becaus it gets in and out of the mech differently Always call remove_occupant(mob) when leaving the mech so the mob is removed properly
For multi-crew, you need to set how the occupants recieve ability bitflags corresponding to their status on the vehicle(i.e: driver, gunner etc) Abilities can then be set to only apply for certain bitflags and are assigned as such automatically
Clicks are wither translated into mech_melee_attack (see mech_melee_attack.dm) Or are used to call action() on equipped gear Cooldown for gear is on the mech because exploits
Vars | |
active_thrusters | /Action vars Ref to any active thrusters we might have |
---|---|
allow_diagonal_movement | Whether this mech is allowed to move diagonally |
bumpsmash | Whether or not the mech destroys walls by running into it. |
cabin_air | Internal air mix datum |
capacitor | Keeps track of the mech's capacitor |
cell | Keeps track of the mech's cell |
completely_disabled | Just stop the mech from doing anything |
component_damage_threshold | damage threshold above which we take component damage |
connected_port | The connected air port, if we have one |
construction_state | Whether the mechs maintenance protocols are on or off |
defense_mode | Bool for energy shield on/off |
destruction_sleep_duration | Time you get slept for if you get forcible ejected by the mech exploding |
dir_in | What direction will the mech face when entered/powered on? Defaults to South. |
dna_lock | Stores the DNA enzymes of a carbon so tht only they can access the mech |
enclosed | Whether outside viewers can see the pilot inside |
equip_by_category | assoc list: key-typepathlist before init, key-equipmentlist after |
equipment_disabled | if we cant use our equipment(such as due to EMP) |
exit_delay | TIme taken to leave the mech |
facing_modifiers | Modifiers for directional damage reduction |
flat_equipment | flat equipment for iteration |
internal_damage | Bitflags for internal damage |
internal_damage_probability | % chance for internal damage to occur |
internal_damage_threshold | damage amount above which we can take internal damages |
internal_tank | The internal air tank obj of the mech |
internal_tank_valve | The setting of the valve on the internal tank |
internals_req_access | required access to change internal components |
is_currently_ejecting | Currently ejecting, and unable to do things |
leg_overload_coeff | Energy use modifier for leg overload |
leg_overload_mode | Bool for leg overload on/off |
lights_power | How powerful our lights are |
max_equip_by_category | assoc list: max equips for non-arm modules key-count |
mecha_flags | Contains flags for the mecha |
melee_cooldown | Cooldown duration between melee punches |
melee_energy_drain | How much energy we drain each time we mechpunch someone |
normal_step_energy_drain | How much energy the mech will consume each time it moves. This variable is a backup for when leg actuators affect the energy drain. |
operation_req_access | required access level for mecha operation |
overload_step_energy_drain_min | The minimum amount of energy charge consumed by leg overload |
phase_state | icon_state for flick() when phazing |
phasing | check for phasing, if it is set to text (to describe how it is phasing: "flying", "phasing") it will let the mech walk through walls. |
phasing_energy_drain | Power we use every time we phaze through something |
possible_int_damage | list of possibly dealt internal damage for this mech type |
radio | Special version of the radio, which is unsellable |
scanmod | Keeps track of the mech's scanning module |
silbutton_icon_state | In case theres a different iconstate for AI/MMI pilot(currently only used for ripley) |
smashcooldown | Cooldown length between bumpsmashes |
smoke_charges | Remaining smoke charges |
smoke_cooldown | Cooldown between using smoke |
spark_system | Spark effects are handled by this datum |
step_energy_drain | How much energy the mech will consume each time it moves. this is the current active energy consumed |
step_silent | Whether our steps are silent due to no gravity |
stepsound | Sound played when the mech moves |
strafe | Wether we are strafing |
turnsound | Sound played when the mech walks |
ui_view | ref to screen object that displays in the middle of the UI |
ui_x | Ui size, so you can make the UI bigger if you let it load a lot of stuff |
ui_y | Ui size, so you can make the UI bigger if you let it load a lot of stuff |
use_internal_tank | ////////ATMOS Whether we are currrently drawing from the internal tank |
wreckage | Typepath for the wreckage it spawns when destroyed |
Procs | |
add_capacitor | Adds a capacitor, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this. |
add_cell | Updates the values given by scanning module and capacitor tier, called when a part is removed or inserted. |
add_scanmod | Adds a scanning module, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this. |
ai_enter_mech | Hack and From Card interactions share some code, so leave that here for both to use. |
aimob_enter_mech | Handles an actual AI (simple_animal mecha pilot) entering the mech |
aimob_exit_mech | Handles an actual AI (simple_animal mecha pilot) exiting the mech |
ammo_resupply | Ammo stuff |
attack_ai | AI piloting |
diag_hud_set_mechtracking | Shows tracking beacons on the mech |
disconnect_air | Disconnects air tank- air port connection on mecha move |
display_speech_bubble | Displays a special speech bubble when someone inside the mecha speaks |
generate_action_type | MECHA ACTIONS |
get_armour_facing | returns a number for the damage multiplier for this relative angle/dir |
get_int_repair_fluff_end | gets the successful finish balloon alert flufftext |
get_int_repair_fluff_fail | gets the on-fail balloon alert flufftext |
get_int_repair_fluff_start | gets the starting balloon alert flufftext |
has_charge | Power stuff |
on_light_eater | Special light eater handling |
on_mouseclick | // Action processing //// |
operation_allowed | Access stuff |
play_stepsound | ///// Movement procs //////// |
remove_air | Atmospheric stuff |
returnPressure | fetches pressure of the gas mixture we are using |
return_temperature | fetches temp of the gas mixture we are using |
setDir | Sets the direction of the mecha and all of its occcupents, required for FOV. Alternatively one could make a recursive contents registration and register topmost direction changes in the fov component |
try_damage_component | tries to damage mech equipment depending on damage and where is being targetted |
try_deal_internal_damage | tries to deal internal damaget depending on the damage amount |
try_repair_int_damage | ///// Internal damage //////// |
Var Details
active_thrusters

/Action vars Ref to any active thrusters we might have
allow_diagonal_movement

Whether this mech is allowed to move diagonally
bumpsmash

Whether or not the mech destroys walls by running into it.
cabin_air

Internal air mix datum
capacitor

Keeps track of the mech's capacitor
cell

Keeps track of the mech's cell
completely_disabled

Just stop the mech from doing anything
component_damage_threshold

damage threshold above which we take component damage
connected_port

The connected air port, if we have one
construction_state

Whether the mechs maintenance protocols are on or off
defense_mode

Bool for energy shield on/off
destruction_sleep_duration

Time you get slept for if you get forcible ejected by the mech exploding
dir_in

What direction will the mech face when entered/powered on? Defaults to South.
dna_lock

Stores the DNA enzymes of a carbon so tht only they can access the mech
enclosed

Whether outside viewers can see the pilot inside
equip_by_category

assoc list: key-typepathlist before init, key-equipmentlist after
equipment_disabled

if we cant use our equipment(such as due to EMP)
exit_delay

TIme taken to leave the mech
facing_modifiers

Modifiers for directional damage reduction
flat_equipment

flat equipment for iteration
internal_damage

Bitflags for internal damage
internal_damage_probability

% chance for internal damage to occur
internal_damage_threshold

damage amount above which we can take internal damages
internal_tank

The internal air tank obj of the mech
internal_tank_valve

The setting of the valve on the internal tank
internals_req_access

required access to change internal components
is_currently_ejecting

Currently ejecting, and unable to do things
leg_overload_coeff

Energy use modifier for leg overload
leg_overload_mode

Bool for leg overload on/off
lights_power

How powerful our lights are
max_equip_by_category

assoc list: max equips for non-arm modules key-count
mecha_flags

Contains flags for the mecha
melee_cooldown

Cooldown duration between melee punches
melee_energy_drain

How much energy we drain each time we mechpunch someone
normal_step_energy_drain

How much energy the mech will consume each time it moves. This variable is a backup for when leg actuators affect the energy drain.
operation_req_access

required access level for mecha operation
overload_step_energy_drain_min

The minimum amount of energy charge consumed by leg overload
phase_state

icon_state for flick() when phazing
phasing

check for phasing, if it is set to text (to describe how it is phasing: "flying", "phasing") it will let the mech walk through walls.
phasing_energy_drain

Power we use every time we phaze through something
possible_int_damage

list of possibly dealt internal damage for this mech type
radio

Special version of the radio, which is unsellable
scanmod

Keeps track of the mech's scanning module
silbutton_icon_state

In case theres a different iconstate for AI/MMI pilot(currently only used for ripley)
smashcooldown

Cooldown length between bumpsmashes
smoke_charges

Remaining smoke charges
smoke_cooldown

Cooldown between using smoke
spark_system

Spark effects are handled by this datum
step_energy_drain

How much energy the mech will consume each time it moves. this is the current active energy consumed
step_silent

Whether our steps are silent due to no gravity
stepsound

Sound played when the mech moves
strafe

Wether we are strafing
turnsound

Sound played when the mech walks
ui_view

ref to screen object that displays in the middle of the UI
ui_x

Ui size, so you can make the UI bigger if you let it load a lot of stuff
ui_y

Ui size, so you can make the UI bigger if you let it load a lot of stuff
use_internal_tank

////////ATMOS Whether we are currrently drawing from the internal tank
wreckage

Typepath for the wreckage it spawns when destroyed
Proc Details
add_capacitor
Adds a capacitor, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this.
add_cell
Updates the values given by scanning module and capacitor tier, called when a part is removed or inserted.
/// Helpers /////////
Adds a cell, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this.
add_scanmod
Adds a scanning module, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this.
ai_enter_mech
Hack and From Card interactions share some code, so leave that here for both to use.
aimob_enter_mech
Handles an actual AI (simple_animal mecha pilot) entering the mech
aimob_exit_mech
Handles an actual AI (simple_animal mecha pilot) exiting the mech
ammo_resupply
Ammo stuff
attack_ai
AI piloting
diag_hud_set_mechtracking
Shows tracking beacons on the mech
disconnect_air
Disconnects air tank- air port connection on mecha move
display_speech_bubble
Displays a special speech bubble when someone inside the mecha speaks
generate_action_type
MECHA ACTIONS
get_armour_facing
returns a number for the damage multiplier for this relative angle/dir
get_int_repair_fluff_end
gets the successful finish balloon alert flufftext
get_int_repair_fluff_fail
gets the on-fail balloon alert flufftext
get_int_repair_fluff_start
gets the starting balloon alert flufftext
has_charge
Power stuff
on_light_eater
Special light eater handling
on_mouseclick
// Action processing ////
Called when a driver clicks somewhere. Handles everything like equipment, punches, etc.
operation_allowed
Access stuff
play_stepsound
///// Movement procs ////////
Plays the mech step sound effect. Split from movement procs so that other mechs (HONK) can override this one specific part.
remove_air
Atmospheric stuff
returnPressure
fetches pressure of the gas mixture we are using
return_temperature
fetches temp of the gas mixture we are using
setDir
Sets the direction of the mecha and all of its occcupents, required for FOV. Alternatively one could make a recursive contents registration and register topmost direction changes in the fov component
try_damage_component
tries to damage mech equipment depending on damage and where is being targetted
try_deal_internal_damage
tries to deal internal damaget depending on the damage amount
try_repair_int_damage
///// Internal damage ////////
tries to repair any internal damage and plays fluff for it