CvDiplomacyAI::GetMajorCivOpinionWeight(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 2420
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetMajorCivOpinionWeight
Hooks
static bool BeforeCvDiplomacyAI_GetMajorCivOpinionWeight(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetMajorCivOpinionWeight(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetMajorCivOpinionWeight(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetMajorCivOpinionWeight>(host, &BeforeCvDiplomacyAI_GetMajorCivOpinionWeight);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetMajorCivOpinionWeight>(host, &AfterCvDiplomacyAI_GetMajorCivOpinionWeight);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetMajorCivOpinionWeight>(host, &ReplaceCvDiplomacyAI_GetMajorCivOpinionWeight);
Code
2419// What is the number value of our opinion towards ePlayer?2420int CvDiplomacyAI::GetMajorCivOpinionWeight(PlayerTypes ePlayer)2421{2422 int iOpinionWeight = 0;24232424 //////////////////////////////////////2425 // How nasty am I?2426 //////////////////////////////////////2427 int iHostility = GetPersonalityMajorCivApproachBias(MAJOR_CIV_APPROACH_HOSTILE);2428 int iFriendliness = GetPersonalityMajorCivApproachBias(MAJOR_CIV_APPROACH_FRIENDLY);2429 iOpinionWeight += (iHostility - iFriendliness) * 2;24302431 iOpinionWeight += GetLandDisputeLevelScore(ePlayer);2432 iOpinionWeight += GetWonderDisputeLevelScore(ePlayer);2433 iOpinionWeight += GetMinorCivDisputeLevelScore(ePlayer);2434 iOpinionWeight += GetWarmongerThreatScore(ePlayer);24352436 //////////////////////////////////////2437 // Player has done nice stuff2438 //////////////////////////////////////2439 iOpinionWeight += GetCiviliansReturnedToMeScore(ePlayer);2440 iOpinionWeight += GetLandmarksBuiltForMeScore(ePlayer);2441 iOpinionWeight += GetResurrectedScore(ePlayer);2442 iOpinionWeight += GetLiberatedCitiesScore(ePlayer);2443 iOpinionWeight += GetEmbassyScore(ePlayer);2444 iOpinionWeight += GetForgaveForSpyingScore(ePlayer);2445 iOpinionWeight += GetTimesIntrigueSharedScore(ePlayer);24462447 //////////////////////////////////////2448 // Player has asked us to do stuff we don't like2449 //////////////////////////////////////2450 iOpinionWeight += GetNoSetterRequestScore(ePlayer);2451 iOpinionWeight += GetStopSpyingRequestScore(ePlayer);2452 iOpinionWeight += GetDemandEverMadeScore(ePlayer);2453 iOpinionWeight += GetTimesCultureBombedScore(ePlayer);2454 iOpinionWeight += GetReligiousConversionPointsScore(ePlayer);24552456 iOpinionWeight += GetHasAdoptedHisReligionScore(ePlayer);2457 iOpinionWeight += GetHasAdoptedMyReligionScore(ePlayer);2458 2459 iOpinionWeight += GetSameLatePoliciesScore(ePlayer);2460 iOpinionWeight += GetDifferentLatePoliciesScore(ePlayer);2461 2462 //iOpinionWeight += GetTimesNukedScore(ePlayer); DUPLICATE of GetNukedScore below. Removing this from scoring.2463 iOpinionWeight += GetTimesRobbedScore(ePlayer);24642465 //////////////////////////////////////2466 // BROKEN PROMISES ;_;2467 //////////////////////////////////////2468 iOpinionWeight += GetBrokenMilitaryPromiseScore(ePlayer);2469 iOpinionWeight += GetBrokenMilitaryPromiseWithAnybodyScore(ePlayer);2470 iOpinionWeight += GetIgnoredMilitaryPromiseScore(ePlayer);2471 iOpinionWeight += GetBrokenExpansionPromiseScore(ePlayer);2472 iOpinionWeight += GetIgnoredExpansionPromiseScore(ePlayer);2473 iOpinionWeight += GetBrokenBorderPromiseScore(ePlayer);2474 iOpinionWeight += GetIgnoredBorderPromiseScore(ePlayer);24752476 iOpinionWeight += GetBrokenAttackCityStatePromiseScore(ePlayer);2477 iOpinionWeight += GetBrokenAttackCityStatePromiseWithAnybodyScore(ePlayer);2478 iOpinionWeight += GetIgnoredAttackCityStatePromiseScore(ePlayer);24792480 iOpinionWeight += GetBrokenBullyCityStatePromiseScore(ePlayer);2481 iOpinionWeight += GetIgnoredBullyCityStatePromiseScore(ePlayer);24822483 iOpinionWeight += GetBrokenNoConvertPromiseScore(ePlayer);2484 iOpinionWeight += GetIgnoredNoConvertPromiseScore(ePlayer);24852486 iOpinionWeight += GetBrokenNoDiggingPromiseScore(ePlayer);2487 iOpinionWeight += GetIgnoredNoDiggingPromiseScore(ePlayer);24882489 iOpinionWeight += GetBrokenSpyPromiseScore(ePlayer);2490 iOpinionWeight += GetIgnoredSpyPromiseScore(ePlayer);24912492 iOpinionWeight += GetBrokenCoopWarPromiseScore(ePlayer);24932494 //////////////////////////////////////2495 // PROTECTED MINORS2496 //////////////////////////////////////2497 iOpinionWeight += GetAngryAboutProtectedMinorKilledScore(ePlayer);2498 iOpinionWeight += GetAngryAboutProtectedMinorAttackedScore(ePlayer);2499 iOpinionWeight += GetAngryAboutProtectedMinorBulliedScore(ePlayer);25002501 //////////////////////////////////////2502 // BULLIED MINORS2503 //////////////////////////////////////2504 iOpinionWeight += GetAngryAboutSidedWithProtectedMinorScore(ePlayer);25052506 //////////////////////////////////////2507 // DECLARATION OF FRIENDSHIP2508 //////////////////////////////////////2509 iOpinionWeight += GetDOFAcceptedScore(ePlayer);2510 iOpinionWeight += GetDOFWithAnyFriendScore(ePlayer);2511 iOpinionWeight += GetDOFWithAnyEnemyScore(ePlayer);25122513 //////////////////////////////////////2514 // FRIENDS NOT GETTING ALONG2515 //////////////////////////////////////25162517 // Beging TraitorOpinion bit2518 int iTraitorOpinion = GetFriendDenouncementScore(ePlayer);2519 iTraitorOpinion = max(iTraitorOpinion, GetWeDenouncedFriendScore(ePlayer));2520 iTraitorOpinion = max(iTraitorOpinion, GetFriendDenouncedUsScore(ePlayer));2521 iTraitorOpinion = max(iTraitorOpinion, GetWeDeclaredWarOnFriendScore(ePlayer));2522 iTraitorOpinion = max(iTraitorOpinion, GetFriendDeclaredWarOnUsScore(ePlayer));2523 iOpinionWeight += iTraitorOpinion;2524 // End TraitorOpinion bit25252526 //iOpinionWeight += GetRequestsRefusedScore(ePlayer);25272528 //////////////////////////////////////2529 // DENOUNCING2530 //////////////////////////////////////25312532 iOpinionWeight += GetDenouncedUsScore(ePlayer);2533 iOpinionWeight += GetDenouncedThemScore(ePlayer);2534 iOpinionWeight += GetDenouncedFriendScore(ePlayer);2535 iOpinionWeight += GetDenouncedEnemyScore(ePlayer);25362537 //////////////////////////////////////2538 // RECKLESS EXPANDER2539 //////////////////////////////////////2540 iOpinionWeight += GetRecklessExpanderScore(ePlayer);25412542 //////////////////////////////////////2543 // JUNE 2011 ADDITIONS2544 //////////////////////////////////////2545 iOpinionWeight += GetRecentTradeScore(ePlayer);2546 iOpinionWeight += GetCommonFoeScore(ePlayer);2547 iOpinionWeight += GetRecentAssistScore(ePlayer);25482549 iOpinionWeight += GetNukedByScore(ePlayer);2550 iOpinionWeight += GetCapitalCapturedByScore(ePlayer);25512552 iOpinionWeight += GetGaveAssistanceToScore(ePlayer);2553 iOpinionWeight += GetPaidTributeToScore(ePlayer);25542555 //////////////////////////////////////2556 // XP22557 //////////////////////////////////////25582559 iOpinionWeight += GetLikedTheirProposalScore(ePlayer);2560 iOpinionWeight += GetDislikedTheirProposalScore(ePlayer);2561 iOpinionWeight += GetSupportedMyProposalScore(ePlayer);2562 iOpinionWeight += GetFoiledMyProposalScore(ePlayer);2563 iOpinionWeight += GetSupportedMyHostingScore(ePlayer);25642565 //////////////////////////////////////2566 // SCENARIO-SPECIFIC2567 //////////////////////////////////////2568#if defined(MOD_EVENTS_DIPLO_MODIFIERS)2569 std::vector<Opinion> aOpinions;2570 iOpinionWeight += GetDiploModifiers(ePlayer, aOpinions);2571#else2572 iOpinionWeight += GetScenarioModifier1(ePlayer);2573 iOpinionWeight += GetScenarioModifier2(ePlayer);2574 iOpinionWeight += GetScenarioModifier3(ePlayer);2575#endif25762577 return iOpinionWeight;2578}
Calls
- CvDiplomacyAI::GetAngryAboutProtectedMinorAttackedScore(PlayerTypes)
- CvDiplomacyAI::GetAngryAboutProtectedMinorBulliedScore(PlayerTypes)
- CvDiplomacyAI::GetAngryAboutProtectedMinorKilledScore(PlayerTypes)
- CvDiplomacyAI::GetAngryAboutSidedWithProtectedMinorScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenAttackCityStatePromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenAttackCityStatePromiseWithAnybodyScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenBorderPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenBullyCityStatePromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenCoopWarPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenExpansionPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenMilitaryPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenMilitaryPromiseWithAnybodyScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenNoConvertPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenNoDiggingPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetBrokenSpyPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetCapitalCapturedByScore(PlayerTypes)
- CvDiplomacyAI::GetCiviliansReturnedToMeScore(PlayerTypes)
- CvDiplomacyAI::GetCommonFoeScore(PlayerTypes)
- CvDiplomacyAI::GetDemandEverMadeScore(PlayerTypes)
- CvDiplomacyAI::GetDenouncedEnemyScore(PlayerTypes)
- CvDiplomacyAI::GetDenouncedFriendScore(PlayerTypes)
- CvDiplomacyAI::GetDenouncedThemScore(PlayerTypes)
- CvDiplomacyAI::GetDenouncedUsScore(PlayerTypes)
- CvDiplomacyAI::GetDifferentLatePoliciesScore(PlayerTypes)
- CvDiplomacyAI::GetDiploModifiers(PlayerTypes, std::vector<Opinion> &)
- CvDiplomacyAI::GetDislikedTheirProposalScore(PlayerTypes)
- CvDiplomacyAI::GetDOFAcceptedScore(PlayerTypes)
- CvDiplomacyAI::GetDOFWithAnyEnemyScore(PlayerTypes)
- CvDiplomacyAI::GetDOFWithAnyFriendScore(PlayerTypes)
- CvDiplomacyAI::GetEmbassyScore(PlayerTypes)
- CvDiplomacyAI::GetFoiledMyProposalScore(PlayerTypes)
- CvDiplomacyAI::GetForgaveForSpyingScore(PlayerTypes)
- CvDiplomacyAI::GetFriendDeclaredWarOnUsScore(PlayerTypes)
- CvDiplomacyAI::GetFriendDenouncedUsScore(PlayerTypes)
- CvDiplomacyAI::GetFriendDenouncementScore(PlayerTypes)
- CvDiplomacyAI::GetGaveAssistanceToScore(PlayerTypes)
- CvDiplomacyAI::GetHasAdoptedHisReligionScore(PlayerTypes)
- CvDiplomacyAI::GetHasAdoptedMyReligionScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredAttackCityStatePromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredBorderPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredBullyCityStatePromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredExpansionPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredMilitaryPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredNoConvertPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredNoDiggingPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetIgnoredSpyPromiseScore(PlayerTypes)
- CvDiplomacyAI::GetLandDisputeLevelScore(PlayerTypes)
- CvDiplomacyAI::GetLandmarksBuiltForMeScore(PlayerTypes)
- CvDiplomacyAI::GetLiberatedCitiesScore(PlayerTypes)
- CvDiplomacyAI::GetLikedTheirProposalScore(PlayerTypes)
- CvDiplomacyAI::GetMinorCivDisputeLevelScore(PlayerTypes)
- CvDiplomacyAI::GetNoSetterRequestScore(PlayerTypes)
- CvDiplomacyAI::GetNukedByScore(PlayerTypes)
- CvDiplomacyAI::GetPaidTributeToScore(PlayerTypes)
- CvDiplomacyAI::GetPersonalityMajorCivApproachBias(MajorCivApproachTypes) const
- CvDiplomacyAI::GetRecentAssistScore(PlayerTypes)
- CvDiplomacyAI::GetRecentTradeScore(PlayerTypes)
- CvDiplomacyAI::GetRecklessExpanderScore(PlayerTypes)
- CvDiplomacyAI::GetReligiousConversionPointsScore(PlayerTypes)
- CvDiplomacyAI::GetResurrectedScore(PlayerTypes)
- CvDiplomacyAI::GetSameLatePoliciesScore(PlayerTypes)
- CvDiplomacyAI::GetStopSpyingRequestScore(PlayerTypes)
- CvDiplomacyAI::GetSupportedMyHostingScore(PlayerTypes)
- CvDiplomacyAI::GetSupportedMyProposalScore(PlayerTypes)
- CvDiplomacyAI::GetTimesCultureBombedScore(PlayerTypes)
- CvDiplomacyAI::GetTimesIntrigueSharedScore(PlayerTypes)
- CvDiplomacyAI::GetTimesRobbedScore(PlayerTypes)
- CvDiplomacyAI::GetWarmongerThreatScore(PlayerTypes)
- CvDiplomacyAI::GetWeDeclaredWarOnFriendScore(PlayerTypes)
- CvDiplomacyAI::GetWeDenouncedFriendScore(PlayerTypes)
- CvDiplomacyAI::GetWonderDisputeLevelScore(PlayerTypes)
std::maxstd::vector::vector