CvDealAI::GetPeaceTreatyValue(PlayerTypes)
- Defined in
- CvDealAI.cpp, line 1956
- Class
- CvDealAI
- Hook name
CivHooks::CvDealAI_GetPeaceTreatyValue
Hooks
static bool BeforeCvDealAI_GetPeaceTreatyValue(CvDealAI* self, PlayerTypes eOtherPlayer, int& result);static void AfterCvDealAI_GetPeaceTreatyValue(CvDealAI* self, PlayerTypes eOtherPlayer, int& result);static int ReplaceCvDealAI_GetPeaceTreatyValue(int (*original)(CvDealAI*, PlayerTypes), CvDealAI* self, PlayerTypes eOtherPlayer);CivRegisterBefore<CivHooks::CvDealAI_GetPeaceTreatyValue>(host, &BeforeCvDealAI_GetPeaceTreatyValue);CivRegisterAfter<CivHooks::CvDealAI_GetPeaceTreatyValue>(host, &AfterCvDealAI_GetPeaceTreatyValue);CivRegisterReplace<CivHooks::CvDealAI_GetPeaceTreatyValue>(host, &ReplaceCvDealAI_GetPeaceTreatyValue);
Code
1955/// How much is a Peace Treaty worth?1956int CvDealAI::GetPeaceTreatyValue(PlayerTypes eOtherPlayer)1957{1958 DEBUG_VARIABLE(eOtherPlayer);19591960 CvAssertMsg(GetPlayer()->GetID() != eOtherPlayer, "DEAL_AI: Trying to check value of a Peace Treaty with oneself. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");19611962 return 0;19631964 // DEPRECATED19651966 //int iItemValue = 500;19671968 //// What I think me giving up peace is worth to them (if we're winning "our peace" is more valuable)1969 //if (bFromMe)1970 //{1971 // if (GetPlayer()->GetDiplomacyAI()->IsWantsPeaceWithPlayer(eOtherPlayer))1972 // {1973 // iItemValue = 200;1974 // }1975 //}1976 //// What I think them agreeing to peace with me is worth (if they're winning "their peace" is more valuable)1977 //else1978 //{1979 // if (GET_PLAYER(eOtherPlayer).GetDiplomacyAI()->IsWantsPeaceWithPlayer(GetPlayer()->GetID()))1980 // {1981 // iItemValue = 200;1982 // }1983 //}19841985 //// Are we trying to find the middle point between what we think this item is worth and what another player thinks it's worth?1986 //if (bUseEvenValue)1987 //{1988 // iItemValue += GET_PLAYER(eOtherPlayer).GetDealAI()->GetPeaceTreatyValue(!bFromMe, GetPlayer()->GetID(), /*bUseEvenValue*/ false);19891990 // iItemValue /= 2;1991 //}19921993 //return iItemValue;1994}