[MIRROR] Tailed species now gain a negative moodlet for having their tail lost (#3456)

* Tailed species now gain a negative moodlet for having their tail lost

* a

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-02-17 17:14:18 +00:00
committed by GitHub
co-authored by MrMelbert Gandalf2k15
parent 18456cdb73
commit f2b1e99a73
5 changed files with 106 additions and 14 deletions
@@ -464,6 +464,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
C.dna.species.mutant_bodyparts -= "wings"
C.dna.features["wings"] = "None"
C.update_body()
clear_tail_moodlets(C)
C.remove_movespeed_modifier(/datum/movespeed_modifier/species)
@@ -2061,6 +2062,65 @@ GLOBAL_LIST_EMPTY(roundstart_races)
//Tail Wagging//
////////////////
/*
* This proc is called when a mob loses their tail.
*
* tail_owner - the owner of the tail (who holds our species datum)
* lost_tail - the tail that was removed
* on_species_init - whether or not this was called when the species was initialized, or if it was called due to an ingame means (like surgery)
*/
/datum/species/proc/on_tail_lost(mob/living/carbon/human/tail_owner, obj/item/organ/tail/lost_tail, on_species_init = FALSE)
SEND_SIGNAL(tail_owner, COMSIG_CLEAR_MOOD_EVENT, "right_tail_regained")
SEND_SIGNAL(tail_owner, COMSIG_CLEAR_MOOD_EVENT, "wrong_tail_regained")
stop_wagging_tail(tail_owner)
// If it's initializing the species, don't add moodlets
if(on_species_init)
return
// If we don't have a set tail, don't bother adding moodlets
if(!mutant_organs.len)
return
SEND_SIGNAL(tail_owner, COMSIG_ADD_MOOD_EVENT, "tail_lost", /datum/mood_event/tail_lost)
SEND_SIGNAL(tail_owner, COMSIG_ADD_MOOD_EVENT, "tail_balance_lost", /datum/mood_event/tail_balance_lost)
/*
* This proc is called when a mob gains a tail.
*
* tail_owner - the owner of the tail (who holds our species datum)
* lost_tail - the tail that was added
* on_species_init - whether or not this was called when the species was initialized, or if it was called due to an ingame means (like surgery)
*/
/datum/species/proc/on_tail_regain(mob/living/carbon/human/tail_owner, obj/item/organ/tail/found_tail, on_species_init = FALSE)
SEND_SIGNAL(tail_owner, COMSIG_CLEAR_MOOD_EVENT, "tail_lost")
SEND_SIGNAL(tail_owner, COMSIG_CLEAR_MOOD_EVENT, "tail_balance_lost")
// If it's initializing the species, don't add moodlets
if(on_species_init)
return
// If we don't have a set tail, don't add moodlets
if(!mutant_organs.len)
return
if(found_tail.type in mutant_organs)
SEND_SIGNAL(tail_owner, COMSIG_ADD_MOOD_EVENT, "right_tail_regained", /datum/mood_event/tail_regained_right)
else
SEND_SIGNAL(tail_owner, COMSIG_ADD_MOOD_EVENT, "wrong_tail_regained", /datum/mood_event/tail_regained_wrong)
/*
* Clears all tail related moodlets when they lose their species.
*
* former_tail_owner - the mob that was once a species with a tail and now is a different species
*/
/datum/species/proc/clear_tail_moodlets(mob/living/carbon/human/former_tail_owner)
SEND_SIGNAL(former_tail_owner, COMSIG_CLEAR_MOOD_EVENT, "tail_lost")
SEND_SIGNAL(former_tail_owner, COMSIG_CLEAR_MOOD_EVENT, "tail_balance_lost")
SEND_SIGNAL(former_tail_owner, COMSIG_CLEAR_MOOD_EVENT, "right_tail_regained")
SEND_SIGNAL(former_tail_owner, COMSIG_CLEAR_MOOD_EVENT, "wrong_tail_regained")
stop_wagging_tail(former_tail_owner)
//SKYRAT EDIT REMOVAL BEGIN - CUSTOMIZATION (moved to modular)
/*
/datum/species/proc/can_wag_tail(mob/living/carbon/human/H)
@@ -2068,7 +2128,6 @@ GLOBAL_LIST_EMPTY(roundstart_races)
/datum/species/proc/is_wagging_tail(mob/living/carbon/human/H)
return FALSE
/datum/species/proc/start_wagging_tail(mob/living/carbon/human/H)
/datum/species/proc/stop_wagging_tail(mob/living/carbon/human/H)
@@ -63,7 +63,7 @@
mutantears = /obj/item/organ/ears
if(H.dna.features["tail_human"] == "Cat")
var/obj/item/organ/tail/cat/tail = new
tail.Insert(H, drop_if_replaced = FALSE)
tail.Insert(H, special = TRUE, drop_if_replaced = FALSE)
else
mutant_organs = list()
return ..()