Changeset 265 for trunk/Forms


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.
Location:
trunk/Forms
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.lfm

    r249 r265  
    1313  OnKeyUp = FormKeyUp
    1414  OnShow = FormShow
    15   LCLVersion = '1.8.2.0'
     15  LCLVersion = '1.8.4.0'
    1616  WindowState = wsMaximized
    1717  object StatusBar1: TStatusBar
    1818    Left = 0
    19     Height = 30
    20     Top = 591
     19    Height = 28
     20    Top = 593
    2121    Width = 775
    2222    Panels = <   
     
    3434  object ToolBar1: TToolBar
    3535    Left = 0
    36     Height = 591
     36    Height = 593
    3737    Top = 0
    3838    Width = 32
     
    8080  object PaintBox1: TPaintBox
    8181    Left = 32
    82     Height = 591
     82    Height = 593
    8383    Top = 0
    8484    Width = 743
  • trunk/Forms/UFormClient.pas

    r249 r265  
    152152    FormMove.TrackBarRepeat.Max := FormMove.SpinEditRepeat.MaxValue;
    153153    FormMove.TrackBarRepeat.Position := FormMove.SpinEditRepeat.Value;
    154     FormMove.DefendCount := CellTo.MapCell.Power;
     154    if Assigned(CellTo.MapCell.OneUnit) then
     155      FormMove.DefendCount := CellTo.MapCell.OneUnit.Power
     156      else FormMove.DefendCount := 0;
    155157    // Attack count from other surrounding cells without current move if already exists
    156158    FormMove.AttackCount := 0;
  • trunk/Forms/UFormNew.lfm

    r263 r265  
    1515  OnShow = FormShow
    1616  Position = poMainFormCenter
    17   LCLVersion = '1.8.2.0'
     17  LCLVersion = '1.8.4.0'
    1818  object PageControl1: TPageControl
    1919    Left = 4
     
    2121    Top = 4
    2222    Width = 749
    23     ActivePage = TabSheetMap
     23    ActivePage = TabSheetRules
    2424    Align = alClient
    2525    BorderSpacing.Around = 4
    26     TabIndex = 2
     26    TabIndex = 3
    2727    TabOrder = 0
    2828    object TabSheetMode: TTabSheet
    2929      Caption = 'Mode'
    30       ClientHeight = 651
    31       ClientWidth = 743
     30      ClientHeight = 655
     31      ClientWidth = 739
    3232      object Panel3: TPanel
    3333        Left = 0
     
    113113            item
    114114              Caption = 'Address'
    115               Width = 214
     115              Width = 219
    116116            end>
    117117          MultiSelect = True
     
    158158    object TabSheetPlayers: TTabSheet
    159159      Caption = 'Players'
    160       ClientHeight = 651
    161       ClientWidth = 743
     160      ClientHeight = 655
     161      ClientWidth = 739
    162162      object Panel2: TPanel
    163163        Left = 0
    164         Height = 651
     164        Height = 655
    165165        Top = 0
    166         Width = 743
     166        Width = 739
    167167        Align = alClient
    168168        BevelOuter = bvNone
    169         ClientHeight = 651
    170         ClientWidth = 743
     169        ClientHeight = 655
     170        ClientWidth = 739
    171171        TabOrder = 0
    172172        object ListViewPlayers: TListView
    173173          Left = 4
    174           Height = 601
     174          Height = 605
    175175          Top = 4
    176           Width = 735
     176          Width = 731
    177177          Align = alTop
    178178          Anchors = [akTop, akLeft, akRight, akBottom]
     
    212212          Left = 16
    213213          Height = 25
    214           Top = 613
     214          Top = 617
    215215          Width = 83
    216216          Action = APlayerAdd
     
    221221          Left = 120
    222222          Height = 25
    223           Top = 613
     223          Top = 617
    224224          Width = 83
    225225          Action = APlayerModify
     
    230230          Left = 224
    231231          Height = 25
    232           Top = 613
     232          Top = 617
    233233          Width = 83
    234234          Action = APlayerRemove
     
    240240    object TabSheetMap: TTabSheet
    241241      Caption = 'Map'
    242       ClientHeight = 651
    243       ClientWidth = 743
     242      ClientHeight = 655
     243      ClientWidth = 739
    244244      object Panel1: TPanel
    245245        Left = 0
    246         Height = 651
     246        Height = 655
    247247        Top = 0
    248         Width = 743
     248        Width = 739
    249249        Align = alClient
    250250        BevelOuter = bvNone
    251         ClientHeight = 651
    252         ClientWidth = 743
     251        ClientHeight = 655
     252        ClientWidth = 739
    253253        TabOrder = 0
    254254        object Label1: TLabel
     
    270270        object SpinEditMapSizeX: TSpinEdit
    271271          Left = 128
    272           Height = 36
     272          Height = 43
    273273          Top = 4
    274274          Width = 98
     
    280280        object SpinEditMapSizeY: TSpinEdit
    281281          Left = 128
    282           Height = 36
     282          Height = 43
    283283          Top = 55
    284284          Width = 98
     
    290290        object TrackBarSizeX: TTrackBar
    291291          Left = 240
    292           Height = 47
     292          Height = 58
    293293          Top = 8
    294           Width = 492
     294          Width = 488
    295295          Max = 100
    296296          Min = 2
     
    303303        object TrackBarSizeY: TTrackBar
    304304          Left = 240
    305           Height = 47
     305          Height = 58
    306306          Top = 49
    307           Width = 492
     307          Width = 488
    308308          Max = 100
    309309          Min = 2
     
    324324        object ComboBoxGridType: TComboBox
    325325          Left = 146
    326           Height = 36
     326          Height = 42
    327327          Top = 104
    328328          Width = 208
     
    340340        object ComboBoxMapShape: TComboBox
    341341          Left = 146
    342           Height = 36
     342          Height = 42
    343343          Top = 144
    344344          Width = 208
     
    365365          Height = 27
    366366          Top = 110
    367           Width = 255
     367          Width = 251
    368368          Anchors = [akTop, akLeft, akRight]
    369369          AutoSize = False
     
    373373        object SpinEditVoidPercent: TSpinEdit
    374374          Left = 216
    375           Height = 36
     375          Height = 43
    376376          Top = 224
    377377          Width = 106
     
    384384          Height = 30
    385385          Top = 232
    386           Width = 187
     386          Width = 189
    387387          Caption = 'Inaccessible places'
    388388          OnChange = CheckBoxVoidChange
     
    393393          Height = 30
    394394          Top = 272
    395           Width = 71
     395          Width = 73
    396396          Caption = 'Cities'
    397397          OnChange = CheckBoxCityChange
     
    400400        object SpinEditCityPercent: TSpinEdit
    401401          Left = 216
    402           Height = 36
     402          Height = 43
    403403          Top = 272
    404404          Width = 106
     
    425425        object SpinEditNeutralUnits: TSpinEdit
    426426          Left = 408
    427           Height = 36
     427          Height = 43
    428428          Top = 384
    429429          Width = 98
     
    442442        object EditImageFile: TEdit
    443443          Left = 144
    444           Height = 36
     444          Height = 43
    445445          Top = 184
    446           Width = 476
     446          Width = 472
    447447          Anchors = [akTop, akLeft, akRight]
    448448          TabOrder = 12
    449449        end
    450450        object ButtonImageBrowse: TButton
    451           Left = 628
     451          Left = 624
    452452          Height = 25
    453453          Top = 192
     
    470470          Height = 30
    471471          Top = 310
    472           Width = 210
     472          Width = 212
    473473          Caption = 'Bridges between cells'
    474474          TabOrder = 14
     
    476476        object SpinEditMaxPower: TSpinEdit
    477477          Left = 408
    478           Height = 36
     478          Height = 43
    479479          Top = 344
    480480          Width = 98
     
    497497          Height = 27
    498498          Top = 137
    499           Width = 255
     499          Width = 251
    500500          Anchors = [akTop, akLeft, akRight]
    501501          AutoSize = False
     
    507507    object TabSheetRules: TTabSheet
    508508      Caption = 'Rules'
    509       ClientHeight = 651
    510       ClientWidth = 743
     509      ClientHeight = 655
     510      ClientWidth = 739
    511511      object Panel4: TPanel
    512512        Left = 0
    513         Height = 651
     513        Height = 655
    514514        Top = 0
    515         Width = 743
     515        Width = 739
    516516        Align = alClient
    517517        BevelOuter = bvNone
    518         ClientHeight = 651
    519         ClientWidth = 743
     518        ClientHeight = 655
     519        ClientWidth = 739
    520520        TabOrder = 0
    521521        object RadioGroupGrowCells: TRadioGroup
     
    533533          ChildSizing.Layout = cclLeftToRightThenTopToBottom
    534534          ChildSizing.ControlsPerLine = 1
    535           ClientHeight = 77
    536           ClientWidth = 308
     535          ClientHeight = 78
     536          ClientWidth = 310
    537537          Items.Strings = (
    538538            'None'
     
    552552        object ComboBoxWinObjective: TComboBox
    553553          Left = 224
    554           Height = 36
     554          Height = 38
    555555          Top = 244
    556556          Width = 328
     
    580580          ChildSizing.Layout = cclLeftToRightThenTopToBottom
    581581          ChildSizing.ControlsPerLine = 1
    582           ClientHeight = 48
    583           ClientWidth = 301
     582          ClientHeight = 49
     583          ClientWidth = 303
    584584          Items.Strings = (
    585585            'By one'
     
    592592          Height = 30
    593593          Top = 24
    594           Width = 113
     594          Width = 115
    595595          Caption = 'Fog of war'
    596596          TabOrder = 3
     
    600600          Height = 78
    601601          Top = 290
    602           Width = 720
     602          Width = 716
    603603          ActivePage = TabSheetCaptureCities
    604604          Anchors = [akTop, akLeft, akRight]
     
    611611          end
    612612          object TabSheetCaptureCells: TTabSheet
    613             ClientHeight = 72
    614             ClientWidth = 714
     613            ClientHeight = 74
     614            ClientWidth = 706
    615615            object Label14: TLabel
    616616              Left = 8
     
    633633          end
    634634          object TabSheetStayAliveTurns: TTabSheet
    635             ClientHeight = 72
    636             ClientWidth = 714
     635            ClientHeight = 74
     636            ClientWidth = 706
    637637            object Label13: TLabel
    638638              Left = 8
     
    659659          Height = 30
    660660          Top = 62
    661           Width = 360
     661          Width = 362
    662662          Caption = 'Set cells without player units as neutral'
    663663          TabOrder = 5
  • 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.