From 665bff3f8be948212f92704b8a9d10f647842366 Mon Sep 17 00:00:00 2001 From: Lexanx <61974560+Lexanx@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:55:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20cooling=20belts=20=20(#2907)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maps/antag_spawn/mercenary/mercenary_base.dmm | 2 + maps/sierra/z1-z5_sierra.dmm | 12 +++ mods/ipc_mods/_ipc_mods.dme | 10 +- mods/ipc_mods/code/coolerbelt.dm | 89 ++++++++++++++++++ mods/ipc_mods/icons/beltcooler.dmi | Bin 0 -> 879 bytes 5 files changed, 104 insertions(+), 9 deletions(-) create mode 100644 mods/ipc_mods/code/coolerbelt.dm create mode 100644 mods/ipc_mods/icons/beltcooler.dmi diff --git a/maps/antag_spawn/mercenary/mercenary_base.dmm b/maps/antag_spawn/mercenary/mercenary_base.dmm index 39396c0e5fabe..d301337624213 100644 --- a/maps/antag_spawn/mercenary/mercenary_base.dmm +++ b/maps/antag_spawn/mercenary/mercenary_base.dmm @@ -2623,6 +2623,8 @@ /obj/item/device/suit_cooling_unit, /obj/item/device/suit_cooling_unit, /obj/floor_decal/corner/blue/mono, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled/dark/monotile, /area/map_template/merc_spawn) "DI" = ( diff --git a/maps/sierra/z1-z5_sierra.dmm b/maps/sierra/z1-z5_sierra.dmm index aab24e20df269..0782caa9141a8 100644 --- a/maps/sierra/z1-z5_sierra.dmm +++ b/maps/sierra/z1-z5_sierra.dmm @@ -10273,6 +10273,8 @@ /obj/item/device/suit_cooling_unit, /obj/floor_decal/industrial/outline/grey, /obj/item/device/suit_cooling_unit, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled/techfloor/grid, /area/storage/eva) "bAm" = ( @@ -63085,6 +63087,8 @@ /obj/item/device/suit_cooling_unit, /obj/item/device/suit_cooling_unit, /obj/floor_decal/industrial/outline/yellow, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled/techfloor/grid, /area/quartermaster/exploration/storage) "joT" = ( @@ -74088,6 +74092,8 @@ dir = 1; pixel_y = -21 }, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled/steel_grid, /area/engineering/engine_eva) "kUj" = ( @@ -85417,6 +85423,8 @@ dir = 4 }, /obj/item/tank/jetpack/carbondioxide, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled/techfloor, /area/security/sierra/suits) "mDw" = ( @@ -125682,6 +125690,8 @@ dir = 8 }, /obj/floor_decal/industrial/outline/yellow, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled, /area/quartermaster/expedition/eva) "syP" = ( @@ -130812,6 +130822,8 @@ dir = 1 }, /obj/floor_decal/industrial/outline/yellow, +/obj/item/device/suit_cooling_unit/miniature, +/obj/item/device/suit_cooling_unit/miniature, /turf/simulated/floor/tiled/white/monotile, /area/medical/locker) "tkw" = ( diff --git a/mods/ipc_mods/_ipc_mods.dme b/mods/ipc_mods/_ipc_mods.dme index d6532ead37fac..2e6f53d99d1e4 100644 --- a/mods/ipc_mods/_ipc_mods.dme +++ b/mods/ipc_mods/_ipc_mods.dme @@ -11,13 +11,5 @@ #include "code/uplink.dm" #include "code/machine_functions.dm" #include "code/pictures.dm" +#include "code/coolerbelt.dm" #endif -// BEGIN_INTERNALS -// END_INTERNALS -// BEGIN_FILE_DIR -#define FILE_DIR . -// END_FILE_DIR -// BEGIN_PREFERENCES -// END_PREFERENCES -// BEGIN_INCLUDE -// END_INCLUDE diff --git a/mods/ipc_mods/code/coolerbelt.dm b/mods/ipc_mods/code/coolerbelt.dm new file mode 100644 index 0000000000000..719cce6d3a70d --- /dev/null +++ b/mods/ipc_mods/code/coolerbelt.dm @@ -0,0 +1,89 @@ +/obj/item/device/suit_cooling_unit/is_in_slot() + var/mob/living/carbon/human/H = loc + if(!istype(H)) + return 0 + + return (H.back == src) || (H.s_store == src) || (H.belt == src) + +/obj/item/device/suit_cooling_unit/miniature + name = "miniature cooling device" + desc = "Minituarized heat sink that can be hooked up to around waist. Weaker than it's bigger counterpart." + w_class = ITEM_SIZE_NORMAL + icon = 'mods/ipc_mods/icons/beltcooler.dmi' + item_icons = list( + slot_belt_str = 'mods/ipc_mods/icons/beltcooler.dmi', + ) + icon_state = "miniaturesuitcooler0" + item_state = "coolingbelt" + + max_cooling = 6 + charge_consumption = 2.4 KILOWATTS + slot_flags = SLOT_BELT + matter = list(MATERIAL_STEEL = 10000, MATERIAL_ALUMINIUM = 5000, MATERIAL_GLASS = 3000) + +/obj/item/device/suit_cooling_unit/miniature/on_update_icon() + ClearOverlays() + if (cover_open) + if (cell) + icon_state = "miniaturesuitcooler1" + else + icon_state = "miniaturesuitcooler2" + return + + icon_state = "miniaturesuitcooler0" + + if(!cell || !on) + return + + switch(round(cell.percent())) + if(86 to INFINITY) + AddOverlays("minibattery-0") + if(69 to 85) + AddOverlays("minibattery-1") + if(52 to 68) + AddOverlays("minibattery-2") + if(35 to 51) + AddOverlays("minibattery-3") + if(18 to 34) + AddOverlays("minibattery-4") + if(-INFINITY to 17) + AddOverlays("minibattery-5") + + +/obj/item/device/suit_cooling_unit/miniature/Process() + if (!on || !cell) + return + + if (!is_in_slot()) + return + + var/mob/living/carbon/human/H = loc + if ((H.pressure_alert == -1) || (H.pressure_alert == -2)) + max_cooling = max_cooling/2 + + var/temp_adj = min(H.bodytemperature - thermostat, max_cooling) + + if (temp_adj < 0.5) //only cools, doesn't heat, also we don't need extreme precision + return + + var/charge_usage = (temp_adj/max_cooling)*charge_consumption + + H.bodytemperature -= temp_adj + + cell.use(charge_usage * CELLRATE) + update_icon() + + if(cell.charge <= 0) + turn_off(1) + + +/obj/item/device/suit_cooling_unit/miniature/empty + + +/obj/item/device/suit_cooling_unit/empty/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + cell = null + +/datum/fabricator_recipe/mini_suit_cooler + path = /obj/item/device/suit_cooling_unit/miniature/empty diff --git a/mods/ipc_mods/icons/beltcooler.dmi b/mods/ipc_mods/icons/beltcooler.dmi new file mode 100644 index 0000000000000000000000000000000000000000..ce82d4a0c80e1606356364ce9b2dcbe574af9437 GIT binary patch literal 879 zcmV-#1CacQP)C0001QP)t-sz`(!^ z3=9wu5GW`pGcz+77a75gD(b8V=-0C=38k;@8$Fcd`B z$yWs3w#8SM-H1|L)PIQ0tzPf}$+gA5Z_*-ex`^G)z&S85p~%Z?Rg2XSwOZLi0Tqit>&puW;9ogr zRw%aSIoIa{fam@7-3l;7+>KG#8r&-vQh69l+g5j(fNH=55?P#&gI6@F0kJ zRRN1fK`8!d89VTC2EGI700%j?coy&3f5_yiA1NO@=J)8MfUd*iBJ>YfJ|T1f5+QZq zI8O!qhy`Twe*8AqfuGT!fOttIowf`wfusW*!XWTKp@% zWeO