Merge pull request #4100 from Zuhayr/dev

DNA2 EPISODE 2: Revenge of the Bugs
This commit is contained in:
Chinsky
2013-12-25 03:49:58 -08:00
18 changed files with 1401 additions and 691 deletions
+224 -188
View File
@@ -3,11 +3,8 @@
desc = "This injects the person with DNA."
icon = 'icons/obj/items.dmi'
icon_state = "dnainjector"
var/dnatype = null
var/list/dna = null
var/block = null
var/owner = null
var/ue = null
var/block=0
var/datum/dna2/record/buf=null
var/s_time = 10.0
throw_speed = 1
throw_range = 5
@@ -17,57 +14,76 @@
var/is_bullet = 0
var/inuse = 0
// USE ONLY IN PREMADE SYRINGES. WILL NOT WORK OTHERWISE.
var/datatype=0
var/value=0
/obj/item/weapon/dnainjector/New()
if(datatype && block)
buf=new
buf.dna=new
buf.types = datatype
buf.dna.ResetSE()
//testing("[name]: DNA2 SE blocks prior to SetValue: [english_list(buf.dna.SE)]")
SetValue(src.value)
//testing("[name]: DNA2 SE blocks after SetValue: [english_list(buf.dna.SE)]")
/obj/item/weapon/dnainjector/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/item/weapon/dnainjector/proc/GetRealBlock(var/selblock)
if(selblock==0)
return block
else
return selblock
/obj/item/weapon/dnainjector/proc/GetState(var/selblock=0)
var/real_block
if(!selblock)
real_block=block
selblock=1
var/real_block=GetRealBlock(selblock)
if(buf.types&DNA2_BUF_SE)
return buf.dna.GetSEState(real_block)
else
real_block=selblock
var/list/BOUNDS = GetDNABounds(real_block)
return dna[selblock] > BOUNDS[DNA_ON_LOWERBOUND]
return buf.dna.GetUIState(real_block)
/obj/item/weapon/dnainjector/proc/SetState(var/on, var/selblock=0)
var/real_block
if(!selblock)
real_block=block
selblock=1
var/real_block=GetRealBlock(selblock)
if(buf.types&DNA2_BUF_SE)
return buf.dna.SetSEState(real_block,on)
else
real_block=selblock
var/list/BOUNDS=GetDNABounds(real_block)
var/val
if(on)
val=rand(BOUNDS[DNA_ON_LOWERBOUND],BOUNDS[DNA_ON_UPPERBOUND])
else
val=rand(BOUNDS[DNA_OFF_LOWERBOUND],BOUNDS[DNA_OFF_UPPERBOUND])
dna[selblock]=val
return buf.dna.SetUIState(real_block,on)
/obj/item/weapon/dnainjector/proc/GetValue(var/block=1)
return dna[block]
/obj/item/weapon/dnainjector/proc/GetValue(var/selblock=0)
var/real_block=GetRealBlock(selblock)
if(buf.types&DNA2_BUF_SE)
return buf.dna.GetSEValue(real_block)
else
return buf.dna.GetUIValue(real_block)
/obj/item/weapon/dnainjector/proc/SetValue(var/val,var/selblock=0)
var/real_block=GetRealBlock(selblock)
if(buf.types&DNA2_BUF_SE)
return buf.dna.SetSEValue(real_block,val)
else
return buf.dna.SetUIValue(real_block,val)
/obj/item/weapon/dnainjector/proc/inject(mob/M as mob, mob/user as mob)
if(istype(M,/mob/living))
M.radiation += rand(5,20)
if (!(NOCLONE in M.mutations)) // prevents drained people from having their DNA changed
if (dnatype == "ui")
if (buf.types & DNA2_BUF_UI)
if (!block) //isolated block?
M.UpdateAppearance(dna)
if (ue) //unique enzymes? yes
M.real_name = ue
M.name = ue
M.UpdateAppearance(buf.dna)
if (buf.types & DNA2_BUF_UE) //unique enzymes? yes
M.real_name = buf.dna.real_name
M.name = buf.dna.real_name
uses--
else
M.dna.SetUIValue(block,src.GetValue())
M.UpdateAppearance()
uses--
if (dnatype == "se")
if (buf.types & DNA2_BUF_SE)
if (!block) //isolated block?
M.dna.SE = dna
M.dna.SE = buf.dna.SE
M.dna.UpdateSE()
else
M.dna.SetSEValue(block,src.GetValue())
@@ -107,15 +123,24 @@
spawn(50) // Not the best fix. There should be an failure proc, for /effect/equip_e/, which is called when the first initital checks fail
inuse = 0
M.requests += O
if (dnatype == "se")
// So you're checking for 14, and yet MONKEYBLOCK is 27 in globals.dm,
// and domutcheck checks MONKEYBLOCK...? wat. - N3X
//if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human))
if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human) )
msg_admin_attack("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
if (buf.types & DNA2_BUF_SE)
if(block)// Isolated injector
testing("Isolated block [block] injector with contents: [GetValue()]")
if (GetState() && block == MONKEYBLOCK && istype(M, /mob/living/carbon/human) )
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)")
log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
else
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_attack("[key_name(user)] injected [key_name(M)] with the [name]")
testing("DNA injector with contents: [english_list(buf.dna.SE)]")
if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human) )
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_attack("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_attack("[key_name(user)] injected [key_name(M)] with the [name]")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_attack("[key_name(user)] injected [key_name(M)] with the [name]")
@@ -132,15 +157,24 @@
if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey)))
user << "\red Apparently it didn't work."
return
if (dnatype == "se")
// And again... ?
//if (isblockon(getblock(dna, 14,3),14) && istype(M, /mob/living/carbon/human))
if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
if (buf.types & DNA2_BUF_SE)
if(block)// Isolated injector
testing("Isolated block [block] injector with contents: [GetValue()]")
if (GetState() && block == MONKEYBLOCK && istype(M, /mob/living/carbon/human) )
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name] (MONKEY)")
log_game("[key_name_admin(user)] injected [key_name_admin(M)] with the Isolated [name] \red(MONKEY)")
else
log_attack("[key_name(user)] injected [key_name(M)] with the Isolated [name]")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
testing("DNA injector with contents: [english_list(buf.dna.SE)]")
if (GetState(MONKEYBLOCK) && istype(M, /mob/living/carbon/human))
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] \red(MONKEY)")
log_game("[key_name(user)] injected [key_name(M)] with the [name] (MONKEY)")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
else
// message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name]")
log_game("[key_name(user)] injected [key_name(M)] with the [name]")
@@ -165,460 +199,462 @@
/obj/item/weapon/dnainjector/hulkmut
name = "DNA-Injector (Hulk)"
desc = "This will make you big and strong, but give you a bad skin condition."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = HULKBLOCK
..()
/obj/item/weapon/dnainjector/antihulk
name = "DNA-Injector (Anti-Hulk)"
desc = "Cures green skin."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = HULKBLOCK
..()
/obj/item/weapon/dnainjector/xraymut
name = "DNA-Injector (Xray)"
desc = "Finally you can see what the Captain does."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 8
New()
..()
block = XRAYBLOCK
..()
/obj/item/weapon/dnainjector/antixray
name = "DNA-Injector (Anti-Xray)"
desc = "It will make you see harder."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 8
New()
..()
block = XRAYBLOCK
..()
/obj/item/weapon/dnainjector/firemut
name = "DNA-Injector (Fire)"
desc = "Gives you fire."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 10
New()
..()
block = FIREBLOCK
..()
/obj/item/weapon/dnainjector/antifire
name = "DNA-Injector (Anti-Fire)"
desc = "Cures fire."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 10
New()
..()
block = FIREBLOCK
..()
/obj/item/weapon/dnainjector/telemut
name = "DNA-Injector (Tele.)"
desc = "Super brain man!"
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 12
New()
..()
block = TELEBLOCK
..()
/obj/item/weapon/dnainjector/antitele
name = "DNA-Injector (Anti-Tele.)"
desc = "Will make you not able to control your mind."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 12
New()
..()
block = TELEBLOCK
..()
/obj/item/weapon/dnainjector/nobreath
name = "DNA-Injector (No Breath)"
desc = "Hold your breath and count to infinity."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = NOBREATHBLOCK
..()
/obj/item/weapon/dnainjector/antinobreath
name = "DNA-Injector (Anti-No Breath)"
desc = "Hold your breath and count to 100."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = NOBREATHBLOCK
..()
/obj/item/weapon/dnainjector/remoteview
name = "DNA-Injector (Remote View)"
desc = "Stare into the distance for a reason."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = REMOTEVIEWBLOCK
..()
/obj/item/weapon/dnainjector/antiremoteview
name = "DNA-Injector (Anti-Remote View)"
desc = "Cures green skin."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = REMOTEVIEWBLOCK
..()
/obj/item/weapon/dnainjector/regenerate
name = "DNA-Injector (Regeneration)"
desc = "Healthy but hungry."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = REGENERATEBLOCK
..()
/obj/item/weapon/dnainjector/antiregenerate
name = "DNA-Injector (Anti-Regeneration)"
desc = "Sickly but sated."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = REGENERATEBLOCK
..()
/obj/item/weapon/dnainjector/runfast
name = "DNA-Injector (Increase Run)"
desc = "Running Man."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = INCREASERUNBLOCK
..()
/obj/item/weapon/dnainjector/antirunfast
name = "DNA-Injector (Anti-Increase Run)"
desc = "Walking Man."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = INCREASERUNBLOCK
..()
/obj/item/weapon/dnainjector/morph
name = "DNA-Injector (Morph)"
desc = "A total makeover."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = MORPHBLOCK
..()
/obj/item/weapon/dnainjector/antimorph
name = "DNA-Injector (Anti-Morph)"
desc = "Cures identity crisis."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = MORPHBLOCK
/*
..()
/* No COLDBLOCK on bay
/obj/item/weapon/dnainjector/cold
name = "DNA-Injector (Cold)"
desc = "Feels a bit chilly."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = COLDBLOCK
..()
/obj/item/weapon/dnainjector/anticold
name = "DNA-Injector (Anti-Cold)"
desc = "Feels room-temperature."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = COLDBLOCK
..()
*/
/obj/item/weapon/dnainjector/noprints
name = "DNA-Injector (No Prints)"
desc = "Better than a pair of budget insulated gloves."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = NOPRINTSBLOCK
..()
/obj/item/weapon/dnainjector/antinoprints
name = "DNA-Injector (Anti-No Prints)"
desc = "Not quite as good as a pair of budget insulated gloves."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = NOPRINTSBLOCK
..()
/obj/item/weapon/dnainjector/insulation
name = "DNA-Injector (Shock Immunity)"
desc = "Better than a pair of real insulated gloves."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = SHOCKIMMUNITYBLOCK
..()
/obj/item/weapon/dnainjector/antiinsulation
name = "DNA-Injector (Anti-Shock Immunity)"
desc = "Not quite as good as a pair of real insulated gloves."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = SHOCKIMMUNITYBLOCK
..()
/obj/item/weapon/dnainjector/midgit
name = "DNA-Injector (Small Size)"
desc = "Makes you shrink."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = SMALLSIZEBLOCK
..()
/obj/item/weapon/dnainjector/antimidgit
name = "DNA-Injector (Anti-Small Size)"
desc = "Makes you grow. But not too much."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = SMALLSIZEBLOCK
..()
/////////////////////////////////////
/obj/item/weapon/dnainjector/antiglasses
name = "DNA-Injector (Anti-Glasses)"
desc = "Toss away those glasses!"
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 1
New()
..()
block = GLASSESBLOCK
..()
/obj/item/weapon/dnainjector/glassesmut
name = "DNA-Injector (Glasses)"
desc = "Will make you need dorkish glasses."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 1
New()
..()
block = GLASSESBLOCK
..()
/obj/item/weapon/dnainjector/epimut
name = "DNA-Injector (Epi.)"
desc = "Shake shake shake the room!"
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 3
New()
..()
block = HEADACHEBLOCK
..()
/obj/item/weapon/dnainjector/antiepi
name = "DNA-Injector (Anti-Epi.)"
desc = "Will fix you up from shaking the room."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 3
New()
..()
block = HEADACHEBLOCK
..()
/obj/item/weapon/dnainjector/anticough
name = "DNA-Injector (Anti-Cough)"
desc = "Will stop that awful noise."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 5
New()
..()
block = COUGHBLOCK
..()
/obj/item/weapon/dnainjector/coughmut
name = "DNA-Injector (Cough)"
desc = "Will bring forth a sound of horror from your throat."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 5
New()
..()
block = COUGHBLOCK
..()
/obj/item/weapon/dnainjector/clumsymut
name = "DNA-Injector (Clumsy)"
desc = "Makes clumsy minions."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 6
New()
..()
block = CLUMSYBLOCK
..()
/obj/item/weapon/dnainjector/anticlumsy
name = "DNA-Injector (Anti-Clumy)"
desc = "Cleans up confusion."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 6
New()
..()
block = CLUMSYBLOCK
..()
/obj/item/weapon/dnainjector/antitour
name = "DNA-Injector (Anti-Tour.)"
desc = "Will cure tourrets."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 7
New()
..()
block = TWITCHBLOCK
..()
/obj/item/weapon/dnainjector/tourmut
name = "DNA-Injector (Tour.)"
desc = "Gives you a nasty case off tourrets."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 7
New()
..()
block = TWITCHBLOCK
..()
/obj/item/weapon/dnainjector/stuttmut
name = "DNA-Injector (Stutt.)"
desc = "Makes you s-s-stuttterrr"
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 9
New()
..()
block = NERVOUSBLOCK
..()
/obj/item/weapon/dnainjector/antistutt
name = "DNA-Injector (Anti-Stutt.)"
desc = "Fixes that speaking impairment."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 9
New()
..()
block = NERVOUSBLOCK
..()
/obj/item/weapon/dnainjector/blindmut
name = "DNA-Injector (Blind)"
desc = "Makes you not see anything."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 11
New()
..()
block = BLINDBLOCK
..()
/obj/item/weapon/dnainjector/antiblind
name = "DNA-Injector (Anti-Blind)"
desc = "ITS A MIRACLE!!!"
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 11
New()
..()
block = BLINDBLOCK
..()
/obj/item/weapon/dnainjector/deafmut
name = "DNA-Injector (Deaf)"
desc = "Sorry, what did you say?"
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 13
New()
..()
block = DEAFBLOCK
..()
/obj/item/weapon/dnainjector/antideaf
name = "DNA-Injector (Anti-Deaf)"
desc = "Will make you hear once more."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 13
New()
..()
block = DEAFBLOCK
..()
/obj/item/weapon/dnainjector/hallucination
name = "DNA-Injector (Halluctination)"
desc = "What you see isn't always what you get."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 2
New()
..()
block = HALLUCINATIONBLOCK
..()
/obj/item/weapon/dnainjector/antihallucination
name = "DNA-Injector (Anti-Hallucination)"
desc = "What you see is what you get."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 2
New()
..()
block = HALLUCINATIONBLOCK
..()
/obj/item/weapon/dnainjector/h2m
name = "DNA-Injector (Human > Monkey)"
desc = "Will make you a flea bag."
dnatype = "se"
dna = list(4090)
datatype = DNA2_BUF_SE
value = 0xFFF
//block = 14
New()
..()
block = MONKEYBLOCK
..()
/obj/item/weapon/dnainjector/m2h
name = "DNA-Injector (Monkey > Human)"
desc = "Will make you...less hairy."
dnatype = "se"
dna = list(1)
datatype = DNA2_BUF_SE
value = 0x001
//block = 14
New()
..()
block = MONKEYBLOCK
..()