Skip to content

Commit

Permalink
add support for underworld
Browse files Browse the repository at this point in the history
  • Loading branch information
gelzis committed Nov 1, 2023
1 parent 3a96add commit 7008043
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/frontend/MartialPoints/OrderParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,25 @@ export function getMartialPointsFromOrders(orders: string): MartialPointData {

// matches ALH version
// ;*** desert (3,1)
let matches = line.match(/;\*\*\* \w+ \((\d+),(\d+)\)/);
// also
// ;*** desert (3,1,underworld)
let matches = line.match(/;\*\*\* \w+ \((\d+),(\d+),?(\w+)?\)/);
if (matches) {
currentRegion = `${matches[1]},${matches[2]}`;
if (matches[3]) {
currentRegion += `,${matches[3]}`;
}
}

// matches advisor version
// ; desert (3,1) in Great Boldur Desert
matches = line.match(/; \w+ \((\d+),(\d+)\)/);
// ; desert (3,1,underworld) in Great Boldur Desert
matches = line.match(/; \w+ \((\d+),(\d+),?(\w+)?\)/);
if (matches) {
currentRegion = `${matches[1]},${matches[2]}`;
if (matches[3]) {
currentRegion += `,${matches[3]}`;
}
}

const hasProduce = !!line.trim().match(/^[@]?produce/);
Expand Down

0 comments on commit 7008043

Please sign in to comment.