fix: protect legendary companions from accidental egg discard (#314) - #335
Open
justinjeong5 wants to merge 1 commit into
Open
justinjeong5 wants to merge 1 commit into
justinjeong5 wants to merge 1 commit into
Conversation
…min#314) Require an extra confirmation step before discarding a legendary or shiny companion when buying an egg in the token shop. - CompanionStore: Add isHighValueCompanion (currentIsShiny || rarity == .legendary) keeping evaluation in the store and preserving Ditto disguise secrecy. - ShopView: Generalize EggCard confirmation stage to preciousConfirm with appropriate legendary/shiny warning copy and discard buttons. - Localization: Add freshEggLegendaryWarning and freshEggDiscardValuable across all 7 supported languages. - Tests: Add PreciousCompanionGuardTests covering legendary, shiny, rare exclusion (avoiding reroll fatigue), disguised Ditto invariants, and 7-language copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an extra confirmation step before discarding a Legendary or Shiny companion when purchasing an egg (regular, uncommon, or rare) in the Token Shop.
Previously,
EggCardonly triggered a second-stage warning (stage = .shinyConfirm) ifstore.currentIsShinywas true. Non-shiny Legendary companions (1/512 hatch odds) were discarded immediately on the first prompt without any safeguard, leading to accidental loss of rare companions (#314).Key Decisions & Safeguards (Red-Team Validated)
isHighValueCompanion): Evaluated cleanly inCompanionStoreascurrentIsShiny || rarity == .legendary.store.currentIsShiny == falseandstore.rarity == .common, ensuring the disguise is never prematurely revealed through the egg purchase modal..rarecompanions are intentionally excluded from the double-stage confirmation. High-tier players repeatedly buying Rare Eggs to hunt specific species/shinies are spared repetitive prompts, ensuring alerts remain meaningful for truly rare companions.preciousConfirmwith appropriate copy, adding only 2 localized strings across all 7 supported languages without enum proliferation.Type of change
UI changes
Checklist
swift buildandswift testpass locally (1,171 tests passed, 0 failures, 13 skipped; logic-core line coverage 93.39% >= 75%)PreciousCompanionGuardTests.swiftcovering legendary, shiny, rare exclusion, disguised Ditto secrecy, and 7-language localization)🤖 Generated with Antigravity 2.0 (AGY 2.0)