gffg
This commit is contained in:
parent
d1b9df5e5f
commit
140fb1d1b0
2 changed files with 14 additions and 4 deletions
|
@ -39,9 +39,9 @@ def pay_rent(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def steal(v):
|
def steal(v):
|
||||||
if int(time.time()) - v.created_utc > 604800:
|
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:
|
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:
|
if random.randint(1, 10) < 8:
|
||||||
v.coins += 2000
|
v.coins += 2000
|
||||||
v.steal_utc = int(time.time())
|
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!")
|
send_notification(NOTIFICATIONS_ACCOUNT, u, f"@{v.username} has stolen 2000 dramacoins from you!")
|
||||||
else:
|
else:
|
||||||
v.fail_utc = int(time.time())
|
v.fail_utc = int(time.time())
|
||||||
|
v.ban(days=1, reason="Failed thief")
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
u = get_account(253)
|
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!")
|
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")
|
@app.get("/rentoids")
|
||||||
|
|
|
@ -12,8 +12,16 @@
|
||||||
<h2 class="h5">This account is private</h2>
|
<h2 class="h5">This account is private</h2>
|
||||||
<p class="text-muted">This user has enabled private mode to cloak their posting history.</p>
|
<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 %}
|
{% 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('/pay_rent', callback=function(){window.location.reload(true)})">Pay rent to view profile (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>
|
<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 %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue