Special game mode allowing the only clan on map for training mode
authorunc0rr
Thu, 20 Sep 2007 20:00:10 +0000
changeset 601 78a68cc4d846
parent 600 f6e5f4e122db
child 602 f7628ebfccde
Special game mode allowing the only clan on map for training mode
QTfrontend/game.cpp
QTfrontend/hwform.cpp
hedgewars.kdevelop
hedgewars/GSHandlers.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uTeams.pas
--- a/QTfrontend/game.cpp	Tue Sep 18 19:52:46 2007 +0000
+++ b/QTfrontend/game.cpp	Thu Sep 20 20:00:10 2007 +0000
@@ -120,7 +120,7 @@
 	QByteArray teamscfg;
 	HWProto::addStringToBuffer(teamscfg, "TL");
 	HWProto::addStringToBuffer(teamscfg, "eseed none");
-	HWProto::addStringToBuffer(teamscfg, "e$gmflags 0");
+	HWProto::addStringToBuffer(teamscfg, QString("e$gmflags %1").arg(0x10000000));
 	HWProto::addStringToBuffer(teamscfg, "e$turntime 60000");
 	HWProto::addStringToBuffer(teamscfg, "emap mushrooms");
 	HWProto::addStringToBuffer(teamscfg, "etheme avematan");
@@ -132,13 +132,6 @@
 	HWProto::addStringListToBuffer(teamscfg,
 			team1.TeamGameConfig(100));
 
-	HWTeam team2(2);
-	team2.difficulty = 4;
-	team2.teamColor = QColor(16776960);
-	team2.numHedgehogs = 4;
-	HWProto::addStringListToBuffer(teamscfg,
-			team2.TeamGameConfig(100));
-
 	QFile file(datadir->absolutePath() + "/Trainings/001_Shotgun.txt");
 	if(!file.open(QFile::ReadOnly))
 	{
--- a/QTfrontend/hwform.cpp	Tue Sep 18 19:52:46 2007 +0000
+++ b/QTfrontend/hwform.cpp	Thu Sep 20 20:00:10 2007 +0000
@@ -87,7 +87,6 @@
 	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	config, SLOT(SaveOptions()));
 	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	this, SLOT(GoBack()));
 	connect(ui.pageOptions->WeaponsButt,	SIGNAL(clicked()),	this, SLOT(GoToSelectWeapon()));
-	// TODO
 
 	connect(ui.pageNet->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
 	connect(ui.pageNet->BtnNetConnect,	SIGNAL(clicked()),	this, SLOT(NetConnect()));
--- a/hedgewars.kdevelop	Tue Sep 18 19:52:46 2007 +0000
+++ b/hedgewars.kdevelop	Thu Sep 20 20:00:10 2007 +0000
@@ -6,22 +6,36 @@
     <version>1</version>
     <projectmanagement>KDevCustomProject</projectmanagement>
     <primarylanguage>C++</primarylanguage>
-    <ignoreparts/>
+    <ignoreparts>
+      <part>kdevfilegroups</part>
+      <part>kdevvalgrind</part>
+      <part>kdevdoxygen</part>
+      <part>kdevregexptest</part>
+      <part>kdevdistpart</part>
+      <part>kdevscripting</part>
+      <part>kdevfilter</part>
+    </ignoreparts>
     <projectname>hedgewars</projectname>
     <projectdirectory>.</projectdirectory>
     <absoluteprojectpath>false</absoluteprojectpath>
     <description></description>
     <versioncontrol>kdevsubversion</versioncontrol>
+    <defaultencoding></defaultencoding>
   </general>
   <kdevcustomproject>
     <run>
       <directoryradio>executable</directoryradio>
       <customdirectory>/</customdirectory>
-      <mainprogram>bin/hedgewars</mainprogram>
+      <mainprogram>/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GNA/bin/hedgewars</mainprogram>
       <programargs></programargs>
       <terminal>false</terminal>
       <autocompile>true</autocompile>
       <envvars/>
+      <globaldebugarguments></globaldebugarguments>
+      <globalcwd>/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GNA</globalcwd>
+      <useglobalprogram>false</useglobalprogram>
+      <autoinstall>false</autoinstall>
+      <autokdesu>false</autokdesu>
     </run>
     <filetypes>
       <filetype>*.java</filetype>
@@ -165,11 +179,21 @@
         <default/>
       </environments>
     </make>
+    <other>
+      <prio>0</prio>
+      <otherbin></otherbin>
+      <defaulttarget></defaulttarget>
+      <otheroptions></otheroptions>
+      <selectedenvironment>default</selectedenvironment>
+      <environments>
+        <default/>
+      </environments>
+    </other>
   </kdevcustomproject>
   <kdevdebugger>
     <general>
       <dbgshell></dbgshell>
-      <programargs></programargs>
+      <programargs/>
       <gdbpath></gdbpath>
       <configGdbScript></configGdbScript>
       <runShellScript></runShellScript>
@@ -245,8 +269,8 @@
       <includestyle>3</includestyle>
       <root>/usr/qt/3</root>
       <designerintegration>EmbeddedKDevDesigner</designerintegration>
-      <qmake>/usr/qt/3/bin/qmake</qmake>
-      <designer>/usr/qt/3/bin/designer</designer>
+      <qmake>/usr/local/bin/qmake-qt4</qmake>
+      <designer>/usr/local/bin/designer-qt4</designer>
       <designerpluginpaths/>
     </qt>
     <references/>
@@ -285,6 +309,11 @@
       <inlineGet>true</inlineGet>
       <inlineSet>true</inlineSet>
     </creategettersetter>
+    <splitheadersource>
+      <enabled>false</enabled>
+      <synchronize>true</synchronize>
+      <orientation>Vertical</orientation>
+    </splitheadersource>
   </kdevcppsupport>
   <kdevfileview>
     <groups>
@@ -311,7 +340,8 @@
     </projectdoc>
   </kdevdocumentation>
   <ctagspart>
-    <customArguments/>
-    <customTagfilePath/>
+    <customArguments></customArguments>
+    <customTagfilePath>/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GNA/tags</customTagfilePath>
+    <activeTagsFiles/>
   </ctagspart>
 </kdevelop>
--- a/hedgewars/GSHandlers.inc	Tue Sep 18 19:52:46 2007 +0000
+++ b/hedgewars/GSHandlers.inc	Thu Sep 20 20:00:10 2007 +0000
@@ -866,7 +866,7 @@
                              team: PTeam;
                              SortFactor: QWord;
                              end;
-    currsorter: PGear;
+    currsorter: PGear = nil;
 
 procedure doStepTeamHealthSorterWork(Gear: PGear);
 var i: LongInt;
@@ -906,7 +906,8 @@
       SortFactor:= (SortFactor shl 30) + TeamsArray[t]^.TeamHealth;
       end;
 
-repeat
+if TeamsCount > 1 then
+  repeat
     b:= true;
     for t:= 0 to TeamsCount - 2 do
         if (thexchar[t].SortFactor > thexchar[Succ(t)].SortFactor) then
@@ -916,7 +917,7 @@
            thexchar[Succ(t)]:= thexchar[cMaxTeams];
            b:= false
            end
-until b;
+  until b;
 
 t:= cScreenHeight - 4;
 for i:= 0 to Pred(TeamsCount) do
--- a/hedgewars/uConsts.pas	Tue Sep 18 19:52:46 2007 +0000
+++ b/hedgewars/uConsts.pas	Thu Sep 20 20:00:10 2007 +0000
@@ -137,7 +137,8 @@
 
       cInactDelay = 1500;
 
-      gfForts = $00000001;
+      gfForts       = $00000001;
+      gfOneClanMode = $10000000;
 
       gstDrowning       = $00000001;
       gstHHDriven       = $00000002;
--- a/hedgewars/uGears.pas	Tue Sep 18 19:52:46 2007 +0000
+++ b/hedgewars/uGears.pas	Thu Sep 20 20:00:10 2007 +0000
@@ -251,7 +251,7 @@
                 end;
         gtCase: begin
                 Result^.Radius:= 16;
-                Result^.Elasticity:= _0_4
+                Result^.Elasticity:= _0_3
                 end;
   gtDEagleShot: begin
                 Result^.Radius:= 1;
@@ -294,7 +294,8 @@
                 Result^.Z:= cCurrHHZ
                 end;
       gtTarget: begin
-                Result^.Radius:= 16
+                Result^.Radius:= 16;
+                Result^.Elasticity:= _0_3
                 end;
      end;
 InsertGearToList(Result);
--- a/hedgewars/uTeams.pas	Tue Sep 18 19:52:46 2007 +0000
+++ b/hedgewars/uTeams.pas	Thu Sep 20 20:00:10 2007 +0000
@@ -106,7 +106,8 @@
        AliveClan:= ClansArray[t]
        end;
 
-if AliveCount >= 2 then exit(false);
+if  (AliveCount > 1) or
+   ((AliveCount = 1) and ((GameFlags and gfOneClanMode) <> 0)) then exit(false);
 CheckForWin:= true;
 
 TurnTimeLeft:= 0;