Merge remote-tracking branch 'upstream/dev-freeze' into dev

Conflicts:
	code/modules/clothing/clothing.dm
	code/modules/mob/living/carbon/human/inventory.dm
	code/modules/mob/living/silicon/ai/ai.dm
	code/modules/mob/living/silicon/robot/custom_sprites.dm
	code/modules/organs/organ_stump.dm
	code/setup.dm
This commit is contained in:
PsiOmega
2015-08-10 17:56:14 +02:00
12 changed files with 89 additions and 51 deletions

View File

@@ -49,6 +49,11 @@ datum/controller/game_controller/proc/setup_objects()
for(var/atom/movable/object in world)
object.initialize()
admin_notice("<span class='danger>Initializing areas</span>", R_DEBUG)
sleep(-1)
for(var/area/area in all_areas)
area.initialize()
admin_notice("<span class='danger'>Initializing pipe networks</span>", R_DEBUG)
sleep(-1)
for(var/obj/machinery/atmospherics/machine in machines)

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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 << "<span class='notice'>You cannot roll down [src]!</span>"
return

View File

@@ -61,6 +61,11 @@
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

View File

@@ -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"

View File

@@ -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()

View File

@@ -30,9 +30,9 @@ Used In File(s): \code\game\machinery\alarm.dm
{{:helper.fixed(value.value, 1)}}
</span>{{:value.unit}}<br>
{{/for}}
Local Status: {{if value.danger_level == 2}}
Local Status: {{if data.total_danger == 2}}
<span class='bad'>DANGER: Internals Required
{{else value.danger_level == 1}}
{{else data.total_danger == 1}}
<span class='average'>Caution
{{else}}
<span class='good'>Optimal