Fixes the cling transform problem and adds a proc for it

I cried when I saw that the problem code not copied to another place. So
I made a proc for it.
This commit is contained in:
joep van der velden
2018-09-28 20:59:56 +02:00
parent 488c274f8f
commit 27f5d66d4c
3 changed files with 18 additions and 18 deletions
@@ -81,3 +81,18 @@
if(req_human && !ishuman(user))
return 0
return 1
// Transform the target to the chosen dna. Used in transform.dm and tiny_prick.dm (handy for changes since it's the same thing done twice)
/obj/effect/proc_holder/changeling/proc/transform_dna(var/mob/living/carbon/human/H, var/datum/dna/D)
if(!D)
return
H.set_species(D.species.type)
H.dna = D.Clone()
H.real_name = D.real_name
domutcheck(H, null, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them
H.flavor_text = ""
H.dna.UpdateSE()
H.dna.UpdateUI()
H.sync_organ_dna(1)
H.UpdateAppearance()
@@ -100,7 +100,6 @@
/obj/effect/proc_holder/changeling/sting/transformation/sting_action(var/mob/user, var/mob/target)
add_attack_logs(user, target, "Transformation sting (changeling) (new identity is [selected_dna.real_name])")
var/datum/dna/NewDNA = selected_dna
if(issmall(target))
to_chat(user, "<span class='notice'>Our genes cry out as we sting [target.name]!</span>")
@@ -111,13 +110,7 @@
target.visible_message("<span class='danger'>[target] begins to violenty convulse!</span>","<span class='userdanger'>You feel a tiny prick and a begin to uncontrollably convulse!</span>")
spawn(10)
if(ishuman(target))
var/mob/living/carbon/human/H = target
H.set_species(NewDNA.species.type)
target.dna = NewDNA.Clone()
target.real_name = NewDNA.real_name
target.UpdateAppearance()
domutcheck(target, null)
transform_dna(target,selected_dna)//target is always human so no problem here
feedback_add_details("changeling_powers","TS")
return TRUE
@@ -14,16 +14,8 @@
if(!chosen_dna)
return
if(ishuman(user))
user.set_species(chosen_dna.species.type)
user.dna = chosen_dna.Clone()
user.real_name = chosen_dna.real_name
domutcheck(user, null, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them
user.flavor_text = ""
user.dna.UpdateSE()
user.dna.UpdateUI()
user.sync_organ_dna(1)
user.UpdateAppearance()
transform_dna(user,chosen_dna)
user.changeling_update_languages(changeling.absorbed_languages)