Skip to content

Add option to lose level-gated tiers when island level drops (#118) - #161

Merged
tastybento merged 1 commit into
developfrom
118-lose-tiers-on-level-loss
Jul 5, 2026
Merged

tastybento merged 1 commit into
developfrom
118-lose-tiers-on-level-loss

Conversation

@tastybento

Copy link
Copy Markdown
Member

Closes #118

Feature

Restores the pre-2.0.0 behaviour where a generator unlocked by island level is locked again if the island level later drops below its requirement. Off by default, behind a config toggle.

Change

  • Setting: lose-tiers-on-level-loss (Settings.loseTiersOnLevelLoss, default false). Requires the Level addon to be meaningful.
  • Logic: checkGeneratorUnlockStatus now calls a new revokeLevelLockedGenerators after the existing permission revocation. When the feature is enabled, it removes from the island's unlocked + active lists any generator whose requiredMinIslandLevel is now above the current island level. This runs on the existing IslandLevelCalculatedEvent → checkGeneratorUnlockStatus path (see IslandLevelListener), so it triggers whenever the level is recalculated.

Design choice

Purchased tiers are always kept — the revocation skips anything in purchasedTiers, so players never lose a generator they actually paid for. Only free, level-unlocked tiers are re-locked. (Mirrors how #133 preserves purchases for permission revocation.)

Tests

Added to StoneGeneratorManagerTest:

  • revokes a level-gated tier when the level drops below its requirement,
  • keeps it when it was purchased,
  • keeps it when the feature is disabled (default),
  • keeps it when the level is still sufficient.

Full suite: 110 tests pass.

🤖 Generated with Claude Code

Adds a lose-tiers-on-level-loss config option (default false). When
enabled, generators that were unlocked purely by reaching an island
level are locked again if the island level later drops below their
required level.

- Settings.loseTiersOnLevelLoss (lose-tiers-on-level-loss, default false).
- checkGeneratorUnlockStatus now calls revokeLevelLockedGenerators, which
  removes level-gated tiers from the unlocked and active lists when the
  island level is below their requirement. Runs on the existing
  IslandLevelCalculatedEvent -> checkGeneratorUnlockStatus path.
- Purchased tiers are always kept, so players never lose generators they
  actually paid for.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7NWPeGXmsUJnnX42X24Rd
@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

@tastybento
tastybento merged commit aeade4f into develop Jul 5, 2026
4 checks passed
@tastybento
tastybento deleted the 118-lose-tiers-on-level-loss branch July 5, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to lose access to tiers when player looses required level

1 participant