% ##############
% # Player 
% ##############
/**
 @descr asks player, at which field he wants to go.
 @form playerMove(+PossibleTiles)b
 */
playerTaoMove(PossibleTiles):-
	currentPlayer(ID),
	changeEvent(move),
	query(ID,get_player_move(PossibleTiles)).

/**
 @descr asks palyer what to do next, fight or use village power	
 @form playerDoNext
 */
playerTaoDoNext(Pos,FieldList) :-
	currentPlayer(ID),
	changeEvent(doNext),
	query(ID,do_next([Pos|FieldList])).

/**
 @descr from: qiYY - 
 asks current player, if he wants to take a Qi-Point or gets his YY back
 @form playerSelectTaoMarker
 */
playerSelectQiOrYY :-
	currentPlayer(ID),
	changeEvent(ghostDoContinue),
	query(ID,selectQiOrYY).

/**
 @descr inform next taoist, it is her/his turn
 @form playerChangeCurrent
 */
playerChangeCurrent :-
	currentPlayer(ID),
	query(ID,set_this_player(ID)).

% ##############
% # Ghost 
% ##############

/**
 @descr asks player, at which field the ghost shoud be placed.
 @form playerSelectField(+FieldList)
 */
playerGhostPlace(GhostID,FieldList) :-
	currentPlayer(ID),
	changeEvent(placeGhost),
	query(ID,get_ghost_placement(FieldList,GhostID)).

/**
 @descr asks player wich ghost he/she wants to attack
 @form playerGhostSelect(FieldList)
 */
playerGhostSelect(FieldList) :-
	currentPlayer(ID),
	changeEvent(ghostSelect),
	query(ID,ghostSelect(FieldList)).

/**
 @descr asks player to select colors for white dice and
 tao markers to defend a ghost
 @form playerChooseMarkers(Resistance,WhiteDice,TaoMarkers)
 */
playerChooseMarkers(List,WhiteDice,TaoMarkers,GhostID) :-
	currentPlayer(ID),
	changeEvent(chooseMarkers),
	query(ID,choose_markers(List,WhiteDice,TaoMarkers,GhostID)).

/**
 @descr from: anyTao / anyTwoTao - 
 asks current player, which Tao-Marker he wants to take/lose
 @form playerSelectGhostTaoMarker(+TaoMarkerList)
 */
playerSelectGhostTaoMarker(Action) :-
	setBuffer(Action),
	currentPlayer(ID),
	changeEvent(chooseOneMarker),
	query(ID,choose_tao_marker).

playerSelectTaoist(PlayerList) :-
	currentPlayer(ID),
	changeEvent(selectTaoist),
	query(ID,choose_player(PlayerList)).

% ##############
% # Village
% ##############

/**
 @descr from: exorcismAid (Gebetskreis) / taoChiGhost (Teehaus) / anyTao / anyTwoTao - 
 asks current player, which Tao-Marker he wants to take
 @form playerSelectVillageTaoMarker(+TaoMarkerList)
 */
playerSelectVillageTaoMarker(Action) :-
	setBuffer(Action),
	currentPlayer(ID),
	changeEvent(chooseOneMarker),
	query(ID,choose_tao_marker).

playerSelectGhostVillage(FieldList) :-
	currentPlayer(ID),
	changeEvent(village),
	query(ID,select_ghost_village(FieldList)).

/**
 @descr from: unhauntVillage (Altar of Taoists) - asks current player, which village he wants to unhaunt
 @form playerUnhauntVillage(+TileList)
 */
playerUnhauntVillage(TileList) :-
	currentPlayer(ID),
	changeEvent(village),
	query(ID,select_villagefield(TileList)).

/**
 @descr from: movePlayerGhost (Pavillon der Himmlischen Winde) - asks current player, which ghost and other taoist he wants to move
 @form playerMoveGhostPlayer(+GhostList,+FreeList,+PlayerList+,TargetList)
 */
playerMoveGhostPlayer(GhostList,FreeList,PlayerList,TargetList) :-
	currentPlayer(ID),
	changeEvent(village),
	query(ID,moveGhostPlayer(GhostList,FreeList,PlayerList,TargetList)).

/**
 @descr from: ressurect (Graveyard) - asks current player, which taoist he wants to ressurect
 @form playerRessurectPlayer(+PlayerList)
 */
playerRessurectPlayer(PlayerList) :-
	currentPlayer(Player),
	changeEvent(chooseTaoist),
	query(Player,choose_player(PlayerList)).

/**
 @descr from: exorcise (House of witch) - asks current player, which ghost he wants to exorcise
 @form playerExorcise(+GhostList)
 */
playerExorcise(GhostList) :-
	currentPlayer(ID),
	changeEvent(village),
	query(ID,exorcise(GhostList)).

/**
 @descr from: resetHaunters (Turm des Nachtwächters) - asks current player, which haunter-group he wants to reset
 @form playerResetHaunters(+GhostList)
 */
playerResetHaunters(GhostList) :-
	currentPlayer(ID),
	changeEvent(village),
	query(ID, resetHaunters(GhostList)).

% ##############
% # Buddha
% ##############
	
/**
 @descr asks player if he/she wants to place a buddha
 */
playerBuddhaPlace(FieldList,BuddhaID) :-
	currentPlayer(ID),
	changeEvent(placeBuddha),
	query(ID,get_buddha_placement(FieldList,BuddhaID)).

% ##############
% # Else
% ##############
 
/**
 @descr asks current player, with witch colors he wants to replace his white dice.
 @form playerWhiteDice(+WhiteDiceList)
 */
playerWhiteDice(WhiteDiceAmount) :-
	currentPlayer(ID),
	changeEvent(village),
	query(ID,whiteDice(WhiteDiceAmount)).

	
