From 999a31048cad22bc4287702f8742c597cdf14539 Mon Sep 17 00:00:00 2001 From: "Lila S." Date: Mon, 4 Nov 2024 20:27:50 +0100 Subject: [PATCH] initial --- .../accessable_storage/accessable_storage.dm | 3 +- .../modular_quirks/breather/accessories.dm | 39 ++++++++++++------- .../modular_quirks/breather/breather_quirk.dm | 11 ++++++ .../nitrogen_breather/nitrogen_breather.dm | 17 +++----- .../breather/water_breather/water_breather.dm | 18 +++++---- tgstation.dme | 1 + 6 files changed, 56 insertions(+), 33 deletions(-) create mode 100644 modular_doppler/modular_quirks/breather/breather_quirk.dm diff --git a/modular_doppler/accessable_storage/accessable_storage.dm b/modular_doppler/accessable_storage/accessable_storage.dm index e8840921cac40..a8ec638b2b541 100644 --- a/modular_doppler/accessable_storage/accessable_storage.dm +++ b/modular_doppler/accessable_storage/accessable_storage.dm @@ -95,6 +95,7 @@ var/obj/item/organ/visible_organ = parent if(!length(visible_organ.contents)) return - var/examine_text = span_notice("[user.p_Theyre()] holding [icon2html(visible_organ.contents[1], examined)] \a [visible_organ.contents[1].name] with [user.p_their()] [visible_organ.name].") + var/mob/living/carbon/human/organ_haver = user + var/examine_text = span_notice("[organ_haver.p_Theyre()] holding [icon2html(visible_organ.contents[1], examined)] \a [visible_organ.contents[1].name] with [organ_haver.p_their()] [visible_organ.name].") examine_list += examine_text diff --git a/modular_doppler/modular_quirks/breather/accessories.dm b/modular_doppler/modular_quirks/breather/accessories.dm index b0f99d0875ff4..f8a6aae64c2d4 100644 --- a/modular_doppler/modular_quirks/breather/accessories.dm +++ b/modular_doppler/modular_quirks/breather/accessories.dm @@ -20,7 +20,8 @@ /obj/item/clothing/accessory/breathing/proc/on_examine(datum/source, mob/user, list/examine_list) SIGNAL_HANDLER - examine_list += "[user.p_Their()] [name] reads: 'I breathe [breath_type]'." + var/mob/living/carbon/human/accessory_wearer = user + examine_list += "[accessory_wearer.p_Their()] [name] reads: 'I breathe [breath_type]'." // Accessory for Akula species, it makes them wet and happy! :) @@ -29,8 +30,9 @@ desc = "An expensive device manufactured for the civilian work-force of the Azulean military power. \ Relying on an internal battery, the coil mechanism synthesizes a hydrogen oxygen mixture, \ which can then be used to moisturize the wearer's skin. \n\n\ - A label on its back warns about the potential dangers of electro-magnetic pulses. \ - ctrl-click in-hand to hide the device while worn." + A label on its back warns about the potential dangers of electro-magnetic pulses. \n\ + ctrl-click in-hand to hide the device while worn. \n\ + Can also be worn inside of a pocket." icon_state = "wetmaker" base_icon_state = "wetmaker" icon = 'modular_doppler/modular_cosmetics/icons/obj/accessories/accessories.dmi' @@ -61,22 +63,33 @@ update_icon() // update that mf return CLICK_ACTION_SUCCESS +/mob/living/carbon/human/emp_act(severity) // necessary to still emp when worn as accessory + . = ..() + var/obj/item/clothing/under/worn_uniform = w_uniform + if(w_uniform) + for(var/obj/item/clothing/accessory/vaporizer/vaporizer in worn_uniform.attached_accessories) + vaporizer.on_emp() + break + /obj/item/clothing/accessory/vaporizer/emp_act(severity) . = ..() - var/obj/item/clothing/under/attached_to = loc - var/mob/living/carbon/human/wearer = attached_to.loc - if(!istype(wearer) || !istype(attached_to)) - return - var/turf/open/tile = get_turf(wearer) + var/turf/open/tile = get_turf(src) + var/list/victims = get_hearers_in_view(4, tile) if(istype(tile)) tile.atmos_spawn_air("[GAS_WATER_VAPOR]=50;[TURF_TEMPERATURE(1000)]") - wearer.balloon_alert(wearer, "overloaded!") - wearer.visible_message("[wearer] [wearer.p_their()] [src] overloads, exploding in a cloud of hot steam!") - wearer.set_jitter_if_lower(10 SECONDS) - playsound(wearer, 'sound/effects/spray.ogg', 80) - detach(attached_to) // safely remove wetsuit status effect + tile.balloon_alert_to_viewers("overloaded!") + tile.visible_message("[src] overloads, exploding in a cloud of hot steam!") + playsound(tile, 'sound/effects/spray.ogg', 80) + for(var/mob/living/collateral in victims) + collateral.set_jitter_if_lower(15 SECONDS) + collateral.set_eye_blur_if_lower(5 SECONDS) qdel(src) +/obj/item/clothing/accessory/vaporizer/proc/on_emp() + var/obj/item/clothing/under/attached_to = loc + detach(attached_to) // safely remove wetsuit status effect + emp_act(EMP_LIGHT) + /datum/design/vaporizer name = "Hydro-Vaporizer" id = "vaporizer" diff --git a/modular_doppler/modular_quirks/breather/breather_quirk.dm b/modular_doppler/modular_quirks/breather/breather_quirk.dm new file mode 100644 index 0000000000000..a400df373e210 --- /dev/null +++ b/modular_doppler/modular_quirks/breather/breather_quirk.dm @@ -0,0 +1,11 @@ +/datum/quirk/item_quirk/breather + abstract_parent_type = /datum/quirk/item_quirk/breather + icon = FA_ICON_LUNGS_VIRUS + var/breath_type = "oxygen" + +/datum/quirk/item_quirk/breather/add_unique(client/client_source) + var/obj/item/organ/internal/lungs/target_lungs = quirk_holder.get_organ_slot(ORGAN_SLOT_LUNGS) + if(!target_lungs) + to_chat(quirk_holder, span_warning("Your [name] quirk couldn't properly execute due to your species/body lacking a pair of lungs!")) + return FALSE + return TRUE diff --git a/modular_doppler/modular_quirks/breather/nitrogen_breather/nitrogen_breather.dm b/modular_doppler/modular_quirks/breather/nitrogen_breather/nitrogen_breather.dm index 1eb1eb4078314..b0ed07ad77e77 100644 --- a/modular_doppler/modular_quirks/breather/nitrogen_breather/nitrogen_breather.dm +++ b/modular_doppler/modular_quirks/breather/nitrogen_breather/nitrogen_breather.dm @@ -1,8 +1,3 @@ -/datum/quirk/item_quirk/breather - abstract_parent_type = /datum/quirk/item_quirk/breather - icon = FA_ICON_LUNGS_VIRUS - var/breath_type = "oxygen" - /datum/quirk/item_quirk/breather/nitrogen_breather name = "Nitrogen Breather" desc = "You breathe nitrogen, even if you might not normally breathe it. Oxygen is poisonous." @@ -13,8 +8,12 @@ breath_type = "nitrogen" /datum/quirk/item_quirk/breather/nitrogen_breather/add_unique(client/client_source) - var/mob/living/carbon/human/target = quirk_holder - var/obj/item/clothing/accessory/breathing/target_tag = new(get_turf(target)) + . = ..() + if(!.) + return + + var/obj/item/organ/internal/lungs/target_lungs = quirk_holder.get_organ_slot(ORGAN_SLOT_LUNGS) + var/obj/item/clothing/accessory/breathing/target_tag = new(get_turf(quirk_holder)) target_tag.breath_type = breath_type give_item_to_holder(target_tag, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS)) @@ -27,10 +26,6 @@ LOCATION_HANDS = ITEM_SLOT_HANDS ) ) - var/obj/item/organ/internal/lungs/target_lungs = target.get_organ_slot(ORGAN_SLOT_LUNGS) - if(!target_lungs) - to_chat(target, span_warning("Your [name] quirk couldn't properly execute due to your species/body lacking a pair of lungs!")) - return // set lung vars target_lungs.safe_oxygen_min = 0 //Dont need oxygen target_lungs.safe_oxygen_max = 2 //But it is quite toxic diff --git a/modular_doppler/modular_quirks/breather/water_breather/water_breather.dm b/modular_doppler/modular_quirks/breather/water_breather/water_breather.dm index 708e25746f435..a776bbdf83dbe 100644 --- a/modular_doppler/modular_quirks/breather/water_breather/water_breather.dm +++ b/modular_doppler/modular_quirks/breather/water_breather/water_breather.dm @@ -9,8 +9,12 @@ breath_type = "water" /datum/quirk/item_quirk/breather/water_breather/add_unique(client/client_source) - var/mob/living/carbon/human/target = quirk_holder - var/obj/item/clothing/accessory/breathing/target_tag = new(get_turf(target)) + . = ..() + if(!.) + return + + var/obj/item/organ/internal/lungs/target_lungs = quirk_holder.get_organ_slot(ORGAN_SLOT_LUNGS) + var/obj/item/clothing/accessory/breathing/target_tag = new(get_turf(quirk_holder)) target_tag.breath_type = breath_type give_item_to_holder(target_tag, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS)) @@ -23,11 +27,6 @@ LOCATION_BACKPACK = ITEM_SLOT_BACKPACK ), "Be sure to equip your vaporizer, or you may end up choking to death!" ) - var/obj/item/organ/internal/lungs/target_lungs = target.get_organ_slot(ORGAN_SLOT_LUNGS) - var/obj/item/bodypart/chest/target_chest = target.get_bodypart(BODY_ZONE_CHEST) - if(!target_lungs || !target_chest) - to_chat(target, span_warning("Your [name] quirk couldn't properly execute due to your species/body lacking a pair of lungs!")) - return // if your lungs already have this trait, no need to update if(target_lungs.type == /obj/item/organ/internal/lungs/fish) return @@ -39,4 +38,7 @@ // flavor target_lungs.AddElement(/datum/element/noticable_organ, "%PRONOUN_Theyve a set of gills on %PRONOUN_their neck.", BODY_ZONE_PRECISE_MOUTH) target_lungs.AddComponent(/datum/component/bubble_icon_override, "fish", BUBBLE_ICON_PRIORITY_ORGAN) - target_chest.add_bodypart_overlay(new /datum/bodypart_overlay/simple/gills) + // add the gills overlay + var/obj/item/bodypart/chest/target_chest = quirk_holder.get_bodypart(BODY_ZONE_CHEST) + if(target_chest) // just to be sure + target_chest.add_bodypart_overlay(new /datum/bodypart_overlay/simple/gills) diff --git a/tgstation.dme b/tgstation.dme index 871f06eaa6d7b..5059aaeb9a97a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6972,6 +6972,7 @@ #include "modular_doppler\modular_mood\code\mood_events\hotspring.dm" #include "modular_doppler\modular_mood\code\mood_events\race_drink.dm" #include "modular_doppler\modular_quirks\breather\accessories.dm" +#include "modular_doppler\modular_quirks\breather\breather_quirk.dm" #include "modular_doppler\modular_quirks\breather\nitrogen_breather\nitrogen_breather.dm" #include "modular_doppler\modular_quirks\breather\nitrogen_breather\nitrogen_tanks.dm" #include "modular_doppler\modular_quirks\breather\water_breather\water_breather.dm"