Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating an Item and setting MaximumUsages but not setting UsagesLeft, the UsagesLeft value should equal the MaximumUsages value #18

Open
musti645 opened this issue Dec 22, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@musti645
Copy link
Owner

musti645 commented Dec 22, 2020

This somehow doesn't seem to work as it should. The UsagesLeft value is 0, or rather the item returns the NoUsagesLeftResponse although it shouldn't.

Code:

      .addItem()
        .setName('shovel')
        .setDescription('A sturdy shovel that just has the perfect size.')
        .setInSceneDescription('On the right side of the entrance is a shovel.')
        .setCanPickUp(true)
        .setCanUseFunction((item: InGameItem, currentScene: Scene) => {
          if(currentScene.getName() === 'Driveway'){
            return true;
          }

          return false;
        })
        .setCannotUseItemResponse('You don\'t think that using a shovel inside the hut is a good idea.')
        .setMaximumUsages(3)
        .setItemUsedResponse('You play around in the snow until it\'s not fun anymore.')
        .setNoUsagesLeftResponse('Again? You don\'t feel like it.')
        .finish()
@musti645 musti645 added the bug Something isn't working label Dec 22, 2020
@musti645 musti645 self-assigned this Dec 23, 2020
@musti645
Copy link
Owner Author

The ItemBuilder now sets the UsagesLeft value to the MaximumUsages value, if it has not been set yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant