mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 10:04:30 +01:00
Quirk "quadruple amputee" now will return your original limbs back if you off it (#90745)
## About The Pull Request Then you try to remove quirk - your limbs didn't change back to normal **Visual bug only**, originally found on downstream. Also confirmed on up-to-date TG-localhost  ## Why It's Good For The Game Bug-Fix always good ## Changelog 🆑 fix: Quirk "quadruple amputee" now will return your original limbs back if you off it qol: Quirk "prosthetic limb" now resets more correctly /🆑 --------- Co-authored-by: Maximal08 <73069825+Maximal08@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -8,24 +8,26 @@
|
||||
mail_goodies = list(/obj/item/weldingtool/mini, /obj/item/stack/cable_coil/five)
|
||||
/// The slot to replace, in string form
|
||||
var/slot_string = "limb"
|
||||
/// the original limb from before the prosthetic was applied
|
||||
var/obj/item/bodypart/old_limb
|
||||
/// The slot to replace, in GLOB.limb_zones (both arms and both legs)
|
||||
var/limb_zone
|
||||
|
||||
|
||||
/datum/quirk_constant_data/prosthetic_limb
|
||||
associated_typepath = /datum/quirk/prosthetic_limb
|
||||
customization_options = list(/datum/preference/choiced/prosthetic)
|
||||
|
||||
/datum/quirk/prosthetic_limb/add_unique(client/client_source)
|
||||
var/limb_type = GLOB.prosthetic_limb_choice[client_source?.prefs?.read_preference(/datum/preference/choiced/prosthetic)]
|
||||
var/obj/item/bodypart/limb_type = GLOB.prosthetic_limb_choice[client_source?.prefs?.read_preference(/datum/preference/choiced/prosthetic)]
|
||||
if(isnull(limb_type)) //Client gone or they chose a random prosthetic
|
||||
limb_type = GLOB.prosthetic_limb_choice[pick(GLOB.prosthetic_limb_choice)]
|
||||
limb_zone = limb_type.body_zone
|
||||
|
||||
var/mob/living/carbon/human/human_holder = quirk_holder
|
||||
var/obj/item/bodypart/surplus = new limb_type()
|
||||
slot_string = "[surplus.plaintext_zone]"
|
||||
|
||||
medical_record_text = "Patient uses a low-budget prosthetic on the [slot_string]."
|
||||
old_limb = human_holder.return_and_replace_bodypart(surplus, special = TRUE)
|
||||
human_holder.del_and_replace_bodypart(surplus, special = TRUE)
|
||||
|
||||
/datum/quirk/prosthetic_limb/post_add()
|
||||
to_chat(quirk_holder, span_bolddanger("Your [slot_string] has been replaced with a surplus prosthetic. It has almost no muscle force, and makes you unhealthier by just having it. Additionally, \
|
||||
@@ -33,5 +35,4 @@
|
||||
|
||||
/datum/quirk/prosthetic_limb/remove()
|
||||
var/mob/living/carbon/human/human_holder = quirk_holder
|
||||
human_holder.del_and_replace_bodypart(old_limb, special = TRUE)
|
||||
old_limb = null
|
||||
human_holder.reset_to_original_bodypart(limb_zone)
|
||||
|
||||
@@ -18,3 +18,13 @@
|
||||
/datum/quirk/quadruple_amputee/post_add()
|
||||
to_chat(quirk_holder, span_bolddanger("All your limbs have been replaced with surplus prosthetics. They are fragile and will easily come apart under duress. \
|
||||
Additionally, you need to use a welding tool and cables to repair them, instead of bruise packs and ointment."))
|
||||
|
||||
/datum/quirk/quadruple_amputee/remove()
|
||||
if(QDELING(quirk_holder))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/human_holder = quirk_holder
|
||||
human_holder.reset_to_original_bodypart(BODY_ZONE_L_ARM)
|
||||
human_holder.reset_to_original_bodypart(BODY_ZONE_R_ARM)
|
||||
human_holder.reset_to_original_bodypart(BODY_ZONE_L_LEG)
|
||||
human_holder.reset_to_original_bodypart(BODY_ZONE_R_LEG)
|
||||
|
||||
@@ -29,6 +29,24 @@
|
||||
new_limb.try_attach_limb(src, special = special)
|
||||
return old_limb // can be null
|
||||
|
||||
/// Replaces the chosen limb(zone) to the original one
|
||||
/mob/living/carbon/proc/reset_to_original_bodypart(limb_zone)
|
||||
if (!(limb_zone in GLOB.all_body_zones))
|
||||
stack_trace("Invalid zone [limb_zone] provided to reset_to_original_bodypart()")
|
||||
return
|
||||
|
||||
// find old limb to del it first
|
||||
var/obj/item/bodypart/old_limb = get_bodypart(limb_zone)
|
||||
if(old_limb)
|
||||
old_limb.drop_limb(special = TRUE)
|
||||
qdel(old_limb)
|
||||
|
||||
// mаke and attach the original limb
|
||||
var/obj/item/bodypart/original_limb = newBodyPart(limb_zone)
|
||||
original_limb.try_attach_limb(src, TRUE)
|
||||
original_limb.update_limb(is_creating = TRUE)
|
||||
regenerate_icons()
|
||||
|
||||
/mob/living/carbon/has_hand_for_held_index(i)
|
||||
if(!i)
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user