From c0465614da2f80557d15c3f1c8053bfced4a0096 Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Thu, 16 Aug 2012 17:13:28 +0000 Subject: [PATCH] - Mutantraces are no longer a variable tied to human mobs, but rather a variable tied to dna. As such, changelings who absorb people with a mutantrace will now transform back into the mutantrace when they transform into their DNA. - Fixed issue 784. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4440 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/datumvars.dm | 5 ++-- code/game/dna.dm | 1 + code/game/machinery/bots/ed209bot.dm | 2 +- code/game/machinery/bots/secbot.dm | 2 +- code/game/machinery/cloning.dm | 5 ++-- code/game/machinery/computer/cloning.dm | 5 +++- code/game/machinery/hydroponics.dm | 3 +- code/modules/chemical/Chemistry-Reagents.dm | 5 ++-- .../living/carbon/human/human_attackhand.dm | 15 +++++----- .../mob/living/carbon/human/human_defines.dm | 2 -- code/modules/mob/living/carbon/human/life.dm | 17 ++++++----- code/modules/mob/living/carbon/human/say.dm | 27 ++++++++--------- .../mob/living/carbon/human/update_icons.dm | 29 ++++++++++--------- .../modules/mob/living/carbon/metroid/life.dm | 5 ++-- code/modules/mob/living/silicon/ai/ai.dm | 4 +-- code/modules/projectiles/projectile/change.dm | 5 ++-- .../modules/projectiles/projectile/special.dm | 4 +-- 17 files changed, 74 insertions(+), 62 deletions(-) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 3317d9a903..cad8f8518d 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -735,8 +735,9 @@ client if(!H || !istype(H)) usr << "Mob doesn't exist anymore" return - H.mutantrace = new_mutantrace - H.update_mutantrace() + if(H.dna) + H.dna.mutantrace = new_mutantrace + H.update_mutantrace() else if (href_list["regenerateicons"]) var/mob/M = locate(href_list["regenerateicons"]) if(!istype(M)) diff --git a/code/game/dna.dm b/code/game/dna.dm index 1ede0cf37e..7b179393bf 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -4,6 +4,7 @@ var/struc_enzymes = null var/uni_identity = null var/b_type = "A+" + var/mutantrace = null //The type of mutant race the player is if applicable (i.e. potato-man) /datum/dna/proc/check_integrity(var/mob/living/carbon/human/character) if(character) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index a58380d445..95d0c9d751 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -679,7 +679,7 @@ Auto Patrol: []"}, if(istype(perp:wear_suit, /obj/item/clothing/suit/wizrobe)) threatcount += 2 - if(perp.mutantrace && perp.mutantrace != "none") + if(perp.dna && perp.dna.mutantrace && perp.dna.mutantrace != "none") threatcount += 2 //Agent cards lower threatlevel when normal idchecking is off. diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 61362d1751..564b4a5e06 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -611,7 +611,7 @@ Auto Patrol: []"}, if(istype(perp:wear_suit, /obj/item/clothing/suit/wizrobe)) threatcount += 2 - if(perp.mutantrace && perp.mutantrace != "none") + if(perp.dna && perp.dna.mutantrace && perp.dna.mutantrace != "none") threatcount += 2 //Agent cards lower threatlevel. diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index d7996fe028..a4888e6622 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -191,8 +191,9 @@ H.f_style = "Shaved" H.h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3") - H.mutantrace = mrace - H.update_mutantrace() + if(H.dna) + H.dna.mutantrace = mrace + H.update_mutantrace() H.suiciding = 0 src.attempting = 0 return 1 diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 6d7af7bdcd..3ac1bc2490 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -419,7 +419,10 @@ subject.dna.check_integrity() var/datum/data/record/R = new /datum/data/record( ) - R.fields["mrace"] = subject.mutantrace + if(subject.dna) + R.fields["mrace"] = subject.dna.mutantrace + else + R.fields["mrace"] = null R.fields["ckey"] = subject.ckey R.fields["name"] = subject.real_name R.fields["id"] = copytext(md5(subject.real_name), 2, 6) diff --git a/code/game/machinery/hydroponics.dm b/code/game/machinery/hydroponics.dm index b1a8885c5d..716f33c029 100644 --- a/code/game/machinery/hydroponics.dm +++ b/code/game/machinery/hydroponics.dm @@ -916,7 +916,8 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) if(se) podman.dna.struc_enzymes = se if(!prob(potency)) //if it fails, plantman! - podman.mutantrace = "plant" + if(podman.dna) + podman.dna.mutantrace = "plant" podman.update_mutantrace() else //else, one packet of seeds. maybe two diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index b008e11669..ed380ac867 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -1053,8 +1053,9 @@ datum C.adjustToxLoss(2) // 4 toxic damage per application, doubled for some reason if(ishuman(M)) var/mob/living/carbon/human/H = M - if(H.mutantrace == "plant") //plantmen take a LOT of damage - H.adjustToxLoss(10) + if(H.dna) + if(H.dna.mutantrace == "plant") //plantmen take a LOT of damage + H.adjustToxLoss(10) plasma name = "Plasma" diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 8ba29ba87f..26c17b993a 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -127,13 +127,14 @@ var/attack_verb - switch(M.mutantrace) - if("lizard") - attack_verb = "scratch" - if("plant") - attack_verb = "slash" - else - attack_verb = "punch" + if(M.dna) + switch(M.dna.mutantrace) + if("lizard") + attack_verb = "scratch" + if("plant") + attack_verb = "slash" + else + attack_verb = "punch" var/damage = rand(0, 9) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 8eb2963bac..c593b32b1d 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -43,8 +43,6 @@ var/icon/stand_icon = null var/icon/lying_icon = null - var/mutantrace = null //The type of mutant race the player is if applicable (i.e. potato-man) - var/list/organs = list() var/miming = null //Toggle for the mime's abilities. diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c9fce0a453..aaf4c1ba9f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -726,7 +726,7 @@ proc/handle_chemicals_in_body() if(reagents) reagents.metabolize(src) - if(mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist + if(dna && dna.mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing if(istype(loc,/turf)) //else, there's considered to be no light light_amount = min(10,loc:sd_lumcount) - 5 //hardcapped so it's not abused by having a ton of flashlights @@ -768,7 +768,7 @@ if(overeatduration > 1) overeatduration -= 2 //doubled the unfat rate - if(mutantrace == "plant") + if(dna && dna.mutantrace == "plant") if(nutrition < 200) take_overall_damage(2,0) @@ -934,12 +934,13 @@ if(healths) healths.icon_state = "health7" //DEAD healthmeter else sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) - switch(mutantrace) - if("lizard","metroid") - see_in_dark = 3 - see_invisible = SEE_INVISIBLE_LEVEL_ONE - else - see_in_dark = 2 + if(dna) + switch(dna.mutantrace) + if("lizard","metroid") + see_in_dark = 3 + see_invisible = SEE_INVISIBLE_LEVEL_ONE + else + see_in_dark = 2 if(XRAY in mutations) sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 141ed27a6a..92ff74bd2c 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -16,20 +16,21 @@ if (copytext(message, 1, 2) != "*") return - if(src.mutantrace == "lizard") - if(copytext(message, 1, 2) != "*") - message = dd_replacetext(message, "s", stutter("ss")) + if(src.dna) + if(src.dna.mutantrace == "lizard") + if(copytext(message, 1, 2) != "*") + message = dd_replacetext(message, "s", stutter("ss")) - if(src.mutantrace == "metroid" && prob(5)) - if(copytext(message, 1, 2) != "*") - if(copytext(message, 1, 2) == ";") - message = ";" - else - message = "" - message += "SKR" - var/imax = rand(5,20) - for(var/i = 0,i 0) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index d37e58b675..7aeaf725de 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -401,12 +401,12 @@ L[A.name] = list(A, (C) ? C : O, list(alarmsource)) if (O) if (C && C.status) - src << text("--- [] alarm detected in []! ([])", class, A.name, src, C, C.c_tag) + src << "--- [class] alarm detected in [A.name]! ([C.c_tag])" else if (CL && CL.len) var/foo = 0 var/dat2 = "" for (var/obj/machinery/camera/I in CL) - dat2 += text("[][]", (!foo) ? "" : " | ", src, I, I.c_tag) + dat2 += text("[][]", (!foo) ? "" : " | ", src, I, I.c_tag) //I'm not fixing this shit... foo = 1 src << text ("--- [] alarm detected in []! ([])", class, A.name, dat2) else diff --git a/code/modules/projectiles/projectile/change.dm b/code/modules/projectiles/projectile/change.dm index 2767689eb4..4d4490ab4c 100644 --- a/code/modules/projectiles/projectile/change.dm +++ b/code/modules/projectiles/projectile/change.dm @@ -72,8 +72,9 @@ var/datum/preferences/A = new() //Randomize appearance for the human A.randomize_appearance_for(new_mob) - var/mob/living/carbon/human/Human = new_mob - Human.mutantrace = pick("lizard","golem","metroid","plant",4;"") + var/mob/living/carbon/human/H = new_mob + if(H.dna) + H.dna.mutantrace = pick("lizard","golem","metroid","plant",4;"") else return diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index e6d2ee27e0..e9b64f7cc0 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -49,7 +49,7 @@ on_hit(var/atom/target, var/blocked = 0) var/mob/living/M = target - if(istype(target, /mob/living/carbon/human) && M:mutantrace == "plant") //Plantmen possibly get mutated and damaged by the rays. + if(ishuman(target) && M.dna && M.dna.mutantrace == "plant") //Plantmen possibly get mutated and damaged by the rays. var/mob/living/L as mob if(prob(15)) L.apply_effect((rand(30,80)),IRRADIATE) @@ -87,7 +87,7 @@ on_hit(var/atom/target, var/blocked = 0) var/mob/M = target - if(istype(target, /mob/living/carbon/human) && M:mutantrace == "plant") //These rays make plantmen fat. + if(ishuman(target) && M.dna && M.dna.mutantrace == "plant") //These rays make plantmen fat. if(M.nutrition < 500) //sanity check M.nutrition += 30 else if (istype(target, /mob/living/carbon/))