From 6eca3fed860e3f5dd3a36a55c4abb9568eb79fd5 Mon Sep 17 00:00:00 2001 From: Alphas00 <154434082+Alphas00@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:16:45 +0100 Subject: [PATCH 1/2] Modular items update tweak, Water Sponge vapor function Changed modular items to update periodically though handle_fatness, not just when fatness is changed. Water Sponge vapor function restored and updated --- GainStation13/code/mechanics/water_sponge.dm | 25 +++++++++++-------- .../clothing/under/jobs/modular_items.dm | 3 +-- .../code/modules/mob/living/species.dm | 1 + 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/GainStation13/code/mechanics/water_sponge.dm b/GainStation13/code/mechanics/water_sponge.dm index 6453dc8204..84d4b1e788 100644 --- a/GainStation13/code/mechanics/water_sponge.dm +++ b/GainStation13/code/mechanics/water_sponge.dm @@ -40,17 +40,22 @@ var/mob/living/carbon/L = AM L.reagents.add_reagent(/datum/reagent/water, 3) -/* Disabling this for now. -/mob/living/carbon/proc/water_check(datum/gas_mixture/breath) - if(HAS_TRAIT(src, TRAIT_WATER_SPONGE)) + +/obj/item/organ/lungs/proc/water_check(datum/gas_mixture/breath, mob/living/carbon/human/H) + if(HAS_TRAIT(H, TRAIT_WATER_SPONGE)) if(breath) - if(breath.gases) - var/breath_gases = breath.gases - if(breath_gases[/datum/gas/water_vapor]) - var/H2O_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/water_vapor]) - reagents.add_reagent(/datum/reagent/water, H2O_pp/10) - breath_gases[/datum/gas/water_vapor] -= H2O_pp -*/ + var/pressure = breath.return_pressure() + var/total_moles = breath.total_moles() + #define PP_MOLES(X) ((X / total_moles) * pressure) + #define PP(air, gas) PP_MOLES(air.get_moles(gas)) + var/gas_breathed = PP(breath,GAS_H2O) + if(gas_breathed > 0) + H.reagents.add_reagent(/datum/reagent/water, gas_breathed) + breath.adjust_moles(GAS_H2O, -gas_breathed) + +/obj/item/organ/lungs/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) + water_check(breath, H) + . = ..() /obj/structure/sink var/mob/living/attached diff --git a/GainStation13/code/modules/clothing/under/jobs/modular_items.dm b/GainStation13/code/modules/clothing/under/jobs/modular_items.dm index c29ef75b74..ea0543fc1d 100644 --- a/GainStation13/code/modules/clothing/under/jobs/modular_items.dm +++ b/GainStation13/code/modules/clothing/under/jobs/modular_items.dm @@ -1,8 +1,7 @@ /mob/living/carbon var/modular_items = list() -/mob/living/carbon/adjust_fatness(adjustment_amount, type_of_fattening = FATTENING_TYPE_ITEM) - ..() +/mob/living/carbon/proc/handle_modular_items(adjustment_amount, type_of_fattening = FATTENING_TYPE_ITEM) for(var/obj/item/item in modular_items) item.update_modular_overlays(src) diff --git a/GainStation13/code/modules/mob/living/species.dm b/GainStation13/code/modules/mob/living/species.dm index 235987bda0..133b41d9bc 100644 --- a/GainStation13/code/modules/mob/living/species.dm +++ b/GainStation13/code/modules/mob/living/species.dm @@ -222,6 +222,7 @@ /datum/species/proc/handle_fatness(mob/living/carbon/human/H) handle_helplessness(H) + H.handle_modular_items() // update movement speed var/fatness_delay = 0 From b4e4253a5b7527e7d0a2edc1e948947ceb5e26f9 Mon Sep 17 00:00:00 2001 From: Alphas00 <154434082+Alphas00@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:09:45 +0100 Subject: [PATCH 2/2] Further modular items tweak and breasts fix Further tweaked modular item functions and fixed an error with breasts sprites --- .../clothing/under/jobs/modular_items.dm | 51 ++++++++++++++---- .../icons/mob/modclothes/modular_grey.dmi | Bin 90762 -> 90764 bytes 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/GainStation13/code/modules/clothing/under/jobs/modular_items.dm b/GainStation13/code/modules/clothing/under/jobs/modular_items.dm index ea0543fc1d..6435c66202 100644 --- a/GainStation13/code/modules/clothing/under/jobs/modular_items.dm +++ b/GainStation13/code/modules/clothing/under/jobs/modular_items.dm @@ -8,16 +8,25 @@ /obj/item var/modular_icon_location = null var/mod_overlays = list() + var/mod_breasts_size = 0 + var/mod_butt_size = 0 + var/mod_belly_size = 0 /obj/item/equipped(mob/user, slot) if(modular_icon_location != null && slot == slot_flags) //if(slot == ITEM_SLOT_ICLOTHING) - update_modular_overlays(user) + add_modular_item(user) ..() /obj/item/dropped(mob/user) - remove_modular_overlays(user) + remove_modular_item(user) ..() +/obj/item/proc/add_modular_item(mob/user) + mod_breasts_size = 0 + mod_butt_size = 0 + mod_belly_size = 0 + update_modular_overlays(user) + /obj/item/proc/add_modular_overlay(mob/living/carbon/U, modular_icon, modular_layer, sprite_color) var/mutable_appearance/mod_overlay = mutable_appearance(modular_icon_location, modular_icon, -(modular_layer), color = sprite_color) mod_overlays += mod_overlay @@ -87,25 +96,45 @@ if(!iscarbon(user)) return var/mob/living/carbon/U = user + + var/list/genitals_list + var/build_modular = FALSE + + var/obj/item/organ/genital/O + for(O in U.internal_organs) + if(istype(O, /obj/item/organ/genital/belly)) + genitals_list += list(O) + if(O.size != mod_belly_size) + mod_belly_size = O.size + build_modular = TRUE + if(istype(O, /obj/item/organ/genital/butt)) + genitals_list += list(O) + if(O.size != mod_butt_size) + mod_butt_size = O.size + build_modular = TRUE + if(istype(O, /obj/item/organ/genital/breasts)) + genitals_list += list(O) + var/obj/item/organ/genital/breasts/G = O + if(G.cached_size != mod_breasts_size) + mod_breasts_size = G.cached_size + build_modular = TRUE + if(!build_modular) + return delete_modular_overlays(U) if(!(src in U.modular_items)) U.modular_items += src - var/obj/item/organ/O var/obj/item/organ/genital/G - for(O in U.internal_organs) //check the user for the organs they have - if(istype(O, /obj/item/organ/genital/belly)) //if that organ is a belly - G = O //treat that organ as a genital + for(G in genitals_list) //check the user for the organs they have + if(istype(G, /obj/item/organ/genital/belly)) //if that organ is a belly var/modular_sprite = get_modular_belly(G) add_modular_overlay(U, modular_sprite, MODULAR_BELLY_LAYER, color) add_modular_overlay(U, "[modular_sprite]_SOUTH", BELLY_FRONT_LAYER, color) - if(istype(O, /obj/item/organ/genital/butt)) //if that organ is the butt - G = O + if(istype(G, /obj/item/organ/genital/butt)) //if that organ is the butt var/modular_sprite = get_modular_butt(G) add_modular_overlay(U, modular_sprite, MODULAR_BUTT_LAYER, color) add_modular_overlay(U, "[modular_sprite]_NORTH", BUTT_BEHIND_LAYER, color) - if(istype(O, /obj/item/organ/genital/breasts)) //if the organ is the breasts - G = O + if(istype(G, /obj/item/organ/genital/breasts)) //if the organ is the breasts var/modular_sprite = get_modular_breasts(G) add_modular_overlay(U, modular_sprite, MODULAR_BREASTS_LAYER, color) add_modular_overlay(U, "[modular_sprite]_NORTH", BREASTS_BEHIND_LAYER, color) @@ -121,7 +150,7 @@ U.cut_overlay(overlay) mod_overlays -= mod_overlays -/obj/item/proc/remove_modular_overlays(mob/user) +/obj/item/proc/remove_modular_item(mob/user) if(!iscarbon(user)) return delete_modular_overlays(user) diff --git a/GainStation13/icons/mob/modclothes/modular_grey.dmi b/GainStation13/icons/mob/modclothes/modular_grey.dmi index 9d75573877b956f443ddc73fe7c2bd313afb1640..94fb401c916a1a1c968134351c92acf5b6063933 100644 GIT binary patch delta 875 zcmV-x1C;!V#RZJT1&|~GuaPA}1&nkiQJ9fzD}SMBvo?2YceA~;?Phi}o$ShUQm^W_i{C}9&u(^gs8WwBVLc^9CmT1^Y!&33_iZ;wPPtV_ed=-Bwf#(E{2pki5 zLEt5U69TUYoFY?@g|khidM$!;6^v9cR>6e|E>$p5!IcW8@&lKxnQbaIwFsXxJYsmv z@P7rvmkduBzG8R^Z34EQ^Q>u`&A!T78O~&KE0ZrWxs%CU|Mz9GkjaBgmNNM&lW#I9 zyea~Dl*yA!*820j6uP0utZB-3oiEBlPjz|xRX0t!tw6x4tc4?)L4FJQ7s&4*pVLV>GQu7G=CCdifJ&)g3iu3(RfI|KmSBS%J>(^?;xK; zeh>Kq@(0M5kbi~z8{{jc94XG&1tLo3DsrOQqG{Qom zG{QoyG{Qo;G{Qo~G{QpBG{QpNG{QpZG{QplG{Qmwb>*OP_+NR*@HxXHhQ|zFFn@f> z@Py$jhNldl@lp0%GUt+rOJXiraLJNO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