Exemplo n.º 1
0
void cScoreboard::SetDisplay(const AString & a_Objective, eDisplaySlot a_Slot)
{
	ASSERT(a_Slot < dsCount);

	cObjective * Objective = GetObjective(a_Objective);

	SetDisplay(Objective, a_Slot);
}
Exemplo n.º 2
0
/************************************************************************************************
 * CRMRandomInstance::Spawn
 *	Spawns the instance onto the landscape
 *
 * inputs:
 *  landscape: landscape object this instance will be spawned on
 *
 * return:
 *	true: spawn successful
 *  false: spawn failed
 *
 ************************************************************************************************/
bool CRMRandomInstance::Spawn ( CRandomTerrain* terrain, qboolean IsServer )
{
	mInstance->SetObjective(GetObjective());
	mInstance->SetSide(GetSide());

	if ( !mInstance->Spawn ( terrain, IsServer ) )
	{
		return false;
	}

	return true;
}
Exemplo n.º 3
0
void CASW_Game_Resource::FindObjectives()
{
	// search through all entities and populate the objectives array
	m_NumObjectives = 0;

	FindObjectivesOfClass("asw_objective_dummy");
	FindObjectivesOfClass("asw_objective_kill_eggs");
	FindObjectivesOfClass("asw_objective_destroy_goo");
	FindObjectivesOfClass("asw_objective_triggered");
	FindObjectivesOfClass("asw_objective_escape");
	FindObjectivesOfClass("asw_objective_survive");
	FindObjectivesOfClass("asw_objective_countdown");
	FindObjectivesOfClass("asw_objective_kill_aliens");
	
	// bubble sort objectives by their Y coord
	CASW_Objective* pObjective;
	//for (int k=0;k<m_NumObjectives-1;k++)
	//{
		//Msg("Objective %d has coord %f and title %s\n", k, GetObjective(k)->GetAbsOrigin().y, 
				//GetObjective(k)->m_ObjectiveTitle);
	//}
	for (int i=0;i<m_NumObjectives;i++)
	{
		for (int j=i+1; j<m_NumObjectives; j++)
		{
			if (GetObjective(j)->GetAbsOrigin().y > GetObjective(i)->GetAbsOrigin().y)
			{
				//Msg("Swapping %d (%f) with %d (%f)\n", i, GetObjective(i)->GetAbsOrigin().y,
					//j, GetObjective(j)->GetAbsOrigin().y);
				pObjective = GetObjective(j);
				m_Objectives.Set(j, GetObjective(i));
				m_Objectives.Set(i, pObjective);
			}
		}
	}
}
Exemplo n.º 4
0
void UObjectiveQuestReward::GiveReward(AMech_RPGCharacter* questOwner)
{
	GetOwningQuest()->AddObjective(GetObjective());
	Super::GiveReward(questOwner);
}