diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index b3929c15cef..20bd4d33969 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1021,7 +1021,6 @@ if(!new_bodypart.bodypart_disabled) set_usable_hands(usable_hands + 1) - ///Proc to hook behavior on bodypart removals. Do not directly call. You're looking for [/obj/item/bodypart/proc/drop_limb()]. /mob/living/carbon/proc/remove_bodypart(obj/item/bodypart/old_bodypart) SHOULD_NOT_OVERRIDE(TRUE) @@ -1037,6 +1036,12 @@ if(!old_bodypart.bodypart_disabled) set_usable_hands(usable_hands - 1) +///Updates the bodypart speed modifier based on our bodyparts. +/mob/living/carbon/proc/update_bodypart_speed_modifier() + var/final_modification = 0 + for(var/obj/item/bodypart/bodypart as anything in bodyparts) + final_modification += bodypart.speed_modifier + add_movespeed_modifier(/datum/movespeed_modifier/bodypart, final_modification) /mob/living/carbon/proc/create_internal_organs() for(var/obj/item/organ/internal/internal_organ in organs) diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index ac023e9f892..88eb6f469f3 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -95,8 +95,6 @@ GLOBAL_LIST_EMPTY(features_by_species) ///Replaces default appendix with a different organ. var/obj/item/organ/internal/appendix/mutantappendix = /obj/item/organ/internal/appendix - ///Multiplier for the race's speed. Positive numbers make it move slower, negative numbers make it move faster. - var/speedmod = 0 /** * Percentage modifier for overall defense of the race, or less defense, if it's negative * THIS MODIFIES ALL DAMAGE TYPES. @@ -485,8 +483,6 @@ GLOBAL_LIST_EMPTY(features_by_species) for(var/i in inherent_factions) C.faction += i //Using +=/-= for this in case you also gain the faction from a different source. - C.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/species, multiplicative_slowdown = speedmod) - SEND_SIGNAL(C, COMSIG_SPECIES_GAIN, src, old_species) properly_gained = TRUE @@ -525,8 +521,6 @@ GLOBAL_LIST_EMPTY(features_by_species) clear_tail_moodlets(C) - C.remove_movespeed_modifier(/datum/movespeed_modifier/species) - SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src) /** diff --git a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm index fd1170a7ae0..22dbabaacf6 100644 --- a/code/modules/mob/living/carbon/human/species_types/mushpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/mushpeople.dm @@ -15,7 +15,6 @@ TRAIT_NO_UNDERWEAR, ) inherent_factions = list(FACTION_MUSHROOM) - speedmod = 1.5 //faster than golems but not by much no_equip_flags = ITEM_SLOT_MASK | ITEM_SLOT_OCLOTHING | ITEM_SLOT_GLOVES | ITEM_SLOT_FEET | ITEM_SLOT_ICLOTHING diff --git a/code/modules/mob/living/carbon/human/species_types/snail.dm b/code/modules/mob/living/carbon/human/species_types/snail.dm index 36e73d31ad8..41a61668128 100644 --- a/code/modules/mob/living/carbon/human/species_types/snail.dm +++ b/code/modules/mob/living/carbon/human/species_types/snail.dm @@ -8,7 +8,6 @@ ) coldmod = 0.5 //snails only come out when its cold and wet - speedmod = 6 siemens_coeff = 2 //snails are mostly water changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | RACE_SWAP sexes = FALSE //snails are hermaphrodites diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index d931921d07d..6fbac94e783 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -4,7 +4,7 @@ // 1spooky name = "High-Functioning Zombie" id = SPECIES_ZOMBIE - sexes = 0 + sexes = FALSE meat = /obj/item/food/meat/slab/human/mutant/zombie mutanttongue = /obj/item/organ/internal/tongue/zombie inherent_traits = list( @@ -92,7 +92,6 @@ name = "Infectious Zombie" id = SPECIES_ZOMBIE_INFECTIOUS examine_limb_id = SPECIES_ZOMBIE - speedmod = 1.6 damage_modifier = 20 // 120 damage to KO a zombie, which kills it mutanteyes = /obj/item/organ/internal/eyes/zombie mutantbrain = /obj/item/organ/internal/brain/zombie @@ -120,6 +119,15 @@ TRAIT_STABLELIVER, // Not necessary but for consistency with above ) + // Infectious zombies have slow legs + bodypart_overrides = list( + BODY_ZONE_HEAD = /obj/item/bodypart/head/zombie, + BODY_ZONE_CHEST = /obj/item/bodypart/chest/zombie, + BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left/zombie, + BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right/zombie, + BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/zombie/infectious, + BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/zombie/infectious, + ) /// The rate the zombies regenerate at var/heal_rate = 0.5 /// The cooldown before the zombie can start regenerating diff --git a/code/modules/movespeed/modifiers/innate.dm b/code/modules/movespeed/modifiers/innate.dm index 46fc82269ea..2a55b9db4d7 100644 --- a/code/modules/movespeed/modifiers/innate.dm +++ b/code/modules/movespeed/modifiers/innate.dm @@ -6,7 +6,7 @@ multiplicative_slowdown = 2 flags = IGNORE_NOSLOW -/datum/movespeed_modifier/species +/datum/movespeed_modifier/bodypart movetypes = ~FLYING variable = TRUE diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 2b88ed0e03c..08f88f8b5c4 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -62,6 +62,8 @@ var/list/embedded_objects = list() /// are we a hand? if so, which one! var/held_index = 0 + /// A speed modifier we apply to the owner when attached, if any. Positive numbers make it move slower, negative numbers make it move faster. + var/speed_modifier = 0 // Limb disabling variables ///Controls if the limb is disabled. TRUE means it is disabled (similar to being removed, but still present for the sake of targeted interactions). diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index fe34c10e518..27d50b2f242 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -95,6 +95,8 @@ //limb is out and about, it can't really be considered an implant bodypart_flags &= ~BODYPART_IMPLANTED owner.remove_bodypart(src) + if(speed_modifier) + owner.update_bodypart_speed_modifier() for(var/datum/wound/wound as anything in wounds) wound.remove_wound(TRUE) @@ -336,6 +338,8 @@ if(hand) hand.update_appearance() new_limb_owner.update_worn_gloves() + if(speed_modifier) + new_limb_owner.update_bodypart_speed_modifier() if(special) //non conventional limb attachment for(var/datum/surgery/attach_surgery as anything in new_limb_owner.surgeries) //if we had an ongoing surgery to attach a new limb, we stop it. diff --git a/code/modules/surgery/bodyparts/species_parts/misc_bodyparts.dm b/code/modules/surgery/bodyparts/species_parts/misc_bodyparts.dm index 59e42912b67..8b2544d9e56 100644 --- a/code/modules/surgery/bodyparts/species_parts/misc_bodyparts.dm +++ b/code/modules/surgery/bodyparts/species_parts/misc_bodyparts.dm @@ -28,11 +28,13 @@ limb_id = SPECIES_SNAIL unarmed_damage_high = 0.5 burn_modifier = 2 + speed_modifier = 3 //disgustingly slow /obj/item/bodypart/leg/right/snail limb_id = SPECIES_SNAIL unarmed_damage_high = 0.5 burn_modifier = 2 + speed_modifier = 3 //disgustingly slow ///ABDUCTOR /obj/item/bodypart/head/abductor @@ -194,6 +196,16 @@ limb_id = SPECIES_ZOMBIE should_draw_greyscale = FALSE +/obj/item/bodypart/leg/left/zombie/infectious + limb_id = SPECIES_ZOMBIE + should_draw_greyscale = FALSE + speed_modifier = 0.8 //braaaaains + +/obj/item/bodypart/leg/right/zombie/infectious + limb_id = SPECIES_ZOMBIE + should_draw_greyscale = FALSE + speed_modifier = 0.8 //braaaaains + ///PODPEOPLE /obj/item/bodypart/head/pod limb_id = SPECIES_PODPERSON @@ -377,6 +389,7 @@ unarmed_damage_high = 21 unarmed_stun_threshold = 14 burn_modifier = 1.25 + speed_modifier = 0.75 //big big fungus /obj/item/bodypart/leg/right/mushroom limb_id = SPECIES_MUSHROOM @@ -384,6 +397,7 @@ unarmed_damage_high = 21 unarmed_stun_threshold = 14 burn_modifier = 1.25 + speed_modifier = 0.75 //big fungus big fungus //GOLEM /obj/item/bodypart/head/golem