From: Joann Mõndresku Date: Mon, 13 May 2024 17:57:19 +0000 (+0300) Subject: Fix contract scheduling and array events X-Git-Url: https://git.based.quest/%7B%7B?a=commitdiff_plain;h=d93f7067283eeb3a096ebcdf85a129458fb6a600;p=reEgg.git Fix contract scheduling and array events --- diff --git a/contracts.py b/contracts.py index 17d2bbf..f47a63a 100644 --- a/contracts.py +++ b/contracts.py @@ -56,6 +56,7 @@ def __convert_contract_to_proto(obj): def load_contracts(): with open("data/contracts.json", "r") as file: obj = json.loads(file.read()) + global contract_epoch contract_epoch = obj["epoch"] time_since_epoch = time.time() - contract_epoch i = 0 diff --git a/events.py b/events.py index 50634dc..3cc34bf 100644 --- a/events.py +++ b/events.py @@ -77,13 +77,13 @@ def get_active_events(): iso_calendar = date.isocalendar() seed = int(str(iso_calendar.year) + str(iso_calendar.week)) srng = random.Random(seed) - # 50/50 chance of it being either + # 50/50 chance of it being either (reality is something more like 30/70 ratio, but it's our server so.. \o/) if srng.random() < 0.5: res.append(double_prestige_event) else: res.append(triple_prestige_event) if type(event_calendar[cur_day]) is list: - res = event_calendar[cur_day] + res = res + event_calendar[cur_day] else: res.append(event_calendar[cur_day]) # Apply duration deltas