fd
This commit is contained in:
parent
5bd9119aa0
commit
63263718c7
1 changed files with 7 additions and 0 deletions
|
@ -79,6 +79,13 @@ def shop(v):
|
||||||
def buy(v, award):
|
def buy(v, award):
|
||||||
if award not in AWARDS: abort(400)
|
if award not in AWARDS: abort(400)
|
||||||
price = AWARDS[award]["price"]
|
price = AWARDS[award]["price"]
|
||||||
|
if v.patron:
|
||||||
|
if v.patron == 1: price = price*0.90
|
||||||
|
elif v.patron == 2: price = price*0.85
|
||||||
|
elif v.patron == 3: price = price*0.80
|
||||||
|
elif v.patron == 4: price = price*0.75
|
||||||
|
else: price = price*0.70
|
||||||
|
|
||||||
if v.coins < price: return {"error": "Not enough coins."}, 400
|
if v.coins < price: return {"error": "Not enough coins."}, 400
|
||||||
v.coins -= price
|
v.coins -= price
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue