mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Mech Examine Improvements (#21357)
This PR makes it so that examining a mech provides clickable descriptions for its hardpoints, which allows players to directly view the mechanics hints for specific pieces of equipment. I have actually tested this PR, and here's a screenshot showing it works. <img width="1576" height="550" alt="image" src="https://github.com/user-attachments/assets/2e8a949d-952f-46ae-ad79-469ace45da64" />
This commit is contained in:
@@ -156,7 +156,7 @@
|
||||
. += SPAN_NOTICE("It has the following hardpoints:")
|
||||
for(var/hardpoint in hardpoints)
|
||||
var/obj/item/I = hardpoints[hardpoint]
|
||||
. += "- <b>[hardpoint]</b>: [istype(I) ? SPAN_NOTICE("<i>[I]</i>") : "nothing"]."
|
||||
. += "- <b>[hardpoint]</b>: [istype(I) ? "<a href='byond://?src=[REF(src)];examine=[REF(I)]'>[I.name]</a>" : "nothing"]."
|
||||
else
|
||||
. += "It has <b>no visible hardpoints</b>."
|
||||
|
||||
@@ -175,23 +175,6 @@
|
||||
damage_string = SPAN_DANGER("destroyed")
|
||||
. += "Its <b>[thing.name]</b> [thing.gender == PLURAL ? "are" : "is"] [damage_string]."
|
||||
|
||||
/mob/living/heavy_vehicle/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
. += ..()
|
||||
var/list/hardpoint_hints = list()
|
||||
for(var/hardpoint in hardpoints)
|
||||
var/obj/item/mecha_equipment/I = hardpoints[hardpoint]
|
||||
if(!istype(I) || !length(I.module_hints))
|
||||
continue
|
||||
hardpoint_hints += "- <b>[hardpoint]</b>: [SPAN_NOTICE("<i>[I]</i>")]"
|
||||
hardpoint_hints += I.relayed_mechanics_hints(user, distance, is_adjacent)
|
||||
|
||||
if(length(hardpoint_hints))
|
||||
. += "Its hardpoints have the following mechanics:"
|
||||
. += hardpoint_hints
|
||||
return
|
||||
// Mech has no hardpoints, let's teach them how to fix that instead.
|
||||
. += "modules can be attached to a mech by clicking on the mech with a module in hand."
|
||||
|
||||
/mob/living/heavy_vehicle/Topic(href,href_list[])
|
||||
if (href_list["examine"])
|
||||
var/mob/M = locate(href_list["examine"])
|
||||
|
||||
Reference in New Issue
Block a user