Merge pull request #997 from ArchieBeepBoop/teg

TEG Crate fix + TEG Updates
This commit is contained in:
QuoteFox
2021-02-25 07:10:08 +00:00
committed by GitHub
4 changed files with 25 additions and 5 deletions

View File

@@ -217,3 +217,12 @@
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
// )
#define MANHATTAN_DISTANCE(a, b) (abs(a.x - b.x) + abs(a.y - b.y))
#define LOGISTIC_FUNCTION(L,k,x,x_0) (L/(1+(NUM_E**(-k*(x-x_0)))))
/// Make sure something is a boolean TRUE/FALSE 1/0 value, since things like bitfield & bitflag doesn't always give 1s and 0s.
#define FORCE_BOOLEAN(x) ((x)? TRUE : FALSE)
#define TILES_TO_PIXELS(tiles) (tiles * PIXELS)

View File

@@ -89,6 +89,7 @@
if(!panel_open)
return
anchored = !anchored
move_resist = anchored? INFINITY : 100
I.play_tool_sound(src)
if(generator)
disconnectFromGenerator()

View File

@@ -169,12 +169,22 @@
crate_name = "tesla generator crate"
/datum/supply_pack/engine/teg
name = "Thermoelectric Generator"
desc = "Contains your very own Thermoelectric Generator. Time to turn cargo into a blazing hellfire, perhaps?"
cost = 4000
contains = list(/obj/machinery/power/generator)
name = "Thermoelectric Generator Assembly"
desc = "Contains your very own Thermoelectric Generator Assembly. Time to turn cargo into a blazing hellfire, perhaps?"
cost = 3000
contains = list(/obj/item/paper/teg,
/obj/item/circuitboard/machine/generator,
/obj/item/circuitboard/machine/circulator,
/obj/item/circuitboard/machine/circulator,
/obj/item/stack/cable_coil,
/obj/item/stack/sheet/metal/twenty)
crate_name = "thermoelectric generator crate"
/obj/item/paper/teg
info = "*The seemingly useful notes have been scribbled over with red and black crayon. Hmm.*"
name = "TEG Instructions"
color = "red"
/datum/supply_pack/engine/energy_harvester
name = "Energy Harvesting Module"
desc = "A Device which upon connection to a node, will harvest the energy and send it to engineerless stations in return for credits, derived from a syndicate powersink model."

View File

@@ -89,7 +89,7 @@
var/energy_transfer = delta_temperature*hot_air_heat_capacity*cold_air_heat_capacity/(hot_air_heat_capacity+cold_air_heat_capacity)
var/heat = energy_transfer*(1-efficiency)
lastgen += energy_transfer*efficiency
lastgen += LOGISTIC_FUNCTION(500000,0.0009,delta_temperature,10000)
hot_air.temperature = hot_air.temperature - energy_transfer/hot_air_heat_capacity
cold_air.temperature = cold_air.temperature + heat/cold_air_heat_capacity