Verify random battle and capture routines against the original engine
Checks / web (push) Canceled after 0s
Checks / web (push) Canceled after 0s
This commit is contained in:
1 parent
be7575a4d0
commit
00972bad10
9 files changed
+978
-74
No files matched your search
@@ -40,8 +40,8 @@ describe("catch rate formula", () => {
|
||||
expect(rate({ held: { effect: C.HELD_CATCH_CHANCE, parameter: 5 } })).toBe(90);
|
||||
// Max HP 400: the low bytes wrap, so a full-HP Pokémon gets 67, not 85.
|
||||
expect(rate({ hp: 400, maxHp: 400 })).toBe(67);
|
||||
// Max HP 342 divides by zero in the original.
|
||||
expect(rate({ hp: 342, maxHp: 342 })).toBeUndefined();
|
||||
// These maximum HP values divide by zero in the original.
|
||||
for (const maxHp of [342, 683]) expect(rate({ hp: maxHp, maxHp })).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user