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-23 03:10:27 +02:00
parent ab8fd7bdf7
commit adb55cc6f0
4 changed files with 44 additions and 13 deletions

View file

@ -1,6 +1,7 @@
from typing import * from typing import *
import royalnet import royalnet
import royalnet.commands as rc import royalnet.commands as rc
import royalnet.utils as ru
import random import random
import datetime import datetime
@ -58,16 +59,23 @@ class FortuneCommand(rc.Command):
"🔙 Oggi torneai indietro nel tempo!", "🔙 Oggi torneai indietro nel tempo!",
"🚨 Oggi suonerà l'allarme della Velvet Room!", "🚨 Oggi suonerà l'allarme della Velvet Room!",
"♾ Oggi ti sembrerà infinito!", "♾ Oggi ti sembrerà infinito!",
"👹 Oggi perfino i demoni avranno paura di te!",
"🥐 Oggi mangerai una brioche (o lancerai un boomerang)!",
] ]
async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None: async def run(self, args: rc.CommandArgs, data: rc.CommandData) -> None:
async with data.session_acm() as session: async with data.session_acm() as session:
author = await data.find_author(session=session, required=True) author = await data.find_author(session=session, required=True)
today = datetime.date.today() today = datetime.date.today()
h = author.uid * hash(today) h = author.uid * hash(today)
r = random.Random(x=h) r = random.Random(x=h)
if author is not None and author.halloween2020 is not None:
author.halloween2020.x = datetime.datetime.now()
await ru.asyncify(session.commit)
message = r.sample(self._fortunes, 1)[0]
await data.reply(message)
message = r.sample(self._fortunes, 1)[0]
await data.reply(message)

View file

@ -35,6 +35,7 @@ class SpellCommand(rc.Command):
author = await data.find_author(session=session, required=False) author = await data.find_author(session=session, required=False)
if author is not None and author.halloween2020 is not None: if author is not None and author.halloween2020 is not None:
author.halloween2020.i = datetime.datetime.now() author.halloween2020.i = datetime.datetime.now()
await ru.asyncify(session.commit)
if spell.healing_component: if spell.healing_component:
heal: rs.HealingComponent = spell.healing_component heal: rs.HealingComponent = spell.healing_component

View file

@ -73,6 +73,8 @@ class CheckAchievementSteamGame(Check):
j = await response.json() j = await response.json()
except Exception: except Exception:
return False return False
if not j["playerstats"]["success"]:
return False
achievements = j["playerstats"]["achievements"] achievements = j["playerstats"]["achievements"]
for ach in achievements: for ach in achievements:

View file

@ -24,7 +24,7 @@ trionfilist = (
variable="ii", variable="ii",
title="ii", title="ii",
roman="II", roman="II",
name="La Sacerdotessa", name="L'Alta Sacerdotessa",
puzzle="DEL DECIMO MESE", puzzle="DEL DECIMO MESE",
objective="Gioca almeno mezz'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), check=CheckPlayedSteamGame(881100),
@ -34,7 +34,7 @@ trionfilist = (
title="iii", title="iii",
roman="III", roman="III",
name="L'Imperatrice", name="L'Imperatrice",
puzzle="NON IMPEGNARTI", puzzle="RIMANI LIBERO",
objective="Gioca almeno mezz'ora [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), check=CheckPlayedSteamGame(245170),
), ),
@ -43,7 +43,7 @@ trionfilist = (
title="iv", title="iv",
roman="IV", roman="IV",
name="L'Imperatore", name="L'Imperatore",
puzzle="ESEGUI GLI ORDINI", puzzle="ESEGUI QUESTI ORDINI",
objective="Vinci una partita su [url=https://store.steampowered.com/app/611500]Quake Champions[/url].", objective="Vinci una partita su [url=https://store.steampowered.com/app/611500]Quake Champions[/url].",
check=CheckAchievementSteamGame(611500, "qc_victory") check=CheckAchievementSteamGame(611500, "qc_victory")
), ),
@ -70,6 +70,9 @@ trionfilist = (
roman="VII", roman="VII",
name="Il Carro", name="Il Carro",
puzzle="SOPRA UN CARRO", puzzle="SOPRA UN CARRO",
objective="Gioca 5 incontri a [url=https://store.steampowered.com/app/326460/ShellShock_Live]ShellShock Live["
"/url].",
check=CheckPlayedSteamGame(326460, "play5")
), ),
TrionfoInfo( TrionfoInfo(
variable="viii", variable="viii",
@ -87,25 +90,33 @@ trionfilist = (
roman="IX", roman="IX",
name="L'Eremita", name="L'Eremita",
puzzle="SEGRETAMENTE", puzzle="SEGRETAMENTE",
objective="Sconfiggi tutti i boss del Basement almeno una volta su ["
"url=https://store.steampowered.com/app/250900]The Binding "
"of Isaac: Rebirth[/url].",
check=CheckAchievementSteamGame(250900, "13"),
), ),
TrionfoInfo( TrionfoInfo(
variable="x", variable="x",
title="x", title="x",
roman="X", roman="X",
name="La Fortuna", name="La Fortuna",
puzzle="LA CASA DEI GIOCHI" puzzle="LA CASA DEI GIOCHI",
objective="Chiedi a Royal Bot di predire il tuo futuro.",
check=None,
), ),
TrionfoInfo( TrionfoInfo(
variable="xi", variable="xi",
title="xi", title="xi",
roman="XI", roman="XI",
name="La Forza", name="La Forza",
puzzle="PORTA STRUMENTI DI CONTROLLO"
), ),
TrionfoInfo( TrionfoInfo(
variable="xii", variable="xii",
title="xii", title="xii",
roman="XII", roman="XII",
name="L'Appeso", name="L'Appeso",
puzzle="PREPARA LA CORDA ELETTRICA",
objective="Gioca almeno mezz'ora a [url=https://store.steampowered.com/app/381210]Dead by " objective="Gioca almeno mezz'ora a [url=https://store.steampowered.com/app/381210]Dead by "
"Daylight.[/url]", "Daylight.[/url]",
check=CheckPlayedSteamGame(381210), check=CheckPlayedSteamGame(381210),
@ -115,21 +126,25 @@ trionfilist = (
title="xiii", title="xiii",
roman="XIII", roman="XIII",
name="La Morte", name="La Morte",
objective="Raggiungi la Tenuta dell'Antenato su [url=https://store.steampowered.com/app/262060]Darkest Dungeon[" objective="Completa la campagna Dead Center di [url=]Left 4 Dead 2[/url].",
"/url].", check=CheckAchievementSteamGame(550, "ACH_SURVIVE_MALL"),
check=CheckAchievementSteamGame(262060, "welcome_home"),
), ),
TrionfoInfo( TrionfoInfo(
variable="xiv", variable="xiv",
title="xiv", title="xiv",
roman="XIV", roman="XIV",
name="La Temperanza", name="La Temperanza",
objective="Raggiungi la Tenuta dell'Antenato su [url=https://store.steampowered.com/app/262060]Darkest Dungeon["
"/url].",
check=CheckAchievementSteamGame(262060, "welcome_home"),
), ),
TrionfoInfo( TrionfoInfo(
variable="xv", variable="xv",
title="xv", title="xv",
roman="XV", roman="XV",
name="Il Diavolo", name="Il Diavolo",
objective="Completa la prima missione di [url=https://store.steampowered.com/app/379720]DOOM[/url]."
# DOOM E1M1 https://steamcommunity.com/stats/379720/achievements/
), ),
TrionfoInfo( TrionfoInfo(
variable="xvi", variable="xvi",
@ -146,13 +161,16 @@ trionfilist = (
title="xvii", title="xvii",
roman="XVII", roman="XVII",
name="Le Stelle", name="Le Stelle",
objective="Completa due missioni co-op online su ["
"url=https://store.steampowered.com/app/630/Alien_Swarm]Alien Swarm[/url].",
check=CheckAchievementSteamGame(630, "ASW_PARA_HAT"),
), ),
TrionfoInfo( TrionfoInfo(
variable="xviii", variable="xviii",
title="xviii", title="xviii",
roman="XVIII", roman="XVIII",
name="La Luna", name="La Luna",
objective="Gioca a [url=https://store.steampowered.com/app/388880]Oxenfree[/url].", objective="Gioca almeno mezz'ora a [url=https://store.steampowered.com/app/388880]Oxenfree[/url].",
check=CheckPlayedSteamGame(388880), check=CheckPlayedSteamGame(388880),
), ),
TrionfoInfo( TrionfoInfo(
@ -160,6 +178,8 @@ trionfilist = (
title="xix", title="xix",
roman="XIX", roman="XIX",
name="Il Sole", name="Il Sole",
objective="Gioca almeno mezz'ora a [url=https://store.steampowered.com/app/420530]OneShot[/url].",
check=CheckPlayedSteamGame(420530),
), ),
TrionfoInfo( TrionfoInfo(
variable="xx", variable="xx",