mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-18 15:55:20 +01:00
split up regex
This commit is contained in:
parent
6049038537
commit
b150b5208c
@ -233,10 +233,12 @@ function setDailyRunEventStarterMovesets(seed: string, starters: StarterTuple):
|
|||||||
*/
|
*/
|
||||||
// TODO: Rework this setup into JSON or similar - this is quite hard to maintain
|
// TODO: Rework this setup into JSON or similar - this is quite hard to maintain
|
||||||
function getDailyEventSeedStarters(seed: string): StarterTuple | null {
|
function getDailyEventSeedStarters(seed: string): StarterTuple | null {
|
||||||
const speciesConfigurations =
|
const speciesRegex = i =>
|
||||||
/starters(?<species1>s\d{4})(?:(?<form1>f\d{2})(?<variant1>v\d{2})?|(?<variant1>v\d{2})(?<form1>f\d{2})?)?(?<species2>s\d{4})(?:(?<form2>f\d{2})(?<variant2>v\d{2})?|(?<variant2>v\d{2})(?<form2>f\d{2})?)?(?<species3>s\d{4})(?:(?<form3>f\d{2})(?<variant3>v\d{2})?|(?<variant3>v\d{2})(?<form3>f\d{2})?)?/.exec(
|
`(?<species${i}>s\\d{4})(?:(?<form${i}>f\\d{2})(?<variant${i}>v\\d{2})?|(?<variant${i}>v\\d{2})(?<form${i}>f\\d{2})?)?`;
|
||||||
seed,
|
|
||||||
)?.groups;
|
const matcher = new RegExp(`starters${speciesRegex(1)}${speciesRegex(2)}${speciesRegex(3)}`);
|
||||||
|
|
||||||
|
const speciesConfigurations = matcher.exec(seed)?.groups;
|
||||||
|
|
||||||
if (!speciesConfigurations) {
|
if (!speciesConfigurations) {
|
||||||
const legacyStarters = getDailyEventSeedStartersLegay(seed);
|
const legacyStarters = getDailyEventSeedStartersLegay(seed);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user