summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bar.json6
-rw-r--r--tavern.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/bar.json b/bar.json
index a4f55ec..f1e03f1 100644
--- a/bar.json
+++ b/bar.json
@@ -2,7 +2,7 @@
{
"price": 200,
"currency": "crystals",
- "enabled": true,
+ "min_quest": 0,
"min_draws": 10,
"banner": "",
"details": "Use your crystals to hire the most powerful units ever!\n\n4★ chance: 1.00 %\n3★ chance: 3.00 %\n2★ chance: 35.00 %\n1★ chance: 61.00 %",
@@ -32,7 +32,7 @@
{
"price": 1000,
"currency": "gp",
- "enabled": true,
+ "min_quest": 0,
"min_draws": 10,
"banner": "",
"details": "Strengthen your units!\n\nFairies chance: 20.00 %\nMana Eggs chance: 10.00 %\n1★ chance: 70.00 %",
@@ -58,7 +58,7 @@
{
"price": 350,
"currency": "crystals",
- "enabled": false,
+ "min_quest": -1,
"min_draws": 5,
"banner": "xmas2020",
"details": "Merry Christmas!\n4★/3★ exclusive: 20.00%\n3★: 5.00%\n2★: 25.00%\n1★: 50.00%",
diff --git a/tavern.py b/tavern.py
index 4e89e89..b7660ec 100644
--- a/tavern.py
+++ b/tavern.py
@@ -37,9 +37,13 @@ def recruit(args, token):
stdout("Request for inexistent tavern id %d" % tmp)
raise Exception("Tavern not found")
# Tavern must be active
- if not tavern["enabled"]:
+ if tavern["min_quest"] < 0:
stdout("Request for disabled tavern id %d" % tmp)
raise Exception("Tavern is not active")
+ # Tavern must be unlocked
+ if tavern["min_quest"] > Player[token]["quest"]:
+ stdout("Request for locked tavern id %d" % tmp)
+ raise Exception("Tavern is not active")
# Currency must exist and be valid (actually our fault...)
tmp=int(Player[token][tavern["currency"]])
except: