CvUnit::sellExoticGoods()
- Defined in
- CvUnit.cpp, line 7398
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_sellExoticGoods
Hooks
static bool BeforeCvUnit_sellExoticGoods(CvUnit* self, bool& result);static void AfterCvUnit_sellExoticGoods(CvUnit* self, bool& result);static bool ReplaceCvUnit_sellExoticGoods(bool (*original)(CvUnit*), CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_sellExoticGoods>(host, &BeforeCvUnit_sellExoticGoods);CivRegisterAfter<CivHooks::CvUnit_sellExoticGoods>(host, &AfterCvUnit_sellExoticGoods);CivRegisterReplace<CivHooks::CvUnit_sellExoticGoods>(host, &ReplaceCvUnit_sellExoticGoods);
Code
7398bool CvUnit::sellExoticGoods()7399{7400 if (canSellExoticGoods(plot()))7401 {7402 int iXP = getExoticGoodsXPAmount();7403 int iGold = getExoticGoodsGoldAmount();7404#if defined(MOD_UNITS_XP_TIMES_100)7405 changeExperienceTimes100(iXP * 100);7406#else7407 changeExperience(iXP);7408#endif7409 GET_PLAYER(getOwner()).GetTreasury()->ChangeGold(iGold);7410 char text[256] = {0};7411 sprintf_s(text, "[COLOR_YELLOW]+%d[ENDCOLOR][ICON_GOLD]", iGold);7412#if defined(SHOW_PLOT_POPUP)7413 SHOW_PLOT_POPUP(plot(), getOwner(), text, 0.0f);7414#else7415 float fDelay = 0.0f;7416 DLLUI->AddPopupText(getX(), getY(), text, fDelay);7417#endif74187419 changeNumExoticGoods(-1);7420 }7421 return false;7422}
Calls
- CvPlayer::GetTreasury() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvPlot::showPopupText(PlayerTypes, const char *)
- CvTreasury::ChangeGold(int)
- CvUnit::canSellExoticGoods(const CvPlot *, bool) const
- CvUnit::changeExperienceTimes100(int, int, bool, bool, bool)
- CvUnit::changeNumExoticGoods(int)
- CvUnit::getExoticGoodsGoldAmount()
- CvUnit::getExoticGoodsXPAmount()
- CvUnit::getOwner() const
- CvUnit::plot() const
sprintf_s