added variable to control recovery speed
This commit is contained in:
@@ -14,3 +14,6 @@ max_decay = 3
|
|||||||
# The value is choosen randomly between these two. Obviously a lower number is better.
|
# The value is choosen randomly between these two. Obviously a lower number is better.
|
||||||
min_workpower = 1
|
min_workpower = 1
|
||||||
max_workpower = 3
|
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
|
||||||
|
|||||||
BIN
config.pyc
BIN
config.pyc
Binary file not shown.
@@ -11,10 +11,9 @@ class Tamagotchi:
|
|||||||
decayspeed = 0
|
decayspeed = 0
|
||||||
potential = 0
|
potential = 0
|
||||||
power = 0
|
power = 0
|
||||||
|
recovery = 0
|
||||||
|
|
||||||
recovery = 10
|
def __init__(self, name, hunger, happiness, hygiene, sleep, decayspeed, potential,recovery):
|
||||||
|
|
||||||
def __init__(self, name, hunger, happiness, hygiene, sleep, decayspeed, potential):
|
|
||||||
self.name = name
|
self.name = name
|
||||||
self.hunger = [hunger, hunger]
|
self.hunger = [hunger, hunger]
|
||||||
self.happiness = [happiness, happiness]
|
self.happiness = [happiness, happiness]
|
||||||
@@ -25,6 +24,7 @@ class Tamagotchi:
|
|||||||
self.decayspeed = decayspeed
|
self.decayspeed = decayspeed
|
||||||
self.potential = potential
|
self.potential = potential
|
||||||
self.power = potential
|
self.power = potential
|
||||||
|
self.recovery = recovery
|
||||||
|
|
||||||
def feed_other(self, tamagotchi):
|
def feed_other(self, tamagotchi):
|
||||||
self.status = 'Working'
|
self.status = 'Working'
|
||||||
|
|||||||
BIN
tamagotchi.pyc
BIN
tamagotchi.pyc
Binary file not shown.
3
util.py
3
util.py
@@ -15,5 +15,6 @@ class Util:
|
|||||||
sleep = random.randrange(min_stat,max_stat,1)
|
sleep = random.randrange(min_stat,max_stat,1)
|
||||||
decayspeed = random.randrange(min_decay,max_decay,1)
|
decayspeed = random.randrange(min_decay,max_decay,1)
|
||||||
potential = random.randrange(min_workpower, max_workpower,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)
|
||||||
|
|||||||
Reference in New Issue
Block a user