fix multistat grant

This commit is contained in:
Alexander Drozdov
2020-03-16 18:35:05 +02:00
parent a3ef75d5d3
commit ae0c67d237
2 changed files with 16 additions and 1 deletions
+2
View File
@@ -48,3 +48,5 @@ export const UNIDENTIFIED = 'Unidentified'
export const FLASK_CHARGES = /^Currently has \d+ Charges$/
export const SECTION_SYNTHESISED = 'Synthesised Item'
export const PREFIX_SYNTHESISED = 'Synthesised '
export const CLUSTER_JEWEL_GRANT = 'Added Small Passive Skills grant: '
+14 -1
View File
@@ -1,4 +1,5 @@
import { Mods, Mod, StatMatcher } from '../../data'
import { CLUSTER_JEWEL_GRANT } from './constants'
export enum ModifierType {
Pseudo = 'pseudo',
@@ -22,7 +23,19 @@ export function * sectionToStatStrings (section: string[]) {
let multi = (idx + 1) < section.length
while (idx < section.length) {
const str = multi ? `${section[idx]}\n${section[idx + 1]}` : section[idx]
let str: string
if (multi) {
const lines = [
section[idx],
section[idx + 1]
]
if (lines.every(l => l.startsWith(CLUSTER_JEWEL_GRANT))) {
lines[1] = lines[1].substr(CLUSTER_JEWEL_GRANT.length)
}
str = lines.join('\n')
} else {
str = section[idx]
}
const isParsed: boolean = yield str