Changeset 273 for trunk/UGame.pas
- Timestamp:
- Jan 30, 2019, 8:08:44 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r271 r273 24 24 class procedure PolygonEx(Canvas: TCanvas; const Points: array of Classes.TPoint; Winding: Boolean); 25 25 class procedure PolyLineEx(Canvas: TCanvas; const Points: array of Classes.TPoint); 26 class procedure Ellipse(Canvas: TCanvas; const ARect: TRect); 26 27 end; 27 28 … … 191 192 end; 192 193 194 class procedure TCanvasEx.Ellipse(Canvas: TCanvas; const ARect: TRect); 195 begin 196 LCLIntf.Ellipse(Canvas.Handle, ARect.P1.X, ARect.P1.Y, ARect.P2.X, ARect.P2.Y); 197 end; 198 193 199 { TGame } 194 200 … … 289 295 var 290 296 Cell: TCell; 297 NewPower: Integer; 291 298 begin 292 299 // Randomize map terrain … … 296 303 (Map.IsOutsideShape(PosPx)) then Terrain := ttVoid 297 304 else Terrain := ttNormal; 298 if not Assigned(OneUnit) then 299 OneUnit := Units.AddNew(GameSystem.UnitKinds[0], Random(MaxNeutralUnits + 1)); 305 NewPower := Random(MaxNeutralUnits + 1); 306 if (NewPower > 0) and not Assigned(OneUnit) then begin 307 OneUnit := Units.AddNew(GameSystem.UnitKinds[0], NewPower); 308 end; 300 309 Player := nil; 301 310 end; … … 512 521 SetValue(DOMString(Path + '/StayAliveForDefinedTurns'), StayAliveForDefinedTurns); 513 522 SetValue(DOMString(Path + '/SpecialCaptureCellCount'), SpecialCaptureCellCount); 523 SetValue(DOMString(Path + '/MaxNeutralUnits'), MaxNeutralUnits); 524 SetValue(DOMString(Path + '/MaxPower'), MaxPower); 514 525 Players.SaveConfig(Config, Path + '/Players'); 515 526 end; … … 548 559 StayAliveForDefinedTurns := GetValue(DOMString(Path + '/StayAliveForDefinedTurns'), 20); 549 560 SpecialCaptureCellCount := GetValue(DOMString(Path + '/SpecialCaptureCellCount'), 1); 561 MaxNeutralUnits := GetValue(DOMString(Path + '/MaxNeutralUnits'), 5); 562 MaxPower := GetValue(DOMString(Path + '/MaxPower'), 99); 550 563 Players.LoadConfig(Config, Path + '/Players'); 551 564 end; … … 730 743 CurrentPlayer.Grow; 731 744 CurrentPlayer.UpdateEmptyCellsNeutral; 745 CurrentPlayer.RemoveEmptyUnits; 732 746 CurrentPlayer.UpdateRepeatMoves; 733 747 ComputePlayerStats;
Note:
See TracChangeset
for help on using the changeset viewer.