From 7bd27735717a542e42c1e13639cb88e0407745d1 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sun, 8 Jan 2012 23:06:38 -0700 Subject: [PATCH] Added thermal transfer plate to code, added packaging materials to kitchen for delivered food. --- baystation12.dme | 1 + .../components/unary/thermal_plate.dm | 81 +++++++++++++++++++ maps/tgstation.2.0.8.dmm | 4 +- 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 code/ATMOSPHERICS/components/unary/thermal_plate.dm diff --git a/baystation12.dme b/baystation12.dme index 07210c8a5d0..7704973b732 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -209,6 +209,7 @@ #include "code\ATMOSPHERICS\components\unary\heat_source.dm" #include "code\ATMOSPHERICS\components\unary\outlet_injector.dm" #include "code\ATMOSPHERICS\components\unary\oxygen_generator.dm" +#include "code\ATMOSPHERICS\components\unary\thermal_plate.dm" #include "code\ATMOSPHERICS\components\unary\unary_base.dm" #include "code\ATMOSPHERICS\components\unary\vent_pump.dm" #include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm" diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm new file mode 100644 index 00000000000..22570a23478 --- /dev/null +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -0,0 +1,81 @@ +#define RADIATION_CAPACITY 30000 //Radiation isn't particularly effective (TODO BALANCE) + + +/obj/machinery/atmospherics/unary/thermal_plate +//Based off Heat Reservoir and Space Heater +//Transfers heat between a pipe system and environment, based on which has a greater thermal energy concentration + + icon = 'cold_sink.dmi' + icon_state = "intact_off" + + name = "Thermal Transfer Plate" + desc = "Transfers heat to and from an area" + + update_icon() + if(node) + icon_state = "intact_off" + else + icon_state = "exposed" + return + + process() + ..() + + var/datum/gas_mixture/environment = loc.return_air() + + //Get processable air sample and thermal info from environment + + var/transfer_moles = 0.25 * environment.total_moles() + var/datum/gas_mixture/external_removed = environment.remove(transfer_moles) + + if (!external_removed) + return radiate() + + if (external_removed.total_moles() < 10) + return radiate() + + //Get same info from connected gas + + var/internal_transfer_moles = 0.25 * air_contents.total_moles() + var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) + + if (!internal_removed) + environment.merge(external_removed) + return 1 + + var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity() + var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature + + if(!combined_heat_capacity) combined_heat_capacity = 1 + var/final_temperature = combined_energy / combined_heat_capacity + + external_removed.temperature = final_temperature + environment.merge(external_removed) + + internal_removed.temperature = final_temperature + air_contents.merge(internal_removed) + + network.update = 1 + + return 1 + + proc/radiate() + + var/internal_transfer_moles = 0.25 * air_contents.total_moles() + var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) + + if (!internal_removed) + return 1 + + var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY + var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * 6.4) + + var/final_temperature = combined_energy / combined_heat_capacity + + internal_removed.temperature = final_temperature + air_contents.merge(internal_removed) + + if (network) + network.update = 1 + + return 1 diff --git a/maps/tgstation.2.0.8.dmm b/maps/tgstation.2.0.8.dmm index e93e03320b5..119a58f8834 100644 --- a/maps/tgstation.2.0.8.dmm +++ b/maps/tgstation.2.0.8.dmm @@ -3042,7 +3042,7 @@ "bgz" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/wall/r_wall,/area/bridge/meeting_room) "bgA" = (/obj/machinery/camera{c_tag = "Central Hallway East"; dir = 4; network = "SS13"},/obj/structure/disposalpipe/segment{dir = 1},/turf/simulated/floor,/area/hallway/primary/central) "bgB" = (/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced,/obj/structure/grille,/obj/machinery/door/poddoor/shutters{density = 0; dir = 8; icon_state = "shutter0"; id = "kitchen3"; name = "Kitchen Shutters"; opacity = 0},/turf/simulated/floor/plating,/area/crew_quarters/kitchen) -"bgC" = (/obj/structure/table,/obj/item/weapon/reagent_containers/food/condiment/enzyme,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) +"bgC" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/obj/structure/closet/secure_closet/fridge,/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) "bgD" = (/obj/machinery/light,/obj/machinery/alarm{dir = 1; pixel_y = -22},/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) "bgE" = (/obj/item/device/radio/intercom{name = "Station Intercom (General)"; pixel_y = -29},/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) "bgF" = (/obj/machinery/firealarm{dir = 1; pixel_y = -24},/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) @@ -3156,7 +3156,7 @@ "biJ" = (/obj/structure/table,/obj/item/weapon/paper_bin{pixel_x = -3; pixel_y = 7},/turf/simulated/floor,/area/bridge/meeting_room) "biK" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 4},/obj/machinery/door/poddoor{density = 0; icon_state = "pdoor0"; id = "heads_meeting"; name = "Meeting Room Window Shields"; opacity = 0},/obj/machinery/atmospherics/pipe/simple{tag = "icon-intact-b-f (NORTH)"; icon_state = "intact-b-f"; dir = 1; level = 2; color = "blue"},/turf/simulated/floor/plating,/area/bridge/meeting_room) "biL" = (/obj/structure/disposalpipe/segment{dir = 1},/turf/simulated/floor,/area/hallway/primary/central) -"biM" = (/obj/structure/closet/secure_closet/fridge,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) +"biM" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden,/obj/structure/table,/obj/item/weapon/packageWrap,/obj/item/weapon/packageWrap,/obj/item/device/destTagger{pixel_x = 4; pixel_y = 3},/obj/item/weapon/reagent_containers/food/condiment/enzyme,/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) "biN" = (/obj/structure/table,/obj/machinery/blender{pixel_y = 0},/turf/simulated/floor{icon_state = "cafeteria"; dir = 2},/area/crew_quarters/kitchen) "biO" = (/obj/machinery/light{dir = 1},/turf/simulated/floor{icon_state = "bar"},/area/crew_quarters/bar) "biP" = (/obj/machinery/status_display{density = 0; layer = 4; pixel_x = 0; pixel_y = 32},/turf/simulated/floor{icon_state = "bar"},/area/crew_quarters/bar)