Changeset 183 for trunk/UCore.pas
- Timestamp:
- Feb 9, 2018, 10:33:18 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r182 r183 67 67 procedure DoPlayerChange(Sender: TObject); 68 68 procedure DoMoveUpdated(UnitMove: TUnitMove); 69 procedure DoOnMove(CellFrom, CellTo: TCell; var CountOnce,70 CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);71 69 procedure DoOnWin(Player: TPlayer); 72 70 procedure Delay(Time: Integer); … … 106 104 107 105 uses 108 UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, UFormPlayer,106 UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, 109 107 UFormHelp, UFormCharts, UFormUnitMoves, UFormPlayersStats; 110 108 … … 123 121 124 122 { TCore } 125 126 procedure TCore.DoOnMove(CellFrom, CellTo: TCell; var CountOnce,127 CountRepeat: Integer; Update: Boolean; var Confirm: Boolean);128 var129 I: Integer;130 begin131 if Update then FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower + CountOnce132 else FormMove.SpinEditOnce.MaxValue := CellFrom.GetAvialPower;133 FormMove.SpinEditOnce.Value := CountOnce;134 FormMove.TrackBarOnce.Max := FormMove.SpinEditOnce.MaxValue;135 FormMove.TrackBarOnce.Position := FormMove.SpinEditOnce.Value;136 FormMove.SpinEditRepeat.MaxValue := Game.Map.MaxPower;137 FormMove.SpinEditRepeat.Value := CountRepeat;138 FormMove.TrackBarRepeat.Max := FormMove.SpinEditRepeat.MaxValue;139 FormMove.TrackBarRepeat.Position := FormMove.SpinEditRepeat.Value;140 FormMove.DefendCount := CellTo.Power;141 // Attack count from other surrounding cells without current move if already exists142 FormMove.AttackCount := 0;143 for I := 0 to CellTo.MovesTo.Count - 1 do144 if TUnitMove(CellTo.MovesTo[I]).CellFrom <> CellFrom then145 FormMove.AttackCount := FormMove.AttackCount + TUnitMove(CellTo.MovesTo[I]).CountOnce;146 FormMove.ShowWinProbability := CellTo.Player <> CellFrom.Player;147 148 if FormMove.ShowModal = mrOk then begin149 CountOnce := FormMove.SpinEditOnce.Value;150 CountRepeat := FormMove.SpinEditRepeat.Value;151 Confirm := True;152 end else Confirm := False;153 end;154 123 155 124 procedure TCore.DoOnWin(Player: TPlayer); … … 401 370 begin 402 371 UGame.InitStrings; 403 FormPlayer.Translate;404 372 end; 405 373 … … 408 376 Server := TServer.Create; 409 377 Game := TGame.Create; 410 Game.OnMove := DoOnMove;411 378 Game.OnMoveUpdated := DoMoveUpdated; 412 379 Game.OnWin := DoOnWin; … … 485 452 Form.AZoomAll.Execute; 486 453 Form.Show; 454 FormClients.Add(Form); 487 455 end; 488 456
Note:
See TracChangeset
for help on using the changeset viewer.