All pastes #334873 Raw Edit

aurel

public text v1 · immutable
#334873 ·published 2007-01-31 23:05 UTC
rendered paste body
bool Game::Attack(PLAYER *p1, PLAYER *p2, int x , int y,bool attack , int type)
{
	
	if(p1->IsCaseEmpty(x,y) && !p2->IsCaseEmpty(x,y))
	{
		cout << "reussi" << endl;


		Character *Piece;

		Piece=p1->CanMove(x,y,attack);

		cout << Piece->getX_position<<endl;

		if(p1->MayGoTo(Piece,x,y)&& p2->MayGoTo(Piece,x,y))
		{
			cout << "mouvement possible" << Piece->getType() << endl;

			Piece->setX_position(x);
			Piece->setY_position(y);
			p1->ModifyChar(Piece);
			p2->RemoveChar(x,y);
			return true;
		}
	}
	return false;
}