1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

spooky stuffs

This commit is contained in:
Steffo 2018-10-07 20:16:10 +02:00
parent 6be872ed85
commit f3f71b6373
5 changed files with 113 additions and 28 deletions

View file

@ -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:

View file

@ -79,4 +79,4 @@ def page_whatpumpkin():
if __name__ == "__main__":
app.run(debug=True, port=1235)
app.run(debug=True, port=1234)

View file

@ -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;
}
}

View file

@ -5,9 +5,13 @@
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="Royal Games, halloween, arg">
<title>a curse.</title>
<link href="{{ url_for('static', filename='owl.less') }}" rel="stylesheet/less" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/less.js/3.0.2/less.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<script>
var username;
var user_id;
function timer() {
let now = new Date().getTime();
let to = new Date("Oct 31, 2018 15:30:00").getTime();
@ -17,11 +21,30 @@
+ Math.floor(String((result / 1000) % 60)) + "s";
}
function ident() {
let r = fetch("https://ryg.steffo.eu/ses/identify", {
method: "GET",
mode: "cors",
credentials: "include"
}).done((result) => {
data = result.json();
if(data["user_id"] === null) {
document.getElementById("main").innerHTML = "i don't know you. " +
"<a href='https://ryg.steffo.eu/login'>try logging in</a> first.";
return;
user_id = data["user_id"];
username = data["username"];
}
})
}
setInterval(timer, 100);
window.onload = ident;
</script>
</head>
<body>
<div class="container">
<div id="main" class="container">
<h1>
a curse.
</h1>
@ -55,7 +78,7 @@
<h2>
unleash the horsemen
</h2>
<div>
<div class="description">
you'll need the help of the horsemen of the apocalypse to dispel the curse.<br>
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.
</div>
@ -64,7 +87,7 @@
<h2>
carve the ritual pumpkin
</h2>
<div>
<div class="description">
prepare a pumpkin, and empty its inside.<br>
carve something on its exterior then put a light inside of it.<br>
when dusk has come, take a picture, and <a href="/whatpumpkin">post it to the owl captain</a>.
@ -74,7 +97,7 @@
<h2>
circle the sound
</h2>
<div>
<div class="description">
find the 2038th sound of halloween.<br>
then, follow the circle pattern.<br>
<br>
@ -84,7 +107,7 @@
<h2>
uproot the evil
</h2>
<div>
<div class="description">
listen to the sounds in here.<br>
do you hear the evil that stole your voice?<br>
answer it.
@ -97,7 +120,7 @@
<h2>
remove the ghosts
</h2>
<div>
<div class="description">
during the ritual something strange might happen.<br>
in that case, the ghosts probably will be to blame.<br>
to be safe, i would remove them...<br>
@ -108,8 +131,8 @@
<h2>
conquer the mansion
</h2>
<div>
a mansion has appeared.<br>
<div class="description">
<a href="{{ url_for('static', filename='snesfile.zip') }}">a mansion</a> has appeared.<br>
prove yourself worthy, and find the words hidden deep inside.<br>
only then i can trust you to completely perform the ritual.
</div>
@ -121,28 +144,28 @@
<h2>
</h2>
<div>
<div class="description">
</div>
{% elif loop.index == 8 %}
<h2>
</h2>
<div>
<div class="description">
</div>
{% elif loop.index == 9 %}
<h2>
</h2>
<div>
<div class="description">
</div>
{% elif loop.index == 10 %}
<h2>
</h2>
<div>
<div class="description">
</div>
{% endif %}

View file

@ -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