Skip to content

Commit

Permalink
rewrites simian fur coloring into a species trait similar to etherals…
Browse files Browse the repository at this point in the history
… DYNCOLORS
  • Loading branch information
dwasint committed Oct 23, 2023
1 parent ce47a76 commit f1c48df
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 123 deletions.
21 changes: 11 additions & 10 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,25 @@
#define SKINTONES 12
#define ANIME 13
#define MUTCOLORS_SECONDARY 14
#define SPECIES_FUR 15

/// Use this if you want to change the race's color without the player being able to pick their own color. AKA special color shifting
#define DYNCOLORS 15
#define AGENDER 16
#define DYNCOLORS 16
#define AGENDER 17
/// Do not draw eyes or eyeless overlay
#define NOEYESPRITES 17
#define NOEYESPRITES 18
///If we have a limb-specific overlay sprite
#define HAS_MARKINGS 18
#define HAS_MARKINGS 19
/// Do not draw blood overlay
#define NOBLOODOVERLAY 19
#define NOBLOODOVERLAY 20
///No augments, for monkeys in specific because they will turn into fucking freakazoids https://cdn.discordapp.com/attachments/326831214667235328/791313258912153640/102707682-fa7cad80-4294-11eb-8f13-8c689468aeb0.png
#define NOAUGMENTS 20
#define NOAUGMENTS 21
///will be assigned a universal vampire themed last name shared by their department. this is preferenced!
#define BLOOD_CLANS 21
#define BLOOD_CLANS 22

#define REVIVESBYHEALING 22
#define NOHUSK 23
#define NOMOUTH 24
#define REVIVESBYHEALING 23
#define NOHUSK 24
#define NOMOUTH 25

//organ slots
#define ORGAN_SLOT_ADAMANTINE_RESONATOR "adamantine_resonator"
Expand Down
1 change: 0 additions & 1 deletion code/modules/client/preferences/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
data[species_id]["desc"] = species.get_species_description()
data[species_id]["icon"] = sanitize_css_class_name(species.name)
data[species_id]["use_skintones"] = species.use_skintones
data[species_id]["use_fur"] = species.use_fur
data[species_id]["sexes"] = species.sexes
data[species_id]["enabled_features"] = species.get_features()
data[species_id]["perks"] = species.get_species_perks()
Expand Down
5 changes: 2 additions & 3 deletions code/modules/mob/living/carbon/human/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ GLOBAL_LIST_EMPTY(features_by_species)

///What gas does this species breathe? Used by suffocation screen alerts, most of actual gas breathing is handled by mutantlungs. See [life.dm][code/modules/mob/living/carbon/human/life.dm]
var/breathid = "o2"

///are we a furry little guy?
var/uses_fur = FALSE
///What anim to use for dusting
var/dust_anim = "dust-h"
///What anim to use for gibbing
Expand Down Expand Up @@ -241,8 +242,6 @@ GLOBAL_LIST_EMPTY(features_by_species)
///A list containing outfits that will be overridden in the species_equip_outfit proc. [Key = Typepath passed in] [Value = Typepath of outfit you want to equip for this specific species instead].
var/list/outfit_override_registry = list()

///are we furry little creatures
var/use_fur = FALSE
///health mod of a species
var/maxhealthmod = 1
///Path to BODYTYPE_CUSTOM species worn icons. An assoc list of ITEM_SLOT_X => /icon
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
msg += "[t_He] look[p_s()] extremely disgusted.\n"

var/apparent_blood_volume = blood_volume
if((dna.species.use_skintones || dna.species.use_fur)&& skin_tone == "albino")
if((dna.species.use_skintones)&& skin_tone == "albino")
apparent_blood_volume -= 150 // enough to knock you down one tier
switch(apparent_blood_volume)
if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/surgery/bodyparts/_bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,12 @@
species_flags_list = owner_species.species_traits
limb_gender = (human_owner.physique == MALE) ? "m" : "f"

if(owner_species.use_skintones || owner_species.use_fur)
if(owner_species.use_skintones)
skin_tone = human_owner.skin_tone
else
skin_tone = ""

if(((MUTCOLORS in owner_species.species_traits) || (DYNCOLORS in owner_species.species_traits))) //Ethereal code. Motherfuckers.
if(((MUTCOLORS in owner_species.species_traits) || (DYNCOLORS in owner_species.species_traits) || (SPECIES_FUR in owner_species.species_traits))) //Ethereal code. Motherfuckers.
if(owner_species.fixed_mut_color)
species_color = owner_species.fixed_mut_color
else
Expand Down
19 changes: 0 additions & 19 deletions monkestation/code/__HELPERS/mobs.dm

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
/datum/preference/choiced/fur_color
/datum/preference/color/fur_color
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "fur"
relevant_species_trait = SPECIES_FUR

/datum/preference/choiced/fur_color/init_possible_values()
return GLOB.fur_tones

/datum/preference/choiced/fur_color/compile_constant_data()
var/list/data = ..()

data[CHOICED_PREFERENCE_DISPLAY_NAMES] = GLOB.fur_tone_names

var/list/to_hex = list()
for (var/choice in get_choices())
var/list/hsl = rgb2num("#[choice]", COLORSPACE_HSL)

to_hex[choice] = list(
"lightness" = hsl[3],
"value" = "#[choice]",
)

data["to_hex"] = to_hex

return data

/datum/preference/choiced/fur_color/apply_to_human(mob/living/carbon/human/target, value)
if(target.dna.species.use_fur)
target.skin_tone = value

/datum/preference/choiced/fur_color/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE

var/datum/species/species_type = preferences.read_preference(/datum/preference/choiced/species)
return initial(species_type.use_fur)
/datum/preference/color/fur_color/apply_to_human(mob/living/carbon/human/target, value)
var/mob/user = usr
var/datum/species/species_type = user?.client.prefs.read_preference(/datum/preference/choiced/species)
if(initial(species_type.uses_fur))
target.dna.features["mcolor"] = value

/datum/preference/choiced/simian_tail
savefile_key = "feature_tail_monkey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
species_traits = list(
EYECOLOR,
LIPS,
NO_UNDERWEAR
NO_UNDERWEAR,
SPECIES_FUR,
)
inherent_traits = list(
TRAIT_VAULTING,
Expand All @@ -17,7 +18,6 @@
)

use_skintones = FALSE
use_fur = TRUE

inherent_biotypes = list(
MOB_ORGANIC,
Expand All @@ -30,6 +30,7 @@
skinned_type = /obj/item/stack/sheet/animalhide/monkey
disliked_food = GROSS
liked_food = FRUIT | MEAT
uses_fur = TRUE
//deathsound = 'monkestation/sound/voice/simian/deathsound.ogg'
species_language_holder = /datum/language_holder/monkey
maxhealthmod = 0.85 //small = weak
Expand Down
1 change: 0 additions & 1 deletion tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5469,7 +5469,6 @@
#include "interface\skin.dmf"
#include "monkestation\code\__DEFINES\projectile.dm"
#include "monkestation\code\__HELPERS\_lists.dm"
#include "monkestation\code\__HELPERS\mobs.dm"
#include "monkestation\code\__HELPERS\reagents.dm"
#include "monkestation\code\__HELPERS\turfs.dm"
#include "monkestation\code\_onclick\hud\alert.dm"
Expand Down
1 change: 0 additions & 1 deletion tgui/packages/tgui/interfaces/PreferencesMenu/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export type Species = {
icon: string;

use_skintones: BooleanLike;
use_fur: BooleanLike;
sexes: BooleanLike;

enabled_features: string[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,34 @@
import { sortBy } from 'common/collections';
import { Box, Stack } from '../../../../../../components';
import { Feature, FeatureChoicedServerData, FeatureValueProps, StandardizedDropdown } from '../../base';

type HexValue = {
lightness: number;
value: string;
};

type FurServerData = FeatureChoicedServerData & {
display_names: NonNullable<FeatureChoicedServerData['display_names']>;
to_hex: Record<string, HexValue>;
import { Feature, FeatureValueProps, StandardizedPalette } from '../../base';

const furPresets = {
// these need to be short color (3 byte) compatible
'#ffffff': 'Albino',
'#ffb089': 'Chimp',
'#aeafb3': 'Grey',
'#bfd0ca': 'Snow',
'#ce7d54': 'Orange',
'#c47373': 'Red',
'#f4e2d5': 'Cream',
};

const sortHexValues = sortBy<[string, HexValue]>(
([_, hexValue]) => -hexValue.lightness
);

export const fur: Feature<string, string, FurServerData> = {
name: 'Fur coloring',
component: (props: FeatureValueProps<string, string, FurServerData>) => {
const { handleSetValue, serverData, value } = props;

if (!serverData) {
return null;
}
export const fur: Feature<string> = {
name: 'Fur Color',
small_supplemental: false,
predictable: false,
component: (props: FeatureValueProps<string>) => {
const { handleSetValue, value, featureId, act } = props;

return (
<StandardizedDropdown
choices={sortHexValues(Object.entries(serverData.to_hex)).map(
([key]) => key
)}
displayNames={Object.fromEntries(
Object.entries(serverData.display_names).map(([key, displayName]) => {
const hexColor = serverData.to_hex[key];

return [
key,
<Stack align="center" fill key={key}>
<Stack.Item>
<Box
style={{
background: hexColor.value,
'box-sizing': 'content-box',
'height': '11px',
'width': '11px',
}}
/>
</Stack.Item>

<Stack.Item grow>{displayName}</Stack.Item>
</Stack>,
];
})
)}
<StandardizedPalette
choices={Object.keys(furPresets)}
displayNames={furPresets}
onSetValue={handleSetValue}
value={value}
hex_values
featureId={featureId}
act={act}
maxWidth="100%"
includeHex
/>
);
},
Expand Down

0 comments on commit f1c48df

Please sign in to comment.