Refactor all the lines with a length >80 characters
This commit is contained in:
parent
974a8d36f7
commit
d9ad9ab479
|
@ -28,7 +28,7 @@ def pet_stats():
|
||||||
print("Age: " + str(pet_variables.pet_age))
|
print("Age: " + str(pet_variables.pet_age))
|
||||||
print("Health: " + pet_variables.pet_health * "♥")
|
print("Health: " + pet_variables.pet_health * "♥")
|
||||||
print("Hunger: " + pet_variables.pet_hunger * "*")
|
print("Hunger: " + pet_variables.pet_hunger * "*")
|
||||||
print("Happines: " + pet_variables.pet_happiness * "☺")
|
print("Happines: " + pet_variables.pet_happiness * "☺ ")
|
||||||
|
|
||||||
|
|
||||||
# A function which checks if the pet is still alive
|
# A function which checks if the pet is still alive
|
||||||
|
@ -83,13 +83,16 @@ def aging():
|
||||||
if pet_variables.pet_age == 5:
|
if pet_variables.pet_age == 5:
|
||||||
pet_variables.pet_status = "adult"
|
pet_variables.pet_status = "adult"
|
||||||
set_adult_stats()
|
set_adult_stats()
|
||||||
print("Congratulation your pet has become an adult. It needs less food now")
|
print("Congratulation your pet has become an adult. \
|
||||||
print("and it's health has improved however it's grumpier than a youngling.")
|
It needs less food now")
|
||||||
|
print("and it's health has improved. However, \
|
||||||
|
it's grumpier than a youngling.")
|
||||||
elif pet_variables.pet_age == 15:
|
elif pet_variables.pet_age == 15:
|
||||||
pet_variables.pet_status = "elderly"
|
pet_variables.pet_status = "elderly"
|
||||||
set_elderly_stats()
|
set_elderly_stats()
|
||||||
print("Congratulation your pet has become an elderly it needs now less food.")
|
print("Congratulation your pet has become an elderly. \
|
||||||
print("However it's health is worse and it's grumpier than an adult.")
|
It needs less food now.")
|
||||||
|
print("However it's health is worse and it is grumpier than an adult.")
|
||||||
|
|
||||||
|
|
||||||
### Functions to increase and decrease stats ###
|
### Functions to increase and decrease stats ###
|
||||||
|
@ -160,7 +163,10 @@ def stroking():
|
||||||
# and health.
|
# and health.
|
||||||
def feeding():
|
def feeding():
|
||||||
os.system('clear')
|
os.system('clear')
|
||||||
print("Hungriness of " + pet_variables.pet_name + ": " + pet_variables.pet_hunger * "*")
|
print("Hungriness of " \
|
||||||
|
+ pet_variables.pet_name \
|
||||||
|
+ ": " \
|
||||||
|
+ pet_variables.pet_hunger * "*")
|
||||||
feeding_confirmed = input("Do you want to feed your pet?")
|
feeding_confirmed = input("Do you want to feed your pet?")
|
||||||
if feeding_confirmed in ("Y", "y"):
|
if feeding_confirmed in ("Y", "y"):
|
||||||
increase_hunger()
|
increase_hunger()
|
||||||
|
@ -189,14 +195,19 @@ def playing():
|
||||||
def poking():
|
def poking():
|
||||||
os.system('clear')
|
os.system('clear')
|
||||||
if pet_variables.poke_count < 3:
|
if pet_variables.poke_count < 3:
|
||||||
print("You poke " + pet_variables.pet_name + " and it starts to speak.")
|
print("You poke " \
|
||||||
|
+ pet_variables.pet_name \
|
||||||
|
+ " and it starts to speak.")
|
||||||
increase_poke_count()
|
increase_poke_count()
|
||||||
mixer.init()
|
mixer.init()
|
||||||
mixer.music.load('happy.mp3')
|
mixer.music.load('happy.mp3')
|
||||||
mixer.music.play()
|
mixer.music.play()
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
else:
|
else:
|
||||||
print("You annoyed " + pet_variables.pet_name + "." + " It got angry at you.")
|
print("You annoyed " \
|
||||||
|
+ pet_variables.pet_name \
|
||||||
|
+ "." \
|
||||||
|
+ " It got angry at you.")
|
||||||
decrease_happiness()
|
decrease_happiness()
|
||||||
mixer.init()
|
mixer.init()
|
||||||
mixer.music.load('angry.mp3')
|
mixer.music.load('angry.mp3')
|
||||||
|
|
|
@ -20,7 +20,8 @@ while pet_functions.is_alive():
|
||||||
pet_variables.beginning_finished = True
|
pet_variables.beginning_finished = True
|
||||||
print()
|
print()
|
||||||
print()
|
print()
|
||||||
print("Your pet is currently a youngling which means it's needs a lot of attention.")
|
print("Your pet is currently a youngling which means \
|
||||||
|
it's needs a lot of attention.")
|
||||||
print("Take good care of it or it will die very soon.")
|
print("Take good care of it or it will die very soon.")
|
||||||
# checks if the pet has reached a new life stage and updates it accordingly
|
# checks if the pet has reached a new life stage and updates it accordingly
|
||||||
pet_functions.aging()
|
pet_functions.aging()
|
||||||
|
|
Reference in New Issue