CvPlayer::GetBuyPlotCost() const
- Defined in
- CvPlayer.cpp, line 26539
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_GetBuyPlotCost
Hooks
static bool BeforeCvPlayer_GetBuyPlotCost(const CvPlayer* self, int& result);static void AfterCvPlayer_GetBuyPlotCost(const CvPlayer* self, int& result);static int ReplaceCvPlayer_GetBuyPlotCost(int (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_GetBuyPlotCost>(host, &BeforeCvPlayer_GetBuyPlotCost);CivRegisterAfter<CivHooks::CvPlayer_GetBuyPlotCost>(host, &AfterCvPlayer_GetBuyPlotCost);CivRegisterReplace<CivHooks::CvPlayer_GetBuyPlotCost>(host, &ReplaceCvPlayer_GetBuyPlotCost);
Code
26538/// Gold cost of buying a new Plot26539int CvPlayer::GetBuyPlotCost() const26540{26541 int iCost = /*50*/ GC.getPLOT_BASE_COST();26542 iCost += (/*5*/ GC.getPLOT_ADDITIONAL_COST_PER_PLOT() * GetNumPlotsBought());2654326544 // Cost Mod (Policies, etc.)26545 if(GetPlotGoldCostMod() != 0)26546 {26547 iCost *= (100 + GetPlotGoldCostMod());26548 iCost /= 100;26549 }2655026551 if(isMinorCiv())26552 {26553 iCost *= /*200*/ GC.getMINOR_CIV_GOLD_PERCENT();26554 iCost /= 100;26555 }2655626557 return iCost;26558}