mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-14 07:41:23 +01:00
f905cfc020
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. The xenochimera feral indicator would probably be a good candidate for conversion, but I didn't touch it in this PR. 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, micros escaping from shoes, and struggling in a gut all into one proc, called container_resist(). This means that vore bellies actually no longer need the resist override, but it's been left in place just in case someone finds something else they want to use it for. 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.
100 lines
3.3 KiB
Plaintext
100 lines
3.3 KiB
Plaintext
/mob/living/carbon/resist_fire()
|
|
adjust_fire_stacks(-1.2)
|
|
Weaken(3)
|
|
spin(32,2)
|
|
visible_message(
|
|
"<span class='danger'>[src] rolls on the floor, trying to put themselves out!</span>",
|
|
"<span class='notice'>You stop, drop, and roll!</span>"
|
|
)
|
|
sleep(30)
|
|
if(fire_stacks <= 0)
|
|
visible_message(
|
|
"<span class='danger'>[src] has successfully extinguished themselves!</span>",
|
|
"<span class='notice'>You extinguish yourself.</span>"
|
|
)
|
|
ExtinguishMob()
|
|
return TRUE
|
|
|
|
/mob/living/carbon/resist_restraints()
|
|
var/obj/item/I = null
|
|
if(handcuffed)
|
|
I = handcuffed
|
|
else if(legcuffed)
|
|
I = legcuffed
|
|
|
|
if(I)
|
|
setClickCooldown(100)
|
|
cuff_resist(I, cuff_break = can_break_cuffs())
|
|
|
|
/mob/living/carbon/proc/reduce_cuff_time()
|
|
return FALSE
|
|
|
|
/mob/living/carbon/proc/cuff_resist(obj/item/weapon/handcuffs/I, breakouttime = 1200, cuff_break = 0)
|
|
|
|
if(istype(I))
|
|
breakouttime = I.breakouttime
|
|
|
|
var/displaytime = breakouttime / 10
|
|
|
|
var/reduceCuffTime = reduce_cuff_time()
|
|
if(reduceCuffTime)
|
|
breakouttime /= reduceCuffTime
|
|
displaytime /= reduceCuffTime
|
|
|
|
if(cuff_break)
|
|
visible_message("<span class='danger'>[src] is trying to break [I]!</span>",
|
|
"<span class='warning'>You attempt to break your [I]. (This will take around 5 seconds and you need to stand still)</span>")
|
|
|
|
if(do_after(src, 5 SECONDS, target = src, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED))
|
|
if(!I || buckled)
|
|
return
|
|
visible_message("<span class='danger'>[src] manages to break [I]!</span>",
|
|
"<span class='warning'>You successfully break your [I].</span>")
|
|
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
|
|
|
|
if(I == handcuffed)
|
|
handcuffed = null
|
|
update_handcuffed()
|
|
else if(I == legcuffed)
|
|
legcuffed = null
|
|
update_inv_legcuffed()
|
|
|
|
if(buckled && buckled.buckle_require_restraints)
|
|
buckled.unbuckle_mob()
|
|
|
|
qdel(I)
|
|
else
|
|
to_chat(src, "<span class='warning'>You fail to break [I].</span>")
|
|
return
|
|
|
|
visible_message("<span class='danger'>[src] attempts to remove [I]!</span>",
|
|
"<span class='warning'>You attempt to remove [I]. (This will take around [displaytime] seconds and you need to stand still)</span>")
|
|
if(do_after(src, breakouttime, target = src, incapacitation_flags = INCAPACITATION_DISABLED & INCAPACITATION_KNOCKDOWN))
|
|
visible_message("<span class='danger'>[src] manages to remove [I]!</span>",
|
|
"<span class='notice'>You successfully remove [I].</span>")
|
|
drop_from_inventory(I)
|
|
|
|
/mob/living/carbon/resist_buckle()
|
|
if(!buckled)
|
|
return
|
|
|
|
if(!restrained())
|
|
return ..()
|
|
|
|
setClickCooldown(100)
|
|
visible_message(
|
|
"<span class='danger'>[src] attempts to unbuckle themself!</span>",
|
|
"<span class='warning'>You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)</span>"
|
|
)
|
|
|
|
if(do_after(src, 2 MINUTES, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY)))
|
|
if(!buckled)
|
|
return
|
|
visible_message("<span class='danger'>[src] manages to unbuckle themself!</span>",
|
|
"<span class='notice'>You successfully unbuckle yourself.</span>")
|
|
buckled.user_unbuckle_mob(src, src)
|
|
|
|
/mob/living/carbon/proc/can_break_cuffs()
|
|
if(HULK in mutations)
|
|
return 1
|