Skip to content

Commit c32b250

Browse files
committed
✨ Support large nets and palmers and use big items for the drop rates.
I used the compare script and things look close enough to be reasonable.
1 parent b886d6d commit c32b250

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

py/cider_compare.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import droprates
2+
3+
normal_drops = droprates.compile_drops(
4+
explore=True,
5+
lemonade=True,
6+
net=True,
7+
iron_depot=True,
8+
lemonade_fake_explores=True,
9+
nets_fake_fishes=True,
10+
)
11+
12+
big_drops = droprates.compile_drops(
13+
explore=True,
14+
lemonade=True,
15+
net=True,
16+
iron_depot=True,
17+
lemonade_fake_explores=True,
18+
nets_fake_fishes=True,
19+
cider=True,
20+
palmer=True,
21+
large_net=True,
22+
)
23+
24+
for loc in normal_drops.locations.keys() & big_drops.locations.keys():
25+
normal_loc = normal_drops.locations[loc]
26+
big_loc = big_drops.locations[loc]
27+
for item in normal_loc.items.keys() & big_loc.items.keys():
28+
normal_item = normal_loc.items[item]
29+
big_item = big_loc.items[item]
30+
normal_hits = normal_item.fishes or normal_item.explores
31+
big_hits = big_item.fishes or big_item.explores
32+
normal_rate = normal_hits / normal_item.drops
33+
big_rate = big_hits / big_item.drops
34+
rate_diff = big_rate - normal_rate
35+
rate_pct_diff = rate_diff * 100 / normal_rate
36+
if abs(rate_pct_diff) >= 5:
37+
print(f"{loc} {item}: {rate_pct_diff} {normal_rate:.2f} {big_rate:.2f}")
38+
else:
39+
# print(f"{loc} {item}: {rate_pct_diff}")
40+
pass

py/droprates.py

+28-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
* 1000
6262
)
6363

64+
BROKEN_OVERFLOW_TYPES = {"cider", "large_net", "palmer"}
65+
6466

6567
def cache_path_for(**kwargs) -> str:
6668
buf = io.StringIO()
@@ -96,8 +98,10 @@ class ItemDrops:
9698
explores: int = 0
9799
lemonades: int = 0
98100
ciders: int = 0
101+
palmers: int = 0
99102
fishes: int = 0
100103
nets: int = 0
104+
large_nets: int = 0
101105
harvests: int = 0
102106
drops: int = 0
103107

@@ -107,8 +111,10 @@ class LocationDrops:
107111
explores: int = 0
108112
lemonades: int = 0
109113
ciders: int = 0
114+
palmers: int = 0
110115
fishes: int = 0
111116
nets: int = 0
117+
large_nets: int = 0
112118
harvests: int = 0
113119
drops: int = 0
114120
items: dict[str, ItemDrops] = attrs.Factory(lambda: defaultdict(ItemDrops))
@@ -119,8 +125,10 @@ class Drops:
119125
explores: int = 0
120126
lemonades: int = 0
121127
ciders: int = 0
128+
palmers: int = 0
122129
fishes: int = 0
123130
nets: int = 0
131+
large_nets: int = 0
124132
harvests: int = 0
125133
drops: int = 0
126134
locations: dict[str, LocationDrops] = attrs.Factory(
@@ -179,12 +187,22 @@ def count_sources(
179187
# This is kind of wrong for global and location stats since not all explores count
180188
# for all items but it's more correct than not.
181189
drops.explores += row["results"].get("explores", row["results"]["stamina"])
190+
elif row["type"] == "palmer":
191+
drops.palmers += 1
192+
if lemonade_fake_explores_location is not None:
193+
drops.explores += round(
194+
(1 / BASE_DROP_RATES[lemonade_fake_explores_location]) * 500
195+
)
182196
elif row["type"] == "fish":
183197
drops.fishes += 1
184198
elif row["type"] == "net":
185199
drops.nets += 1
186200
if nets_fake_fishes:
187201
drops.fishes += sum(it.get("quantity", 1) for it in row["results"]["items"])
202+
elif row["type"] == "large_net":
203+
drops.large_nets += 1
204+
if nets_fake_fishes:
205+
drops.fishes += 400
188206
elif row["type"] == "harvestall":
189207
# We already checked that only mono-seed logs are considered.
190208
drops.harvests += len(row["results"]["crops"])
@@ -194,8 +212,10 @@ def compile_drops(
194212
explore: bool = False,
195213
lemonade: bool = False,
196214
cider: bool = False,
215+
palmer: bool = False,
197216
fish: bool = False,
198217
net: bool = False,
218+
large_net: bool = False,
199219
harvest: bool = False,
200220
since: int = 0,
201221
iron_depot: bool = False,
@@ -208,8 +228,10 @@ def compile_drops(
208228
e=explore,
209229
l=lemonade,
210230
c=cider,
231+
p=palmer,
211232
f=fish,
212233
n=net,
234+
m=large_net,
213235
h=harvest,
214236
s=since,
215237
i=iron_depot,
@@ -246,10 +268,14 @@ def compile_drops(
246268
types.add("lemonade")
247269
if cider:
248270
types.add("cider")
271+
if palmer:
272+
types.add("palmer")
249273
if fish:
250274
types.add("fish")
251275
if net:
252276
types.add("net")
277+
if large_net:
278+
types.add("large_net")
253279
if harvest:
254280
types.add("harvestall")
255281
explores = Drops()
@@ -273,7 +299,7 @@ def compile_drops(
273299
# Ignore out-of-bounds drops. This allows accounting for stuff like drop
274300
# rates changing substantially by manually resetting firstDropped.
275301
continue
276-
if row["type"] == "cider" and item["item"] in overflow_items:
302+
if row["type"] in BROKEN_OVERFLOW_TYPES and item["item"] in overflow_items:
277303
# Cider overflow always reports 0 drops so any item that overflows during
278304
# a cider has to be ignored.
279305
continue
@@ -317,7 +343,7 @@ def compile_drops(
317343
if row["ts"] not in when_items_dropped[(item, location_name)]:
318344
# Item couldn't drop, this doesn't count.
319345
continue
320-
if row["type"] == "cider" and item in overflow_items:
346+
if row["type"] in BROKEN_OVERFLOW_TYPES and item in overflow_items:
321347
# Cider overflow always reports 0 drops so any item that overflows during
322348
# a cider has to be ignored.
323349
continue

py/fixtures.py

+8
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,28 @@ def load_quests(resolve_items=False) -> Iterable[Quest]:
137137
def _get_drops():
138138
import droprates
139139

140+
# This seems to be ready to go but I reserve the right to change my mind.
141+
USE_BIG_ITEMS = True
142+
140143
normal_drops = droprates.compile_drops(
141144
explore=True,
142145
lemonade=True,
143146
net=True,
144147
harvest=True,
145148
lemonade_fake_explores=True,
146149
nets_fake_fishes=True,
150+
cider=USE_BIG_ITEMS,
151+
palmer=USE_BIG_ITEMS,
152+
large_net=USE_BIG_ITEMS,
147153
)
148154

149155
iron_depot_drops = droprates.compile_drops(
150156
explore=True,
151157
lemonade=True,
152158
lemonade_fake_explores=True,
153159
iron_depot=True,
160+
cider=USE_BIG_ITEMS,
161+
palmer=USE_BIG_ITEMS,
154162
)
155163

156164
manual_fish_drops = droprates.compile_drops(fish=True)

0 commit comments

Comments
 (0)