From 8b71b7d106c58c67bdcf30c9c1b8441c660ce581 Mon Sep 17 00:00:00 2001 From: Ater Ignis Date: Sat, 10 Nov 2012 14:12:25 +0400 Subject: [PATCH] updated DNA code to have more mutations --- code/game/atoms.dm | 7 + code/game/dna.dm | 255 ++++++++++++------ code/global.dm | 20 ++ .../mob/living/carbon/amorph/amorph.dm | 2 +- .../mob/living/carbon/human/examine.dm | 2 + code/modules/mob/living/carbon/human/human.dm | 127 +++++++++ .../mob/living/carbon/human/human_movement.dm | 3 + code/modules/mob/living/carbon/human/life.dm | 57 +++- code/modules/mob/living/living.dm | 2 + code/setup.dm | 15 ++ 10 files changed, 399 insertions(+), 91 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 3d9130adce0..8187ca46277 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -335,6 +335,7 @@ its easier to just keep the beam vertical. /atom/proc/add_fingerprint(mob/living/M as mob) if(isnull(M)) return + if(isAI(M)) return if(isnull(M.key)) return if (!( src.flags ) & FPRINT) return @@ -344,6 +345,12 @@ its easier to just keep the beam vertical. fingerprintshidden = list() //Fibers~ add_fibers(M) + //He has no prints! + if (mFingerprints in M.mutations) + if(fingerprintslast != M.key) + fingerprintshidden += "(Has no fingerprints) Real name: [M.real_name], Key: [M.key]" + fingerprintslast = M.key + return 0 //Now, lets get to the dirty work. //First, make sure their DNA makes sense. var/mob/living/carbon/human/H = M diff --git a/code/game/dna.dm b/code/game/dna.dm index eec31a2565c..1af645e2942 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -56,9 +56,9 @@ temp += add_zero2(num2hex((hair),1), 3) uni_identity = temp - if(length(struc_enzymes)!= 42) + if(length(struc_enzymes)!= 3*STRUCDNASIZE) var/mutstring = "" - for(var/i = 1, i <= 13, i++) + for(var/i = 1, i <= STRUCDNASIZE, i++) mutstring += add_zero2(num2hex(rand(1,1024)),3) struc_enzymes = mutstring @@ -66,7 +66,7 @@ unique_enzymes = md5(character.real_name) else if(length(uni_identity) != 39) uni_identity = "00600200A00E0110148FC01300B0095BD7FD3F4" - if(length(struc_enzymes)!= 42) struc_enzymes = "0983E840344C39F4B059D5145FC5785DC6406A4000" + if(length(struc_enzymes)!= 3*STRUCDNASIZE) struc_enzymes = "43359156756131E13763334D1C369012032164D4FE4CD61544B6C03F251B6C60A42821D26BA3B0FD6" /datum/dna/proc/ready_dna(mob/living/carbon/human/character) var/temp @@ -268,12 +268,12 @@ else return 0 - if (bnumber == HULKBLOCK || bnumber == TELEBLOCK) + if (bnumber == HULKBLOCK || bnumber == TELEBLOCK || bnumber == NOBREATHBLOCK || bnumber == NOPRINTSBLOCK || bnumber == SMALLSIZEBLOCK || bnumber == SHOCKIMMUNITYBLOCK) if (temp2 >= 3500 + BLOCKADD) return 1 else return 0 - if (bnumber == XRAYBLOCK || bnumber == FIREBLOCK) + if (bnumber == XRAYBLOCK || bnumber == FIREBLOCK || bnumber == REMOTEVIEWBLOCK || bnumber == REGENERATEBLOCK || bnumber == INCREASERUNBLOCK || bnumber == REMOTETALKBLOCK || bnumber == MORPHBLOCK) if (temp2 >= 3050 + BLOCKADD) return 1 else @@ -285,11 +285,14 @@ else return 0 +/proc/ismuton(var/block,var/mob/M) + return isblockon(getblock(M.dna.struc_enzymes, block,3),block) + /proc/randmutb(mob/M as mob) if(!M) return var/num var/newdna - num = pick(1,3,FAKEBLOCK,5,CLUMSYBLOCK,7,9,BLINDBLOCK,DEAFBLOCK) + num = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK) M.dna.check_integrity() newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) M.dna.struc_enzymes = newdna @@ -299,7 +302,7 @@ if(!M) return var/num var/newdna - num = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK) + num = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK) M.dna.check_integrity() newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3) M.dna.struc_enzymes = newdna @@ -309,13 +312,13 @@ if(!M) return M.dna.check_integrity() if(type) - for(var/i = 1, i <= 13, i++) + for(var/i = 1, i <= STRUCDNASIZE-1, i++) if(prob(p)) M.dna.uni_identity = setblock(M.dna.uni_identity, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) updateappearance(M, M.dna.uni_identity) else - for(var/i = 1, i <= 13, i++) + for(var/i = 1, i <= STRUCDNASIZE-1, i++) if(prob(p)) M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3) domutcheck(M, null) @@ -325,7 +328,7 @@ if(!M) return var/num var/newdna - num = pick(1,2,3,4,5,6,7,8,9,10,11,12,13) + num = rand(1,STRUCDNASIZE-1) M.dna.check_integrity() newdna = setblock(M.dna.uni_identity,num,add_zero2(num2hex(rand(1,4095),1),3),3) M.dna.uni_identity = newdna @@ -383,32 +386,77 @@ else return 0 +/proc/probinj(var/pr, var/inj) + return prob(pr+inj*pr) + /proc/domutcheck(mob/living/M as mob, connected, inj) - //telekinesis = 1 - //firemut = 2 - //xray = 4 - //hulk = 8 - //clumsy = 16 + if (!M) return + M.dna.check_integrity() M.disabilities = 0 - M.sdisabilities = 0 + var/old_mutations = M.mutations M.mutations = list() M.see_in_dark = 2 - M.see_invisible = SEE_INVISIBLE_LIVING + M.see_invisible = 0 - if (isblockon(getblock(M.dna.struc_enzymes, 1,3),1)) - M.disabilities |= NEARSIGHTED - M << "\red Your eyes feel strange." - if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),2)) - if(inj || prob(10)) + + if(ismuton(NOBREATHBLOCK,M)) + if(probinj(45,inj) || (mNobreath in old_mutations)) + M << "\blue You feel no need to breathe." + M.mutations.Add(mNobreath) + if(ismuton(REMOTEVIEWBLOCK,M)) + if(probinj(45,inj) || (mRemote in old_mutations)) + M << "\blue Your mind expands" + M.mutations.Add(mRemote) + if(ismuton(REGENERATEBLOCK,M)) + if(probinj(45,inj) || (mRegen in old_mutations)) + M << "\blue You feel strange" + M.mutations.Add(mRegen) + if(ismuton(INCREASERUNBLOCK,M)) + if(probinj(45,inj) || (mRun in old_mutations)) + M << "\blue You feel quick" + M.mutations.Add(mRun) + if(ismuton(REMOTETALKBLOCK,M)) + if(probinj(45,inj) || (mRemotetalk in old_mutations)) + M << "\blue You expand your mind outwards" + M.mutations.Add(mRemotetalk) + if(ismuton(MORPHBLOCK,M)) + if(probinj(45,inj) || (mMorph in old_mutations)) + M.mutations.Add(mMorph) + M << "\blue Your skin feels strange" + if(ismuton(BLENDBLOCK,M)) + if(probinj(45,inj) || (mBlend in old_mutations)) + M.mutations.Add(mBlend) + M << "\blue You feel alone" + if(ismuton(HALLUCINATIONBLOCK,M)) + if(probinj(45,inj) || (mHallucination in old_mutations)) + M.mutations.Add(mHallucination) + M << "\blue Your mind says 'Hello'" + if(ismuton(NOPRINTSBLOCK,M)) + if(probinj(45,inj) || (mFingerprints in old_mutations)) + M.mutations.Add(mFingerprints) + M << "\blue Your fingers feel numb" + if(ismuton(SHOCKIMMUNITYBLOCK,M)) + if(probinj(45,inj) || (mShock in old_mutations)) + M.mutations.Add(mShock) + M << "\blue You feel strange" + if(ismuton(SMALLSIZEBLOCK,M)) + if(probinj(45,inj) || (mSmallsize in old_mutations)) + M << "\blue Your skin feels rubbery" + M.mutations.Add(mSmallsize) + + + + if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),HULKBLOCK)) + if(probinj(5,inj) || (HULK in old_mutations)) M << "\blue Your muscles hurt." M.mutations.Add(HULK) - if (isblockon(getblock(M.dna.struc_enzymes, 3,3),3)) - M.disabilities |= EPILEPSY + if (isblockon(getblock(M.dna.struc_enzymes, HEADACHEBLOCK,3),HEADACHEBLOCK)) + M.disabilities |= 2 M << "\red You get a headache." - if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),4)) + if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),FAKEBLOCK)) M << "\red You feel strange." if (prob(95)) if(prob(50)) @@ -417,40 +465,43 @@ randmuti(M) else randmutg(M) - if (isblockon(getblock(M.dna.struc_enzymes, 5,3),5)) - M.disabilities |= COUGHING + if (isblockon(getblock(M.dna.struc_enzymes, COUGHBLOCK,3),COUGHBLOCK)) + M.disabilities |= 4 M << "\red You start coughing." - if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),6)) + if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),CLUMSYBLOCK)) M << "\red You feel lightheaded." M.mutations.Add(CLUMSY) - if (isblockon(getblock(M.dna.struc_enzymes, 7,3),7)) - M.disabilities |= TOURETTES + if (isblockon(getblock(M.dna.struc_enzymes, TWITCHBLOCK,3),TWITCHBLOCK)) + M.disabilities |= 8 M << "\red You twitch." - if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),8)) - if(inj || prob(30)) + if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),XRAYBLOCK)) + if(probinj(30,inj) || (XRAY in old_mutations)) M << "\blue The walls suddenly disappear." M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) M.see_in_dark = 8 - M.see_invisible = SEE_INVISIBLE_LEVEL_TWO + M.see_invisible = 2 M.mutations.Add(XRAY) - if (isblockon(getblock(M.dna.struc_enzymes, 9,3),9)) - M.disabilities |= NERVOUS + if (isblockon(getblock(M.dna.struc_enzymes, NERVOUSBLOCK,3),NERVOUSBLOCK)) + M.disabilities |= 16 M << "\red You feel nervous." - if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),10)) - if(inj || prob(30)) + if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),FIREBLOCK)) + if(probinj(30,inj) || (COLD_RESISTANCE in old_mutations)) M << "\blue Your body feels warm." M.mutations.Add(COLD_RESISTANCE) - if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),11)) - M.sdisabilities |= BLIND + if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),BLINDBLOCK)) + M.disabilities |= 128 M << "\red You can't seem to see anything." - if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),12)) - if(inj || prob(25)) + if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),TELEBLOCK)) + if(probinj(15,inj) || (TK in old_mutations)) M << "\blue You feel smarter." M.mutations.Add(TK) - if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),13)) - M.sdisabilities |= DEAF + if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),DEAFBLOCK)) + M.disabilities |= 32 M.ear_deaf = 1 - M << "\red You can't seem to hear anything..." + M << "\red Its kinda quiet.." + if (isblockon(getblock(M.dna.struc_enzymes, GLASSESBLOCK,3),GLASSESBLOCK)) + M.disabilities |= 1 + M << "Your eyes feel weird..." /* If you want the new mutations to work, UNCOMMENT THIS. if(istype(M, /mob/living/carbon)) @@ -459,7 +510,7 @@ */ //////////////////////////////////////////////////////////// Monkey Block - if (isblockon(getblock(M.dna.struc_enzymes, 14,3),14) && istype(M, /mob/living/carbon/human)) + if (isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && istype(M, /mob/living/carbon/human)) // human > monkey var/mob/living/carbon/human/H = M H.monkeyizing = 1 @@ -529,7 +580,7 @@ del(M) return - if (!isblockon(getblock(M.dna.struc_enzymes, 14,3),14) && !istype(M, /mob/living/carbon/human)) + if (!isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && !istype(M, /mob/living/carbon/human)) // monkey > human, var/mob/living/carbon/monkey/Mo = M Mo.monkeyizing = 1 @@ -897,6 +948,21 @@ onclose(user, "scannernew") return +/obj/machinery/computer/scan_consolenew/proc/all_dna_blocks(var/buffer) + var/list/arr = list() + for(var/i = 1, i <= length(buffer)/3, i++) + arr += "[i]:[copytext(buffer,i*3-2,i*3+1)]" + return arr + +/obj/machinery/computer/scan_consolenew/proc/setInjectorBlock(var/obj/item/weapon/dnainjector/I, var/blk, var/buffer) + var/pos = findtext(blk,":") + if(!pos) return 0 + var/id = text2num(copytext(blk,1,pos)) + if(!id) return 0 + I.block = id + I.dna = copytext(buffer,id*3-2,id*3+1) + return 1 + /obj/machinery/computer/scan_consolenew/Topic(href, href_list) if(..()) return @@ -1135,7 +1201,7 @@ src.temphtml += text("Irradiate
", src) src.delete = 0 if (href_list["strucmenuplus"]) - if (src.strucblock < 14) + if (src.strucblock < STRUCDNASIZE) src.strucblock++ else src.strucblock = 1 @@ -1144,7 +1210,7 @@ if (src.strucblock > 1) src.strucblock-- else - src.strucblock = 14 + src.strucblock = STRUCDNASIZE dopage(src,"strucmenu") if (href_list["strucmenusubplus"]) if (src.subblock < 3) @@ -1161,7 +1227,7 @@ if (href_list["semenuset"] && href_list["semenusubset"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes) var/menuset = text2num(href_list["semenuset"]) var/menusubset = text2num(href_list["semenusubset"]) - if ((menuset <= 14) && (menuset >= 1)) + if ((menuset <= STRUCDNASIZE) && (menuset >= 1)) src.strucblock = menuset if ((menusubset <= 3) && (menusubset >= 1)) src.subblock = menusubset @@ -1191,9 +1257,9 @@ oldblock = src.strucblock block = miniscramble(block, src.radstrength, src.radduration) newblock = null - if (src.strucblock > 1 && src.strucblock < 5) + if (src.strucblock > 1 && src.strucblock < STRUCDNASIZE/2) src.strucblock++ - else if (src.strucblock > 5 && src.strucblock < 14) + else if (src.strucblock > STRUCDNASIZE/2 && src.strucblock < STRUCDNASIZE) src.strucblock-- if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),2,1) + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1) if (src.subblock == 2) newblock = getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),1,1) + block + getblock(getblock(src.connected.occupant.dna.struc_enzymes,src.strucblock,3),3,1) @@ -1236,7 +1302,7 @@ src.temphtml += text("By: []
", src.buffer1owner) src.temphtml += text("Label: []
", src.buffer1label) if (src.connected.occupant && !(NOCLONE in src.connected.occupant.mutations)) src.temphtml += text("Save : UI - UI+UE - SE
", src, src, src) - if (src.buffer1) src.temphtml += text("Transfer to: Occupant - Injector
", src, src) + if (src.buffer1) src.temphtml += text("Transfer to: Occupant - Full Injector - Iso Injector
", src, src, src) //if (src.buffer1) src.temphtml += text("Isolate Block
", src) if (src.buffer1) src.temphtml += "Disk: Save To | Load From
" if (src.buffer1) src.temphtml += text("Edit Label
", src) @@ -1250,7 +1316,7 @@ src.temphtml += text("By: []
", src.buffer2owner) src.temphtml += text("Label: []
", src.buffer2label) if (src.connected.occupant && !(NOCLONE in src.connected.occupant.mutations)) src.temphtml += text("Save : UI - UI+UE - SE
", src, src, src) - if (src.buffer2) src.temphtml += text("Transfer to: Occupant - Injector
", src, src) + if (src.buffer2) src.temphtml += text("Transfer to: Occupant - Full Injector - Iso Injector
", src, src, src) //if (src.buffer2) src.temphtml += text("Isolate Block
", src) if (src.buffer2) src.temphtml += "Disk: Save To | Load From
" if (src.buffer2) src.temphtml += text("Edit Label
", src) @@ -1264,7 +1330,7 @@ src.temphtml += text("By: []
", src.buffer3owner) src.temphtml += text("Label: []
", src.buffer3label) if (src.connected.occupant && !(NOCLONE in src.connected.occupant.mutations)) src.temphtml += text("Save : UI - UI+UE - SE
", src, src, src) - if (src.buffer3) src.temphtml += text("Transfer to: Occupant - Injector
", src, src) + if (src.buffer3) src.temphtml += text("Transfer to: Occupant - Full Injector - Iso Injector
", src, src, src) //if (src.buffer3) src.temphtml += text("Isolate Block
", src) if (src.buffer3) src.temphtml += "Disk: Save To | Load From
" if (src.buffer3) src.temphtml += text("Edit Label
", src) @@ -1443,49 +1509,76 @@ src.delete = 0 if (href_list["b1injector"]) if (src.injectorready) + var/success = 1 var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector - I.dna = src.buffer1 I.dnatype = src.buffer1type - I.loc = src.loc - I.name += " ([src.buffer1label])" - if (src.buffer1iue) I.ue = src.buffer1owner //lazy haw haw - src.temphtml = "Injector created." - src.delete = 0 - src.injectorready = 0 - spawn(300) - src.injectorready = 1 + if(href_list["b1injector"]=="2") + var/blk = input(usr,"Select Block","Block") in all_dna_blocks(src.buffer1) + success = setInjectorBlock(I,blk,src.buffer1) + else + I.dna = src.buffer1 + if(success) + I.loc = src.loc + I.name += " ([src.buffer1label])" + if (src.buffer1iue) I.ue = src.buffer1owner //lazy haw haw + src.temphtml = "Injector created." + src.delete = 0 + src.injectorready = 0 + spawn(300) + src.injectorready = 1 + else + src.temphtml = "Error in injector creation." + src.delete = 0 else src.temphtml = "Replicator not ready yet." src.delete = 0 if (href_list["b2injector"]) if (src.injectorready) + var/success = 1 var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector - I.dna = src.buffer2 I.dnatype = src.buffer2type - I.loc = src.loc - I.name += " ([src.buffer2label])" - if (src.buffer2iue) I.ue = src.buffer2owner //lazy haw haw - src.temphtml = "Injector created." - src.delete = 0 - src.injectorready = 0 - spawn(300) - src.injectorready = 1 + if(href_list["b2injector"]=="2") + var/blk = input(usr,"Select Block","Block") in all_dna_blocks(src.buffer2) + success = setInjectorBlock(I,blk,src.buffer2) + else + I.dna = src.buffer2 + if(success) + I.loc = src.loc + I.name += " ([src.buffer2label])" + if (src.buffer2iue) I.ue = src.buffer2owner //lazy haw haw + src.temphtml = "Injector created." + src.delete = 0 + src.injectorready = 0 + spawn(300) + src.injectorready = 1 + else + src.temphtml = "Error in injector creation." + src.delete = 0 else src.temphtml = "Replicator not ready yet." src.delete = 0 if (href_list["b3injector"]) if (src.injectorready) + var/success = 1 var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector - I.dna = src.buffer3 I.dnatype = src.buffer3type - I.loc = src.loc - I.name += " ([src.buffer3label])" - if (src.buffer3iue) I.ue = src.buffer3owner //lazy haw haw - src.temphtml = "Injector created." - src.delete = 0 - src.injectorready = 0 - spawn(300) - src.injectorready = 1 + if(href_list["b3injector"]=="2") + var/blk = input(usr,"Select Block","Block") in all_dna_blocks(src.buffer3) + success = setInjectorBlock(I,blk,src.buffer3) + else + I.dna = src.buffer3 + if(success) + I.loc = src.loc + I.name += " ([src.buffer3label])" + if (src.buffer3iue) I.ue = src.buffer3owner //lazy haw haw + src.temphtml = "Injector created." + src.delete = 0 + src.injectorready = 0 + spawn(300) + src.injectorready = 1 + else + src.temphtml = "Error in injector creation." + src.delete = 0 else src.temphtml = "Replicator not ready yet." src.delete = 0 diff --git a/code/global.dm b/code/global.dm index 1a734c2af46..e65ce3f1a64 100644 --- a/code/global.dm +++ b/code/global.dm @@ -34,9 +34,29 @@ var/FIREBLOCK = 0 var/XRAYBLOCK = 0 var/CLUMSYBLOCK = 0 var/FAKEBLOCK = 0 +var/COUGHBLOCK = 0 +var/GLASSESBLOCK = 0 +var/EPILEPSYBLOCK = 0 +var/TWITCHBLOCK = 0 +var/NERVOUSBLOCK = 0 +var/MONKEYBLOCK = 27 + var/BLOCKADD = 0 var/DIFFMUT = 0 +var/HEADACHEBLOCK = 0 +var/NOBREATHBLOCK = 0 +var/REMOTEVIEWBLOCK = 0 +var/REGENERATEBLOCK = 0 +var/INCREASERUNBLOCK = 0 +var/REMOTETALKBLOCK = 0 +var/MORPHBLOCK = 0 +var/BLENDBLOCK = 0 +var/HALLUCINATIONBLOCK = 0 +var/NOPRINTSBLOCK = 0 +var/SHOCKIMMUNITYBLOCK = 0 +var/SMALLSIZEBLOCK = 0 + var/skipupdate = 0 /////////////// var/eventchance = 3 //% per 5 mins diff --git a/code/modules/mob/living/carbon/amorph/amorph.dm b/code/modules/mob/living/carbon/amorph/amorph.dm index abc7e52f19a..c2af2ff75d4 100644 --- a/code/modules/mob/living/carbon/amorph/amorph.dm +++ b/code/modules/mob/living/carbon/amorph/amorph.dm @@ -134,7 +134,7 @@ if(istype(M) && M.lying) //Pulling lying down people is slower tally += 3 - if(MINCREASERUN in mutations) + if(mRun in mutations) tally = 0 return tally diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index ae3e1168dba..5a2118aa359 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -193,6 +193,8 @@ if(suiciding) msg += "[t_He] [t_has] bitten off [t_his] own tongue and [t_has] suffered major bloodloss!\n" + if(mSmallsize in mutations) + msg += "[t_He] [t_is] small halfling!\n" var/distance = get_dist(usr,src) if(istype(usr, /mob/dead/observer) || usr.stat == 2) // ghosts can see anything diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 06808c89cc2..860fbec5b2f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -816,3 +816,130 @@ spawn(350) //wait 35 seconds before next volley lastpuke = 0 +/mob/living/carbon/human/proc/morph() + set name = "Morph" + set category = "Superpower" + if(!(mMorph in mutations)) + src.verbs -= /mob/living/carbon/human/proc/morph + return + + var/new_facial = input("Please select facial hair color.", "Character Generation",rgb(r_facial,g_facial,b_facial)) as color + if(new_facial) + r_facial = hex2num(copytext(new_facial, 2, 4)) + g_facial = hex2num(copytext(new_facial, 4, 6)) + b_facial = hex2num(copytext(new_facial, 6, 8)) + + var/new_hair = input("Please select hair color.", "Character Generation",rgb(r_hair,g_hair,b_hair)) as color + if(new_facial) + r_hair = hex2num(copytext(new_hair, 2, 4)) + g_hair = hex2num(copytext(new_hair, 4, 6)) + b_hair = hex2num(copytext(new_hair, 6, 8)) + + var/new_eyes = input("Please select eye color.", "Character Generation",rgb(r_eyes,g_eyes,b_eyes)) as color + if(new_eyes) + r_eyes = hex2num(copytext(new_eyes, 2, 4)) + g_eyes = hex2num(copytext(new_eyes, 4, 6)) + b_eyes = hex2num(copytext(new_eyes, 6, 8)) + + var/new_tone = input("Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", "[35-s_tone]") as text + + if (!new_tone) + new_tone = 35 + s_tone = max(min(round(text2num(new_tone)), 220), 1) + s_tone = -s_tone + 35 + + // hair + var/list/all_hairs = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair + var/list/hairs = list() + + // loop through potential hairs + for(var/x in all_hairs) + var/datum/sprite_accessory/hair/H = new x // create new hair datum based on type x + hairs.Add(H.name) // add hair name to hairs + del(H) // delete the hair after it's all done + + var/new_style = input("Please select hair style", "Character Generation",h_style) as null|anything in hairs + + // if new style selected (not cancel) + if (new_style) + h_style = new_style + + // facial hair + var/list/all_fhairs = typesof(/datum/sprite_accessory/facial_hair) - /datum/sprite_accessory/facial_hair + var/list/fhairs = list() + + for(var/x in all_fhairs) + var/datum/sprite_accessory/facial_hair/H = new x + fhairs.Add(H.name) + del(H) + + new_style = input("Please select facial style", "Character Generation",f_style) as null|anything in fhairs + + if(new_style) + f_style = new_style + + var/new_gender = alert(usr, "Please select gender.", "Character Generation", "Male", "Female") + if (new_gender) + if(new_gender == "Male") + gender = MALE + else + gender = FEMALE + regenerate_icons() + check_dna() + + visible_message("\blue \The [src] morphs and changes [get_visible_gender() == MALE ? "his" : get_visible_gender() == FEMALE ? "her" : "their"] appearance!", "\blue You change your appearance!", "\red Oh, god! What the hell was that? It sounded like flesh getting squished and bone ground into a different shape!") + +/mob/living/carbon/human/proc/remotesay() + set name = "Project mind" + set category = "Superpower" + if(!(mRemotetalk in src.mutations)) + src.verbs -= /mob/living/carbon/human/proc/remotesay + return + var/list/creatures = list() + for(var/mob/living/carbon/h in world) + creatures += h + var/mob/target = input ("Who do you want to project your mind to ?") as null|anything in creatures + if (isnull(target)) + return + + var/say = input ("What do you wish to say") + if(mRemotetalk in target.mutations) + target.show_message("\blue You hear [src.real_name]'s voice: [say]") + else + target.show_message("\blue You hear a voice that seems to echo around the room: [say]") + usr.show_message("\blue You project your mind into [target.real_name]: [say]") + for(var/mob/dead/observer/G in world) + G.show_message("Telepathic message from [src] to [target]: [say]") + +/mob/living/carbon/human/proc/remoteobserve() + set name = "Remote View" + set category = "Superpower" + + if(!(mRemote in src.mutations)) + reset_view(0) + src.verbs -= /mob/living/carbon/human/proc/remoteobserve + return + + if(client.eye != client.mob) + reset_view(0) + return + + var/list/mob/creatures = list() + + for(var/mob/living/carbon/h in world) + var/turf/temp_turf = get_turf(h) + if(temp_turf.z != 1 && temp_turf.z != 5) //Not on mining or the station. + continue + creatures += h + + var/mob/target = input ("Who do you want to project your mind to ?") as mob in creatures + + if (target) + reset_view(target) + else + reset_view(0) + +/mob/living/carbon/human/proc/get_visible_gender() + if(wear_suit && wear_suit.flags_inv & HIDEJUMPSUIT && ((head && head.flags_inv & HIDEMASK) || wear_mask)) + return NEUTER + return gender diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 4d79d304a8c..74342ca7d1a 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -33,6 +33,9 @@ if (bodytemperature < 283.222) tally += (283.222 - bodytemperature) / 10 * 1.75 + if(mRun in mutations) + tally = 0 + return (tally+config.human_delay) /mob/living/carbon/human/Process_Spacemove(var/check_drift = 0) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 13c9ae5a553..d79e70836fe 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -353,12 +353,28 @@ if((COLD_RESISTANCE in mutations) || (prob(1))) heal_organ_damage(0,1) + if(mHallucination in mutations) + hallucination = 100 + halloss = 0 + + if(mSmallsize in mutations) + if(!(pass_flags & PASSTABLE)) + pass_flags |= PASSTABLE + else + if(pass_flags & PASSTABLE) + pass_flags &= ~PASSTABLE + // Make nanoregen heal youu, -3 all damage types - if(NANOREGEN in augmentations) + if((NANOREGEN in augmentations) || (mRegen in mutations)) var/healed = 0 - var/hptoreg = 3 - if(stat==UNCONSCIOUS) hptoreg=1 + var/hptoreg = 0 + if(NANOREGEN in augmentations) + hptoreg += 3 + if(mRegen in mutations) + hptoreg += 2 + if(stat==UNCONSCIOUS) hptoreg/=2 if(stat==DEAD) hptoreg=0 + for(var/i=0, i 500) src << "\red You suddenly feel blubbery!" mutations.Add(FAT) @@ -983,7 +1020,8 @@ update_mutations(0) update_inv_w_uniform(0) update_inv_wear_suit() -AND YOU */ +*/ + // nutrition decrease if (nutrition > 0 && stat != 2) nutrition = max (0, nutrition - HUNGER_FACTOR) @@ -1394,7 +1432,8 @@ AND YOU */ if(machine) if(!machine.check_eye(src)) reset_view(null) else - if(!client.adminobs) reset_view(null) + if(!(mRemote in mutations) && !client.adminobs) + reset_view(null) return 1 proc/handle_random_events() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 05302b0acb6..5487c4658d4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -40,6 +40,8 @@ /mob/living/proc/burn_skin(burn_amount) if(istype(src, /mob/living/carbon/human)) //world << "DEBUG: burn_skin(), mutations=[mutations]" + if(mShock in src.mutations) //shockproof + return 0 if (COLD_RESISTANCE in src.mutations) //fireproof return 0 var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part diff --git a/code/setup.dm b/code/setup.dm index ddbc69de036..a6d2eb22848 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -308,6 +308,8 @@ var/MAX_EXPLOSION_RANGE = 14 // mob/var/list/mutations +#define STRUCDNASIZE 27 + // Generic mutations: #define TK 1 #define COLD_RESISTANCE 2 @@ -350,6 +352,19 @@ var/MAX_EXPLOSION_RANGE = 14 //2spooky #define SKELETON 29 +// Other Mutations: +#define mNobreath 100 // no need to breathe +#define mRemote 101 // remote viewing +#define mRegen 102 // health regen +#define mRun 103 // no slowdown +#define mRemotetalk 104 // remote talking +#define mMorph 105 // changing appearance +#define mBlend 106 // nothing (seriously nothing) +#define mHallucination 107 // hallucinations +#define mFingerprints 108 // no fingerprints +#define mShock 109 // insulated hands +#define mSmallsize 110 // table climbing + //disabilities #define NEARSIGHTED 1 #define EPILEPSY 2