-
Notifications
You must be signed in to change notification settings - Fork 6
/
commands.py
170 lines (146 loc) · 6.2 KB
/
commands.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
"""
This is the class that will print and return the available commands when the user asks for them
abbreviation PAC means Print Available Commands
"""
from classes import Paladin
from entities import Character
def pac_main_ooc():
"""
Prints all the possible commands you can use while out of combat.
"""
print()
print("Available commands:")
print("\tengage [Monster Name]")
print("\t\tEngages in combat with the monster whose name you've entered.\n")
print("\ttalk to [NPC Name]")
print("\t\tTalks to the NPC.\n")
print("\tbuy from [NPC Name]")
print("\t\tOpens a dialogue with the vendor where you can see and buy the items he has for sale.\n")
print("\topen inventory")
print("\t\tGives you access to your inventory.\n")
print("\tprint alive monsters")
print("\tpam")
print("\t\tPrints 5 monsters that are alive.\n")
print("\tprint alive npcs")
print("\tpan")
print("\t\tPrints 5 NPCs that are alive.\n")
print("\tprint all alive monsters")
print("\t\tPrints all monsters that are alive.\n")
print("\tprint all alive npcs")
print("\t\tPrints all NPCs that are alive.\n")
print("\tprint available quests")
print("\tpaq")
print("\t\tPrints all quests that are available in the current zone/subzone.\n")
print("\tprint quest log")
print("\t\tPrints the quests you are currently on.\n")
print("\tprint equipment")
print("\tpeq")
print("\t\tPrints the equipment the character is currently wearing")
print("\tprint inventory")
print("\t\tPrints every item in your inventory.\n")
print("\tgo to [Sub Zone]")
print("\t\tMoves the character to the selected sub zone.\n")
print("\tgo to ?")
print("\t\tShows a list of the reachable sub zones from the one the character is in.\n")
print("\tsave")
print("\t\tSaves your character to the database.\n")
print("\t?")
print("\t\tShows a list of available commands.\n")
def pac_in_combat(character):
"""
Prints all possible commands that can be used in combat
:param character: A Character object from class entities.py/Character
:return:
"""
print()
print("Available commands that do not end the turn:")
print("\tprint stats")
print("\t\tPrints information about the character and monster\n")
print("\tprint xp")
print("\t\tPrints the experience points of the character and the amount needed to level up\n")
print("\t?")
print("\t\tShows a list of available commands.\n")
print()
print("Available commands that end the turn:")
print("\tattack")
print("\t\tAttacks the monster you are in combat with a meele swing.\n")
print_class_abilities_in_combat(character)
def pac_vendor_dialogue():
print("\tbuy [Item Name]")
print("\t\tBuys the item from the vendor.\n")
print("\tsell [Item Name]")
print("\t\tSells the item to the vendor.\n")
print("\t[Item Name] info")
print("\t\tDisplays information about the item.\n")
print("\texit")
print("\t\tCloses the vendor window..\n")
print("\t?")
print("\t\tShows a list of available commands.\n")
def pac_looting():
"""Prints all possible commands the player can use while looting a creature"""
print()
print("Available commands:")
print("\ttake all")
print("\t\tLoots everything that has dropped.\n")
print("\ttake gold")
print("\t\tLoots the gold dropped from the monster.\n")
print("\ttake [item_name]")
print("\t\tLoots the specified item.\n")
print("\texit")
print("\t\tExits the loot window")
print("\t?")
print("\t\tShows a list of available commands.\n")
def pac_opened_inventory():
"""Prints all possible commands that the player can use while his inventory is opened"""
print("\tequip [Item Name]")
print("\t\tEquips the item\n")
print("\tuse [Consumable Item Name]")
print("\t\tUses up the item and activates it's effect.\n")
print("\texit")
print("\t\tCloses the inventory\n")
print("\t?")
print("\t\tShows a list of available commands.\n")
def pac_map_directions(possible_routes: list):
"""
Prints all possible subzones you can go in from your current subzone
:param possible_routes: A list holding the name of each subzone you have access to
"""
print("Possible directions:")
for route in possible_routes:
print(f'\t\t{route}')
def print_class_abilities_in_combat(character: Character):
if character.get_class() == 'paladin':
print_paladin_abilities_in_combat(character)
# ---------------------PALADIN---------------------
def print_paladin_abilities_in_combat(character: Paladin):
print("\tsor")
print("\t\tCasts Seal of Righteousness")
print(f"\t\t\tMana Cost: {character.learned_spells['Seal of Righteousness'].mana_cost}")
print("'\t\t\tLasts three turns and adds {0} damage to each of your auto attacks\n".format(
character.learned_spells['Seal of Righteousness'].damage1))
if "Melting Strike" in character.learned_spells.keys():
print("\tms")
print("\t\tCasts Melting Strike")
print(f'\t\t\tMana Cost: {character.learned_spells["Melting Strike"].mana_cost}')
print(f'\t\t\tDamages an enemy for '
f'{character.learned_spells["Melting Strike"].damage1} damage and adds a damage over time effect to it.\n')
if "Flash of Light" in character.learned_spells.keys():
print("\tfol")
print("\t\tCasts Flash of Light")
print(f"\t\t\tMana Cost: {character.learned_spells['Flash of Light'].mana_cost}")
# TODO: Move to a method in paladin that gives heal amount of spell name
print(f"\t\t\tHeals the paladin for {character.learned_spells['Flash of Light'].heal1} damage.")
def get_available_paladin_abilities(character: Paladin):
"""
Returns a set holding the COMMANDS for all of the available paladin spells to use
:param character:
:return:
"""
available_spells = set()
available_spells.add('sor')
if "Flash of Light" in character.learned_spells.keys():
available_spells.add('fol')
if "Melting Strike" in character.learned_spells.keys():
available_spells.add('ms')
return available_spells
# ------------------------------PALADIN------------------------------