diff --git a/discordbot.py b/discordbot.py index 83dc90a3..4262db2a 100644 --- a/discordbot.py +++ b/discordbot.py @@ -522,6 +522,12 @@ class RoyalDiscordBot(discord.Client): filename=now_playing.plain_text(), timestamp=datetime.datetime.now()) session.add(played_music) + # EASTER EGG, REMOVE LATER + if "ghostbusters" in now_playing.plain_text().lower(): + halloween = await loop.run_in_executor(executor, session.query(db.Halloween) + .filter_by(royal=enqueuer).one_or_none) + halloween[4] = True + # END await loop.run_in_executor(executor, session.commit) await loop.run_in_executor(executor, session.close) except sqlalchemy.exc.OperationalError: diff --git a/ohciaovedochestaileggendoilmiostato.py b/ohciaovedochestaileggendoilmiostato.py index d8a74e85..69a845cb 100644 --- a/ohciaovedochestaileggendoilmiostato.py +++ b/ohciaovedochestaileggendoilmiostato.py @@ -79,4 +79,4 @@ def page_whatpumpkin(): if __name__ == "__main__": - app.run(debug=True, port=1235) + app.run(debug=True, port=1234) diff --git a/static/owl.less b/static/owl.less index e69de29b..55a517ca 100644 --- a/static/owl.less +++ b/static/owl.less @@ -0,0 +1,59 @@ +body { + background-color: black; + color: white; + box-sizing: border-box; +} + +.container { + max-width: 900px; + margin-left: auto; + margin-right: auto; +} + +.quest { + display: grid; + grid-template-columns: 64px auto; + grid-column-gap: 12px; + margin-top: 36px; + margin-bottom: 36px; + + .progress { + grid-row-start: 1; + grid-row-end: 4; + grid-column: 1; + + i { + display: block; + padding-top: 8px; + font-size: 64px; + color: yellow; + + &.todo { + color: rgba(255, 255, 0, 0.2); + } + + &.done { + color: rgba(255, 255, 0, 1); + } + } + } + + h2 { + grid-row: 1; + grid-column: 2; + margin-top: 0; + margin-bottom: 4px; + } + + .description { + grid-row: 2; + grid-column: 2; + } + + form { + grid-row: 3; + grid-column: 2; + } + + +} \ No newline at end of file diff --git a/templates/ohciaodinuovo.html b/templates/ohciaodinuovo.html index 1e6881b8..8a5e81fd 100644 --- a/templates/ohciaodinuovo.html +++ b/templates/ohciaodinuovo.html @@ -5,9 +5,13 @@ a curse. + -
+

a curse.

@@ -55,7 +78,7 @@

unleash the horsemen

-
+
you'll need the help of the horsemen of the apocalypse to dispel the curse.
lead Chaos to victory in the battle of the ancients, or the War from the shadow isles to victory on the rift, and you'll gain their support.
@@ -64,7 +87,7 @@

carve the ritual pumpkin

-
+
prepare a pumpkin, and empty its inside.
carve something on its exterior then put a light inside of it.
when dusk has come, take a picture, and post it to the owl captain. @@ -74,7 +97,7 @@

circle the sound

-
+
find the 2038th sound of halloween.
then, follow the circle pattern.

@@ -84,7 +107,7 @@

uproot the evil

-
+
listen to the sounds in here.
do you hear the evil that stole your voice?
answer it. @@ -97,7 +120,7 @@

remove the ghosts

-
+
during the ritual something strange might happen.
in that case, the ghosts probably will be to blame.
to be safe, i would remove them...
@@ -108,8 +131,8 @@

conquer the mansion

-
- a mansion has appeared.
+
+ a mansion has appeared.
prove yourself worthy, and find the words hidden deep inside.
only then i can trust you to completely perform the ritual.
@@ -121,28 +144,28 @@

-
+
{% elif loop.index == 8 %}

-
+
{% elif loop.index == 9 %}

-
+
{% elif loop.index == 10 %}

-
+
{% endif %} diff --git a/webserver.py b/webserver.py index 35555c27..2ba103d3 100644 --- a/webserver.py +++ b/webserver.py @@ -68,7 +68,7 @@ def page_main(): random_diario = db_session.query(db.Diario).order_by(db.func.random()).first() next_events = db_session.query(db.Event).filter(db.Event.time > datetime.datetime.now()).order_by( db.Event.time).all() - halloween = db.Halloween.puzzle_status() + halloween = db.Halloween.puzzle_status()[1] db_session.close() return render_template("main.html", royals=royals, wiki_pages=wiki_pages, entry=random_diario, next_events=next_events, g=fl_g, escape=escape, halloween=enumerate(halloween)) @@ -115,6 +115,7 @@ def page_loggedin(): db_session = db.Session() user = db_session.query(db.Royal).filter_by(username=username).one_or_none() db_session.close() + fl_session.permanent = True if user is None: abort(403) return @@ -334,7 +335,7 @@ def page_diario(): @app.route("/api/token") -def page_token(): +def api_token(): username = request.form.get("username", "") password = request.form.get("password", "") db_session = db.Session() @@ -361,19 +362,15 @@ def page_token(): return -@app.route("/spooky", methods=["POST"]) -def page_spooky(): - if request.form.get("solution", "") != "1": - return redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ") - user_id = fl_session.get("user_id") - if not user_id: - return redirect("https://www.youtube.com/watch?v=djV11Xbc914") - db_session = db.Session() - user = db_session.query(db.Royal).filter_by(id=user_id).one() - halloween = db.Halloween(royal=user, first_trigger=datetime.datetime.now()) - db_session.add(halloween) - db_session.commit() - return redirect(url_for("page_main")) +@app.route("/ses/identify") +def ses_identify(): + response = jsonify({ + "username": fl_session.get("username"), + "id": fl_session.get("user_id") + }) + response.headers["Access-Control-Allow-Origin"] = "https://owlcaptain.tk" + return response + @app.before_request