Skip to content

Commit 1969d17

Browse files
most of S21 data
1 parent a8a7c1b commit 1969d17

5 files changed

Lines changed: 215 additions & 38 deletions

File tree

data.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def _generate_next_value_(name, start, count, last_values):
123123
FORCE = auto()
124124
GAUDY = auto()
125125
GRAVITY = auto()
126+
GREEN_LIGHT = auto()
126127
GRIND_RAIL = auto()
127128
GROWTH = auto()
128129
GUARDED = auto()
@@ -364,6 +365,7 @@ class EventType(IntEnum):
364365
A_BLOOD_TYPE = 198
365366
PLAYER_SOUL_INCREASED = 199
366367
BALLPARK_MOD_RATIFIED = 203
368+
SMASH = 204
367369
HYPE_BUILT = 206
368370
PRACTICING_MODERATION = 208
369371
RUNS_SCORED = 209
@@ -382,6 +384,7 @@ class EventType(IntEnum):
382384
VOICEMAIL = 228
383385
THIEVES_GUILD_ITEM = 230
384386
THIEVES_GUILD_PLAYER = 231
387+
TUMBLEWEED_SOUNDS = 232
385388
TRADER_TRAITOR = 233
386389
TRADE_FAILED = 234
387390
TRADE_SUCCESS = 236
@@ -831,7 +834,16 @@ class PlayerData(TeamOrPlayerMods):
831834
@classmethod
832835
def from_chron(cls, data: Dict[str, Any], last_update_time: str, prev_player_data: Optional["PlayerData"]):
833836
data_state = data.get("state", {})
834-
items = [ItemData.from_dict(item) for item in data.get("items") or []]
837+
items = []
838+
for item in data.get("items") or []:
839+
# Thanks, Parker
840+
if isinstance(item, str):
841+
i = ItemData.null()
842+
i.id = item
843+
items.append(i)
844+
else:
845+
items.append(ItemData.from_dict(item))
846+
835847
player_data = PlayerData(
836848
id=data["id"],
837849
last_update_time=last_update_time,
@@ -889,7 +901,7 @@ def multiplied(self, stat: str, multiplier: float) -> float:
889901
full_stat = getattr(self, stat)
890902
item_stat = full_stat - raw_stat
891903
return raw_stat * multiplier + item_stat
892-
904+
893905
def undefined(self) -> bool:
894906
# todo: actually *do* the rolls...
895907
return self.has_mod(Mod.SCATTERED) and self.has_mod(Mod.UNDEFINED)

formulas.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ def get_multiplier(
130130
multiplier += 0.5
131131
elif mod == Mod.MINIMIZED:
132132
return 0.00001 #Apparently this should just be 0, but it turns out that one of our formulas divides by an attribute. Let's not divide by zero shall we
133+
elif mod == Mod.GREEN_LIGHT:
134+
if meta.weather == Weather.POLARITY_PLUS:
135+
multiplier += 0.5
136+
elif meta.weather == Weather.POLARITY_MINUS:
137+
multiplier -= 0.5
133138

134139
if player.bat == "NIGHT_VISION_GOGGLES" and meta.weather == Weather.ECLIPSE:
135140
# Blessing description: Item. Random player on your team hits 50% better during Solar Eclipses.

item_gen.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,12 @@ class ItemRollType(Enum):
631631
ItemRollType.CHEST: lambda x: 0 if x < 0.05 else 1 if x < 0.55 else 2 if x < 0.95 else 3,
632632
ItemRollType.GLITTER: lambda x: 0 if x < 0.5 else 1 if x < 0.9 else 2,
633633
ItemRollType.PRIZE: lambda x: 1 if x < 0.47 else 2 if x < 0.95 else 3, # todo: check this for sure, we have a 0.4601 that's definitely only *one* element (2021-07-20T15:00:08.612Z)
634-
}
634+
},
635+
(23, 0): {
636+
ItemRollType.CHEST: lambda x: 0 if x < 0.05 else 1 if x < 0.55 else 2 if x < 0.95 else 3,
637+
ItemRollType.GLITTER: lambda x: 0 if x < 0.35 else 1 if x < 0.9 else 2,
638+
ItemRollType.PRIZE: lambda x: 1 if x < 0.45 else 2 if x < 0.95 else 3,
639+
},
635640
}
636641

637642

@@ -897,6 +902,24 @@ class ItemRollType(Enum):
897902
),
898903
}
899904

905+
# Very unsure about this, but there's a Helmet of Wisdom that drops in glitter and the roll doesn't work with the other pool. But the community chest drop a few games earlier needs the old pool.
906+
SUFFIX_POOL_GLITTER = {(20, 0): (
907+
"Unknown",
908+
"Blaserunning",
909+
"Fourtitude",
910+
"Unknown",
911+
"Stamina",
912+
"Vanity",
913+
"Vitality",
914+
"Intelligence",
915+
"Strength",
916+
"Charisma",
917+
"Wisdom",
918+
"Dexterity",
919+
"the Feast",
920+
"the Famine",
921+
),
922+
}
900923

901924
DELTA = 0.00000000000001
902925

@@ -965,7 +988,7 @@ def roll_item(
965988
prefix_pool = list(get_pool_for_day(prefix_pool, season, day))
966989
post_prefix_pool = POST_PREFIX_POOL_GLITTER if roll_type == ItemRollType.GLITTER else POST_PREFIX_POOL_CHEST
967990
post_prefix_pool = get_pool_for_day(post_prefix_pool, season, day)
968-
suffix_pool = get_pool_for_day(SUFFIX_POOL, season, day)
991+
suffix_pool = get_pool_for_day(SUFFIX_POOL_GLITTER if roll_type == ItemRollType.GLITTER and season >= 20 else SUFFIX_POOL, season, day)
969992
for _ in range(num_elements):
970993
value = roll(f"pre-prefix???")
971994
if value < 0.25:

0 commit comments

Comments
 (0)