diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index fbde37f1d94..c177d00df64 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,9 @@ 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 + +//HUMANS /obj/screen/alert/oxy name = "Choking" @@ -125,6 +138,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." @@ -134,6 +178,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." @@ -147,6 +194,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." @@ -200,5 +265,6 @@ Reharging stations are available in robotics, the dormitory's bathrooms. and the return usr.client.Click(master, location, control, params) /obj/screen/alert/Destroy() + ..() PlaceInPool(src) return 1 // Don't destroy me, I have a family! \ No newline at end of file diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 045886e7065..b61814d4b85 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -430,6 +430,7 @@ var/mob/living/carbon/human/H = A if(can_embed(src)) if(prob(embed_chance)) + 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 7751934828d..e57fca2e1ae 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -290,6 +290,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 d14b746171c..b03c2c7576f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -358,6 +358,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 e571ae3258d..015637255f0 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -535,8 +535,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 @@ -544,7 +548,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 76df2c205e8..75d964d7889 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -289,12 +289,16 @@ ..() 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 4e13acf2437..4ea6c0a72a4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -663,6 +663,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 15b7d70d17c..92778926362 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -942,6 +942,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() @@ -956,6 +960,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 749faa22698..142cfb1c8fc 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()]!") else diff --git a/icons/mob/screen_alert.dmi b/icons/mob/screen_alert.dmi index cf8d94b9594..c3b59708390 100644 Binary files a/icons/mob/screen_alert.dmi and b/icons/mob/screen_alert.dmi differ