Bazaar developer reference

CvTreasury::GetBuildingGoldMaintenance() const

Defined in
CvTreasury.cpp, line 740
Class
CvTreasury
Hook name
CivHooks::CvTreasury_GetBuildingGoldMaintenance

Hooks

static bool BeforeCvTreasury_GetBuildingGoldMaintenance(const CvTreasury* self, int& result);static void AfterCvTreasury_GetBuildingGoldMaintenance(const CvTreasury* self, int& result);static int ReplaceCvTreasury_GetBuildingGoldMaintenance(int (*original)(const CvTreasury*), const CvTreasury* self);CivRegisterBefore<CivHooks::CvTreasury_GetBuildingGoldMaintenance>(host, &BeforeCvTreasury_GetBuildingGoldMaintenance);CivRegisterAfter<CivHooks::CvTreasury_GetBuildingGoldMaintenance>(host, &AfterCvTreasury_GetBuildingGoldMaintenance);CivRegisterReplace<CivHooks::CvTreasury_GetBuildingGoldMaintenance>(host, &ReplaceCvTreasury_GetBuildingGoldMaintenance);

Code

739/// What are our gold maintenance costs because of Buildings?740int CvTreasury::GetBuildingGoldMaintenance() const741{742	int iMaintenance = GetBaseBuildingGoldMaintenance();743744	// Player modifier745	iMaintenance *= (100 + m_pPlayer->GetBuildingGoldMaintenanceMod());746	iMaintenance /= 100;747748	// Modifier for difficulty level749	CvHandicapInfo& playerHandicap = m_pPlayer->getHandicapInfo();750	//iMaintenance *= playerHandicap->getBuildingCostPercent();751	//iMaintenance /= 100;752753	// Human bonus for Building maintenance costs754	if(m_pPlayer->isHuman())755	{756		iMaintenance *= playerHandicap.getBuildingCostPercent();757		iMaintenance /= 100;758	}759	// AI bonus for Building maintenance costs760	else if(!m_pPlayer->IsAITeammateOfHuman())761	{762		iMaintenance *= GC.getGame().getHandicapInfo().getAIBuildingCostPercent();763		iMaintenance /= 100;764	}765766	// Start Era mod767	iMaintenance *= GC.getGame().getStartEraInfo().getBuildingMaintenancePercent();768	iMaintenance /= 100;769770	return iMaintenance;771}

Calls

Called by