Files
VMSolidus 58f8cd11ac Mech Quality Of Life Additions (#21081)
This PR adds a few much needed new features to mechs, with the main one
being Mechanics Hints. Mechs have a unique way of handling mechanical
hints, in that shift-clicking on a mech to get these hints will reveal
the hints for its equipped modules.

I've also gone through and eliminated all of the lag causing hard
deletes present in the mech code. In a typical round these won't occur
all that often, but if I'm touching all these files I might as well do
my part and certify them free of hard deletes.

Lastly, after talking with Shaft Mining players, I discovered that the
main reason they don't ever want to use mining mechs is that the warp
extraction bag is strictly superior to mining with a mech, as it lets
them teleport ores directly to the ship. So I've added an option to link
ore summoners directly to these "Warp crates", allowing a mech equipped
with one to teleport ores to the ship. Just like the bag can.
2025-08-07 22:42:58 +00:00

82 lines
2.9 KiB
Plaintext

/obj/item/mecha_equipment/mounted_system/rfd
name = "mounted rfd"
icon_state = "mecha_rfd"
holding_type = /obj/item/rfd/construction/mounted/exosuit
restricted_hardpoints = list(HARDPOINT_LEFT_HAND, HARDPOINT_RIGHT_HAND)
restricted_software = list(MECH_SOFTWARE_ENGINEERING)
module_hints = list(
"<b>Control Click(Self):</b> Activate the RFD's mode selection radial menu.",
"<b>Left Click(Target):</b> Use the RFD on the target.",
"Matter used for the RFD is synthesized directly from the mech's power supply via a phoron-catalyzed mass fabricator.",
)
/obj/item/mecha_equipment/mounted_system/rfd/CtrlClick(mob/user)
if(owner && istype(holding, /obj/item/rfd/construction/mounted/exosuit))
var/obj/item/rfd/construction/mounted/exosuit/R = holding
var/current_mode = show_radial_menu(user, owner, R.radial_modes, radius = 42, require_near = FALSE , tooltips = TRUE)
switch(current_mode)
if("Floors and Walls")
R.mode = RFD_FLOORS_AND_WALL
if("Windows and Grille")
R.mode = RFD_WINDOW_AND_FRAME
if("Airlock")
R.mode = RFD_AIRLOCK
if("Deconstruct")
R.mode = RFD_DECONSTRUCT
else
R.mode = RFD_FLOORS_AND_WALL
if(current_mode)
to_chat(user, SPAN_NOTICE("You set the device to <i>\"[current_mode]\"</i>."))
if(R.mode == 3)
playsound(get_turf(src), 'sound/weapons/laser_safetyoff.ogg', 50, FALSE)
else
playsound(get_turf(src), 'sound/weapons/laser_safetyon.ogg', 50, FALSE)
else
return
/obj/item/rfd/construction/mounted/exosuit/attack_self(mob/user) //we don't want this attack_self, as it would target the pilot not the exosuit.
return
/obj/item/rfd/construction/mounted/exosuit/get_hardpoint_maptext()
var/obj/item/mecha_equipment/mounted_system/MS = loc
if(istype(MS) && MS.owner)
var/obj/item/cell/C = MS.owner.get_cell()
if(istype(C))
return "[round(C.charge)]/[round(C.maxcharge)]"
return null
/obj/item/rfd/construction/mounted/exosuit/get_hardpoint_status_value()
var/obj/item/mecha_equipment/mounted_system/MS = loc
if(istype(MS) && MS.owner)
var/obj/item/cell/C = MS.owner.get_cell()
if(istype(C))
return C.charge/C.maxcharge
return null
/obj/item/extinguisher/mech
name = "mounted fire extinguisher"
max_water = 4000 //Good is gooder
icon = 'icons/mecha/mech_equipment.dmi'
icon_state = "mecha_exting"
safety = FALSE
/obj/item/extinguisher/mech/New()
reagents = new/datum/reagents(max_water)
reagents.my_atom = src
reagents.add_reagent(/singleton/reagent/toxin/fertilizer/monoammoniumphosphate, max_water)
..()
/obj/item/extinguisher/mech/get_hardpoint_maptext()
return "[reagents.total_volume]/[max_water]"
/obj/item/extinguisher/mech/get_hardpoint_status_value()
return reagents.total_volume/max_water
/obj/item/mecha_equipment/mounted_system/extinguisher
name = "mounted extinguisher"
icon_state = "mecha_exting"
holding_type = /obj/item/extinguisher/mech
restricted_hardpoints = list(HARDPOINT_LEFT_HAND, HARDPOINT_RIGHT_HAND)
restricted_software = list(MECH_SOFTWARE_ENGINEERING)