Bazaar developer reference

CvUnit::DoCultureBomb()

Defined in
CvUnit.cpp, line 9774
Class
CvUnit
Hook name
CivHooks::CvUnit_DoCultureBomb

Hooks

static bool BeforeCvUnit_DoCultureBomb(CvUnit* self, bool& result);static void AfterCvUnit_DoCultureBomb(CvUnit* self, bool& result);static bool ReplaceCvUnit_DoCultureBomb(bool (*original)(CvUnit*), CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_DoCultureBomb>(host, &BeforeCvUnit_DoCultureBomb);CivRegisterAfter<CivHooks::CvUnit_DoCultureBomb>(host, &AfterCvUnit_DoCultureBomb);CivRegisterReplace<CivHooks::CvUnit_DoCultureBomb>(host, &ReplaceCvUnit_DoCultureBomb);

Code

9774bool CvUnit::DoCultureBomb()9775{9776	// can we actually do this?9777	CvPlot* pThisPlot = plot();9778	if(!CanCultureBomb(pThisPlot))9779		return false;97809781	CvUnitEntry *pkUnitEntry = GC.getUnitInfo(getUnitType());9782	if (pkUnitEntry)9783	{9784		// Cooldown9785		int iCooldown = /*10*/ GC.getCULTURE_BOMB_COOLDOWN();97869787		CvPlayerAI& kPlayer = GET_PLAYER(getOwner());9788		kPlayer.changeCultureBombTimer(iCooldown);97899790		PerformCultureBomb(pkUnitEntry->GetCultureBombRadius());97919792		if(pThisPlot->isActiveVisible(false))9793		{9794			auto_ptr<ICvUnit1> pDllUnit(new CvDllUnit(this));9795			gDLL->GameplayUnitActivate(pDllUnit.get());9796		}97979798		if(IsGreatPerson())9799		{9800#if defined(MOD_EVENTS_GREAT_PEOPLE)9801			kPlayer.DoGreatPersonExpended(getUnitType(), this);9802#else9803			kPlayer.DoGreatPersonExpended(getUnitType());9804#endif9805		}98069807		kill(true);98089809		return true;9810	}98119812	return false;9813}

Calls

Called by