Bazaar developer reference

CvAchievementUnlocker::AlexanderConquest(PlayerTypes)

Defined in
CvAchievementUnlocker.cpp, line 71
Class
CvAchievementUnlocker
Hook name
CivHooks::CvAchievementUnlocker_AlexanderConquest

Hooks

static bool BeforeCvAchievementUnlocker_AlexanderConquest(PlayerTypes ePlayer);static void AfterCvAchievementUnlocker_AlexanderConquest(PlayerTypes ePlayer);static void ReplaceCvAchievementUnlocker_AlexanderConquest(void (*original)(PlayerTypes), PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvAchievementUnlocker_AlexanderConquest>(host, &BeforeCvAchievementUnlocker_AlexanderConquest);CivRegisterAfter<CivHooks::CvAchievementUnlocker_AlexanderConquest>(host, &AfterCvAchievementUnlocker_AlexanderConquest);CivRegisterReplace<CivHooks::CvAchievementUnlocker_AlexanderConquest>(host, &ReplaceCvAchievementUnlocker_AlexanderConquest);

Code

71void CvAchievementUnlocker::AlexanderConquest(PlayerTypes ePlayer)72{73#if !defined(NO_ACHIEVEMENTS)74	//Test For Alexander Conquest75	CvGame& kGame = GC.getGame();76	if (ePlayer == kGame.getActivePlayer())77	{78		CvString szLeaderName = (CvString)GET_PLAYER(ePlayer).getLeaderTypeKey();79		if(szLeaderName == "LEADER_ALEXANDER")80		{81			if(kGame.getGameTurnYear() <= 350)82			{83				for(int iPlayerLoop = 0; iPlayerLoop < MAX_PLAYERS; iPlayerLoop++)84				{85					CvPlayer* pPlayer = &GET_PLAYER((PlayerTypes) iPlayerLoop);8687					//All known players must be dead and killed by us88					if(GET_TEAM(pPlayer->getTeam()).isHasMet(GET_PLAYER(kGame.getActivePlayer()).getTeam()))89					{90						if(!pPlayer->isBarbarian() && !pPlayer->isMinorCiv())91						{92							if(pPlayer->isAlive() && pPlayer->GetID() != GET_PLAYER(kGame.getActivePlayer()).GetID())93							{94								return;	// Nope.95							}96						}97					}98				}99				// Yep.100				gDLL->UnlockAchievement(ACHIEVEMENT_SPECIAL_CONQUEST_WORLD);101			}102		}103	}104#endif105}