mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-26 01:52:29 +00:00
Merge pull request #6315 from mwerezak/engine
Dev-freeze fixes and tweaks
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
|
||||
var/power_draw = specific_power*transfer_moles
|
||||
if (power_draw > 0)
|
||||
removed.add_thermal_energy(power_draw) //1st law - energy is conserved
|
||||
removed.add_thermal_energy(power_draw * config.atmos_machine_heat) //1st law - energy is conserved
|
||||
|
||||
sink.merge(removed)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
source.update_values()
|
||||
|
||||
if (power_draw > 0)
|
||||
sink.add_thermal_energy(power_draw) //gotta conserve that energy
|
||||
sink.add_thermal_energy(power_draw * config.atmos_machine_heat) //gotta conserve that energy
|
||||
|
||||
return power_draw
|
||||
|
||||
@@ -216,9 +216,9 @@
|
||||
|
||||
//1LTD energy is conserved
|
||||
if (filtered_power_used > 0)
|
||||
sink_filtered.add_thermal_energy(filtered_power_used)
|
||||
sink_filtered.add_thermal_energy(filtered_power_used * config.atmos_machine_heat)
|
||||
if (unfiltered_power_used > 0)
|
||||
sink_clean.add_thermal_energy(unfiltered_power_used)
|
||||
sink_clean.add_thermal_energy(unfiltered_power_used * config.atmos_machine_heat)
|
||||
|
||||
return filtered_power_used + unfiltered_power_used
|
||||
|
||||
@@ -297,9 +297,9 @@
|
||||
var/power_draw = unfiltered_power_used
|
||||
for (var/datum/gas_mixture/sink_filtered in filtered_power_used)
|
||||
power_draw += filtered_power_used[sink_filtered]
|
||||
sink_filtered.add_thermal_energy(filtered_power_used[sink_filtered])
|
||||
sink_filtered.add_thermal_energy(filtered_power_used[sink_filtered] * config.atmos_machine_heat)
|
||||
if (unfiltered_power_used > 0)
|
||||
sink_clean.add_thermal_energy(unfiltered_power_used)
|
||||
sink_clean.add_thermal_energy(unfiltered_power_used * config.atmos_machine_heat)
|
||||
|
||||
return power_draw
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
var/datum/gas_mixture/removed = source.remove(transfer_moles)
|
||||
|
||||
var/power_draw = transfer_moles * source_specific_power[source]
|
||||
removed.add_thermal_energy(power_draw) //conservation of energy
|
||||
removed.add_thermal_energy(power_draw * config.atmos_machine_heat) //conservation of energy
|
||||
total_power_draw += power_draw
|
||||
|
||||
sink.merge(removed)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//TODO: Put this under a common parent type with heaters to cut down on the copypasta
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer
|
||||
name = "gas cooling system"
|
||||
desc = "Cools gas when connected to pipe network"
|
||||
@@ -12,8 +14,11 @@
|
||||
|
||||
var/on = 0
|
||||
use_power = 0
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
active_power_usage = 50000 //50 kW. The power rating of the freezer
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
active_power_usage //50 kW. The power rating of the freezer
|
||||
|
||||
var/max_power_usage = 50000 //power rating when the usage is turned up to 1
|
||||
var/power_setting = 100
|
||||
|
||||
var/set_temperature = T20C //thermostat
|
||||
var/cooling = 0
|
||||
@@ -30,6 +35,8 @@
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
|
||||
active_power_usage = max_power_usage * (power_setting/100)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/initialize()
|
||||
if(node) return
|
||||
@@ -72,6 +79,7 @@
|
||||
data["minGasTemperature"] = 0
|
||||
data["maxGasTemperature"] = round(T20C+500)
|
||||
data["targetGasTemperature"] = round(set_temperature)
|
||||
data["powerSetting"] = power_setting
|
||||
|
||||
var/temp_class = "good"
|
||||
if (air_contents.temperature > (T0C - 20))
|
||||
@@ -104,6 +112,9 @@
|
||||
src.set_temperature = min(src.set_temperature+amount, 1000)
|
||||
else
|
||||
src.set_temperature = max(src.set_temperature+amount, 0)
|
||||
if(href_list["setPower"]) //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(href_list["setPower"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
@@ -165,6 +176,16 @@
|
||||
active_power_usage = initial(active_power_usage)*cap_rating //more powerful
|
||||
heatsink_temperature = initial(heatsink_temperature)/((manip_rating+bin_rating)/2) //more efficient
|
||||
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200*bin_rating
|
||||
set_power_level(power_setting)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/proc/set_power_level(var/new_power_setting)
|
||||
power_setting = new_power_setting
|
||||
|
||||
var/old_power_usage = active_power_usage
|
||||
active_power_usage = max_power_usage * (power_setting/100)
|
||||
|
||||
if (use_power >= 2 && old_power_usage != active_power_usage)
|
||||
force_power_update()
|
||||
|
||||
//dismantling code. copied from autolathe
|
||||
/obj/machinery/atmospherics/unary/freezer/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//TODO: Put this under a common parent type with freezers to cut down on the copypasta
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater
|
||||
name = "gas heating system"
|
||||
desc = "Heats gas when connected to a pipe network"
|
||||
@@ -13,8 +15,11 @@
|
||||
|
||||
var/on = 0
|
||||
use_power = 0
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
active_power_usage = 50000 //50 kW. The power rating of the heater
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
active_power_usage //50 kW. The power rating of the heater
|
||||
|
||||
var/max_power_usage = 50000 //power rating when the usage is turned up to 1
|
||||
var/power_setting = 100
|
||||
|
||||
var/heating = 0 //mainly for icon updates
|
||||
var/opened = 0 //for deconstruction
|
||||
@@ -29,6 +34,8 @@
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
|
||||
active_power_usage = max_power_usage * (power_setting/100)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/initialize()
|
||||
if(node) return
|
||||
@@ -93,6 +100,7 @@
|
||||
data["minGasTemperature"] = 0
|
||||
data["maxGasTemperature"] = round(max_temperature)
|
||||
data["targetGasTemperature"] = round(set_temperature)
|
||||
data["powerSetting"] = power_setting
|
||||
|
||||
var/temp_class = "normal"
|
||||
if (air_contents.temperature > (T20C+40))
|
||||
@@ -123,6 +131,9 @@
|
||||
src.set_temperature = min(src.set_temperature+amount, max_temperature)
|
||||
else
|
||||
src.set_temperature = max(src.set_temperature+amount, 0)
|
||||
if(href_list["setPower"]) //setting power to 0 is redundant anyways
|
||||
var/new_setting = between(0, text2num(href_list["setPower"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
return 1
|
||||
@@ -145,9 +156,19 @@
|
||||
cap_rating /= cap_count
|
||||
bin_rating /= bin_count
|
||||
|
||||
active_power_usage = initial(active_power_usage)*cap_rating
|
||||
max_power_usage = initial(max_power_usage)*cap_rating
|
||||
max_temperature = max(initial(max_temperature) - T20C, 0)*((bin_rating*2 + cap_rating)/3) + T20C
|
||||
air_contents.volume = max(initial(internal_volume) - 200, 0) + 200*bin_rating
|
||||
set_power_level(power_setting)
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/proc/set_power_level(var/new_power_setting)
|
||||
power_setting = new_power_setting
|
||||
|
||||
var/old_power_usage = active_power_usage
|
||||
active_power_usage = max_power_usage * (power_setting/100)
|
||||
|
||||
if (use_power >= 2 && old_power_usage != active_power_usage)
|
||||
force_power_update()
|
||||
|
||||
//dismantling code. copied from autolathe
|
||||
/obj/machinery/atmospherics/unary/heater/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
|
||||
//game_options.txt configs
|
||||
|
||||
var/atmos_machine_heat = 1.0
|
||||
|
||||
var/health_threshold_softcrit = 0
|
||||
var/health_threshold_crit = 0
|
||||
var/health_threshold_dead = -100
|
||||
@@ -532,6 +534,8 @@
|
||||
if("limbs_can_break")
|
||||
config.limbs_can_break = value
|
||||
|
||||
if("atmos_machine_heat")
|
||||
config.atmos_machine_heat = value
|
||||
|
||||
if("run_speed")
|
||||
config.run_speed = value
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#define HEAT_CAPACITY_HUMAN 24984 //249840 J/K, for a 72 kg person. Making this one-tenth of that as a quick workaround for cryo not cooling people enough.
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'icons/obj/cryogenics.dmi'
|
||||
|
||||
@@ -165,6 +165,9 @@ Class Procs:
|
||||
use_power = new_use_power
|
||||
|
||||
//force area power update
|
||||
force_power_update()
|
||||
|
||||
/obj/machinery/proc/force_power_update()
|
||||
var/area/A = get_area(src)
|
||||
if(A && A.master)
|
||||
A.master.powerupdate = 1
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
|
||||
origin_tech = "powerstorage=0"
|
||||
maxcharge = 500
|
||||
matter = list("glass" = 40)
|
||||
matter = list("metal" = 700, "glass" = 40)
|
||||
|
||||
/obj/item/weapon/cell/crap/empty/New()
|
||||
..()
|
||||
@@ -38,18 +38,24 @@
|
||||
name = "security borg rechargable D battery"
|
||||
origin_tech = "powerstorage=0"
|
||||
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
|
||||
matter = list("glass" = 40)
|
||||
matter = list("metal" = 700, "glass" = 40)
|
||||
|
||||
/obj/item/weapon/cell/secborg/empty/New()
|
||||
..()
|
||||
charge = 0
|
||||
|
||||
/obj/item/weapon/cell/apc
|
||||
name = "heavy-duty power cell"
|
||||
origin_tech = "powerstorage=1"
|
||||
maxcharge = 5000
|
||||
matter = list("metal" = 700, "glass" = 50)
|
||||
|
||||
/obj/item/weapon/cell/high
|
||||
name = "high-capacity power cell"
|
||||
origin_tech = "powerstorage=2"
|
||||
icon_state = "hcell"
|
||||
maxcharge = 10000
|
||||
matter = list("glass" = 60)
|
||||
matter = list("metal" = 700, "glass" = 60)
|
||||
|
||||
/obj/item/weapon/cell/high/empty/New()
|
||||
..()
|
||||
@@ -60,7 +66,7 @@
|
||||
origin_tech = "powerstorage=5"
|
||||
icon_state = "scell"
|
||||
maxcharge = 20000
|
||||
matter = list("glass" = 70)
|
||||
matter = list("metal" = 700, "glass" = 70)
|
||||
construction_cost = list("metal"=750,"glass"=100)
|
||||
|
||||
/obj/item/weapon/cell/super/empty/New()
|
||||
@@ -72,7 +78,7 @@
|
||||
origin_tech = "powerstorage=6"
|
||||
icon_state = "hpcell"
|
||||
maxcharge = 30000
|
||||
matter = list("glass" = 80)
|
||||
matter = list("metal" = 700, "glass" = 80)
|
||||
construction_cost = list("metal"=500,"glass"=150,"gold"=200,"silver"=200)
|
||||
|
||||
/obj/item/weapon/cell/hyper/empty/New()
|
||||
@@ -84,7 +90,7 @@
|
||||
icon_state = "icell"
|
||||
origin_tech = null
|
||||
maxcharge = 30000
|
||||
matter = list("glass"= 80)
|
||||
matter = list("metal" = 700, "glass" = 80)
|
||||
use()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
var/areastring = null
|
||||
var/obj/item/weapon/cell/cell
|
||||
var/start_charge = 90 // initial cell charge %
|
||||
var/cell_type = 5000 // 0=no cell, 1=regular, 2=high-cap (x5) <- old, now it's just 0=no cell, otherwise dictate cellcapacity by changing this value. 1 used to be 1000, 2 was 2500
|
||||
var/cell_type = /obj/item/weapon/cell/apc // 0=no cell, 1=regular, 2=high-cap (x5) <- old, now it's just 0=no cell, otherwise dictate cellcapacity by changing this value. 1 used to be 1000, 2 was 2500
|
||||
var/opened = 0 //0=closed, 1=opened, 2=cover removed
|
||||
var/shorted = 0
|
||||
var/lighting = 3
|
||||
@@ -166,8 +166,7 @@
|
||||
has_electronics = 2 //installed and secured
|
||||
// is starting with a power cell installed, create it and set its charge level
|
||||
if(cell_type)
|
||||
src.cell = new/obj/item/weapon/cell(src)
|
||||
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
|
||||
src.cell = new cell_type(src)
|
||||
cell.charge = start_charge * cell.maxcharge / 100.0 // (convert percentage to actual value)
|
||||
|
||||
var/area/A = src.loc.loc
|
||||
@@ -1263,8 +1262,8 @@
|
||||
environ = autoset(environ, 1)
|
||||
area.poweralert(0, src)
|
||||
autoflag = 2
|
||||
else if(cell.charge < 750 && cell.charge > 10 && longtermpower < 0) // <15%, turn off lighting & equipment
|
||||
if(autoflag != 1)
|
||||
else if(cell.charge < 750 && cell.charge > 10) // <15%, turn off lighting & equipment
|
||||
if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0))
|
||||
equipment = autoset(equipment, 2)
|
||||
lighting = autoset(lighting, 2)
|
||||
environ = autoset(environ, 1)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// the SMES
|
||||
// stores power
|
||||
|
||||
#define SMESMAXCHARGELEVEL 200000
|
||||
#define SMESMAXOUTPUT 200000
|
||||
#define SMESMAXCHARGELEVEL 250000
|
||||
#define SMESMAXOUTPUT 250000
|
||||
|
||||
/obj/machinery/power/smes
|
||||
name = "power storage unit"
|
||||
@@ -15,7 +15,7 @@
|
||||
var/lastout = 0 //Amount of power it actually outputs to the powernet
|
||||
var/loaddemand = 0 //For use in restore()
|
||||
var/capacity = 5e6 //Maximum amount of power it can hold
|
||||
var/charge = 1e6 //Current amount of power it holds
|
||||
var/charge = 2.0e6 //Current amount of power it holds
|
||||
var/charging = 0 //1 if it's actually charging, 0 if not
|
||||
var/chargemode = 0 //1 if it's trying to charge, 0 if not.
|
||||
//var/chargecount = 0
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Automatically recharges air (unless off), will flush when ready if pre-set
|
||||
// Can hold items and human size things, no other draggables
|
||||
// Toilets are a type of disposal bin for small objects only and work on magic. By magic, I mean torque rotation
|
||||
#define SEND_PRESSURE 700 //kPa. 7 bar - Based on existing pneumatic conveyor pressures.
|
||||
#define SEND_PRESSURE 500 //kPa.
|
||||
#define PRESSURE_TANK_VOLUME 70 //L - a 0.3 m diameter * 1 m long cylindrical tank. Happens to be the same volume as the regular oxygen tanks, so seems appropriate.
|
||||
#define PUMP_MAX_FLOW_RATE 200 //L/s - 8 m/s using a 15 cm by 15 cm inlet
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
var/flush_every_ticks = 30 //Every 30 ticks it will look whether it is ready to flush
|
||||
var/flush_count = 0 //this var adds 1 once per tick. When it reaches flush_every_ticks it resets and tries to flush.
|
||||
var/last_sound = 0
|
||||
active_power_usage = 2200 //the pneumatic pump power. 3 HP ~ 2200W
|
||||
active_power_usage = 3500 //the pneumatic pump power. 3 HP ~ 2200W
|
||||
idle_power_usage = 100
|
||||
|
||||
// create a new disposal
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define DECAY_FACTOR 700 //Affects how fast the supermatter power decays
|
||||
#define CRITICAL_TEMPERATURE 800 //K
|
||||
#define CHARGING_FACTOR 0.05
|
||||
#define DAMAGE_RATE_LIMIT 5 //damage rate cap at power = 300, scales linearly with power
|
||||
#define DAMAGE_RATE_LIMIT 3 //damage rate cap at power = 300, scales linearly with power
|
||||
|
||||
|
||||
//These would be what you would get at point blank, decreases with distance
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#define WARNING_LOW_PRESSURE 50 //This is when the gray low pressure icon is displayed. (it is 2.5 * HAZARD_LOW_PRESSURE)
|
||||
#define HAZARD_LOW_PRESSURE 20 //This is when the black ultra-low pressure icon is displayed. (This one is set as a constant)
|
||||
|
||||
#define HEAT_CAPACITY_HUMAN 249840 //J/K, for a 72 kg person. Only used by cryo at the moment, perhaps it will be used for environment effect on body temperature in the future.
|
||||
#define TEMPERATURE_DAMAGE_COEFFICIENT 1.5 //This is used in handle_temperature_damage() for humans, and in reagents that affect body temperature. Temperature damage is multiplied by this amount.
|
||||
#define BODYTEMP_AUTORECOVERY_DIVISOR 12 //This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive.
|
||||
#define BODYTEMP_AUTORECOVERY_MINIMUM 1 //Minimum amount of kelvin moved toward 310.15K per tick. So long as abs(310.15 - bodytemp) is more than 50.
|
||||
|
||||
Reference in New Issue
Block a user