merge
authorunc0rr
Thu, 23 Jun 2011 21:19:43 +0400
changeset 5294 67278f1cba2c
parent 5247 bf6d4bc531d2 (diff)
parent 5292 f9f75c5bc395 (current diff)
child 5296 0bb518ad2da8
merge
hedgewars/uVariables.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/Chunk.png
share/hedgewars/Data/Themes/Art/Clouds.png
share/hedgewars/Data/Themes/Art/Flake.png
share/hedgewars/Data/Themes/Blox/Flake.png
share/hedgewars/Data/Themes/Blox/Sky.png
share/hedgewars/Data/Themes/Blox/icon.png
share/hedgewars/Data/Themes/Blox/icon@2x.png
share/hedgewars/Data/Themes/Blox/plant1.png
share/hedgewars/Data/Themes/Blox/plant2.png
share/hedgewars/Data/Themes/Blox/plant3.png
share/hedgewars/Data/Themes/Blox/plant4.png
share/hedgewars/Data/Themes/Cake/Clouds.png
share/hedgewars/Data/Themes/Cake/icon.png
share/hedgewars/Data/Themes/Cake/icon@2x.png
share/hedgewars/Data/Themes/Cake/plant4.png
share/hedgewars/Data/Themes/Cheese/Flake.png
share/hedgewars/Data/Themes/CrazyMission/Flake.png
share/hedgewars/Data/Themes/CrazyMission/horizont.png
share/hedgewars/Data/Themes/Deepspace/Clouds.png
share/hedgewars/Data/Themes/Deepspace/horizont.png
share/hedgewars/Data/Themes/EarthRise/Clouds.png
share/hedgewars/Data/Themes/EarthRise/horizontL.png
share/hedgewars/Data/Themes/Planes/Flake.png
share/hedgewars/Data/Themes/themes.cfg
--- a/hedgewars/uAIMisc.pas	Thu Jun 23 21:14:41 2011 +0400
+++ b/hedgewars/uAIMisc.pas	Thu Jun 23 21:19:43 2011 +0400
@@ -134,7 +134,7 @@
 Gear:= GearsList;
 while Gear <> nil do
     begin
-	if (filter = []) or (Gear^.Kind in filter) then
+    if (filter = []) or (Gear^.Kind in filter) then
       case Gear^.Kind of
           gtCase: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
           gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then
@@ -152,7 +152,7 @@
                           AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
                       else
                           if isAfterAttack and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog) then
-                              if (MyClan = Gear^.Hedgehog^.Team^.Clan) then
+                              if (ClansCount > 2) or (MyClan = Gear^.Hedgehog^.Team^.Clan) then
                                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -3) // hedgehog-friend
                               else
                                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, 3)
--- a/hedgewars/uCommandHandlers.pas	Thu Jun 23 21:14:41 2011 +0400
+++ b/hedgewars/uCommandHandlers.pas	Thu Jun 23 21:19:43 2011 +0400
@@ -26,7 +26,7 @@
 procedure freeModule;
 
 implementation
-uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom;
+uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions;
 
 procedure chGenCmd(var s: shortstring);
 begin
@@ -331,7 +331,7 @@
         FollowGear:= CurrentHedgehog^.Gear;
         if not CurrentTeam^.ExtDriven then SendIPC('A');
         Message:= Message or (gmAttack and InputMask);
-	ScriptCall('onAttack');
+        ScriptCall('onAttack');
         end
     end
 end;
@@ -411,7 +411,7 @@
     begin
         Message:= Message or (gmWeapon and InputMask);
         MsgParam:= byte(s[1]);
-	ScriptCall('onSetWeapon');
+    ScriptCall('onSetWeapon');
     end;
 end;
 
@@ -510,8 +510,18 @@
 begin
 s:= s; // avoid compiler hint
 if CheckNoTeamOrHH or isPaused then exit;
-bShowFinger:= true;
-FollowGear:= CurrentHedgehog^.Gear
+
+if FollowGear <> nil then
+    begin
+    AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume);
+    autoCameraOn:= false
+    end
+    else begin
+    AddCaption('Auto Camera On', $CCCCCC, capgrpVolume);
+    bShowFinger:= true;
+    FollowGear:= CurrentHedgehog^.Gear;
+    autoCameraOn:= true
+    end
 end;
 
 procedure chPause(var s: shortstring);
--- a/hedgewars/uVariables.pas	Thu Jun 23 21:14:41 2011 +0400
+++ b/hedgewars/uVariables.pas	Thu Jun 23 21:19:43 2011 +0400
@@ -62,6 +62,7 @@
     isFirstFrame    : boolean;
 
     fastUntilLag    : boolean;
+    autoCameraOn    : boolean;
 
     GameState       : TGameState;
     GameType        : TGameType;
@@ -2355,6 +2356,7 @@
     fastUntilLag    := false;
     isFirstFrame    := true;
     isSEBackup      := true;
+    autoCameraOn    := true;
     cSeed           := '';
     cVolumeDelta    := 0;
     cHasFocus       := true;
--- a/hedgewars/uWorld.pas	Thu Jun 23 21:14:41 2011 +0400
+++ b/hedgewars/uWorld.pas	Thu Jun 23 21:19:43 2011 +0400
@@ -1165,7 +1165,7 @@
 {$ENDIF}
 
 if (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not fastUntilLag) then
-    if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then
+    if (not autoCameraOn) or (abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4) then
     begin
         FollowGear:= nil;
         prevPoint:= CursorPoint;