CvResolutionEffects::AddOngoingEffects(const CvResolutionEffects *)
- Defined in
- CvVotingClasses.cpp, line 305
- Class
- CvResolutionEffects
- Hook name
CivHooks::CvResolutionEffects_AddOngoingEffects
Hooks
static bool BeforeCvResolutionEffects_AddOngoingEffects(CvResolutionEffects* self, const CvResolutionEffects* pOtherEffects);static void AfterCvResolutionEffects_AddOngoingEffects(CvResolutionEffects* self, const CvResolutionEffects* pOtherEffects);static void ReplaceCvResolutionEffects_AddOngoingEffects(void (*original)(CvResolutionEffects*, const CvResolutionEffects*), CvResolutionEffects* self, const CvResolutionEffects* pOtherEffects);CivRegisterBefore<CivHooks::CvResolutionEffects_AddOngoingEffects>(host, &BeforeCvResolutionEffects_AddOngoingEffects);CivRegisterAfter<CivHooks::CvResolutionEffects_AddOngoingEffects>(host, &AfterCvResolutionEffects_AddOngoingEffects);CivRegisterReplace<CivHooks::CvResolutionEffects_AddOngoingEffects>(host, &ReplaceCvResolutionEffects_AddOngoingEffects);
Code
302// Used to sum multiple CvResolutionEffects and reflect them in a single struct.303// Some information may be incomplete (ex. trade embargo which targets a player304// chosen by proposer), so client should track additional information as necessary.305void CvResolutionEffects::AddOngoingEffects(const CvResolutionEffects* pOtherEffects)306{307 if (!pOtherEffects->HasOngoingEffects())308 return;309310 iGoldPerTurn += pOtherEffects->iGoldPerTurn;311 iResourceQuantity += pOtherEffects->iResourceQuantity; // target resource312 bEmbargoCityStates |= pOtherEffects->bEmbargoCityStates;313 bEmbargoPlayer |= pOtherEffects->bEmbargoPlayer; // target player314 bNoResourceHappiness |= pOtherEffects->bNoResourceHappiness; // target resource315 iUnitMaintenanceGoldPercent += pOtherEffects->iUnitMaintenanceGoldPercent;316 iMemberDiscoveredTechMod += pOtherEffects->iMemberDiscoveredTechMod;317 iCulturePerWonder += pOtherEffects->iCulturePerWonder;318 iCulturePerNaturalWonder += pOtherEffects->iCulturePerNaturalWonder;319 bNoTrainingNuclearWeapons |= pOtherEffects->bNoTrainingNuclearWeapons;320 iVotesForFollowingReligion += pOtherEffects->iVotesForFollowingReligion; // target religion321 iHolyCityTourism += pOtherEffects->iHolyCityTourism; // target religion322 iReligionSpreadStrengthMod += pOtherEffects->iReligionSpreadStrengthMod; // target religion323 iVotesForFollowingIdeology += pOtherEffects->iVotesForFollowingIdeology; // target ideology324 iOtherIdeologyRebellionMod += pOtherEffects->iOtherIdeologyRebellionMod; // target ideology325 iArtsyGreatPersonRateMod += pOtherEffects->iArtsyGreatPersonRateMod;326 iScienceyGreatPersonRateMod += pOtherEffects->iScienceyGreatPersonRateMod;327 iGreatPersonTileImprovementCulture += pOtherEffects->iGreatPersonTileImprovementCulture;328 iLandmarkCulture += pOtherEffects->iLandmarkCulture;329}