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-13 23:32:49 -04:00
parent 656cbe79ea
commit fc1d6e741c
47 changed files with 928 additions and 556 deletions

View File

@@ -402,8 +402,7 @@
return 0 //closed but not sealed...
return 1
/obj/structure/closet/proc/mob_breakout(var/mob/living/escapee)
/obj/structure/closet/container_resist(var/mob/living/escapee)
if(breakout || !req_breakout())
return
@@ -414,30 +413,31 @@
visible_message("<span class='danger'>\The [src] begins to shake violently!</span>")
breakout = 1 //can't think of a better way to do this right now.
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
if(!do_after(escapee, 50)) //5 seconds
breakout = 0
return
if(!escapee || escapee.incapacitated() || escapee.loc != src)
breakout = 0
return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
if(!req_breakout())
breakout = 0
return
spawn(0)
breakout = 1 //can't think of a better way to do this right now.
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
if(!do_after(escapee, 50)) //5 seconds
breakout = 0
return
if(!escapee || escapee.incapacitated() || escapee.loc != src)
breakout = 0
return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
if(!req_breakout())
breakout = 0
return
playsound(src.loc, breakout_sound, 100, 1)
animate_shake()
add_fingerprint(escapee)
//Well then break it!
breakout = 0
to_chat(escapee, "<span class='warning'>You successfully break out!</span>")
visible_message("<span class='danger'>\The [escapee] successfully broke out of \the [src]!</span>")
playsound(src.loc, breakout_sound, 100, 1)
break_open()
animate_shake()
add_fingerprint(escapee)
//Well then break it!
breakout = 0
to_chat(escapee, "<span class='warning'>You successfully break out!</span>")
visible_message("<span class='danger'>\The [escapee] successfully broke out of \the [src]!</span>")
playsound(src.loc, breakout_sound, 100, 1)
break_open()
animate_shake()
/obj/structure/closet/proc/break_open()
sealed = 0