Skip to content

Commit

Permalink
Merge pull request #17 from DopplerShift13/mutant-markings
Browse files Browse the repository at this point in the history
Cherry-pick mutant organ & marking changes from tgstation
  • Loading branch information
Ephemeralis authored Aug 29, 2024
2 parents 6a5e176 + ad7ef37 commit 6cd37f6
Show file tree
Hide file tree
Showing 69 changed files with 337 additions and 541 deletions.
5 changes: 4 additions & 1 deletion code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@
///The species is forced to have digitigrade legs in generation.
#define DIGITIGRADE_FORCED 2

///Digitigrade's prefs, used in features for legs if you're meant to be a Digitigrade.
// Preferences for leg types
/// Legs that are normal
#define NORMAL_LEGS "Normal Legs"
/// Digitgrade legs that are like bended and uhhh no shoes
#define DIGITIGRADE_LEGS "Digitigrade Legs"

// Health/damage defines
Expand Down
2 changes: 0 additions & 2 deletions code/__HELPERS/duplicating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars, list(
"contents",
"cooldowns",
"_datum_components",
"external_organs",
"external_organs_slot",
"group",
"hand_bodyparts",
"held_items",
Expand Down
4 changes: 1 addition & 3 deletions code/controllers/subsystem/sprite_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity
var/list/horns_list
var/list/frills_list
var/list/spines_list
var/list/legs_list
var/list/tail_spines_list

//Mutant Human bits
Expand Down Expand Up @@ -87,7 +86,7 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity

socks_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/socks)[DEFAULT_SPRITE_LIST]

lizard_markings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/lizard_markings, add_blank = TRUE)[DEFAULT_SPRITE_LIST]
lizard_markings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/lizard_markings)[DEFAULT_SPRITE_LIST]
tails_list_human = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, add_blank = TRUE)[DEFAULT_SPRITE_LIST]
tails_list_lizard = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard)[DEFAULT_SPRITE_LIST]
tails_list_monkey = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey)[DEFAULT_SPRITE_LIST]
Expand All @@ -99,7 +98,6 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity
frills_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, add_blank = TRUE)[DEFAULT_SPRITE_LIST]
spines_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, add_blank = TRUE)[DEFAULT_SPRITE_LIST]
tail_spines_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/tail_spines, add_blank = TRUE)[DEFAULT_SPRITE_LIST]
legs_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/legs)[DEFAULT_SPRITE_LIST]
caps_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/caps)[DEFAULT_SPRITE_LIST]
moth_wings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_wings)[DEFAULT_SPRITE_LIST]
moth_antennae_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_antennae)[DEFAULT_SPRITE_LIST]
Expand Down
2 changes: 1 addition & 1 deletion code/datums/bodypart_overlays/markings_bodypart_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/datum/bodypart_overlay/simple/body_marking/get_image(layer, obj/item/bodypart/limb)
var/gender_string = (use_gender && limb.is_dimorphic) ? (limb.gender == MALE ? MALE : FEMALE + "_") : "" //we only got male and female sprites
return mutable_appearance(icon, gender_string + icon_state + "_" + limb.body_zone, layer = layer)
return image(icon, gender_string + icon_state + "_" + limb.body_zone, layer = layer)

/datum/bodypart_overlay/simple/body_marking/moth
dna_feature_key = "moth_markings"
Expand Down
20 changes: 19 additions & 1 deletion code/datums/bodypart_overlays/mutant_bodypart_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
///Take on the dna/preference from whoever we're gonna be inserted in
var/imprint_on_next_insertion = TRUE

/datum/bodypart_overlay/mutant/New(obj/item/organ/attached_organ)
. = ..()

RegisterSignal(attached_organ, COMSIG_ORGAN_IMPLANTED, PROC_REF(on_mob_insert))

/datum/bodypart_overlay/mutant/proc/on_mob_insert(obj/item/organ/parent, mob/living/carbon/receiver)
SIGNAL_HANDLER

if(!should_visual_organ_apply_to(parent.type, receiver))
stack_trace("adding a [parent.type] to a [receiver.type] when it shouldn't be!")

if(imprint_on_next_insertion) //We only want this set *once*
var/feature_name = receiver.dna.features[feature_key]
if (isnull(feature_name))
feature_name = receiver.dna.species.mutant_organs[parent.type]
set_appearance_from_name(feature_name)
imprint_on_next_insertion = FALSE

/datum/bodypart_overlay/mutant/get_overlay(layer, obj/item/bodypart/limb)
inherit_color(limb) // If draw_color is not set yet, go ahead and do that
return ..()
Expand Down Expand Up @@ -67,7 +85,6 @@
return appearance

/datum/bodypart_overlay/mutant/color_image(image/overlay, layer, obj/item/bodypart/limb)

overlay.color = sprite_datum.color_src ? draw_color : null

/datum/bodypart_overlay/mutant/added_to_limb(obj/item/bodypart/limb)
Expand Down Expand Up @@ -139,3 +156,4 @@
CRASH("External organ [type] couldn't find sprite accessory [accessory_name]!")
else
CRASH("External organ [type] had fetch_sprite_datum called with a null accessory name!")

4 changes: 2 additions & 2 deletions code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
if(dna.features["pod_hair"])
dna.features["pod_hair"] = SSaccessories.pod_hair_list[deconstruct_block(get_uni_feature_block(features, DNA_POD_HAIR_BLOCK), length(SSaccessories.pod_hair_list))]

for(var/obj/item/organ/external/external_organ in organs)
external_organ.mutate_feature(features, src)
for(var/obj/item/organ/organ in organs)
organ.mutate_feature(features, src)

if(icon_update)
update_body(is_creating = mutcolor_update)
Expand Down
8 changes: 4 additions & 4 deletions code/datums/quirks/neutral_quirks/transhumanist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@
else if(isorgan(new_part))
var/obj/item/organ/new_organ = new_part
old_part = human_holder.get_organ_slot(new_organ.slot)
if(new_organ.Insert(human_holder, special = TRUE))
old_part.moveToNullspace()
STOP_PROCESSING(SSobj, old_part)
slot_string = new_organ.name
new_organ.Insert(human_holder, special = TRUE)
old_part.moveToNullspace()
STOP_PROCESSING(SSobj, old_part)
slot_string = new_organ.name

/datum/quirk/transhumanist/post_add()
if(!slot_string)
Expand Down
18 changes: 4 additions & 14 deletions code/datums/sprite_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* This is the source that this accessory will get its color from. Default is MUTCOLOR, but can also be HAIR, FACEHAIR, EYECOLOR and 0 if none.
*/
var/color_src = MUTANT_COLOR
/// Decides if this sprite has an "inner" part, such as the fleshy parts on ears.
var/hasinner = FALSE
/// Is this part locked from roundstart selection? Used for parts that apply effects.
var/locked = FALSE
/// Should we center the sprite?
Expand Down Expand Up @@ -1726,6 +1724,10 @@
/datum/sprite_accessory/lizard_markings
icon = 'icons/mob/human/species/lizard/lizard_markings.dmi'

/datum/sprite_accessory/lizard_markings/none
name = "None"
icon_state = "none"

/datum/sprite_accessory/lizard_markings/dtiger
name = "Dark Tiger Body"
icon_state = "dtiger"
Expand Down Expand Up @@ -1890,7 +1892,6 @@
/datum/sprite_accessory/ears/cat
name = "Cat"
icon_state = "cat"
hasinner = TRUE
color_src = HAIR_COLOR

/datum/sprite_accessory/ears/cat/big
Expand All @@ -1917,7 +1918,6 @@
icon = 'icons/mob/human/fox_features.dmi'
name = "Fox"
icon_state = "fox"
hasinner = TRUE
color_src = HAIR_COLOR
locked = TRUE

Expand Down Expand Up @@ -2124,16 +2124,6 @@
name = "Aquatic"
icon_state = "aqua"

/datum/sprite_accessory/legs //legs are a special case, they aren't actually sprite_accessories but are updated with them.
icon = null //These datums exist for selecting legs on preference, and little else
em_block = TRUE

/datum/sprite_accessory/legs/none
name = "Normal Legs"

/datum/sprite_accessory/legs/digitigrade_lizard
name = DIGITIGRADE_LEGS

/datum/sprite_accessory/caps
icon = 'icons/mob/human/species/mush_cap.dmi'
color_src = HAIR_COLOR
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/dna_infuser/organ_sets/fly_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
//useless organs we throw in just to fuck with surgeons a bit more. they aren't part of a bonus, just the (absolute) state of flies
/obj/item/organ/internal/fly
desc = FLY_INFUSED_ORGAN_DESC
visual = FALSE

/obj/item/organ/internal/fly/Initialize(mapload)
. = ..()
Expand Down
15 changes: 1 addition & 14 deletions code/game/machinery/dna_infuser/organ_sets/fox_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,4 @@
visual = TRUE
damage_multiplier = 2

/obj/item/organ/internal/ears/fox/on_mob_insert(mob/living/carbon/human/ear_owner)
. = ..()
if(istype(ear_owner) && ear_owner.dna)
color = ear_owner.hair_color
ear_owner.dna.features["ears"] = ear_owner.dna.species.mutant_bodyparts["ears"] = "Fox"
ear_owner.dna.update_uf_block(DNA_EARS_BLOCK)
ear_owner.update_body()

/obj/item/organ/internal/ears/fox/on_mob_remove(mob/living/carbon/human/ear_owner)
. = ..()
if(istype(ear_owner) && ear_owner.dna)
color = ear_owner.hair_color
ear_owner.dna.species.mutant_bodyparts -= "ears"
ear_owner.update_body()
sprite_accessory_override = /datum/sprite_accessory/ears/fox
12 changes: 6 additions & 6 deletions code/game/machinery/dna_infuser/organ_sets/gondola_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Fluoride Stare: After someone says 5 words, blah blah blah...
AddElement(/datum/element/noticable_organ, "%PRONOUN_They radiate%PRONOUN_s an aura of serenity.")
AddElement(/datum/element/update_icon_blocker)

/obj/item/organ/internal/heart/gondola/Insert(mob/living/carbon/receiver, special, movement_flags)
/obj/item/organ/internal/heart/gondola/mob_insert(mob/living/carbon/receiver, special, movement_flags)
. = ..()
if(!(FACTION_HOSTILE in receiver.faction))
factions_to_remove += FACTION_HOSTILE
if(!(FACTION_MINING in receiver.faction))
factions_to_remove += FACTION_MINING
receiver.faction |= list(FACTION_HOSTILE, FACTION_MINING)

/obj/item/organ/internal/heart/gondola/Remove(mob/living/carbon/heartless, special, movement_flags)
/obj/item/organ/internal/heart/gondola/mob_remove(mob/living/carbon/heartless, special, movement_flags)
. = ..()
for(var/faction in factions_to_remove)
heartless.faction -= faction
Expand All @@ -64,11 +64,11 @@ Fluoride Stare: After someone says 5 words, blah blah blah...
AddElement(/datum/element/noticable_organ, "%PRONOUN_Their mouth is permanently affixed into a relaxed smile.", BODY_ZONE_PRECISE_MOUTH)
AddElement(/datum/element/organ_set_bonus, /datum/status_effect/organ_set_bonus/gondola)

/obj/item/organ/internal/tongue/gondola/Insert(mob/living/carbon/tongue_owner, special, movement_flags)
/obj/item/organ/internal/tongue/gondola/mob_insert(mob/living/carbon/tongue_owner, special, movement_flags)
. = ..()
tongue_owner.add_mood_event("gondola_zen", /datum/mood_event/gondola_serenity)

/obj/item/organ/internal/tongue/gondola/Remove(mob/living/carbon/tongue_owner, special, movement_flags)
/obj/item/organ/internal/tongue/gondola/mob_remove(mob/living/carbon/tongue_owner, special, movement_flags)
tongue_owner.clear_mood_event("gondola_zen")
return ..()

Expand All @@ -87,7 +87,7 @@ Fluoride Stare: After someone says 5 words, blah blah blah...
AddElement(/datum/element/noticable_organ, "%PRONOUN_Their left arm has small needles breaching the skin all over it.", BODY_ZONE_L_ARM)
AddElement(/datum/element/noticable_organ, "%PRONOUN_Their right arm has small needles breaching the skin all over it.", BODY_ZONE_R_ARM)

/obj/item/organ/internal/liver/gondola/Insert(mob/living/carbon/liver_owner, special, movement_flags)
/obj/item/organ/internal/liver/gondola/mob_insert(mob/living/carbon/liver_owner, special, movement_flags)
. = ..()
var/has_left = liver_owner.has_left_hand(check_disabled = FALSE)
var/has_right = liver_owner.has_right_hand(check_disabled = FALSE)
Expand All @@ -102,7 +102,7 @@ Fluoride Stare: After someone says 5 words, blah blah blah...
RegisterSignal(liver_owner, COMSIG_LIVING_TRY_PULL, PROC_REF(on_owner_try_pull))
RegisterSignal(liver_owner, COMSIG_CARBON_HELPED, PROC_REF(on_hug))

/obj/item/organ/internal/liver/gondola/Remove(mob/living/carbon/liver_owner, special, movement_flags)
/obj/item/organ/internal/liver/gondola/mob_remove(mob/living/carbon/liver_owner, special, movement_flags)
. = ..()
UnregisterSignal(liver_owner, list(COMSIG_HUMAN_EQUIPPING_ITEM, COMSIG_LIVING_TRY_PULL, COMSIG_CARBON_HELPED))

Expand Down
7 changes: 3 additions & 4 deletions code/game/objects/items/body_egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
if(iscarbon(loc))
Insert(loc)

/obj/item/organ/internal/body_egg/Insert(mob/living/carbon/egg_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED)
/obj/item/organ/internal/body_egg/mob_insert(mob/living/carbon/egg_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED)
. = ..()
if(!.)
return

egg_owner.add_traits(list(TRAIT_XENO_HOST, TRAIT_XENO_IMMUNE), ORGAN_TRAIT)
egg_owner.med_hud_set_status()
INVOKE_ASYNC(src, PROC_REF(AddInfectionImages), egg_owner)

/obj/item/organ/internal/body_egg/Remove(mob/living/carbon/egg_owner, special, movement_flags)
/obj/item/organ/internal/body_egg/mob_remove(mob/living/carbon/egg_owner, special, movement_flags)
. = ..()
egg_owner.remove_traits(list(TRAIT_XENO_HOST, TRAIT_XENO_IMMUNE), ORGAN_TRAIT)
egg_owner.med_hud_set_status()
Expand Down
5 changes: 1 addition & 4 deletions code/modules/admin/verbs/manipulate_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ ADMIN_VERB(manipulate_organs, R_DEBUG, "Manipulate Organs", "Manipulate the orga
return
organ_to_grant = organs[organ_to_grant]
organ_to_grant = new organ_to_grant
if(!organ_to_grant.Insert(carbon_victim))
to_chat(user, span_notice("[carbon_victim] is unable to carry this organ!"))
qdel(organ_to_grant)
return
organ_to_grant.Insert(carbon_victim)
log_admin("[key_name(user)] has added organ [organ_to_grant.type] to [key_name(carbon_victim)]")
message_admins("[key_name_admin(user)] has added organ [organ_to_grant.type] to [ADMIN_LOOKUPFLW(carbon_victim)]")

Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/secrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ ADMIN_VERB(secrets, R_NONE, "Secrets", "Abuse harder than you ever have before w
var/forename = names.len > 1 ? names[2] : names[1]
var/newname = "[forename]-[pick(honorifics["[H.gender]"])]"
H.fully_replace_character_name(H.real_name,newname)
H.update_mutant_bodyparts()
H.update_body_parts()
if(animetype == "Yes")
var/seifuku = pick(typesof(/obj/item/clothing/under/costume/schoolgirl))
var/obj/item/clothing/under/costume/schoolgirl/I = new seifuku
Expand Down
6 changes: 2 additions & 4 deletions code/modules/antagonists/abductor/equipment/gland.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
active_mind_control = FALSE
return TRUE

/obj/item/organ/internal/heart/gland/Remove(mob/living/carbon/gland_owner, special, movement_flags)
/obj/item/organ/internal/heart/gland/mob_remove(mob/living/carbon/gland_owner, special, movement_flags)
. = ..()
active = FALSE
if(initial(uses) == 1)
Expand All @@ -93,10 +93,8 @@
hud.remove_atom_from_hud(gland_owner)
clear_mind_control()

/obj/item/organ/internal/heart/gland/Insert(mob/living/carbon/gland_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED)
/obj/item/organ/internal/heart/gland/mob_insert(mob/living/carbon/gland_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED)
. = ..()
if(!.)
return

if(special != 2 && uses) // Special 2 means abductor surgery
Start()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/antagonists/changeling/headslug_eggs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
/// When this egg last got removed from a body. If -1, the egg hasn't been removed from a body.
var/removal_time = -1

/obj/item/organ/internal/body_egg/changeling_egg/Insert(mob/living/carbon/egg_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED)
/obj/item/organ/internal/body_egg/changeling_egg/mob_insert(mob/living/carbon/egg_owner, special = FALSE, movement_flags = DELETE_IF_REPLACED)
. = ..()
hatch_time = world.time + (removal_time == -1 ? EGG_INCUBATION_TIME : (hatch_time - removal_time))

/obj/item/organ/internal/body_egg/changeling_egg/Remove(mob/living/carbon/egg_owner, special, movement_flags)
/obj/item/organ/internal/body_egg/changeling_egg/mob_remove(mob/living/carbon/egg_owner, special, movement_flags)
. = ..()
removal_time = world.time

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,20 +416,13 @@
usable_organs -= /obj/item/organ/internal/lungs/corrupt // Their lungs are already more cursed than anything I could give them

var/total_implant = rand(2, 4)
var/gave_any = FALSE

for (var/i in 1 to total_implant)
if (!length(usable_organs))
break
return
var/organ_path = pick_n_take(usable_organs)
var/obj/item/organ/internal/to_give = new organ_path
if (!to_give.Insert(sac_target))
qdel(to_give)
else
gave_any = TRUE

if (!gave_any)
return
to_give.Insert(sac_target)

new /obj/effect/gibspawner/human/bodypartless(get_turf(sac_target))
sac_target.visible_message(span_boldwarning("Several organs force themselves out of [sac_target]!"))
Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/nightmare/nightmare_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@
/obj/item/organ/internal/heart/nightmare
name = "heart of darkness"
desc = "An alien organ that twists and writhes when exposed to light."
visual = TRUE
icon_state = "demon_heart-on"
base_icon_state = "demon_heart"
visual = TRUE

color = COLOR_CRAYON_BLACK
decay_factor = 0
// No love is to be found in a heart so twisted.
Expand Down
2 changes: 0 additions & 2 deletions code/modules/antagonists/revenant/revenant_blight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
if(affected_mob)
affected_mob.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#1d2953")
if(affected_mob.dna && affected_mob.dna.species)
affected_mob.dna.species.handle_mutant_bodyparts(affected_mob)
affected_mob.set_haircolor(null, override = TRUE)
to_chat(affected_mob, span_notice("You feel better."))
..()
Expand Down Expand Up @@ -66,7 +65,6 @@
affected_mob.adjustStaminaLoss(22.5 * seconds_per_tick, updating_stamina = FALSE)
new /obj/effect/temp_visual/revenant(affected_mob.loc)
if(affected_mob.dna && affected_mob.dna.species)
affected_mob.dna.species.handle_mutant_bodyparts(affected_mob,"#1d2953")
affected_mob.set_haircolor("#1d2953", override = TRUE)
affected_mob.visible_message(span_warning("[affected_mob] looks terrifyingly gaunt..."), span_revennotice("You suddenly feel like your skin is <i>wrong</i>..."))
affected_mob.add_atom_colour("#1d2953", TEMPORARY_COLOUR_PRIORITY)
Expand Down
7 changes: 1 addition & 6 deletions code/modules/client/preferences/_preference.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
/// DOES have random body on, will this already be randomized?
var/randomize_by_default = TRUE

/// If the selected species has this in its /datum/species/mutant_bodyparts,
/// will show the feature as selectable.
var/relevant_mutant_bodypart = null

/// If the selected species has this in its /datum/species/body_markings,
/// will show the feature as selectable.
var/relevant_body_markings = null
Expand Down Expand Up @@ -336,8 +332,7 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key())
SHOULD_NOT_SLEEP(TRUE)

if ( \
!isnull(relevant_mutant_bodypart) \
|| !isnull(relevant_inherent_trait) \
!isnull(relevant_inherent_trait) \
|| !isnull(relevant_external_organ) \
|| !isnull(relevant_head_flag) \
|| !isnull(relevant_body_markings) \
Expand Down
Loading

0 comments on commit 6cd37f6

Please sign in to comment.