Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworks mutagens to take time and use fully customizable EOCs #55233

Merged
merged 48 commits into from
Feb 25, 2022

Conversation

MylieDaniels
Copy link
Contributor

@MylieDaniels MylieDaniels commented Feb 9, 2022

Summary

Features "Reworks mutagen to take time and use fully customizable EOCs."

Purpose of change

This is a fully featured change in how mutations are gained by consuming mutagen, which also serves as step 1 of implementing Issue #28277.

Describe the solution

Mutagen Changes:

  • Mutagens no longer mutate the player directly, and instead provide vitamins over the course of digestion
  • Generic mutagen provides 325 generic "mutagen" nutrient, which is required for all mutations
  • Typed mutagens provide 125 of this generic mutagen nutrient, along with 175 of their own typed mutagen nutrient
  • These vitamins model the blood levels of a substance that cannot be broken down in a conventional manner, and drain very slowly ( 1 unit/h )
  • Serums have been renamed to "mutagenic primer" (typed) and "mutagen catalyst" (generic), and provide their vitamins instantly due to being intravenous
  • Primers provide 450 to 550 (random) of the typed mutagen nutrient, and no generic mutagen
  • Catalyst provides 750 to 850 (random) generic mutagen nutrient
  • These nutrients cap out at 2500, and each grant a unique, thematic effect which also communicates a loose knowledge of the players blood level

Mutagen Vitamin Effects:

  • Below 100, there is no effect
  • From 100 to 499, the typed mutagen effect is "TYPE Mutation" and always causes generic effects of infrequent pain, sometimes paired with unique effects like very rare vomiting or rare fatigue
  • From 500 to 2199, the typed mutagen effect is "TYPE Transformation", always causes more frequent pain and additionally causes unique effects themed around the mutation category
  • At 2200 and above, the typed mutagen effect is "TYPE Metamorphosis", always causes infrequent torso damage and quite frequent pain, and additionally enhances the unique effects of the second tier
  • Generic mutagen has the same levels, but is presented as "Changing", "Warping", and "Mutagen Overdose"
  • Generic mutagen only causes any effect at Overdose level, at which point it causes frequent torso damage
  • All damage is removed if you have the threshold mutation for the vitamin, or Metallassomaiphile for generic mutagen

Purifier Changes:

  • Split in two, with the present purifier turned into human mutagen, still named purifier
  • Regular purifier is a standard mutagen, but mutates towards basic human traits that are not visible and exist to cancel other traits.
  • Processed purifier (previously purifier serum, renamed to make room for the supersoldier serums Erk proposed) is, again, the same as any other mutagen. The only reason it works to revert you to human is because it would make anything more human.
  • Mutagen chelator is a very unhealthy way to remove mutagen from your bloodstream, removing 500 generic and 250 of each typed (including human)
  • Mutagen chelator is not currently obtainable, and I'd love some feedback on where developers want it to come from- in my eyes it should be as, if not more, common than purifier was, due to being far less powerful

Mutation Changes:

  • Mutations now specify a "vitamin_cost", default 100 (no mutations have specified cost in this PR, that's a possible future tweak)
  • Mutation categories may now specify a "vitamin"
  • Character::mutate() now specifies an integer highest_category_chance (default 1) where there is a 1/int (if 0, always false) chance to ignore vitamin counts and use the highest category, and a boolean use_vitamins (default false) whether to consume vitamin_cost vitamins on successfully mutating into a mutation
  • Character::mutate() behaves roughly as it used to if used with defaults, but if the 1/int chance fails or is 0, then a weighted list of mutation categories is generated, weighted on the characters typed mutagen vitamin levels, and a category is picked from that
  • If use_vitamins is true, mutations remove that many vitamins from the rolled category (not all categories they appear in) on a successful mutation, and are considered invalid if the character cannot "afford" them
  • Attempting to mutate using Character::mutate() with 2200 or more of the category's vitamin (aka Metamorphosis phase) will attempt to cross the threshold, which consumes 1500 vitamin
  • Character::mutate_category() also supports use_vitamins, but not the 1/chance because it should always use the specified category
  • Hidden "Human" mutation category added, to remove the distinction between purification and mutation
  • Mutating now cancels only one mutation in a chain at a time- mutating towards Pretty would not remove every tier of Ugly at the same time, only the top one and fail to give you Pretty

EOC Changes:

  • EOCs have two new effects, "mutate" and "mutate_category", both of which work for both players and npcs
  • EOCs have support for "str_or_var" (used for "mutate_category")
  • EOC weighted lists now use a condition that resolves to an integer instead of an integer (all EOCs which previously used this have been converted to { "const": INT } )
  • "mutate" specifies an integer which is the 1/chance of using the highest category, and an optional boolean "use_vitamins" (default true)
  • "mutate_category" specifies a category, and an optional boolean "use_vitamins" (default true)

How It Works:

  • Mutating now occurs because of a small set of EOCs
  • Every 30 to 45 minutes, a check will be done for the player having 450 or more generic mutagen vitamin
  • If true, the EOC will roll a weighted list of success or delay, with success having a weight equal to the mutagen vitamin quantity and failure having a weight of 2500
  • This means that the player starts mutating faster the more they ingest, at a maximum chance of 50% per 30-45m interval
  • A success assigns a non-visible, non-valid, non-purifiable trait called "Changing", which exists to reduce checks by activating the second EOC only when you have it, and mutates one time (only successful if you have non-generic vitamins as well)
  • While a character has Changing, they will attempt to mutate every 1-6 hours if they have at least 300 generic mutagen, and each of these mutations will cost 60 to 140 generic mutagen vitamin (even if they fail to mutate due to lack of valid options)
  • If unable to mutate due to having less than 300 generic mutagen, the character has a 1/4 chance to lose Changing, requiring them to restart their mutations by breaching 450 again
  • The mutations from gaining or having Changing always use category vitamins and always weight the decision based on vitamin levels

Describe alternatives you've considered

Leave the system as is, or make this multiple PRs (I did not choose this option in order to avoid a project freeze by making a feature-complete change in one PR)

Testing

Mutated myself through every mutation category, mutated NPCs through several categories, tested with all in-repo mods that add mutation categories, and tested each mutagen and purifier

Additional context

All in-repo mods have been updated to this system

@MylieDaniels MylieDaniels changed the title Mutagens as foods Reworks mutagens to take time and use fully customizable EOCs Feb 9, 2022
@MylieDaniels
Copy link
Contributor Author

Currently testing to ensure functionality remains after resolving merge conflicts.

@Night-Pryanik
Copy link
Contributor

Night-Pryanik commented Feb 9, 2022

infrequent torso damage

Maybe it's better to deal damage to the body part that's currently mutating? Otherwise it would be strange: "why my torso hurts when my feet are turning into hooves?"

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Feb 9, 2022
@MylieDaniels
Copy link
Contributor Author

infrequent torso damage

Maybe it's better to deal damage to the body part that's currently mutating? Otherwise it would be strange: "why my torso hurts when my feet are turning into hooves?"

This damage is not applied when mutating, it's applied while having exceptionally high blood levels of mutagen. and is probably your organs shifting in suboptimal ways. There isn't really a way for the effect to know what the next mutation will be- possibly in the future, but definitely not right now.

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Feb 9, 2022
@Venera3
Copy link
Member

Venera3 commented Feb 9, 2022

Pain and localized damage will be a part of the limb progression EOCs on its own, so we just need the generic "oh no my spleen grew bones" effect. I would probably go easy on the damage for the lower intensities and instead lean into fatigue and thirst/hunger as a slightly less deadly penalty unless you really go all in.

@MylieDaniels
Copy link
Contributor Author

Pain and localized damage will be a part of the limb progression EOCs on its own, so we just need the generic "oh no my spleen grew bones" effect. I would probably go easy on the damage for the lower intensities and instead lean into fatigue and thirst/hunger as a slightly less deadly penalty unless you really go all in.

As of now, only the top tier, 2200+, currently causes hit point harm to the player (except on a couple, such as the Alpha and Slime vitamins, which have damage for lower tiers that may need to be toned down). For the most part, this is how this is implemented already! Spending a day at 2200+ is quite possibly going to kill you, which can certainly be toned down, but while above 2200 you should be burning through vitamin to mutate quite quickly.

@MylieDaniels
Copy link
Contributor Author

Thank you to OmniscientQ for finding a notable issue - games with a memorial wherein a character in another world had drank mutagen would crash due to not having a way to read that achievement if they gained a new achievement - it has been fixed.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 20, 2022
Copy link
Member

@Venera3 Venera3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestions to keep the types and such in sync with Limb Stuff, I'll start testing your changes with the arms this week.

data/json/mutations/mutation_type.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
data/json/mutations/mutations.json Outdated Show resolved Hide resolved
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 21, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 22, 2022
@kevingranade kevingranade merged commit d6f5cff into CleverRaven:master Feb 25, 2022
chaosvolt added a commit to chaosvolt/cdda-arcana-mod that referenced this pull request Feb 28, 2022
This won't fully work until mutagens actually mutate the player, something in CleverRaven/Cataclysm-DDA#55233 broke them.
@Faalagorn
Copy link
Contributor

There's some issues/inconsistencies especially with primer descriptions and some leftover serums, especially across the mods. Not sure if I'll be able to take a take it myself, but so far left some commented on Transifex, @MylieDaniels

@MylieDaniels
Copy link
Contributor Author

I'll figure out how to use Transifex and take a look, thank you for informing me.

linonetwo added a commit to linonetwo/CDDA-Kenan-Modpack-Chinese that referenced this pull request Mar 12, 2022
@Altogolik

This comment was marked as outdated.

@Maleclypse
Copy link
Member

A bad change that spoils the game for me. I like to see the result of the mutations immediately, rather than waiting for an undetermined amount of time. if you add this to the game, make an alternative in the settings (instant mutations or at least to be immediately displayed in what mutations change the character, immediately after taking a mutagen)

Hello please pay attention to where you are commenting. This is already merged and in the game and has been for months. If a pattern of critiquing merged PRs is observed then your ability to comment on the repo will be impacted.

@CleverRaven CleverRaven locked as resolved and limited conversation to collaborators Aug 25, 2022
@ZhilkinSerg
Copy link
Contributor

A bad change that spoils the game for me.

The game was not spoiled for you as you are free to play any version prior to these changes. Pick a build earlier than cdda-experimental-2022-02-25-0608 (which includes these changes), e.g. cdda-experimental-2022-02-25-0441 and mutations would be instant for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.