diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 8279cde6a4..e90ca9e096 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -65,7 +65,7 @@ //Check all the alarms before lowering atmosalm. Raising is perfectly fine. for (var/area/RA in related) for (var/obj/machinery/alarm/AA in RA) - if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted) + if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level) danger_level = max(danger_level, AA.danger_level) if(danger_level != atmosalm) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index cf329992c6..c74f03db43 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -78,13 +78,11 @@ var/temperature_dangerlevel = 0 var/other_dangerlevel = 0 - var/apply_danger_level = 1 - var/post_alert = 1 + var/report_danger_level = 1 /obj/machinery/alarm/monitor - apply_danger_level = 0 + report_danger_level = 0 breach_detection = 0 - post_alert = 0 /obj/machinery/alarm/server/New() ..() @@ -432,15 +430,12 @@ send_signal(device_id, list("power"= 0) ) /obj/machinery/alarm/proc/apply_danger_level(var/new_danger_level) - if (apply_danger_level && alarm_area.atmosalert(new_danger_level)) + if (report_danger_level && alarm_area.atmosalert(new_danger_level)) post_alert(new_danger_level) update_icon() /obj/machinery/alarm/proc/post_alert(alert_level) - if(!post_alert) - return - var/datum/radio_frequency/frequency = radio_controller.return_frequency(alarm_frequency) if(!frequency) return diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 94dbd8b611..692d4da481 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -54,6 +54,10 @@ var/datum/effect/effect/system/spark_spread/spark_system //the spark system, used for generating... sparks? +/obj/machinery/porta_turret/stationary + lethal = 1 + installation = /obj/item/weapon/gun/energy/laser + /obj/machinery/porta_turret/New() ..() icon_state = "grey_target_prism" @@ -141,18 +145,25 @@ del(cover) // qdel ..() +/obj/machinery/porta_turret/proc/can_use(mob/user) + if(ailock && issilicon(user)) + user << "There seems to be a firewall preventing you from accessing this device." + return 0 + + if(locked && !issilicon(user)) + user << "Access denied." + return 0 + + return 1 /obj/machinery/porta_turret/attack_ai(mob/user) - if(!ailock) - return attack_hand(user) - else - user << "There seems to be a firewall preventing you from accessing this device." - + return attack_hand(user) /obj/machinery/porta_turret/attack_hand(mob/user) - . = ..() - if(.) - return + if(..()) + return 1 + if(!can_use(user)) + return 1 interact(user) /obj/machinery/porta_turret/interact(mob/user) @@ -165,13 +176,17 @@ if(!locked || issilicon(user)) dat += text({"

- Neutralize All Non-Synthetics: []
- Check for Weapon Authorization: []
+ Lethal Mode: []
+ Neutralize All Non-Synthetics: []
"}, + + "[lethal ? "Enabled" : "Disabled"]", + "[ai ? "Yes" : "No"]") + if(!ai) + dat += text({"Check for Weapon Authorization: []
Check Security Records: []
Neutralize All Non-Authorized Personnel: []
Neutralize All Unidentified Life Signs: []
"}, - "[ai ? "Yes" : "No"]", "[auth_weapons ? "Yes" : "No"]", "[check_records ? "Yes" : "No"]", "[stun_all ? "Yes" : "No"]", @@ -181,14 +196,23 @@ onclose(user, "autosec") return +/obj/machinery/porta_turret/proc/HasController() + var/area/A = get_area(src) + return A && A.turret_controls.len > 0 + /obj/machinery/porta_turret/Topic(href, href_list) if(..()) - return + return 1 + if(!can_use(usr)) + return 1 + usr.set_machine(src) - add_fingerprint(usr) - if(href_list["power"] && (!locked || issilicon(usr))) + if(href_list["power"]) if(anchored) //you can't turn a turret on/off if it's not anchored/secured - on = !on //toggle on/off + if(HasController()) + usr << "Turrets can only be [on ? "disabled" : "enabled"] using the assigned turret controller." + else + on = !on //toggle on/off else usr << "It has to be secured first!" @@ -196,6 +220,12 @@ return switch(href_list["operation"]) //toggles customizable behavioural protocols + if("togglelethal") + if(!controllock) + if(HasController()) + usr << "Weapon mode can only be altered using the assigned turret controller." + else + lethal = !lethal if("toggleai") ai = !ai if("authweapon") @@ -204,6 +234,8 @@ check_records = !check_records if("shootall") stun_all = !stun_all + if("checkxenos") + check_anomalies = !check_anomalies updateUsrDialog() @@ -252,20 +284,24 @@ else if((istype(I, /obj/item/weapon/wrench)) && (!on)) if(raised) return - //This code handles moving the turret around. After all, it's a portable turret! - if(!anchored && !isinspace()) - anchored = 1 - invisibility = INVISIBILITY_LEVEL_TWO - update_icon() - user << "You secure the exterior bolts on the turret." - cover = new /obj/machinery/porta_turret_cover(loc) //create a new turret. While this is handled in process(), this is to workaround a bug where the turret becomes invisible for a split second - cover.Parent_Turret = src //make the cover's parent src - else if(anchored) - anchored = 0 - user << "You unsecure the exterior bolts on the turret." - invisibility = 0 - update_icon() - del(cover) //deletes the cover, and the turret instance itself becomes its own cover. - qdel + + if(do_after(user, 50)) + //This code handles moving the turret around. After all, it's a portable turret! + if(!anchored && !isinspace()) + playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) + anchored = 1 + invisibility = INVISIBILITY_LEVEL_TWO + update_icon() + user << "You secure the exterior bolts on the turret." + cover = new /obj/machinery/porta_turret_cover(loc) //create a new turret. While this is handled in process(), this is to workaround a bug where the turret becomes invisible for a split second + cover.Parent_Turret = src //make the cover's parent src + else if(anchored) + playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) + anchored = 0 + user << "You unsecure the exterior bolts on the turret." + invisibility = 0 + update_icon() + del(cover) //deletes the cover, and the turret instance itself becomes its own cover. - qdel else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) //Behavior lock/unlock mangement @@ -703,6 +739,7 @@ Turret.name = finish_name Turret.installation = installation Turret.gun_charge = gun_charge + Turret.on = 0 Turret.setup() // Turret.cover=new/obj/machinery/porta_turret_cover(loc) @@ -772,137 +809,14 @@ //I'm not fixing it because i'm fucking bored of this code already, but someone should just reroute these to the parent turret's procs. /obj/machinery/porta_turret_cover/attack_ai(mob/user) - if(!Parent_Turret.ailock) - return attack_hand(user) - else - user << "There seems to be a firewall preventing you from accessing this device." + return attack_hand(user) /obj/machinery/porta_turret_cover/attack_hand(mob/user) - . = ..() - if(.) - return - var/dat - if(!istype(Parent_Turret, /obj/machinery/porta_turret/tag)) - dat += text({" - Automatic Portable Turret Installation

- Status: []
- Behaviour controls are [Parent_Turret.locked ? "locked" : "unlocked"]"}, - - "[Parent_Turret.on ? "On" : "Off"]" ) - - if(!src.Parent_Turret.locked || issilicon(user)) - dat += text({"

- Neutralize All Non-Synthetics: []
- Check for Weapon Authorization: []
- Check Security Records: []
- Neutralize All Non-Authorized Personnel: []
- Neutralize All Unidentified Life Signs: []
"}, - - "[Parent_Turret.ai ? "Yes" : "No"]", - "[Parent_Turret.auth_weapons ? "Yes" : "No"]", - "[Parent_Turret.check_records ? "Yes" : "No"]", - "[Parent_Turret.stun_all ? "Yes" : "No"]" , - "[Parent_Turret.check_anomalies ? "Yes" : "No"]" ) - else - if(istype(user,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - var/obj/machinery/porta_turret/tag/laser_turret = Parent_Turret - if(laser_turret.lasercolor == "b" && istype(H.wear_suit, /obj/item/clothing/suit/redtag)) - return - if(laser_turret.lasercolor == "r" && istype(H.wear_suit, /obj/item/clothing/suit/bluetag)) - return - dat += text({" - Automatic Portable Turret Installation

- Status: []
"}, - - "[Parent_Turret.on ? "On" : "Off"]" ) - - user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") - onclose(user, "autosec") - + return Parent_Turret.attack_hand(user) /obj/machinery/porta_turret_cover/Topic(href, href_list) - if(..()) - return - usr.set_machine(src) - Parent_Turret.add_fingerprint(usr) - add_fingerprint(usr) - if(href_list["power"] && (!src.Parent_Turret.locked || issilicon(usr))) - if(Parent_Turret.anchored) - if(Parent_Turret.on) - Parent_Turret.on = 0 - else - Parent_Turret.on = 1 - else - usr << "It has to be secured first!" - - updateUsrDialog() - return - - switch(href_list["operation"]) - if("toggleai") - Parent_Turret.ai = !Parent_Turret.ai - if("authweapon") - Parent_Turret.auth_weapons = !Parent_Turret.auth_weapons - if("checkrecords") - Parent_Turret.check_records = !Parent_Turret.check_records - if("shootall") - Parent_Turret.stun_all = !Parent_Turret.stun_all - if("checkxenos") - Parent_Turret.check_anomalies = !Parent_Turret.check_anomalies - + Parent_Turret.Topic(href, href_list, 1) // Calling another object's Topic requires that we claim to not have a window, otherwise BYOND's base proc will runtime. updateUsrDialog() - /obj/machinery/porta_turret_cover/attackby(obj/item/I, mob/user) - if(istype(I, /obj/item/weapon/card/emag) && !Parent_Turret.emagged) - user << "You short out [Parent_Turret]'s threat assessment circuits." - visible_message("[Parent_Turret] hums oddly...") - Parent_Turret.emagged = 1 - Parent_Turret.on = 0 - sleep(40) - Parent_Turret.on = 1 - - else if(istype(I, /obj/item/weapon/wrench) && !Parent_Turret.on) - if(Parent_Turret.raised) return - - if(!Parent_Turret.anchored) - Parent_Turret.anchored = 1 - Parent_Turret.invisibility = INVISIBILITY_LEVEL_TWO - Parent_Turret.icon_state = "grey_target_prism" - user << "You secure the exterior bolts on the turret." - else - Parent_Turret.anchored = 0 - user << "You unsecure the exterior bolts on the turret." - Parent_Turret.icon_state = "turretCover" - Parent_Turret.invisibility = 0 - del(src) // qdel - - else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) - if(Parent_Turret.allowed(user)) - Parent_Turret.locked = !Parent_Turret.locked - user << "Controls are now [Parent_Turret.locked ? "locked" : "unlocked"]." - updateUsrDialog() - else - user << "Access denied." - - else - user.changeNext_move(CLICK_CD_MELEE) - Parent_Turret.health -= I.force * 0.5 - if(Parent_Turret.health <= 0) - Parent_Turret.die() - if(I.force * 0.5 > 2) - if(!Parent_Turret.attacked && !Parent_Turret.emagged) - Parent_Turret.attacked = 1 - spawn() - sleep(30) - Parent_Turret.attacked = 0 - ..() - - -/obj/machinery/porta_turret/stationary - lethal = 1 - - New() - installation = /obj/item/weapon/gun/energy/laser - ..() + Parent_Turret.attackby(I, user) diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index ab023eb87e..b28d0a6e7f 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -2,6 +2,10 @@ //Turret Control Panel// //////////////////////// +/area + // Turrets use this list to see if individual power/lethal settings are allowed + var/list/turret_controls = list() + /obj/machinery/turretid name = "turret control panel" desc = "Used to control a room's automated defenses." @@ -25,6 +29,13 @@ lethal = 1 icon_state = "control_kill" +/obj/machinery/turretid/Del() + if(control_area) + var/area/A = control_area + if(A && istype(A)) + A.turret_controls -= src + ..() + /obj/machinery/turretid/initialize() if(!control_area) var/area/CA = get_area(src) @@ -39,6 +50,11 @@ break power_change() //Checks power and initial settings //don't have to check if control_area is path, since get_area_all_atoms can take path. + + if(control_area) + var/area/A = control_area + if(A && istype(A)) + A.turret_controls += src return /obj/machinery/turretid/proc/can_use(mob/user) @@ -85,6 +101,9 @@ else user << "Access denied." +/obj/machinery/turretid/attack_ai(mob/user as mob) + return attack_hand(user) + /obj/machinery/turretid/attack_hand(mob/user as mob) if(!can_use(user)) return diff --git a/code/modules/clothing/suits/labcoat.dm b/code/modules/clothing/suits/labcoat.dm index 00a9918447..e2e6e2b563 100644 --- a/code/modules/clothing/suits/labcoat.dm +++ b/code/modules/clothing/suits/labcoat.dm @@ -97,6 +97,12 @@ if("labgreen") src.icon_state = "labgreen_open" usr << "You unbutton the labcoat." + if ("labcoat_black_open") + src.icon_state = "labcoat_black" + usr << "You button up the labcoat." + if ("labcoat_black") + src.icon_state = "labcoat_black_open" + usr << "You unbutton the labcoat." else usr << "You attempt to button-up the velcro on your [src], before promptly realising how silly you are." return diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 76a2e97dd2..99d80e7891 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -870,6 +870,13 @@ icon_state = "mitlabcoat" item_state = "mitlabcoat" +/obj/item/clothing/suit/storage/labcoat/fluff/epsilon //Devildabeast: Looping Song + name = "e UMi labcoat" + desc = "A suit that protects against minor chemical spills. Has a black stripe on the shoulder. The abbreviation \"e UMi\" is written on the back in bold text." + icon = 'icons/obj/custom_items.dmi' + icon_state = "labcoat_black_open" + item_state = "labcoat_black" + /obj/item/clothing/suit/storage/det_suit/fluff/leatherjack //atomicdog92: Seth Sealis name = "leather jacket" desc = "A black leather coat, popular amongst punks, greasers, and other galactic scum." diff --git a/icons/mob/custom-synthetic.dmi b/icons/mob/custom-synthetic.dmi index f73b4693f9..f45b26ae19 100644 Binary files a/icons/mob/custom-synthetic.dmi and b/icons/mob/custom-synthetic.dmi differ diff --git a/icons/mob/suit.dmi b/icons/mob/suit.dmi index 11a6a604e7..5b9c84be6b 100644 Binary files a/icons/mob/suit.dmi and b/icons/mob/suit.dmi differ diff --git a/icons/obj/custom_items.dmi b/icons/obj/custom_items.dmi index 691e34e194..beae558e4c 100644 Binary files a/icons/obj/custom_items.dmi and b/icons/obj/custom_items.dmi differ