master
Aevann1 2021-08-31 23:20:09 +02:00
parent 37232c4763
commit e2a3ca00aa
2 changed files with 14 additions and 4 deletions

View File

@ -39,9 +39,9 @@ def pay_rent(v):
@auth_required
def steal(v):
if int(time.time()) - v.created_utc > 604800:
return "You must have an account older than 1 week in order to steal."
return "You must have an account older than 1 week in order to stealing."
if v.coins > 200:
return "You must have more than 200 coins in order to steal."
return "You must have more than 200 coins in order to attempt stealing."
if random.randint(1, 10) < 8:
v.coins += 2000
v.steal_utc = int(time.time())
@ -52,9 +52,11 @@ def steal(v):
send_notification(NOTIFICATIONS_ACCOUNT, u, f"@{v.username} has stolen 2000 dramacoins from you!")
else:
v.fail_utc = int(time.time())
v.ban(days=1, reason="Failed thief")
g.db.add(v)
u = get_account(253)
send_notification(NOTIFICATIONS_ACCOUNT, u, f"@{v.username} has failed to steal coins from you and has been banned for 1 day!")
return "", 204
@app.get("/rentoids")

View File

@ -12,8 +12,16 @@
<h2 class="h5">This account is private</h2>
<p class="text-muted">This user has enabled private mode to cloak their posting history.</p>
{% if u.id == 253 and 'rdrama' in request.host %}
<a class="btn btn-primary" href="javascript:void(0)", onclick="post('/pay_rent', callback=function(){window.location.reload(true)})">Pay Rent to View (500 coins)</a>
<a class="btn btn-primary" href="javascript:void(0)", onclick="post('/steal', callback=function(){window.location.reload(true)})">Attempt to steal coins (30% chance of being banned for 1 day, 70% chance of stealing 2000 coins"</a>
<a class="btn btn-primary" href="javascript:void(0)", onclick="post('/pay_rent', callback=function(){window.location.reload(true)})">Pay rent to view profile (500 coins)</a>
<pre></pre>
<a class="btn btn-primary" href="javascript:void(0)", onclick="post('/steal', callback=function(){window.location.reload(true)})">Attempt to steal coins"</a>
<div class="text-small-extra text-muted mt-3">30% chance of being banned for 1 day, 70% chance of stealing 2000 coins</div>
<pre>
</pre>
{% endif %}
</div>
</div>