Skip to content

Game: some percentile ability check rolls are recorded one too low #101

Open

Description

@ccady

make_player_check in globalScripts/game_abilitychecks.gd converts the percentile roll from DieManager.rollDice() to an integer with int(die_handler[1]*100).

DieManager builds a percentile roll as tens/10.0 + ones/100.0. That float isn't always exact (for example, 0.3 + 0.03 is 0.32999…), and int() truncates instead of rounding. As a result, rolls of 33, 58, 66, 78 and 79 are recorded as 32, 57, 65, 77 and 78.

This affects about 5% of ability checks. A check can pass that should fail, for example a total ability score of 32 against a real roll of 33. The wrong value also appears in the TestAbilityCheck output text.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions