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

Consolidated crerefnam.txt, monsters.txt, cr_factions.txt, cr_upgrade_list.txt, CREDEFS.TXT, cr_shots.txt and cr_to_turret.txt into creatures.json

This commit is contained in:
Frank Zago 2011-08-20 21:53:03 +00:00
parent 81e50c9f2b
commit b853df76ba
9 changed files with 1753 additions and 1063 deletions

View File

@ -1,198 +0,0 @@
Names_of_Units_DEFS_in_order_of_ID
0 CPKMAN.DEF
1 CHALBD.DEF
2 CLCBOW.DEF
3 CHCBOW.DEF
4 CGRIFF.DEF
5 CRGRIF.DEF
6 CSWORD.DEF
7 CCRUSD.DEF
8 CMONKK.DEF
9 CZEALT.DEF
10 CCAVLR.DEF
11 CCHAMP.DEF
12 CANGEL.DEF
13 CRANGL.DEF
14 CCENTR.DEF
15 CECENT.DEF
16 CDWARF.DEF
17 CBDWAR.DEF
18 CELF.DEF
19 CGRELF.DEF
20 CPEGAS.DEF
21 CAPEGS.DEF
22 CTREE.DEF
23 CBTREE.DEF
24 CUNICO.DEF
25 CWUNIC.DEF
26 CGDRAG.DEF
27 CDDRAG.DEF
28 CGREMA.DEF
29 CGREMM.DEF
30 CGARGO.DEF
31 COGARG.DEF
32 CSGOLE.DEF
33 CIGOLE.DEF
34 CMAGE.DEF
35 CAMAGE.DEF
36 CGENIE.DEF
37 CSULTA.DEF
38 CNAGA.DEF
39 CNAGAG.DEF
40 CLTITA.DEF
41 CGTITA.DEF
42 CIMP.DEF
43 CFAMIL.DEF
44 CGOG.DEF
45 CMAGOG.DEF
46 CHHOUN.DEF
47 CCERBU.DEF
48 COHDEM.DEF
49 CTHDEM.DEF
50 CPFIEN.DEF
51 CPFOE.DEF
52 CEFREE.DEF
53 CEFRES.DEF
54 CDEVIL.DEF
55 CADEVL.DEF
56 CSKELE.DEF
57 CWSKEL.DEF
58 CZOMBI.DEF
59 CZOMLO.DEF
60 CWIGHT.DEF
61 CWRAIT.DEF
62 CVAMP.DEF
63 CNOSFE.DEF
64 CLICH.DEF
65 CPLICH.DEF
66 CBKNIG.DEF
67 CBLORD.DEF
68 CNDRGN.DEF
69 CHDRGN.DEF
70 CTROGL.DEF
71 CITROG.DEF
72 CHARPY.DEF
73 CHARPH.DEF
74 CBEHOL.DEF
75 CEVEYE.DEF
76 CMEDUS.DEF
77 CMEDUQ.DEF
78 CMINOT.DEF
79 CMINOK.DEF
80 CMCORE.DEF
81 CCMCOR.DEF
82 CRDRGN.DEF
83 CBDRGN.DEF
84 CGOBLI.DEF
85 CHGOBL.DEF
86 CBWLFR.DEF
87 CUWLFR.DEF
88 CORC.DEF
89 CORCCH.DEF
90 COGRE.DEF
91 COGMAG.DEF
92 CROC.DEF
93 CTBIRD.DEF
94 CCYCLR.DEF
95 CCYCLLOR.DEF
96 CYBEHE.DEF
97 CABEHE.DEF
98 CGNOLL.DEF
99 CGNOLM.DEF
100 CPLIZA.DEF
101 CALIZA.DEF
102 CCGORG.DEF
103 CBGOG.DEF
104 CDRFLY.DEF
105 CDRFIR.DEF
106 CBASIL.DEF
107 CGBASI.DEF
108 CWYVER.DEF
109 CWYVMN.DEF
110 CHYDRA.DEF
111 CCHYDR.DEF
112 CAELEM.DEF
113 CEELEM.DEF
114 CFELEM.DEF
115 CWELEM.DEF
116 CGGOLE.DEF
117 CDGOLE.DEF
118 CPIXIE.DEF
119 CSPRITE.DEF
120 CPSYEL.DEF
121 CMAGEL.DEF
122 x
123 CICEE.DEF
124 x
125 CSTONE.DEF
126 x
127 CSTORM.DEF
128 x
129 CNRG.DEF
130 CFBIRD.DEF
131 CPHX.DEF
132 CADRGN.DEF
133 CCDRGN.DEF
134 CFDRGN.DEF
135 CRSDGN.DEF
136 CENCH.DEF
137 CSHARP.DEF
138 CHALF.DEF
139 CPEAS.DEF
140 CBOAR.DEF
141 CMUMMY.DEF
142 CNOMAD.DEF
143 CROGUE.DEF
144 CTROLL.DEF
145 SMCATA.DEF
146 SMBAL.DEF
147 SMTENT.DEF
148 SMCART.DEF
149 x
150 ZM150Z.DEF
151 ZM151Z.DEF
152 ZM152Z.DEF
153 ZM153Z.DEF
154 ZM154Z.DEF
155 ZM155Z.DEF
156 ZM156Z.DEF
157 ZM157Z.DEF
158 ZM158Z.DEF
159 ZM159G.DEF
160 ZM160G.DEF
161 ZM161G.DEF
162 ZM162G.DEF
163 ZM163G.DEF
164 ZM164GD.DEF
165 ZM165GD.DEF
166 ZM166GD.DEF
167 ZM167GD.DEF
168 ZM168DG.DEF
169 ZM169ZL.DEF
170 ZM170SW.DEF
171 ZM171SR.DEF
172 ZM172N.DEF
173 ZM173M.DEF
174 ZM174NPC.DEF
175 ZM175NPC.DEF
176 ZM176NPC.DEF
177 ZM177NPC.DEF
178 ZM178NPC.DEF
179 ZM179NPC.DEF
180 ZM180NPC.DEF
181 ZM181NPC.DEF
182 ZM182NPC.DEF
183 ZM174NPC.DEF
184 ZM175NPC.DEF
185 ZM176NPC.DEF
186 ZM177NPC.DEF
187 ZM178NPC.DEF
188 ZM179NPC.DEF
189 ZM180NPC.DEF
190 ZM181NPC.DEF
191 ZM182NPC.DEF
192 ZM192Z.DEF
193 ZM193Z.DEF
194 ZM194Z.DEF
195 ZM195Z.DEF
196 ZM196Z.DEF

View File

@ -1,197 +0,0 @@
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 1
15 1
16 1
17 1
18 1
19 1
20 1
21 1
22 1
23 1
24 1
25 1
26 1
27 1
28 2
29 2
30 2
31 2
32 2
33 2
34 2
35 2
36 2
37 2
38 2
39 2
40 2
41 2
42 3
43 3
44 3
45 3
46 3
47 3
48 3
49 3
50 3
51 3
52 3
53 3
54 3
55 3
56 4
57 4
58 4
59 4
60 4
61 4
62 4
63 4
64 4
65 4
66 4
67 4
68 4
69 4
70 5
71 5
72 5
73 5
74 5
75 5
76 5
77 5
78 5
79 5
80 5
81 5
82 5
83 5
84 6
85 6
86 6
87 6
88 6
89 6
90 6
91 6
92 6
93 6
94 6
95 6
96 6
97 6
98 7
99 7
100 7
101 7
102 7
103 7
104 7
105 7
106 7
107 7
108 7
109 7
110 7
111 7
112 8
113 8
114 8
115 8
116 -1
117 -1
118 8
119 8
120 8
121 8
122 -1
123 8
124 -1
125 8
126 -1
127 8
128 -1
129 8
130 8
131 8
132 -1
133 -1
134 -1
135 -1
136 -1
137 -1
138 -1
139 -1
140 -1
141 -1
142 -1
143 -1
144 -1
145 -1
146 -1
147 -1
148 -1
149 -1
150 0
151 1
152 2
153 3
154 4
155 5
156 6
157 7
158 8
159 -1
160 -1
161 -1
162 -1
163 -1
164 -1
165 -1
166 -1
167 -1
168 -1
169 -1
170 -1
171 -1
172 -1
173 -1
174 -1
175 -1
176 -1
177 -1
178 -1
179 -1
180 -1
181 -1
182 -1
183 -1
184 -1
185 -1
186 -1
187 -1
188 -1
189 -1
190 -1
191 -1
192 -1
193 -1
194 -1
195 -1
196 -1

View File

@ -1,40 +0,0 @@
//here are defs with things shot by different units - don't delete this line; format: unit_ID def_name spin_projectile
2 PLCBOWX.DEF 0
3 PLCBOWX.DEF 0
8 CPRZEAX.DEF 1
9 CPRZEAX.DEF 1
18 PELFX.DEF 0
19 PELFX.DEF 0
29 CPRGRE.DEF 1
34 PMAGEX.DEF 1
35 PMAGEX.DEF 1
41 CPRGTIX.DEF 0
44 CPRGOGX.DEF 1
45 CPRGOGX.DEF 1
64 PLICH.DEF 0
65 PLICH.DEF 0
74 SMBALX.DEF 0
75 SMBALX.DEF 0
76 PMEDUSX.DEF 0
77 PMEDUSX.DEF 0
88 PORCHX.DEF 1
89 PORCHX.DEF 1
94 PCYCLBX.DEF 1
95 PCYCLBX.DEF 1
100 PPLIZAX.DEF 0
101 PPLIZAX.DEF 0
123 PICEE.DEF 0
127 CPRGTIX.DEF 0
136 SMBALX.DEF 0
137 PELFX.DEF 0
138 PHALF.DEF 1
145 SMCATX.DEF 1
146 SMBALX.DEF 0
152 CPRGTIX.DEF 0
169 CPRZEAX.DEF 0
170 PLCBOWX.DEF 0
171 PLCBOWX.DEF 0
173 CPRGRE.DEF 1
193 SMBALX.DEF 0
196 SMBALX.DEF 0
-1

View File

@ -1,11 +0,0 @@
//describes_which_creature's_animation_should_be_used_to_dispaly_creature_in_turret_while_siege
//i-th_line_-_i-th_faction
2
18
34
44
64
76
88
100
127

View File

@ -1,64 +0,0 @@
0 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
118 119
120 121
112 127
113 125
114 129
115 123
130 131
131 15

1712
config/creatures.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,224 +0,0 @@
0 Pikeman
1 Halberdier
2 LightCrossbowman
2 Archer
3 HeavyCrossbowman
4 Griffin
5 RoyalGriffin
6 Swordsman
7 Crusader
8 Monk
9 Zealot
10 Cavalier
11 Champion
12 Angel
13 Archangel
14 Centaur
15 EliteCentaur
16 Dwarf
17 BattleDwarf
18 WoodElf
19 GrandElf
20 Pegasus
21 SilverPegasus
22 Treefolk
23 BriarTreefolk
24 Unicorn
25 WarUnicorn
26 GreenDragon
27 GoldDragon
28 ApprenticeGremlin
29 MasterGremlin
30 StoneGargoyle
31 ObsidianGargoyle
32 IronGolem
33 StoneGolem
34 Mage
35 ArchMage
36 Genie
37 Caliph
38 NagaSentinel
39 NagaGuardian
40 LesserTitan
41 GreaterTitan
42 Imp
43 Familiar
44 Gog
45 Magog
46 HellHound
47 Cerberus
48 Single-HornedDemon
49 Dual-HornedDemon
50 PitFiend
51 PitFoe
52 Efreet
53 EfreetSultan
54 Devil
55 ArchDevil
56 Skeleton
57 SkeletonWarrior
58 Zombie
59 ZombieLord
60 Wight
61 Wraith
62 Vampire
63 Nosferatu
64 Lich
65 PowerLich
66 BlackKnight
67 BlackLord
68 BoneDragon
69 GhostDragon
70 Troglodyte
71 InfernalTroglodyte
72 Harpy
73 HarpyHag
73 M73
74 Beholder
75 EvilEye
75 M75
76 Medusa
76 Medusae
77 MedusaQueen
78 Minotaur
79 MinotaurKing
80 Manticore
81 Scorpicore
82 RedDragon
83 BlackDragon
84 Goblin
85 Hobgoblin
86 GoblinWolfRider
87 HobgoblinWolfRider
88 Orc
89 OrcChieftain
90 Ogre
91 OgreMage
92 Roc
93 Thunderbird
94 Cyclops
95 CyclopsLord
96 YoungBehemoth
97 AncientBehemoth
98 Gnoll
99 GnollMarauder
100 PrimitiveLizardman
101 AdvancedLizardman
102 CopperGorgon
103 BronzeGorgon
104 DragonFly
104 SerpentFly
104 Dragonflies
105 FireDragonFly
106 Basilisk
107 GreaterBasilisk
108 Wyvern
109 WyvernMonarch
110 Hydra
111 ChaosHydra
112 AirElemental
112 AirElementals
113 EarthElemental
113 EarthElementals
114 FireElemental
114 FireElementals
115 WaterElemental
115 WaterElementals
116 GoldGolem
117 DiamondGolem
118 Pixie
118 Pixies
119 Sprite
120 PsiElemental
121 MagicElemental
122 NOTUSED
123 IceElemental
124 NOTUSED
125 StoneElemental
127 StormElemental
129 ElectricityElemental
130 Firebird
131 Pheonix
132 AzureDragon
133 CrystalDragon
134 FairieDragon
135 RustDragon
136 Enchanter
137 Sharpshooter
138 Halfling
139 Peasant
140 Boar
141 Mummy
142 warrior
143 Rogue
144 OgreShaman
145 Catapult
146 Ballista
147 FirstAidTent
148 AmmoCart
149 ArrowTower
150 SupremeArchangel
151 DiamondDragon
152 LordofThunder
153 HellBaron
154 BloodDragon
155 DarknessDragon
156 GhostBehemoth
157 HellHydra
158 SacredPhoenix
159 Ghost
160 God1War
161 God2Peace
162 God3Mana
163 God4Lore
164 MinotaurKing
165 MineralElemental
166 ElectricityElemental
167 AncientBasilisk
168 Gorynych
169 WarZealot
170 Myriad
171 MedusaMatriarch
172 Nightmare
173 SantaGremlin
174 Paladin1
175 Hierophant1
176 TempleGuardian1
177 Succubus1
178 SoulEater1
179 Brute1
180 OgreLeader1
181 Shaman1
182 AstralSpirit1
183 Paladin2
184 Hierophant2
185 TempleGuardian2
186 Succubus2
187 SoulEater2
188 Brute2
189 OgreLeader2
190 Shaman2
191 AstralSpirit2
192 SylvanCentaur
193 Sorceress
194 Werewolf
195 HellSteed
196 Dracolich
197
198
199
200
201
202
203
204
205
206
207
208
209
210
999 999 999 999
FORMAT:
ID Reference_name

View File

@ -1,197 +0,0 @@
0 1
1 1
2 2
3 2
4 3
5 3
6 4
7 4
8 5
9 5
10 6
11 6
12 7
13 7
14 1
15 1
16 2
17 2
18 3
19 3
20 4
21 4
22 5
23 5
24 6
25 6
26 7
27 7
28 1
29 1
30 2
31 2
32 3
33 3
34 4
35 4
36 5
37 5
38 6
39 6
40 7
41 7
42 1
43 1
44 2
45 2
46 3
47 3
48 4
49 4
50 5
51 5
52 6
53 6
54 7
55 7
56 1
57 1
58 2
59 2
60 3
61 3
62 4
63 4
64 5
65 5
66 6
67 6
68 7
69 7
70 1
71 1
72 2
73 2
74 3
75 3
76 4
77 4
78 5
79 5
80 6
81 6
82 7
83 7
84 1
85 1
86 2
87 2
88 3
89 3
90 4
91 4
92 5
93 5
94 6
95 6
96 7
97 7
98 1
99 1
100 2
101 2
102 5
103 5
104 3
105 3
106 4
107 4
108 6
109 6
110 7
111 7
112 2
113 5
114 4
115 3
116 4
117 5
118 1
119 1
120 6
121 6
122 000000
123 3
124 000000
125 5
126 000000
127 2
128 000000
129 4
130 7
131 7
132 10
133 10
134 8
135 10
136 6
137 4
138 1
139 1
140 2
141 3
142 3
143 2
144 5
145 000000
146 000000
147 000000
148 000000
149 000000
150 000000
151 8
152 8
153 8
154 8
155 8
156 8
157 8
158 8
159 000000
160 000000
161 000000
162 000000
163 000000
164 000000
165 000000
166 000000
167 000000
168 000000
169 000000
170 000000
171 000000
172 000000
173 000000
174 000000
175 000000
176 000000
177 000000
178 000000
179 000000
180 000000
181 000000
182 000000
183 000000
184 000000
185 000000
186 000000
187 000000
188 000000
189 000000
190 000000
191 000000
192 000000
193 000000
194 000000
195 000000
196 000000

View File

@ -14,6 +14,7 @@
#include "../lib/CGameState.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "../lib/JsonNode.h"
using namespace boost::assign;
extern CLodHandler * bitmaph;
@ -462,145 +463,53 @@ void CCreatureHandler::loadCreatures()
abils.close();
tlog5 << "\t\tReading config/crerefnam.txt" << std::endl;
//loading reference names
std::ifstream ifs(DATA_DIR "/config/crerefnam.txt");
int tempi;
std::string temps;
for (;;)
{
ifs >> tempi >> temps;
if (tempi>=creatures.size())
break;
boost::assign::insert(nameToID)(temps,tempi);
creatures[tempi]->nameRef=temps;
}
ifs.close();
ifs.clear();
// loading creatures properties
tlog5 << "\t\tReading config/creatures.json" << std::endl;
const JsonNode config(DATA_DIR "/config/creatures.json");
const JsonVector &creatures_vec = config["creatures"].Vector();
tlog5 << "\t\tReading config/monsters.txt" << std::endl;
ifs.open(DATA_DIR "/config/monsters.txt");
{
while(!ifs.eof())
{
int id, lvl;
ifs >> id >> lvl;
if(!ifs.good())
break;
CCreature *c = creatures[id];
c->level = lvl;
for (JsonVector::const_iterator it = creatures_vec.begin(); it!=creatures_vec.end(); ++it) {
const JsonNode &creature = *it;
int creatureID = creature["id"].Float();
const JsonNode *value;
/* A creature can have several names. */
const JsonVector &names_vec = creature["name"].Vector();
for (JsonVector::const_iterator it = names_vec.begin(); it!=names_vec.end(); ++it) {
const std::string name = (*it).String();
boost::assign::insert(nameToID)(name, creatureID);
}
// Set various creature properties
CCreature *c = creatures[creatureID];
c->level = creature["level"].Float();
c->faction = creature["faction"].Float();
c->animDefName = creature["defname"].String();
value = &creature["upgrade"];
if (!value->isNull())
c->upgrades.insert(value->Float());
value = &creature["projectile_defname"];
if (!value->isNull()) {
idToProjectile[creatureID] = value->String();
value = &creature["projectile_spin"];
idToProjectileSpin[creatureID] = value->Bool();
}
value = &creature["turret_shooter"];
if (!value->isNull() && value->Bool())
factionToTurretCreature[c->faction] = creatureID;
}
std::ifstream ifs;
std::string dump2;
buildBonusTreeForTiers();
ifs.close();
ifs.clear();
tlog5 << "\t\tReading config/cr_factions.txt" << std::endl;
ifs.open(DATA_DIR "/config/cr_factions.txt");
while(!ifs.eof())
{
int id, fact;
ifs >> id >> fact;
creatures[id]->faction = fact;
}
ifs.close();
ifs.clear();
tlog5 << "\t\tReading config/cr_upgrade_list.txt" << std::endl;
ifs.open(DATA_DIR "/config/cr_upgrade_list.txt");
while(!ifs.eof())
{
int id, up;
ifs >> id >> up;
creatures[id]->upgrades.insert(up);
}
ifs.close();
ifs.clear();
//loading unit animation def names
tlog5 << "\t\tReading config/CREDEFS.TXT" << std::endl;
std::ifstream inp(DATA_DIR "/config/CREDEFS.TXT", std::ios::in | std::ios::binary); //this file is not in lod
inp.seekg(0,std::ios::end); // na koniec
int andame2 = inp.tellg(); // read length
inp.seekg(0,std::ios::beg); // wracamy na poczatek
char * bufor = new char[andame2+1]; // allocate memory
inp.read((char*)bufor, andame2); // read map file to buffer
inp.close();
bufor[andame2] = 0;
buf = std::string(bufor);
delete [] bufor;
i = 0; //buf iterator
hmcr = 0;
for(; i<andame2; ++i) //omitting rubbish
{
if(buf[i]=='\r')
break;
}
i+=2;
tlog5 << "We have "<<creatures.size() << " creatures\n";
for(int s=0; s<creatures.size(); ++s)
{
//tlog5 <<"\t\t\t" << s <<". Reading defname. \n";
int befi=i;
std::string rub;
for(; i<andame2; ++i)
{
if(buf[i]==' ')
break;
}
rub = buf.substr(befi, i-befi);
++i;
befi=i;
for(; i<andame2; ++i)
{
if(buf[i]=='\r')
break;
}
std::string defName = buf.substr(befi, i-befi);
creatures[s]->animDefName = defName;
}
tlog5 << "\t\tReading CRANIM.TXT.txt" << std::endl;
loadAnimationInfo();
//loading id to projectile mapping
tlog5 << "\t\tReading config/cr_shots.txt" << std::endl;
std::ifstream inp2(DATA_DIR "/config/cr_shots.txt", std::ios::in | std::ios::binary); //this file is not in lod
char dump [200];
inp2.getline(dump, 200);
while(true)
{
int id;
std::string name;
bool spin;
inp2>>id;
if(id == -1)
break;
inp2>>name;
idToProjectile[id] = name;
inp2>>spin;
idToProjectileSpin[id] = spin;
}
inp2.close();
//reading factionToTurretCreature
tlog5 << "\t\tReading config/cr_to_turret.txt" << std::endl;
std::ifstream inp3(DATA_DIR "/config/cr_to_turret.txt", std::ios::in | std::ios::binary); //this file is not in lod
std::string dump2;
inp3 >> dump2 >> dump2;
for(int g=0; g<F_NUMBER; ++g)
{
inp3 >> factionToTurretCreature[g];
}
inp3.close();
//reading creature ability names
ifs.open(DATA_DIR "/config/bonusnames.txt");
{