mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into OrganRefactor
This commit is contained in:
+136
-407
@@ -14,20 +14,20 @@ What are the archived variables for?
|
||||
#define QUANTIZE(variable) (round(variable,0.0001))
|
||||
|
||||
/datum/gas
|
||||
sleeping_agent
|
||||
specific_heat = 40
|
||||
|
||||
oxygen_agent_b
|
||||
specific_heat = 300
|
||||
|
||||
volatile_fuel
|
||||
specific_heat = 30
|
||||
|
||||
var/moles = 0
|
||||
var/specific_heat = 0
|
||||
|
||||
var/moles_archived = 0
|
||||
|
||||
/datum/gas/sleeping_agent
|
||||
specific_heat = 40
|
||||
|
||||
/datum/gas/oxygen_agent_b
|
||||
specific_heat = 300
|
||||
|
||||
/datum/gas/volatile_fuel
|
||||
specific_heat = 30
|
||||
|
||||
|
||||
/datum/gas_mixture
|
||||
var/oxygen = 0
|
||||
@@ -57,27 +57,27 @@ What are the archived variables for?
|
||||
/datum/gas_mixture/proc/heat_capacity()
|
||||
var/heat_capacity = HEAT_CAPACITY_CALCULATION(oxygen,carbon_dioxide,nitrogen,toxins)
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
heat_capacity += trace_gas.moles*trace_gas.specific_heat
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
heat_capacity += trace_gas.moles*trace_gas.specific_heat
|
||||
return heat_capacity
|
||||
|
||||
|
||||
/datum/gas_mixture/proc/heat_capacity_archived()
|
||||
var/heat_capacity_archived = HEAT_CAPACITY_CALCULATION(oxygen_archived,carbon_dioxide_archived,nitrogen_archived,toxins_archived)
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
heat_capacity_archived += trace_gas.moles_archived*trace_gas.specific_heat
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
heat_capacity_archived += trace_gas.moles_archived*trace_gas.specific_heat
|
||||
return heat_capacity_archived
|
||||
|
||||
|
||||
/datum/gas_mixture/proc/total_moles()
|
||||
var/moles = oxygen + carbon_dioxide + nitrogen + toxins
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
moles += trace_gas.moles
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
moles += trace_gas.moles
|
||||
return moles
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ What are the archived variables for?
|
||||
|
||||
|
||||
//Procedures used for very specific events
|
||||
|
||||
|
||||
/datum/gas_mixture/proc/react(atom/dump_location)
|
||||
var/reacting = 0 //set to 1 if a notable reaction occured (used by pipe_network)
|
||||
|
||||
@@ -161,11 +163,11 @@ What are the archived variables for?
|
||||
else
|
||||
temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE)
|
||||
if(temperature_scale > 0)
|
||||
oxygen_burn_rate = 1.4 - temperature_scale
|
||||
oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale
|
||||
if(oxygen > toxins*PLASMA_OXYGEN_FULLBURN)
|
||||
plasma_burn_rate = (toxins*temperature_scale)/4
|
||||
plasma_burn_rate = (toxins*temperature_scale)/PLASMA_BURN_RATE_DELTA
|
||||
else
|
||||
plasma_burn_rate = (temperature_scale*(oxygen/PLASMA_OXYGEN_FULLBURN))/4
|
||||
plasma_burn_rate = (temperature_scale*(oxygen/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA
|
||||
if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY)
|
||||
toxins -= plasma_burn_rate
|
||||
oxygen -= plasma_burn_rate*oxygen_burn_rate
|
||||
@@ -190,11 +192,6 @@ What are the archived variables for?
|
||||
//Merges all air from giver into self. Deletes giver.
|
||||
//Returns: 1 on success (no failure cases yet)
|
||||
|
||||
/datum/gas_mixture/proc/check_then_merge(datum/gas_mixture/giver)
|
||||
//Similar to merge(...) but first checks to see if the amount of air assumed is small enough
|
||||
// that group processing is still accurate for source (aborts if not)
|
||||
//Returns: 1 on successful merge, 0 if the check failed
|
||||
|
||||
/datum/gas_mixture/proc/remove(amount)
|
||||
//Proportionally removes amount of gas from the gas_mixture
|
||||
//Returns: gas_mixture with the gases removed
|
||||
@@ -203,62 +200,25 @@ What are the archived variables for?
|
||||
//Proportionally removes amount of gas from the gas_mixture
|
||||
//Returns: gas_mixture with the gases removed
|
||||
|
||||
/datum/gas_mixture/proc/subtract(datum/gas_mixture/right_side)
|
||||
//Subtracts right_side from air_mixture. Used to help turfs mingle
|
||||
|
||||
/datum/gas_mixture/proc/check_then_remove(amount)
|
||||
//Similar to remove(...) but first checks to see if the amount of air removed is small enough
|
||||
// that group processing is still accurate for source (aborts if not)
|
||||
//Returns: gas_mixture with the gases removed or null
|
||||
|
||||
/datum/gas_mixture/proc/copy_from(datum/gas_mixture/sample)
|
||||
//Copies variables from sample
|
||||
|
||||
/datum/gas_mixture/proc/share(datum/gas_mixture/sharer)
|
||||
//Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length
|
||||
//Return: amount of gas exchanged (+ if sharer received)
|
||||
|
||||
/datum/gas_mixture/proc/mimic(turf/model)
|
||||
/datum/gas_mixture/proc/mimic(turf/model) //I want this proc to die a painful death
|
||||
//Similar to share(...), except the model is not modified
|
||||
//Return: amount of gas exchanged
|
||||
|
||||
/datum/gas_mixture/proc/check_gas_mixture(datum/gas_mixture/sharer)
|
||||
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if both checks pass
|
||||
|
||||
/datum/gas_mixture/proc/check_turf(turf/model)
|
||||
/datum/gas_mixture/proc/check_turf(turf/model) //I want this proc to die a painful death
|
||||
//Returns: 0 if self-check failed or 1 if check passes
|
||||
|
||||
// check_me_then_share(datum/gas_mixture/sharer)
|
||||
//Similar to share(...) but first checks to see if amount of air moved is small enough
|
||||
// that group processing is still accurate for source (aborts if not)
|
||||
//Returns: 1 on successful share, 0 if the check failed
|
||||
|
||||
// check_me_then_mimic(turf/model)
|
||||
//Similar to mimic(...) but first checks to see if amount of air moved is small enough
|
||||
// that group processing is still accurate (aborts if not)
|
||||
//Returns: 1 on successful mimic, 0 if the check failed
|
||||
|
||||
// check_both_then_share(datum/gas_mixture/sharer)
|
||||
//Similar to check_me_then_share(...) but also checks to see if amount of air moved is small enough
|
||||
// that group processing is still accurate for the sharer (aborts if not)
|
||||
//Returns: 0 if the self-check failed then -1 if sharer-check failed then 1 if successful share
|
||||
|
||||
|
||||
/datum/gas_mixture/proc/temperature_mimic(turf/model, conduction_coefficient)
|
||||
/datum/gas_mixture/proc/temperature_mimic(turf/model, conduction_coefficient) //I want this proc to die a painful death
|
||||
|
||||
/datum/gas_mixture/proc/temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
|
||||
|
||||
/datum/gas_mixture/proc/temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
|
||||
|
||||
|
||||
/datum/gas_mixture/proc/check_me_then_temperature_mimic(turf/model, conduction_coefficient)
|
||||
|
||||
/datum/gas_mixture/proc/check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
|
||||
|
||||
/datum/gas_mixture/proc/check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
|
||||
|
||||
/datum/gas_mixture/proc/check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
|
||||
|
||||
/datum/gas_mixture/proc/compare(datum/gas_mixture/sample)
|
||||
//Compares sample to self to see if within acceptable ranges that group processing may be enabled
|
||||
|
||||
@@ -268,33 +228,14 @@ What are the archived variables for?
|
||||
nitrogen_archived = nitrogen
|
||||
toxins_archived = toxins
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
trace_gas.moles_archived = trace_gas.moles
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
trace_gas.moles_archived = trace_gas.moles
|
||||
|
||||
temperature_archived = temperature
|
||||
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/check_then_merge(datum/gas_mixture/giver)
|
||||
if(!giver)
|
||||
return 0
|
||||
if(((giver.oxygen > MINIMUM_AIR_TO_SUSPEND) && (giver.oxygen >= oxygen*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((giver.carbon_dioxide > MINIMUM_AIR_TO_SUSPEND) && (giver.carbon_dioxide >= carbon_dioxide*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((giver.nitrogen > MINIMUM_AIR_TO_SUSPEND) && (giver.nitrogen >= nitrogen*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((giver.toxins > MINIMUM_AIR_TO_SUSPEND) && (giver.toxins >= toxins*MINIMUM_AIR_RATIO_TO_SUSPEND)))
|
||||
return 0
|
||||
if(abs(giver.temperature - temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
|
||||
return 0
|
||||
|
||||
if(giver.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in giver.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if((trace_gas.moles > MINIMUM_AIR_TO_SUSPEND) && (!corresponding || (trace_gas.moles >= corresponding.moles*MINIMUM_AIR_RATIO_TO_SUSPEND)))
|
||||
return 0
|
||||
|
||||
return merge(giver)
|
||||
|
||||
/datum/gas_mixture/merge(datum/gas_mixture/giver)
|
||||
if(!giver)
|
||||
return 0
|
||||
@@ -311,15 +252,14 @@ What are the archived variables for?
|
||||
nitrogen += giver.nitrogen
|
||||
toxins += giver.toxins
|
||||
|
||||
if(giver.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in giver.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if(!corresponding)
|
||||
corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
corresponding.moles += trace_gas.moles
|
||||
for(var/gas in giver.trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if(!corresponding)
|
||||
corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
corresponding.moles += trace_gas.moles
|
||||
|
||||
// qdel(giver)
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/remove(amount)
|
||||
@@ -342,13 +282,13 @@ What are the archived variables for?
|
||||
carbon_dioxide -= removed.carbon_dioxide
|
||||
toxins -= removed.toxins
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
var/datum/gas/corresponding = new trace_gas.type()
|
||||
removed.trace_gases += corresponding
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
var/datum/gas/corresponding = new trace_gas.type()
|
||||
removed.trace_gases += corresponding
|
||||
|
||||
corresponding.moles = (trace_gas.moles/sum)*amount
|
||||
trace_gas.moles -= corresponding.moles
|
||||
corresponding.moles = (trace_gas.moles/sum)*amount
|
||||
trace_gas.moles -= corresponding.moles
|
||||
|
||||
removed.temperature = temperature
|
||||
|
||||
@@ -373,29 +313,18 @@ What are the archived variables for?
|
||||
carbon_dioxide -= removed.carbon_dioxide
|
||||
toxins -= removed.toxins
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
var/datum/gas/corresponding = new trace_gas.type()
|
||||
removed.trace_gases += corresponding
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
var/datum/gas/corresponding = new trace_gas.type()
|
||||
removed.trace_gases += corresponding
|
||||
|
||||
corresponding.moles = trace_gas.moles*ratio
|
||||
trace_gas.moles -= corresponding.moles
|
||||
corresponding.moles = trace_gas.moles*ratio
|
||||
trace_gas.moles -= corresponding.moles
|
||||
|
||||
removed.temperature = temperature
|
||||
|
||||
return removed
|
||||
|
||||
/datum/gas_mixture/check_then_remove(amount)
|
||||
|
||||
//Since it is all proportional, the check may be done on the gas as a whole
|
||||
var/sum = total_moles()
|
||||
amount = min(amount,sum) //Can not take more air than tile has!
|
||||
|
||||
if((amount > MINIMUM_AIR_RATIO_TO_SUSPEND) && (amount > sum*MINIMUM_AIR_RATIO_TO_SUSPEND))
|
||||
return 0
|
||||
|
||||
return remove(amount)
|
||||
|
||||
/datum/gas_mixture/copy_from(datum/gas_mixture/sample)
|
||||
oxygen = sample.oxygen
|
||||
carbon_dioxide = sample.carbon_dioxide
|
||||
@@ -403,86 +332,17 @@ What are the archived variables for?
|
||||
toxins = sample.toxins
|
||||
|
||||
trace_gases.len=null
|
||||
if(sample.trace_gases.len > 0)
|
||||
for(var/datum/gas/trace_gas in sample.trace_gases)
|
||||
var/datum/gas/corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
for(var/gas in sample.trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
var/datum/gas/corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
|
||||
corresponding.moles = trace_gas.moles
|
||||
corresponding.moles = trace_gas.moles
|
||||
|
||||
temperature = sample.temperature
|
||||
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/subtract(datum/gas_mixture/right_side)
|
||||
oxygen -= right_side.oxygen
|
||||
carbon_dioxide -= right_side.carbon_dioxide
|
||||
nitrogen -= right_side.nitrogen
|
||||
toxins -= right_side.toxins
|
||||
|
||||
if((trace_gases.len > 0)||(right_side.trace_gases.len > 0))
|
||||
for(var/datum/gas/trace_gas in right_side.trace_gases)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if(!corresponding)
|
||||
corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
|
||||
corresponding.moles -= trace_gas.moles
|
||||
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/check_gas_mixture(datum/gas_mixture/sharer)
|
||||
if(!sharer) return 0
|
||||
var/delta_oxygen = (oxygen_archived - sharer.oxygen_archived)/5
|
||||
var/delta_carbon_dioxide = (carbon_dioxide_archived - sharer.carbon_dioxide_archived)/5
|
||||
var/delta_nitrogen = (nitrogen_archived - sharer.nitrogen_archived)/5
|
||||
var/delta_toxins = (toxins_archived - sharer.toxins_archived)/5
|
||||
|
||||
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
|
||||
|
||||
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
|
||||
return 0
|
||||
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
|
||||
return 0
|
||||
|
||||
if(sharer.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in sharer.trace_gases)
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if(corresponding)
|
||||
if(trace_gas.moles_archived >= corresponding.moles_archived*MINIMUM_AIR_RATIO_TO_SUSPEND*4)
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
if(!locate(trace_gas.type) in sharer.trace_gases)
|
||||
return 0
|
||||
|
||||
if(((abs(delta_oxygen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_oxygen) >= sharer.oxygen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((abs(delta_carbon_dioxide) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_carbon_dioxide) >= sharer.carbon_dioxide_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((abs(delta_nitrogen) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_nitrogen) >= sharer.nitrogen_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)) \
|
||||
|| ((abs(delta_toxins) > MINIMUM_AIR_TO_SUSPEND) && (abs(delta_toxins) >= sharer.toxins_archived*MINIMUM_AIR_RATIO_TO_SUSPEND)))
|
||||
return -1
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in sharer.trace_gases
|
||||
if(corresponding)
|
||||
if(trace_gas.moles_archived >= corresponding.moles_archived*MINIMUM_AIR_RATIO_TO_SUSPEND*4)
|
||||
return -1
|
||||
else
|
||||
return -1
|
||||
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/check_turf(turf/model, atmos_adjacent_turfs = 4)
|
||||
var/delta_oxygen = (oxygen_archived - model.oxygen)/(atmos_adjacent_turfs+1)
|
||||
var/delta_carbon_dioxide = (carbon_dioxide_archived - model.carbon_dioxide)/(atmos_adjacent_turfs+1)
|
||||
@@ -499,14 +359,14 @@ What are the archived variables for?
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
|
||||
return 0
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
return 0
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/proc/check_turf_total(turf/model)
|
||||
/datum/gas_mixture/proc/check_turf_total(turf/model) //I want this proc to die a painful death
|
||||
var/delta_oxygen = (oxygen - model.oxygen)
|
||||
var/delta_carbon_dioxide = (carbon_dioxide - model.carbon_dioxide)
|
||||
var/delta_nitrogen = (nitrogen - model.nitrogen)
|
||||
@@ -522,14 +382,14 @@ What are the archived variables for?
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
|
||||
return 0
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
if(trace_gas.moles > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
return 0
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
if(trace_gas.moles > MINIMUM_AIR_TO_SUSPEND*4)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/datum/gas_mixture/share(datum/gas_mixture/sharer, var/atmos_adjacent_turfs = 4)
|
||||
/datum/gas_mixture/share(datum/gas_mixture/sharer, atmos_adjacent_turfs = 4)
|
||||
if(!sharer) return 0
|
||||
var/delta_oxygen = QUANTIZE(oxygen_archived - sharer.oxygen_archived)/(atmos_adjacent_turfs+1)
|
||||
var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - sharer.carbon_dioxide_archived)/(atmos_adjacent_turfs+1)
|
||||
@@ -588,57 +448,54 @@ What are the archived variables for?
|
||||
|
||||
var/list/trace_types_considered = list()
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in sharer.trace_gases
|
||||
var/delta = 0
|
||||
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in sharer.trace_gases
|
||||
var/delta = 0
|
||||
if(corresponding)
|
||||
delta = QUANTIZE(trace_gas.moles_archived - corresponding.moles_archived)/(atmos_adjacent_turfs+1)
|
||||
else
|
||||
corresponding = new trace_gas.type()
|
||||
sharer.trace_gases += corresponding
|
||||
|
||||
if(corresponding)
|
||||
delta = QUANTIZE(trace_gas.moles_archived - corresponding.moles_archived)/(atmos_adjacent_turfs+1)
|
||||
delta = trace_gas.moles_archived/(atmos_adjacent_turfs+1)
|
||||
|
||||
trace_gas.moles -= delta
|
||||
corresponding.moles += delta
|
||||
|
||||
if(delta)
|
||||
var/individual_heat_capacity = trace_gas.specific_heat*delta
|
||||
if(delta > 0)
|
||||
heat_capacity_self_to_sharer += individual_heat_capacity
|
||||
else
|
||||
corresponding = new trace_gas.type()
|
||||
sharer.trace_gases += corresponding
|
||||
heat_capacity_sharer_to_self -= individual_heat_capacity
|
||||
|
||||
delta = trace_gas.moles_archived/(atmos_adjacent_turfs+1)
|
||||
moved_moles += delta
|
||||
last_share += abs(delta)
|
||||
|
||||
trace_gas.moles -= delta
|
||||
corresponding.moles += delta
|
||||
trace_types_considered += trace_gas.type
|
||||
|
||||
if(delta)
|
||||
var/individual_heat_capacity = trace_gas.specific_heat*delta
|
||||
if(delta > 0)
|
||||
heat_capacity_self_to_sharer += individual_heat_capacity
|
||||
else
|
||||
heat_capacity_sharer_to_self -= individual_heat_capacity
|
||||
for(var/gas in sharer.trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
if(trace_gas.type in trace_types_considered)
|
||||
continue
|
||||
var/datum/gas/corresponding
|
||||
var/delta = 0
|
||||
corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
|
||||
moved_moles += delta
|
||||
last_share += abs(delta)
|
||||
delta = trace_gas.moles_archived/5
|
||||
|
||||
trace_types_considered += trace_gas.type
|
||||
trace_gas.moles -= delta
|
||||
corresponding.moles += delta
|
||||
|
||||
//Guaranteed transfer from sharer to self
|
||||
var/individual_heat_capacity = trace_gas.specific_heat*delta
|
||||
heat_capacity_sharer_to_self += individual_heat_capacity
|
||||
|
||||
if(sharer.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in sharer.trace_gases)
|
||||
if(trace_gas.type in trace_types_considered) continue
|
||||
else
|
||||
var/datum/gas/corresponding
|
||||
var/delta = 0
|
||||
|
||||
corresponding = new trace_gas.type()
|
||||
trace_gases += corresponding
|
||||
|
||||
delta = trace_gas.moles_archived/5
|
||||
|
||||
trace_gas.moles -= delta
|
||||
corresponding.moles += delta
|
||||
|
||||
//Guaranteed transfer from sharer to self
|
||||
var/individual_heat_capacity = trace_gas.specific_heat*delta
|
||||
heat_capacity_sharer_to_self += individual_heat_capacity
|
||||
|
||||
moved_moles += -delta
|
||||
last_share += abs(delta)
|
||||
moved_moles += -delta
|
||||
last_share += abs(delta)
|
||||
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
|
||||
var/new_self_heat_capacity = old_self_heat_capacity + heat_capacity_sharer_to_self - heat_capacity_self_to_sharer
|
||||
@@ -658,7 +515,7 @@ What are the archived variables for?
|
||||
var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - sharer.temperature_archived*(sharer.total_moles() - moved_moles)
|
||||
return delta_pressure*R_IDEAL_GAS_EQUATION/volume
|
||||
|
||||
/datum/gas_mixture/mimic(turf/model, border_multiplier, var/atmos_adjacent_turfs = 4)
|
||||
/datum/gas_mixture/mimic(turf/model, atmos_adjacent_turfs = 4)
|
||||
var/delta_oxygen = QUANTIZE(oxygen_archived - model.oxygen)/(atmos_adjacent_turfs+1)
|
||||
var/delta_carbon_dioxide = QUANTIZE(carbon_dioxide_archived - model.carbon_dioxide)/(atmos_adjacent_turfs+1)
|
||||
var/delta_nitrogen = QUANTIZE(nitrogen_archived - model.nitrogen)/(atmos_adjacent_turfs+1)
|
||||
@@ -690,30 +547,22 @@ What are the archived variables for?
|
||||
|
||||
old_self_heat_capacity = heat_capacity()
|
||||
|
||||
if(border_multiplier)
|
||||
oxygen -= delta_oxygen*border_multiplier
|
||||
carbon_dioxide -= delta_carbon_dioxide*border_multiplier
|
||||
nitrogen -= delta_nitrogen*border_multiplier
|
||||
toxins -= delta_toxins*border_multiplier
|
||||
else
|
||||
oxygen -= delta_oxygen
|
||||
carbon_dioxide -= delta_carbon_dioxide
|
||||
nitrogen -= delta_nitrogen
|
||||
toxins -= delta_toxins
|
||||
oxygen -= delta_oxygen
|
||||
carbon_dioxide -= delta_carbon_dioxide
|
||||
nitrogen -= delta_nitrogen
|
||||
toxins -= delta_toxins
|
||||
|
||||
var/moved_moles = (delta_oxygen + delta_carbon_dioxide + delta_nitrogen + delta_toxins)
|
||||
last_share = abs(delta_oxygen) + abs(delta_carbon_dioxide) + abs(delta_nitrogen) + abs(delta_toxins)
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
var/delta = 0
|
||||
|
||||
delta = trace_gas.moles_archived/(atmos_adjacent_turfs+1)
|
||||
|
||||
if(border_multiplier)
|
||||
trace_gas.moles -= delta*border_multiplier
|
||||
else
|
||||
trace_gas.moles -= delta
|
||||
trace_gas.moles -= delta
|
||||
|
||||
var/heat_cap_transferred = delta*trace_gas.specific_heat
|
||||
heat_transferred += heat_cap_transferred*temperature_archived
|
||||
@@ -724,12 +573,9 @@ What are the archived variables for?
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
|
||||
var/new_self_heat_capacity = old_self_heat_capacity - heat_capacity_transferred
|
||||
if(new_self_heat_capacity > MINIMUM_HEAT_CAPACITY)
|
||||
if(border_multiplier)
|
||||
temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*border_multiplier*temperature_archived)/new_self_heat_capacity
|
||||
else
|
||||
temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*temperature_archived)/new_self_heat_capacity
|
||||
temperature = (old_self_heat_capacity*temperature - heat_capacity_transferred*temperature_archived)/new_self_heat_capacity
|
||||
|
||||
temperature_mimic(model, model.thermal_conductivity, border_multiplier)
|
||||
temperature_mimic(model, model.thermal_conductivity)
|
||||
|
||||
if((delta_temperature > MINIMUM_TEMPERATURE_TO_MOVE) || abs(moved_moles) > MINIMUM_MOLES_DELTA_TO_MOVE)
|
||||
var/delta_pressure = temperature_archived*(total_moles() + moved_moles) - model.temperature*(model.oxygen+model.carbon_dioxide+model.nitrogen+model.toxins)
|
||||
@@ -737,116 +583,6 @@ What are the archived variables for?
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/gas_mixture/check_both_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
|
||||
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
|
||||
|
||||
var/self_heat_capacity = heat_capacity_archived()
|
||||
var/sharer_heat_capacity = sharer.heat_capacity_archived()
|
||||
|
||||
var/self_temperature_delta = 0
|
||||
var/sharer_temperature_delta = 0
|
||||
|
||||
if((sharer_heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
|
||||
var/heat = conduction_coefficient*delta_temperature* \
|
||||
(self_heat_capacity*sharer_heat_capacity/(self_heat_capacity+sharer_heat_capacity))
|
||||
|
||||
self_temperature_delta = -heat/(self_heat_capacity)
|
||||
sharer_temperature_delta = heat/(sharer_heat_capacity)
|
||||
else
|
||||
return 1
|
||||
|
||||
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
|
||||
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
|
||||
return 0
|
||||
|
||||
if((abs(sharer_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
|
||||
&& (abs(sharer_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*sharer.temperature_archived))
|
||||
return -1
|
||||
|
||||
temperature += self_temperature_delta
|
||||
sharer.temperature += sharer_temperature_delta
|
||||
|
||||
return 1
|
||||
//Logic integrated from: temperature_share(sharer, conduction_coefficient) for efficiency
|
||||
|
||||
/datum/gas_mixture/check_me_then_temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
|
||||
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
|
||||
|
||||
var/self_heat_capacity = heat_capacity_archived()
|
||||
var/sharer_heat_capacity = sharer.heat_capacity_archived()
|
||||
|
||||
var/self_temperature_delta = 0
|
||||
var/sharer_temperature_delta = 0
|
||||
|
||||
if((sharer_heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
|
||||
var/heat = conduction_coefficient*delta_temperature* \
|
||||
(self_heat_capacity*sharer_heat_capacity/(self_heat_capacity+sharer_heat_capacity))
|
||||
|
||||
self_temperature_delta = -heat/self_heat_capacity
|
||||
sharer_temperature_delta = heat/sharer_heat_capacity
|
||||
else
|
||||
return 1
|
||||
|
||||
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
|
||||
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
|
||||
return 0
|
||||
|
||||
temperature += self_temperature_delta
|
||||
sharer.temperature += sharer_temperature_delta
|
||||
|
||||
return 1
|
||||
//Logic integrated from: temperature_share(sharer, conduction_coefficient) for efficiency
|
||||
|
||||
/datum/gas_mixture/check_me_then_temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
|
||||
var/delta_temperature = (temperature_archived - sharer.temperature)
|
||||
|
||||
var/self_temperature_delta = 0
|
||||
var/sharer_temperature_delta = 0
|
||||
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
|
||||
var/self_heat_capacity = heat_capacity_archived()
|
||||
|
||||
if((sharer.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
|
||||
var/heat = conduction_coefficient*delta_temperature* \
|
||||
(self_heat_capacity*sharer.heat_capacity/(self_heat_capacity+sharer.heat_capacity))
|
||||
|
||||
self_temperature_delta = -heat/self_heat_capacity
|
||||
sharer_temperature_delta = heat/sharer.heat_capacity
|
||||
else
|
||||
return 1
|
||||
|
||||
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
|
||||
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
|
||||
return 0
|
||||
|
||||
temperature += self_temperature_delta
|
||||
sharer.temperature += sharer_temperature_delta
|
||||
|
||||
return 1
|
||||
//Logic integrated from: temperature_turf_share(sharer, conduction_coefficient) for efficiency
|
||||
|
||||
/datum/gas_mixture/check_me_then_temperature_mimic(turf/model, conduction_coefficient)
|
||||
var/delta_temperature = (temperature_archived - model.temperature)
|
||||
var/self_temperature_delta = 0
|
||||
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
|
||||
var/self_heat_capacity = heat_capacity_archived()
|
||||
|
||||
if((model.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
|
||||
var/heat = conduction_coefficient*delta_temperature* \
|
||||
(self_heat_capacity*model.heat_capacity/(self_heat_capacity+model.heat_capacity))
|
||||
|
||||
self_temperature_delta = -heat/self_heat_capacity
|
||||
|
||||
if((abs(self_temperature_delta) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) \
|
||||
&& (abs(self_temperature_delta) > MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND*temperature_archived))
|
||||
return 0
|
||||
|
||||
temperature += self_temperature_delta
|
||||
|
||||
return 1
|
||||
//Logic integrated from: temperature_mimic(model, conduction_coefficient) for efficiency
|
||||
|
||||
/datum/gas_mixture/temperature_share(datum/gas_mixture/sharer, conduction_coefficient)
|
||||
|
||||
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
|
||||
@@ -861,19 +597,16 @@ What are the archived variables for?
|
||||
temperature -= heat/self_heat_capacity
|
||||
sharer.temperature += heat/sharer_heat_capacity
|
||||
|
||||
/datum/gas_mixture/temperature_mimic(turf/model, conduction_coefficient, border_multiplier)
|
||||
/datum/gas_mixture/temperature_mimic(turf/model, conduction_coefficient)
|
||||
var/delta_temperature = (temperature - model.temperature)
|
||||
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
|
||||
var/self_heat_capacity = heat_capacity()//_archived()
|
||||
var/self_heat_capacity = heat_capacity()
|
||||
|
||||
if((model.heat_capacity > MINIMUM_HEAT_CAPACITY) && (self_heat_capacity > MINIMUM_HEAT_CAPACITY))
|
||||
var/heat = conduction_coefficient*delta_temperature* \
|
||||
(self_heat_capacity*model.heat_capacity/(self_heat_capacity+model.heat_capacity))
|
||||
|
||||
if(border_multiplier)
|
||||
temperature -= heat*border_multiplier/self_heat_capacity
|
||||
else
|
||||
temperature -= heat/self_heat_capacity
|
||||
temperature -= heat/self_heat_capacity
|
||||
|
||||
/datum/gas_mixture/temperature_turf_share(turf/simulated/sharer, conduction_coefficient)
|
||||
var/delta_temperature = (temperature_archived - sharer.temperature)
|
||||
@@ -904,35 +637,33 @@ What are the archived variables for?
|
||||
if(total_moles() > MINIMUM_AIR_TO_SUSPEND)
|
||||
if((abs(temperature-sample.temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) && \
|
||||
((temperature < (1-MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND)*sample.temperature) || (temperature > (1+MINIMUM_TEMPERATURE_RATIO_TO_SUSPEND)*sample.temperature)))
|
||||
//world << "temp fail [temperature] & [sample.temperature]"
|
||||
return 0
|
||||
|
||||
if(sample.trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in sample.trace_gases)
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if(corresponding)
|
||||
if((abs(trace_gas.moles - corresponding.moles) > MINIMUM_AIR_TO_SUSPEND) && \
|
||||
((corresponding.moles < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*trace_gas.moles) || (corresponding.moles > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*trace_gas.moles)))
|
||||
return 0
|
||||
else
|
||||
for(var/gas in sample.trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
if(trace_gas.moles_archived > MINIMUM_AIR_TO_SUSPEND)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in trace_gases
|
||||
if(corresponding)
|
||||
if((abs(trace_gas.moles - corresponding.moles) > MINIMUM_AIR_TO_SUSPEND) && \
|
||||
((corresponding.moles < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*trace_gas.moles) || (corresponding.moles > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*trace_gas.moles)))
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
|
||||
if(trace_gases.len)
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
if(trace_gas.moles > MINIMUM_AIR_TO_SUSPEND)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in sample.trace_gases
|
||||
if(corresponding)
|
||||
if((abs(trace_gas.moles - corresponding.moles) > MINIMUM_AIR_TO_SUSPEND) && \
|
||||
((trace_gas.moles < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*corresponding.moles) || (trace_gas.moles > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*corresponding.moles)))
|
||||
return 0
|
||||
else
|
||||
for(var/gas in trace_gases)
|
||||
var/datum/gas/trace_gas = gas
|
||||
if(trace_gas.moles > MINIMUM_AIR_TO_SUSPEND)
|
||||
var/datum/gas/corresponding = locate(trace_gas.type) in sample.trace_gases
|
||||
if(corresponding)
|
||||
if((abs(trace_gas.moles - corresponding.moles) > MINIMUM_AIR_TO_SUSPEND) && \
|
||||
((trace_gas.moles < (1-MINIMUM_AIR_RATIO_TO_SUSPEND)*corresponding.moles) || (trace_gas.moles > (1+MINIMUM_AIR_RATIO_TO_SUSPEND)*corresponding.moles)))
|
||||
return 0
|
||||
else
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
|
||||
//Takes the amount of the gas you want to PP as an argument
|
||||
//So I don't have to do some hacky switches/defines/magic strings
|
||||
|
||||
@@ -942,15 +673,13 @@ What are the archived variables for?
|
||||
|
||||
//Does handle trace gases!
|
||||
|
||||
/datum/gas_mixture/proc/get_breath_partial_pressure(var/gas_pressure)
|
||||
var/breath_pressure = (total_moles()*R_IDEAL_GAS_EQUATION*temperature)/BREATH_VOLUME
|
||||
return (gas_pressure/total_moles())*breath_pressure
|
||||
/datum/gas_mixture/proc/get_breath_partial_pressure(gas_pressure)
|
||||
return (gas_pressure*R_IDEAL_GAS_EQUATION*temperature)/BREATH_VOLUME
|
||||
|
||||
|
||||
//Reverse of the above
|
||||
/datum/gas_mixture/proc/get_true_breath_pressure(var/breath_pp)
|
||||
var/breath_pressure = (total_moles()/R_IDEAL_GAS_EQUATION/temperature)*BREATH_VOLUME
|
||||
return (breath_pp/breath_pressure*total_moles())
|
||||
/datum/gas_mixture/proc/get_true_breath_pressure(breath_pp)
|
||||
return (breath_pp*BREATH_VOLUME)/(R_IDEAL_GAS_EQUATION*temperature)
|
||||
|
||||
//Mathematical proofs:
|
||||
/*
|
||||
|
||||
+7
-7
@@ -180,7 +180,7 @@
|
||||
else
|
||||
text += "<b>EMPLOYEE</b>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<a href='?src=\ref[src];revolution=rev'>rev</a>"
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_REV)
|
||||
if(current && current.client && (ROLE_REV in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
@@ -205,7 +205,7 @@
|
||||
text += "<b>EMPLOYEE</b>|<a href='?src=\ref[src];cult=cultist'>cultist</a>"
|
||||
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_CULTIST)
|
||||
if(current && current.client && (ROLE_CULTIST in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
@@ -225,7 +225,7 @@
|
||||
else
|
||||
text += "<a href='?src=\ref[src];wizard=wizard'>yes</a>|<b>NO</b>"
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_WIZARD)
|
||||
if(current && current.client && (ROLE_WIZARD in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
@@ -246,7 +246,7 @@
|
||||
else
|
||||
text += "<a href='?src=\ref[src];changeling=changeling'>yes</a>|<b>NO</b>"
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_CHANGELING)
|
||||
if(current && current.client && (ROLE_CHANGELING in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
@@ -294,7 +294,7 @@
|
||||
else
|
||||
text += "<a href='?src=\ref[src];nuclear=nuclear'>operative</a>|<b>NANOTRASEN</b>"
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_OPERATIVE)
|
||||
if(current && current.client && (ROLE_OPERATIVE in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
@@ -316,7 +316,7 @@
|
||||
else
|
||||
text += "<a href='?src=\ref[src];traitor=traitor'>traitor</a>|<b>EMPLOYEE</b>"
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_TRAITOR)
|
||||
if(current && current.client && (ROLE_TRAITOR in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
@@ -335,7 +335,7 @@
|
||||
else
|
||||
text += "<a href='?src=\ref[src];shadowling=shadowling'>shadowling</a>|<a href='?src=\ref[src];shadowling=thrall'>thrall</a>|<b>HUMAN</b>"
|
||||
|
||||
if(current && current.client && current.client.prefs.be_special & BE_SHADOWLING)
|
||||
if(current && current.client && (ROLE_SHADOWLING in current.client.prefs.be_special))
|
||||
text += "|Enabled in Prefs"
|
||||
else
|
||||
text += "|Disabled in Prefs"
|
||||
|
||||
@@ -74,10 +74,10 @@ obj/effect/proc_holder/spell/targeted/lightning/proc/Reset(mob/user = usr)
|
||||
origin.Beam(target,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
var/mob/living/carbon/current = target
|
||||
if(bounces < 1)
|
||||
current.electrocute_act(bolt_energy,"Lightning Bolt", def_zone = "chest")
|
||||
current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1)
|
||||
playsound(get_turf(current), 'sound/machines/defib_zap.ogg', 50, 1, -1)
|
||||
else
|
||||
current.electrocute_act(bolt_energy,"Lightning Bolt", def_zone = "chest")
|
||||
current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1)
|
||||
playsound(get_turf(current), 'sound/machines/defib_zap.ogg', 50, 1, -1)
|
||||
var/list/possible_targets = new
|
||||
for(var/mob/living/M in view_or_range(range,target,"view"))
|
||||
|
||||
+47
-36
@@ -13,9 +13,9 @@ var/list/uplink_items = list()
|
||||
var/datum/uplink_item/I = new item()
|
||||
if(!I.item)
|
||||
continue
|
||||
if(I.gamemodes.len && ticker && !(ticker.mode.name in I.gamemodes))
|
||||
if(I.gamemodes.len && ticker && !(ticker.mode.type in I.gamemodes))
|
||||
continue
|
||||
if(I.excludefrom.len && ticker && (ticker.mode.name in I.excludefrom))
|
||||
if(I.excludefrom.len && ticker && (ticker.mode.type in I.excludefrom))
|
||||
continue
|
||||
if(I.last)
|
||||
last += I
|
||||
@@ -285,7 +285,7 @@ var/list/uplink_items = list()
|
||||
desc = "A fully-loaded Scarborough Arms bullpup submachine gun that fires .45 rounds with a 20-round magazine and is compatible with suppressors."
|
||||
item = /obj/item/weapon/gun/projectile/automatic/c20r
|
||||
cost = 14
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/dangerous/carbine
|
||||
@@ -294,7 +294,7 @@ var/list/uplink_items = list()
|
||||
reference = "AR"
|
||||
item = /obj/item/weapon/gun/projectile/automatic/m90
|
||||
cost = 18
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 50
|
||||
|
||||
/datum/uplink_item/dangerous/machinegun
|
||||
@@ -303,7 +303,7 @@ var/list/uplink_items = list()
|
||||
reference = "LMG"
|
||||
item = /obj/item/weapon/gun/projectile/automatic/l6_saw
|
||||
cost = 40
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
/datum/uplink_item/dangerous/crossbow
|
||||
@@ -312,7 +312,7 @@ var/list/uplink_items = list()
|
||||
reference = "EC"
|
||||
item = /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
|
||||
cost = 12
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
surplus = 50
|
||||
|
||||
/datum/uplink_item/dangerous/flamethrower
|
||||
@@ -321,7 +321,7 @@ var/list/uplink_items = list()
|
||||
reference = "FT"
|
||||
item = /obj/item/weapon/flamethrower/full/tank
|
||||
cost = 11
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/dangerous/sword
|
||||
@@ -344,7 +344,7 @@ var/list/uplink_items = list()
|
||||
reference = "VDG"
|
||||
item = /obj/item/weapon/grenade/spawnergrenade/manhacks
|
||||
cost = 8
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 35
|
||||
|
||||
/datum/uplink_item/ammo/bioterror
|
||||
@@ -353,7 +353,7 @@ var/list/uplink_items = list()
|
||||
reference = "BTS"
|
||||
item = /obj/item/weapon/storage/box/syndie_kit/bioterror
|
||||
cost = 6
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/dangerous/tabungrenades
|
||||
name = "Tabun Gas Grenades"
|
||||
@@ -361,7 +361,7 @@ var/list/uplink_items = list()
|
||||
reference = "TGG"
|
||||
item = /obj/item/weapon/storage/box/syndie_kit/tabun
|
||||
cost = 15
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
/datum/uplink_item/dangerous/emp
|
||||
@@ -385,7 +385,7 @@ var/list/uplink_items = list()
|
||||
reference = "GE"
|
||||
item = /obj/mecha/combat/gygax/dark/loaded
|
||||
cost = 90
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
/datum/uplink_item/dangerous/mauler
|
||||
@@ -394,7 +394,7 @@ var/list/uplink_items = list()
|
||||
reference = "ME"
|
||||
item = /obj/mecha/combat/marauder/mauler/loaded
|
||||
cost = 140
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
/datum/uplink_item/dangerous/syndieborg
|
||||
@@ -403,7 +403,7 @@ var/list/uplink_items = list()
|
||||
reference = "SC"
|
||||
item = /obj/item/weapon/antag_spawner/borg_tele
|
||||
cost = 50
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
//for refunding the syndieborg teleporter
|
||||
@@ -416,7 +416,7 @@ var/list/uplink_items = list()
|
||||
name = "Holoparasites"
|
||||
desc = "Though capable of near sorcerous feats via use of hardlight holograms and nanomachines, they require an organic host as a home base and source of fuel."
|
||||
item = /obj/item/weapon/storage/box/syndie_kit/guardian
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
cost = 12
|
||||
|
||||
// Ammunition
|
||||
@@ -445,7 +445,7 @@ var/list/uplink_items = list()
|
||||
reference = "45"
|
||||
item = /obj/item/ammo_box/magazine/smgm45
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/ammobag
|
||||
name = "Ammo Duffelbag - Shotgun Ammo Grab Bag"
|
||||
@@ -453,7 +453,7 @@ var/list/uplink_items = list()
|
||||
reference = "SAGL"
|
||||
item = /obj/item/weapon/storage/backpack/duffel/syndie/ammo/loaded
|
||||
cost = 10 //bulk buyer's discount. Very useful if you're buying a mech and dont have TC left to buy people non-shotgun guns
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/bullslug
|
||||
name = "Drum Magazine - 12g Slugs"
|
||||
@@ -461,7 +461,7 @@ var/list/uplink_items = list()
|
||||
reference = "12BSG"
|
||||
item = /obj/item/ammo_box/magazine/m12g
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/bullbuck
|
||||
name = "Drum Magazine - 12g buckshot"
|
||||
@@ -469,7 +469,7 @@ var/list/uplink_items = list()
|
||||
reference = "12BS"
|
||||
item = /obj/item/ammo_box/magazine/m12g/buckshot
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/bullstun
|
||||
name = "Drum Magazine - 12g Stun Slug"
|
||||
@@ -477,7 +477,7 @@ var/list/uplink_items = list()
|
||||
reference = "12SS"
|
||||
item = /obj/item/ammo_box/magazine/m12g/stun
|
||||
cost = 3
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/bulldragon
|
||||
name = "Drum Magazine - 12g Dragon's Breath"
|
||||
@@ -485,7 +485,7 @@ var/list/uplink_items = list()
|
||||
reference = "12DB"
|
||||
item = /obj/item/ammo_box/magazine/m12g/dragon
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/carbine
|
||||
name = "Toploader Magazine - 5.56"
|
||||
@@ -493,7 +493,7 @@ var/list/uplink_items = list()
|
||||
reference = "556"
|
||||
item = /obj/item/ammo_box/magazine/m556
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/a40mm
|
||||
name = "Ammo Box - 40mm grenades"
|
||||
@@ -501,7 +501,7 @@ var/list/uplink_items = list()
|
||||
reference = "40MM"
|
||||
item = /obj/item/ammo_box/a40mm
|
||||
cost = 4
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/ammo/machinegun
|
||||
name = "Box Magazine - 7.62x51mm"
|
||||
@@ -509,7 +509,7 @@ var/list/uplink_items = list()
|
||||
reference = "762"
|
||||
item = /obj/item/ammo_box/magazine/m762
|
||||
cost = 12
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
// STEALTHY WEAPONS
|
||||
@@ -530,7 +530,7 @@ var/list/uplink_items = list()
|
||||
reference = "SP"
|
||||
item = /obj/item/weapon/pen/sleepy
|
||||
cost = 8
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/stealthy_weapons/soap
|
||||
name = "Syndicate Soap"
|
||||
@@ -605,14 +605,14 @@ var/list/uplink_items = list()
|
||||
reference = "NSSS"
|
||||
item = /obj/item/clothing/shoes/syndigaloshes
|
||||
cost = 2
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/stealthy_tools/syndigaloshes/nuke
|
||||
name = "Tactical No-Slip Brown Shoes"
|
||||
desc = "These allow you to run on wet floors. They do not work on lubricated surfaces, and the maker swears they're better than normal ones, somehow."
|
||||
reference = "NNSSS"
|
||||
cost = 4 //but they aren't
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/stealthy_tools/agent_card
|
||||
name = "Agent ID Card"
|
||||
@@ -691,7 +691,7 @@ var/list/uplink_items = list()
|
||||
reference = "SBM"
|
||||
item = /obj/item/weapon/storage/belt/military
|
||||
cost = 3
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/medkit
|
||||
name = "Syndicate Combat Medic Kit"
|
||||
@@ -700,7 +700,7 @@ var/list/uplink_items = list()
|
||||
reference = "SCMK"
|
||||
item = /obj/item/weapon/storage/firstaid/tactical
|
||||
cost = 9
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/space_suit
|
||||
name = "Space Suit"
|
||||
@@ -718,6 +718,17 @@ var/list/uplink_items = list()
|
||||
item = /obj/item/weapon/storage/box/syndie_kit/hardsuit
|
||||
cost = 8
|
||||
|
||||
/datum/uplink_item/device_tools/elite_hardsuit
|
||||
name = "Elite Syndicate Hardsuit"
|
||||
desc = "The elite Syndicate hardsuit is worn by only the best nuclear agents. Features much better armoring and complete fireproofing, as well as a built in jetpack. \
|
||||
When the built in helmet is deployed your identity will be protected, even in death, as the suit cannot be removed by outside forces. Toggling the suit into combat mode \
|
||||
will allow you all the mobility of a loose fitting uniform without sacrificing armoring. Additionally the suit is collapsible, small enough to fit within a backpack. \
|
||||
Nanotrasen crewmembers are trained to report red space suit sightings; these suits in particular are known to drive employees into a panic."
|
||||
reference = "ESHS"
|
||||
item = /obj/item/weapon/storage/box/syndie_kit/elite_hardsuit
|
||||
cost = 8
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/thermal
|
||||
name = "Thermal Imaging Glasses"
|
||||
desc = "These glasses are thermals disguised as engineers' optical meson scanners. They allow you to see organisms through walls by capturing the upper portion of the infra-red light spectrum, emitted as heat and light by objects. Hotter objects, such as warm bodies, cybernetic organisms and artificial intelligence cores emit more of this light than cooler objects like walls and airlocks."
|
||||
@@ -755,7 +766,7 @@ var/list/uplink_items = list()
|
||||
reference = "BRMB"
|
||||
item = /obj/item/clothing/shoes/magboots/syndie
|
||||
cost = 3
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/plastic_explosives
|
||||
name = "Composition C-4"
|
||||
@@ -793,7 +804,7 @@ var/list/uplink_items = list()
|
||||
reference = "SD"
|
||||
item = /obj/item/device/syndicatedetonator
|
||||
cost = 3
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/device_tools/advpinpointer
|
||||
name = "Advanced Pinpointer"
|
||||
@@ -815,7 +826,7 @@ var/list/uplink_items = list()
|
||||
item = /obj/item/weapon/circuitboard/teleporter
|
||||
reference = "TP"
|
||||
cost = 40
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
/datum/uplink_item/device_tools/shield
|
||||
@@ -824,7 +835,7 @@ var/list/uplink_items = list()
|
||||
item = /obj/item/weapon/shield/energy
|
||||
reference = "ESD"
|
||||
cost = 16
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 20
|
||||
|
||||
/datum/uplink_item/device_tools/medgun
|
||||
@@ -833,7 +844,7 @@ var/list/uplink_items = list()
|
||||
item = /obj/item/weapon/gun/medbeam
|
||||
reference = "MBG"
|
||||
cost = 15
|
||||
gamemodes = list("nuclear emergency")
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
|
||||
|
||||
// IMPLANTS
|
||||
@@ -903,7 +914,7 @@ var/list/uplink_items = list()
|
||||
reference = "SYB"
|
||||
item = /obj/item/weapon/storage/box/syndicate
|
||||
cost = 20
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/badass/syndiecards
|
||||
name = "Syndicate Playing Cards"
|
||||
@@ -912,7 +923,7 @@ var/list/uplink_items = list()
|
||||
reference = "SPC"
|
||||
item = /obj/item/toy/cards/deck/syndicate
|
||||
cost = 1
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/badass/syndiecash
|
||||
@@ -962,7 +973,7 @@ var/list/uplink_items = list()
|
||||
reference = "SYSC"
|
||||
cost = 20
|
||||
item = /obj/item/weapon/storage/box/syndicate
|
||||
excludefrom = list("nuclear emergency")
|
||||
excludefrom = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/badass/surplus_crate/spawn_item(turf/loc, obj/item/device/uplink/U)
|
||||
var/obj/structure/closet/crate/C = new(loc)
|
||||
|
||||
Reference in New Issue
Block a user