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)*
## 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
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
* Curses-based menu system
* 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
* *Plant lifecycle is currently extremely short for testing - bear with me!*
* *Plant mutation happens more frequently than it will in final version.*
### to-dos
@ -47,7 +55,7 @@ botany.py - this initalizes the shared data file permissions.*
* Server API to have rain storms, heat waves, insects
* Name your plant
* Reward for keeping plant alive
* Hybridization, multiple generations, lineage
* Hybridization, multiple generations, lineage tracking
## requirements
* Unix-based OS (Mac, Linux)

View File

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

View File

@ -230,7 +230,6 @@ class CursedMenu(object):
self.screen.refresh()
def get_plant_description(self, this_plant):
1==1
output_text = ""
this_species = this_plant.species_dict[this_plant.species]
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 wish your seed could tell you what it needs.",
"You can feel the spirit inside your seed.",
"These pretzels are making you thirsty.",
],
1:[
"The seedling fills you with hope.",