fields-of-arle icon indicating copy to clipboard operation
fields-of-arle copied to clipboard

Action for Imitate should be disabled if < 2 food

Open philihp opened this issue 6 years ago • 0 comments

Good bug for someone getting their feet wet:

The Imitate action consumes 2 food from the current player. As such, the current player should not be allowed to take this action if they don't have 2 food. This issue has two parts:

First, the Laborer job should not do anything if the client attempts to try to do it without 2 food. Currently it just takes 2 food away and allows the player to go negative. https://github.com/philihp/fields-of-arle/blob/master/src/game/jobs/laborer.js

Second, on the Action component, disable the buttons if they have less than 2 food. A good starting place is right here: https://github.com/philihp/fields-of-arle/blob/master/src/components/actionsBoard.js#L355-L370

Best to satisfy the first requirement first, since the second will make it difficult to test the first.

philihp avatar Oct 30 '18 08:10 philihp