Merge branch 'bleeding-edge-freeze' of github.com:Baystation12/Baystation12 into feature

Conflicts:
	code/ZAS/ZAS_Zones.dm
	code/game/gamemodes/events.dm
This commit is contained in:
cib
2012-12-16 15:10:04 +01:00
50 changed files with 645 additions and 158 deletions

View File

@@ -133,15 +133,16 @@ proc/Airflow(zone/A, zone/B)
else
connected_turfs |= C.B
//Get lists of things that can be thrown across the room for each zone.
var/list/pplz = B.movables()
var/list/otherpplz = A.movables()
//Get lists of things that can be thrown across the room for each zone (assumes air is moving from zone B to zone A)
var/list/air_sucked = B.movables()
var/list/air_repelled = A.movables()
if(n < 0)
var/list/temporary_pplz = pplz
pplz = otherpplz
otherpplz = temporary_pplz
//air is moving from zone A to zone B
var/list/temporary_pplz = air_sucked
air_sucked = air_repelled
air_repelled = temporary_pplz
for(var/atom/movable/M in pplz)
for(var/atom/movable/M in air_sucked)
if(M.last_airflow > world.time - vsc.airflow_delay) continue
@@ -166,7 +167,7 @@ proc/Airflow(zone/A, zone/B)
spawn M.GotoAirflowDest(abs(n)/5)
//Do it again for the stuff in the other zone, making it fly away.
for(var/atom/movable/M in otherpplz)
for(var/atom/movable/M in air_repelled)
if(M.last_airflow > world.time - vsc.airflow_delay) continue
@@ -240,12 +241,15 @@ atom/movable
if(airflow_dest == loc)
step_away(src,loc)
if(ismob(src))
if(src:nodamage) return
if(src:nodamage)
return
if(istype(src, /mob/living/carbon/human))
if(istype(src, /mob/living/carbon/human))
if(src:buckled) return
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return
if(src:buckled)
return
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots)
if(src:shoes.flags & NOSLIP)
return
src << "\red You are sucked away by airflow!"
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
@@ -266,9 +270,15 @@ atom/movable
airflow_speed -= vsc.airflow_speed_decay
if(airflow_speed > 7)
if(airflow_time++ >= airflow_speed - 7)
if(od)
density = 0
sleep(1 * tick_multiplier)
else
if(od)
density = 0
sleep(max(1,10-(airflow_speed+3)) * tick_multiplier)
if(od)
density = 1
if ((!( src.airflow_dest ) || src.loc == src.airflow_dest))
src.airflow_dest = locate(min(max(src.x + xo, 1), world.maxx), min(max(src.y + yo, 1), world.maxy), src.z)
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
@@ -276,7 +286,8 @@ atom/movable
if(!istype(loc, /turf))
return
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
if(ismob(src) && src:client)
src:client:move_delay = world.time + vsc.airflow_mob_slowdown
airflow_dest = null
airflow_speed = 0
airflow_time = 0
@@ -295,12 +306,15 @@ atom/movable
if(airflow_dest == loc)
step_away(src,loc)
if(ismob(src))
if(src:nodamage) return
if(src:nodamage)
return
if(istype(src, /mob/living/carbon/human))
if(istype(src, /mob/living/carbon/human))
if(src:buckled) return
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return
if(src:buckled)
return
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots)
if(src:shoes.flags & NOSLIP)
return
src << "\red You are pushed away by airflow!"
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
@@ -331,7 +345,8 @@ atom/movable
if(!istype(loc, /turf))
return
step_towards(src, src.airflow_dest)
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
if(ismob(src) && src:client)
src:client:move_delay = world.time + vsc.airflow_mob_slowdown
airflow_dest = null
airflow_speed = 0
airflow_time = 0

View File

@@ -36,7 +36,7 @@ zone
if(!istype(T,/turf/simulated))
AddTurf(T)
//Generate the gas_mixture for use in this zone by using the average of the gases
//Generate the gas_mixture for use in txhis zone by using the average of the gases
//defined at startup.
air = new
var/members = contents.len
@@ -304,6 +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 )
@@ -366,17 +373,30 @@ proc/ShareSpace(datum/gas_mixture/A, list/unsimulated_tiles)
size = max(1,A.group_multiplier)
share_size = max(1,unsimulated_tiles.len)
full_oxy = A.oxygen * size
full_nitro = A.nitrogen * size
full_co2 = A.carbon_dioxide * size
full_plasma = A.toxins * size
//full_oxy = A.oxygen * size
//full_nitro = A.nitrogen * size
//full_co2 = A.carbon_dioxide * size
//full_plasma = A.toxins * size
full_heat_capacity = A.heat_capacity() * size
//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)
plasma_avg = unsim_plasma//(full_plasma + unsim_plasma) / (size + share_size)
temp_avg = unsim_temperature//(A.temperature * full_heat_capacity + unsim_temperature * unsim_heat_capacity) / (full_heat_capacity + unsim_heat_capacity)
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 )