Code cleanup

pull/1/head
Jake Funke 2017-03-17 19:00:46 +00:00
parent b2d1c62323
commit 81590dd3f3
3 changed files with 20 additions and 12 deletions

View File

@ -11,10 +11,19 @@ Check in and water your plant every 24h to keep it growing. 5 days without water
*(work in progress)* *(work in progress)*
## getting started ## getting started
botany is designed for unix-based systems. Clone into a local directory using `git clone https://github.com/jifunks/botany.git`. Run with `python botany.py`. Water your seed to get started. You can come and go as you please and your plant continues to grow. Make sure to come back and water every 24 hours or your plant won't grow. If your plant goes 5 days without water, it will die! botany is designed for unix-based systems. Clone into a local directory using `git clone https://github.com/jifunks/botany.git`.
Run with `python botany.py`.
*Note - botany.py must initially be run by the user who cloned/unzipped *Note - botany.py must initially be run by the user who cloned/unzipped
botany.py - this initalizes the shared data file permissions.* botany.py - this initalizes the shared data file permissions.*
Water your seed to get started. You can come and go as you please and your plant continues to grow.
Make sure to come back and water every 24 hours or your plant won't grow.
If your plant goes 5 days without water, it will die!
## features ## features
* Curses-based menu system * Curses-based menu system
* Persistent aging system that allows your plant to grow even when app is closed * Persistent aging system that allows your plant to grow even when app is closed
@ -34,7 +43,6 @@ botany.py - this initalizes the shared data file permissions.*
``` ```
### testing features ### testing features
* *Plant lifecycle is currently extremely short for testing - bear with me!*
* *Plant mutation happens more frequently than it will in final version.* * *Plant mutation happens more frequently than it will in final version.*
### to-dos ### to-dos
@ -47,7 +55,7 @@ botany.py - this initalizes the shared data file permissions.*
* Server API to have rain storms, heat waves, insects * Server API to have rain storms, heat waves, insects
* Name your plant * Name your plant
* Reward for keeping plant alive * Reward for keeping plant alive
* Hybridization, multiple generations, lineage * Hybridization, multiple generations, lineage tracking
## requirements ## requirements
* Unix-based OS (Mac, Linux) * Unix-based OS (Mac, Linux)

View File

@ -91,11 +91,12 @@ class Plant(object):
12: 'iris', 12: 'iris',
13: 'agave', 13: 'agave',
14: 'ficus', 14: 'ficus',
15: 'lichen', 15: 'moss',
16: 'sage', 16: 'sage',
17: 'snapdragon', 17: 'snapdragon',
18: 'columbine', 18: 'columbine',
19: 'brugmansia', 19: 'brugmansia',
20: 'palm',
} }
mutation_dict = { mutation_dict = {
@ -227,8 +228,7 @@ class Plant(object):
def mutate_check(self): def mutate_check(self):
# Create plant mutation # Create plant mutation
# TODO: when out of debug this needs to be set to high number (1000 # TODO: when out of debug this needs to be set to high number
# even maybe)
CONST_MUTATION_RARITY = 3000 # Increase this # to make mutation rarer (chance 1 out of x) CONST_MUTATION_RARITY = 3000 # Increase this # to make mutation rarer (chance 1 out of x)
mutation_seed = random.randint(1,CONST_MUTATION_RARITY) mutation_seed = random.randint(1,CONST_MUTATION_RARITY)
if mutation_seed == CONST_MUTATION_RARITY: if mutation_seed == CONST_MUTATION_RARITY:
@ -251,7 +251,7 @@ class Plant(object):
# do stage growth stuff # do stage growth stuff
else: else:
# do stage 5 stuff (after fruiting) # do stage 5 stuff (after fruiting)
1==1 pass
def water(self): def water(self):
# Increase plant growth stage # Increase plant growth stage
@ -264,7 +264,7 @@ class Plant(object):
self.kill_plant() self.kill_plant()
while self.write_lock: while self.write_lock:
# Wait for garden writer to unlock # Wait for garden writer to unlock
1==1 pass
if not self.write_lock: if not self.write_lock:
self.new_seed(self.file_name) self.new_seed(self.file_name)
@ -291,13 +291,13 @@ class Plant(object):
if self.ticks >= self.life_stages[self.stage]: if self.ticks >= self.life_stages[self.stage]:
self.growth() self.growth()
if self.mutate_check(): if self.mutate_check():
1==1 pass
if self.water_check(): if self.water_check():
# Do something # Do something
1==1 pass
if self.dead_check(): if self.dead_check():
# Do something else # Do something else
1==1 pass
# TODO: event check # TODO: event check
class DataManager(object): class DataManager(object):

View File

@ -230,7 +230,6 @@ class CursedMenu(object):
self.screen.refresh() self.screen.refresh()
def get_plant_description(self, this_plant): def get_plant_description(self, this_plant):
1==1
output_text = "" output_text = ""
this_species = this_plant.species_dict[this_plant.species] this_species = this_plant.species_dict[this_plant.species]
this_color = this_plant.color_dict[this_plant.color] this_color = this_plant.color_dict[this_plant.color]
@ -244,6 +243,7 @@ class CursedMenu(object):
"You're tired of waiting for your seed to grow.", "You're tired of waiting for your seed to grow.",
"You wish your seed could tell you what it needs.", "You wish your seed could tell you what it needs.",
"You can feel the spirit inside your seed.", "You can feel the spirit inside your seed.",
"These pretzels are making you thirsty.",
], ],
1:[ 1:[
"The seedling fills you with hope.", "The seedling fills you with hope.",