forked from spitsfire/adadachi-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.py
60 lines (49 loc) · 1.64 KB
/
game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from player import Player
from adadachi import Adadachi
from constants import *
import random
player = Player()
def display(statement):
print(statement)
def create_adadachi_personality():
foods = player.inventory["foods"]
games = player.inventory["games"]
personality = {}
fav_food = random.randint(0,len(foods)-1)
hates_food = random.randint(0,len(foods)-1)
while fav_food == hates_food:
hates_food = random.randint(0,len(foods)-1)
fav_game = random.randint(0,len(games)-1)
hates_game = random.randint(0,len(games)-1)
while fav_game == hates_game:
hates_game = random.randint(0,len(games)-1)
personality["fav_food"] = fav_food
personality["hates_food"] = hates_food
personality["fav_game"] = fav_game
personality["hates_game"] = hates_game
return personality
def create_adadachi():
name = input(GET_NAME + "\n\t")
personality = create_adadachi_personality()
player.adadachi = Adadachi(name,personality)
def start_game():
display(TITLE)
answer = input(GREETING)
if answer.lower() == "y":
create_adadachi()
while player.adadachi.hunger < 5:
option = input(OPTIONS).lower()
if option == "s":
player.get_status()
elif option == "c":
player.clean()
elif option == "f":
if player.inventory["foods"]:
player.feed()
else:
break
elif option == "p":
player.play_with_adadachi()
elif option == "x":
return display(EXIT)
display(LOST)