- Timestamp:
- Sep 28, 2014, 5:42:51 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r62 r69 5 5 Width = 775 6 6 Caption = 'xTactics' 7 ClientHeight = 6007 ClientHeight = 595 8 8 ClientWidth = 775 9 9 Menu = MainMenu1 … … 13 13 OnDestroy = FormDestroy 14 14 OnShow = FormShow 15 LCLVersion = '1. 0.10.0'15 LCLVersion = '1.3' 16 16 WindowState = wsMaximized 17 17 object PaintBox1: TPaintBox 18 18 Left = 40 19 Height = 5 7919 Height = 569 20 20 Top = 0 21 21 Width = 735 … … 32 32 object StatusBar1: TStatusBar 33 33 Left = 0 34 Height = 2 135 Top = 5 7934 Height = 26 35 Top = 569 36 36 Width = 775 37 37 Panels = < … … 49 49 object ToolBar1: TToolBar 50 50 Left = 0 51 Height = 5 7951 Height = 569 52 52 Top = 0 53 53 Width = 40 … … 87 87 object ToolButton6: TToolButton 88 88 Left = 1 89 Top = 1 9489 Top = 172 90 90 Action = AZoomIn 91 91 end 92 92 object ToolButton7: TToolButton 93 93 Left = 1 94 Top = 2 2694 Top = 204 95 95 Action = AZoomOut 96 96 end 97 97 object ToolButton8: TToolButton 98 98 Left = 1 99 Top = 2 5899 Top = 236 100 100 Action = AZoomAll 101 101 end -
trunk/Forms/UFormMain.pas
r62 r69 343 343 procedure TFormMain.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton; 344 344 Shift: TShiftState; X, Y: Integer); 345 begin 346 if (Abs(StartMousePoint.X - X) < 5) and (Abs(StartMousePoint.Y - Y) < 5) then begin 345 const 346 MouseMinDiff = 10; 347 begin 348 if (Abs(StartMousePoint.X - X) < MouseMinDiff) and (Abs(StartMousePoint.Y - Y) < MouseMinDiff) then begin 347 349 if Core.Game.Running and (Core.Game.CurrentPlayer.Mode = pmHuman) then begin 348 350 Core.Game.CurrentPlayer.View.SelectCell(Point(X, Y), Core.Game.CurrentPlayer); -
trunk/UGame.pas
r68 r69 1148 1148 S: string; 1149 1149 const 1150 AttackDiff = 2;1150 AttackDiff = 1; 1151 1151 begin 1152 1152 AllCells := Game.Map.Cells; … … 1283 1283 NewTargetCells.OwnsObjects := False; 1284 1284 1285 // Get list of all our cells which can attack1285 // Get list of all enemy border cells 1286 1286 for C := 0 to AllCells.Count - 1 do 1287 1287 with TCell(AllCells[C]) do begin 1288 if (Player = Game.CurrentPlayer) then begin1288 if (Player <> Game.CurrentPlayer) and (Player <> nil) and (Terrain <> ttVoid) then begin 1289 1289 Cells := Game.Map.GetCellNeighbors(TCell(AllCells[C])); 1290 1290 CanAttack := 0; 1291 1291 for I := 0 to Length(Cells) - 1 do 1292 if ( Cells[I].Player <> Game.CurrentPlayer) and (Cells[I].Terrain <> ttVoid) then begin1292 if ((Cells[I].Player = Game.CurrentPlayer) or (Cells[I].Player = nil)) and (Cells[I].Terrain <> ttVoid) then begin 1293 1293 Inc(CanAttack); 1294 1294 end; … … 1310 1310 for C := 0 to TargetCells.Count - 1 do 1311 1311 with TCell(TargetCells[C]) do begin 1312 //1313 1312 Cells := Game.Map.GetCellNeighbors(TCell(TargetCells[C])); 1314 for I := 0 to Length(Cells) - 1 do 1315 if (Cells[I].Player = Game.CurrentPlayer) and (Cells[I].Terrain <> ttVoid) 1316 and (not Cells[I].Mark) then begin 1317 Game.SetMove(Cells[I], TCell(TargetCells[C]), Cells[I].GetAvialPower); 1318 TCell(TargetCells[C]).Mark := True; 1319 NewTargetCells.Add(Cells[I]); 1313 for I := 0 to Length(Cells) - 1 do begin 1314 if (Cells[I].Terrain <> ttVoid) and (not Cells[I].Mark) then begin 1315 if (TCell(TargetCells[C]).Player = Game.CurrentPlayer) and 1316 (Cells[I].Player = Game.CurrentPlayer) then begin 1317 // Do not take units from front line 1318 Cells2 := Game.Map.GetCellNeighbors(TCell(Cells[I])); 1319 CanAttack := 0; 1320 for J := 0 to Length(Cells2) - 1 do 1321 if ((Cells2[J].Player <> Game.CurrentPlayer) or (Cells2[J].Player = nil)) 1322 and (Cells2[J].Terrain <> ttVoid) then begin 1323 Inc(CanAttack); 1324 end; 1325 if CanAttack = 0 then 1326 Game.SetMove(Cells[I], TCell(TargetCells[C]), Cells[I].GetAvialPower); 1327 end; 1328 TCell(TargetCells[C]).Mark := True; 1329 NewTargetCells.Add(Cells[I]); 1330 end; 1320 1331 end; 1321 1332 end; … … 1695 1706 VoidEnabled := GetValue(Path + '/VoidEnabled', True); 1696 1707 VoidPercentage := GetValue(Path + '/VoidPercentage', 20); 1697 Map.Size := Point(GetValue(Path + '/MapSizeX', 1 5),1698 GetValue(Path + '/MapSizeY', 1 5));1699 CityEnabled := GetValue(Path + '/CityEnabled', True);1708 Map.Size := Point(GetValue(Path + '/MapSizeX', 10), 1709 GetValue(Path + '/MapSizeY', 10)); 1710 CityEnabled := GetValue(Path + '/CityEnabled', False); 1700 1711 CityPercentage := GetValue(Path + '/CityPercentage', 10); 1701 1712 GrowAmount := TGrowAmount(GetValue(Path + '/GrowAmount', Integer(gaBySquareRoot))); … … 1839 1850 MoveAll(CurrentPlayer); 1840 1851 Map.Grow(CurrentPlayer); 1852 UpdateRepeatMoves(CurrentPlayer); 1841 1853 ComputePlayerStats; 1842 1854 PrevPlayer := CurrentPlayer; … … 1847 1859 if Players.IndexOf(CurrentPlayer) < Players.IndexOf(PrevPlayer) then Inc(TurnCounter); 1848 1860 CheckWinObjective; 1849 UpdateRepeatMoves(CurrentPlayer);1850 1861 // For computers take view from previous human 1851 1862 if CurrentPlayer.Mode = pmComputer then CurrentPlayer.View.Assign(PrevPlayer.View);
Note:
See TracChangeset
for help on using the changeset viewer.