CvMinorCivAI::GetBullyGoldAmount(PlayerTypes)
- Defined in
- CvMinorCivAI.cpp, line 8951
- Class
- CvMinorCivAI
- Hook name
CivHooks::CvMinorCivAI_GetBullyGoldAmount
Hooks
static bool BeforeCvMinorCivAI_GetBullyGoldAmount(CvMinorCivAI* self, PlayerTypes arg0, int& result);static void AfterCvMinorCivAI_GetBullyGoldAmount(CvMinorCivAI* self, PlayerTypes arg0, int& result);static int ReplaceCvMinorCivAI_GetBullyGoldAmount(int (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes arg0);CivRegisterBefore<CivHooks::CvMinorCivAI_GetBullyGoldAmount>(host, &BeforeCvMinorCivAI_GetBullyGoldAmount);CivRegisterAfter<CivHooks::CvMinorCivAI_GetBullyGoldAmount>(host, &AfterCvMinorCivAI_GetBullyGoldAmount);CivRegisterReplace<CivHooks::CvMinorCivAI_GetBullyGoldAmount>(host, &ReplaceCvMinorCivAI_GetBullyGoldAmount);
Code
8951int CvMinorCivAI::GetBullyGoldAmount(PlayerTypes /*eBullyPlayer*/)8952{8953 int iGold = GC.getMINOR_BULLY_GOLD();8954 int iGoldGrowthFactor = 350; //antonjs: todo: XML89558956 // Add gold, more if later in game8957 float fGameProgressFactor = ((float) GC.getGame().getElapsedGameTurns() / (float) GC.getGame().getEstimateEndTurn());8958 CvAssertMsg(fGameProgressFactor >= 0.0f, "fGameProgressFactor is not expected to be negative! Please send Anton your save file and version.");8959 if(fGameProgressFactor > 1.0f)8960 fGameProgressFactor = 1.0f;89618962 iGold += (int)(fGameProgressFactor * iGoldGrowthFactor);89638964 // UA, SP Mods89658966 // Game Speed Mod8967 iGold *= GC.getGame().getGameSpeedInfo().getGoldGiftMod(); //antonjs: consider: separate XML8968 iGold /= 100;89698970 // Rounding8971 int iVisibleDivisor = /*5*/ GC.getMINOR_CIV_GOLD_GIFT_VISIBLE_DIVISOR(); //antonjs: consider: separate XML8972 iGold /= iVisibleDivisor;8973 iGold *= iVisibleDivisor;89748975 return iGold;8976}