Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Nate Smith | 49ae1125d3 | |
Nate Smith | df01d7397c | |
Nate Smith | ccc08316fe | |
Noelle Leigh | 43333db825 | |
Noelle Leigh | c6aed375da | |
Marcos Marado | 1fffd41783 |
|
@ -81,7 +81,7 @@ class DataManager(object):
|
||||||
|
|
||||||
def check_plant(self):
|
def check_plant(self):
|
||||||
# check for existing save file
|
# check for existing save file
|
||||||
if os.path.isfile(self.savefile_path):
|
if os.path.isfile(self.savefile_path) and os.path.getsize(self.savefile_path) > 0:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -564,7 +564,7 @@ class CursedMenu(object):
|
||||||
# get plant description before printing
|
# get plant description before printing
|
||||||
output_string = self.get_plant_description(this_plant)
|
output_string = self.get_plant_description(this_plant)
|
||||||
growth_multiplier = 1 + (0.2 * (this_plant.generation-1))
|
growth_multiplier = 1 + (0.2 * (this_plant.generation-1))
|
||||||
output_string += "Generation: {}\nGrowth rate: {}x".format(self.plant.generation, growth_multiplier)
|
output_string += "Generation: {}\nGrowth rate: {:.1f}x".format(self.plant.generation, growth_multiplier)
|
||||||
self.draw_info_text(output_string)
|
self.draw_info_text(output_string)
|
||||||
self.infotoggle = 1
|
self.infotoggle = 1
|
||||||
else:
|
else:
|
||||||
|
|
2
plant.py
2
plant.py
|
@ -164,7 +164,7 @@ class Plant:
|
||||||
def rarity_check(self):
|
def rarity_check(self):
|
||||||
# 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,int(CONST_RARITY_MAX))
|
||||||
common_range = round((2.0/3)*CONST_RARITY_MAX)
|
common_range = round((2.0/3)*CONST_RARITY_MAX)
|
||||||
uncommon_range = round((2.0/3)*(CONST_RARITY_MAX-common_range))
|
uncommon_range = round((2.0/3)*(CONST_RARITY_MAX-common_range))
|
||||||
rare_range = round((2.0/3)*(CONST_RARITY_MAX-common_range-uncommon_range))
|
rare_range = round((2.0/3)*(CONST_RARITY_MAX-common_range-uncommon_range))
|
||||||
|
|
Loading…
Reference in New Issue