1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Merged specials.txt into heroes.json.

This commit is contained in:
Frank Zago 2011-08-27 17:33:07 +00:00
parent 9594058157
commit 2a0fef0e4d
3 changed files with 888 additions and 352 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,176 +0,0 @@
"Hero ID" "Bonus Type" "Val" "Subtype" "Additional Info"
0 2 5 1 0
1 1 0 0 2
2 1 0 0 4
3 2 2 5 1
4 2 5 13 0
5 1 0 0 6
6 1 0 0 146
7 1 0 0 10
8 2 5 27 0
9 6 3 41 0
10 8 0 45 0
11 3 3 20 0
12 1 0 0 8
13 2 5 11 0
14 8 0 48 0
15 10 350 6 0
16 2 5 23 0
17 1 0 0 16
18 10 350 6 0
19 1 0 0 22
20 2 5 26 0
21 1 0 0 18
22 1 0 0 24
23 2 5 2 0
24 8 0 55 1
25 3 3 37 0
26 2 5 24 0
27 2 5 27 0
28 2 5 11 0
29 7 0 51 0
30 3 3 16 0
31 1 0 0 20
32 1 0 0 30
33 1 0 0 36
34 1 0 0 32
35 2 5 23 0
36 1 0 0 146
37 1 0 0 38
38 10 1 1 0
39 1 0 0 36
40 3 3 60 0
41 2 5 8 1
42 2 5 11 0
43 7 0 51 0
44 1 0 0 34
45 3 3 19 0
46 8 0 53 0
47 10 350 6 0
48 1 0 0 46
49 1 0 0 52
50 1 0 0 48
51 1 0 0 42
52 10 350 6 0
53 1 0 0 42
54 1 0 0 146
55 1 0 0 50
56 2 5 24 0
57 3 3 22 0
58 2 5 8 1
59 8 0 45 0
60 10 1 3 0
61 8 0 43 0
62 2 5 25 0
63 3 3 21 0
64 1 0 0 58
65 1 0 0 62
66 1 0 0 64
67 1 0 0 60
68 1 0 0 66
69 2 5 12 0
70 10 350 6 0
71 1 0 0 56
72 3 3 24 0
73 3 3 23 0
74 2 5 25 0
75 2 5 11 1
76 3 39 0 3
77 8 0 46 0
78 2 5 12 0
79 10 350 6 0
80 1 0 0 72
81 1 0 0 146
82 1 0 0 78
83 1 0 0 74
84 10 350 6 0
85 2 5 2 0
86 1 0 0 80
87 1 0 0 70
88 3 3 38 0
89 2 5 8 1
90 2 5 25 0
91 3 3 38 0
92 2 5 11 1
93 3 3 23 0
94 10 1 4 0
95 8 0 46 0
96 1 0 0 94
97 1 0 0 146
98 1 0 0 88
99 1 0 0 92
101 1 0 0 84
102 1 0 0 90
103 2 5 22 0
104 1 0 0 86
105 2 5 25 0
106 1 0 0 90
107 2 5 2 0
108 8 0 53 0
109 8 0 44 0
110 2 5 25 0
111 2 5 11 1
112 10 1 5 0
113 1 0 0 106
114 1 0 0 98
115 1 0 0 100
116 2 5 23 0
117 1 0 0 102
118 1 0 0 104
119 1 0 0 146
120 1 0 0 108
121 2 5 8 1
122 2 2 5 1
123 2 5 27 1
124 8 0 46 0
125 2 5 25 0
126 2 5 24 0
127 2 5 11 1
128 4 3 1 120
128 4 3 2 120
129 4 2 1 113
129 4 1 2 113
129 4 5 4 113
130 4 1 1 114
130 4 2 1 114
130 4 2 3 114
131 4 2 1 115
132 4 3 1 120
132 4 3 2 120
133 4 2 1 113
133 4 1 2 113
133 4 5 4 113
134 4 1 1 114
134 4 2 1 114
134 4 2 3 114
135 4 2 1 115
136 5 100 13 0
137 8 0 53 0
138 5 50 15 0
139 8 0 46 0
140 8 0 43 0
141 8 0 47 0
142 10 350 6 0
143 10 350 6 0
144 12 2 0 0
145 11 14 0 0
146 1 0 0 4
147 9 0 8 136
147 9 0 34 136
148 9 0 2 137
148 9 0 18 137
149 4 5 1 96
149 4 5 2 96
149 4 10 3 96
150 4 5 1 66
150 4 5 2 66
150 4 10 3 66
151 13 5 1 0
151 13 5 2 0
152 1 0 0 4
153 13 1 1 5
153 13 1 1 5
154 1 0 0 90
155 4 4 1 54
155 4 2 2 54
155 4 1 5 54

View File

@ -288,6 +288,7 @@ void CHeroHandler::loadHeroes()
const JsonNode config(DATA_DIR "/config/heroes.json"); const JsonNode config(DATA_DIR "/config/heroes.json");
BOOST_FOREACH(const JsonNode &hero, config["heroes"].Vector()) { BOOST_FOREACH(const JsonNode &hero, config["heroes"].Vector()) {
int hid = hero["id"].Float(); int hid = hero["id"].Float();
const JsonNode *value;
heroes[hid]->sex = hero["sex"].Float(); heroes[hid]->sex = hero["sex"].Float();
@ -295,10 +296,24 @@ void CHeroHandler::loadHeroes()
heroes[hid]->secSkillsInit.push_back(std::make_pair(set["skill"].Float(), set["level"].Float())); heroes[hid]->secSkillsInit.push_back(std::make_pair(set["skill"].Float(), set["level"].Float()));
} }
const JsonNode *value = &hero["spell"]; value = &hero["spell"];
if (!value->isNull()) { if (!value->isNull()) {
heroes[hid]->startingSpell = value->Float(); heroes[hid]->startingSpell = value->Float();
} }
value = &hero["specialties"];
if (!value->isNull()) {
BOOST_FOREACH(const JsonNode &specialty, value->Vector()) {
SSpecialtyInfo dummy;
dummy.type = specialty["type"].Float();
dummy.val = specialty["val"].Float();
dummy.subtype = specialty["subtype"].Float();
dummy.additionalinfo = specialty["info"].Float();
heroes[hid]->spec.push_back(dummy); //put a copy of dummy
}
}
} }
loadHeroClasses(); loadHeroClasses();
@ -360,26 +375,8 @@ void CHeroHandler::loadHeroes()
} }
ballistics.push_back(bli); ballistics.push_back(bli);
} }
{
std::ifstream inp;
dump.clear();
inp.open(DATA_DIR "/config/specials.txt"); //loading hero specials
assert(inp);
SSpecialtyInfo dummy;
si32 hid;
inp.ignore(100, '\n');
for (int i = 0; i < 175; ++i)
{
inp >> hid;
inp >> dummy.type;
inp >> dummy.val;
inp >> dummy.subtype;
inp >> dummy.additionalinfo;
heroes[hid]->spec.push_back(dummy); //put a copy of dummy
}
inp.close();
}
} }
void CHeroHandler::loadHeroClasses() void CHeroHandler::loadHeroClasses()
{ {
std::istringstream str(bitmaph->getTextFile("HCTRAITS.TXT")); //we'll be reading from it std::istringstream str(bitmaph->getTextFile("HCTRAITS.TXT")); //we'll be reading from it