Ignore:
Timestamp:
Jan 15, 2019, 1:03:40 AM (6 years ago)
Author:
chronos
Message:
  • Modified: Cell power is now internally represented as unit power (TUnit class).
  • Modified: Allow to have only one player in the game.
  • Added: New win objective None to just play freely without any win objective.
  • Added: New win objective to capture entire map.
  • Added: TGameSystem class to represent various game play systems of other existing games.
  • Fixed: Clear correctly defender player from unit moves if his cell is captured.
  • Fixed: Do not allow to remove too many players to have at least minimum players.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.pas

    r263 r265  
    163163  SGridTypeRandom = 'Random';
    164164  SGridTypeIsometric = 'Isometric';
     165  SWinObjectiveNone = 'None';
    165166  SWinObjectiveDefeatAllOponents = 'Defeat all oponents';
    166167  SWinObjectiveDefeatAllCities = 'Defeat all oponents cities';
    167168  SWinObjectiveCapturePosition = 'Capture all special cells';
    168169  SWinObjectiveStayAliveForTurns = 'Stay alive for number of turns';
     170  SWinObjectiveCaptureEntireMap = 'Capture entire map';
    169171  SGrowNone = 'None';
    170172  SGrowPlayerCities = 'Player cities';
     
    283285    LastIndex := ItemIndex;
    284286    Clear;
     287    Items.Add(SWinObjectiveNone);
    285288    Items.Add(SWinObjectiveDefeatAllOponents);
    286289    Items.Add(SWinObjectiveDefeatAllCities);
    287290    Items.Add(SWinObjectiveCapturePosition);
    288291    Items.Add(SWinObjectiveStayAliveForTurns);
     292    Items.Add(SWinObjectiveCaptureEntireMap);
    289293    ItemIndex := LastIndex;
    290294  end;
     
    327331procedure TFormNew.UpdateInterface;
    328332begin
    329   APlayerRemove.Enabled := Assigned(ListViewPlayers.Selected) and (Players.Count > 2);
     333  APlayerRemove.Enabled := Assigned(ListViewPlayers.Selected) and (Players.Count > MinPlayerCount);
    330334  APlayerAdd.Enabled := Players.Count < MaxPlayerCount;
    331335  APlayerModify.Enabled := Assigned(ListViewPlayers.Selected);
     
    427431  if ListViewPlayers.Items[I].Selected then begin
    428432    Players.Remove(ListViewPlayers.Items[I].Data);
     433    if Players.Count <= MinPlayerCount then Break;
    429434  end;
    430435  ReloadView;
     
    487492  if Players.Count <= (MaxPlayerCount - 1) then begin
    488493    NewPlayer := TPlayer.Create;
    489     NewPlayer.Id := Players.GetNewPlayerId;
     494    NewPlayer.Id := Players.GetNewId;
    490495    NewPlayer.Name := SPlayer + ' ' + IntToStr(NewPlayer.Id);
    491496    NewPlayer.Color := PlayerColors[Players.Count];
     
    539544    SpinEditTurns.Value := StayAliveForDefinedTurns;
    540545    SpinEditSpecialCells.Value := SpecialCaptureCellCount;
    541     CheckBoxEmptyCellsNeutral.Checked := EmptyCellsNeutral;
     546    CheckBoxEmptyCellsNeutral.Checked := GameSystem.EmptyCellsNeutral;
    542547  end;
    543548end;
     
    582587    StayAliveForDefinedTurns := SpinEditTurns.Value;
    583588    SpecialCaptureCellCount := SpinEditSpecialCells.Value;
    584     EmptyCellsNeutral := CheckBoxEmptyCellsNeutral.Checked;
     589    GameSystem.EmptyCellsNeutral := CheckBoxEmptyCellsNeutral.Checked;
    585590  end;
    586591end;
Note: See TracChangeset for help on using the changeset viewer.