Gets some of the easy-bad species procs (#78993)

## About The Pull Request

- Kills `spec_death`, everything that used it is now signalized. 
- Kills `spec_hitby`, nothing used it. Anything that did hypothetically
can use the signal.

- [x] I tested this PR

## Why It's Good For The Game

These are all bad and using signals is superior. 

## Changelog

🆑 Melbert
code: Removed species death and species hitby, replaced any uses with
signals.
/🆑
This commit is contained in:
MrMelbert
2023-10-15 08:52:02 -04:00
committed by GitHub
parent cae098d432
commit ad63f7ae2a
6 changed files with 39 additions and 47 deletions
@@ -874,9 +874,6 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(HAS_TRAIT(H, TRAIT_NOBREATH) && (H.health < H.crit_threshold) && !HAS_TRAIT(H, TRAIT_NOCRITDAMAGE))
H.adjustBruteLoss(0.5 * seconds_per_tick)
/datum/species/proc/spec_death(gibbed, mob/living/carbon/human/H)
return
/datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H, bypass_equip_delay_self = FALSE, ignore_equipped = FALSE, indirect_action = FALSE)
if(no_equip_flags & slot)
if(!I.species_exception || !is_type_in_list(src, I.species_exception))
@@ -1247,10 +1244,6 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE
user.disarm(target)
/datum/species/proc/spec_hitby(atom/movable/AM, mob/living/carbon/human/H)
return
/datum/species/proc/spec_attack_hand(mob/living/carbon/human/owner, mob/living/carbon/human/target, datum/martial_art/attacker_style, modifiers)
if(!istype(owner))
return
@@ -30,9 +30,6 @@ GLOBAL_LIST_EMPTY(dead_players_during_shift)
if(client && !HAS_TRAIT(src, TRAIT_SUICIDED) && !(client in GLOB.dead_players_during_shift))
GLOB.dead_players_during_shift += client
if(!QDELETED(dna)) //The gibbed param is bit redundant here since dna won't exist at this point if they got deleted.
dna.species.spec_death(gibbed, src)
if(SSticker.HasRoundStarted())
SSblackbox.ReportDeath(src)
log_message("has died (BRUTE: [src.getBruteLoss()], BURN: [src.getFireLoss()], TOX: [src.getToxLoss()], OXY: [src.getOxyLoss()], CLONE: [src.getCloneLoss()])", LOG_ATTACK)
@@ -148,10 +148,6 @@
return FALSE
/mob/living/carbon/human/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(dna?.species)
var/spec_return = dna.species.spec_hitby(AM, src)
if(spec_return)
return spec_return
var/obj/item/I
var/damage_type = BRUTE
var/throwpower = 30
@@ -206,6 +206,7 @@
// so if someone mindswapped into them, they'd still be shared.
bodies = null
C.blood_volume = min(C.blood_volume, BLOOD_VOLUME_NORMAL)
UnregisterSignal(C, COMSIG_LIVING_DEATH)
..()
/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species)
@@ -221,20 +222,25 @@
else
bodies |= C
/datum/species/jelly/slime/spec_death(gibbed, mob/living/carbon/human/H)
if(slime_split)
if(!H.mind || !H.mind.active)
return
RegisterSignal(C, COMSIG_LIVING_DEATH, PROC_REF(on_death_move_body))
var/list/available_bodies = (bodies - H)
for(var/mob/living/L in available_bodies)
if(!swap_body.can_swap(L))
available_bodies -= L
/datum/species/jelly/slime/proc/on_death_move_body(mob/living/carbon/human/source, gibbed)
SIGNAL_HANDLER
if(!LAZYLEN(available_bodies))
return
if(!slime_split)
return
if(!source.mind?.active)
return
swap_body.swap_to_dupe(H.mind, pick(available_bodies))
var/list/available_bodies = bodies - source
for(var/mob/living/other_body as anything in available_bodies)
if(!swap_body.can_swap(other_body))
available_bodies -= other_body
if(!length(available_bodies))
return
swap_body.swap_to_dupe(source.mind, pick(available_bodies))
//If you're cloned you get your body pool back
/datum/species/jelly/slime/copy_properties_from(datum/species/jelly/slime/old_species)
@@ -140,6 +140,14 @@
/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/human/new_zombie, datum/species/old_species)
. = ..()
// Deal with the source of this zombie corruption
// Infection organ needs to be handled separately from mutant_organs
// because it persists through species transitions
var/obj/item/organ/internal/zombie_infection/infection = new_zombie.get_organ_slot(ORGAN_SLOT_ZOMBIE)
if(isnull(infection))
infection = new()
infection.Insert(new_zombie)
new_zombie.AddComponent(/datum/component/mutant_hands, mutant_hand_path = /obj/item/mutant_hand/zombie)
/datum/species/zombie/infectious/on_species_loss(mob/living/carbon/human/was_zombie, datum/species/new_species, pref_load)
@@ -179,26 +187,6 @@
if(!HAS_TRAIT(carbon_mob, TRAIT_CRITICAL_CONDITION) && SPT_PROB(2, seconds_per_tick))
playsound(carbon_mob, pick(spooks), 50, TRUE, 10)
//Congrats you somehow died so hard you stopped being a zombie
/datum/species/zombie/infectious/spec_death(gibbed, mob/living/carbon/C)
. = ..()
var/obj/item/organ/internal/zombie_infection/infection
infection = C.get_organ_slot(ORGAN_SLOT_ZOMBIE)
if(infection)
qdel(infection)
/datum/species/zombie/infectious/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
// Deal with the source of this zombie corruption
// Infection organ needs to be handled separately from mutant_organs
// because it persists through species transitions
var/obj/item/organ/internal/zombie_infection/infection
infection = C.get_organ_slot(ORGAN_SLOT_ZOMBIE)
if(!infection)
infection = new()
infection.Insert(C)
// Your skin falls off
/datum/species/human/krokodil_addict
name = "\improper Krokodil Human"
+14 -2
View File
@@ -37,10 +37,22 @@
if(timer_id)
deltimer(timer_id)
/obj/item/organ/internal/zombie_infection/on_insert(mob/living/carbon/organ_owner, special)
. = ..()
RegisterSignal(organ_owner, COMSIG_LIVING_DEATH, PROC_REF(organ_owner_died))
/obj/item/organ/internal/zombie_infection/on_remove(mob/living/carbon/organ_owner, special)
. = ..()
UnregisterSignal(organ_owner, COMSIG_LIVING_DEATH)
/obj/item/organ/internal/zombie_infection/proc/organ_owner_died(mob/living/carbon/source, gibbed)
SIGNAL_HANDLER
qdel(src) // Congrats you somehow died so hard you stopped being a zombie
/obj/item/organ/internal/zombie_infection/on_find(mob/living/finder)
to_chat(finder, "<span class='warning'>Inside the head is a disgusting black \
to_chat(finder, span_warning("Inside the head is a disgusting black \
web of pus and viscera, bound tightly around the brain like some \
biological harness.</span>")
biological harness."))
/obj/item/organ/internal/zombie_infection/process(seconds_per_tick, times_fired)
if(!owner)