diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index 002c30b0eb0..e1686b45028 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -49,6 +49,11 @@ datum/controller/game_controller/proc/setup_objects()
for(var/atom/movable/object in world)
object.initialize()
+ admin_notice("Initializing pipe networks", R_DEBUG)
sleep(-1)
for(var/obj/machinery/atmospherics/machine in machines)
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 007bb79c103..3b970c74381 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -14,13 +14,17 @@
all_areas += src
if(!requires_power)
- power_light = 0 //rastaf0
- power_equip = 0 //rastaf0
- power_environ = 0 //rastaf0
+ power_light = 0
+ power_equip = 0
+ power_environ = 0
..()
-// spawn(15)
+/area/proc/initialize()
+ if(!requires_power || !apc)
+ power_light = 0
+ power_equip = 0
+ power_environ = 0
power_change() // all machines set to current power level, also updates lighting icon
/area/proc/get_contents()
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 834f3f37499..88807d914bd 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -69,6 +69,7 @@
var/datum/radio_frequency/radio_connection
var/list/TLV = list()
+ var/list/trace_gas = list("sleeping_agent", "volatile_fuel") //list of other gases that this air alarm is able to detect
var/danger_level = 0
var/pressure_dangerlevel = 0
@@ -240,23 +241,24 @@
/obj/machinery/alarm/proc/overall_danger_level(var/datum/gas_mixture/environment)
var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
var/environment_pressure = environment.return_pressure()
- //var/other_moles = 0.0
- ////for(var/datum/gas/G in environment.trace_gases)
- // other_moles+=G.moles
+
+ var/other_moles = 0
+ for(var/g in trace_gas)
+ other_moles += environment.gas[g] //this is only going to be used in a partial pressure calc, so we don't need to worry about group_multiplier here.
pressure_dangerlevel = get_danger_level(environment_pressure, TLV["pressure"])
oxygen_dangerlevel = get_danger_level(environment.gas["oxygen"]*partial_pressure, TLV["oxygen"])
co2_dangerlevel = get_danger_level(environment.gas["carbon_dioxide"]*partial_pressure, TLV["carbon dioxide"])
phoron_dangerlevel = get_danger_level(environment.gas["phoron"]*partial_pressure, TLV["phoron"])
temperature_dangerlevel = get_danger_level(environment.temperature, TLV["temperature"])
- //other_dangerlevel = get_danger_level(other_moles*partial_pressure, TLV["other"])
+ other_dangerlevel = get_danger_level(other_moles*partial_pressure, TLV["other"])
return max(
pressure_dangerlevel,
oxygen_dangerlevel,
co2_dangerlevel,
phoron_dangerlevel,
- //other_dangerlevel,
+ other_dangerlevel,
temperature_dangerlevel
)
@@ -504,34 +506,13 @@
var/list/environment_data = new
data["has_environment"] = total
if(total)
- var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
-
- var/list/current_settings = TLV["pressure"]
var/pressure = environment.return_pressure()
- var/pressure_danger = get_danger_level(pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Pressure", "value" = pressure, "unit" = "kPa", "danger_level" = pressure_danger)
- data["total_danger"] = pressure_danger
-
- current_settings = TLV["oxygen"]
- var/oxygen_danger = get_danger_level(environment.gas["oxygen"]*partial_pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Oxygen", "value" = environment.gas["oxygen"] / total * 100, "unit" = "%", "danger_level" = oxygen_danger)
- data["total_danger"] = max(oxygen_danger, data["total_danger"])
-
- current_settings = TLV["carbon dioxide"]
- var/carbon_dioxide_danger = get_danger_level(environment.gas["carbon_dioxide"]*partial_pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Carbon dioxide", "value" = environment.gas["carbon_dioxide"] / total * 100, "unit" = "%", "danger_level" = carbon_dioxide_danger)
- data["total_danger"] = max(carbon_dioxide_danger, data["total_danger"])
-
- current_settings = TLV["phoron"]
- var/phoron_danger = get_danger_level(environment.gas["phoron"]*partial_pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Toxins", "value" = environment.gas["phoron"] / total * 100, "unit" = "%", "danger_level" = phoron_danger)
- data["total_danger"] = max(phoron_danger, data["total_danger"])
-
- current_settings = TLV["temperature"]
- var/temperature_danger = get_danger_level(environment.temperature, current_settings)
- environment_data[++environment_data.len] = list("name" = "Temperature", "value" = environment.temperature, "unit" = "K ([round(environment.temperature - T0C, 0.1)]C)", "danger_level" = temperature_danger)
- data["total_danger"] = max(temperature_danger, data["total_danger"])
-
+ environment_data[++environment_data.len] = list("name" = "Pressure", "value" = pressure, "unit" = "kPa", "danger_level" = pressure_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Oxygen", "value" = environment.gas["oxygen"] / total * 100, "unit" = "%", "danger_level" = oxygen_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Carbon dioxide", "value" = environment.gas["carbon_dioxide"] / total * 100, "unit" = "%", "danger_level" = co2_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Toxins", "value" = environment.gas["phoron"] / total * 100, "unit" = "%", "danger_level" = phoron_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Temperature", "value" = environment.temperature, "unit" = "K ([round(environment.temperature - T0C, 0.1)]C)", "danger_level" = temperature_dangerlevel)
+ data["total_danger"] = danger_level
data["environment"] = environment_data
data["atmos_alarm"] = alarm_area.atmosalm
data["fire_alarm"] = alarm_area.fire != null
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index fb4a03d21f6..99d713cccba 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -71,7 +71,7 @@
/obj/machinery/syndicate_beacon/proc/selfdestruct()
selfdestructing = 1
- spawn() explosion(src.loc, rand(3,8), rand(1,3), 1, 10)
+ spawn() explosion(src.loc, 1, rand(1,3), rand(3,8), 10)
////////////////////////////////////////
//Singularity beacon
diff --git a/code/game/objects/effects/explosion_particles.dm b/code/game/objects/effects/explosion_particles.dm
index 90020e50801..e0750ba1c35 100644
--- a/code/game/objects/effects/explosion_particles.dm
+++ b/code/game/objects/effects/explosion_particles.dm
@@ -9,7 +9,7 @@
/obj/effect/expl_particles/New()
..()
spawn (15)
- src.loc = null
+ qdel(src)
return
/obj/effect/expl_particles/Move()
@@ -49,7 +49,7 @@
/obj/effect/explosion/New()
..()
spawn (10)
- src.loc = null
+ qdel(src)
return
/datum/effect/system/explosion
diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm
index 4b90283a56d..2131e977ac7 100644
--- a/code/modules/admin/verbs/buildmode.dm
+++ b/code/modules/admin/verbs/buildmode.dm
@@ -42,6 +42,12 @@
icon = 'icons/misc/buildmode.dmi'
var/obj/effect/bmode/buildholder/master = null
+/obj/effect/bmode/Destroy()
+ if(master && master.cl)
+ master.cl.screen -= src
+ master = null
+ return ..()
+
/obj/effect/bmode/builddir
icon_state = "build"
screen_loc = "NORTH,WEST"
@@ -117,6 +123,19 @@
var/obj/effect/bmode/buildquit/buildquit = null
var/atom/movable/throw_atom = null
+/obj/effect/bmode/buildholder/Destroy()
+ qdel(builddir)
+ builddir = null
+ qdel(buildhelp)
+ buildhelp = null
+ qdel(buildmode)
+ buildmode = null
+ qdel(buildquit)
+ buildquit = null
+ throw_atom = null
+ cl = null
+ return ..()
+
/obj/effect/bmode/buildmode
icon_state = "buildmode1"
screen_loc = "NORTH,WEST+2"
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 0cf15d0d0d1..76f6dcc7993 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -397,7 +397,30 @@ BLIND // can't see anything
//autodetect rollability
if(rolled_down < 0)
if((worn_state + "_d_s") in icon_states('icons/mob/uniform.dmi'))
+
+/obj/item/clothing/under/proc/update_rolldown_status()
+
+ var/mob/living/carbon/human/H
+ if(istype(src.loc, /mob/living/carbon/human))
+ H = src.loc
+
+ var/icon/under_icon
+ if(icon_override)
+ under_icon = icon_override
+ else if(H && sprite_sheets && sprite_sheets[H.species.name])
+ under_icon = sprite_sheets[H.species.name]
+ else if(item_icons && item_icons[slot_w_uniform_str])
+ under_icon = item_icons[slot_w_uniform_str]
+ else
+ under_icon = INV_W_UNIFORM_DEF_ICON
+
+ // The _s is because the icon update procs append it.
+ if(("[worn_state]_d_s") in icon_states(under_icon))
+ if(rolled_down != 1)
rolled_down = 0
+ else
+ rolled_down = -1
+ if(H) update_clothing_icon()
/obj/item/clothing/under/update_clothing_icon()
if (ismob(src.loc))
@@ -540,7 +563,8 @@ BLIND // can't see anything
if(!istype(usr, /mob/living)) return
if(usr.stat) return
- if(rolled_down < 0)
+ update_rolldown_status()
+ if(rolled_down == -1)
usr << "You cannot roll down [src]!"
return
diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm
index c99fe6936d0..729c204f8b3 100644
--- a/code/modules/customitems/item_spawning.dm
+++ b/code/modules/customitems/item_spawning.dm
@@ -49,18 +49,23 @@
item.icon = CUSTOM_ITEM_OBJ
item.icon_state = item_icon
return
- else
+ else
if(inherit_inhands)
apply_inherit_inhands(item)
else
item.item_state_slots = null
item.item_icons = null
-
+
item.icon = CUSTOM_ITEM_OBJ
item.icon_state = item_icon
item.item_state = null
item.icon_override = CUSTOM_ITEM_MOB
+ var/obj/item/clothing/under/U = item
+ if(istype(U))
+ U.worn_state = U.icon_state
+ U.update_rolldown_status()
+
// Kits are dumb so this is going to have to be hardcoded/snowflake.
if(istype(item, /obj/item/device/kit))
var/obj/item/device/kit/K = item
@@ -81,9 +86,9 @@
/datum/custom_item/proc/apply_inherit_inhands(var/obj/item/item)
var/list/new_item_icons = list()
var/list/new_item_state_slots = list()
-
+
var/list/available_states = icon_states(CUSTOM_ITEM_MOB)
-
+
//If l_hand or r_hand are not present, preserve them using item_icons/item_state_slots
//Then use icon_override to make every other slot use the custom sprites by default.
//This has to be done before we touch any of item's vars
@@ -93,7 +98,7 @@
if(!("[item_icon]_r" in available_states))
new_item_state_slots[slot_r_hand_str] = get_state(item, slot_r_hand_str, "_r")
new_item_icons[slot_r_hand_str] = get_icon(item, slot_r_hand_str, 'icons/mob/items/righthand.dmi')
-
+
item.item_state_slots = new_item_state_slots
item.item_icons = new_item_icons
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index a75a4b16300..f3f399c8864 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -41,7 +41,7 @@ This saves us from having to call add_fingerprint() any time something is put in
/mob/living/carbon/human/proc/has_organ(name)
var/obj/item/organ/external/O = organs_by_name[name]
- return (O && !(O.status & ORGAN_DESTROYED) && !O.is_stump())
+ return (O && !(O.status & ORGAN_DESTROYED) && !O.is_stump())
/mob/living/carbon/human/proc/has_organ_for_slot(slot)
switch(slot)
diff --git a/code/modules/mob/living/silicon/robot/custom_sprites.dm b/code/modules/mob/living/silicon/robot/custom_sprites.dm
index 5966796f4d3..360308ccec4 100644
--- a/code/modules/mob/living/silicon/robot/custom_sprites.dm
+++ b/code/modules/mob/living/silicon/robot/custom_sprites.dm
@@ -25,6 +25,6 @@ var/list/robot_custom_icons
var/rname = robot_custom_icons[ckey]
if(rname && rname == real_name)
custom_sprite = 1
- icon = 'icons/mob/custom_synthetic.dmi'
+ icon = CUSTOM_ITEM_ROBOT
if(icon_state == "robot")
icon_state = "[ckey]-Standard"
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index c9d08b2b497..8e8ab59ca6c 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -65,9 +65,9 @@
if(src.camera && !scrambledcodes)
if(src.stat == 2 || wires.IsIndexCut(BORG_WIRE_CAMERA))
- src.camera.status = 0
+ src.camera.set_status(0)
else
- src.camera.status = 1
+ src.camera.set_status(1)
updatehealth()
diff --git a/nano/templates/air_alarm.tmpl b/nano/templates/air_alarm.tmpl
index edfe41cda7a..2caa14e955c 100644
--- a/nano/templates/air_alarm.tmpl
+++ b/nano/templates/air_alarm.tmpl
@@ -30,9 +30,9 @@ Used In File(s): \code\game\machinery\alarm.dm
{{:helper.fixed(value.value, 1)}}
{{:value.unit}}
{{/for}}
- Local Status: {{if value.danger_level == 2}}
+ Local Status: {{if data.total_danger == 2}}
DANGER: Internals Required
- {{else value.danger_level == 1}}
+ {{else data.total_danger == 1}}
Caution
{{else}}
Optimal