diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm
index ca38a246dc0..e9b60141730 100644
--- a/code/_onclick/hud/alert.dm
+++ b/code/_onclick/hud/alert.dm
@@ -33,8 +33,12 @@
clear_alert(category)
return .()
else if(alert.icon_state == "[id][severity]")
-// src << "threw alert not in need of update [category] [id] [severity]"
- return 0
+ if(alert.timeout)
+ clear_alert(category)
+ return .()
+ else
+ // src << "threw alert not in need of update [category] [id] [severity]"
+ return 0
// src << "updating alert [category] [id] [severity]"
else
alert = PoolOrNew(/obj/screen/alert)
@@ -63,6 +67,12 @@
return 0
alert.name = initial(path_as_obj.name)
alert.desc = initial(path_as_obj.desc)
+ alert.timeout = initial(path_as_obj.timeout)
+ if(alert.timeout)
+ spawn(alert.timeout)
+ if(alert.timeout && alerts[category] == alert && world.time >= alert.timeout)
+ clear_alert(category)
+ alert.timeout = world.time + alert.timeout - world.tick_lag
alert.mouse_opacity = 1
return alert
@@ -86,6 +96,7 @@
icon_state = "default"
name = "Alert"
desc = "Something seems to have gone wrong with this alert, so report this bug please"
+ var/timeout = 0 //If set to a number, this alert will clear itself after that many deciseconds
//Gas alerts
@@ -145,6 +156,37 @@ The box in your backpack has an oxygen tank and gas mask in it."
name = "High Pressure"
desc = "The air around you is hazardously thick. A fire suit would protect you."
+/obj/screen/alert/blind
+ name = "Blind"
+ desc = "For whatever reason, you can't see. This may be caused by a genetic defect, eye trauma, being unconscious, \
+or something covering your eyes."
+
+/obj/screen/alert/high
+ name = "High"
+ desc = "Woah man, you're tripping balls! Careful you don't get addicted to this... if you aren't already."
+
+/obj/screen/alert/drunk //Not implemented
+ name = "Drunk"
+ desc = "All that alcohol you've been drinking is impairing your speech, motor skills, and mental cognition. Make sure to act like it."
+
+/obj/screen/alert/embeddedobject
+ name = "Embedded Object"
+ desc = "Something got lodged into your flesh and is causing major bleeding. It might fall out with time, but surgery is the safest way. \
+If you're feeling frisky, click yourself in help intent to pull the object out."
+
+/obj/screen/alert/asleep
+ name = "Asleep"
+ desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are."
+
+/obj/screen/alert/weightless
+ name = "Weightless"
+ desc = "Gravity has ceased affecting you, and you're floating around aimlessly. You'll need something large and heavy, like a \
+wall or lattice strucure, to push yourself off of if you want to move. A jetpack would enable free range of motion. A pair of \
+magboots would let you walk around normally on the floor. Barring those, you can throw things, use a fire extuingisher, \
+or shoot a gun to move around via Newton's 3rd Law of motion."
+
+//ALIENS
+
/obj/screen/alert/alien_tox
name = "Plasma"
desc = "There's flammable plasma in the air. If it lights up, you'll be toast."
@@ -154,6 +196,9 @@ The box in your backpack has an oxygen tank and gas mask in it."
name = "Burning"
desc = "It's too hot! Flee to space or at least away from the flames. Standing on weeds will heal you up."
+
+//SILICONS
+
/obj/screen/alert/nocell
name = "Missing Power Cell"
desc = "Unit has no power cell. No modules available until a power cell is reinstalled. Robotics may provide assistance."
@@ -167,6 +212,24 @@ Reharging stations are available in robotics, the dormitory's bathrooms. and the
name = "Low Charge"
desc = "Unit's power cell is running low. Reharging stations are available in robotics, the dormitory's bathrooms. and the AI satelite."
+//Need to cover all use cases - emag, illegal upgrade module, malf AI hack, traitor cyborg
+/obj/screen/alert/hacked
+ name = "Hacked"
+ desc = "Hazardous non-standard equipment detected. Please ensure any usage of this equipment is in line with unit's laws, if any."
+
+/obj/screen/alert/locked
+ name = "Locked Down"
+ desc = "Unit has remotely locked down. Usage of a Robotics Control Computer like the one in the Research Director's \
+office by your AI master or any qualified human may resolve this matter. Robotics my provide further assistance if necessary."
+
+/obj/screen/alert/newlaw
+ name = "Law Update"
+ desc = "Laws have potentially been uploaded to or removed from this unit. Please be aware of any changes \
+so as to remain in compliance with the most up-to-date laws."
+ timeout = 300
+
+//OBJECT-BASED
+
/obj/screen/alert/buckled
name = "Buckled"
desc = "You've been buckled to something and can't move. Click the alert to unbuckle unless you're handcuffed."
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index a098fc0bf08..cdedfe0733f 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -443,6 +443,7 @@
var/mob/living/carbon/human/H = A
if(can_embed(src))
if(prob(embed_chance) && !(PIERCEIMMUNE in H.dna.species.specflags))
+ H.throw_alert("embeddedobject")
var/obj/item/organ/limb/L = pick(H.organs)
L.embedded_objects |= src
add_blood(H)//it embedded itself in you, of course it's bloody!
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 620d251ed54..505342daaf3 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -291,6 +291,8 @@
usr.put_in_hands(I)
usr.emote("scream")
usr.visible_message("[usr] successfully rips [I] out of their [L.getDisplayName()]!","You successfully remove [I] from your [L.getDisplayName()].")
+ if(!has_embedded_objects())
+ clear_alert("embeddedobject")
return
if(href_list["item"])
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 7d29d7a3bdc..df510e18e0a 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -335,6 +335,8 @@
L.embedded_objects -= I
I.loc = get_turf(src)
visible_message("\the [I] falls out of [name]'s [L.getDisplayName()]!","\the [I] falls out of your [L.getDisplayName()]!")
+ if(!has_embedded_objects())
+ clear_alert("embeddedobject")
/mob/living/carbon/human/handle_heart()
if(!heart_attack)
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index e9cee838880..ae6d8824d95 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -600,8 +600,12 @@
H.client.screen += global_hud.darkMask
if(H.blind)
- if(H.eye_blind) H.blind.layer = 18
- else H.blind.layer = 0
+ if(H.eye_blind)
+ H.throw_alert("blind")
+ H.blind.layer = 18
+ else
+ H.clear_alert("blind")
+ H.blind.layer = 0
if(!H.client)//no client, no screen to update
return 1
@@ -609,7 +613,11 @@
if( H.disabilities & NEARSIGHT && !istype(H.glasses, /obj/item/clothing/glasses/regular) )
H.client.screen += global_hud.vimpaired
if(H.eye_blurry) H.client.screen += global_hud.blurry
- if(H.druggy) H.client.screen += global_hud.druggy
+ if(H.druggy)
+ H.client.screen += global_hud.druggy
+ H.throw_alert("high")
+ else
+ H.clear_alert("high")
if(H.eye_stat > 20)
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 120e7da4350..a59914466bf 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -293,12 +293,16 @@
CheckStamina()
if(sleeping)
+ throw_alert("asleep")
handle_dreams()
adjustStaminaLoss(-10)
sleeping = max(sleeping-1, 0)
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
+ else
+ clear_alert("asleep")
+
var/restingpwr = 1 + 4 * resting
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index af02c55f543..5beeeb3a847 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -170,8 +170,10 @@
if(blind)
if(eye_blind)
blind.layer = 18
+ throw_alert("blind")
else
blind.layer = 0
+ clear_alert("blind")
if (disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
@@ -181,6 +183,9 @@
if (druggy)
client.screen += global_hud.druggy
+ throw_alert("high")
+ else
+ clear_alert("high")
if(eye_stat > 20)
if(eye_stat > 30)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 855ecf423c4..d23dcbabcc0 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -664,6 +664,10 @@ Sorry Giacom. Please don't be mad :(
/mob/living/update_gravity(has_gravity)
if(!ticker)
return
+ if(has_gravity)
+ clear_alert("weightless")
+ else
+ throw_alert("weightless")
float(!has_gravity)
/mob/living/proc/float(on)
diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm
index aed6b5c06a4..c2bb3e4afb2 100644
--- a/code/modules/mob/living/silicon/laws.dm
+++ b/code/modules/mob/living/silicon/laws.dm
@@ -6,30 +6,37 @@
make_laws()
/mob/living/silicon/proc/set_zeroth_law(var/law, var/law_borg)
+ throw_alert("newlaw")
src.laws_sanity_check()
src.laws.set_zeroth_law(law, law_borg)
/mob/living/silicon/proc/add_inherent_law(var/law)
+ throw_alert("newlaw")
laws_sanity_check()
laws.add_inherent_law(law)
/mob/living/silicon/proc/clear_inherent_laws()
+ throw_alert("newlaw")
laws_sanity_check()
laws.clear_inherent_laws()
/mob/living/silicon/proc/add_supplied_law(var/number, var/law)
+ throw_alert("newlaw")
laws_sanity_check()
laws.add_supplied_law(number, law)
/mob/living/silicon/proc/clear_supplied_laws()
+ throw_alert("newlaw")
laws_sanity_check()
laws.clear_supplied_laws()
/mob/living/silicon/proc/add_ion_law(var/law)
+ throw_alert("newlaw")
laws_sanity_check()
laws.add_ion_law(law)
/mob/living/silicon/proc/clear_ion_laws()
+ throw_alert("newlaw")
laws_sanity_check()
laws.clear_ion_laws()
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index c016f818fbd..e560096f24f 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -939,6 +939,10 @@
// They stay locked down if their wire is cut.
if(wires.LockedCut())
state = 1
+ if(state)
+ throw_alert("locked")
+ else
+ clear_alert("locked")
lockcharge = state
update_canmove()
@@ -953,6 +957,10 @@
if(hud_used)
hud_used.update_robot_modules_display() //Shows/hides the emag item if the inventory screen is already open.
update_icons()
+ if(emagged)
+ throw_alert("hacked")
+ else
+ clear_alert("hacked")
/mob/living/silicon/robot/verb/outputlaws()
set category = "Robot Commands"
diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm
index df88239994d..2025f3c155b 100644
--- a/code/modules/surgery/organs/organ.dm
+++ b/code/modules/surgery/organs/organ.dm
@@ -188,4 +188,12 @@
for(var/obj/item/organ/limb/L in organs)
for(var/obj/item/I in L.embedded_objects)
L.embedded_objects -= I
- I.loc = T
\ No newline at end of file
+ I.loc = T
+
+ clear_alert("embeddedobject")
+
+/mob/living/carbon/human/proc/has_embedded_objects()
+ . = 0
+ for(var/obj/item/organ/limb/L in organs)
+ for(var/obj/item/I in L.embedded_objects)
+ return 1
\ No newline at end of file
diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm
index 33968dd8968..f8e7de333d9 100644
--- a/code/modules/surgery/remove_embedded_object.dm
+++ b/code/modules/surgery/remove_embedded_object.dm
@@ -33,6 +33,9 @@
I.loc = get_turf(H)
L.embedded_objects -= I
+ if(!H.has_embedded_objects())
+ H.clear_alert("embeddedobject")
+
if(objects > 0)
user.visible_message("[user] sucessfully removes [objects] objects from [H]'s [L.getDisplayName()]!", "You sucessfully remove [objects] objects from [H]'s [L.getDisplayName()].")
else
diff --git a/icons/mob/screen_alert.dmi b/icons/mob/screen_alert.dmi
index 7a0c7a6599a..0ed43592376 100644
Binary files a/icons/mob/screen_alert.dmi and b/icons/mob/screen_alert.dmi differ