Skip to content
Snippets Groups Projects
Commit df008f7d authored by Victor Melnik's avatar Victor Melnik
Browse files

Update ships, fix scripts

parent 4d6238c4
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ def jsoupGet(url) = Jsoup.connect(url)
.get()
// Fetch ship classes
doc = jsoupGet("https://azurlane.koumakan.jp/List_of_Ships_by_Class")
doc = jsoupGet("https://azurlane.koumakan.jp/wiki/List_of_Ships_by_Class")
shipToClassProjection = {}
rows = doc.select(".wikitable tr:has(td)").toArray()
for row : rows {
......@@ -18,7 +18,7 @@ for row : rows {
}
// Fetch ships stats
doc = jsoupGet("https://azurlane.koumakan.jp/List_of_Ships_by_Stats")
doc = jsoupGet("https://azurlane.koumakan.jp/wiki/List_of_Ships_by_Stats")
tables = doc.select(".azltable.sortable").toArray()
ships = stream(tables)
.flatMap(def(table) = table.select("tr").toArray())
......@@ -52,7 +52,9 @@ for ship : ships {
}
level = 1
if arrayKeyExists("level100", shipsById[id]) {
if arrayKeyExists("level120", shipsById[id]) {
level = 125
} else if arrayKeyExists("level100", shipsById[id]) {
level = 120
} else if arrayKeyExists("level1", shipsById[id]) {
level = 100
......@@ -117,12 +119,13 @@ def rarityIndex(rarityName) {
}
def fixCosts(ship) {
for lvl : [1, 100, 120] {
for lvl : [1, 100, 120, 125] {
level = "level" + lvl
if arrayKeyExists(level, ship) && toInt(ship[level]["cost"]) == 0 {
costMax = toInt(ship["level1"]["cost"] ?? 0)
costMax = max(costMax, toInt(ship["level100"]["cost"] ?? 0))
costMax = max(costMax, toInt(ship["level120"]["cost"] ?? 0))
costMax = max(costMax, toInt(ship["level125"]["cost"] ?? 0))
ship[level]["cost"] = costMax
}
}
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment