diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-07-22 08:10:45 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-07-22 08:10:45 -0300 |
commit | 4dd9a5fdc183630607729456a025437e4dec1cb9 (patch) | |
tree | ff5e9ec8aa2657bf1c141c8750a3d06413e34135 | |
parent | 8cdd82f3e72828744896ba94d359460ce773abd9 (diff) | |
download | server-4dd9a5fdc183630607729456a025437e4dec1cb9.tar.gz server-4dd9a5fdc183630607729456a025437e4dec1cb9.tar.bz2 server-4dd9a5fdc183630607729456a025437e4dec1cb9.tar.xz server-4dd9a5fdc183630607729456a025437e4dec1cb9.zip |
Change Tavern rules so they are quest-level dependant.
This means you now may unlock taverns as story goes on.
With possibly better rates or specialized units.
-rw-r--r-- | bar.json | 6 | ||||
-rw-r--r-- | tavern.py | 6 |
2 files changed, 8 insertions, 4 deletions
@@ -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%", @@ -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: |