Skip to content

Commit

Permalink
[MIRROR] Monkeys now use height offset (and monkey tail works) (#1886)
Browse files Browse the repository at this point in the history
* Monkeys now use height offset (and monkey tail works)

* Removes old screenshot tests

* Fixes

* Removals

* this needs updates too

* Modular

* Removes unneeded files

* .

* .

* Fix monkey screenshot test

---------

Co-authored-by: John Willard <[email protected]>
Co-authored-by: Mal <[email protected]>
Co-authored-by: SomeRandomOwl <[email protected]>
  • Loading branch information
4 people authored and StealsThePRs committed May 6, 2024
1 parent 4c0b8a4 commit 065d35b
Show file tree
Hide file tree
Showing 53 changed files with 222 additions and 259 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -60407,7 +60407,7 @@
desc = "A cold, hard place for your final rest.";
name = "Morgue Slab"
},
/mob/living/carbon/human/species/monkey/humand_legged{
/mob/living/carbon/human/species/monkey{
name = "Charles";
real_name = "Charles"
},
Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@
#define DNA_MOTH_MARKINGS_BLOCK 13
#define DNA_MUSHROOM_CAPS_BLOCK 14
#define DNA_POD_HAIR_BLOCK 15
#define DNA_MONKEY_TAIL_BLOCK 16
#define DNA_FEATURE_BLOCKS 15
#define DNA_FEATURE_BLOCKS 16
*/ //NOVA EDIT CHANGE - ORIGINAL
#define DNA_FEATURE_BLOCKS GLOB.dna_total_feature_blocks

Expand Down
16 changes: 14 additions & 2 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@
/// Total amount of slots
#define SLOTS_AMT 20 // Keep this up to date!

///Inventory slots that can be blacklisted by a species from being equipped into
DEFINE_BITFIELD(no_equip_flags, list(
"EXOSUIT" = ITEM_SLOT_OCLOTHING,
"JUMPSUIT" = ITEM_SLOT_ICLOTHING,
"GLOVES" = ITEM_SLOT_GLOVES,
"GLASSES" = ITEM_SLOT_EYES,
"EARPIECES" = ITEM_SLOT_EARS,
"MASKS" = ITEM_SLOT_MASK,
"HATS" = ITEM_SLOT_HEAD,
"SHOES" = ITEM_SLOT_FEET,
"BACKPACKS" = ITEM_SLOT_BACK,
"TIES" = ITEM_SLOT_NECK,
))

//SLOT GROUP HELPERS
#define ITEM_SLOT_POCKETS (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET)
/// Slots that are physically on you
Expand Down Expand Up @@ -153,8 +167,6 @@
#define CLOTHING_DIGITIGRADE_VARIATION (1<<1)
///The sprite works fine for digitigrade legs as-is.
#define CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON (1<<2)
///has a sprite for monkeys
#define CLOTHING_MONKEY_VARIATION (1<<3)
// NOVA EDIT ADDITION START
/// The sprite works fine for snouts.
#define CLOTHING_SNOUTED_VARIATION (1<<4)
Expand Down
21 changes: 11 additions & 10 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,13 @@
#define SPECIES_LIZARD_SILVER "silverscale"
#define SPECIES_NIGHTMARE "nightmare"
#define SPECIES_MONKEY "monkey"
#define SPECIES_MONKEY_FREAK "monkey_freak"
#define SPECIES_MONKEY_HUMAN_LEGGED "monkey_human_legged"
#define SPECIES_MOTH "moth"
#define SPECIES_MUSHROOM "mush"
#define SPECIES_PLASMAMAN "plasmaman"
#define SPECIES_PODPERSON "pod"
#define SPECIES_SHADOW "shadow"
#define SPECIES_SKELETON "skeleton"
#define SPECIES_SNAIL "snail"
#define SPECIES_TALLBOY "tallboy"
#define SPECIES_VAMPIRE "vampire"
#define SPECIES_ZOMBIE "zombie"
#define SPECIES_ZOMBIE_INFECTIOUS "memezombie"
Expand Down Expand Up @@ -649,18 +646,22 @@
// - They do not start at 0 for futureproofing
// - They skip numbers for futureproofing as well
// Otherwise they are completely arbitrary
#define HUMAN_HEIGHT_DWARF 2
#define HUMAN_HEIGHT_SHORTEST 4
#define HUMAN_HEIGHT_SHORT 6
#define HUMAN_HEIGHT_MEDIUM 8
#define HUMAN_HEIGHT_TALL 10
#define HUMAN_HEIGHT_TALLER 12
#define HUMAN_HEIGHT_TALLEST 14
#define MONKEY_HEIGHT_DWARF 2
#define MONKEY_HEIGHT_MEDIUM 4
#define HUMAN_HEIGHT_DWARF 6
#define HUMAN_HEIGHT_SHORTEST 8
#define HUMAN_HEIGHT_SHORT 10
#define HUMAN_HEIGHT_MEDIUM 12
#define HUMAN_HEIGHT_TALL 14
#define HUMAN_HEIGHT_TALLER 16
#define HUMAN_HEIGHT_TALLEST 18

/// Assoc list of all heights, cast to strings, to """"tuples"""""
/// The first """tuple""" index is the upper body offset
/// The second """tuple""" index is the lower body offset
GLOBAL_LIST_INIT(human_heights_to_offsets, list(
"[MONKEY_HEIGHT_DWARF]" = list(-9, -3),
"[MONKEY_HEIGHT_MEDIUM]" = list(-7, -4),
"[HUMAN_HEIGHT_DWARF]" = list(-5, -4),
"[HUMAN_HEIGHT_SHORTEST]" = list(-2, -1),
"[HUMAN_HEIGHT_SHORT]" = list(-1, -1),
Expand Down
5 changes: 0 additions & 5 deletions code/__DEFINES/research/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
GLOBAL_LIST_INIT(bioscrambler_parts_blacklist, typecacheof(list(
/obj/item/bodypart/chest/larva,
/obj/item/bodypart/head/larva,
// Re-add the ones below this line when the bug with offset is fixed
/obj/item/bodypart/leg/left/monkey,
/obj/item/bodypart/leg/right/monkey,
/obj/item/bodypart/leg/left/tallboy,
/obj/item/bodypart/leg/right/tallboy,
)))

/// Blacklist of organs which should not appear when bioscrambled.
Expand Down
4 changes: 0 additions & 4 deletions code/__DEFINES/species_clothing_paths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
///The dmi for humanoid oversuits
#define DEFAULT_SUIT_FILE 'icons/mob/clothing/suits/default.dmi'

//MONKEY PATHS
///The dmi for monkey uniforms
#define MONKEY_UNIFORM_FILE 'modular_nova/master_files/icons/mob/clothing/species/monkey/uniform.dmi' // NOVA EDIT CHANGE

//DIGITIGRADE PATHS
///The dmi containing digitigrade uniforms
#define DIGITIGRADE_UNIFORM_FILE 'modular_nova/master_files/icons/mob/clothing/uniform_digi.dmi' // NOVA EDIT CHANGE
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human, add_blank = TRUE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard, add_blank = TRUE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, GLOB.tails_list_monkey, add_blank = TRUE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, GLOB.tails_list_monkey, add_blank = FALSE)
init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/horns,GLOB.horns_list)
init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.ears_list)
Expand Down
1 change: 0 additions & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ DEFINE_BITFIELD(supports_variations_flags, list(
"CLOTHING_NO_VARIATION" = CLOTHING_NO_VARIATION,
"CLOTHING_DIGITIGRADE_VARIATION" = CLOTHING_DIGITIGRADE_VARIATION,
"CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON" = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON,
"CLOTHING_MONKEY_VARIATION" = CLOTHING_MONKEY_VARIATION, // NOVA EDIT ADDITION BEGIN
"CLOTHING_SNOUTED_VARIATION" = CLOTHING_SNOUTED_VARIATION,
"CLOTHING_SNOUTED_VARIATION_NO_NEW_ICON" = CLOTHING_SNOUTED_VARIATION_NO_NEW_ICON,
"CLOTHING_SNOUTED_VOX_VARIATION" = CLOTHING_SNOUTED_VOX_VARIATION,
Expand Down
10 changes: 10 additions & 0 deletions code/datums/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@
filter_data[name] = copied_parameters
update_filters()

///A version of add_filter that takes a list of filters to add rather than being individual, to limit calls to update_filters().
/datum/proc/add_filters(list/list/filters)
LAZYINITLIST(filter_data)
for(var/list/individual_filter as anything in filters)
var/list/params = individual_filter["params"]
var/list/copied_parameters = params.Copy()
copied_parameters["priority"] = individual_filter["priority"]
filter_data[individual_filter["name"]] = copied_parameters
update_filters()

/// Reapplies all the filters.
/datum/proc/update_filters()
ASSERT(isatom(src) || istype(src, /image))
Expand Down
8 changes: 7 additions & 1 deletion code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
L[DNA_TAIL_BLOCK] = construct_block(GLOB.tails_list_human.Find(features["tail_cat"]), GLOB.tails_list_human.len)
if(features["tail_lizard"])
L[DNA_LIZARD_TAIL_BLOCK] = construct_block(GLOB.tails_list_lizard.Find(features["tail_lizard"]), GLOB.tails_list_lizard.len)
if(features["tail_monkey"])
L[DNA_MONKEY_TAIL_BLOCK] = construct_block(GLOB.tails_list_monkey.Find(features["tail_monkey"]), GLOB.tails_list_monkey.len)
if(features["snout"])
L[DNA_SNOUT_BLOCK] = construct_block(GLOB.snouts_list.Find(features["snout"]), GLOB.snouts_list.len)
if(features["horns"])
Expand Down Expand Up @@ -391,6 +393,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
set_uni_feature_block(blocknumber, construct_block(GLOB.tails_list_human.Find(features["tail_cat"]), GLOB.tails_list_human.len))
if(DNA_LIZARD_TAIL_BLOCK)
set_uni_feature_block(blocknumber, construct_block(GLOB.tails_list_lizard.Find(features["tail_lizard"]), GLOB.tails_list_lizard.len))
if(DNA_MONKEY_TAIL_BLOCK)
set_uni_feature_block(blocknumber, construct_block(GLOB.tails_list_monkey.Find(features["tail_monkey"]), GLOB.tails_list_monkey.len))
if(DNA_SNOUT_BLOCK)
set_uni_feature_block(blocknumber, construct_block(GLOB.snouts_list.Find(features["snout"]), GLOB.snouts_list.len))
if(DNA_HORNS_BLOCK)
Expand Down Expand Up @@ -724,7 +728,9 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
if(dna.features["tail_cat"])
dna.features["tail_cat"] = GLOB.tails_list_human[deconstruct_block(get_uni_feature_block(features, DNA_TAIL_BLOCK), GLOB.tails_list_human.len)]
if(dna.features["tail_lizard"])
dna.features["tail_cat"] = GLOB.tails_list_lizard[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_TAIL_BLOCK), GLOB.tails_list_lizard.len)]
dna.features["tail_lizard"] = GLOB.tails_list_lizard[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_TAIL_BLOCK), GLOB.tails_list_lizard.len)]
if(dna.features["tail_monkey"])
dna.features["tail_monkey"] = GLOB.tails_list_monkey[deconstruct_block(get_uni_feature_block(features, DNA_MONKEY_TAIL_BLOCK), GLOB.tails_list_monkey.len)]
if(dna.features["ears"])
dna.features["ears"] = GLOB.ears_list[deconstruct_block(get_uni_feature_block(features, DNA_EARS_BLOCK), GLOB.ears_list.len)]
if(dna.features["moth_wings"])
Expand Down
14 changes: 6 additions & 8 deletions code/datums/sprite_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1742,17 +1742,17 @@
/datum/sprite_accessory/body_markings/dtiger
name = "Dark Tiger Body"
icon_state = "dtiger"
gender_specific = 1
gender_specific = TRUE

/datum/sprite_accessory/body_markings/ltiger
name = "Light Tiger Body"
icon_state = "ltiger"
gender_specific = 1
gender_specific = TRUE

/datum/sprite_accessory/body_markings/lbelly
name = "Light Belly"
icon_state = "lbelly"
gender_specific = 1
gender_specific = TRUE

/datum/sprite_accessory/tails
em_block = TRUE
Expand Down Expand Up @@ -1790,14 +1790,12 @@
icon_state = "default"
color_src = HAIR_COLOR

/datum/sprite_accessory/tails/monkey
/datum/sprite_accessory/tails/monkey/default
name = "Monkey"
icon = 'icons/mob/human/species/monkey/monkey_tail.dmi'
icon_state = "default"
color_src = FALSE

/datum/sprite_accessory/tails/monkey/standard
name = "Monkey"
icon_state = "monkey"

/datum/sprite_accessory/pod_hair
icon = 'icons/mob/human/species/podperson_hair.dmi'
em_block = TRUE
Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/player_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
if(isliving(M))

if(iscarbon(M)) //Carbon stuff
if(ismonkey(M))
M_job = "Monkey"
else if(ishuman(M))
if(ishuman(M) && M.job)
M_job = M.job
else if(ismonkey(M))
M_job = "Monkey"
else if(isalien(M)) //aliens
if(islarva(M))
M_job = "Alien larva"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
var/datum/action/cooldown/spell/conjure_item/clown_pockets/new_spell = new(victim)
new_spell.Grant(victim)
continue
if (!ismonkey(victim)) // Monkeys cannot yet wear clothes
dress_as_magic_clown(victim)
dress_as_magic_clown(victim)
if (prob(15))
create_vendetta(victim.mind, invoker.mind)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,6 @@
. = ..()
disconnect_from_area(area_to_unregister)

///adds a gas or list of gases to our filter_types. used so that the scrubber can check if its supposed to be processing after each change
/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/add_filters(filter_or_filters)
if(!islist(filter_or_filters))
filter_or_filters = list(filter_or_filters)

for(var/gas_to_filter in filter_or_filters)
var/translated_gas = istext(gas_to_filter) ? gas_id2path(gas_to_filter) : gas_to_filter

if(ispath(translated_gas, /datum/gas))
filter_types |= translated_gas
continue

atmos_conditions_changed()
return TRUE

///remove a gas or list of gases from our filter_types.used so that the scrubber can check if its supposed to be processing after each change
/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/remove_filters(filter_or_filters)
if(!islist(filter_or_filters))
Expand Down
15 changes: 15 additions & 0 deletions code/modules/client/preferences/species_features/monkey.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/datum/preference/choiced/monkey_tail
savefile_key = "feature_monkey_tail"
savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
relevant_external_organ = /obj/item/organ/external/tail/monkey

/datum/preference/choiced/monkey_tail/init_possible_values()
return assoc_to_keys_features(GLOB.tails_list_monkey)

/datum/preference/choiced/monkey_tail/apply_to_human(mob/living/carbon/human/target, value)
target.dna.features["tail_monkey"] = value

/datum/preference/choiced/monkey_tail/create_default_value()
var/datum/sprite_accessory/tails/monkey/default/tail = /datum/sprite_accessory/tails/monkey/default
return initial(tail.name)
1 change: 0 additions & 1 deletion code/modules/clothing/under/suits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
desc = "It's a very smart uniform with a special pocket for tip."
icon_state = "waiter"
inhand_icon_state = "waiter"
supports_variations_flags = CLOTHING_MONKEY_VARIATION

/obj/item/clothing/under/suit/black_really
name = "executive suit"
Expand Down
1 change: 0 additions & 1 deletion code/modules/clothing/under/syndicate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
alt_covers_chest = TRUE
icon = 'icons/obj/clothing/under/syndicate.dmi'
worn_icon = 'icons/mob/clothing/under/syndicate.dmi'
supports_variations_flags = CLOTHING_MONKEY_VARIATION

/datum/armor/clothing_under/syndicate
melee = 10
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,12 @@
if(M.active_storage?.attempt_insert(src, M))
return TRUE

var/list/obj/item/possible = list(M.get_inactive_held_item(), M.get_item_by_slot(ITEM_SLOT_BELT), M.get_item_by_slot(ITEM_SLOT_DEX_STORAGE), M.get_item_by_slot(ITEM_SLOT_BACK))
var/list/obj/item/possible = list(
M.get_inactive_held_item(),
M.get_item_by_slot(ITEM_SLOT_BELT),
M.get_item_by_slot(ITEM_SLOT_DEX_STORAGE),
M.get_item_by_slot(ITEM_SLOT_BACK),
)
for(var/i in possible)
if(!i)
continue
Expand Down
20 changes: 1 addition & 19 deletions code/modules/mob/living/carbon/carbon_update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@
var/old_key = icon_render_keys?[limb.body_zone] //Checks the mob's icon render key list for the bodypart
icon_render_keys[limb.body_zone] = (limb.is_husked) ? limb.generate_husk_key().Join() : limb.generate_icon_key().Join() //Generates a key for the current bodypart

if(icon_render_keys[limb.body_zone] != old_key || get_top_offset() != last_top_offset) //If the keys match, that means the limb doesn't need to be redrawn
if(icon_render_keys[limb.body_zone] != old_key) //If the keys match, that means the limb doesn't need to be redrawn
needs_update += limb

var/list/missing_bodyparts = get_missing_limbs()
Expand All @@ -499,15 +499,10 @@
for(var/obj/item/bodypart/limb as anything in bodyparts)
if(limb in needs_update)
var/bodypart_icon = limb.get_limb_icon()
if(!istype(limb, /obj/item/bodypart/leg))
var/top_offset = get_top_offset()
for(var/image/image as anything in bodypart_icon)
image.pixel_y += top_offset
new_limbs += bodypart_icon
limb_icon_cache[icon_render_keys[limb.body_zone]] = bodypart_icon //Caches the icon with the bodypart key, as it is new
else
new_limbs += limb_icon_cache[icon_render_keys[limb.body_zone]] //Pulls existing sprites from the cache
last_top_offset = get_top_offset()


remove_overlay(BODYPARTS_LAYER)
Expand All @@ -517,19 +512,6 @@

apply_overlay(BODYPARTS_LAYER)

/// This looks at the chest and legs of the mob and decides how much our chest, arms, and head should be adjusted. This is useful for limbs that are larger or smaller than the scope of normal human height while keeping the feet anchored to the bottom of the tile
/mob/living/carbon/proc/get_top_offset()
var/from_chest
var/from_leg
for(var/obj/item/bodypart/leg/leg_checked in bodyparts)
if(leg_checked.top_offset > from_leg || isnull(from_leg)) // We find the tallest leg available
from_leg = leg_checked.top_offset
if(isnull(from_leg))
from_leg = 0 // If we have no legs, we set this to zero to avoid any math issues that might stem from it being NULL
for(var/obj/item/bodypart/chest/chest_checked in bodyparts) // Take the height from the chest
from_chest = chest_checked.top_offset
return (from_chest + from_leg) // The total hight of the chest and legs together

/////////////////////////
// Limb Icon Cache 2.0 //
/////////////////////////
Expand Down
Loading

0 comments on commit 065d35b

Please sign in to comment.