einheit action true if tokens >0

This commit is contained in:
xxsoca 2023-06-23 09:08:20 +02:00
parent 35e75e86b4
commit 98bff63c20
2 changed files with 11 additions and 2 deletions

2
gui.pl
View File

@ -63,6 +63,7 @@ choose_units :-
send(D, open). send(D, open).
%TODO delete
change_cell_content(T, Row, Col, NewContent) :- change_cell_content(T, Row, Col, NewContent) :-
get(T, cell, Row, Col, Cell), get(T, cell, Row, Col, Cell),
send(Cell, free), send(Cell, free),
@ -305,6 +306,7 @@ process_move_unit(FromX, FromY, ToX, ToY, Controls) :-
update_controls, update_controls,
spielfeld. spielfeld.
%TODO delete
test_change :- test_change :-
new(D, dialog), new(D, dialog),
new(T, tabular), new(T, tabular),

View File

@ -115,8 +115,15 @@ einheit_action(Xold, Yold, Xnew, Ynew) :-
einheit_attack(Xold, Yold, Xnew, Ynew) einheit_attack(Xold, Yold, Xnew, Ynew)
), ),
end_turn,!. (
current_player(Player),
player_tokens(Player, Tokens),
\+ Tokens > 0,
end_turn,
!
;
true
).
einheit_alive(AP, HP, HPnew, HPmult) :- einheit_alive(AP, HP, HPnew, HPmult) :-
% berechnen der differenz nach anwenden des multplikators % berechnen der differenz nach anwenden des multplikators