Merge pull request #2052 from CIB/feature

Many feature commits
This commit is contained in:
Hawk-v3
2012-12-18 05:12:30 -08:00
12 changed files with 151 additions and 9 deletions
+1 -2
View File
@@ -235,7 +235,6 @@ proc/airborne_can_reach(turf/source, turf/target)
if(prob(1))
majormutate()
if(mob.reagents.has_reagent("spaceacillin"))
mob.reagents.remove_reagent("spaceacillin",0.3)
return
if(mob.reagents.has_reagent("virusfood"))
mob.reagents.remove_reagent("virusfood",0.1)
@@ -599,4 +598,4 @@ proc/airborne_can_reach(turf/source, turf/target)
getrandomeffect_greater()
/proc/dprob(var/p)
return(prob(sqrt(p)) && prob(sqrt(p)))
return(prob(sqrt(p)) && prob(sqrt(p)))
+54 -4
View File
@@ -16,6 +16,9 @@ zone
last_update = 0
progress = "nothing"
// To make sure you're not spammed to death by airflow sound effects
tmp/playsound_cooldown = 0
//CREATION AND DELETION
New(turf/start)
. = ..()
@@ -161,6 +164,16 @@ zone/proc/process()
RemoveTurf(T)
if(unsimulated_tiles)
var/moved_air = ShareSpace(air,unsimulated_tiles)
// Only play a sound effect every once in a while
if(playsound_cooldown <= world.time)
// Play a nice sound effect at one of the bordering turfs
playsound_cooldown = world.time + rand(30, 70)
var/turf/random_border = pick(contents)
play_wind_sound(random_border, abs(moved_air))
if(moved_air > vsc.airflow_lightest_pressure)
AirflowSpace(src)
@@ -239,7 +252,17 @@ zone/proc/process()
for(var/zone/Z in connected_zones)
if(air && Z.air)
//Ensure we're not doing pointless calculations on equilibrium zones.
if(abs(air.total_moles() - Z.air.total_moles()) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
var/moles_delta = abs(air.total_moles() - Z.air.total_moles())
if(moles_delta > 0.1)
// Only play a sound effect every once in a while
if(playsound_cooldown <= world.time)
// Play a nice sound effect at one of the bordering turfs
playsound_cooldown = world.time + rand(30, 70)
var/turf/random_border = pick(contents)
play_wind_sound(random_border, abs(moles_delta))
if(moles_delta > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
if(abs(Z.air.return_pressure() - air.return_pressure()) > vsc.airflow_lightest_pressure)
Airflow(src,Z)
ShareRatio( air , Z.air , connected_zones[Z] )
@@ -255,7 +278,7 @@ var/list/sharing_lookup_table = list(0.06, 0.11, 0.15, 0.18, 0.20, 0.21)
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
//Shares a specific ratio of gas between mixtures using simple weighted averages.
var
ratio = 0.21
ratio = 0.50
size = max(1,A.group_multiplier)
share_size = max(1,B.group_multiplier)
@@ -281,10 +304,13 @@ proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles)
temp_avg = (A.temperature * full_heat_capacity + B.temperature * s_full_heat_capacity) / (full_heat_capacity + s_full_heat_capacity)
<<<<<<< HEAD
=======
if(sharing_lookup_table.len >= connecting_tiles) //6 or more interconnecting tiles will max at 42% of air moved per tick.
ratio = sharing_lookup_table[connecting_tiles]
ratio *= 3
>>>>>>> bc318a3c8e40f9a2eed179318e17f56ce828ab1e
A.oxygen = max(0, (A.oxygen - oxy_avg) * (1-ratio) + oxy_avg )
A.nitrogen = max(0, (A.nitrogen - nit_avg) * (1-ratio) + nit_avg )
A.carbon_dioxide = max(0, (A.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg )
@@ -339,7 +365,8 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles)
unsim_temperature += T.temperature/unsimulated_tiles.len
var
ratio = 0.21
// Depressurize very, very fast(it's fine since many rooms are internally multiple zones)
ratio = 0.50
old_pressure = A.return_pressure()
@@ -353,6 +380,12 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles)
//full_heat_capacity = A.heat_capacity() * size
<<<<<<< HEAD
oxy_avg = (full_oxy + unsim_oxygen * 4) / (size + share_size * 4)
nit_avg = (full_nitro + unsim_nitrogen * 4) / (size + share_size * 4)
co2_avg = (full_co2 + unsim_co2 * 4) / (size + share_size * 4)
plasma_avg = (full_plasma + unsim_plasma * 4) / (size + share_size * 4)
=======
oxy_avg = unsim_oxygen//(full_oxy + unsim_oxygen) / (size + share_size)
nit_avg = unsim_nitrogen//(full_nitro + unsim_nitrogen) / (size + share_size)
co2_avg = unsim_co2//(full_co2 + unsim_co2) / (size + share_size)
@@ -363,13 +396,15 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles)
if(sharing_lookup_table.len >= unsimulated_tiles.len) //6 or more interconnecting tiles will max at 42% of air moved per tick.
ratio = sharing_lookup_table[unsimulated_tiles.len]
ratio *= 3
>>>>>>> bc318a3c8e40f9a2eed179318e17f56ce828ab1e
A.oxygen = max(0, (A.oxygen - oxy_avg) * (1-ratio) + oxy_avg )
A.nitrogen = max(0, (A.nitrogen - nit_avg) * (1-ratio) + nit_avg )
A.carbon_dioxide = max(0, (A.carbon_dioxide - co2_avg) * (1-ratio) + co2_avg )
A.toxins = max(0, (A.toxins - plasma_avg) * (1-ratio) + plasma_avg )
A.temperature = max(TCMB, (A.temperature - temp_avg) * (1-ratio) + temp_avg )
// EXPERIMENTAL: Disable space being cold
//A.temperature = max(TCMB, (A.temperature - temp_avg) * (1-ratio) + temp_avg )
for(var/datum/gas/G in A.trace_gases)
var/G_avg = (G.moles*size + 0) / (size+share_size)
@@ -459,6 +494,21 @@ zone/proc/Rebuild()
if(istype(T) && T.zone && S.CanPass(null, T, 0, 0))
T.zone.AddTurf(S)
proc/play_wind_sound(var/turf/random_border, var/n)
if(random_border)
var/windsound = 'sound/effects/wind/wind_2_1.ogg'
switch(n)
if(0 to 30)
windsound = pick('sound/effects/wind/wind_2_1.ogg', 'sound/effects/wind/wind_2_2.ogg')
if(31 to 40)
windsound = pick('sound/effects/wind/wind_3_1.ogg')
if(41 to 60)
windsound = pick('sound/effects/wind/wind_4_1.ogg', 'sound/effects/wind/wind_4_2.ogg')
if(61 to 1000000)
windsound = pick('sound/effects/wind/wind_5_1.ogg')
playsound(random_border, windsound, 50, 1, 1)
//UNUSED
/*
zone/proc/connected_zones()
+78
View File
@@ -379,6 +379,84 @@ datum/objective/survive
return 0
return 1
// Similar to the anti-rev objective, but for traitors
datum/objective/brig
var/already_completed = 0
find_target()
..()
if(target && target.current)
explanation_text = "Have [target.current.real_name], the [target.assigned_role] brigged for 10 minutes."
else
explanation_text = "Free Objective"
return target
find_target_by_role(role, role_type=0)
..(role, role_type)
if(target && target.current)
explanation_text = "Have [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] brigged for 10 minutes."
else
explanation_text = "Free Objective"
return target
check_completion()
if(already_completed)
return 1
if(target && target.current)
if(target.current.stat == DEAD)
return 0
// Make the actual required time a bit shorter than the official time
if(target.is_brigged(10 * 60 * 5))
already_completed = 1
return 1
return 0
return 0
// Harm a crew member, making an example of them
datum/objective/harm
var/already_completed = 0
find_target()
..()
if(target && target.current)
explanation_text = "Make an example of [target.current.real_name], the [target.assigned_role]. Break one of their bones, detach one of their limbs or disfigure their face. Make sure they're alive when you do it."
else
explanation_text = "Free Objective"
return target
find_target_by_role(role, role_type=0)
..(role, role_type)
if(target && target.current)
explanation_text = "Make an example of [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]. Break one of their bones, detach one of their limbs or disfigure their face. Make sure they're alive when you do it."
else
explanation_text = "Free Objective"
return target
check_completion()
if(already_completed)
return 1
if(target && target.current && istype(target.current, /mob/living/carbon/human))
if(target.current.stat == DEAD)
return 0
var/mob/living/carbon/human/H = target.current
for(var/datum/organ/external/E in H.organs)
if(E.status & ORGAN_BROKEN)
already_completed = 1
return 1
if(E.status & ORGAN_DESTROYED && !E.amputated)
already_completed = 1
return 1
var/datum/organ/external/head/head = H.get_organ("head")
if(head.disfigured)
return 1
return 0
datum/objective/nuclear
explanation_text = "Destroy the station with a nuclear device."
+12 -2
View File
@@ -94,11 +94,21 @@
else
switch(rand(1,100))
if(1 to 50)
if(1 to 33)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
traitor.objectives += kill_objective
if(34 to 50)
var/datum/objective/brig/brig_objective = new
brig_objective.owner = traitor
brig_objective.find_target()
traitor.objectives += brig_objective
if(51 to 66)
var/datum/objective/harm/harm_objective = new
harm_objective.owner = traitor
harm_objective.find_target()
traitor.objectives += harm_objective
else
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
@@ -273,4 +283,4 @@
else
traitor_mob << "Unfortunately, the Syndicate did not provide you with a code response."
traitor_mob << "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe."
//End code phrase.
//End code phrase.
@@ -799,6 +799,10 @@
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
if(adjusted_pressure > HAZARD_HIGH_PRESSURE)
adjustBruteLoss( min( (adjusted_pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT , MAX_PRESSURE_DAMAGE) )
else if(pressure <= 50)
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
if(adjusted_pressure < 50)
adjustBruteLoss( (50 - adjusted_pressure) / 50 )
return
/*
+2 -1
View File
@@ -1552,8 +1552,8 @@ datum
color = "#C8A5DC" // rgb: 200, 165, 220
on_mob_life(var/mob/living/M as mob)//no more mr. panacea
// Only consume 0.1 units per tick
holder.remove_reagent(src.id, 0.2)
..()
return
carpotoxin
@@ -2147,6 +2147,7 @@ datum
if(!M) M = holder.my_atom
M.druggy = max(M.druggy, 30)
if(!data) data = 1
switch(data)
if(1 to 5)
if (!M.stuttering) M.stuttering = 1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.