diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index a0de9b5f76..e28c916ae4 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -390,7 +390,7 @@ desc = "A chainsaw that has replaced your arm." icon_state = "chainsaw_on" item_state = "mounted_chainsaw" - flags = NODROP | ABSTRACT + flags = NODROP | ABSTRACT | DROPDEL w_class = WEIGHT_CLASS_HUGE force = 21 throwforce = 0 @@ -400,10 +400,17 @@ attack_verb = list("sawed", "torn", "cut", "chopped", "diced") hitsound = 'sound/weapons/chainsawhit.ogg' -/obj/item/weapon/mounted_chainsaw/dropped() - ..() +/obj/item/weapon/mounted_chainsaw/Destroy() + var/obj/item/bodypart/part new /obj/item/weapon/twohanded/required/chainsaw(get_turf(src)) - qdel(src) + if(iscarbon(loc)) + var/mob/living/carbon/holder = loc + var/index = holder.get_held_index_of_item(src) + if(index) + part = holder.hand_bodyparts[index] + . = ..() + if(part) + part.drop_limb() /obj/item/weapon/statuebust name = "bust" diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 331fc5fc95..77ac31812a 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -142,10 +142,12 @@ return not_handled //For future deeper overrides /mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) + var/index = get_held_index_of_item(I) . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. if(!. || !I) return - + if(index && dna.species.mutanthands) + put_in_hand(new dna.species.mutanthands(), index) if(I == wear_suit) if(s_store && invdrop) dropItemToGround(s_store, TRUE) //It makes no sense for your suit storage to stay on you if you drop your suit. diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index a48124e412..f6afab36f1 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -143,15 +143,16 @@ qdel(lungs) lungs = null - if(eyes) - qdel(eyes) - eyes = new mutanteyes - eyes.Insert(C) + if(C.get_bodypart("head")) + if(eyes) + qdel(eyes) + eyes = new mutanteyes + eyes.Insert(C) - if(ears) - qdel(ears) - ears = new mutantears - ears.Insert(C) + if(ears) + qdel(ears) + ears = new mutantears + ears.Insert(C) if((!(NOBREATH in species_traits)) && !lungs) if(mutantlungs) diff --git a/code/modules/mob/living/carbon/human/species.dm.rej b/code/modules/mob/living/carbon/human/species.dm.rej new file mode 100644 index 0000000000..25968a6a31 --- /dev/null +++ b/code/modules/mob/living/carbon/human/species.dm.rej @@ -0,0 +1,33 @@ +diff a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm (rejected hunks) +@@ -173,14 +173,18 @@ + if(exotic_bloodtype && C.dna.blood_type != exotic_bloodtype) + C.dna.blood_type = exotic_bloodtype + ++ if(old_species.mutanthands) ++ for(var/obj/item/I in C.held_items) ++ if(istype(I, old_species.mutanthands)) ++ qdel(I) ++ + if(mutanthands) + // Drop items in hands + // If you're lucky enough to have a NODROP item, then it stays. + for(var/V in C.held_items) + var/obj/item/I = V + if(istype(I)) +- if(C.dropItemToGround(I)) +- C.put_in_hands(new mutanthands()) ++ C.dropItemToGround(I) + else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand + C.put_in_hands(new mutanthands()) + +@@ -189,10 +193,6 @@ + C.dna.blood_type = random_blood_type() + if(DIGITIGRADE in species_traits) + C.Digitigrade_Leg_Swap(TRUE) +- if(mutanthands) +- for(var/obj/item/I in C.held_items) +- if(istype(I, mutanthands)) +- qdel(I) + + /datum/species/proc/handle_hair(mob/living/carbon/human/H, forced_colour) + H.remove_overlay(HAIR_LAYER) diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index 573b58159a..aef4aaaab5 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -13,6 +13,7 @@ name = "Infectious Zombie" id = "memezombies" limbs_id = "zombie" + mutanthands = /obj/item/zombie_hand no_equip = list(slot_wear_mask, slot_head) armor = 20 // 120 damage to KO a zombie, which kills it speedmod = 2 @@ -27,29 +28,15 @@ /datum/species/zombie/infectious/on_species_gain(mob/living/carbon/C, datum/species/old_species) . = ..() - // Drop items in hands - // If you're a zombie lucky enough to have a NODROP item, then it stays. - for(var/V in C.held_items) - var/obj/item/I = V - if(istype(I)) - if(C.dropItemToGround(I)) - var/obj/item/zombie_hand/zh = new /obj/item/zombie_hand() - C.put_in_hands(zh) - else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand - var/obj/item/zombie_hand/zh = new /obj/item/zombie_hand() - C.put_in_hands(zh) - // Next, deal with the source of this zombie corruption + // Deal with the source of this zombie corruption + // Infection organ needs to be handled separately from mutant_organs + // because it persists through species transitions var/obj/item/organ/zombie_infection/infection infection = C.getorganslot("zombie_infection") if(!infection) - infection = new(C) - -/datum/species/zombie/infectious/on_species_loss(mob/living/carbon/C) - . = ..() - for(var/obj/item/I in C.held_items) - if(istype(I, /obj/item/zombie_hand)) - qdel(I) + infection = new() + infection.Insert(C) // Your skin falls off diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index c25a1d050d..0b388ee7b4 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -1533,7 +1533,9 @@ /datum/reagent/romerol/on_mob_life(mob/living/carbon/human/H) // Silently add the zombie infection organ to be activated upon death - new /obj/item/organ/zombie_infection(H) + if(!H.getorganslot("zombie_infection")) + var/obj/item/organ/zombie_infection/ZI = new() + ZI.Insert(H) ..() /datum/reagent/growthserum diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index de8c2b79ac..c8f0ade4b8 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -254,6 +254,8 @@ if(held_index > C.hand_bodyparts.len) C.hand_bodyparts.len = held_index C.hand_bodyparts[held_index] = src + if(C.dna.species.mutanthands && !is_pseudopart) + C.put_in_hand(new C.dna.species.mutanthands(), held_index) if(C.hud_used) var/obj/screen/inventory/hand/hand = C.hud_used.hand_slots["[held_index]"] if(hand) @@ -269,6 +271,9 @@ qdel(S) break + for(var/obj/item/organ/O in contents) + O.Insert(C) + update_bodypart_damage_state() C.updatehealth() diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index b054626f4e..0f9a6489dd 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -58,9 +58,9 @@ user.visible_message("[user] successfully replaces [target]'s [parse_zone(target_zone)]!", "You succeed in replacing [target]'s [parse_zone(target_zone)].") return 1 else - target.regenerate_limb(target_zone) - var/obj/item/bodypart/L = target.get_bodypart(target_zone) + var/obj/item/bodypart/L = target.newBodyPart(target_zone, FALSE, FALSE) L.is_pseudopart = TRUE + L.attach_limb(target) user.visible_message("[user] finishes attaching [tool]!", "You attach [tool].") qdel(tool) if(istype(tool, /obj/item/weapon/twohanded/required/chainsaw)) diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index 1bdbd3fa45..1b93a4f685 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -46,7 +46,8 @@ var/obj/item/organ/zombie_infection/infection infection = target.getorganslot("zombie_infection") if(!infection) - infection = new(target) + infection = new() + infection.Insert(target) /obj/item/zombie_hand/proc/check_feast(mob/living/target, mob/living/user) if(target.stat == DEAD) diff --git a/code/modules/zombie/organs.dm b/code/modules/zombie/organs.dm index 295d774595..28e6d9499f 100644 --- a/code/modules/zombie/organs.dm +++ b/code/modules/zombie/organs.dm @@ -5,7 +5,7 @@ slot = "zombie_infection" icon_state = "blacktumor" origin_tech = "biotech=5" - var/datum/species/old_species + var/datum/species/old_species = /datum/species/human var/living_transformation_time = 3 var/converts_living = FALSE @@ -63,6 +63,7 @@ if(!iszombie(owner)) old_species = owner.dna.species.type + owner.set_species(/datum/species/zombie/infectious) if(!converts_living && owner.stat != DEAD) return @@ -70,7 +71,6 @@ var/stand_up = (owner.stat == DEAD) || (owner.stat == UNCONSCIOUS) owner.grab_ghost() - owner.set_species(/datum/species/zombie/infectious) owner.revive(full_heal = TRUE) owner.visible_message("[owner] suddenly convulses, as [owner.p_they()][stand_up ? " stagger to [owner.p_their()] feet and" : ""] gain a ravenous hunger in [owner.p_their()] eyes!", "You HUNGER!") playsound(owner.loc, 'sound/hallucinations/far_noise.ogg', 50, 1)