Skip to content

Commit aca3dff

Browse files
authored
Merge pull request #50 from nditech/Increase-polling-percentage-max-to-200
Change poll percentage max to 200
2 parents 5417b82 + 9fb0a5f commit aca3dff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/models/game.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ const deliverGameInjection = async ({ gameId, injectionId }) => {
450450
await db('game')
451451
.where({ id: gameId })
452452
.update({
453-
poll: Math.max(0, Math.min(game.poll + pollChange, 100)),
453+
poll: Math.max(0, Math.min(game.poll + pollChange, 200)),
454454
});
455455
}
456456
await db('game_injection')
@@ -540,7 +540,7 @@ const performAction = async ({ gameId, actionId }) => {
540540
.where({ id: gameId })
541541
.update({
542542
budget: Math.max(0, game.budget - cost + budgetIncrease),
543-
poll: Math.max(0, Math.min(game.poll + pollIncrease, 100)),
543+
poll: Math.max(0, Math.min(game.poll + pollIncrease, 200)),
544544
});
545545
await db('game_log').insert({
546546
game_id: gameId,
@@ -588,7 +588,7 @@ const performCurveball = async ({ gameId, curveballId }) => {
588588
.where({ id: gameId })
589589
.update({
590590
budget: loseAllBudget ? 0 : Math.max(0, game.budget + budgetChange),
591-
poll: Math.min(Math.max(game.poll + pollChange, 0), 100),
591+
poll: Math.min(Math.max(game.poll + pollChange, 0), 200),
592592
});
593593

594594
await db('game_log').insert({

tests/game/performAction.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Perform Action', () => {
2626

2727
expect(poll).toBe(dummyGame.poll + actionToPerorm.poll_increase);
2828
expect(poll).toBeGreaterThanOrEqual(0);
29-
expect(poll).toBeLessThanOrEqual(100);
29+
expect(poll).toBeLessThanOrEqual(200);
3030
expect(budget).toBe(
3131
dummyGame.budget - actionToPerorm.cost + actionToPerorm.budget_increase,
3232
);

0 commit comments

Comments
 (0)