Changeset 72 for trunk/UCore.pas


Ignore:
Timestamp:
Sep 28, 2014, 9:21:26 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: Unit move win probability was bad calculated if already existed move was modified.
  • Added: Easier close of unit move dialog by Escape or Enter key.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r68 r72  
    8181procedure TCore.DoOnMove(CellFrom, CellTo: TCell; var CountOnce,
    8282  CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);
     83var
     84  I: Integer;
    8385begin
    8486  if Update then FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower + CountOnce
     
    9294  FormMove.TrackBarRepeat.Position := FormMove.SpinEditRepeat.Value;
    9395  FormMove.DefendCount := CellTo.Power;
    94   FormMove.AttackCount := CellTo.GetAttackPower;
     96  // Attack count from other surrounding cells without current move if already exists
     97  FormMove.AttackCount := 0;
     98  for I := 0 to CellTo.MovesTo.Count - 1 do
     99  if TUnitMove(CellTo.MovesTo[I]).CellFrom <> CellFrom then
     100    FormMove.AttackCount := FormMove.AttackCount + TUnitMove(CellTo.MovesTo[I]).CountOnce;
    95101  FormMove.ShowWinProbability := CellTo.Player <> CellFrom.Player;
     102
    96103  if FormMove.ShowModal = mrOk then begin
    97104    CountOnce := FormMove.SpinEditOnce.Value;
Note: See TracChangeset for help on using the changeset viewer.