From 610483ea1eb61bb3dd1b0fa524664aed08f0ecb5 Mon Sep 17 00:00:00 2001 From: MrPerson Date: Tue, 13 Oct 2015 17:16:23 -0700 Subject: [PATCH] Mild rewrite of screen alerts to enable more functionality Specifically I wanted to allow #12043 to correctly implement clicking an "on fire" alert to call resist without affecting other alerts which is currently impssible. Plus this whole mess was stupid and bothering me so here we go. --- code/_onclick/hud/alert.dm | 73 ++++++++++++------- code/game/mecha/mecha.dm | 14 ++-- code/game/objects/buckling.dm | 2 +- code/modules/mob/living/carbon/alien/alien.dm | 2 +- code/modules/mob/living/carbon/alien/life.dm | 2 +- .../mob/living/carbon/human/human_defense.dm | 2 +- .../mob/living/carbon/human/species.dm | 44 +++++------ code/modules/mob/living/carbon/life.dm | 8 +- code/modules/mob/living/carbon/monkey/life.dm | 20 ++--- code/modules/mob/living/life.dm | 4 +- code/modules/mob/living/living.dm | 2 +- code/modules/mob/living/silicon/laws.dm | 14 ++-- code/modules/mob/living/silicon/robot/life.dm | 10 +-- .../modules/mob/living/silicon/robot/robot.dm | 4 +- 14 files changed, 110 insertions(+), 91 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 0b65c3948dc..4ee0bcd5d29 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -3,46 +3,41 @@ //PUBLIC - call these wherever you want -/mob/proc/throw_alert(category, id, severity, obj/new_master) +/mob/proc/throw_alert(category, type, severity, obj/new_master) -/* Proc to create or update an alert. Returns 1 if the alert is new or updated, 0 if it was thrown already +/* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already category is a text string. Each mob may only have one alert per category; the previous one will be replaced - id is a text string, If you don't provide one, category will be used as id - Either way it MUST match a type path like so: /obj/screen/alert/[id] - Also the alert's icon_state will be [id] so you must add it to screen_alert.dmi + path is a type path of the actual alert type to throw severity is an optional number that will be placed at the end of the icon_state for this alert - For example, high pressure's id is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2" as icon_states + For example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2" new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay. Clicks are forwarded to master */ if(!category) return - if(!id) - id = category var/obj/screen/alert/alert if(alerts[category]) alert = alerts[category] if(new_master && new_master != alert.master) WARNING("[src] threw alert [category] with new_master [new_master] while already having that alert with master [alert.master]") -// alert.overlays.Cut() // This is apparently an invalid expression clear_alert(category) return .() - else if(alert.icon_state == "[id][severity]") + else if(alert.type == type && (!severity || severity == alert.severity)) if(alert.timeout) clear_alert(category) return .() else - // src << "threw alert not in need of update [category] [id] [severity]" +// src << "threw alert not in need of update [category] [type] [severity]" return 0 -// src << "updating alert [category] [id] [severity]" +// src << "updating alert [category] [type] [severity]" else - alert = PoolOrNew(/obj/screen/alert) -// src << "throwing new alert [category] [id] [severity]" + alert = PoolOrNew(type) +// src << "throwing new alert [category] [type] [severity]" if(new_master) var/old_layer = new_master.layer @@ -52,7 +47,8 @@ alert.icon_state = "template" // We'll set the icon to the client's ui pref in reorganize_alerts() alert.master = new_master else - alert.icon_state = "[id][severity]" + alert.icon_state = "[initial(alert.icon_state)][severity]" + alert.severity = severity alerts[category] = alert if(client && hud_used) @@ -60,21 +56,11 @@ alert.transform = matrix(32, 6, MATRIX_TRANSLATE) animate(alert, transform = matrix(), time = 2.5, easing = CUBIC_EASING) - var/obj/screen/alert/path_as_obj = text2path("/obj/screen/alert/[id]") - // BYOND magic-fu - we'll be storing a path in this reference and retrieving vars from it. - if(!path_as_obj) - throw EXCEPTION("throw_alert(): Invalid screen alert path") //check for obj/screen/alert/[id] - 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 // Proc to clear an existing alert. @@ -89,14 +75,14 @@ client.screen -= alert qdel(alert) -// Make sure any alerts you throw have a path that matches /obj/screen/alert/[id] or /obj/screen/alert/[category] - /obj/screen/alert icon = 'icons/mob/screen_alert.dmi' icon_state = "default" name = "Alert" desc = "Something seems to have gone wrong with this alert, so report this bug please" + mouse_opacity = 1 var/timeout = 0 //If set to a number, this alert will clear itself after that many deciseconds + var/severity = 0 //Gas alerts @@ -104,79 +90,97 @@ name = "Choking (No O2)" desc = "You're not getting enough oxygen. Find some good air before you pass out! \ The box in your backpack has an oxygen tank and gas mask in it." + icon_state = "oxy" /obj/screen/alert/too_much_oxy name = "Choking (O2)" desc = "There's too much oxygen in the air, and you're breathing it in! Find some good air before you pass out!" + icon_state = "too_much_oxy" /obj/screen/alert/not_enough_co2 name = "Choking (No CO2)" desc = "You're not getting enough carbon dioxide. Find some good air before you pass out!" + icon_state = "not_enough_co2" /obj/screen/alert/too_much_co2 name = "Chocking (CO2)" desc = "There's too much carbon dioxide in the air, and you're breathing it in! Find some good air before you pass out!" + icon_state = "too_much_co2" /obj/screen/alert/not_enough_tox name = "Choking (No Plasma)" desc = "You're not getting enough plasma. Find some good air before you pass out!" + icon_state = "not_enough_tox" /obj/screen/alert/tox_in_air name = "Choking (Plasma)" desc = "There's highly flammable, toxic plasma in the air and you're breathing it in. Find some fresh air. \ The box in your backpack has an oxygen tank and gas mask in it." + icon_state = "tox_in_air" //End gas alerts /obj/screen/alert/fat name = "Fat" desc = "You ate too much food, lardass. Run around the station and lose some weight." + icon_state = "fat" /obj/screen/alert/hungry name = "Hungry" desc = "Some food would be good right about now." + icon_state = "hungry" /obj/screen/alert/starving name = "Starving" desc = "Some food would be to kill for right about now. The hunger pains make moving around a chore." + icon_state = "starving" /obj/screen/alert/hot name = "Too Hot" desc = "You're flaming hot! Get somewhere cooler and take off any insulating clothing like a fire suit." + icon_state = "hot" /obj/screen/alert/cold name = "Too Cold" desc = "You're freezing cold! Get somewhere warmer and take off any insulating clothing like a space suit." + icon_state = "cold" /obj/screen/alert/lowpressure name = "Low Pressure" desc = "The air around you is hazardously thin. A space suit would protect you." + icon_state = "lowpressure" /obj/screen/alert/highpressure name = "High Pressure" desc = "The air around you is hazardously thick. A fire suit would protect you." + icon_state = "highpressure" /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." + icon_state = "blind" /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." + icon_state = "high" /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." + icon_state = "drunk" /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." + icon_state = "embeddedobject" /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." + icon_state = "asleep" /obj/screen/alert/weightless name = "Weightless" @@ -184,17 +188,20 @@ If you're feeling frisky, click yourself in help intent to pull the object out." 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." + icon_state = "weightless" //ALIENS /obj/screen/alert/alien_tox name = "Plasma" desc = "There's flammable plasma in the air. If it lights up, you'll be toast." + icon_state = "alien_tox" /obj/screen/alert/alien_fire // This alert is temporarily gonna be thrown for all hot air but one day it will be used for literally being on fire name = "Burning" desc = "It's too hot! Flee to space or at least away from the flames. Standing on weeds will heal you up." + icon_state = "alien_fire" //SILICONS @@ -202,30 +209,36 @@ or shoot a gun to move around via Newton's 3rd Law of motion." /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." + icon_state = "nocell" /obj/screen/alert/emptycell name = "Out of Power" desc = "Unit's power cell has no charge remaining. No modules available until power cell is recharged. \ Reharging stations are available in robotics, the dormitory's bathrooms. and the AI satelite." + icon_state = "emptycell" /obj/screen/alert/lowcell 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." + icon_state = "lowcell" //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." + icon_state = "hacked" /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." + icon_state = "locked" /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." + icon_state = "newlaw" timeout = 300 //MECHS @@ -233,6 +246,7 @@ so as to remain in compliance with the most up-to-date laws." /obj/screen/alert/low_mech_integrity name = "Mech Damaged" desc = "Mech integrity is low." + icon_state = "low_mech_integrity" //OBJECT-BASED @@ -272,6 +286,8 @@ so as to remain in compliance with the most up-to-date laws." . = ui_alert4 if(5) . = ui_alert5 // Right now there's 5 slots + else + . = "" alert.screen_loc = . mymob.client.screen |= alert return 1 @@ -291,4 +307,7 @@ so as to remain in compliance with the most up-to-date laws." /obj/screen/alert/Destroy() ..() + severity = 0 + master = null + screen_loc = "" return QDEL_HINT_PUTINPOOL //Don't destroy me, I have a family! diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 69a0cdfb492..96618a9eac5 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -285,22 +285,22 @@ if(0.75 to INFINITY) occupant.clear_alert("charge") if(0.5 to 0.75) - occupant.throw_alert("charge","lowcell",1) + occupant.throw_alert("charge",/obj/screen/alert/lowcell, 1) if(0.25 to 0.5) - occupant.throw_alert("charge","lowcell",2) + occupant.throw_alert("charge",/obj/screen/alert/lowcell, 2) if(0.01 to 0.25) - occupant.throw_alert("charge","lowcell",3) + occupant.throw_alert("charge",/obj/screen/alert/lowcell, 3) else - occupant.throw_alert("charge","emptycell") + occupant.throw_alert("charge",/obj/screen/alert/emptycell) var/integrity = health/initial(health)*100 switch(integrity) if(30 to 45) - occupant.throw_alert("mech damage", "low_mech_integrity", 1) + occupant.throw_alert("mech damage", /obj/screen/alert/low_mech_integrity, 1) if(15 to 35) - occupant.throw_alert("mech damage", "low_mech_integrity", 2) + occupant.throw_alert("mech damage", /obj/screen/alert/low_mech_integrity, 2) if(-INFINITY to 15) - occupant.throw_alert("mech damage", "low_mech_integrity", 3) + occupant.throw_alert("mech damage", /obj/screen/alert/low_mech_integrity, 3) else occupant.clear_alert("mech damage") diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index df95b3e5e93..26ba09703dd 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -43,7 +43,7 @@ buckled_mob = M M.update_canmove() post_buckle_mob(M) - M.throw_alert("buckled", new_master = src) + M.throw_alert("buckled", /obj/screen/alert/buckled, new_master = src) return 1 diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 15d859a83fd..77c1aefa88e 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -74,7 +74,7 @@ if(bodytemperature > 360.15) //Body temperature is too hot. - throw_alert("alien_fire") + throw_alert("alien_fire", /obj/screen/alert/alien_fire) switch(bodytemperature) if(360 to 400) apply_damage(HEAT_DAMAGE_LEVEL_1, BURN) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 04358675e9e..e1cf8dc0284 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -15,7 +15,7 @@ if(Toxins_pp) // Detect toxins in air adjustPlasma(breath.toxins*250) - throw_alert("alien_tox") + throw_alert("alien_tox", /obj/screen/alert/alien_tox) toxins_used = breath.toxins diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index d11d0e389e2..d501ebb1ef3 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -379,7 +379,7 @@ emp_act if(I.throw_speed >= EMBED_THROWSPEED_THRESHOLD) if(can_embed(I)) if(prob(I.embed_chance) && !(dna && (PIERCEIMMUNE in dna.species.specflags))) - throw_alert("embeddedobject") + throw_alert("embeddedobject", /obj/screen/alert/embeddedobject) var/obj/item/organ/limb/L = pick(organs) L.embedded_objects |= I I.add_blood(src)//it embedded itself in you, of course it's bloody! diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index f9973ea991d..bdc28bf4031 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -695,7 +695,7 @@ if(H.blind) if(H.eye_blind) - H.throw_alert("blind") + H.throw_alert("blind", /obj/screen/alert/blind) H.blind.layer = 18 else H.clear_alert("blind") @@ -709,7 +709,7 @@ if(H.eye_blurry) H.client.screen += global_hud.blurry if(H.druggy) H.client.screen += global_hud.druggy - H.throw_alert("high") + H.throw_alert("high", /obj/screen/alert/high) else H.clear_alert("high") @@ -766,13 +766,13 @@ switch(H.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) - H.throw_alert("nutrition","fat") + H.throw_alert("nutrition", /obj/screen/alert/fat) if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FULL) H.clear_alert("nutrition") if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) - H.throw_alert("nutrition","hungry") + H.throw_alert("nutrition", /obj/screen/alert/hungry) else - H.throw_alert("nutrition","starving") + H.throw_alert("nutrition", /obj/screen/alert/starving) return 1 @@ -1145,7 +1145,7 @@ H.adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) H.failed_last_breath = 1 - H.throw_alert("oxy") + H.throw_alert("oxy", /obj/screen/alert/oxy) return 0 @@ -1163,14 +1163,14 @@ if(safe_oxygen_max && O2_pp > safe_oxygen_max && !(NOBREATH in specflags)) var/ratio = (breath.oxygen/safe_oxygen_max) * 10 H.adjustOxyLoss(Clamp(ratio,oxy_breath_dam_min,oxy_breath_dam_max)) - H.throw_alert("too_much_oxy") + H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy) else H.clear_alert("too_much_oxy") //Too little oxygen! if(safe_oxygen_min && O2_pp < safe_oxygen_min) gas_breathed = handle_too_little_breath(H,O2_pp,safe_oxygen_min,breath.oxygen) - H.throw_alert("oxy") + H.throw_alert("oxy", /obj/screen/alert/oxy) else H.failed_last_breath = 0 H.adjustOxyLoss(-5) @@ -1194,7 +1194,7 @@ H.adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! H.adjustOxyLoss(8) - H.throw_alert("too_much_co2") + H.throw_alert("too_much_co2", /obj/screen/alert/too_much_co2) if(prob(20)) // Lets give them some chance to know somethings not right though I guess. spawn(0) H.emote("cough") @@ -1205,7 +1205,7 @@ //Too little CO2! if(safe_co2_min && CO2_pp < safe_co2_min) gas_breathed = handle_too_little_breath(H,CO2_pp, safe_co2_min,breath.carbon_dioxide) - H.throw_alert("not_enough_co2") + H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2) else H.failed_last_breath = 0 H.adjustOxyLoss(-5) @@ -1225,7 +1225,7 @@ var/ratio = (breath.toxins/safe_toxins_max) * 10 if(H.reagents) H.reagents.add_reagent("plasma", Clamp(ratio, tox_breath_dam_min, tox_breath_dam_max)) - H.throw_alert("tox_in_air") + H.throw_alert("tox_in_air", /obj/screen/alert/tox_in_air) else H.clear_alert("tox_in_air") @@ -1233,7 +1233,7 @@ //Too little toxins! if(safe_toxins_min && Toxins_pp < safe_toxins_min && !(NOBREATH in specflags)) gas_breathed = handle_too_little_breath(H,Toxins_pp, safe_toxins_min, breath.toxins) - H.throw_alert("not_enough_tox") + H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox) else H.failed_last_breath = 0 H.adjustOxyLoss(-5) @@ -1333,13 +1333,13 @@ //Body temperature is too hot. switch(H.bodytemperature) if(360 to 400) - H.throw_alert("temp","hot",1) + H.throw_alert("temp", /obj/screen/alert/hot, 1) H.apply_damage(HEAT_DAMAGE_LEVEL_1*heatmod, BURN) if(400 to 460) - H.throw_alert("temp","hot",2) + H.throw_alert("temp", /obj/screen/alert/hot, 2) H.apply_damage(HEAT_DAMAGE_LEVEL_2*heatmod, BURN) if(460 to INFINITY) - H.throw_alert("temp","hot",3) + H.throw_alert("temp", /obj/screen/alert/hot, 3) if(H.on_fire) H.apply_damage(HEAT_DAMAGE_LEVEL_3*heatmod, BURN) else @@ -1349,13 +1349,13 @@ if(!istype(H.loc, /obj/machinery/atmospherics/components/unary/cryo_cell)) switch(H.bodytemperature) if(200 to 260) - H.throw_alert("temp","cold",1) + H.throw_alert("temp", /obj/screen/alert/cold, 1) H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod, BURN) if(120 to 200) - H.throw_alert("temp","cold",2) + H.throw_alert("temp", /obj/screen/alert/cold, 2) H.apply_damage(COLD_DAMAGE_LEVEL_2*coldmod, BURN) if(-INFINITY to 120) - H.throw_alert("temp","cold",3) + H.throw_alert("temp", /obj/screen/alert/cold, 3) H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod, BURN) else H.clear_alert("temp") @@ -1372,21 +1372,21 @@ if(HAZARD_HIGH_PRESSURE to INFINITY) if(!(HEATRES in specflags)) H.adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) - H.throw_alert("pressure","highpressure",2) + H.throw_alert("pressure", /obj/screen/alert/highpressure, 2) else H.clear_alert("pressure") if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) - H.throw_alert("pressure","highpressure",1) + H.throw_alert("pressure", /obj/screen/alert/highpressure, 1) if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) H.clear_alert("pressure") if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) - H.throw_alert("pressure","lowpressure",1) + H.throw_alert("pressure", /obj/screen/alert/lowpressure, 1) else if(H.dna.check_mutation(COLDRES) || (COLDRES in specflags)) H.clear_alert("pressure") else H.adjustBruteLoss( LOW_PRESSURE_DAMAGE ) - H.throw_alert("pressure","lowpressure",2) + H.throw_alert("pressure", /obj/screen/alert/lowpressure, 2) ////////// // FIRE // diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 86014c735ca..51e181ba888 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -104,7 +104,7 @@ return adjustOxyLoss(1) failed_last_breath = 1 - throw_alert("oxy") + throw_alert("oxy", /obj/screen/alert/oxy) return 0 @@ -134,7 +134,7 @@ else adjustOxyLoss(3) failed_last_breath = 1 - throw_alert("oxy") + throw_alert("oxy", /obj/screen/alert/oxy) else //Enough oxygen failed_last_breath = 0 @@ -165,7 +165,7 @@ var/ratio = (breath.toxins/safe_tox_max) * 10 if(reagents) reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) - throw_alert("tox_in_air") + throw_alert("tox_in_air", /obj/screen/alert/tox_in_air) else clear_alert("tox_in_air") @@ -291,7 +291,7 @@ CheckStamina() if(sleeping) - throw_alert("asleep") + throw_alert("asleep", /obj/screen/alert/asleep) handle_dreams() adjustStaminaLoss(-10) sleeping = max(sleeping-1, 0) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 909d769ac74..a5b06559b32 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -80,13 +80,13 @@ if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT) switch(bodytemperature) if(360 to 400) - throw_alert("temp","hot",1) + throw_alert("temp", /obj/screen/alert/hot, 1) adjustFireLoss(2) if(400 to 460) - throw_alert("temp","hot",2) + throw_alert("temp", /obj/screen/alert/hot, 2) adjustFireLoss(3) if(460 to INFINITY) - throw_alert("temp","hot",3) + throw_alert("temp", /obj/screen/alert/hot, 3) if(on_fire) adjustFireLoss(8) else @@ -96,13 +96,13 @@ if(!istype(loc, /obj/machinery/atmospherics/components/unary/cryo_cell)) switch(bodytemperature) if(200 to 260) - throw_alert("temp","cold",1) + throw_alert("temp", /obj/screen/alert/cold, 1) adjustFireLoss(0.5) if(120 to 200) - throw_alert("temp","cold",2) + throw_alert("temp", /obj/screen/alert/cold, 2) adjustFireLoss(1.5) if(-INFINITY to 120) - throw_alert("temp","cold",3) + throw_alert("temp", /obj/screen/alert/cold, 3) adjustFireLoss(3) else clear_alert("temp") @@ -117,16 +117,16 @@ switch(adjusted_pressure) if(HAZARD_HIGH_PRESSURE to INFINITY) adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) - throw_alert("pressure","highpressure",2) + throw_alert("pressure", /obj/screen/alert/highpressure, 2) if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) - throw_alert("pressure","highpressure",1) + throw_alert("pressure", /obj/screen/alert/highpressure, 1) if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) clear_alert("pressure") if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) - throw_alert("pressure","lowpressure",1) + throw_alert("pressure", /obj/screen/alert/lowpressure, 1) else adjustBruteLoss( LOW_PRESSURE_DAMAGE ) - throw_alert("pressure","lowpressure",2) + throw_alert("pressure", /obj/screen/alert/lowpressure, 2) return diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 0d5b4cd0444..96c9c0819b7 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -190,7 +190,7 @@ if(blind) if(eye_blind) blind.layer = 18 - throw_alert("blind") + throw_alert("blind", /obj/screen/alert/blind) else blind.layer = 0 clear_alert("blind") @@ -203,7 +203,7 @@ if (druggy) client.screen += global_hud.druggy - throw_alert("high") + throw_alert("high", /obj/screen/alert/high) else clear_alert("high") diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 77c21506462..0d7edb8ca6b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -681,7 +681,7 @@ Sorry Giacom. Please don't be mad :( if(has_gravity) clear_alert("weightless") else - throw_alert("weightless") + throw_alert("weightless", /obj/screen/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 a588bd19e1c..c159c87cd41 100644 --- a/code/modules/mob/living/silicon/laws.dm +++ b/code/modules/mob/living/silicon/laws.dm @@ -6,37 +6,37 @@ make_laws() /mob/living/silicon/proc/set_zeroth_law(law, law_borg) - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) src.laws_sanity_check() src.laws.set_zeroth_law(law, law_borg) /mob/living/silicon/proc/add_inherent_law(law) - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) laws_sanity_check() laws.add_inherent_law(law) /mob/living/silicon/proc/clear_inherent_laws() - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) laws_sanity_check() laws.clear_inherent_laws() /mob/living/silicon/proc/add_supplied_law(number, law) - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) laws_sanity_check() laws.add_supplied_law(number, law) /mob/living/silicon/proc/clear_supplied_laws() - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) laws_sanity_check() laws.clear_supplied_laws() /mob/living/silicon/proc/add_ion_law(law) - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) laws_sanity_check() laws.add_ion_law(law) /mob/living/silicon/proc/clear_ion_laws() - throw_alert("newlaw") + throw_alert("newlaw", /obj/screen/alert/newlaw) laws_sanity_check() laws.clear_ion_laws() diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index c6a6424d2a1..30fdc2e0b37 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -153,15 +153,15 @@ if(0.75 to INFINITY) clear_alert("charge") if(0.5 to 0.75) - throw_alert("charge","lowcell",1) + throw_alert("charge", /obj/screen/alert/lowcell, 1) if(0.25 to 0.5) - throw_alert("charge","lowcell",2) + throw_alert("charge", /obj/screen/alert/lowcell, 2) if(0.01 to 0.25) - throw_alert("charge","lowcell",3) + throw_alert("charge", /obj/screen/alert/lowcell, 3) else - throw_alert("charge","emptycell") + throw_alert("charge", /obj/screen/alert/emptycell) else - throw_alert("charge","nocell") + throw_alert("charge", /obj/screen/alert/nocell) /mob/living/silicon/robot/proc/update_items() if (client) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index bf1f812ae1f..c5cdaedc234 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -998,7 +998,7 @@ if(wires.LockedCut()) state = 1 if(state) - throw_alert("locked") + throw_alert("locked", /obj/screen/alert/locked) else clear_alert("locked") lockcharge = state @@ -1016,7 +1016,7 @@ 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") + throw_alert("hacked", /obj/screen/alert/hacked) else clear_alert("hacked")