Skip to content

Commit

Permalink
[MIRROR] SPECIES NUKING 2023: Refactors a bunch of species traits int…
Browse files Browse the repository at this point in the history
…o flags for the head bodypart [MDB IGNORE] (Skyrat-SS13#21991)

* SPECIES NUKING 2023: Refactors a bunch of species traits into flags for the head bodypart

* Makes it all compile, for now

* Fixes eye emissives not working right.

* Fixes the plasmaman head (oof conflicts)

* Fixes the screenshot tests

---------

Co-authored-by: ChungusGamer666 <[email protected]>
Co-authored-by: GoldenAlpharex <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2023
1 parent ca066b1 commit 7a50449
Show file tree
Hide file tree
Showing 92 changed files with 626 additions and 655 deletions.
33 changes: 12 additions & 21 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,24 @@
#define DNA_MUTATION_BLOCKS 8
#define DNA_UNIQUE_ENZYMES_LEN 32

//species traits for mutantraces
// species_traits list on /datum/species, please avoid adding more and use inherent_traits instead where possible
#define MUTCOLORS 1
#define HAIR 2
#define FACEHAIR 3
#define EYECOLOR 4
#define LIPS 5
#define NOTRANSSTING 7
#define NOZOMBIE 8
#define NO_UNDERWEAR 9
#define NO_DNA_COPY 10
#define DRINKSBLOOD 11

#define NOTRANSSTING 2
#define NOZOMBIE 3
#define NO_UNDERWEAR 4
#define NO_DNA_COPY 5
#define DRINKSBLOOD 6
/// 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 12
#define AGENDER 13
/// Do not draw eyes or eyeless overlay
#define NOEYESPRITES 14
#define DYNCOLORS 7
#define AGENDER 8
///If we have a limb-specific overlay sprite
#define HAS_MARKINGS 15
#define HAS_MARKINGS 9
/// Do not draw blood overlay
#define NOBLOODOVERLAY 16
#define NOBLOODOVERLAY 10
///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 17
#define NOAUGMENTS 11
///will be assigned a universal vampire themed last name shared by their department. this is preferenced!
#define BLOOD_CLANS 18
/// Similar to NOEYESPRITES but only excludes the eyeless overlay
#define NOEYEHOLES 19
#define BLOOD_CLANS 12

//organ slots
#define ORGAN_SLOT_ADAMANTINE_RESONATOR "adamantine_resonator"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define COLOR_ASSISTANT_OLIVE "#828163"
#define COLOR_VIBRANT_LIME "#00FF00"
#define COLOR_SERVICE_LIME "#58C800"
#define COLOR_JADE "#5EFB6E"
#define COLOR_LIME "#32CD32"
#define COLOR_DARK_LIME "#00aa00"
#define COLOR_VERY_PALE_LIME_GREEN "#DDFFD3"
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/sprite_accessories.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// ~color source defines for sprite accessories
/// Color of the sprite accessory will match the owner's mutant color, which is granted by certain species
#define MUTANT_COLOR "mutant_color"
/// Color of the sprite accessory will match the owner's hair color
#define HAIR_COLOR "hair_color"
/// Color of the sprite accessory will match the owner's facial hair color
#define FACIAL_HAIR_COLOR "facial_hair_color"
/// Color of the sprite accessory will match the owner's (left) eye color
#define EYE_COLOR "eye_color"
18 changes: 18 additions & 0 deletions code/__DEFINES/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@
///Bodypart does not get replaced during set_species()
#define BP_BLOCK_CHANGE_SPECIES (1<<0)

// Flags for the head_flags var on /obj/item/bodypart/head
/// Head can have hair
#define HEAD_HAIR (1<<0)
/// Head can have facial hair
#define HEAD_FACIAL_HAIR (1<<1)
/// Head can have lips
#define HEAD_LIPS (1<<2)
/// Head can have eye sprites
#define HEAD_EYESPRITES (1<<3)
/// Head will have colored eye sprites
#define HEAD_EYECOLOR (1<<4)
/// Head can have eyeholes when missing eyes
#define HEAD_EYEHOLES (1<<5)
/// Head can have debrain overlay
#define HEAD_DEBRAIN (1<<6)
/// All head flags, default for most heads
#define HEAD_ALL_FEATURES (HEAD_HAIR|HEAD_FACIAL_HAIR|HEAD_LIPS|HEAD_EYESPRITES|HEAD_EYECOLOR|HEAD_EYEHOLES|HEAD_DEBRAIN)

/// When the surgery step fails :(
#define SURGERY_STEP_FAIL -1

Expand Down
10 changes: 10 additions & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,16 @@ DEFINE_BITFIELD(change_exempt_flags, list(
"BP_BLOCK_CHANGE_SPECIES" = BP_BLOCK_CHANGE_SPECIES,
))

DEFINE_BITFIELD(head_flags, list(
"HEAD_HAIR" = HEAD_HAIR,
"HEAD_FACIAL_HAIR" = HEAD_FACIAL_HAIR,
"HEAD_LIPS" = HEAD_LIPS,
"HEAD_EYESPRITES" = HEAD_EYESPRITES,
"HEAD_EYECOLOR" = HEAD_EYECOLOR,
"HEAD_EYEHOLES" = HEAD_EYEHOLES,
"HEAD_DEBRAIN" = HEAD_DEBRAIN,
))

DEFINE_BITFIELD(supports_variations_flags, list(
"CLOTHING_NO_VARIATION" = CLOTHING_NO_VARIATION,
"CLOTHING_DIGITIGRADE_VARIATION" = CLOTHING_DIGITIGRADE_VARIATION,
Expand Down
11 changes: 5 additions & 6 deletions code/datums/mutations/body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@
. = ..()
if(.)//cant add
return TRUE

var/obj/item/organ/internal/brain/brain = owner.get_organ_slot(ORGAN_SLOT_BRAIN)
if(brain)
brain.zone = BODY_ZONE_CHEST
Expand All @@ -529,19 +530,18 @@
if(head)
owner.visible_message(span_warning("[owner]'s head splatters with a sickening crunch!"), ignored_mobs = list(owner))
new /obj/effect/gibspawner/generic(get_turf(owner), owner)
head.dismember(BRUTE)
head.dismember(dam_type = BRUTE, silent = TRUE)
head.drop_organs()
qdel(head)
owner.regenerate_icons()
RegisterSignal(owner, COMSIG_ATTEMPT_CARBON_ATTACH_LIMB, PROC_REF(abortattachment))
RegisterSignal(owner, COMSIG_ATTEMPT_CARBON_ATTACH_LIMB, PROC_REF(abort_attachment))

/datum/mutation/human/headless/on_losing()
. = ..()
if(.)
return TRUE
var/obj/item/organ/internal/brain/brain = owner.get_organ_slot(ORGAN_SLOT_BRAIN)
if(brain) //so this doesn't instantly kill you. we could delete the brain, but it lets people cure brain issues they /really/ shouldn't be
brain.zone = BODY_ZONE_HEAD
brain.zone = initial(brain.zone)
UnregisterSignal(owner, COMSIG_ATTEMPT_CARBON_ATTACH_LIMB)
var/successful = owner.regenerate_limb(BODY_ZONE_HEAD)
if(!successful)
Expand All @@ -552,8 +552,7 @@
owner.visible_message(span_warning("[owner]'s head returns with a sickening crunch!"), span_warning("Your head regrows with a sickening crack! Ouch."))
new /obj/effect/gibspawner/generic(get_turf(owner), owner)


/datum/mutation/human/headless/proc/abortattachment(datum/source, obj/item/bodypart/new_limb, special) //you aren't getting your head back
/datum/mutation/human/headless/proc/abort_attachment(datum/source, obj/item/bodypart/new_limb, special) //you aren't getting your head back
SIGNAL_HANDLER

if(istype(new_limb, /obj/item/bodypart/head))
Expand Down
4 changes: 1 addition & 3 deletions code/datums/wounds/_wounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@
set_limb(L)
LAZYADD(victim.all_wounds, src)
LAZYADD(limb.wounds, src)
//it's ok to not typecheck, humans are the only ones that deal with wounds
var/mob/living/carbon/human/human_victim = victim
no_bleeding = HAS_TRAIT(human_victim, TRAIT_NOBLOOD)
no_bleeding = HAS_TRAIT(victim, TRAIT_NOBLOOD)
update_descriptions()
limb.update_wounds()
if(status_effect_type)
Expand Down
Loading

0 comments on commit 7a50449

Please sign in to comment.