Skip to content

Commit 457065f

Browse files
committed
✨ Support for LNx10 stuff and new drop areas.
1 parent 43e3c4a commit 457065f

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

lib/explore.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const parseExploreResults = (page, url) => {
3131
const parsedUrl = new URL(url)
3232
results.locID = parsedUrl.searchParams.get("id")
3333
results.cider = parsedUrl.searchParams.get("cider") === "1"
34+
results.mult = parseInt(parsedUrl.searchParams.get("mult") || "1", 10)
3435
// Parse the name and items from the HTML.
3536
const parser = new DOMParser()
3637
const dom = parser.parseFromString(page, "text/html")
@@ -110,7 +111,7 @@ const visitExploreResults = async (state, page, url) => {
110111
const runecube = state.player.perks["Eagle Eye"] || false
111112
const logMethod = results.lemonade ? "lemonade" : results.cider ? "cider" : results.arnoldPalmer ? "palmer" : "explore"
112113
if (state.player.settings.drop_logging === "1") {
113-
await state.log[logMethod]({stamina: results.stamina, explores: results.explores, location: loc.name, items, runecube})
114+
await state.log[logMethod]({stamina: results.stamina, explores: results.explores, location: loc.name, mult: results.mult, items, runecube})
114115
}
115116
if (state.player.settings.xp_logging) {
116117
console.debug("exploring xp from items", xp)

lib/fishing.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const parseNetResults = (page, url) => {
1616
// Parse the ID out of the URL.
1717
const parsedUrl = new URL(url)
1818
results.locID = parsedUrl.searchParams.get("id")
19+
results.mult = parseInt(parsedUrl.searchParams.get("mult") || "1", 10)
1920
// Parse the images out of the HTML.
2021
const parser = new DOMParser()
2122
const dom = parser.parseFromString(page, "text/html")
@@ -53,7 +54,7 @@ const visitNetResults = async (state, page, url) => {
5354
const action = results.largeNet ? "largeNet" : "net"
5455
const runecube = state.player.perks["Eagle Eye"] || false
5556
if (state.player.settings.drop_logging === "1") {
56-
await state.log[action]({location: loc.name, items, runecube})
57+
await state.log[action]({location: loc.name, mult: results.mult, items, runecube})
5758
}
5859
if (state.player.settings.xp_logging) {
5960
console.debug("fishing xp from items", xp)

py/droprates.py

+24-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"Whispering Creek": 4 / 15,
3232
"Jundland Desert": 4 / 15,
3333
"Haunted House": 2 / 5,
34+
"Santa's Workshop": 2 / 5,
3435
}
3536

3637
CACHE_PATH_BASE = f"{os.path.dirname(__file__)}/.dropscache/{'{}'}.json"
@@ -54,6 +55,9 @@
5455
"Egg 03": "Carrot Seeds",
5556
"Popcorn": "Corn Seeds",
5657
"Gold Potato": "Potato Seeds",
58+
"Frozen Pine": "Pine Seeds",
59+
"Frozen Cabbage": "Cabbage Seeds",
60+
"Frozen Peas": "Pea Seeds",
5761
}
5862

5963
# When the Iron Depot drop change went live.
@@ -80,6 +84,13 @@
8084
# Drop log types which are immune from the runecube perk.
8185
RUNECUBE_IMMUNE_TYPES = {"harvestall"}
8286

87+
# Timestamp for when the new drop code went into effect.
88+
NEW_DROP_CODE = 1667244595000
89+
90+
# Timestamp for when xmas 2022 started (for snowball drops)
91+
XMAS_2022 = 1669874400000
92+
XMAS_2022_END = 1672801200000
93+
8394

8495
def cache_path_for(**kwargs) -> str:
8596
buf = io.StringIO()
@@ -109,6 +120,9 @@ def when_dropped(item: fixtures.Item, location: fixtures.Location) -> range:
109120
if item.name == "Popcorn" and location.name == "Corn Seeds":
110121
# September 12th, time unknown so saying midnight for simplicity.
111122
first_dropped = 1662958800000
123+
if item.name == "Snowball":
124+
first_dropped = XMAS_2022
125+
last_dropped = XMAS_2022_END
112126
last_dropped = item.last_dropped or round((time.time() + 10000000) * 1000)
113127
return range(first_dropped, last_dropped + 1)
114128

@@ -194,16 +208,20 @@ def count_sources(
194208
nets_fake_fishes: bool = False,
195209
cider_location: Optional[str] = None,
196210
) -> None:
211+
mult = row.get("results", {}).get("mult", 1)
197212
if row["type"] == "explore":
213+
assert mult == 1
198214
drops.explores += row["results"]["stamina"]
199215
elif row["type"] == "lemonade":
216+
assert mult == 1
200217
drops.lemonades += 1
201218
if lemonade_fake_explores_location is not None:
202219
drops.explores += round(
203220
(1 / BASE_DROP_RATES[lemonade_fake_explores_location])
204221
* sum(it.get("quantity", 1) for it in row["results"]["items"])
205222
)
206223
elif row["type"] == "cider":
224+
# assert mult == 1
207225
drops.ciders += 1
208226
cider_explores = row["results"]["explores"]
209227
if row["ts"] >= CIDER_CHANGE:
@@ -217,22 +235,26 @@ def count_sources(
217235
# for all items but it's more correct than not.
218236
drops.explores += cider_explores
219237
elif row["type"] == "palmer":
238+
assert mult == 1
220239
drops.palmers += 1
221240
if lemonade_fake_explores_location is not None:
222241
drops.explores += round(
223242
(1 / BASE_DROP_RATES[lemonade_fake_explores_location]) * 500
224243
)
225244
elif row["type"] == "fish":
245+
assert mult == 1
226246
drops.fishes += 1
227247
elif row["type"] == "net":
248+
# assert mult == 1
228249
drops.nets += 1
229250
if nets_fake_fishes:
230251
drops.fishes += sum(it.get("quantity", 1) for it in row["results"]["items"])
231252
elif row["type"] == "large_net":
232-
drops.large_nets += 1
253+
drops.large_nets += mult
233254
if nets_fake_fishes:
234-
drops.fishes += 500 if row["ts"] >= TRIGON_KNOT else 400
255+
drops.fishes += (500 if row["ts"] >= TRIGON_KNOT else 400) * mult
235256
elif row["type"] == "harvestall":
257+
assert mult == 1
236258
# We already checked that only mono-seed logs are considered.
237259
drops.harvests += len(row["results"]["crops"])
238260

0 commit comments

Comments
 (0)