diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index eb22af762432..cd562e987692 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -59,7 +59,7 @@ GLOBAL_LIST_EMPTY(antagonists) /datum/antagonist/proc/on_body_transfer(mob/living/old_body, mob/living/new_body) SHOULD_CALL_PARENT(TRUE) remove_innate_effects(old_body) - if(old_body.stat != DEAD && !LAZYLEN(old_body.mind?.antag_datums)) + if(old_body && old_body.stat != DEAD && !LAZYLEN(old_body.mind?.antag_datums)) old_body.remove_from_current_living_antags() apply_innate_effects(new_body) if(new_body.stat != DEAD) diff --git a/code/modules/antagonists/changeling/powers/humanform.dm b/code/modules/antagonists/changeling/powers/humanform.dm index 6c8f870524c2..49a71c72d10b 100644 --- a/code/modules/antagonists/changeling/powers/humanform.dm +++ b/code/modules/antagonists/changeling/powers/humanform.dm @@ -15,7 +15,7 @@ for(var/datum/changelingprofile/prof in changeling.stored_profiles) names += "[prof.name]" - var/chosen_name = tgui_input_list("Select the target DNA", "Target DNA", sortList(names)) + var/chosen_name = tgui_input_list(user, "Select the target DNA", "Target DNA", sortList(names)) if(!chosen_name) return @@ -28,7 +28,5 @@ ..() changeling.purchasedpowers -= src - var/newmob = user.humanize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_KEEPSE) - - changeling_transform(newmob, chosen_prof) + user.humanize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_KEEPSE, chosen_prof) return TRUE diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 6a5d55f45c38..f9c5a427e95a 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -61,12 +61,12 @@ if(C.has_horror_inside()) var/mob/living/simple_animal/horror/B = C.has_horror_inside() B.leave_victim() - if(C.mind && C.mind.has_antag_datum(/datum/antagonist/changeling)) - var/datum/antagonist/changeling/bruh = C.mind.has_antag_datum(/datum/antagonist/changeling) - for(var/d in bruh.purchasedpowers) - if(istype(d, /datum/action/changeling/fakedeath)) - var/datum/action/changeling/fakedeath/ack = d - ack.sting_action(C) + if(C.mind && C.mind.has_antag_datum(/datum/antagonist/changeling)) + var/datum/antagonist/changeling/bruh = C.mind.has_antag_datum(/datum/antagonist/changeling) + for(var/d in bruh.purchasedpowers) + if(istype(d, /datum/action/changeling/fakedeath)) + var/datum/action/changeling/fakedeath/ack = d + ack.sting_action(C) for(var/X in traumas) var/datum/brain_trauma/BT = X diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 11f82fd7841e..e9a26052f5ad 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -178,7 +178,7 @@ ////////////////////////// Humanize ////////////////////////////// //Could probably be merged with monkeyize but other transformations got their own procs, too -/mob/living/carbon/proc/humanize(tr_flags = (TR_KEEPITEMS | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_DEFAULTMSG)) +/mob/living/carbon/proc/humanize(tr_flags = (TR_KEEPITEMS | TR_KEEPVIRUS | TR_KEEPSTUNS | TR_KEEPREAGENTS | TR_DEFAULTMSG), datum/changelingprofile/chosen_prof) if (notransform || transformation_timer) return //now the rest @@ -199,9 +199,9 @@ invisibility = INVISIBILITY_MAXIMUM new /obj/effect/temp_visual/monkeyify/humanify(loc) - transformation_timer = addtimer(CALLBACK(src, .proc/finish_humanize, tr_flags), TRANSFORMATION_DURATION, TIMER_UNIQUE) + transformation_timer = addtimer(CALLBACK(src, .proc/finish_humanize, tr_flags, chosen_prof), TRANSFORMATION_DURATION, TIMER_UNIQUE) -/mob/living/carbon/proc/finish_humanize(tr_flags) +/mob/living/carbon/proc/finish_humanize(tr_flags, datum/changelingprofile/chosen_prof) transformation_timer = null var/list/stored_implants = list() var/list/int_organs = list() @@ -349,6 +349,9 @@ transfer_trait_datums(O) + if(chosen_prof) + changeling_transform(O, chosen_prof) + qdel(src) /mob/living/carbon/human/AIize(transfer_after = TRUE, client/preference_source) diff --git a/code/modules/spells/spell_types/shapeshift.dm b/code/modules/spells/spell_types/shapeshift.dm index c09c7e0fa39b..2a4684409be8 100644 --- a/code/modules/spells/spell_types/shapeshift.dm +++ b/code/modules/spells/spell_types/shapeshift.dm @@ -58,9 +58,15 @@ return if(iscyborg(caster)) - to_chat(caster, span_warning("You cannot shapeshift as a cyborg")) + to_chat(caster, span_warning("You cannot shapeshift as a cyborg!")) + return var/mob/living/shape = new shapeshift_type(caster.loc) + if(caster.maxHealth - (caster.health + caster.maxHealth)/2 >= shape.maxHealth) // this would instantly kill the caster + to_chat(caster, span_warning("You are too damaged to shapeshift into this form!")) + qdel(shape) + return + H = new(shape,src,caster) clothes_req = FALSE diff --git a/yogstation/code/game/gamemodes/vampire/vampire_powers.dm b/yogstation/code/game/gamemodes/vampire/vampire_powers.dm index 57bb2e32266a..ab9596717f24 100644 --- a/yogstation/code/game/gamemodes/vampire/vampire_powers.dm +++ b/yogstation/code/game/gamemodes/vampire/vampire_powers.dm @@ -536,4 +536,4 @@ bat.controller.status_flags &= ~GODMODE bat.mind.transfer_to(bat.controller) bat.controller = null //just so we don't accidently trigger the death() thing - qdel(bat) + QDEL_NULL(bat)