1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Make more progress

This commit is contained in:
Steffo 2020-09-22 21:00:49 +02:00
parent 3f0b412024
commit ab8fd7bdf7
2 changed files with 39 additions and 4 deletions

View file

@ -18,6 +18,12 @@ class Check(metaclass=abc.ABCMeta):
async def check(self, status: "TrionfiStatus") -> bool:
raise NotImplementedError()
def __or__(self, other: "Check"):
return CheckOr(self, other)
def __and__(self, other):
return CheckAnd(self, other)
class CheckPlayedSteamGame(Check):
def __init__(self, appid: int, *args, **kwargs):
@ -44,7 +50,7 @@ class CheckPlayedSteamGame(Check):
for game in games:
if game["appid"] != self.appid:
continue
if game["playtime_forever"] >= 1:
if game["playtime_forever"] >= 30:
return True
return False
@ -74,3 +80,23 @@ class CheckAchievementSteamGame(Check):
continue
return ach["achieved"] == 1
return False
class CheckOr(Check):
def __init__(self, first: Check, second: Check, *args, **kwargs):
super().__init__(*args, **kwargs)
self.first: Check = first
self.second: Check = second
async def check(self, status: "TrionfiStatus") -> bool:
return (await self.first.check(status)) or (await self.second.check(status))
class CheckAnd(Check):
def __init__(self, first: Check, second: Check, *args, **kwargs):
super().__init__(*args, **kwargs)
self.first: Check = first
self.second: Check = second
async def check(self, status: "TrionfiStatus") -> bool:
return (await self.first.check(status)) and (await self.second.check(status))

View file

@ -26,7 +26,7 @@ trionfilist = (
roman="II",
name="La Sacerdotessa",
puzzle="DEL DECIMO MESE",
objective="Gioca almeno un'ora a [url=https://store.steampowered.com/app/881100]Noita[/url].",
objective="Gioca almeno mezz'ora a [url=https://store.steampowered.com/app/881100]Noita[/url].",
check=CheckPlayedSteamGame(881100),
),
TrionfoInfo(
@ -35,7 +35,7 @@ trionfilist = (
roman="III",
name="L'Imperatrice",
puzzle="NON IMPEGNARTI",
objective="Gioca a [url=https://store.steampowered.com/app/245170]Skullgirls[/url].",
objective="Gioca almeno mezz'ora [url=https://store.steampowered.com/app/245170]Skullgirls[/url].",
check=CheckPlayedSteamGame(245170),
),
TrionfoInfo(
@ -59,7 +59,7 @@ trionfilist = (
title="vi",
roman="VI",
name="Gli Amanti",
puzzle="ANCORA DIECI MINUTI",
puzzle="PIÙ DIECI MINUTI",
objective="Finisci l'Atto 3 di [url=https://store.steampowered.com/app/698780]Doki Doki Literature Club["
"/url].",
check=CheckPlayedSteamGame(698780),
@ -76,6 +76,7 @@ trionfilist = (
title="viii",
roman="VIII",
name="La Giustizia",
puzzle="RAGGIUNGI",
objective="Porta la giustizia dalla tua parte su [url=https://store.steampowered.com/app/1289310]Helltaker["
"/url].",
check=CheckAchievementSteamGame(1289310, "achiev_05"),
@ -92,6 +93,7 @@ trionfilist = (
title="x",
roman="X",
name="La Fortuna",
puzzle="LA CASA DEI GIOCHI"
),
TrionfoInfo(
variable="xi",
@ -104,6 +106,9 @@ trionfilist = (
title="xii",
roman="XII",
name="L'Appeso",
objective="Gioca almeno mezz'ora a [url=https://store.steampowered.com/app/381210]Dead by "
"Daylight.[/url]",
check=CheckPlayedSteamGame(381210),
),
TrionfoInfo(
variable="xiii",
@ -131,6 +136,10 @@ trionfilist = (
title="xvi",
roman="XVI",
name="La Torre",
objective="Sconfiggi un boss del secondo piano su [url=https://store.steampowered.com/app/646570/]"
"Slay the Spire[/url].",
check=CheckAchievementSteamGame(646570, "AUTOMATON") or CheckAchievementSteamGame(646570, "COLLECTOR") or
CheckAchievementSteamGame(646570, "CHAMP")
),
TrionfoInfo(
variable="xvii",