CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.65k stars 4.18k forks source link

[Xedra Evolved] Gaining mutations with (active) variants multiple times #71802

Closed Cadvin closed 8 months ago

Cadvin commented 9 months ago

Describe the bug

Arvore paraclesians (and presumably other types, but I've only tested Arvore) can regain mutations that transform into active variants such as Solar Rejuvenation and Sensing the Sun.

I assume this happens because when a mutation like Solar Rejuvenation turns into Solar Rejuvenation (active), the player no longer has the Solar Rejuvenation mutation, and can gain it again, but I'm not knowledgeable enough to state this as the definitive reason.

In the case of a duplicate, the result of having both the active and inactive version seems to resolve after a tick (though it obviously still consumes mutagen and catalyst vitamins), but the player can also mutate earlier versions of more advanced mutations, such as gaining Solar Rejuvenation while having Solar Ascendancy, in which case it will not disappear.

Attach save file

Xedra Arvore Test-trimmed.tar.gz

Steps to reproduce

  1. Make an Arvore (Or use the attached save file, containing a test character that's already mutated Solar Rejuvenation several times).
  2. Drink Arvore Destiny Draught and wait in the sunlight.
  3. Mutate Solar Rejuvenation (and possibly other similar mutations) multiple times.

Expected behavior

What I expected (and what I assume to be the intended behavior) is for active mutation variants to prevent the player from mutating their inactive variant, or from regaining earlier versions of the mutation.

Screenshots

2024-02-16 23_10_33-Cataclysm_ Dark Days Ahead - 11b2f31 2024-02-16 22_25_41-Cataclysm_ Dark Days Ahead - 8c2c1f5

Versions and configuration

Additional context

I tried adding "prevented_by": [ "ARVORE_SUN_NUTRIENTS_ON" ] to ARVORE_SUN_NUTRIENTS to see if it would work, but it just resulted in Solar Rejuvenation (active) being automatically removed when Solar Rejuvenation was re-mutated. I don't know enough to do more than clumsy blind stabs like that, though.

Standing-Storm commented 9 months ago

This happens because there's no way to link the two mutations together so the system considers them a single one for mutation-gaining purposes.

Unfortunately, in some cases it's inevitable because there are traits (such as "stealth_modifier") that are mutation only, and so a separate mutation is required in order to apply it in some cases and not in other cases. There may be some where I can redesign them into a single mutation to reduce this problem, however.

Standing-Storm commented 9 months ago

Something similar with Feline: image

Extending claws turns the ID from CLAWS_RETRACT to CLAWS_RETRACT_active. CLAWS_RETRACT_active is not technically part of the Long Fingernails -> Claws -> Retractable Claws chain since it has "valid": false so (IIRC), the system sees that I don't have any of the chain active and gives me Long Fingernails. Long Fingernails is a "types": [ "CLAWS" ] mutation, and you can only have one mutation of each type, so by extending my claws while still mutating I lost them completely and they turned back into fingernails.

As with the Arvore mutations, this happens because "integrated_armor" is a mutation only trait, so in order to grant the claws while extended, a separate ID that has the "integrated_armor" JSON parameter is required