Ported /tg/ style screen alerts, replacing the hunger icon with them

This adds throw_alert() and /obj/screen/alert, a system that allows you to do custom hud alerts for any variety of things from "You're too cold!" to mecha status indicators for the pilot.

There's quite a few things that actually got replaced; the
fire/oxy/tox/co2 alerts are all now just alerts, as is nutrition. There's also a number of new alerts, such as blindness, highness, legcuffed, buckled, handcuffed, and probably some more I missed; read code/_onclick/hud/alert.dm and see for yourself!

Additionally, a number of tweaks have been done to resisting code, to make it so that there's an indicator when you're buckled or handcuffed, and can just click the alert to start resisting. This includes a refactor that combines the logic for lockers, holders all into one proc, called container_resist().

Also, the health and internals indicator got moved down one tile each. Needed room for the alerts. If we add the oxygen tank action buttons from /tg/ and remove the internals indicator, the health indicator can go back where it was originally.

Alerts, pictured in the top right.
![https://i.imgur.com/H7Bipci.png](https://i.imgur.com/H7Bipci.png)
This commit is contained in:
Rykka
2020-05-23 04:48:47 -04:00
parent 656cbe79ea
commit fc1d6e741c
47 changed files with 928 additions and 556 deletions
+11 -1
View File
@@ -469,6 +469,8 @@ This function completely restores a damaged organ to perfect condition.
if(!istype(implanted_object,/obj/item/weapon/implant)) // We don't want to remove REAL implants. Just shrapnel etc.
implanted_object.loc = get_turf(src)
implants -= implanted_object
if(!owner.has_embedded_objects())
owner.clear_alert("embeddedobject")
if(owner && !ignore_prosthetic_prefs)
if(owner.client && owner.client.prefs && owner.client.prefs.real_name == owner.real_name)
@@ -1167,6 +1169,7 @@ Note that amputating the affected organ does in fact remove the infection from t
implants += W
owner.embedded_flag = 1
owner.verbs += /mob/proc/yank_out_object
owner.throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
W.add_blood(owner)
if(ismob(W.loc))
var/mob/living/H = W.loc
@@ -1355,4 +1358,11 @@ Note that amputating the affected organ does in fact remove the infection from t
if(bling.body_parts_covered & src.body_part)
covering_clothing |= bling
return covering_clothing
return covering_clothing
/mob/living/carbon/human/proc/has_embedded_objects()
. = 0
for(var/obj/item/organ/external/L in organs)
for(var/obj/item/I in L.implants)
if(!istype(I,/obj/item/weapon/implant) && !istype(I,/obj/item/device/nif))
return 1