From 9ebccff1a0f265d2e52e25bc7a0bc5da277ca8a7 Mon Sep 17 00:00:00 2001 From: luxick Date: Sun, 26 Jul 2015 22:20:39 +0200 Subject: [PATCH] added variable to control recovery speed --- config.py | 3 +++ config.pyc | Bin 348 -> 408 bytes tamagotchi.py | 6 +++--- tamagotchi.pyc | Bin 5092 -> 5108 bytes util.py | 3 ++- util.pyc | Bin 1033 -> 1106 bytes 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 20884bd..41d074c 100644 --- a/config.py +++ b/config.py @@ -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 diff --git a/config.pyc b/config.pyc index 45dcc486c1e4abd4ab5cfe8d415dcf612718d23b..7a3f02ca01ef16b6dbdfa5fddc19081044b613e9 100644 GIT binary patch delta 151 zcmcb^G=o{1`7*^gqRRe5gQW_ KGJ-KPga!a=fE-@{ delta 72 zcmbQie1}Pz`7E?+Kf3^gLPtpIJ2Jy=fswl$y$sNLVQ3u NHYOls1Y>44MgaJY3uXWS diff --git a/tamagotchi.py b/tamagotchi.py index a0b468a..c248336 100644 --- a/tamagotchi.py +++ b/tamagotchi.py @@ -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' diff --git a/tamagotchi.pyc b/tamagotchi.pyc index 0fcad13ecc764a732ff267cb37d1fcf375415bc3..414be85a37effa44e83e07287d0bbf580ca46768 100644 GIT binary patch delta 554 zcmZvYKTE?v7{=c>P19bJH2vS&p+yH9a43EQK{^zvVCvMN5qkv-qSB^M)l<1v>2}*T*fSnkUYLJ(+pXRG zcK5(0Y)vV%2eL9JY}f7VbUfFMaqeZf01~vuFJbS>CR(f-xWzd83=}ns2b?4usa4ig zYuvn3C#FAA4>9gUMMCFdqaaIU{d;X5F~MF#3x#Q4PPyLgw;ge+aoV2^Z=jmx23yqf z?1}_q(*=Jw{2?h+)00?P|3Ah~^(Q`K!>I5>h?zf(y)j*zTWI-4^aZ6+^UJY5NB<_S cU|RlC+=!DBBCf^BvB$(k5H*FEteHId1%ydwzW@LL delta 523 zcmZXPJxc>Y5Qb+q$>oy!$R)WXMg&1b4=lv5QV_*p1XG+g+Nm4-K%&Gmpp6z{Dd@DO z^$#5W0Q+=eXK7(&qm7-rgJ|Kxy!*_)v$M0Gqpzbz;={=ArCUmPylH%6hUSfe2`g&5=e`o4AN$(fOHu8K)MW7kU55a2v-9Sh5;f_ zYmX(XblX&-L#S9#aonLfJSji82OxhCTG;P-CMc77O-|^{P zR4AQTN0&Ae_vn$C95h^Ig$0^0>(oiEjCd-I(n{txqussMPJr6iL-0f4UwJ&4nn6F( zW3`*xhn;5oG_-Ub(zR&BkH!dMp5D@9)v9ixEuM0%ebNjwe}!je1+h%GnIY@9@TZ59 z^$~pt;k9d!rU3B9C_Zc~zEm(2QYoR)O$O|lS|D2wtsHLQ( QLcKyaB@B_Vsa3rC2E9&WG5`Po diff --git a/util.py b/util.py index eaef25c..82d32a0 100644 --- a/util.py +++ b/util.py @@ -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) diff --git a/util.pyc b/util.pyc index 258b7004c0ad05498a4a61be93921b0074b38029..de51284d7d8aee884242d942bf7ee3e34707f3b6 100644 GIT binary patch delta 189 zcmeC=xWvK6{F#@_&0!+jQ9e!v1_lsz2IAs<6L0o8Ffn8?Gn8;KlyEboFfueVGt_c0 zl<+XrFf!CIG1M?K)UYtrurk!JG1Ra#)Nn8~b1(#JFadS@WikRu4c^K9jFU8h8W18cd12B^*FDOyy(+X8Xw}m?SxcKq?q{7)2+) NVA5xlm@L8k5di1)Dl7m1 delta 111 zcmcb_(aFKa{F#?a({3W$Q9cd^1_lsz2IAsn6L0oua52;{GSo0J)G#yDurSoHGSsj! z)UY!&voi#1FacHhWikRu4erUy87Hv^0htUM9Fvon5+`3^ieMK2@fmq08#3!NicU^s G{s;iuIu+Xh