| Line 11... |
Line 11... |
| 11 |
{
|
11 |
{
|
| 12 |
this->ClearLists();
|
12 |
this->ClearLists();
|
| 13 |
}
|
13 |
}
|
| 14 |
|
14 |
|
| 15 |
|
15 |
|
| 16 |
CyString CShipData::CreateData()
|
16 |
Utils::String CShipData::createData() const
|
| 17 |
{
|
17 |
{
|
| 18 |
CyString data = this->sModel;
|
18 |
Utils::String data = this->sModel;
|
| 19 |
data.AddToken(";", CyString::Number(this->iPictureID));
|
19 |
data.addToken(";", Utils::String::Number(this->iPictureID));
|
| 20 |
data.AddToken(";", CyString::CreateFromFloat(this->fRotX, -1));
|
20 |
data.addToken(";", Utils::String::FromFloat(this->fRotX, -1));
|
| 21 |
data.AddToken(";", CyString::CreateFromFloat(this->fRotY, -1));
|
21 |
data.addToken(";", Utils::String::FromFloat(this->fRotY, -1));
|
| 22 |
data.AddToken(";", CyString::CreateFromFloat(this->fRotZ, -1));
|
22 |
data.addToken(";", Utils::String::FromFloat(this->fRotZ, -1));
|
| 23 |
data.AddToken(";", CShipData::ConvertShipSubType(this->iSubType));
|
23 |
data.addToken(";", CShipData::ConvertShipSubType(this->iSubType));
|
| 24 |
data.AddToken(";", CyString::Number(this->iDesc));
|
24 |
data.addToken(";", Utils::String::Number(this->iDesc));
|
| 25 |
data.AddToken(";", CyString::Number(this->iSpeed));
|
25 |
data.addToken(";", Utils::String::Number(this->iSpeed));
|
| 26 |
data.AddToken(";", CyString::Number(this->iAccel));
|
26 |
data.addToken(";", Utils::String::Number(this->iAccel));
|
| 27 |
data.AddToken(";", CyString::Number(this->iEngineSound));
|
27 |
data.addToken(";", Utils::String::Number(this->iEngineSound));
|
| 28 |
data.AddToken(";", CyString::Number(this->iReactionDelay));
|
28 |
data.addToken(";", Utils::String::Number(this->iReactionDelay));
|
| 29 |
data.AddToken(";", CyString::Number(this->iEngineEffect));
|
29 |
data.addToken(";", Utils::String::Number(this->iEngineEffect));
|
| 30 |
data.AddToken(";", CyString::Number(this->iEngineGlow));
|
30 |
data.addToken(";", Utils::String::Number(this->iEngineGlow));
|
| 31 |
data.AddToken(";", CyString::Number(this->iPower));
|
31 |
data.addToken(";", Utils::String::Number(this->iPower));
|
| 32 |
data.AddToken(";", CyString::Number(this->iSoundMin));
|
32 |
data.addToken(";", Utils::String::Number(this->iSoundMin));
|
| 33 |
data.AddToken(";", CyString::Number(this->iSoundMax));
|
33 |
data.addToken(";", Utils::String::Number(this->iSoundMax));
|
| 34 |
data.AddToken(";", this->sModelScene);
|
34 |
data.addToken(";", this->sModelScene);
|
| 35 |
data.AddToken(";", this->sCockpitScene);
|
35 |
data.addToken(";", this->sCockpitScene);
|
| 36 |
data.AddToken(";", CyString::Number(this->iLaserMask));
|
36 |
data.addToken(";", Utils::String::Number(this->iLaserMask));
|
| 37 |
data.AddToken(";", CyString::Number(this->iGunCount));
|
37 |
data.addToken(";", Utils::String::Number(this->iGunCount));
|
| 38 |
data.AddToken(";", CyString::Number(this->iLaserEnergy));
|
38 |
data.addToken(";", Utils::String::Number(this->iLaserEnergy));
|
| 39 |
data.AddToken(";", CyString::CreateFromFloat(this->fLaserRecharge, -1));
|
39 |
data.addToken(";", Utils::String::FromFloat(this->fLaserRecharge, -1));
|
| 40 |
data.AddToken(";", CyString::Number(this->iShieldType));
|
40 |
data.addToken(";", Utils::String::Number(this->iShieldType));
|
| 41 |
data.AddToken(";", CyString::Number(this->iMaxShields));
|
41 |
data.addToken(";", Utils::String::Number(this->iMaxShields));
|
| 42 |
data.AddToken(";", CyString::Number(this->iMissileMask));
|
42 |
data.addToken(";", Utils::String::Number(this->iMissileMask));
|
| 43 |
data.AddToken(";", CyString::Number(this->iMissileCount));
|
43 |
data.addToken(";", Utils::String::Number(this->iMissileCount));
|
| 44 |
data.AddToken(";", CyString::Number(this->iSpeedExtension));
|
44 |
data.addToken(";", Utils::String::Number(this->iSpeedExtension));
|
| 45 |
data.AddToken(";", CyString::Number(this->iSteeringExtension));
|
45 |
data.addToken(";", Utils::String::Number(this->iSteeringExtension));
|
| 46 |
data.AddToken(";", CyString::Number(this->iCargoMin));
|
46 |
data.addToken(";", Utils::String::Number(this->iCargoMin));
|
| 47 |
data.AddToken(";", CyString::Number(this->iCargoMax));
|
47 |
data.addToken(";", Utils::String::Number(this->iCargoMax));
|
| 48 |
data.AddToken(";", CyString::Number(this->iWareListID));
|
48 |
data.addToken(";", Utils::String::Number(this->iWareListID));
|
| 49 |
|
49 |
|
| 50 |
// 6 turrets next
|
50 |
// 6 turrets next
|
| 51 |
for ( int i = 0; i < 6; i++ )
|
51 |
for ( int i = 0; i < 6; i++ )
|
| 52 |
{
|
52 |
{
|
| 53 |
if ( this->cockpits[i].sCockpit.Empty() )
|
53 |
if ( this->cockpits[i].sCockpit.empty() )
|
| 54 |
data.AddToken(";", CyString::Number(this->cockpits[i].iCockpit));
|
54 |
data.addToken(";", Utils::String::Number(this->cockpits[i].iCockpit));
|
| 55 |
else
|
55 |
else
|
| 56 |
{
|
56 |
{
|
| 57 |
if ( this->cockpits[i].iCockpit > -1 )
|
57 |
if ( this->cockpits[i].iCockpit > -1 )
|
| 58 |
data.AddToken(";", this->cockpits[i].sCockpit + "(" + (long)this->cockpits[i].iCockpit + ")");
|
58 |
data.addToken(";", this->cockpits[i].sCockpit + "(" + (long)this->cockpits[i].iCockpit + ")");
|
| 59 |
else
|
59 |
else
|
| 60 |
data.AddToken(";", this->cockpits[i].sCockpit);
|
60 |
data.addToken(";", this->cockpits[i].sCockpit);
|
| 61 |
}
|
61 |
}
|
| 62 |
data.AddToken(";", CyString::Number(this->cockpits[i].iPos));
|
62 |
data.addToken(";", Utils::String::Number(this->cockpits[i].iPos));
|
| 63 |
}
|
63 |
}
|
| 64 |
|
64 |
|
| 65 |
data.AddToken(";", CyString::Number(this->iDocking));
|
65 |
data.addToken(";", Utils::String::Number(this->iDocking));
|
| 66 |
data.AddToken(";", CyString::Number(this->iCargoClass));
|
66 |
data.addToken(";", Utils::String::Number(this->iCargoClass));
|
| 67 |
data.AddToken(";", CyString::Number(this->iRace));
|
67 |
data.addToken(";", Utils::String::Number(this->iRace));
|
| 68 |
data.AddToken(";", CyString::Number(this->iHull));
|
68 |
data.addToken(";", Utils::String::Number(this->iHull));
|
| 69 |
data.AddToken(";", CyString::Number(this->iExplosionDef));
|
69 |
data.addToken(";", Utils::String::Number(this->iExplosionDef));
|
| 70 |
data.AddToken(";", CyString::Number(this->iExplosionBody));
|
70 |
data.addToken(";", Utils::String::Number(this->iExplosionBody));
|
| 71 |
data.AddToken(";", CyString::Number(this->iParticle));
|
71 |
data.addToken(";", Utils::String::Number(this->iParticle));
|
| 72 |
data.AddToken(";", CyString::Number(this->iVariation));
|
72 |
data.addToken(";", Utils::String::Number(this->iVariation));
|
| 73 |
data.AddToken(";", CyString::Number(this->iRotationAccel));
|
73 |
data.addToken(";", Utils::String::Number(this->iRotationAccel));
|
| 74 |
data.AddToken(";", CyString::Number(this->iClass));
|
74 |
data.addToken(";", Utils::String::Number(this->iClass));
|
| 75 |
data.AddToken(";", CyString::Number(this->iTurretCount));
|
75 |
data.addToken(";", Utils::String::Number(this->iTurretCount));
|
| 76 |
|
76 |
|
| 77 |
// now do the turrets
|
77 |
// now do the turrets
|
| 78 |
for ( int i = 0; i < this->iTurretCount; i++ )
|
78 |
for ( int i = 0; i < this->iTurretCount; i++ )
|
| 79 |
{
|
79 |
{
|
| 80 |
STurretEntry *t = this->lTurrets[i];
|
80 |
STurretEntry *t = this->lTurrets[i];
|
| 81 |
data.AddToken(";", CyString::Number(t->iIndex));
|
81 |
data.addToken(";", Utils::String::Number(t->iIndex));
|
| 82 |
data.AddToken(";", CyString::Number(t->iTurret));
|
82 |
data.addToken(";", Utils::String::Number(t->iTurret));
|
| 83 |
data.AddToken(";", t->sModel);
|
83 |
data.addToken(";", t->sModel);
|
| 84 |
data.AddToken(";", CyString::Number(t->iSceneNode));
|
84 |
data.addToken(";", Utils::String::Number(t->iSceneNode));
|
| 85 |
}
|
85 |
}
|
| 86 |
|
86 |
|
| 87 |
// the gun entries next
|
87 |
// the gun entries next
|
| 88 |
data.AddToken(";", CyString::Number(this->iGunsCount));
|
88 |
data.addToken(";", Utils::String::Number(this->iGunsCount));
|
| 89 |
for ( int i = 0; i < this->iGunsCount; i++ )
|
89 |
for ( int i = 0; i < this->iGunsCount; i++ )
|
| 90 |
{
|
90 |
{
|
| 91 |
SGunGroup *g = this->lGuns[i];
|
91 |
SGunGroup *g = this->lGuns[i];
|
| 92 |
data.AddToken(";", CyString::Number(g->iGunIndex));
|
92 |
data.addToken(";", Utils::String::Number(g->iGunIndex));
|
| 93 |
data.AddToken(";", CyString::Number(g->iLaserCount));
|
93 |
data.addToken(";", Utils::String::Number(g->iLaserCount));
|
| 94 |
data.AddToken(";", CyString::Number(g->iIndex));
|
94 |
data.addToken(";", Utils::String::Number(g->iIndex));
|
| 95 |
data.AddToken(";", CyString::Number(g->iWeaponCount));
|
95 |
data.addToken(";", Utils::String::Number(g->iWeaponCount));
|
| 96 |
for ( int j = 0; j < g->iWeaponCount; j++ )
|
96 |
for ( int j = 0; j < g->iWeaponCount; j++ )
|
| 97 |
{
|
97 |
{
|
| 98 |
SWeaponGroup *w = g->lWeapons[j];
|
98 |
SWeaponGroup *w = g->lWeapons[j];
|
| 99 |
data.AddToken(";", CyString::Number(w->iGunIndex));
|
99 |
data.addToken(";", Utils::String::Number(w->iGunIndex));
|
| 100 |
data.AddToken(";", CyString::Number(w->iLaser));
|
100 |
data.addToken(";", Utils::String::Number(w->iLaser));
|
| 101 |
data.AddToken(";", w->sModel1);
|
101 |
data.addToken(";", w->sModel1);
|
| 102 |
data.AddToken(";", CyString::Number(w->iNode1));
|
102 |
data.addToken(";", Utils::String::Number(w->iNode1));
|
| 103 |
data.AddToken(";", w->sModel2);
|
103 |
data.addToken(";", w->sModel2);
|
| 104 |
data.AddToken(";", CyString::Number(w->iNode2));
|
104 |
data.addToken(";", Utils::String::Number(w->iNode2));
|
| 105 |
}
|
105 |
}
|
| 106 |
}
|
106 |
}
|
| 107 |
|
107 |
|
| 108 |
// now the rest of the data
|
108 |
// now the rest of the data
|
| 109 |
data.AddToken(";", CyString::Number(this->iVolumn));
|
109 |
data.addToken(";", Utils::String::Number(this->iVolumn));
|
| 110 |
data.AddToken(";", CyString::Number(this->iRelVal));
|
110 |
data.addToken(";", Utils::String::Number(this->iRelVal));
|
| 111 |
data.AddToken(";", CyString::Number(this->iPriceMod1));
|
111 |
data.addToken(";", Utils::String::Number(this->iPriceMod1));
|
| 112 |
data.AddToken(";", CyString::Number(this->iPriceMod2));
|
112 |
data.addToken(";", Utils::String::Number(this->iPriceMod2));
|
| 113 |
data.AddToken(";", CyString::Number(this->iSize));
|
113 |
data.addToken(";", Utils::String::Number(this->iSize));
|
| 114 |
data.AddToken(";", CyString::Number(this->iRelValPlayer));
|
114 |
data.addToken(";", Utils::String::Number(this->iRelValPlayer));
|
| 115 |
data.AddToken(";", CyString::Number(this->iMinNoto));
|
115 |
data.addToken(";", Utils::String::Number(this->iMinNoto));
|
| 116 |
data.AddToken(";", CyString::Number(this->iVideoID));
|
116 |
data.addToken(";", Utils::String::Number(this->iVideoID));
|
| 117 |
data.AddToken(";", CyString::Number(this->iSkin));
|
117 |
data.addToken(";", Utils::String::Number(this->iSkin));
|
| 118 |
data.AddToken(";", this->sID);
|
118 |
data.addToken(";", this->sID);
|
| 119 |
data += ";"; // add the end ;
|
119 |
data += ";"; // add the end ;
|
| 120 |
|
120 |
|
| 121 |
return data;
|
121 |
return data;
|
| 122 |
}
|
122 |
}
|
| 123 |
|
123 |
|
| Line 187... |
Line 187... |
| 187 |
for ( SGunGroup *g = this->lGuns.First(); g; g = this->lGuns.Next() )
|
187 |
for ( SGunGroup *g = this->lGuns.First(); g; g = this->lGuns.Next() )
|
| 188 |
g->lWeapons.MemoryClear();
|
188 |
g->lWeapons.MemoryClear();
|
| 189 |
this->lGuns.MemoryClear();
|
189 |
this->lGuns.MemoryClear();
|
| 190 |
}
|
190 |
}
|
| 191 |
|
191 |
|
| 192 |
bool CShipData::ReadShipData(CyString a_data)
|
192 |
bool CShipData::readShipData(const Utils::String &a_data)
|
| 193 |
{
|
193 |
{
|
| 194 |
int max;
|
194 |
int max;
|
| 195 |
CyString *entries = a_data.SplitToken(";", &max);
|
195 |
Utils::String *entries = a_data.tokenise(";", &max);
|
| 196 |
if ( max >= 60 && entries )
|
196 |
if ( max >= 60 && entries )
|
| 197 |
{
|
197 |
{
|
| 198 |
this->sModel = entries[0];
|
198 |
this->sModel = entries[0];
|
| 199 |
this->iPictureID = entries[1].ToInt();
|
199 |
this->iPictureID = entries[1].toInt();
|
| 200 |
this->fRotX = entries[2].ToFloat();
|
200 |
this->fRotX = entries[2].toFloat();
|
| 201 |
this->fRotY = entries[3].ToFloat();
|
201 |
this->fRotY = entries[3].toFloat();
|
| 202 |
this->fRotZ = entries[4].ToFloat();
|
202 |
this->fRotZ = entries[4].toFloat();
|
| 203 |
if ( entries[5].IsNumber() )
|
203 |
if ( entries[5].isNumber() )
|
| 204 |
this->iSubType = entries[5].ToInt();
|
204 |
this->iSubType = entries[5].toInt();
|
| 205 |
else
|
205 |
else
|
| 206 |
this->iSubType = CShipData::ConvertShipSubType(entries[5]);
|
206 |
this->iSubType = CShipData::ConvertShipSubType(entries[5]);
|
| 207 |
this->iDesc = entries[6].ToInt();
|
207 |
this->iDesc = entries[6].toInt();
|
| 208 |
this->iSpeed = entries[7].ToInt();
|
208 |
this->iSpeed = entries[7].toInt();
|
| 209 |
this->iAccel = entries[8].ToInt();
|
209 |
this->iAccel = entries[8].toInt();
|
| 210 |
this->iEngineSound = entries[9].ToInt();
|
210 |
this->iEngineSound = entries[9].toInt();
|
| 211 |
this->iReactionDelay = entries[10].ToInt();
|
211 |
this->iReactionDelay = entries[10].toInt();
|
| 212 |
this->iEngineEffect = entries[11].ToInt();
|
212 |
this->iEngineEffect = entries[11].toInt();
|
| 213 |
this->iEngineGlow = entries[12].ToInt();
|
213 |
this->iEngineGlow = entries[12].toInt();
|
| 214 |
this->iPower = entries[13].ToInt();
|
214 |
this->iPower = entries[13].toInt();
|
| 215 |
this->iSoundMin = entries[14].ToInt();
|
215 |
this->iSoundMin = entries[14].toInt();
|
| 216 |
this->iSoundMax = entries[15].ToInt();
|
216 |
this->iSoundMax = entries[15].toInt();
|
| 217 |
this->sModelScene = entries[16];
|
217 |
this->sModelScene = entries[16];
|
| 218 |
this->sCockpitScene = entries[17];
|
218 |
this->sCockpitScene = entries[17];
|
| 219 |
this->iLaserMask = entries[18].ToInt();
|
219 |
this->iLaserMask = entries[18].toInt();
|
| 220 |
this->iGunCount = entries[19].ToInt();
|
220 |
this->iGunCount = entries[19].toInt();
|
| 221 |
this->iLaserEnergy = entries[20].ToInt();
|
221 |
this->iLaserEnergy = entries[20].toInt();
|
| 222 |
this->fLaserRecharge = entries[21].ToFloat();
|
222 |
this->fLaserRecharge = entries[21].toFloat();
|
| 223 |
this->iShieldType = entries[22].ToInt();
|
223 |
this->iShieldType = entries[22].toInt();
|
| 224 |
this->iMaxShields = entries[23].ToInt();
|
224 |
this->iMaxShields = entries[23].toInt();
|
| 225 |
this->iMissileMask = entries[24].ToInt();
|
225 |
this->iMissileMask = entries[24].toInt();
|
| 226 |
this->iMissileCount = entries[25].ToInt();
|
226 |
this->iMissileCount = entries[25].toInt();
|
| 227 |
this->iSpeedExtension = entries[26].ToInt();
|
227 |
this->iSpeedExtension = entries[26].toInt();
|
| 228 |
this->iSteeringExtension = entries[27].ToInt();
|
228 |
this->iSteeringExtension = entries[27].toInt();
|
| 229 |
this->iCargoMin = entries[28].ToInt();
|
229 |
this->iCargoMin = entries[28].toInt();
|
| 230 |
this->iCargoMax = entries[29].ToInt();
|
230 |
this->iCargoMax = entries[29].toInt();
|
| 231 |
this->iWareListID = entries[30].ToInt();
|
231 |
this->iWareListID = entries[30].toInt();
|
| 232 |
|
232 |
|
| 233 |
for ( int i = 0; i < 6; i++ )
|
233 |
for ( int i = 0; i < 6; i++ )
|
| 234 |
{
|
234 |
{
|
| 235 |
this->cockpits[i].iPos = entries[(i * 2) + 32].ToInt();
|
235 |
this->cockpits[i].iPos = entries[(i * 2) + 32].toInt();
|
| 236 |
if ( entries[(i * 2) + 31].IsNumber() )
|
236 |
if ( entries[(i * 2) + 31].isNumber() )
|
| 237 |
this->cockpits[i].iCockpit = entries[(i * 2) + 31].ToInt();
|
237 |
this->cockpits[i].iCockpit = entries[(i * 2) + 31].toInt();
|
| 238 |
else
|
238 |
else
|
| 239 |
{
|
239 |
{
|
| 240 |
this->cockpits[i].sCockpit = entries[(i * 2) + 31];
|
240 |
this->cockpits[i].sCockpit = entries[(i * 2) + 31];
|
| 241 |
this->cockpits[i].iCockpit = -1; // custom cockpit
|
241 |
this->cockpits[i].iCockpit = -1; // custom cockpit
|
| 242 |
if ( this->cockpits[i].sCockpit.IsIn("(") ) {
|
242 |
if ( this->cockpits[i].sCockpit.contains("(") ) {
|
| 243 |
this->cockpits[i].iCockpit = this->cockpits[i].sCockpit.GetToken("(", 2).GetToken(")", 1, 1).ToInt();
|
243 |
this->cockpits[i].iCockpit = this->cockpits[i].sCockpit.tokens("(", 2).token(")", 1).toInt();
|
| 244 |
this->cockpits[i].sCockpit = this->cockpits[i].sCockpit.GetToken("(", 1, 1);
|
244 |
this->cockpits[i].sCockpit = this->cockpits[i].sCockpit.token("(", 1);
|
| 245 |
}
|
245 |
}
|
| 246 |
}
|
246 |
}
|
| 247 |
}
|
247 |
}
|
| 248 |
|
248 |
|
| 249 |
this->iDocking = entries[43].ToInt();
|
249 |
this->iDocking = entries[43].toInt();
|
| 250 |
this->iCargoClass = entries[44].ToInt();
|
250 |
this->iCargoClass = entries[44].toInt();
|
| 251 |
this->iRace = entries[45].ToInt();
|
251 |
this->iRace = entries[45].toInt();
|
| 252 |
this->iHull = entries[46].ToInt();
|
252 |
this->iHull = entries[46].toInt();
|
| 253 |
this->iExplosionDef = entries[47].ToInt();
|
253 |
this->iExplosionDef = entries[47].toInt();
|
| 254 |
this->iExplosionBody = entries[48].ToInt();
|
254 |
this->iExplosionBody = entries[48].toInt();
|
| 255 |
this->iParticle = entries[49].ToInt();
|
255 |
this->iParticle = entries[49].toInt();
|
| 256 |
this->iVariation = entries[50].ToInt();
|
256 |
this->iVariation = entries[50].toInt();
|
| 257 |
this->iRotationAccel = entries[51].ToInt();
|
257 |
this->iRotationAccel = entries[51].toInt();
|
| 258 |
if ( entries[52].IsNumber() )
|
258 |
if ( entries[52].isNumber() )
|
| 259 |
this->iClass = entries[52].ToInt();
|
259 |
this->iClass = entries[52].toInt();
|
| 260 |
else
|
260 |
else
|
| 261 |
this->iClass = CShipData::ConvertShipClass(entries[52].ToString());
|
261 |
this->iClass = CShipData::ConvertShipClass(entries[52]);
|
| 262 |
this->iTurretCount = entries[53].ToInt();
|
262 |
this->iTurretCount = entries[53].toInt();
|
| 263 |
|
263 |
|
| 264 |
// now read in the turret data
|
264 |
// now read in the turret data
|
| 265 |
int pos = 54;
|
265 |
int pos = 54;
|
| 266 |
for ( int i = 0; i < this->iTurretCount; i++ )
|
266 |
for ( int i = 0; i < this->iTurretCount; i++ )
|
| 267 |
{
|
267 |
{
|
| 268 |
STurretEntry *t = new STurretEntry;
|
268 |
STurretEntry *t = new STurretEntry;
|
| 269 |
t->iIndex = entries[pos].ToInt();
|
269 |
t->iIndex = entries[pos].toInt();
|
| 270 |
t->iTurret = entries[pos + 1].ToInt();
|
270 |
t->iTurret = entries[pos + 1].toInt();
|
| 271 |
t->sModel = entries[pos + 2];
|
271 |
t->sModel = entries[pos + 2];
|
| 272 |
t->iSceneNode = entries[pos + 3].ToInt();
|
272 |
t->iSceneNode = entries[pos + 3].toInt();
|
| 273 |
this->lTurrets.push_back(t);
|
273 |
this->lTurrets.push_back(t);
|
| 274 |
pos += 4;
|
274 |
pos += 4;
|
| 275 |
}
|
275 |
}
|
| 276 |
|
276 |
|
| 277 |
if ( this->iTurretCount == 0 )
|
277 |
if ( this->iTurretCount == 0 )
|
| Line 283... |
Line 283... |
| 283 |
t->iSceneNode = 0;
|
283 |
t->iSceneNode = 0;
|
| 284 |
t->sModel = "0";
|
284 |
t->sModel = "0";
|
| 285 |
}
|
285 |
}
|
| 286 |
|
286 |
|
| 287 |
// next pos should be gun count
|
287 |
// next pos should be gun count
|
| 288 |
this->iGunsCount = entries[pos].ToInt();
|
288 |
this->iGunsCount = entries[pos].toInt();
|
| 289 |
++pos;
|
289 |
++pos;
|
| 290 |
for ( int i = 0; i < this->iGunsCount; i++ )
|
290 |
for ( int i = 0; i < this->iGunsCount; i++ )
|
| 291 |
{
|
291 |
{
|
| 292 |
SGunGroup *gun = new SGunGroup;
|
292 |
SGunGroup *gun = new SGunGroup;
|
| 293 |
gun->iGunIndex = entries[pos].ToInt();
|
293 |
gun->iGunIndex = entries[pos].toInt();
|
| 294 |
gun->iLaserCount = entries[pos + 1].ToInt();
|
294 |
gun->iLaserCount = entries[pos + 1].toInt();
|
| 295 |
gun->iIndex = entries[pos + 2].ToInt();
|
295 |
gun->iIndex = entries[pos + 2].toInt();
|
| 296 |
gun->iWeaponCount = entries[pos + 3].ToInt();
|
296 |
gun->iWeaponCount = entries[pos + 3].toInt();
|
| 297 |
pos += 4;
|
297 |
pos += 4;
|
| 298 |
|
298 |
|
| 299 |
for ( int j = 0; j < gun->iWeaponCount; j++ )
|
299 |
for ( int j = 0; j < gun->iWeaponCount; j++ )
|
| 300 |
{
|
300 |
{
|
| 301 |
SWeaponGroup *weapon = new SWeaponGroup;
|
301 |
SWeaponGroup *weapon = new SWeaponGroup;
|
| 302 |
weapon->iGunIndex = entries[pos].ToInt();
|
302 |
weapon->iGunIndex = entries[pos].toInt();
|
| 303 |
weapon->iLaser = entries[pos + 1].ToInt();
|
303 |
weapon->iLaser = entries[pos + 1].toInt();
|
| 304 |
weapon->sModel1 = entries[pos + 2];
|
304 |
weapon->sModel1 = entries[pos + 2];
|
| 305 |
weapon->iNode1 = entries[pos + 3].ToInt();
|
305 |
weapon->iNode1 = entries[pos + 3].toInt();
|
| 306 |
weapon->sModel2 = entries[pos + 4];
|
306 |
weapon->sModel2 = entries[pos + 4];
|
| 307 |
weapon->iNode2 = entries[pos + 5].ToInt();
|
307 |
weapon->iNode2 = entries[pos + 5].toInt();
|
| 308 |
|
308 |
|
| 309 |
pos += 6;
|
309 |
pos += 6;
|
| 310 |
gun->lWeapons.push_back(weapon);
|
310 |
gun->lWeapons.push_back(weapon);
|
| 311 |
}
|
311 |
}
|
| 312 |
|
312 |
|
| Line 321... |
Line 321... |
| 321 |
gun->iIndex = 0;
|
321 |
gun->iIndex = 0;
|
| 322 |
gun->iLaserCount = 0;
|
322 |
gun->iLaserCount = 0;
|
| 323 |
gun->iWeaponCount = 0;
|
323 |
gun->iWeaponCount = 0;
|
| 324 |
}
|
324 |
}
|
| 325 |
|
325 |
|
| 326 |
this->iVolumn = entries[pos].ToInt();
|
326 |
this->iVolumn = entries[pos].toInt();
|
| 327 |
this->iRelVal = entries[pos + 1].ToInt();
|
327 |
this->iRelVal = entries[pos + 1].toInt();
|
| 328 |
this->iPriceMod1 = entries[pos + 2].ToInt();
|
328 |
this->iPriceMod1 = entries[pos + 2].toInt();
|
| 329 |
this->iPriceMod2 = entries[pos + 3].ToInt();
|
329 |
this->iPriceMod2 = entries[pos + 3].toInt();
|
| 330 |
this->iSize = entries[pos + 4].ToInt();
|
330 |
this->iSize = entries[pos + 4].toInt();
|
| 331 |
this->iRelValPlayer = entries[pos + 5].ToInt();
|
331 |
this->iRelValPlayer = entries[pos + 5].toInt();
|
| 332 |
this->iMinNoto = entries[pos + 6].ToInt();
|
332 |
this->iMinNoto = entries[pos + 6].toInt();
|
| 333 |
this->iVideoID = entries[pos + 7].ToInt();
|
333 |
this->iVideoID = entries[pos + 7].toInt();
|
| 334 |
this->iSkin = entries[pos + 8].ToInt();
|
334 |
this->iSkin = entries[pos + 8].toInt();
|
| 335 |
this->sID = entries[pos + 9];
|
335 |
this->sID = entries[pos + 9];
|
| 336 |
|
336 |
|
| 337 |
this->UpdateGunEntries();
|
337 |
this->UpdateGunEntries();
|
| 338 |
|
338 |
|
| 339 |
CLEANSPLIT(entries, max);
|
339 |
CLEANSPLIT(entries, max);
|
| Line 458... |
Line 458... |
| 458 |
}
|
458 |
}
|
| 459 |
|
459 |
|
| 460 |
return "OBJ_SHIP_TL";
|
460 |
return "OBJ_SHIP_TL";
|
| 461 |
}
|
461 |
}
|
| 462 |
|
462 |
|
| 463 |
CyString CShipData::ConvertShipSubType(int subtype)
|
463 |
Utils::String CShipData::ConvertShipSubType(int subtype)
|
| 464 |
{
|
464 |
{
|
| 465 |
switch ( subtype )
|
465 |
switch ( subtype )
|
| 466 |
{
|
466 |
{
|
| 467 |
case SG_SH_TL:
|
467 |
case SG_SH_TL:
|
| 468 |
return "SG_SH_TL";
|
468 |
return "SG_SH_TL";
|
| Line 499... |
Line 499... |
| 499 |
}
|
499 |
}
|
| 500 |
|
500 |
|
| 501 |
return "SG_SH_TL";
|
501 |
return "SG_SH_TL";
|
| 502 |
}
|
502 |
}
|
| 503 |
|
503 |
|
| 504 |
int CShipData::ConvertShipSubType(CyString subtype)
|
504 |
int CShipData::ConvertShipSubType(const Utils::String &subtype)
|
| 505 |
{
|
505 |
{
|
| 506 |
int num = 0;
|
506 |
int num = 0;
|
| 507 |
for ( int i = 0; i < SG_SH_MAX; i++ )
|
507 |
for ( int i = 0; i < SG_SH_MAX; i++ )
|
| 508 |
{
|
508 |
{
|
| 509 |
if ( subtype.Compare(CShipData::ConvertShipSubType(i)) )
|
509 |
if ( subtype.Compare(CShipData::ConvertShipSubType(i)) )
|
| Line 571... |
Line 571... |
| 571 |
g->iLaserCount = 0;
|
571 |
g->iLaserCount = 0;
|
| 572 |
for ( CListNode<SWeaponGroup> *wNode = g->lWeapons.Front(); wNode; wNode = wNode->next() )
|
572 |
for ( CListNode<SWeaponGroup> *wNode = g->lWeapons.Front(); wNode; wNode = wNode->next() )
|
| 573 |
{
|
573 |
{
|
| 574 |
SWeaponGroup *w = wNode->Data();
|
574 |
SWeaponGroup *w = wNode->Data();
|
| 575 |
|
575 |
|
| 576 |
if ( (w->iNode1 > 0 || (w->iNode1 == 0 && w->sModel1 != "0")) && !w->sModel1.Empty() )
|
576 |
if ( (w->iNode1 > 0 || (w->iNode1 == 0 && w->sModel1 != "0")) && !w->sModel1.empty() )
|
| 577 |
{
|
577 |
{
|
| 578 |
w->iLaser = 1;
|
578 |
w->iLaser = 1;
|
| 579 |
if ( (w->iNode2 > 0 || (w->iNode2 == 0 && w->sModel2 != "0")) && !w->sModel2.Empty() )
|
579 |
if ( (w->iNode2 > 0 || (w->iNode2 == 0 && w->sModel2 != "0")) && !w->sModel2.empty() )
|
| 580 |
w->iLaser = 2;
|
580 |
w->iLaser = 2;
|
| 581 |
}
|
581 |
}
|
| 582 |
else
|
582 |
else
|
| 583 |
{
|
583 |
{
|
| 584 |
w->iLaser = 0;
|
584 |
w->iLaser = 0;
|
| Line 652... |
Line 652... |
| 652 |
++this->iGunsCount;
|
652 |
++this->iGunsCount;
|
| 653 |
|
653 |
|
| 654 |
this->UpdateGunEntries();
|
654 |
this->UpdateGunEntries();
|
| 655 |
}
|
655 |
}
|
| 656 |
|
656 |
|
| 657 |
CyString CShipData::ConvertMissileGroup(int type)
|
657 |
Utils::String CShipData::ConvertMissileGroup(int type)
|
| 658 |
{
|
658 |
{
|
| 659 |
switch ( type )
|
659 |
switch ( type )
|
| 660 |
{
|
660 |
{
|
| 661 |
case SG_MISSILE_LIGHT:
|
661 |
case SG_MISSILE_LIGHT:
|
| 662 |
return "SG_MISSILE_LIGHT";
|
662 |
return "SG_MISSILE_LIGHT";
|
| Line 704... |
Line 704... |
| 704 |
}
|
704 |
}
|
| 705 |
|
705 |
|
| 706 |
return 0;
|
706 |
return 0;
|
| 707 |
}
|
707 |
}
|
| 708 |
|
708 |
|
| 709 |
int CShipData::ConvertMissileGroupToID(CyString type)
|
709 |
int CShipData::ConvertMissileGroupToID(const Utils::String &type)
|
| 710 |
{
|
710 |
{
|
| 711 |
return CShipData::ConvertMissileGroupToID(CShipData::ConvertMissileGroup(type));
|
711 |
return CShipData::ConvertMissileGroupToID(CShipData::ConvertMissileGroup(type));
|
| 712 |
}
|
712 |
}
|
| 713 |
|
713 |
|
| 714 |
int CShipData::ConvertMissileGroup(CyString type)
|
714 |
int CShipData::ConvertMissileGroup(const Utils::String &type)
|
| 715 |
{
|
715 |
{
|
| 716 |
if ( type.Compare("SG_MISSILE_LIGHT") )
|
716 |
if ( type.Compare("SG_MISSILE_LIGHT") )
|
| 717 |
return SG_MISSILE_LIGHT;
|
717 |
return SG_MISSILE_LIGHT;
|
| 718 |
if ( type.Compare("SG_MISSILE_MEDIUM") )
|
718 |
if ( type.Compare("SG_MISSILE_MEDIUM") )
|
| 719 |
return SG_MISSILE_MEDIUM;
|
719 |
return SG_MISSILE_MEDIUM;
|