Skip to content

API: Feature Request: Provide "ns.${Api}.isEligible" functions for each restricted APIs. #1632

Open
@bupjae

Description

@bupjae

Based on:

Assume the user doesn't have SF4 / SF5 and currently not in BN4 / BN5 in this discussion.

For example, if the user wants to know whether they can use Stanek's API, the only way is run ns.stanek.acceptGift() and see return value.
However, running that causes the user accept gift, and suffers 10% all stat penalty, therefore it is not suitable for check eligibility of Stanek's API.

Almost all features in this game has similar issues; the user should actually start/join/create the feature to know whether the user is eligibile to access.

This feature request is to provide NS function isEligible for each API.

Sample ns.stanek.isEligible function:

isEligible: () => () => {
    // You already accepted Stanek's gift. You can use stanek API of course.
    if (Player.hasAugmentation(AugmentationName.StaneksGift1, true)) return true;
    // You don't have SF13 and you'are not in BN13. You don't know anything about The Church.
    if (!Player.canAccessCotMG()) return false;
    // If you installed other augmentation before accepting gift, The Church will treat you filth and you can't use stanek API.
    // Otherwise, you can use stanek API, starting from acceptGift().
    return [...Player.augmentations, ...Player.queuedAugmentations].filter(
          (a) => a.name !== AugmentationName.NeuroFluxGovernor,
        ).length === 0;
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions