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

Conflicts:
	code/modules/mob/living/carbon/human/life.dm
	code/modules/nano/nanomanager.dm
	code/modules/surgery/surgery.dm
This commit is contained in:
PsiOmega
2015-03-05 08:05:44 +01:00
9 changed files with 1785 additions and 1782 deletions
+55 -54
View File
@@ -1,54 +1,55 @@
proc/createRandomZlevel()
if(awaydestinations.len) //crude, but it saves another var!
return
var/list/potentialRandomZlevels = list()
world << "\red \b Searching for away missions..."
var/list/Lines = file2list("maps/RandomZLevels/fileList.txt")
if(!Lines.len) return
for (var/t in Lines)
if (!t)
continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
// var/value = null
if (pos)
// No, don't do lowertext here, that breaks paths on linux
name = copytext(t, 1, pos)
// value = copytext(t, pos + 1)
else
// No, don't do lowertext here, that breaks paths on linux
name = t
if (!name)
continue
potentialRandomZlevels.Add(name)
if(potentialRandomZlevels.len)
world << "\red \b Loading away mission..."
var/map = pick(potentialRandomZlevels)
var/file = file(map)
if(isfile(file))
maploader.load_map(file, load_speed = 100)
for(var/obj/effect/landmark/L in landmarks_list)
if (L.name != "awaystart")
continue
awaydestinations.Add(L)
world << "\red \b Away mission loaded."
else
world << "\red \b No away missions found."
return
proc/createRandomZlevel()
if(awaydestinations.len) //crude, but it saves another var!
return
var/list/potentialRandomZlevels = list()
world << "\red \b Searching for away missions..."
var/list/Lines = file2list("maps/RandomZLevels/fileList.txt")
if(!Lines.len) return
for (var/t in Lines)
if (!t)
continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
// var/value = null
if (pos)
// No, don't do lowertext here, that breaks paths on linux
name = copytext(t, 1, pos)
// value = copytext(t, pos + 1)
else
// No, don't do lowertext here, that breaks paths on linux
name = t
if (!name)
continue
potentialRandomZlevels.Add(name)
if(potentialRandomZlevels.len)
world << "\red \b Loading away mission..."
var/map = pick(potentialRandomZlevels)
var/file = file(map)
if(isfile(file))
maploader.load_map(file)
world.log << "away mission loaded: [map]"
for(var/obj/effect/landmark/L in landmarks_list)
if (L.name != "awaystart")
continue
awaydestinations.Add(L)
world << "\red \b Away mission loaded."
else
world << "\red \b No away missions found."
return
+1 -2
View File
@@ -53,10 +53,9 @@ dmm_suite{
*/
verb/load_map(var/dmm_file as file, var/z_offset as num, var/load_speed as num)
verb/load_map(var/dmm_file as file, var/z_offset as num)
// dmm_file: A .dmm file to load (Required).
// z_offset: A number representing the z-level on which to start loading the map (Optional).
// load_speed: How many tiles should be loaded per second, defaults to no pause (Optional)
verb/write_map(var/turf/t1 as turf, var/turf/t2 as turf, var/flags as num){
// t1: A turf representing one corner of a three dimensional grid (Required).
+41 -43
View File
@@ -600,32 +600,35 @@
// Hot air hurts :(
if((breath.temperature < species.cold_level_1 || breath.temperature > species.heat_level_1) && !(COLD_RESISTANCE in mutations))
if(breath.temperature < species.cold_level_1)
if(breath.temperature <= species.cold_level_1)
if(prob(20))
src << "<span class='danger'>You feel your face freezing and icicles forming in your lungs!</span>"
else if(breath.temperature > species.heat_level_1)
else if(breath.temperature >= species.heat_level_1)
if(prob(20))
src << "<span class='danger'>You feel your face burning and a searing heat in your lungs!</span>"
switch(breath.temperature)
if(-INFINITY to species.cold_level_3)
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
if(species.cold_level_3 to species.cold_level_2)
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
if(species.cold_level_2 to species.cold_level_1)
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
if(species.heat_level_1 to species.heat_level_2)
if(breath.temperature >= species.heat_level_1)
if(breath.temperature < species.heat_level_2)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
if(species.heat_level_2 to species.heat_level_3)
else if(breath.temperature < species.heat_level_3)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
if(species.heat_level_3 to INFINITY)
else
apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
else if(breath.temperature <= species.cold_level_1)
if(breath.temperature > species.cold_level_2)
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
else if(breath.temperature > species.cold_level_3)
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
else
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
//breathing in hot/cold air also heats/cools you a bit
var/temp_adj = breath.temperature - bodytemperature
@@ -695,43 +698,38 @@
//Use heat transfer as proportional to the gas density. However, we only care about the relative density vs standard 101 kPa/20 C air. Therefore we can use mole ratios
var/relative_density = environment.total_moles / MOLES_CELLSTANDARD
temp_adj *= relative_density
if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX
if (temp_adj < BODYTEMP_COOLING_MAX) temp_adj = BODYTEMP_COOLING_MAX
//world << "Environment: [loc_temp], [src]: [bodytemperature], Adjusting: [temp_adj]"
bodytemperature += temp_adj
bodytemperature += between(BODYTEMP_COOLING_MAX, temp_adj*relative_density, BODYTEMP_HEATING_MAX)
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > species.heat_level_1)
if(bodytemperature >= species.heat_level_1)
//Body temperature is too hot.
fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE) return 1 //godmode
switch(bodytemperature)
if(species.heat_level_1 to species.heat_level_2)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
if(species.heat_level_2 to species.heat_level_3)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
if(species.heat_level_3 to INFINITY)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
if(bodytemperature < species.heat_level_2)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else if(bodytemperature < species.heat_level_3)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else if(bodytemperature < species.cold_level_1)
else if(bodytemperature <= species.cold_level_1)
fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE) return 1 //godmode
if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
switch(bodytemperature)
if(species.cold_level_2 to species.cold_level_1)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
if(species.cold_level_3 to species.cold_level_2)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
if(-INFINITY to species.cold_level_3)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
if(bodytemperature > species.cold_level_2)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
else if(bodytemperature > species.cold_level_3)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
else
take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1)
// Account for massive pressure differences. Done by Polymorph
// Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense!
+1 -1
View File
@@ -220,7 +220,7 @@
*/
/datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
//testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]")
if (isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
if (!oldMob || isnull(oldMob.open_uis) || !istype(oldMob.open_uis, /list) || open_uis.len == 0)
//testing("nanomanager/user_transferred mob [oldMob.name] has no open uis")
return 0 // has no open uis
+10 -10
View File
@@ -82,27 +82,27 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
return 0
if (user.a_intent == "harm") //check for Hippocratic Oath
return 0
if(M.op_stage.in_progress) //Can't operate on someone repeatedly.
user << "\red You can't operate on the patient while surgery is already in progress."
var/zone = user.zone_sel.selecting
if(zone in M.op_stage.in_progress) //Can't operate on someone repeatedly.
user << "\red You can't operate on this area while surgery is already in progress."
return 1
for(var/datum/surgery_step/S in surgery_steps)
//check if tool is right or close enough and if this step is possible
if(S.tool_quality(tool))
var/step_is_valid = S.can_use(user, M, user.zone_sel.selecting, tool)
var/step_is_valid = S.can_use(user, M, zone, tool)
if(step_is_valid && S.is_valid_target(M))
if(step_is_valid == 2) // This is a failure that already has a message for failing.
return 1
M.op_stage.in_progress = 1
S.begin_step(user, M, user.zone_sel.selecting, tool) //start on it
M.op_stage.in_progress += zone
S.begin_step(user, M, zone, tool) //start on it
//We had proper tools! (or RNG smiled.) and user did not move or change hands.
if(prob(S.tool_quality(tool)) && do_mob(user, M, rand(S.min_duration, S.max_duration)))
S.end_step(user, M, user.zone_sel.selecting, tool) //finish successfully
S.end_step(user, M, zone, tool) //finish successfully
else if ((tool in user.contents) && user.Adjacent(M)) //or
S.fail_step(user, M, user.zone_sel.selecting, tool) //malpractice~
S.fail_step(user, M, zone, tool) //malpractice~
else // This failing silently was a pain.
user << "\red You must remain close to your patient to conduct surgery."
M.op_stage.in_progress = 0 // Clear the in-progress flag.
M.op_stage.in_progress -= zone // Clear the in-progress flag.
if (ishuman(M))
var/mob/living/carbon/human/H = M
H.update_surgery()
@@ -134,4 +134,4 @@ proc/sort_surgeries()
var/face = 0
var/head_reattach = 0
var/current_organ = "organ"
var/in_progress = 0
var/list/in_progress = list()