diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 22974f42fae..ffcc6a23f31 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -2,7 +2,7 @@ name = "portable suit cooling unit" desc = "A portable heat sink and liquid cooled radiator that can be hooked up to a space suit's existing temperature controls to provide industrial levels of cooling." w_class = ITEMSIZE_LARGE - icon = 'icons/obj/suitcooler.dmi' + icon = 'icons/obj/contained_items/tools/suitcooler.dmi' icon_state = "suitcooler0" item_state = "coolingpack" contained_sprite = TRUE @@ -24,7 +24,7 @@ var/cover_open = 0 //is the cover open? var/obj/item/cell/cell var/max_cooling = 12 //in degrees per second - probably don't need to mess with heat capacity here - var/charge_consumption = 16.6 //charge per second at max_cooling + var/charge_consumption = 8.3 //charge per second at max_cooling var/thermostat = T20C //TODO: make it heat up the surroundings when not in space @@ -134,8 +134,13 @@ src.cell = null update_icon() return + toggle_power(user) - //TODO use a UI like the air tanks +/obj/item/device/suit_cooling_unit/AltClick(mob/user) + if(Adjacent(user)) + toggle_power(user) + +/obj/item/device/suit_cooling_unit/proc/toggle_power(var/mob/user) if(on) turn_off() else @@ -177,23 +182,31 @@ return icon_state = "suitcooler0" + item_state = "coolingpack" - if(!cell || !on) - return + if(cell && on) + var/battery_level = 0 + switch(round(cell.percent())) + if(86 to INFINITY) + battery_level = 0 + if(69 to 85) + battery_level = 1 + if(52 to 68) + battery_level = 2 + if(35 to 51) + battery_level = 3 + if(18 to 34) + battery_level = 4 + if(-INFINITY to 17) + battery_level = 5 - switch(round(cell.percent())) - if(86 to INFINITY) - add_overlay("battery-0") - if(69 to 85) - add_overlay("battery-1") - if(52 to 68) - add_overlay("battery-2") - if(35 to 51) - add_overlay("battery-3") - if(18 to 34) - add_overlay("battery-4") - if(-INFINITY to 17) - add_overlay("battery-5") + add_overlay("battery-[battery_level]") + item_state = "coolingpack[battery_level]" + + if(ismob(loc)) + var/mob/M = loc + M.update_inv_back() + M.update_inv_s_store() /obj/item/device/suit_cooling_unit/examine(mob/user) if(!..(user, 1)) diff --git a/html/changelogs/geeves-suit_cooler_stuff.yml b/html/changelogs/geeves-suit_cooler_stuff.yml new file mode 100644 index 00000000000..38ba2eefee9 --- /dev/null +++ b/html/changelogs/geeves-suit_cooler_stuff.yml @@ -0,0 +1,9 @@ +author: Geeves + +delete-after: True + +changes: + - tweak: "Suit coolers now use charge a half the usual rate, doubling their lifespan." + - rscadd: "You can now toggle a suit cooler on or near your person on-and-off by alt-clicking it." + - rscadd: "Suit coolers now have on-mob sprites that reflect the current charge." + - bugfix: "Suit coolers now have suit storage slot sprites too." \ No newline at end of file diff --git a/icons/obj/contained_items/tools/suitcooler.dmi b/icons/obj/contained_items/tools/suitcooler.dmi new file mode 100644 index 00000000000..109858f8c0e Binary files /dev/null and b/icons/obj/contained_items/tools/suitcooler.dmi differ diff --git a/icons/obj/suitcooler.dmi b/icons/obj/suitcooler.dmi deleted file mode 100644 index b735d61d717..00000000000 Binary files a/icons/obj/suitcooler.dmi and /dev/null differ