Skip to content

Den Original™ Player Requirements System#78

Draft
portfiend wants to merge 4 commits intoTheDenSS14:masterfrom
portfiend:fear/character-requirements
Draft

Den Original™ Player Requirements System#78
portfiend wants to merge 4 commits intoTheDenSS14:masterfrom
portfiend:fear/character-requirements

Conversation

@portfiend
Copy link
Contributor

@portfiend portfiend commented Mar 17, 2026

About the PR

This PR basically rewrites WizDen's JobRequirements to be cleaner, readable, and more flexible. This is drawing a lot from my prebase refactor work on CharacterRequirements.

Why / Balance

We used that requirement system A LOT, and my refactors to the prebase system made it pretty easy to add new requirements. In addition, this system should make it possible to run requirements through tests, as making all parameters of the requirements optional means that we can skip over irrelevant requirements.

This is needed for traits and loadouts etc.

Technical details

IPlayerRequirement is a new interface for defining a "player requirement". IPlayerRequirements all have the following fields and methods:

  • bool Inverted: Whether or not this requirement should be inverted. Fails become passes and vice versa.
  • bool MustPassPreCheck: If a context fails the pre-check, normally it would count as an auto-pass so that the requirement gets "ignored" in checks. If this is enabled, instead, requirements that fail pre-checking will auto-fail.
  • bool PreCheck(PlayerRequirementContext context): This method checks a context to make sure all required fields are non-null.
  • bool CheckRequirement(PlayerRequirementContext context): Performs the actual requirement check.
  • string? GetReason(PlayerRequirementContext context): Produces a "reason string" for a requirement. Notice how this logic is now decoupled from requirement checking!

PlayerRequirementContext is a new record definition that stores "contextual data" on the player that is being checked, like their current playtimes or selected character. All fields are nullable; null fields are "optional" and ignored in checks (at least, depending on MustPassPreCheck).

Media

TBA

Requirements

  • I have read and am following the Pull Request and Changelog Guidelines.
  • I have added media to this PR or it does not require an in-game showcase.
  • I have tested my changes and additions in-game.

Licensing

  • All code in this pull request can be licensed to MIT.
  • (OPTIONAL) I give permission to seeing this feature upstreamed to Macrocosm in the future.

Breaking changes

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant