From b678da500131bb385dd8f71a3324ba6242c13b59 Mon Sep 17 00:00:00 2001 From: SigDoesCode <84544997+SigDoesCode@users.noreply.github.com> Date: Sat, 17 Aug 2024 03:05:32 -0700 Subject: [PATCH] QOL Fixes for Psionic Armor (#32) ## About The Pull Request
About The Pull Request
Adds two functionalities to psionic armor: 1. Clothing that used to be replaced entirely by the power is now dropped on the floor when using the power. 2. Equipment in the suit storage slot is now reequipped on resolution of the power. This change also fixes some of the grammar and spelling in the power descriptions and updates the messages displayed in chat to reflect the fact that the psionic moth god no longer eats the psion's clothing when using this armor power.
## Changelog :cl: tweak: Psionic armor powers no longer eat your clothing and reequip anything you had in your suit slot on use. :cl: Co-authored-by: valkyria-gk <177847920+valkyria-gk@users.noreply.github.com> --- .../psionics/psion_powers/armour_powers.dm | 63 ++++++++++++------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/code/modules/psionics/psion_powers/armour_powers.dm b/code/modules/psionics/psion_powers/armour_powers.dm index 52ddafe48b0..6a11d388416 100644 --- a/code/modules/psionics/psion_powers/armour_powers.dm +++ b/code/modules/psionics/psion_powers/armour_powers.dm @@ -4,54 +4,75 @@ /mob/living/carbon/human/proc/psionic_armor() set category = "Psionic powers" set name = "Psionic armor (4)" - set desc = "Creates a set of armor from somewhere that does not exist. Anything taken off disappears and whatever clothing you are wearing when this power is used is destroyed." + set desc = "Creates a set of armor from somewhere that does not exist. Any part disappears once removed from your body. Your current suit, headgear, gloves, and shoes will be discarded on the floor." var/psi_point_cost = 4 var/mob/living/carbon/human/user = src var/obj/item/organ/internal/psionic_tumor/PT = user.first_organ_by_process(BP_PSION) if(PT && PT.pay_power_cost(psi_point_cost) && PT.check_possibility()) + var/list/affected_slots = list(slot_shoes, slot_wear_suit, slot_gloves, slot_head) //This code lists slots for equipping armor, so we can drop their clothing. playsound(usr.loc, pick('sound/mecha/lowpower.ogg','sound/effects/magic/Blind.ogg','sound/effects/phasein.ogg'), 50, 1, -3) user.visible_message( - SPAN_DANGER("[src]'s flesh and clothing contort and shimmer, reforming into flowing, black and bronze robes!"), - SPAN_DANGER("Your flesh and clothing meld painfully, shimmering out of this reality as they are replaced with a set of armored robes!") + SPAN_DANGER("[src]'s clothes fall away as their flesh contorts and shimmers, reforming into flowing, black and bronze robes!"), + SPAN_DANGER("Your clothing falls away as your flesh shimmers painfully, easing as it is replaced by a set of armored robes!") ) - user.replace_in_slot(new /obj/item/clothing/shoes/occultgreaves, slot_shoes, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/suit/space/occultist, slot_wear_suit, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/gloves/occultgloves, slot_gloves, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/head/helmet/space/occulthood, slot_head, skip_covering_check = TRUE) + var/obj/item/suitequipment = get_equipped_item(slot_s_store) //If they hav esomething in the suit storage slot we want to reequip it afterwards. + for(var/location in affected_slots) //Loading the clothing that they're wearing so we can drop it. + var/I = get_equipped_item(location) + unEquip(I) //Drop the equipment. + user.replace_in_slot(new /obj/item/clothing/shoes/occultgreaves, slot_shoes, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/suit/space/occultist, slot_wear_suit, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/gloves/occultgloves, slot_gloves, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/head/helmet/space/occulthood, slot_head, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + if(suitequipment) //If they had something on their back previously, this will be true. Otherwise, nope. + user.equip_to_slot_if_possible(suitequipment, slot_s_store) /mob/living/carbon/human/proc/Hpsi_armor() set category = "Psionic powers" set name = "Durable shell (8)" - set desc = "Creates a set of very strong armor, using your mind and the environment as the material. Each piece of armor replaces the clothes you are already wearing, and provides additional strength to your body, in exchange for your psionic abilities." + set desc = "Creates a set of very strong armor, using your mind and the environment as the material. your clothes wil be discarded on the floor. Each piece of armor provides additional strength to your body, in exchange for your psionic abilities." var/psi_point_cost = 8 var/mob/living/carbon/human/user = src var/obj/item/organ/internal/psionic_tumor/PT = user.first_organ_by_process(BP_PSION) if(PT && PT.pay_power_cost(psi_point_cost) && PT.check_possibility()) + var/list/affected_slots = list(slot_shoes, slot_wear_suit, slot_gloves, slot_head) playsound(usr.loc, pick('sound/mecha/lowpower.ogg','sound/effects/magic/Blind.ogg','sound/effects/phasein.ogg'), 50, 1, -3) user.visible_message( - SPAN_DANGER("[src]'s Flesh and clothing merge together, tiny crumbs, small objects, streams of thoughts and ideas are pulled together to them, forming on their body a solid armor woven from matter itself, held together by only one will of the psion!"), - SPAN_DANGER("Your flesh and clothes, the surrounding space and the thoughts of others are put together, forming a massive obsidian armor on your body!") + SPAN_DANGER("[src]'s clothes fall away as a shimmering aura surrounds them for a moment, fading to reveal a shiny, black suit of solid obsidian armor!"), + SPAN_DANGER("Your clothing falls away as a shimmering aura surrounds your body, solidifying into a slick, black suit of obsidian armor!") ) - user.replace_in_slot(new /obj/item/clothing/shoes/occultHgreaves, slot_shoes, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/gloves/occultHgloves, slot_gloves, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/suit/space/occulHtist, slot_wear_suit, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/head/helmet/space/occultHhood, slot_head, skip_covering_check = TRUE) + var/obj/item/suitequipment = get_equipped_item(slot_s_store) + for(var/location in affected_slots) + var/I = get_equipped_item(location) + unEquip(I) + user.replace_in_slot(new /obj/item/clothing/shoes/occultHgreaves, slot_shoes, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/gloves/occultHgloves, slot_gloves, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/suit/space/occulHtist, slot_wear_suit, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/head/helmet/space/occultHhood, slot_head, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + if(suitequipment) + user.equip_to_slot_if_possible(suitequipment, slot_s_store) /mob/living/carbon/human/proc/Light_psi_armor() set category = "Psionic powers" set name = "Void robe (6)" - set desc = "When applied, it creates an ultra-light protected cloak, spurring the wearer to new adventures in the kingdom of the king of dreams! Each part of the kit enhances the psion's thinking abilities and accelerates his step." + set desc = "When applied, it creates an ultra-light protected cloak, spurring the wearer to new adventures in the kingdom of the king of dreams! Each part of the kit enhances the psion's thinking abilities and accelerates his step. your current clothing will be discarded on the floor." var/psi_point_cost = 6 var/mob/living/carbon/human/user = src var/obj/item/organ/internal/psionic_tumor/PT = user.first_organ_by_process(BP_PSION) if(PT && PT.pay_power_cost(psi_point_cost) && PT.check_possibility()) + var/list/affected_slots = list(slot_shoes, slot_wear_suit, slot_gloves, slot_head) playsound(usr.loc, pick('sound/mecha/lowpower.ogg','sound/effects/magic/Blind.ogg','sound/hallucinations/i_see_you2.ogg','sound/effects/phasein.ogg'), 50, 1, 1, -3) user.visible_message( - SPAN_DANGER("[src]'s Flesh and clothing merge together, tiny crumbs, small objects, streams of thoughts and ideas are pulled together to them, forming on their body a solid armor woven from matter itself, held together by only one will of the psion!"), - SPAN_DANGER("Your flesh and clothes, the surrounding space and the thoughts of others are put together, forming a massive obsidian armor on your body!") + SPAN_DANGER("[src]'s clothes fall away as a shimmering aura surrounds them for a moment, fading to reveal a shimmering cloak of psionic metamaterial!"), + SPAN_DANGER("Your clothing falls away as a shimmering aura surrounds your body, solidifying into a shimmering cloak of psionic metamaterial!") ) - user.replace_in_slot(new /obj/item/clothing/shoes/occultLgreaves, slot_shoes, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/gloves/occultLgloves, slot_gloves, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/suit/space/occulLtist, slot_wear_suit, skip_covering_check = TRUE) - user.replace_in_slot(new /obj/item/clothing/head/helmet/space/occultLhood, slot_head, skip_covering_check = TRUE) + var/obj/item/suitequipment = get_equipped_item(slot_s_store) + for(var/location in affected_slots) + var/I = get_equipped_item(location) + unEquip(I) + user.replace_in_slot(new /obj/item/clothing/shoes/occultLgreaves, slot_shoes, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/gloves/occultLgloves, slot_gloves, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/suit/space/occulLtist, slot_wear_suit, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + user.replace_in_slot(new /obj/item/clothing/head/helmet/space/occultLhood, slot_head, drop_if_unable_to_store = TRUE, skip_covering_check = TRUE) + if(suitequipment) + user.equip_to_slot_if_possible(suitequipment, slot_s_store)