pankration.py
5.27 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import random
import time
FIND_PERCENTAGE = 80
class HuntResponse:
ERROR = -1
FAILURE = 0
SUCCESS = 1
def __init__(self, result, message, monster):
self.result = result
self.message = message
self.monster = monster
class Jobs:
WAR = 1
MNK = 2
BLM = 3
WHM = 4
THF = 5
RDM = 6
PLD = 7
DRK = 8
BST = 9
BRD = 10
RNG = 11
SAM = 12
NIN = 13
DRG = 14
SMN = 15
BLU = 16
COR = 17
PUP = 18
DNC = 19
SCH = 20
GEO = 21
RUN = 22
PhysicalDamageTypes = {
'blunt': ['Hand-to-Hand', 'Club', 'Staff', 'Harlequin Frame', 'Stormwaker Frame', 'Sharpshot Frame'],
'slashing': ['Axe', 'Great Axe', 'Great Sword', 'Sword', 'Scythe', 'Katana', 'Great Katana', 'Valoredge Frame'],
'piercing': ['Dagger', 'Polearm', 'Archery', 'Marksmanship', 'Shuriken', 'Boomerang']
}
FeralSkills = {
'Airy Shield': {'type': 'Enhancing', 'sub_type': 'arrow shield', 'shadows': 'ignore', 'range': None, 'aoe': False, 'spell': 'arrow shield'},
'Binding Wave': {'type': 'Enfeebling', 'shadows': 'ignore', 'range': 15, 'aoe': True, 'spell': 'bind'},
'Dire Straight': {'type': 'Physical', 'shadows': 'wipe', 'range': None, 'aoe': False},
'Dismemberment': {'type': 'Piercing', 'shadows': 'absorb', 'range': None, 'aoe': False}, # causes the monster to lose a body part
'Earthshatter': {'type': 'Piercing', 'shadows': 'wipe', 'range': None, 'aoe': True},
'Eyes On Me': {'type': 'Magical', 'sub_type': 'Dark', 'mp_cost': 112, 'shadows': 'absorb', 'range': 13, 'aoe': False},
'Hypnosis': {'type': 'Enfeebling', 'sub_type': 'sleep', 'shadows': 'ignore', 'range': 'gaze', 'aoe': True},
'Magic Barrier': {'type': 'Magical', 'sub_type': 'Dark', 'mp_cost': 29, 'shadows': 'absorb', 'range': None, 'aoe': True},
'Sinker Drill': {'type': 'Physical', 'sub_type': 'Piercing', 'shadows': 'absorb', 'range': None, 'aoe': False},
}
Families = {
'acrolith': {
'base_fp': 50,
'fp_per_level': 0.1,
'max_fp': 55,
'main_job': Jobs.WAR,
'support_job': None,
'innate_feral_skills': ['Sinker Drill', 'Dire Straight', 'Dismemberment', 'Earthshatter'],
'type': 'Arcana',
'strong_vs': ['Dark'],
'charmable': False,
'aspir': False,
'drain': False
},
'ahriman': {
'base_fp': 65,
'fp_per_level': 0.3,
'max_fp': 80,
'main_job': Jobs.WAR,
'support_job': Jobs.BLM,
'innate_feral_skills': ['Binding Wave', 'Magic Barrier', 'Hypnosis', 'Eyes On Me', 'Airy Shield'],
'type': 'Demon',
'traits': ['magic defence bonus +25%'],
'charmable': False,
'aspir': True,
'drain': True
}
}
Monsters = {
'Mechanical Menace': {
'family': 'acrolith',
'zone': 'Abyssea - Uleguerand'
},
'Floating Eye': {
'family': 'ahriman',
'zone': 'Ranguemont Pass'
}
}
class Pankration:
def __init__(self):
pass
def start_battle(self, monster1, monster2, battle_type):
pass
def list_zones(self):
zone_list = []
for monster in Monsters.itervalues():
if monster['zone'] not in zone_list:
zone_list.append(monster['zone'])
return zone_list
def get_monsters(self, zone):
monster_list = []
for monster_name, monster in Monsters.iteritems():
if monster['zone'] == zone:
monster_list.append(monster_name)
return monster_list
def hunt_monster(self, zone):
if random.randint(1, 100) < FIND_PERCENTAGE:
return HuntResponse(HuntResponse.SUCCESS, "You captured the monster!",
random.choice(self.get_monsters(zone)))
else:
return HuntResponse(HuntResponse.FAILURE, "You were unable to capture a monster's soul.",
None)
def get_action():
return ""
class Monster:
def __init__(self, family, level, main_job, support_job, fp_capacity, innate_feral_skills,
eqipped_feral_skills, dicipline_level, temperament):
self.family = family
self.level = level
self.main_job = main_job
self.support_job = support_job
self.fp_capacity = fp_capacity
self.innate_feral_skills = innate_feral_skills
self.equipped_feral_skills = eqipped_feral_skills
self.discipline_level = dicipline_level
self.temperament = temperament
def calculate_fp_gain(self):
pass
def set_strategy(self, strategy_type):
if strategy_type not in self.monster_data['strategies']:
return False
else:
self.strategy = strategy_type
class Battle:
pass
class Arena:
pass
#print Families
p = Pankration()
print("Zones: \n\n{}".format('\n'.join(p.list_zones())))
hunt_zone = p.list_zones()[0]
print("Hunting for monster in zone: {}\n".format(hunt_zone))
hunt_response = p.hunt_monster(hunt_zone)
print("hunt_response")
print(str(hunt_response.result))
time.sleep(0.5)
if hunt_response.result == HuntResponse.SUCCESS:
print(hunt_response.message)
monster = Monsters[hunt_response.monster]
print("The Soul Plate Shows: \n\n{}\n{}{}".format(hunt_response.monster))
else:
print(hunt_response.message)