-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.py
More file actions
73 lines (62 loc) · 1.17 KB
/
Copy pathplayer.py
File metadata and controls
73 lines (62 loc) · 1.17 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
name = "none"
experience = 0
level = 1
armor_id = 0
weapon_id = 0
py_pos = 0
px_pos = 0
pdamage = (10 + (level * 5)) * (weapon_id * 1.3)
id_to_name = {
0: "",
1: "coal",
2: "wood",
3: "stick",
4: "slime",
5: "iron",
6: "diamond"
}
inventory_id = [
0,
0,
0,
0,
0
]
inventory_amount = [
0,
0,
0,
0,
0
]
#the id is listed first then the amount
wood_sword_recipe = [
[3, 1],
[2, 2]
]
iron_sword_recipe = [
[3, 1],
[5, 2]
]
diamond_sword_recipe = [
[3, 1],
[6, 2]
]
def mult(inventory_amount):
#checks if there are are multiple items and updates the inventory function ccordingly
if inventory_amount[i] > 1:
return f"x{inventory_amount[i]}"
else:
return f"x1"
def craft():
craft_choice = int(input("\nWhat do you want to craft?"))
def inventory():
for i in range(len(inventory_id)):
#iterates through the list and prints the names of the items
print(f"{i + 1}: {id_to_name.get(inventory_id[i])} {mult(inventory_amount[i])}")
i += 1
inv_choice = int(input("\n\nYou may do 2 things.\n1: exit.\n2: craft"))
if inv_choice == 2:
craft()
elif inv_choice == 1:
return None