Files
Tsar-SalatandGitHub 0917d44cc8 Audits and cleans up Trigger() parent calls (#95548)
## About The Pull Request

``/datum/action/proc/Trigger(mob/clicker, trigger_flags)`` has a lot of
children, many of which use mixed ``. = ..()`` or no parent calls at
all.


https://github.com/tgstation/tgstation/blob/d65ee47f6ebd0384d463a1f2a044c321ff2d912f/code/datums/actions/action.dm#L163-L170

This PR attempts to standardize all the children procs to call parent in
a uniform way, or cements that they *shouldnt* call parent for whatever
reason.
## Why It's Good For The Game

Base proc calls are important, yanno?

The base proc has the action button signals and availability proc on it,
so its technically possible for children procs of trigger() to have
check_flags enabled, but never blocked (i.e AB_CHECK_CONSCIOUS,
AB_CHECK_HANDS_BLOCKED).

Some children procs have IsAvailable on them, but its possible they can
be skipped over if a coder is not paying attention. This reduces that
risk.
2026-04-07 14:23:25 -05:00

80 lines
2.4 KiB
Plaintext

/obj/vehicle/sealed/mecha/phazon
desc = "This is a Phazon exosuit. The pinnacle of scientific research and pride of Nanotrasen, it uses cutting edge anomalous technology and expensive materials."
name = "\improper Phazon"
icon_state = "phazon"
base_icon_state = "phazon"
movedelay = 2
step_energy_drain = 4
max_integrity = 200
armor_type = /datum/armor/mecha_phazon
max_temperature = 25000
accesses = list(ACCESS_MECH_SCIENCE, ACCESS_MECH_SECURITY)
destruction_sleep_duration = 40
exit_delay = 40
wreckage = /obj/structure/mecha_wreckage/phazon
mech_type = EXOSUIT_MODULE_PHAZON
force = 15
max_equip_by_category = list(
MECHA_L_ARM = 1,
MECHA_R_ARM = 1,
MECHA_UTILITY = 3,
MECHA_POWER = 1,
MECHA_ARMOR = 2,
)
phase_state = "phazon-phase"
/datum/armor/mecha_phazon
melee = 30
bullet = 30
laser = 30
energy = 30
bomb = 30
fire = 100
acid = 100
/obj/vehicle/sealed/mecha/phazon/generate_actions()
. = ..()
initialize_passenger_action_type(/datum/action/vehicle/sealed/mecha/mech_toggle_phasing)
initialize_passenger_action_type(/datum/action/vehicle/sealed/mecha/mech_switch_damtype)
/datum/action/vehicle/sealed/mecha/mech_switch_damtype
name = "Reconfigure arm microtool arrays"
button_icon_state = "mech_damtype_brute"
/datum/action/vehicle/sealed/mecha/mech_switch_damtype/Trigger(mob/clicker, trigger_flags)
. = ..()
if(!.)
return
if(!chassis || !(owner in chassis.occupants))
return
var/new_damtype
switch(chassis.damtype)
if(TOX)
new_damtype = BRUTE
chassis.balloon_alert(owner, "your punches will now deal brute damage")
if(BRUTE)
new_damtype = BURN
chassis.balloon_alert(owner, "your punches will now deal burn damage")
if(BURN)
new_damtype = TOX
chassis.balloon_alert(owner,"your punches will now deal toxin damage")
chassis.damtype = new_damtype
button_icon_state = "mech_damtype_[new_damtype]"
playsound(chassis, 'sound/vehicles/mecha/mechmove01.ogg', 50, TRUE)
build_all_button_icons()
/datum/action/vehicle/sealed/mecha/mech_toggle_phasing
name = "Toggle Phasing"
button_icon_state = "mech_phasing_off"
/datum/action/vehicle/sealed/mecha/mech_toggle_phasing/Trigger(mob/clicker, trigger_flags)
. = ..()
if(!.)
return
if(!chassis || !(owner in chassis.occupants))
return
chassis.phasing = chassis.phasing ? "" : "phasing"
button_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]"
chassis.balloon_alert(owner, "[chassis.phasing ? "enabled" : "disabled"] phasing")
build_all_button_icons()