Kills /obj/shapeshift_holder, replaces it with /datum/status_effect/shapechange_mob, also does a lot of Wabbajack refactoring (#69091)

About The Pull Request

    Deletes /obj/shapeshift_holder, replaces it with /datum/status_effect/shapechange_mob
    Refactors Heretic worm form into a shapeshift spell
    Refactors Wabbajack, and associated code

Fixes #69117
Fixes #65653
Fixes #59127
Fixes #52786
Why It's Good For The Game

/obj/shapeshift_holder was one of the worst remaining abuses of /obj direct subtypes, so I replaced it with a cool fancy datum.

This also decouples the shapeshifting behavior entirely from the shapeshifting spell. So we have support for shapeshifted mobs not sourced from a spell. Which is neat, we could technically swap Wabbajack to use this in the future.
Changelog

cl Melbert
fix: Wabbajacking a shapeshifted mob no longer runtimes horribly. When a shapeshifted mob is wabbajacked, they'll now be removed from their shapeshift and stunned.
fix: Transforming via a shapeshift should no longer rob you of your hearing / runechat awareness.
fix: Shapeshifting plays nicer with holoparasites.
fix: Being polymorphed from a xeno to a non-xeno correctly makes you a non-xeno
refactor: Refactored shapeshifting, the shapeshift holder is now a status effect instead of an object.
refactor: Heretic worm form is a shapeshift spell now, this might have some minor behavioral changes but should overall be the same.
refactor: Refactored Wabbajack (+ cursed pool). Overall a bit more clean / consistent behavior.
/cl
This commit is contained in:
MrMelbert
2022-09-01 16:44:41 -05:00
committed by GitHub
parent c7cf23ae7e
commit de04b3be80
31 changed files with 710 additions and 346 deletions
@@ -19,28 +19,23 @@
. = ..()
if(!isliving(arrived))
return
var/mob/living/L = arrived
if(!L.client || L.incorporeal_move || !L.mind)
var/mob/living/to_transform = arrived
var/datum/mind/transforming_mind = to_transform.mind
if(!to_transform.client || to_transform.incorporeal_move || !transforming_mind)
return
if(HAS_TRAIT(L.mind, TRAIT_HOT_SPRING_CURSED)) // no double dipping
if(HAS_TRAIT(transforming_mind, TRAIT_HOT_SPRING_CURSED)) // no double dipping
return
ADD_TRAIT(L.mind, TRAIT_HOT_SPRING_CURSED, TRAIT_GENERIC)
var/random_choice = pick("Mob", "Appearance")
switch(random_choice)
if("Mob")
L = L.wabbajack("animal")
if("Appearance")
var/mob/living/carbon/human/H = L.wabbajack("humanoid")
randomize_human(H)
var/list/all_species = list()
for(var/stype in subtypesof(/datum/species))
var/datum/species/S = stype
if(initial(S.changesource_flags) & RACE_SWAP)
all_species += stype
var/random_race = pick(all_species)
H.set_species(random_race)
L = H
var/turf/T = find_safe_turf(extended_safety_checks = TRUE, dense_atoms = FALSE)
L.forceMove(T)
to_chat(L, span_notice("You blink and find yourself in [get_area_name(T)]."))
ADD_TRAIT(transforming_mind, TRAIT_HOT_SPRING_CURSED, TRAIT_GENERIC)
var/mob/living/transformed_mob = to_transform.wabbajack(pick(WABBAJACK_HUMAN, WABBAJACK_ANIMAL), change_flags = RACE_SWAP)
if(!transformed_mob)
// Wabbajack failed, maybe the mob had godmode or something.
if(!QDELETED(to_transform))
to_chat(to_transform, span_notice("The water seems to have no effect on you."))
// because it failed, let's allow them to try again in a lil' bit
addtimer(TRAIT_CALLBACK_REMOVE(transforming_mind, TRAIT_HOT_SPRING_CURSED, TRAIT_GENERIC), 10 SECONDS)
return
var/turf/return_turf = find_safe_turf(extended_safety_checks = TRUE, dense_atoms = FALSE)
transformed_mob.forceMove(return_turf)
to_chat(transformed_mob, span_notice("You blink and find yourself in [get_area_name(return_turf)]."))