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:52:31 +02:00
|
|
|
einheit_move(Player, Xold, Yold, Xnew, Ynew) :-
|
2023-05-22 15:56:32 +02:00
|
|
|
% Die Einheit entfernen
|
|
|
|
retract( einheit_active(Player, Type, Xold, Yold) ),
|
|
|
|
|
|
|
|
% Die Einheit an die neue Position setzen
|
2023-05-22 16:37:59 +02:00
|
|
|
assert( einheit_active(Player, Type, Xnew, Ynew) ),
|
|
|
|
|
|
|
|
% Errechnen der verbleibenden Tokens
|
|
|
|
retract( player_tokens(Player, Tokens) ),
|
2023-05-22 16:52:31 +02:00
|
|
|
% die berechnung muss noch mal angeschaut werden
|
|
|
|
TokensNew is Tokens - (Xold - Xnew) - (Xold - Ynew),
|
2023-05-22 16:37:59 +02:00
|
|
|
assert( player_tokens(Player, TokensNew) ).
|