Exemplo n.º 1
0
Arquivo: csbb.cpp Projeto: Siile/CSTT
void CGameControllerCSBB::RoundRewards(int WinningTeam)
{
	for (int i = 0; i < MAX_CLIENTS; i++)
	{
		CPlayer *pPlayer = GameServer()->m_apPlayers[i];
		if(!pPlayer)
			continue;

		if (pPlayer->GetTeam() == WinningTeam)
			pPlayer->AddMoney(g_Config.m_SvWinMoney);
		else
			pPlayer->AddMoney(g_Config.m_SvLoseMoney);
	}
	
	//GameServer()->SwapTeams();
	GameServer()->ResetVotes();
}
Exemplo n.º 2
0
/*
 * PlayerVisit : when player visit this unit
 */
void COrchardUnit::PlayerVisit(CPlayer &player)
{
	if(player.GetIdentifier() == owner_)	
	{
		if(state_ != 4) /* can't harvest */
		{
			cout << "Do you want to SEEDING this Unit?(y/n) ";
			char choice;
			cin >> choice;
			if(choice == 'y')
			{
				player.AddMoney(-1 * seeding_price_);
				state_++;
				cout << "Spend " << seeding_price_ << " for SEEDING..... ";
			}

		}	
		else /* can harvest */
		{