Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various breather quirk fixes #214

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modular_doppler/accessable_storage/accessable_storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <b>[visible_organ.contents[1].name]</b> 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 <b>[visible_organ.contents[1].name]</b> with [organ_haver.p_their()] [visible_organ.name].")

examine_list += examine_text
39 changes: 26 additions & 13 deletions modular_doppler/modular_quirks/breather/accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()] <b>[name]</b> reads: 'I breathe [breath_type]'."
var/mob/living/carbon/human/accessory_wearer = user
examine_list += "[accessory_wearer.p_Their()] <b>[name]</b> reads: 'I breathe [breath_type]'."


// Accessory for Akula species, it makes them wet and happy! :)
Expand All @@ -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\
<i>A label on its back warns about the potential dangers of electro-magnetic pulses.</i> \
<b>ctrl-click</b> in-hand to hide the device while worn."
<i>A label on its back warns about the potential dangers of electro-magnetic pulses.</i> \n\
<b>ctrl-click</b> 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'
Expand Down Expand Up @@ -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("<span class='danger'>[wearer] [wearer.p_their()] [src] overloads, exploding in a cloud of hot steam!</span>")
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("<span class='danger'>[src] overloads, exploding in a cloud of hot steam!</span>")
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"
Expand Down
11 changes: 11 additions & 0 deletions modular_doppler/modular_quirks/breather/breather_quirk.dm
Original file line number Diff line number Diff line change
@@ -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/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
Original file line number Diff line number Diff line change
@@ -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."
Expand All @@ -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/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))
Expand All @@ -27,10 +26,6 @@
LOCATION_HANDS = ITEM_SLOT_HANDS
)
)
var/obj/item/organ/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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/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))
Expand All @@ -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/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/lungs/fish)
return
Expand All @@ -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)
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7002,6 +7002,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"
Expand Down
Loading