Skip to content
This repository was archived by the owner on Aug 19, 2018. It is now read-only.

Commit ff8f9a0

Browse files
committed
add special chests into get_chest()
1 parent 80b7e9b commit ff8f9a0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

crasync/models.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,14 @@ def clan_badge_url(self):
296296

297297
def get_chest(self, index=0):
298298
'''Get your current chest +- the index'''
299-
index += self.chest_cycle.position % len(CHESTS)
300-
return CHESTS[index-1]
299+
index += self.chest_cycle.position
300+
if index == self.chest_cycle.super_magical:
301+
return 'Super Magical'
302+
if index == self.chest_cycle.epic:
303+
return 'Epic'
304+
if index == self.chest_cycle.legendary:
305+
return 'Legendary'
306+
return CHESTS[index % len(CHESTS)-1]
301307

302308
def get_clan(self):
303309
if self.clan_tag is None:

0 commit comments

Comments
 (0)