moved global variables to a seperate config file

This commit is contained in:
luxick
2015-07-26 22:14:21 +02:00
parent 0c6e2cbdf2
commit 187df5697a
9 changed files with 50 additions and 29 deletions

View File

@@ -20,7 +20,7 @@ class Mayorgotchi:
self.mygotchis.remove(n)
def give_status(self,show_pct):
result = 'I am Mayorgotchi ' + self.name + '.\nIn my Village '+str(self.graveyard)+' Tamagotchis died so far.\nThese are the Tamagotchis living in my Village:\n\n'
result = 'I am Mayorgotchi ' + self.name + '.\nIn my Village '+str(self.graveyard)+' Tamagotchis died so far.\nThese are the '+str(len(self.mygotchis))+' Tamagotchis living in my Village:\n\n'
for n in self.mygotchis:
if show_pct:
result += n.status_pct()
@@ -33,7 +33,7 @@ class Mayorgotchi:
for n in self.mygotchis:
if n.status is 'Idle':
freegotchis.append(n)
if freegotchis is not None:
if len(freegotchis) > 0:
return freegotchis[random.randrange(0,len(freegotchis),1)]
else:
return None