118 HWProto::addStringToBuffer(teamscfg, "TL"); |
117 HWProto::addStringToBuffer(teamscfg, "TL"); |
119 HWProto::addStringToBuffer(teamscfg, QString("etheme %1") |
118 HWProto::addStringToBuffer(teamscfg, QString("etheme %1") |
120 .arg((themesModel->rowCount() > 0) ? themesModel->index(rand() % themesModel->rowCount()).data().toString() : "steel")); |
119 .arg((themesModel->rowCount() > 0) ? themesModel->index(rand() % themesModel->rowCount()).data().toString() : "steel")); |
121 HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString()); |
120 HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString()); |
122 |
121 |
123 HWNamegen namegen; |
|
124 |
|
125 HWTeam team1; |
122 HWTeam team1; |
126 team1.setDifficulty(0); |
123 team1.setDifficulty(0); |
127 team1.setColor(QColor(colors[0])); |
124 team1.setColor(QColor(colors[0])); |
128 team1.setNumHedgehogs(4); |
125 team1.setNumHedgehogs(4); |
129 namegen.teamRandomNames(team1,TRUE); |
126 HWNamegen::teamRandomNames(team1,true); |
130 HWProto::addStringListToBuffer(teamscfg, |
127 HWProto::addStringListToBuffer(teamscfg, |
131 team1.teamGameConfig(100)); |
128 team1.teamGameConfig(100)); |
132 |
129 |
133 HWTeam team2; |
130 HWTeam team2; |
134 team2.setDifficulty(4); |
131 team2.setDifficulty(4); |
135 team2.setColor(QColor(colors[1])); |
132 team2.setColor(QColor(colors[1])); |
136 team2.setNumHedgehogs(4); |
133 team2.setNumHedgehogs(4); |
137 do |
134 do |
138 namegen.teamRandomNames(team2,TRUE); |
135 HWNamegen::teamRandomNames(team2,true); |
139 while(!team2.name().compare(team1.name()) || !team2.hedgehog(0).Hat.compare(team1.hedgehog(0).Hat)); |
136 while(!team2.name().compare(team1.name()) || !team2.hedgehog(0).Hat.compare(team1.hedgehog(0).Hat)); |
140 HWProto::addStringListToBuffer(teamscfg, |
137 HWProto::addStringListToBuffer(teamscfg, |
141 team2.teamGameConfig(100)); |
138 team2.teamGameConfig(100)); |
142 |
139 |
143 HWProto::addStringToBuffer(teamscfg, QString("eammloadt %1").arg(cDefaultAmmoStore->mid(0, cAmmoNumber))); |
140 HWProto::addStringToBuffer(teamscfg, QString("eammloadt %1").arg(cDefaultAmmoStore->mid(0, cAmmoNumber))); |
316 arguments << tr("en.txt"); |
313 arguments << tr("en.txt"); |
317 |
314 |
318 return arguments; |
315 return arguments; |
319 } |
316 } |
320 |
317 |
321 void HWGame::AddTeam(const QString & teamname) |
|
322 { |
|
323 if (TeamCount == 5) return; |
|
324 teams[TeamCount] = teamname; |
|
325 TeamCount++; |
|
326 } |
|
327 |
|
328 void HWGame::PlayDemo(const QString & demofilename, bool isSave) |
318 void HWGame::PlayDemo(const QString & demofilename, bool isSave) |
329 { |
319 { |
330 gameType = isSave ? gtSave : gtDemo; |
320 gameType = isSave ? gtSave : gtDemo; |
331 QFile demofile(demofilename); |
321 QFile demofile(demofilename); |
332 if (!demofile.open(QIODevice::ReadOnly)) |
322 if (!demofile.open(QIODevice::ReadOnly)) |