- Timestamp:
- Jun 18, 2017, 1:37:51 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r129 r131 1394 1394 I: Integer; 1395 1395 Addition: Integer; 1396 begin 1397 for I := 0 to Cells.Count - 1 do 1396 Dies: Integer; 1397 begin 1398 for I := 0 to Cells.Count - 1 do 1398 1399 with TCell(Cells[I]) do begin 1399 1400 if (Player = APlayer) and ((Game.GrowCells = gcPlayerAll) or 1400 1401 ((Game.GrowCells = gcPlayerCities) and (Terrain = ttCity))) then begin 1401 if Game.GrowAmount = gaByOne then Addition := 1 1402 else if Game.GrowAmount = gaBySquareRoot then begin 1403 Addition := Trunc(Sqrt(Power)); 1404 if Addition = 0 then Addition := 1; 1405 end; 1406 Power := Power + Addition; 1407 if Power > MaxPower then Power := MaxPower; 1402 if Power < MaxPower then begin 1403 // Increase units count 1404 if Game.GrowAmount = gaByOne then Addition := 1 1405 else if Game.GrowAmount = gaBySquareRoot then begin 1406 Addition := Trunc(Sqrt(Power)); 1407 if Addition = 0 then Addition := 1; 1408 end; 1409 Power := Min(Power + Addition, MaxPower); 1410 end else 1411 if Power > MaxPower then begin 1412 // Reduce units count 1413 // If cell has more then MaxPower units then additional units dies 1414 // in twice of squeare root of unites over MaxPower 1415 Dies := 2 * Trunc(Sqrt(Power - MaxPower)); 1416 Power := Max(Power - Dies, 0); 1417 end; 1408 1418 end; 1409 1419 end; … … 1501 1511 MaxPower := 99; 1502 1512 DefaultCellSize := Point(220, 220); 1503 Cells := TCells. create;1513 Cells := TCells.Create; 1504 1514 Cells.Map := Self; 1505 1515 Size := Point(0, 0); … … 2392 2402 S := 'Att:'; 2393 2403 for I := 0 to AttackerDiceCount - 1 do 2394 S := S + In TToStr(Integer(AttackRolls[I])) + ', ';2404 S := S + IntToStr(Integer(AttackRolls[I])) + ', '; 2395 2405 DefendRolls.Count := DefenderDiceCount; 2396 2406 for I := 0 to DefenderDiceCount - 1 do begin
Note:
See TracChangeset
for help on using the changeset viewer.