added variable to control recovery speed

This commit is contained in:
luxick
2015-07-26 22:20:39 +02:00
parent 187df5697a
commit 9ebccff1a0
6 changed files with 8 additions and 4 deletions

View File

@@ -14,3 +14,6 @@ max_decay = 3
# The value is choosen randomly between these two. Obviously a lower number is better.
min_workpower = 1
max_workpower = 3
# This defines the bounds of how much a Tamagotchi can recover when eating/sleeping/playing etc.
min_recovery = 10
max_recovery = 20

Binary file not shown.

View File

@@ -11,10 +11,9 @@ class Tamagotchi:
decayspeed = 0
potential = 0
power = 0
recovery = 0
recovery = 10
def __init__(self, name, hunger, happiness, hygiene, sleep, decayspeed, potential):
def __init__(self, name, hunger, happiness, hygiene, sleep, decayspeed, potential,recovery):
self.name = name
self.hunger = [hunger, hunger]
self.happiness = [happiness, happiness]
@@ -25,6 +24,7 @@ class Tamagotchi:
self.decayspeed = decayspeed
self.potential = potential
self.power = potential
self.recovery = recovery
def feed_other(self, tamagotchi):
self.status = 'Working'

Binary file not shown.

View File

@@ -15,5 +15,6 @@ class Util:
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)
return Tamagotchi(name,hunger,happiness,hygiene,sleep,decayspeed,potential)
return Tamagotchi(name,hunger,happiness,hygiene,sleep,decayspeed,potential,recovery)

BIN
util.pyc

Binary file not shown.