mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-24 00:12:07 +00:00
Fixes a bug with Vampire Shapeshift where you didn't get a name appropriate to your species and clarifies that you won't be taking on another species using this ability. Ensures you won't be taking on another species using this ability by circumventing an exploit whereby someone could change their species in game preferences, shapeshift, and be another species. Fixes a bug with DNA scramblers whereby you wouldn't get a name appropriate to your species. Adds marking resetting for consistency. Desnowflakes preferences_setup.dm like I had done with preferences.dm.
60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
/obj/item/weapon/dnascrambler
|
|
name = "dna scrambler"
|
|
desc = "An illegal genetic serum designed to randomize the user's identity."
|
|
icon = 'icons/obj/hypo.dmi'
|
|
item_state = "syringe_0"
|
|
icon_state = "lepopen"
|
|
var/used = null
|
|
|
|
update_icon()
|
|
if(used)
|
|
icon_state = "lepopen0"
|
|
else
|
|
icon_state = "lepopen"
|
|
|
|
attack(mob/M as mob, mob/user as mob)
|
|
if(!M || !user)
|
|
return
|
|
|
|
if(!ishuman(M) || !ishuman(user))
|
|
return
|
|
|
|
if(used)
|
|
return
|
|
|
|
if(ishuman(M))
|
|
var/mob/living/carbon/human/H = M
|
|
if(NO_DNA in H.species.species_traits)
|
|
to_chat(user, "<span class='warning'>You failed to inject [M], as they have no DNA to scramble, nor flesh to inject.</span>")
|
|
return
|
|
|
|
if(M == user)
|
|
user.visible_message("<span class='danger'>[user] injects \himself with [src]!</span>")
|
|
injected(user, user)
|
|
else
|
|
user.visible_message("<span class='danger'>[user] is trying to inject [M] with [src]!</span>")
|
|
if(do_mob(user,M,30))
|
|
user.visible_message("<span class='danger'>[user] injects [M] with [src].</span>")
|
|
injected(M, user)
|
|
else
|
|
to_chat(user, "<span class='warning'>You failed to inject [M].</span>")
|
|
|
|
proc/injected(var/mob/living/carbon/human/target, var/mob/living/carbon/user)
|
|
if(istype(target))
|
|
var/mob/living/carbon/human/H = target
|
|
scramble(1, H, 100)
|
|
H.real_name = random_name(H.gender, H.species.name) //Give them a name that makes sense for their species.
|
|
H.sync_organ_dna(assimilate = 1)
|
|
H.update_body(0)
|
|
H.reset_hair() //No more winding up with hairstyles you're not supposed to have, and blowing your cover.
|
|
H.reset_markings() //...Or markings.
|
|
H.dna.ResetUIFrom(H)
|
|
target.update_icons()
|
|
|
|
log_attack("[key_name(user)] injected [key_name(target)] with the [name]")
|
|
log_game("[key_name_admin(user)] injected [key_name_admin(target)] with the [name]")
|
|
|
|
used = 1
|
|
update_icon()
|
|
name = "used " + name
|