Skip to content

Commit bf59e61

Browse files
author
Federyeeco
committed
json maker
1 parent bd1ddde commit bf59e61

File tree

4 files changed

+225
-41
lines changed

4 files changed

+225
-41
lines changed

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"python.linting.pylintEnabled": true,
3+
"python.linting.enabled": false
4+
}

src/db/f.txt

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
Rathian
2+
Flying Wyvern
3+
Head 0 70 75 65 0 15 15 20 30 100
4+
Neck 0 40 45 35 0 0 0 5 15 0
5+
Body 0 35 30 25 0 5 5 10 20 0
6+
Back 0 35 30 25 0 5 5 10 20 0
7+
Wing 0 45 45 35 0 10 10 15 25 0
8+
Leg 0 40 40 35 0 0 0 5 15 0
9+
Tail 0 45 40 35 0 5 5 10 20 0
10+
Poison
11+
250 +150 →700
12+
5 / 10 sec
13+
150
14+
15 sec
15+
Paralysis
16+
180 +130 →570
17+
5 / 10 sec
18+
0
19+
10 sec
20+
Sleep
21+
150 +100 →550
22+
5 / 10 sec
23+
0
24+
40 sec
25+
Stun
26+
110 +120 →630
27+
5 / 10 sec
28+
0
29+
10 sec
30+
Blast
31+
120 +60 →720
32+
5 / 10 sec
33+
0
34+
0 sec
35+
Exhaust
36+
225 +75 →900
37+
5 / 10 sec
38+
0
39+
0 sec
40+
Fireblight
41+
180 +130 →570
42+
5 / 10 sec
43+
300
44+
20 sec
45+
Waterblight
46+
180 +130 →570
47+
5 / 10 sec
48+
0
49+
30 sec
50+
Iceblight
51+
180 +130 →570
52+
5 / 10 sec
53+
0
54+
30 sec
55+
Thunderblight
56+
180 +130 →570
57+
5 / 10 sec
58+
0
59+
40 sec
60+
61+
M
62+
Apex Rathian
63+
Flying Wyvern
64+
PARTS
65+
Head 0 60 65 50 0 10 10 10 20 100
66+
Head 1 65 70 55 0 10 10 10 25 100
67+
Neck 0 40 40 30 5 10 10 10 20 0
68+
Body 0 24 24 20 0 5 5 15 15 0
69+
Back 0 20 20 15 5 10 10 20 25 0
70+
Back 1 38 38 45 5 10 10 20 25 0
71+
Wing 0 35 35 30 0 10 10 20 25 0
72+
Leg 0 24 24 20 0 5 5 10 15 0
73+
Tail 0 40 35 30 5 5 5 10 15 0
74+
Tail 1 45 40 35 5 5 5 10 20 0
75+
Tail 2 50 45 45 0 5 5 10 20 0
76+
AILMENTS
77+
Poison
78+
250 +150 →700
79+
5 / 10 sec
80+
150
81+
15 sec
82+
Paralysis
83+
300 +100 →700
84+
5 / 10 sec
85+
0
86+
7 sec
87+
Sleep
88+
250 +150 →700
89+
5 / 10 sec
90+
0
91+
40 sec
92+
Stun
93+
150 +120 →630
94+
5 / 10 sec
95+
0
96+
10 sec
97+
Blast
98+
120 +60 →720
99+
5 / 10 sec
100+
0
101+
0 sec
102+
Exhaust
103+
375 +150 →1575
104+
5 / 10 sec
105+
0
106+
0 sec
107+
Fireblight
108+
180 +130 →570
109+
5 / 10 sec
110+
300
111+
20 sec
112+
Waterblight
113+
180 +130 →570
114+
5 / 10 sec
115+
0
116+
30 sec
117+
Iceblight
118+
180 +130 →570
119+
5 / 10 sec
120+
0
121+
30 sec
122+
Thunderblight
123+
180 +130 →570
124+
5 / 10 sec
125+
0
126+
40 sec
127+
128+
M
129+
Rathalos
130+
Flying Wyvern
131+
PARTS
132+
Head 0 65 70 60 0 15 15 20 30 100
133+
Neck 0 35 40 30 0 5 5 10 20 0
134+
Back 0 25 25 20 0 5 5 10 20 0
135+
Abdomen 0 25 25 20 0 5 5 10 20 0
136+
Tail 0 45 40 35 0 5 5 10 20 0
137+
Wing 0 50 45 40 0 10 10 15 25 0
138+
Leg 0 35 35 30 0 0 0 5 15 0
139+
AILMENTS
140+
Poison
141+
250 +150 →700
142+
5 / 10 sec
143+
150
144+
15 sec
145+
Paralysis
146+
180 +130 →570
147+
5 / 10 sec
148+
0
149+
10 sec
150+
Sleep
151+
150 +100 →550
152+
5 / 10 sec
153+
0
154+
40 sec
155+
Stun
156+
150 +120 →630
157+
5 / 10 sec
158+
0
159+
10 sec
160+
Blast
161+
120 +60 →720
162+
5 / 10 sec
163+
0
164+
0 sec
165+
Exhaust
166+
225 +75 →900
167+
5 / 10 sec
168+
0
169+
0 sec
170+
Fireblight
171+
180 +130 →570
172+
5 / 10 sec
173+
300
174+
20 sec
175+
Waterblight
176+
180 +130 →570
177+
5 / 10 sec
178+
0
179+
30 sec
180+
Iceblight
181+
180 +130 →570
182+
5 / 10 sec
183+
0
184+
30 sec
185+
Thunderblight
186+
180 +130 →570
187+
5 / 10 sec
188+
0
189+
40 sec

src/db/file.json

-28
This file was deleted.

src/db/json_maker.py

+32-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from copy import deepcopy
21
import json
2+
import numpy as np
33

44
class Monsters(object):
55
def __init__(self):
@@ -49,22 +49,39 @@ def custom_encode(obj):
4949
voti_arr = []
5050
lista_mostri = Monsters()
5151

52-
flag = raw_input('Nuovo mostro? [s/n]')
52+
file = open('f.txt', 'r')
53+
lines = file.readlines()
54+
55+
count = 0
56+
for line in lines:
57+
if 'M' in line:
58+
59+
60+
"""
61+
m = input('In: ')
62+
m_array = m.split()
63+
np_m = np.asarray(m_array)
64+
matrix = np_m.reshape(7, 11)
65+
print(matrix)
66+
67+
flag = input('Nuovo mostro? [s/n]')
5368
5469
while flag == 's':
55-
name = raw_input('Nome Mostro: ')
56-
tipo = raw_input('Tipo Mostro: ')
70+
name = input('Nome Mostro: ')
71+
tipo = input('Tipo Mostro: ')
5772
58-
for i in range(7):
59-
p = raw_input('Part: ')
60-
p_splitted = p.split()
73+
p = input('Parts: ')
74+
p_splitted = p.split()
75+
p_np_m = np.array(p_splitted)
76+
matrix = p_np_m.reshape(7, 11)
6177
62-
if len(p_splitted) == 11:
63-
part = Part(p_splitted[0], p_splitted[1], p_splitted[2], p_splitted[3], p_splitted[4], p_splitted[5], p_splitted[6], p_splitted[7], p_splitted[8], p_splitted[9], p_splitted[10])
64-
parts_array.append(part)
78+
for i in range(7):
79+
row = matrix[i, :]
80+
part = Part(row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10])
81+
parts_array.append(part)
6582
6683
for i in range(10):
67-
a = raw_input('Ailment: ')
84+
a = input('Ailment: ')
6885
a_splitted = a.split()
6986
7087
if len(a_splitted) == 5:
@@ -73,7 +90,9 @@ def custom_encode(obj):
7390
7491
monster = Monster(name, tipo, parts_array, ailments_array)
7592
lista_mostri.monsters.append(monster)
76-
flag = raw_input('Nuovo mostro? [s/n]')
93+
flag = input('Nuovo mostro? [s/n]')
94+
7795
78-
with open("f1.json", "w") as file:
96+
with open("f2.json", "w") as file:
7997
file.write(json.dumps(lista_mostri.__dict__, default=custom_encode))
98+
"""

0 commit comments

Comments
 (0)