Shiny cytomons! Random color mutations for vat grown creatures. (#90072)

## About The Pull Request

This PR creates a 15% chance for any vat grown creatures to be born with
a color mutation, the more dramatic the colour shift, the rarer it is!

In the future I would like to make the mutation chance dependant on the
growing conditions and cell line, but that is for another day.

The distribution between color variants is as follows:
painted: 35% 
mutant: 35%
rare: 13%
shiny: 12%
mutant king: 5%


![bild](https://github.com/user-attachments/assets/f5f110ee-d4aa-4bbe-be3d-31d0a400194a)

## Why It's Good For The Game
Cytology requires a lot of time and game knowledge and the rewards are
not that powerful considering the time investment.

So most players do not engage with it.

This is a small way to make the activity more rewarding without simply
ramping up the power level.

It also makes it easier for the cytologist to keep his sentience
potion'ed minions apart, faciltating RP with the creatures.

And we all like something rare and beautiful, don't we folks?

## Changelog

🆑
add: cytology color mutations!
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
Krysonism
2025-04-29 17:11:39 -06:00
committed by Shadow-Quill
co-authored by Ghom
parent 5f08b64d48
commit b379fdcad2
2 changed files with 38 additions and 0 deletions
+2
View File
@@ -61,6 +61,8 @@
//! General defines for vatgrowing
/// Past how much growth can the other cell_lines affect a finished cell line negatively
#define VATGROWING_DANGER_MINIMUM 30
//Defines how many percent of vat grown atoms come out as hue shifted color mutants. A flat chance for now, maybe in the future dependant on the cell line.
#define CYTO_SHINY_CHANCE 15
#define SCIPAPER_COOPERATION_INDEX 1
#define SCIPAPER_FUNDING_INDEX 2
@@ -106,6 +106,9 @@
var/atom/thing = new resulting_atom(get_turf(vat))
ADD_TRAIT(thing, TRAIT_VATGROWN, "vatgrowing")
vat.visible_message(span_nicegreen("[thing] pops out of [vat]!"))
//We maybe add some color. the chance is static for now, but idewally we would be able to manipulate it in the future.
if(prob(CYTO_SHINY_CHANCE))
mutate_color(thing)
if(SEND_SIGNAL(vat.biological_sample, COMSIG_SAMPLE_GROWTH_COMPLETED) & SPARE_SAMPLE)
return
QDEL_NULL(vat.biological_sample)
@@ -127,3 +130,36 @@
var/datum/reagent/reagent = i
reagent_names += initial(reagent.name)
return span_notice("[prefix_text] [jointext(reagent_names, ", ")]")
//Adds a hue shift filter and affix to an atom.
/datum/micro_organism/cell_line/proc/mutate_color(atom/beautiful_mutant)
//This determines how much the hue of the atom is shifted, 0.5 is the most extreme, respresenting a 180° hue shift.
var/hue_shift = 1
//This affix is added to the name of the atom, to help players understand and converse about the different rarity levels.
var/rarity_affix = "glitched"
switch(rand(1, 100))
if(1 to 35) //35% chance : painted
hue_shift = 0.15
rarity_affix = "painted"
if(36 to 70) //35% chance : mutant
hue_shift = 0.85 //this value is equivalent in distance as the painted tier, just in the other direction.
rarity_affix = "mutant"
if(71 to 83) //13% chance : rare
hue_shift = 0.3
rarity_affix = "rare"
if(84 to 95) //12% chance : shiny
hue_shift = 0.7
rarity_affix = "shiny"
if(96 to 100) //5% chance : mutant king
hue_shift = 0.5 //Best in show, most extreme color change.
rarity_affix = "mutant king" //The name is up to debate, since cyto is all about freaky creatures I thought it was good choice over something like "cosmic" or "regal".
var/list/mutant_shift_matrix = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, hue_shift,0,0,0) //matrix for our colour shifting.
//Here we make the changes for the atom, we apply a filter and change the name to indicate rarity.
beautiful_mutant.add_filter("shiny mutation", 15, color_matrix_filter(mutant_shift_matrix, FILTER_COLOR_HSL))
beautiful_mutant.name = "[rarity_affix] [beautiful_mutant.name]"
if(isliving(beautiful_mutant)) //update the real name var if it's actually a living mob
var/mob/living/living_mutie = beautiful_mutant
living_mutie.real_name = living_mutie.name