Hooks
static bool BeforeCvDiplomacyAI_LogWarmongerThreat(CvDiplomacyAI* self, CvString& strString, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_LogWarmongerThreat(CvDiplomacyAI* self, CvString& strString, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_LogWarmongerThreat(void (*original)(CvDiplomacyAI*, CvString&, PlayerTypes), CvDiplomacyAI* self, CvString& strString, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_LogWarmongerThreat>(host, &BeforeCvDiplomacyAI_LogWarmongerThreat);CivRegisterAfter<CivHooks::CvDiplomacyAI_LogWarmongerThreat>(host, &AfterCvDiplomacyAI_LogWarmongerThreat);CivRegisterReplace<CivHooks::CvDiplomacyAI_LogWarmongerThreat>(host, &ReplaceCvDiplomacyAI_LogWarmongerThreat);
Code
27247/// Log Warmonger Threat27248void CvDiplomacyAI::LogWarmongerThreat(CvString& strString, PlayerTypes ePlayer)27249{27250 CvString strTemp;2725127252 // Don't fill out this field for Minors, as it just makes the log harder to read27253 if(GET_PLAYER(ePlayer).isMinorCiv())27254 {27255 strTemp.Format(",");27256 }27257 else27258 {27259 switch(GetWarmongerThreat(ePlayer))27260 {27261 case THREAT_CRITICAL:27262 strTemp.Format("W_THT CRIT, %d/%d", GetOtherPlayerWarmongerAmount(ePlayer), GetOtherPlayerWarmongerScore(ePlayer));27263 break;27264 case THREAT_SEVERE:27265 strTemp.Format("W_THT SEVR, %d/%d", GetOtherPlayerWarmongerAmount(ePlayer), GetOtherPlayerWarmongerScore(ePlayer));27266 break;27267 case THREAT_MAJOR:27268 strTemp.Format("W_THT MAJR, %d/%d", GetOtherPlayerWarmongerAmount(ePlayer), GetOtherPlayerWarmongerScore(ePlayer));27269 break;27270 case THREAT_MINOR:27271 strTemp.Format("W_THT MINR, %d/%d", GetOtherPlayerWarmongerAmount(ePlayer), GetOtherPlayerWarmongerScore(ePlayer));27272 break;27273 case THREAT_NONE:27274 strTemp.Format("W_THT NONE, %d/%d", GetOtherPlayerWarmongerAmount(ePlayer), GetOtherPlayerWarmongerScore(ePlayer));27275 break;27276 default:27277 strTemp.Format("W_THT XXXX, %d/%d", GetOtherPlayerWarmongerAmount(ePlayer), GetOtherPlayerWarmongerScore(ePlayer));27278 break;27279 }27280 }2728127282 strString += ", " + strTemp;27283}