summaryrefslogtreecommitdiffstats
path: root/osrc/watbot_player.py
diff options
context:
space:
mode:
authorPratyush Desai2023-10-04 13:11:10 +0530
committerPratyush Desai2023-10-04 13:11:10 +0530
commitdd3a079d62f6d702efa066a1d47cf5129b281e16 (patch)
treeb0b74f38bc44a1fa37269955eb7a4c89e0e4c04a /osrc/watbot_player.py
parent28efaf9eec032bcdaa26cf9ff4f2ac79bb60f3e3 (diff)
downloadwatbot-dd3a079d62f6d702efa066a1d47cf5129b281e16.tar.gz
watbot-dd3a079d62f6d702efa066a1d47cf5129b281e16.tar.bz2
watbot-dd3a079d62f6d702efa066a1d47cf5129b281e16.zip
rm redundant code
Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
Diffstat (limited to 'osrc/watbot_player.py')
-rw-r--r--osrc/watbot_player.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/osrc/watbot_player.py b/osrc/watbot_player.py
deleted file mode 100644
index 5c4267b..0000000
--- a/osrc/watbot_player.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/python
-
-import time
-
-class WatbotPlayer:
- """class representing a player account"""
-
- def __init__(self, db, nick):
- self.nick = nick
- self.db = db
-
- (
- self.watting_exp,
- self.anarchy_exp,
- self.trickery_exp,
- self.coins,
- self.last_mine,
- self.health,
- self.last_rest
- ) = db.get_account(nick)
-
- self.watting = self.get_level(self.watting_exp)
- self.anarchy = self.get_level(self.anarchy_exp)
- self.trickery = self.get_level(self.trickery_exp)
-
- now = time.time()
- delta = now - self.last_rest
- if delta > 60:
- self.health += int(delta/60)
- if self.health > 10:
- self.health = 10
-
- self.last_rest += int(delta/60) * 60
-
- def get_level(self, exp):
- if exp < 100:
- level = int(exp/10)
- elif exp < 900:
- level = 10 + int(exp/100)
- else:
- level = 99
-
- return level
-
- def update(self, log):
- self.db.update_account(self.nick, self.watting_exp, self.anarchy_exp, self.trickery_exp, self.coins, self.last_mine, self.health, self.last_rest, log)