mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
Merge pull request #12067 from AnturK/resequencing
Changes to DNA Injectors
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
var/list/fields
|
||||
var/list/add_mutations = list()
|
||||
var/list/remove_mutations = list()
|
||||
var/used = 0
|
||||
|
||||
/obj/item/weapon/dnainjector/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
@@ -45,6 +46,9 @@
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "<span class='warning'>You don't have the dexterity to do this!</span>"
|
||||
return
|
||||
if(used)
|
||||
user << "<span class='warning'>This injector is used up!</span>"
|
||||
return
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/humantarget = target
|
||||
if (!humantarget.can_inject(user, 1))
|
||||
@@ -63,7 +67,9 @@
|
||||
add_logs(user, target, "injected", src)
|
||||
|
||||
inject(target, user) //Now we actually do the heavy lifting.
|
||||
qdel(src)
|
||||
used = 1
|
||||
icon_state = "dnainjector0"
|
||||
desc += " This one is used up."
|
||||
|
||||
|
||||
/obj/item/weapon/dnainjector/antihulk
|
||||
@@ -385,4 +391,70 @@
|
||||
name = "\improper DNA injector (Anti-Laser Eyes)"
|
||||
New()
|
||||
..()
|
||||
remove_mutations.Add(mutations_list[LASEREYES])
|
||||
remove_mutations.Add(mutations_list[LASEREYES])
|
||||
|
||||
/obj/item/weapon/dnainjector/timed
|
||||
var/duration = 600
|
||||
|
||||
/obj/item/weapon/dnainjector/timed/inject(mob/living/carbon/M, mob/user)
|
||||
if(M.has_dna() && !(M.disabilities & NOCLONE))
|
||||
if(M.stat == DEAD) //prevents dead people from having their DNA changed
|
||||
user << "<span class='notice'>You can't modify [M]'s DNA while \he's dead.</span>"
|
||||
return
|
||||
M.radiation += rand(20/(damage_coeff ** 2),50/(damage_coeff ** 2))
|
||||
var/log_msg = "[key_name(user)] injected [key_name(M)] with the [name]"
|
||||
var/endtime = world.time+duration
|
||||
for(var/datum/mutation/human/HM in remove_mutations)
|
||||
if(HM.name == RACEMUT)
|
||||
if(ishuman(M))
|
||||
continue
|
||||
M = HM.force_lose(M)
|
||||
else
|
||||
HM.force_lose(M)
|
||||
for(var/datum/mutation/human/HM in add_mutations)
|
||||
if((HM in M.dna.mutations) && !(M.dna.temporary_mutations[HM.name]))
|
||||
continue //Skip permanent mutations we already have.
|
||||
if(HM.name == RACEMUT && ishuman(M))
|
||||
message_admins("[key_name_admin(user)] injected [key_name_admin(M)] with the [name] <span class='danger'>(MONKEY)</span>")
|
||||
log_msg += " (MONKEY)"
|
||||
M = HM.force_give(M)
|
||||
else
|
||||
HM.force_give(M)
|
||||
M.dna.temporary_mutations[HM.name] = endtime
|
||||
if(fields)
|
||||
if(fields["name"] && fields["UE"] && fields["blood_type"])
|
||||
if(!M.dna.previous["name"])
|
||||
M.dna.previous["name"] = M.real_name
|
||||
if(!M.dna.previous["UE"])
|
||||
M.dna.previous["UE"] = M.dna.unique_enzymes
|
||||
if(!M.dna.previous["blood_type"])
|
||||
M.dna.previous["blood_type"] = M.dna.blood_type
|
||||
M.real_name = fields["name"]
|
||||
M.dna.unique_enzymes = fields["UE"]
|
||||
M.name = M.real_name
|
||||
M.dna.blood_type = fields["blood_type"]
|
||||
M.dna.temporary_mutations[UE_CHANGED] = endtime
|
||||
if(fields["UI"]) //UI+UE
|
||||
if(!M.dna.previous["UI"])
|
||||
M.dna.previous["UI"] = M.dna.uni_identity
|
||||
M.dna.uni_identity = merge_text(M.dna.uni_identity, fields["UI"])
|
||||
M.updateappearance(mutations_overlay_update=1)
|
||||
M.dna.temporary_mutations[UI_CHANGED] = endtime
|
||||
log_attack(log_msg)
|
||||
else
|
||||
user << "<span class='notice'>It appears that [M] does not have compatible DNA.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/dnainjector/timed/hulk
|
||||
name = "\improper DNA injector (Hulk)"
|
||||
desc = "This will make you big and strong, but give you a bad skin condition."
|
||||
New()
|
||||
..()
|
||||
add_mutations.Add(mutations_list[HULK])
|
||||
|
||||
/obj/item/weapon/dnainjector/timed/h2m
|
||||
name = "\improper DNA injector (Human > Monkey)"
|
||||
desc = "Will make you a flea bag."
|
||||
New()
|
||||
..()
|
||||
add_mutations.Add(mutations_list[RACEMUT])
|
||||
|
||||
Reference in New Issue
Block a user