Zombie/limb refactors/fixes

This commit is contained in:
CitadelStationBot
2017-04-28 21:05:06 -05:00
parent a39b40d879
commit daeba2eec7
10 changed files with 76 additions and 38 deletions
@@ -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.
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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()
@@ -58,9 +58,9 @@
user.visible_message("[user] successfully replaces [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You succeed in replacing [target]'s [parse_zone(target_zone)].</span>")
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]!", "<span class='notice'>You attach [tool].</span>")
qdel(tool)
if(istype(tool, /obj/item/weapon/twohanded/required/chainsaw))
+2 -1
View File
@@ -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)
+2 -2
View File
@@ -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("<span class='danger'>[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!</span>", "<span class='alien'>You HUNGER!</span>")
playsound(owner.loc, 'sound/hallucinations/far_noise.ogg', 50, 1)