mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01:00
Moved a few monkeys features out of species code (+ updated a couple infusion organs) (#96735)
## About The Pull Request Title. I'm moving a few monkey features away from the species and into its bodyparts and organs. I plan on following up with another PR for the various `ismonkey()` in the code, as these are necessary changes for a niche thing I'm ultimately working on. Also one carp organ and one stoat organ both had bits of code made redundant by available traits. This takes care of them. Also removed the passwindow_on/off and passtable_on/off procs. We can just register the associated trait signals on init for living mobs (plus they were being misused on non-mobs). ## Why It's Good For The Game Less code associated directly to the species and more to its body parts and organs, which is basically something we've been doing for a few years ~~(also I need it for skeletonized monkeys)~~. ## Changelog N/A
This commit is contained in:
@@ -38,6 +38,12 @@
|
||||
/// Which functional (i.e. flightpotion) wing types (if any) does this bodypart support? If count is >1 a radial menu is used to choose between all icons in list
|
||||
var/list/wing_types = list(/obj/item/organ/wings/functional/angel)
|
||||
|
||||
/obj/item/bodypart/chest/apply_ownership(mob/living/carbon/new_owner)
|
||||
. = ..()
|
||||
if(ishuman(new_owner))
|
||||
var/mob/living/carbon/human/humie = new_owner
|
||||
humie.update_mob_height()
|
||||
|
||||
/obj/item/bodypart/chest/get_butcher_drops(force = FALSE)
|
||||
. = ..()
|
||||
if(!isnull(butcher_drops) && !force)
|
||||
@@ -67,6 +73,21 @@
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Calculates the expected height values for the holder of this bodypart
|
||||
*
|
||||
* Return a height value corresponding to a specific height filter
|
||||
* Return null to just use the mob's base height
|
||||
*/
|
||||
/obj/item/bodypart/chest/proc/update_mob_heights(mob/living/carbon/holder)
|
||||
if(HAS_TRAIT(holder, TRAIT_DWARF))
|
||||
return HUMAN_HEIGHT_DWARF
|
||||
|
||||
if(HAS_TRAIT(holder, TRAIT_TOO_TALL))
|
||||
return HUMAN_HEIGHT_TALLEST
|
||||
|
||||
return null
|
||||
|
||||
/obj/item/bodypart/chest/Destroy()
|
||||
QDEL_NULL(cavity_item)
|
||||
QDEL_NULL(worn_uniform_offset)
|
||||
|
||||
@@ -37,6 +37,12 @@
|
||||
bodyshape = BODYSHAPE_MONKEY
|
||||
acceptable_bodyshape = BODYSHAPE_MONKEY
|
||||
dmg_overlay_type = SPECIES_MONKEY
|
||||
bodypart_traits = list(
|
||||
TRAIT_PASSTABLE,
|
||||
TRAIT_VENTCRAWLER_NUDE,
|
||||
TRAIT_NO_AUGMENTS,
|
||||
TRAIT_NO_UNDERWEAR,
|
||||
)
|
||||
|
||||
/obj/item/bodypart/chest/monkey/Initialize(mapload)
|
||||
worn_neck_offset = new(
|
||||
@@ -46,6 +52,15 @@
|
||||
)
|
||||
return ..()
|
||||
|
||||
/obj/item/bodypart/chest/monkey/update_mob_heights(mob/living/carbon/holder)
|
||||
if(HAS_TRAIT(holder, TRAIT_DWARF))
|
||||
return MONKEY_HEIGHT_DWARF
|
||||
|
||||
if(HAS_TRAIT(holder, TRAIT_TOO_TALL))
|
||||
return MONKEY_HEIGHT_TALL
|
||||
|
||||
return MONKEY_HEIGHT_MEDIUM
|
||||
|
||||
/obj/item/bodypart/arm/left/monkey
|
||||
icon = 'icons/mob/human/species/monkey/bodyparts.dmi'
|
||||
icon_static = 'icons/mob/human/species/monkey/bodyparts.dmi'
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
human.add_traits(list(TRAIT_MOVE_FLOATING, TRAIT_IGNORING_GRAVITY, TRAIT_NOGRAV_ALWAYS_DRIFT), SPECIES_FLIGHT_TRAIT)
|
||||
human.add_movespeed_modifier(/datum/movespeed_modifier/jetpack/wings)
|
||||
human.AddElement(/datum/element/forced_gravity, 0)
|
||||
passtable_on(human, SPECIES_FLIGHT_TRAIT)
|
||||
ADD_TRAIT(human, TRAIT_PASSTABLE, SPECIES_FLIGHT_TRAIT)
|
||||
open_wings()
|
||||
to_chat(human, span_notice("You beat your wings and begin to hover gently above the ground..."))
|
||||
human.set_resting(FALSE, TRUE)
|
||||
@@ -135,7 +135,7 @@
|
||||
human.remove_traits(list(TRAIT_MOVE_FLOATING, TRAIT_IGNORING_GRAVITY, TRAIT_NOGRAV_ALWAYS_DRIFT), SPECIES_FLIGHT_TRAIT)
|
||||
human.remove_movespeed_modifier(/datum/movespeed_modifier/jetpack/wings)
|
||||
human.RemoveElement(/datum/element/forced_gravity, 0)
|
||||
passtable_off(human, SPECIES_FLIGHT_TRAIT)
|
||||
REMOVE_TRAIT(human, TRAIT_PASSTABLE, SPECIES_FLIGHT_TRAIT)
|
||||
to_chat(human, span_notice("You settle gently back onto the ground..."))
|
||||
close_wings()
|
||||
human.refresh_gravity()
|
||||
|
||||
@@ -105,11 +105,11 @@
|
||||
|
||||
if(is_portable)
|
||||
interaction_flags_item |= INTERACT_ITEM_ATTACK_HAND_PICKUP
|
||||
passtable_on(src, type)
|
||||
pass_flags |= PASSTABLE
|
||||
RemoveElement(/datum/element/noisy_movement)
|
||||
else
|
||||
interaction_flags_item &= ~INTERACT_ITEM_ATTACK_HAND_PICKUP
|
||||
passtable_off(src, type)
|
||||
pass_flags &= ~PASSTABLE
|
||||
AddElement(/datum/element/noisy_movement)
|
||||
|
||||
update_appearance()
|
||||
|
||||
Reference in New Issue
Block a user