Merge branch 'master' of https://github.com/jifunks/botany
commit
b3922ddf85
10
botany.py
10
botany.py
|
@ -174,10 +174,10 @@ class Plant(object):
|
||||||
# Generate plant rarity
|
# Generate plant rarity
|
||||||
CONST_RARITY_MAX = 256.0
|
CONST_RARITY_MAX = 256.0
|
||||||
rare_seed = random.randint(1,CONST_RARITY_MAX)
|
rare_seed = random.randint(1,CONST_RARITY_MAX)
|
||||||
common_range = round((2/3)*CONST_RARITY_MAX)
|
common_range = round((2.0/3)*CONST_RARITY_MAX)
|
||||||
uncommon_range = round((2/3)*(CONST_RARITY_MAX-common_range))
|
uncommon_range = round((2.0/3)*(CONST_RARITY_MAX-common_range))
|
||||||
rare_range = round((2/3)*(CONST_RARITY_MAX-common_range-uncommon_range))
|
rare_range = round((2.0/3)*(CONST_RARITY_MAX-common_range-uncommon_range))
|
||||||
legendary_range = round((2/3)*(CONST_RARITY_MAX-common_range-uncommon_range-rare_range))
|
legendary_range = round((2.0/3)*(CONST_RARITY_MAX-common_range-uncommon_range-rare_range))
|
||||||
|
|
||||||
common_max = common_range
|
common_max = common_range
|
||||||
uncommon_max = common_max + uncommon_range
|
uncommon_max = common_max + uncommon_range
|
||||||
|
@ -238,7 +238,7 @@ class Plant(object):
|
||||||
if element['user'] not in visitors_this_check:
|
if element['user'] not in visitors_this_check:
|
||||||
visitors_this_check.append(element['user'])
|
visitors_this_check.append(element['user'])
|
||||||
# prevent users from manually setting watered_time in the future
|
# prevent users from manually setting watered_time in the future
|
||||||
if element['timestamp'] <= int(time.time()):
|
if element['timestamp'] <= int(time.time() and element['timestamp'] >= self.watered_timestamp):
|
||||||
guest_timestamps.append(element['timestamp'])
|
guest_timestamps.append(element['timestamp'])
|
||||||
try:
|
try:
|
||||||
self.update_visitor_db(visitors_this_check)
|
self.update_visitor_db(visitors_this_check)
|
||||||
|
|
|
@ -89,7 +89,7 @@ class CursedMenu(object):
|
||||||
|
|
||||||
def set_options(self, options):
|
def set_options(self, options):
|
||||||
# Validates that the last option is "exit"
|
# Validates that the last option is "exit"
|
||||||
if options[-1] is not 'exit':
|
if options[-1] != 'exit':
|
||||||
options.append('exit')
|
options.append('exit')
|
||||||
self.options = options
|
self.options = options
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ class CursedMenu(object):
|
||||||
# Actually draws the menu and handles branching
|
# Actually draws the menu and handles branching
|
||||||
request = ""
|
request = ""
|
||||||
try:
|
try:
|
||||||
while request is not "exit":
|
while request != "exit":
|
||||||
self.draw()
|
self.draw()
|
||||||
request = self.get_user_input()
|
request = self.get_user_input()
|
||||||
self.handle_request(request)
|
self.handle_request(request)
|
||||||
|
|
Loading…
Reference in New Issue