2023-05-22 15:31:21 +02:00
|
|
|
% hier kommt der ganze logik bums hin
|
|
|
|
|
|
|
|
% globalen Turncounter
|
|
|
|
|
|
|
|
player_turn(Player) :-
|
|
|
|
|
|
|
|
% calculate action points
|
2023-05-22 15:56:32 +02:00
|
|
|
calc_action_points(Player, Turncounter),
|
2023-05-22 15:31:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
% further logic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% save remaining ap
|
2023-05-22 15:56:32 +02:00
|
|
|
save_action_points(Player).
|
|
|
|
|
|
|
|
|
|
|
|
% Bewegt die Einheit des Spielers an position Xold, Yold
|
|
|
|
% um Xmove, Ymove in die jeweilige Richtung
|
2023-05-22 16:22:08 +02:00
|
|
|
einheit_move(Player, Xold, Yold, Xmove, Ymove) :-
|
2023-05-22 15:56:32 +02:00
|
|
|
% Die Einheit entfernen
|
|
|
|
retract( einheit_active(Player, Type, Xold, Yold) ),
|
|
|
|
|
|
|
|
% Neue position berechnen
|
|
|
|
Xnew is Xold + Xmove,
|
|
|
|
Ynew is Yold + Ymove,
|
|
|
|
|
|
|
|
% Die Einheit an die neue Position setzen
|
|
|
|
assert( einheit_active(Player, Type, Xnew, Ynew) ).
|