move turnstime and minestime * 1000 outside frontend and place it in engine
authorkoda
Sun, 07 Nov 2010 20:27:05 +0100
changeset 4197 dad127904958
parent 4196 78c45314f123
child 4198 55814f1ef60a
move turnstime and minestime * 1000 outside frontend and place it in engine
QTfrontend/gamecfgwidget.cpp
hedgewars/uAI.pas
hedgewars/uGears.pas
hedgewars/uMisc.pas
hedgewars/uTeams.pas
hedgewars/uWorld.pas
--- a/QTfrontend/gamecfgwidget.cpp	Sun Nov 07 14:24:00 2010 -0500
+++ b/QTfrontend/gamecfgwidget.cpp	Sun Nov 07 20:27:05 2010 +0100
@@ -157,8 +157,8 @@
     sl.append("eseed " + pMapContainer->getCurrentSeed());
     sl.append(QString("e$gmflags %1").arg(getGameFlags()));
     sl.append(QString("e$damagepct %1").arg(schemeData(22).toInt()));
-    sl.append(QString("e$turntime %1").arg(schemeData(23).toInt() * 1000));
-    sl.append(QString("e$minestime %1").arg(schemeData(27).toInt() * 1000));
+    sl.append(QString("e$turntime %1").arg(schemeData(23).toInt()));
+    sl.append(QString("e$minestime %1").arg(schemeData(27).toInt()));
     sl.append(QString("e$minesnum %1").arg(schemeData(28).toInt()));
     sl.append(QString("e$sd_turns %1").arg(schemeData(25).toInt()));
     sl.append(QString("e$casefreq %1").arg(schemeData(26).toInt()));
--- a/hedgewars/uAI.pas	Sun Nov 07 14:24:00 2010 -0500
+++ b/hedgewars/uAI.pas	Sun Nov 07 20:27:05 2010 +0100
@@ -333,7 +333,7 @@
 with CurrentHedgehog^ do
      if (Gear <> nil)
         and ((Gear^.State and gstHHDriven) <> 0)
-        and (TurnTimeLeft < cHedgehogTurnTime - 50) then
+        and (TurnTimeLeft < (cHedgehogTurnTime * 1000) - 50) then
         if ((Gear^.State and gstHHThinking) = 0) then
            if (BestActions.Pos >= BestActions.Count)
               and (TurnTimeLeft > cStopThinkTime) then
--- a/hedgewars/uGears.pas	Sun Nov 07 14:24:00 2010 -0500
+++ b/hedgewars/uGears.pas	Sun Nov 07 20:27:05 2010 +0100
@@ -365,9 +365,9 @@
                 gear^.Elasticity:= _0_55;
                 gear^.Friction:= _0_995;
                 if cMinesTime < 0 then
-                    gear^.Timer:= getrandom(6)*1000
+                    gear^.Timer:= getrandom(51)*100
                 else
-                    gear^.Timer:= cMinesTime*1;
+                    gear^.Timer:= cMinesTime*1000;
                 end;
        gtSMine: begin
                 gear^.Health:= 10;
@@ -890,7 +890,7 @@
                 and not isInMultiShoot then
                 begin
                 if (TurnTimeLeft = 5000)
-                    and (cHedgehogTurnTime >= 10000)
+                    and (cHedgehogTurnTime >= 10)
                     and (not PlacingHogs)
                     and (CurrentHedgehog^.Gear <> nil)
                     and ((CurrentHedgehog^.Gear^.State and gstAttacked) = 0) then
--- a/hedgewars/uMisc.pas	Sun Nov 07 14:24:00 2010 -0500
+++ b/hedgewars/uMisc.pas	Sun Nov 07 20:27:05 2010 +0100
@@ -757,8 +757,8 @@
     cTemplateFilter     := 0;
     cMapGen             := 0;   // MAPGEN_REGULAR
     cMazeSize           := 0;
-    cHedgehogTurnTime   := 45000;
-    cMinesTime          := 3000;
+    cHedgehogTurnTime   := 45;
+    cMinesTime          := 3;
     cMaxAIThinkTime     := 9000;
     cCloudsNumber       := 9;
     cHealthCaseProb     := 35;
--- a/hedgewars/uTeams.pas	Sun Nov 07 14:24:00 2010 -0500
+++ b/hedgewars/uTeams.pas	Sun Nov 07 20:27:05 2010 +0100
@@ -295,14 +295,14 @@
    if CurrentHedgehog^.Unplaced then TurnTimeLeft:= 15000
    else TurnTimeLeft:= 0
    end
-else TurnTimeLeft:= cHedgehogTurnTime;
+else TurnTimeLeft:= cHedgehogTurnTime * 1000;
 if (TurnTimeLeft > 0) and (CurrentHedgehog^.BotLevel = 0) then
     begin
     if CurrentTeam^.ExtDriven then
         PlaySound(sndIllGetYou, CurrentTeam^.voicepack)
     else
         PlaySound(sndYesSir, CurrentTeam^.voicepack);
-    if PlacingHogs or (cHedgehogTurnTime < 1000000) then ReadyTimeLeft:= cReadyDelay;
+    if PlacingHogs or (cHedgehogTurnTime < 1000) then ReadyTimeLeft:= cReadyDelay;
     AddCaption(Format(shortstring(trmsg[sidReady]), CurrentTeam^.TeamName), cWhiteColor, capgrpGameState)
     end
 else
--- a/hedgewars/uWorld.pas	Sun Nov 07 14:24:00 2010 -0500
+++ b/hedgewars/uWorld.pas	Sun Nov 07 20:27:05 2010 +0100
@@ -149,14 +149,14 @@
 ScreenFadeSpeed:= 1;
 
 // modified mine timers?
-if cMinesTime <> 3000 then
+if cMinesTime <> 3 then
     begin
     if cMinesTime = 0 then
         g:= AddGoal(g, gfAny, gidNoMineTimer)
     else if cMinesTime < 0 then
         g:= AddGoal(g, gfAny, gidRandomMineTimer)
     else
-        g:= AddGoal(g, gfAny, gidMineTimer, cMinesTime div 1000);
+        g:= AddGoal(g, gfAny, gidMineTimer, cMinesTime);
     end;
 
 // if the string has been set, show it for (default timeframe) seconds