Skip to content

Commit

Permalink
fix: random monster type Type now is as const
Browse files Browse the repository at this point in the history
  • Loading branch information
syradar committed Jul 3, 2023
1 parent f328653 commit fff100f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/features/monsters/data/random-monster.data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('agility', () => {
[2, 'gatherer'],
[4, 'scavenger'],
[5, 'predator'],
[8, 'aggressive_predator'],
[8, 'aggressivePredator'],
]
it.each(cases)('should return %s AGI for type %s', (expected, type) => {
const result = types.find((s) => s.value.type === type)?.value.agility
Expand Down
2 changes: 1 addition & 1 deletion src/features/monsters/data/random-monster.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const types: WeightedChoice<{
{ weight: 5, value: { type: 'gatherer', agility: 2 } },
{ weight: 7, value: { type: 'scavenger', agility: 4 } },
{ weight: 12, value: { type: 'predator', agility: 5 } },
{ weight: 6, value: { type: 'aggressive_predator', agility: 8 } },
{ weight: 6, value: { type: 'aggressivePredator', agility: 8 } },
]

export const defaultMonsterLimbs: MonsterLimbs = {
Expand Down
2 changes: 1 addition & 1 deletion src/features/monsters/monster.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const monsterTypes = [
'scavenger',
'predator',
'aggressivePredator',
]
] as const
export type MonsterType = (typeof monsterTypes)[number]

export const monsterTypeTranslationDict = translationDict(
Expand Down

0 comments on commit fff100f

Please sign in to comment.