feat(progression): capabilities the adapters need (commit A of the swap)
no behaviour change - additive only. GrantSkill: pickups are free unlocks, and collecting one already owned is a no-op rather than a free upgrade. RevokeSkill: for skills that consume themselves (brick shield). AbandonAttempt: leaving a level without dying, so no life is charged. ApplyCheat rewrites the Playthrough through its snapshot rather than via SetLives/AddCoins mutators, which ADR-0005 rules out - a bare mutator is an invitation, and the old code had two paths to exactly that. Every value is re-validated on the way back in and a rejected cheat leaves the Playthrough untouched, which is asserted. 73 tests.
This commit is contained in:
@@ -130,6 +130,12 @@ public sealed class Playthrough
|
||||
/// Takes the events raised since the last drain, clearing them. The composition root drains
|
||||
/// once after each use case and republishes.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Forgets an owned Skill. Exists for Skills that consume themselves — the brick shield is spent
|
||||
/// when it breaks — so this is gameplay, not a cheat.
|
||||
/// </summary>
|
||||
public bool RevokeSkill(SkillId skill) => _ownedSkills.Remove(skill);
|
||||
|
||||
public IReadOnlyList<ProgressionEvent> DrainEvents() => _events.Drain();
|
||||
|
||||
public PlaythroughSnapshot Export() => new(
|
||||
|
||||
Reference in New Issue
Block a user