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

View File

@@ -72,10 +72,10 @@ datum/mind
current.remove_changeling_powers() current.remove_changeling_powers()
current.verbs -= /datum/changeling/proc/EvolutionMenu current.verbs -= /datum/changeling/proc/EvolutionMenu
current.mind = null current.mind = null
if(new_character.mind) //remove any mind currently in our new body's mind variable
new_character.mind.current = null
nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
if(new_character.mind) //remove any mind currently in our new body's mind variable
new_character.mind.current = null
current = new_character //link ourself to our new body current = new_character //link ourself to our new body
new_character.mind = src //and link our new body to ourself new_character.mind = src //and link our new body to ourself

View File

@@ -266,13 +266,19 @@ Auto Patrol: []"},
src.mode = 0 src.mode = 0
walk_to(src,0) walk_to(src,0)
if(target) // make sure target exists
// We re-assess human targets, before bashing their head in, in case their credentials change // We re-assess human targets, before bashing their head in, in case their credentials change
if(target && istype(target, /mob/living/carbon/human)) if(istype(target, /mob/living/carbon/human))
var/threat = src.assess_perp(target, idcheck, check_records, check_arrest) var/threat = src.assess_perp(target, idcheck, check_records, check_arrest)
if(threat < 4) if(threat < 4)
target = null frustration = 8
return
// The target must remain in view to complete the desire to bash its head in
if(!(target in view(search_range,src)))
frustration++
return
if(target) // make sure target exists
if(!lasercolor && Adjacent(target)) // If right next to perp. Lasertag bots do not arrest anyone, just patrol and shoot and whatnot if(!lasercolor && Adjacent(target)) // If right next to perp. Lasertag bots do not arrest anyone, just patrol and shoot and whatnot
if(istype(src.target,/mob/living/carbon)) if(istype(src.target,/mob/living/carbon))
playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)

View File

@@ -1076,7 +1076,7 @@ About the new airlock wires panel:
..() ..()
//if assembly is given, create the new door from the assembly //if assembly is given, create the new door from the assembly
if (assembly) if (assembly && istype(assembly))
assembly_type = assembly.type assembly_type = assembly.type
electronics = assembly.electronics electronics = assembly.electronics

View File

@@ -40,7 +40,8 @@ proc/createRandomZlevel()
var/map = pick(potentialRandomZlevels) var/map = pick(potentialRandomZlevels)
var/file = file(map) var/file = file(map)
if(isfile(file)) if(isfile(file))
maploader.load_map(file, load_speed = 100) maploader.load_map(file)
world.log << "away mission loaded: [map]"
for(var/obj/effect/landmark/L in landmarks_list) for(var/obj/effect/landmark/L in landmarks_list)
if (L.name != "awaystart") if (L.name != "awaystart")

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). // dmm_file: A .dmm file to load (Required).
// z_offset: A number representing the z-level on which to start loading the map (Optional). // 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){ 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). // t1: A turf representing one corner of a three dimensional grid (Required).

View File

@@ -600,33 +600,36 @@
// Hot air hurts :( // 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 || 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)) if(prob(20))
src << "<span class='danger'>You feel your face freezing and icicles forming in your lungs!</span>" 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)) if(prob(20))
src << "<span class='danger'>You feel your face burning and a searing heat in your lungs!</span>" src << "<span class='danger'>You feel your face burning and a searing heat in your lungs!</span>"
switch(breath.temperature) if(breath.temperature >= species.heat_level_1)
if(-INFINITY to species.cold_level_3) if(breath.temperature < species.heat_level_2)
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)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat") apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2) 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") apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2) 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") apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2) 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 //breathing in hot/cold air also heats/cools you a bit
var/temp_adj = breath.temperature - bodytemperature var/temp_adj = breath.temperature - bodytemperature
if (temp_adj < 0) if (temp_adj < 0)
@@ -695,41 +698,36 @@
//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 //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 var/relative_density = environment.total_moles / MOLES_CELLSTANDARD
temp_adj *= relative_density bodytemperature += between(BODYTEMP_COOLING_MAX, temp_adj*relative_density, BODYTEMP_HEATING_MAX)
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
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. // +/- 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. //Body temperature is too hot.
fire_alert = max(fire_alert, 1) fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE) return 1 //godmode if(status_flags & GODMODE) return 1 //godmode
switch(bodytemperature)
if(species.heat_level_1 to species.heat_level_2) if(bodytemperature < species.heat_level_2)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2) fire_alert = max(fire_alert, 2)
if(species.heat_level_2 to species.heat_level_3) else if(bodytemperature < species.heat_level_3)
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2) fire_alert = max(fire_alert, 2)
if(species.heat_level_3 to INFINITY) else
take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2) 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) fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE) return 1 //godmode if(status_flags & GODMODE) return 1 //godmode
if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
switch(bodytemperature) if(bodytemperature > species.cold_level_2)
if(species.cold_level_2 to species.cold_level_1)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1) fire_alert = max(fire_alert, 1)
if(species.cold_level_3 to species.cold_level_2) else if(bodytemperature > species.cold_level_3)
take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1) fire_alert = max(fire_alert, 1)
if(-INFINITY to species.cold_level_3) else
take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 1) fire_alert = max(fire_alert, 1)

View File

@@ -220,7 +220,7 @@
*/ */
/datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob) /datum/nanomanager/proc/user_transferred(var/mob/oldMob, var/mob/newMob)
//testing("nanomanager/user_transferred from mob [oldMob.name] to mob [newMob.name]") //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") //testing("nanomanager/user_transferred mob [oldMob.name] has no open uis")
return 0 // has no open uis return 0 // has no open uis

View File

@@ -82,27 +82,27 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool)
return 0 return 0
if (user.a_intent == "harm") //check for Hippocratic Oath if (user.a_intent == "harm") //check for Hippocratic Oath
return 0 return 0
if(M.op_stage.in_progress) //Can't operate on someone repeatedly. var/zone = user.zone_sel.selecting
user << "\red You can't operate on the patient while surgery is already in progress." 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 return 1
for(var/datum/surgery_step/S in surgery_steps) for(var/datum/surgery_step/S in surgery_steps)
//check if tool is right or close enough and if this step is possible //check if tool is right or close enough and if this step is possible
if(S.tool_quality(tool)) 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 && S.is_valid_target(M))
if(step_is_valid == 2) // This is a failure that already has a message for failing. if(step_is_valid == 2) // This is a failure that already has a message for failing.
return 1 return 1
M.op_stage.in_progress = 1 M.op_stage.in_progress += zone
S.begin_step(user, M, user.zone_sel.selecting, tool) //start on it 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. //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))) 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 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. else // This failing silently was a pain.
user << "\red You must remain close to your patient to conduct surgery." 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)) if (ishuman(M))
var/mob/living/carbon/human/H = M var/mob/living/carbon/human/H = M
H.update_surgery() H.update_surgery()
@@ -134,4 +134,4 @@ proc/sort_surgeries()
var/face = 0 var/face = 0
var/head_reattach = 0 var/head_reattach = 0
var/current_organ = "organ" var/current_organ = "organ"
var/in_progress = 0 var/list/in_progress = list()

File diff suppressed because it is too large Load Diff