Skip to content

Commit

Permalink
Возвращение cooling belts (#2907)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexanx authored Nov 26, 2024
1 parent 87bd6de commit 665bff3
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 9 deletions.
2 changes: 2 additions & 0 deletions maps/antag_spawn/mercenary/mercenary_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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" = (
Expand Down
12 changes: 12 additions & 0 deletions maps/sierra/z1-z5_sierra.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down
10 changes: 1 addition & 9 deletions mods/ipc_mods/_ipc_mods.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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
89 changes: 89 additions & 0 deletions mods/ipc_mods/code/coolerbelt.dm
Original file line number Diff line number Diff line change
@@ -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
Binary file added mods/ipc_mods/icons/beltcooler.dmi
Binary file not shown.

0 comments on commit 665bff3

Please sign in to comment.