Ignore:
Timestamp:
Jul 14, 2018, 7:21:43 PM (6 years ago)
Author:
chronos
Message:
  • Modified: CellMoves moved from terrain map to player map. Every player should have own moves to avoid affecting moves of different player.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormClient.pas

    r222 r223  
    8585    procedure DoNextPlayer(Sender: TObject);
    8686    procedure DoTurnStart(Sender: TObject);
    87     procedure DoMove(CellFrom, CellTo: TCell; var CountOnce,
     87    procedure DoMove(CellFrom, CellTo: TPlayerCell; var CountOnce,
    8888      CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
    8989    procedure SetToolbarHints;
     
    129129end;
    130130
    131 procedure TFormClient.DoMove(CellFrom, CellTo: TCell; var CountOnce,
     131procedure TFormClient.DoMove(CellFrom, CellTo: TPlayerCell; var CountOnce,
    132132  CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
    133133var
     
    146146    FormMove.TrackBarRepeat.Max := FormMove.SpinEditRepeat.MaxValue;
    147147    FormMove.TrackBarRepeat.Position := FormMove.SpinEditRepeat.Value;
    148     FormMove.DefendCount := CellTo.Power;
     148    FormMove.DefendCount := CellTo.MapCell.Power;
    149149    // Attack count from other surrounding cells without current move if already exists
    150150    FormMove.AttackCount := 0;
     
    152152    if TUnitMove(CellTo.MovesTo[I]).CellFrom <> CellFrom then
    153153      FormMove.AttackCount := FormMove.AttackCount + TUnitMove(CellTo.MovesTo[I]).CountOnce;
    154     FormMove.ShowWinProbability := CellTo.Player <> CellFrom.Player;
     154    FormMove.ShowWinProbability := CellTo.MapCell.Player <> CellFrom.MapCell.Player;
    155155
    156156    if FormMove.ShowModal = mrOk then begin
     
    456456  Y: Integer);
    457457var
    458   Cell: TCell;
    459   OldCell: TCell;
     458  Cell: TPlayerCell;
     459  OldCell: TPlayerCell;
    460460  CellPos: TPoint;
    461461begin
     
    473473    OldCell := Client.View.FocusedCell;
    474474    with Core.Game do
    475       Cell := Map.PosToCell(Client.View.CanvasToCellPos(TPoint.Create(X, Y)), Client.View);
     475      if Assigned(Client.ControlPlayer) then
     476        Cell := Client.ControlPlayer.PlayerMap.PosToCell(Client.View.CanvasToCellPos(TPoint.Create(X, Y)), Client.View);
     477        //else Cell := Client.Game.Map.PosToCell(Client.View.CanvasToCellPos(TPoint.Create(X, Y)), Client.View);
    476478    if Assigned(Cell) then begin
    477479      Client.View.FocusedCell := Cell;
    478       StatusBar1.Panels[0].Text := '[' + IntToStr(Cell.PosPx.X) + ', ' + IntToStr(Cell.PosPx.Y) +
    479         '] (' + IntToStr(Cell.MovesFrom.Count) + ', ' + IntToStr(Cell.MovesTo.Count) + ') ' + IntToStr(Cell.Id);
     480      StatusBar1.Panels[0].Text := '[' + IntToStr(Cell.MapCell.PosPx.X) + ', ' + IntToStr(Cell.MapCell.PosPx.Y) +
     481        '] (' + IntToStr(Cell.MovesFrom.Count) + ', ' + IntToStr(Cell.MovesTo.Count) + ') ' + IntToStr(Cell.MapCell.Id);
    480482    end else begin
    481483      Client.View.FocusedCell := nil;
Note: See TracChangeset for help on using the changeset viewer.