From ca21572aa7245ec43b63c015b0351a6d8323dc21 Mon Sep 17 00:00:00 2001 From: DeltaFire15 <46569814+DeltaFire15@users.noreply.github.com> Date: Sat, 17 Oct 2020 11:39:58 +0200 Subject: [PATCH] Fixes vamp shapeshifting a bit (#13562) * fixes vamp shapeshifting a bit Title. Buncha weird stuff happening. * ghom's request moves the check to ../bat/cast(), adds type safety --- .../carbon/human/species_types/vampire.dm | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm index 4125d3beab..c2bafd0065 100644 --- a/code/modules/mob/living/carbon/human/species_types/vampire.dm +++ b/code/modules/mob/living/carbon/human/species_types/vampire.dm @@ -153,16 +153,33 @@ to_chat(caster, "You're already shapeshifted!") return + if(!ishuman(caster)) + to_chat(caster, "You need to be humanoid to be able to do this!") + return + + var/mob/living/carbon/human/human_caster = caster var/mob/living/shape = new shapeshift_type(caster.loc) - H = new(shape,src,caster) + H = new(shape,src,human_caster) if(istype(H, /mob/living/simple_animal)) var/mob/living/simple_animal/SA = H - if((caster.blood_volume >= (BLOOD_VOLUME_BAD*caster.blood_ratio)) || (ventcrawl_nude_only && length(caster.get_equipped_items(include_pockets = TRUE)))) + if((human_caster.blood_volume <= (BLOOD_VOLUME_BAD*human_caster.blood_ratio)) || (ventcrawl_nude_only && length(human_caster.get_equipped_items(include_pockets = TRUE)))) SA.ventcrawler = FALSE if(transfer_name) - H.name = caster.name + H.name = human_caster.name clothes_req = NONE mobs_whitelist = null mobs_blacklist = null + +/obj/effect/proc_holder/spell/targeted/shapeshift/bat/cast(list/targets, mob/user = usr) + if(!(locate(/obj/shapeshift_holder) in targets[1])) + if(!ishuman(user)) + to_chat(user, "You need to be humanoid to be able to do this!") + return + + var/mob/living/carbon/human/human_user = user + if(!(human_user.dna?.species?.id == SPECIES_VAMPIRE)) + to_chat(user, "You don't seem to be able to shapeshift..") + return + return ..()