Merge remote-tracking branch 'citadel/master' into unarmed_parry
This commit is contained in:
@@ -125,12 +125,12 @@
|
||||
return
|
||||
|
||||
// Negative Kelvin temperatures should never happen and if they do, normalize them
|
||||
if(source_air.temperature < TCMB)
|
||||
source_air.temperature = TCMB
|
||||
if(source_air.return_temperature() < TCMB)
|
||||
source_air.set_temperature(TCMB)
|
||||
|
||||
var/pressure_delta = target_pressure - target_air.return_pressure()
|
||||
if(pressure_delta > 0.1)
|
||||
var/transfer_moles = (pressure_delta*target_air.volume/(source_air.temperature * R_IDEAL_GAS_EQUATION))*PUMP_EFFICIENCY
|
||||
var/transfer_moles = (pressure_delta*target_air.return_volume()/(source_air.return_temperature() * R_IDEAL_GAS_EQUATION))*PUMP_EFFICIENCY
|
||||
var/datum/gas_mixture/removed = source_air.remove(transfer_moles)
|
||||
target_air.merge(removed)
|
||||
|
||||
@@ -171,14 +171,14 @@
|
||||
return
|
||||
|
||||
// Negative Kelvin temperatures should never happen and if they do, normalize them
|
||||
if(source_air.temperature < TCMB)
|
||||
source_air.temperature = TCMB
|
||||
if(source_air.return_temperature() < TCMB)
|
||||
source_air.set_temperature(TCMB)
|
||||
|
||||
if((source_air.return_pressure() < 0.01) || (target_air.return_pressure() >= PUMP_MAX_PRESSURE))
|
||||
return
|
||||
|
||||
//The second part of the min caps the pressure built by the volume pumps to the max pump pressure
|
||||
var/transfer_ratio = min(transfer_rate,target_air.volume*PUMP_MAX_PRESSURE/source_air.return_pressure())/source_air.volume
|
||||
var/transfer_ratio = min(transfer_rate,target_air.return_volume()*PUMP_MAX_PRESSURE/source_air.return_pressure())/source_air.return_volume()
|
||||
|
||||
var/datum/gas_mixture/removed = source_air.remove_ratio(transfer_ratio * PUMP_EFFICIENCY)
|
||||
|
||||
@@ -351,10 +351,10 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
var/transfer_moles
|
||||
|
||||
//Negative Kelvins are an anomaly and should be normalized if encountered
|
||||
if(source_air.temperature < TCMB)
|
||||
source_air.temperature = TCMB
|
||||
if(source_air.return_temperature(TCMB))
|
||||
source_air.set_temperature(TCMB)
|
||||
|
||||
transfer_moles = (pressure_delta*contaminated_air.volume/(source_air.temperature * R_IDEAL_GAS_EQUATION))*PUMP_EFFICIENCY
|
||||
transfer_moles = (pressure_delta*contaminated_air.return_volume()/(source_air.return_temperature() * R_IDEAL_GAS_EQUATION))*PUMP_EFFICIENCY
|
||||
|
||||
//If there is nothing to transfer, just return
|
||||
if(transfer_moles <= 0)
|
||||
@@ -368,16 +368,15 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
//This is the gas that will be moved from source to filtered
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
|
||||
for(var/filtered_gas in removed.gases)
|
||||
for(var/filtered_gas in removed.get_gases())
|
||||
//Get the name of the gas and see if it is in the list
|
||||
if(GLOB.meta_gas_names[filtered_gas] in wanted)
|
||||
//The gas that is put in all the filtered out gases
|
||||
filtered_out.temperature = removed.temperature
|
||||
filtered_out.gases[filtered_gas] = removed.gases[filtered_gas]
|
||||
filtered_out.set_temperature(removed.return_temperature())
|
||||
filtered_out.set_moles(filtered_gas, removed.get_moles(filtered_gas))
|
||||
|
||||
//The filtered out gas is entirely removed from the currently filtered gases
|
||||
removed.gases[filtered_gas] = 0
|
||||
GAS_GARBAGE_COLLECT(removed.gases)
|
||||
removed.set_moles(filtered_gas, 0)
|
||||
|
||||
//Check if the pressure is high enough to put stuff in filtered, or else just put it back in the source
|
||||
var/datum/gas_mixture/target = (filtered_air.return_pressure() < target_pressure ? filtered_air : source_air)
|
||||
@@ -444,7 +443,7 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
var/gas_percentage = round(max(min(get_pin_data(IC_INPUT, 4),100),0) / 100)
|
||||
|
||||
//Basically: number of moles = percentage of pressure filled up * efficiency coefficient * (pressure from both gases * volume of output) / (R * Temperature)
|
||||
var/transfer_moles = (get_pin_data(IC_INPUT, 5) / max(1,output_gases.return_pressure())) * PUMP_EFFICIENCY * (source_1_gases.return_pressure() * gas_percentage + source_2_gases.return_pressure() * (1 - gas_percentage)) * output_gases.volume/ (R_IDEAL_GAS_EQUATION * max(output_gases.temperature,TCMB))
|
||||
var/transfer_moles = (get_pin_data(IC_INPUT, 5) / max(1,output_gases.return_pressure())) * PUMP_EFFICIENCY * (source_1_gases.return_pressure() * gas_percentage + source_2_gases.return_pressure() * (1 - gas_percentage)) * output_gases.return_volume()/ (R_IDEAL_GAS_EQUATION * max(output_gases.return_temperature(),TCMB))
|
||||
|
||||
|
||||
if(transfer_moles <= 0)
|
||||
@@ -544,10 +543,10 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
push_data()
|
||||
|
||||
//Cool the tank if the power is on and the temp is above
|
||||
if(!power_draw_idle || air_contents.temperature < temperature)
|
||||
if(!power_draw_idle || air_contents.return_temperature() < temperature)
|
||||
return
|
||||
|
||||
air_contents.temperature = max(73.15,air_contents.temperature - (air_contents.temperature - temperature) * heater_coefficient)
|
||||
air_contents.set_temperature(max(73.15,air_contents.return_temperature() - (air_contents.return_temperature() - temperature) * heater_coefficient))
|
||||
|
||||
|
||||
// - heater tank - // **works**
|
||||
@@ -574,10 +573,10 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
push_data()
|
||||
|
||||
//Heat the tank if the power is on or its temperature is below what is set
|
||||
if(!power_draw_idle || air_contents.temperature > temperature)
|
||||
if(!power_draw_idle || air_contents.return_temperature() > temperature)
|
||||
return
|
||||
|
||||
air_contents.temperature = min(573.15,air_contents.temperature + (temperature - air_contents.temperature) * heater_coefficient)
|
||||
air_contents.set_temperature(min(573.15,air_contents.return_temperature() + (temperature - air_contents.return_temperature()) * heater_coefficient))
|
||||
|
||||
|
||||
// - atmospheric cooler - // **works**
|
||||
@@ -621,11 +620,11 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/turf_air = current_turf.return_air()
|
||||
if(!power_draw_idle || turf_air.temperature < temperature)
|
||||
if(!power_draw_idle || turf_air.return_temperature() < temperature)
|
||||
return
|
||||
|
||||
//Cool the gas
|
||||
turf_air.temperature = max(243.15,turf_air.temperature - (turf_air.temperature - temperature) * heater_coefficient)
|
||||
turf_air.set_temperature(max(243.15,turf_air.return_temperature() - (turf_air.return_temperature() - temperature) * heater_coefficient))
|
||||
|
||||
|
||||
// - atmospheric heater - // **works**
|
||||
@@ -650,11 +649,11 @@ obj/item/integrated_circuit/atmospherics/connector/portableConnectorReturnAir()
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/turf_air = current_turf.return_air()
|
||||
if(!power_draw_idle || turf_air.temperature > temperature)
|
||||
if(!power_draw_idle || turf_air.return_temperature() > temperature)
|
||||
return
|
||||
|
||||
//Heat the gas
|
||||
turf_air.temperature = min(323.15,turf_air.temperature + (temperature - turf_air.temperature) * heater_coefficient)
|
||||
turf_air.set_temperature(min(323.15,turf_air.return_temperature() + (temperature - turf_air.return_temperature()) * heater_coefficient))
|
||||
|
||||
|
||||
// - tank slot - // **works**
|
||||
|
||||
@@ -1162,12 +1162,11 @@
|
||||
activate_pin(3)
|
||||
return
|
||||
|
||||
var/list/gases = air_contents.gases
|
||||
var/list/gas_names = list()
|
||||
var/list/gas_amounts = list()
|
||||
for(var/id in gases)
|
||||
for(var/id in air_contents.get_gases())
|
||||
var/name = GLOB.meta_gas_names[id]
|
||||
var/amt = round(gases[id], 0.001)
|
||||
var/amt = round(air_contents.get_moles(id), 0.001)
|
||||
gas_names.Add(name)
|
||||
gas_amounts.Add(amt)
|
||||
|
||||
@@ -1175,7 +1174,7 @@
|
||||
set_pin_data(IC_OUTPUT, 2, gas_amounts)
|
||||
set_pin_data(IC_OUTPUT, 3, round(air_contents.total_moles(), 0.001))
|
||||
set_pin_data(IC_OUTPUT, 4, round(air_contents.return_pressure(), 0.001))
|
||||
set_pin_data(IC_OUTPUT, 5, round(air_contents.temperature, 0.001))
|
||||
set_pin_data(IC_OUTPUT, 5, round(air_contents.return_temperature(), 0.001))
|
||||
set_pin_data(IC_OUTPUT, 6, round(air_contents.return_volume(), 0.001))
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
stuff_to_display = replacetext("[I.data]", eol , "<br>")
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/large
|
||||
name = "large screen"
|
||||
name = "medium screen"
|
||||
desc = "Takes any data type as an input and displays it to anybody near the device when pulsed. \
|
||||
It can also be examined to see the last thing it displayed."
|
||||
icon_state = "screen_medium"
|
||||
@@ -51,15 +51,29 @@
|
||||
else
|
||||
if(!isturf(assembly.loc))
|
||||
return
|
||||
|
||||
var/atom/host = assembly || src
|
||||
var/list/mobs = list()
|
||||
for(var/mob/M in range(0, get_turf(src)))
|
||||
mobs += M
|
||||
to_chat(mobs, "<span class='notice'>[icon2html(host.icon, world, host.icon_state)] flashes a message: [stuff_to_display]</span>")
|
||||
host.investigate_log("displayed \"[html_encode(stuff_to_display)]\" as [type].", INVESTIGATE_CIRCUIT)
|
||||
|
||||
var/list/nearby_things = range(0, get_turf(src))
|
||||
for(var/mob/M in nearby_things)
|
||||
var/obj/O = assembly ? assembly : src
|
||||
to_chat(M, "<span class='notice'>[icon2html(O.icon, world, O.icon_state)] [stuff_to_display]</span>")
|
||||
if(assembly)
|
||||
assembly.investigate_log("displayed \"[html_encode(stuff_to_display)]\" with [type].", INVESTIGATE_CIRCUIT)
|
||||
else
|
||||
investigate_log("displayed \"[html_encode(stuff_to_display)]\" as [type].", INVESTIGATE_CIRCUIT)
|
||||
/obj/item/integrated_circuit/output/screen/extralarge // the subtype is called "extralarge" because tg brought back medium screens and they named the subtype /screen/large
|
||||
name = "large screen"
|
||||
desc = "Takes any data type as an input and displays it to the user upon examining, and to all nearby beings when pulsed."
|
||||
icon_state = "screen_large"
|
||||
power_draw_per_use = 40
|
||||
cooldown_per_use = 10
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/extralarge/do_work()
|
||||
..()
|
||||
var/atom/host = assembly || src
|
||||
var/list/mobs = list()
|
||||
for(var/mob/M in viewers(7, get_turf(src)))
|
||||
mobs += M
|
||||
to_chat(mobs, "<span class='notice'>[icon2html(host.icon, world, host.icon_state)] flashes a message: [stuff_to_display]</span>")
|
||||
host.investigate_log("displayed \"[html_encode(stuff_to_display)]\" as [type].", INVESTIGATE_CIRCUIT)
|
||||
|
||||
/obj/item/integrated_circuit/output/light
|
||||
name = "light"
|
||||
@@ -389,25 +403,4 @@
|
||||
|
||||
//Hippie Ported Code--------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
/obj/item/radio/headset/integrated
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/large
|
||||
name = "medium screen"
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/extralarge // the subtype is called "extralarge" because tg brought back medium screens and they named the subtype /screen/large
|
||||
name = "large screen"
|
||||
desc = "Takes any data type as an input and displays it to the user upon examining, and to all nearby beings when pulsed."
|
||||
icon_state = "screen_large"
|
||||
power_draw_per_use = 40
|
||||
cooldown_per_use = 10
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/extralarge/do_work()
|
||||
..()
|
||||
var/obj/O = assembly ? get_turf(assembly) : loc
|
||||
O.visible_message("<span class='notice'>[icon2html(O.icon, world, O.icon_state)] [stuff_to_display]</span>")
|
||||
if(assembly)
|
||||
assembly.investigate_log("displayed \"[html_encode(stuff_to_display)]\" with [type].", INVESTIGATE_CIRCUIT)
|
||||
else
|
||||
investigate_log("displayed \"[html_encode(stuff_to_display)]\" as [type].", INVESTIGATE_CIRCUIT)
|
||||
|
||||
@@ -514,6 +514,8 @@
|
||||
outputs = list("volume used" = IC_PINTYPE_NUMBER,"self reference" = IC_PINTYPE_SELFREF,"temperature" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
var/heater_coefficient = 0.1
|
||||
var/max_temp = 1000
|
||||
var/min_temp = 2.7
|
||||
|
||||
/obj/item/integrated_circuit/reagent/storage/heater/on_data_written()
|
||||
if(get_pin_data(IC_INPUT, 2))
|
||||
@@ -531,7 +533,7 @@
|
||||
|
||||
/obj/item/integrated_circuit/reagent/storage/heater/process()
|
||||
if(power_draw_idle)
|
||||
var/target_temperature = get_pin_data(IC_INPUT, 1)
|
||||
var/target_temperature = clamp(get_pin_data(IC_INPUT, 1), min_temp, max_temp)
|
||||
if(reagents.chem_temp > target_temperature)
|
||||
reagents.chem_temp += min(-1, (target_temperature - reagents.chem_temp) * heater_coefficient)
|
||||
if(reagents.chem_temp < target_temperature)
|
||||
@@ -795,4 +797,4 @@
|
||||
..()
|
||||
if(istype(loc,/obj/item/integrated_circuit/input/beaker_connector))
|
||||
var/obj/item/integrated_circuit/input/beaker_connector/current_circuit = loc
|
||||
current_circuit.push_vol()
|
||||
current_circuit.push_vol()
|
||||
|
||||
Reference in New Issue
Block a user