mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
Merge pull request #2029 from Markolie/intercom
Air alarm temperature fix
This commit is contained in:
@@ -41,8 +41,8 @@
|
||||
|
||||
#define AALARM_PRESET_HUMAN 1 // Default
|
||||
#define AALARM_PRESET_VOX 2 // Support Vox
|
||||
#define AALARM_PRESET_SERVER 3 // Server coldroom
|
||||
#define AALARM_PRESET_COLDROOM 4 // Kitchen coldroom
|
||||
#define AALARM_PRESET_COLDROOM 3 // Kitchen coldroom
|
||||
#define AALARM_PRESET_SERVER 4 // Server coldroom
|
||||
|
||||
#define AALARM_SCREEN_MAIN 1
|
||||
#define AALARM_SCREEN_VENT 2
|
||||
@@ -59,8 +59,8 @@
|
||||
//1000 joules equates to about 1 degree every 2 seconds for a single tile of air.
|
||||
#define MAX_ENERGY_CHANGE 1000
|
||||
|
||||
#define MAX_TEMPERATURE 90
|
||||
#define MIN_TEMPERATURE -40
|
||||
#define MAX_TEMPERATURE 363.15 // 90C
|
||||
#define MIN_TEMPERATURE 233.15 // -40C
|
||||
|
||||
//all air alarms in area are connected via magic
|
||||
/area
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
var/buildstage = 2 //2 is built, 1 is building, 0 is frame.
|
||||
|
||||
var/target_temperature = T0C+20
|
||||
var/target_temperature = T20C
|
||||
var/regulating_temperature = 0
|
||||
|
||||
var/datum/radio_frequency/radio_connection
|
||||
@@ -156,16 +156,6 @@
|
||||
"pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.10,ONE_ATMOSPHERE*1.20), /* kpa */
|
||||
"temperature" = new/datum/tlv(T0C, T0C+10, T0C+40, T0C+66), // K
|
||||
)
|
||||
if(AALARM_PRESET_SERVER)
|
||||
TLV = list(
|
||||
"oxygen" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // Partial pressure, kpa
|
||||
"nitrogen" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), // Partial pressure, kpa
|
||||
"carbon dioxide" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // Partial pressure, kpa
|
||||
"plasma" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // Partial pressure, kpa
|
||||
"other" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // Partial pressure, kpa
|
||||
"pressure" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), /* kpa */
|
||||
"temperature" = new/datum/tlv(-1.0, -1.0,-1.0,-1.0), // K
|
||||
)
|
||||
if(AALARM_PRESET_COLDROOM)
|
||||
TLV = list(
|
||||
"oxygen" = new/datum/tlv(16, 19, 135, 140), // Partial pressure, kpa
|
||||
@@ -174,7 +164,17 @@
|
||||
"plasma" = new/datum/tlv(-1.0, -1.0, 0.2, 0.5), // Partial pressure, kpa
|
||||
"other" = new/datum/tlv(-1.0, -1.0, 0.5, 1.0), // Partial pressure, kpa
|
||||
"pressure" = new/datum/tlv(ONE_ATMOSPHERE*0.80,ONE_ATMOSPHERE*0.90,ONE_ATMOSPHERE*1.50,ONE_ATMOSPHERE*1.60), /* kpa */
|
||||
"temperature" = new/datum/tlv(200, 210, 273.15, 283.15), // K
|
||||
"temperature" = new/datum/tlv(T0C-40, T0C-20, T0C, T20C), // K
|
||||
)
|
||||
if(AALARM_PRESET_SERVER)
|
||||
TLV = list(
|
||||
"oxygen" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), // Partial pressure, kpa
|
||||
"nitrogen" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), // Partial pressure, kpa
|
||||
"carbon dioxide" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), // Partial pressure, kpa
|
||||
"plasma" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), // Partial pressure, kpa
|
||||
"other" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), // Partial pressure, kpa
|
||||
"pressure" = new/datum/tlv(-1.0, -1.0, -1.0, -1.0), /* kpa */
|
||||
"temperature" = new/datum/tlv(T0C-60, T0C-40, T20C, T20C + 10), // K
|
||||
)
|
||||
|
||||
if(!no_cycle_after)
|
||||
@@ -307,11 +307,11 @@
|
||||
visible_message("\The [src] clicks as it starts [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\
|
||||
"You hear a click and a faint electronic hum.")
|
||||
|
||||
if(target_temperature > T0C + MAX_TEMPERATURE)
|
||||
target_temperature = T0C + MAX_TEMPERATURE
|
||||
if(target_temperature > MAX_TEMPERATURE)
|
||||
target_temperature = MAX_TEMPERATURE
|
||||
|
||||
if(target_temperature < T0C + MIN_TEMPERATURE)
|
||||
target_temperature = T0C + MIN_TEMPERATURE
|
||||
if(target_temperature < MIN_TEMPERATURE)
|
||||
target_temperature = MIN_TEMPERATURE
|
||||
|
||||
var/datum/gas_mixture/gas = location.remove_air(0.25*environment.total_moles())
|
||||
var/heat_capacity = gas.heat_capacity()
|
||||
@@ -720,10 +720,10 @@
|
||||
)
|
||||
data["mode"] = mode
|
||||
data["presets"] = list(
|
||||
AALARM_PRESET_HUMAN = list("name"="Human", "desc"="Checks for Oxygen and Nitrogen"),\
|
||||
AALARM_PRESET_VOX = list("name"="Vox", "desc"="Checks for Nitrogen only"),\
|
||||
AALARM_PRESET_SERVER = list("name"="Server Room", "desc"="For server rooms"),\
|
||||
AALARM_PRESET_COLDROOM = list("name"="Coldroom", "desc"="For freezers")
|
||||
AALARM_PRESET_HUMAN = list("name"="Human", "desc"="Checks for oxygen and nitrogen"),\
|
||||
AALARM_PRESET_VOX = list("name"="Vox", "desc"="Checks for nitrogen only"),\
|
||||
AALARM_PRESET_COLDROOM = list("name"="Coldroom", "desc"="For freezers"),\
|
||||
AALARM_PRESET_SERVER = list("name"="Server Room", "desc"="For server rooms")
|
||||
)
|
||||
data["preset"] = preset
|
||||
data["screen"] = screen
|
||||
@@ -975,15 +975,18 @@
|
||||
|
||||
if(href_list["temperature"])
|
||||
var/datum/tlv/selected = TLV["temperature"]
|
||||
var/max_temperature = min(selected.max1 - T0C, MAX_TEMPERATURE)
|
||||
var/min_temperature = max(selected.min1 - T0C, MIN_TEMPERATURE)
|
||||
var/input_temperature = input("What temperature would you like the system to maintain? (Capped between [min_temperature]C and [max_temperature]C)", "Thermostat Controls") as num|null
|
||||
var/max_temperature = selected.max1 >= 0 ? min(selected.max1, MAX_TEMPERATURE) : max(selected.max1, MAX_TEMPERATURE)
|
||||
var/min_temperature = max(selected.min1, MIN_TEMPERATURE)
|
||||
var/max_temperature_c = max_temperature - T0C
|
||||
var/min_temperature_c = min_temperature - T0C
|
||||
var/input_temperature = input("What temperature would you like the system to maintain? (Capped between [min_temperature_c]C and [max_temperature_c]C)", "Thermostat Controls") as num|null
|
||||
if(isnull(input_temperature) || ..(href, href_list, nowindow, state))
|
||||
return
|
||||
input_temperature = input_temperature + T0C
|
||||
if(input_temperature > max_temperature || input_temperature < min_temperature)
|
||||
usr << "Temperature must be between [min_temperature]C and [max_temperature]C"
|
||||
usr << "Temperature must be between [min_temperature_c]C and [max_temperature_c]C"
|
||||
else
|
||||
target_temperature = input_temperature + T0C
|
||||
target_temperature = input_temperature
|
||||
return 1
|
||||
|
||||
/obj/machinery/alarm/emag_act(mob/user)
|
||||
|
||||
Reference in New Issue
Block a user