From b4330b2f3d2e5f35cd2c72a3525f07c945c6b32f Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Fri, 5 Aug 2022 18:19:22 +0100
Subject: [PATCH] GOODBYE SPECIES, HELLO COMPONENT
---
code/datums/components/dullahan.dm | 22 +++++++++++++++++++
code/datums/dna.dm | 15 +++++--------
code/datums/wounds/slash.dm | 2 +-
code/game/machinery/recycler.dm | 2 +-
code/modules/client/preferences_savefile.dm | 4 ++--
code/modules/holiday/halloween/jacqueen.dm | 20 +----------------
code/modules/mob/living/carbon/human/human.dm | 3 ---
.../mob/living/carbon/human/species.dm | 4 ++--
code/modules/projectiles/projectile/magic.dm | 2 +-
tgstation.dme | 1 -
10 files changed, 36 insertions(+), 39 deletions(-)
diff --git a/code/datums/components/dullahan.dm b/code/datums/components/dullahan.dm
index 5e0658be39..b39726082a 100644
--- a/code/datums/components/dullahan.dm
+++ b/code/datums/components/dullahan.dm
@@ -161,3 +161,25 @@
H.reset_perspective(H)
else
H.reset_perspective(dullahan_head)
+
+/datum/component/dullahan/Destroy()
+ UnregisterSignal(parent, COMSIG_LIVING_REGENERATE_LIMBS)
+ qdel(dullahan_head)
+ REMOVE_TRAIT(parent, TRAIT_DULLAHAN, "dullahan_component")
+
+ // work out what organs to give them based on their species
+ if(ishuman(parent))
+ var/mob/living/carbon/human/H = parent
+ var/obj/item/organ/eyes/new_eyes = new H.dna.species.mutant_eyes()
+ var/obj/item/organ/brain/new_brain = new H.dna.species.mutant_brain()
+ var/obj/item/organ/eyes/old_eyes = H.getorganslot(ORGAN_SLOT_EYES)
+ var/obj/item/organ/brain/old_brain = H.getorganslot(ORGAN_SLOT_BRAIN)
+
+ old_brain.Remove(TRUE,TRUE)
+ QDEL_NULL(old_brain)
+ new_brain.Insert(C, TRUE, TRUE)
+
+ old_eyes.Remove(TRUE,TRUE)
+ QDEL_NULL(old_eyes)
+ new_eyes.Insert(C, TRUE, TRUE)
+ . = ..()
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index 5619a09f05..bb2dab8033 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -717,16 +717,13 @@
death()
petrify(INFINITY)
if(3)
- if(prob(90))
- var/obj/item/bodypart/BP = get_bodypart(pick(BODY_ZONE_CHEST,BODY_ZONE_HEAD))
- if(BP)
- BP.dismember()
- else
- unequip_everything()
- drop_all_held_items()
- gib()
+ var/obj/item/bodypart/BP = get_bodypart(pick(BODY_ZONE_CHEST,BODY_ZONE_HEAD))
+ if(BP)
+ BP.dismember()
else
- set_species(/datum/species/dullahan)
+ unequip_everything()
+ drop_all_held_items()
+ gib()
/datum/dna/proc/update_body_size(old_size)
if(!holder || features["body_size"] == old_size)
diff --git a/code/datums/wounds/slash.dm b/code/datums/wounds/slash.dm
index 6a631ab8f4..68740e78ab 100644
--- a/code/datums/wounds/slash.dm
+++ b/code/datums/wounds/slash.dm
@@ -177,7 +177,7 @@
if(isinsect(victim) || iscatperson(victim) || ismammal(victim) || isdwarf(victim) || ismonkey(victim)) // Yep you can lick monkeys.
user.reagents.add_reagent(/datum/reagent/hairball, 2)
- else if(ishumanbasic(victim) || isflyperson(victim) || islizard(victim) || isdullahan(victim))
+ else if(ishumanbasic(victim) || isflyperson(victim) || islizard(victim) || HAS_TRAIT(victim, TRAIT_DULLAHAN))
user.reagents.add_reagent(/datum/reagent/hairball, 1)
if(blood_flow > minimum_flow)
diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm
index c1dac389bf..c561170af4 100644
--- a/code/game/machinery/recycler.dm
+++ b/code/game/machinery/recycler.dm
@@ -119,7 +119,7 @@
if(istype(AM, /obj/item))
var/obj/item/bodypart/head/as_head = AM
var/obj/item/mmi/as_mmi = AM
- if(istype(AM, /obj/item/organ/brain) || (istype(as_head) && as_head.brain) || (istype(as_mmi) && as_mmi.brain) || istype(AM, /obj/item/dullahan_relay))
+ if(istype(AM, /obj/item/organ/brain) || (istype(as_head) && as_head.brain) || (istype(as_mmi) && as_mmi.brain) || istype(AM, /obj/item/dullahan_head))
living_detected = living_detected ? living_detected : AM
nom += AM
else if(isliving(AM))
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index b4a8952675..3a7e52e706 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -363,9 +363,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
// dullahans as a species cease to exist
if(current_version < 56)
var/species_id = S["species"]
- if(species_id = SPECIES_DULLAHAN)
+ if(species_id == SPECIES_DULLAHAN)
S["species"] = SPECIES_HUMAN
- if(islist(S["all_quirks"])
+ if(islist(S["all_quirks"]))
S["all_quirks"] += "Dullahan"
else
S["all_quirks"] = list("Dullahan")
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index 77187532f9..66ae3dce4b 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -219,23 +219,11 @@
/mob/living/simple_animal/jacq/proc/treat(mob/living/carbon/C, gender)
visible_message("[src] gives off a glowing smile, \"What ken Ah offer ye? I can magic up an object, a potion or a plushie fer ye.\"")
jacqrunes("What ken Ah offer ye? I can magic up an object, a potion or a plushie fer ye.", C)
- var/choices_reward = list("Object - 3 candies", "Potion - 2 candies", "Jacqueline Tracker - 2 candies", "Plushie - 1 candy", "Can I get to know you instead?", "Become a pumpkinhead dullahan (perma) - 4 candies")
+ var/choices_reward = list("Object - 3 candies", "Potion - 2 candies", "Jacqueline Tracker - 2 candies", "Plushie - 1 candy", "Can I get to know you instead?")
var/choice_reward = input(usr, "Trick or Treat?", "Trick or Treat?") in choices_reward
//rewards
switch(choice_reward)
- if("Become a pumpkinhead dullahan (perma) - 4 candies")
- if(!take_candies(C, 4))
- visible_message("[src] raises an eyebrown, \"It's 4 candies for that [gender]! Thems the rules!\"")
- jacqrunes("It's 4 candies for that [gender]! Thems the rules!", C)
- return
- visible_message("[src] waves their arms around, \"Off comes your head, a pumpkin taking it's stead!\"")
- jacqrunes("Off comes your head, a pumpkin taking it's stead!", C)
- C.reagents.add_reagent(/datum/reagent/mutationtoxin/pumpkinhead, 5)
- sleep(20)
- poof()
- return
-
if("Object - 3 candies")
if(!take_candies(C, 3))
visible_message("[src] raises an eyebrown, \"It's 3 candies per trinket [gender]! Thems the rules!\"")
@@ -688,12 +676,6 @@
else
..()
-/datum/reagent/mutationtoxin/pumpkinhead
- name = "Pumpkin head mutation toxin"
- race = /datum/species/dullahan/pumpkin
- mutationtext = "The pain subsides. You feel your head roll off your shoulders... and you smell pumpkin."
- //I couldn't get the replace head sprite with a pumpkin to work so, it is what it is.
-
/mob/living/simple_animal/jacq/proc/check_candies(mob/living/carbon/C)
var/invs = C.get_contents()
var/candy_count = 0
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index c60e4c6cb2..b81863e932 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -954,9 +954,6 @@
/mob/living/carbon/human/species/corporate
race = /datum/species/corporate
-/mob/living/carbon/human/species/dullahan
- race = /datum/species/dullahan
-
/mob/living/carbon/human/species/felinid
race = /datum/species/human/felinid
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index b73f1da93a..77ad6c7d5a 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -345,11 +345,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/obj/item/organ/stomach/stomach = C.getorganslot(ORGAN_SLOT_STOMACH)
var/obj/item/organ/tail/tail = C.getorganslot(ORGAN_SLOT_TAIL)
- var/should_have_brain = !(HAS_TRAIT(C, TRAIT_DULLAHAN))
+ var/should_have_brain = !(HAS_TRAIT(C, TRAIT_DULLAHAN)) // do not mess with a dullahans brain
var/should_have_heart = !(NOBLOOD in species_traits)
var/should_have_lungs = ((TRAIT_AUXILIARY_LUNGS in inherent_traits) || !(TRAIT_NOBREATH in inherent_traits))
var/should_have_appendix = !(TRAIT_NOHUNGER in inherent_traits)
- var/should_have_eyes = TRUE
+ var/should_have_eyes = !(HAS_TRAIT(C, TRAIT_DULLAHAN)) // .. or their eyes
var/should_have_ears = TRUE
var/should_have_tongue = TRUE
var/should_have_liver = !(NOLIVER in species_traits)
diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm
index 9761881067..2959666a4c 100644
--- a/code/modules/projectiles/projectile/magic.dm
+++ b/code/modules/projectiles/projectile/magic.dm
@@ -37,7 +37,7 @@
return BULLET_ACT_BLOCK
if(iscarbon(target))
var/mob/living/carbon/C = target
- if(!is_species(C, /datum/species/dullahan)) //No accidental instagibbing dullahans please
+ if(HAS_TRAIT(C, TRAIT_DULLAHAN)) //No accidental instagibbing dullahans please
C.regenerate_limbs()
C.regenerate_organs()
if(target.revive(full_heal = 1))
diff --git a/tgstation.dme b/tgstation.dme
index 9fd6194e67..ca7d9ebda1 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -2696,7 +2696,6 @@
#include "code\modules\mob\living\carbon\human\species_types\arachnid.dm"
#include "code\modules\mob\living\carbon\human\species_types\bugmen.dm"
#include "code\modules\mob\living\carbon\human\species_types\corporate.dm"
-#include "code\modules\mob\living\carbon\human\species_types\dullahan.dm"
#include "code\modules\mob\living\carbon\human\species_types\dwarves.dm"
#include "code\modules\mob\living\carbon\human\species_types\ethereal.dm"
#include "code\modules\mob\living\carbon\human\species_types\felinid.dm"