From ce318aebb0cce46000bf106448c8da059cf485d5 Mon Sep 17 00:00:00 2001 From: luxick Date: Thu, 21 Jan 2016 16:51:04 +0100 Subject: [PATCH] Cleaned up configs --- cli.py | 2 +- config.py | 28 ++++++++++++++-------------- syllables.txt | 6 +++++- util.py | 16 ++++++++-------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/cli.py b/cli.py index e918b25..547a53a 100644 --- a/cli.py +++ b/cli.py @@ -31,7 +31,7 @@ class cursesUI: height, width = self.stdscr.getmaxyx() self.win = curses.newpad(16383, width) - self.king.createKingdom(50) + self.king.createKingdom(startNrVillages) while self.running: self.build_screen(self.king, self.ticks) diff --git a/config.py b/config.py index a98491f..e55549e 100644 --- a/config.py +++ b/config.py @@ -1,34 +1,34 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +# Define if simulation should be started paused or running +start_paused = True # The lenght of one game cycle in milliseconds ticklenght = 0.001 +# Controls if Tamagotchi stats are shown in absolute vlaues or precentage (Possible values: True/False) +show_pct = True # Number of Tamagotchis to be created at the start of the simulation startnr = 60 +startNrVillages = 50 +# If the value of a Tamagotchis stats drops below this he will be fed/washed/etc +# Synatx [Hunger, Hygiene, Happiness] +interventionPoints = [50, 50, 50] # If the hunger stat falls below this level Tamagotchis can be fed feeding_point = 50 # If the hygiene stat falls below this level Tamagotchis can be washed washing_point = 50 # If the happiness stat falls below this level Tamagotchis can be played with play_point = 50 -# Controls if Tamagotchi stats are shown in absolute vlaues or precentage (Possible values: True/False) -show_pct = True # When new Tamagotchis are created their stats will be be created randomly between these. -min_stat = 100 -max_stat = 200 +statrange = [100, 200] # Tamagotchis decay at a set rate per tick. The value of decay is randomly chosen between these two. -min_decay = 1 -max_decay = 3 +decay = [1, 3] # These two define how long it takes a Tamagotchi to perform work (preparing food/washing someone/playing with someone) # The value is choosen randomly between these two. Obviously a lower number is better. -min_workpower = 3 -max_workpower = 6 +workpower = [3, 6] # This defines the bounds of how much a Tamagotchi can recover when eating/sleeping/playing etc. -min_recovery = 10 -max_recovery = 20 +recovery = [10, 20] # Defines the range in witch the lifetime of Tamagotichs will be created in ticks -min_life = 2000 -max_life = 3000 -# Define if simulation should be started paused or running -start_paused = True +life = [2000, 3000] + diff --git a/syllables.txt b/syllables.txt index b5b613e..d646121 100644 --- a/syllables.txt +++ b/syllables.txt @@ -20,4 +20,8 @@ wir wen ein dev -ken \ No newline at end of file +ken +ir +ne +he +mu \ No newline at end of file diff --git a/util.py b/util.py index f8e74b2..6167864 100644 --- a/util.py +++ b/util.py @@ -10,14 +10,14 @@ class Util: def make_Tamagotchi(self): name = self.generateName() - hunger = random.randrange(min_stat,max_stat,1) - happiness = random.randrange(min_stat,max_stat,1) - hygiene = random.randrange(min_stat,max_stat,1) - sleep = random.randrange(min_stat,max_stat,1) - decayspeed = random.randrange(min_decay,max_decay,1) - potential = random.randrange(min_workpower, max_workpower,1) - recovery = random.randrange(min_recovery, max_recovery, 1) - lifetime = random.randrange(min_life, max_life, 1) + hunger = random.randrange(statrange[0],statrange[1],1) + happiness = random.randrange(statrange[0],statrange[1],1) + hygiene = random.randrange(statrange[0],statrange[1],1) + sleep = random.randrange(statrange[0],statrange[1],1) + decayspeed = random.randrange(decay[0],decay[1],1) + potential = random.randrange(workpower[0], workpower[1],1) + recovery = random.randrange(recovery[0], recovery[1], 1) + lifetime = random.randrange(life[0], life[1], 1) return Tamagotchi(name,hunger,happiness,hygiene,sleep,decayspeed,potential,recovery,lifetime)