void CvPlayer::setCivics(CivicOptionTypes eIndex, CivicTypes eNewValue)
{
CvWString szBuffer;
CivicTypes eOldCivic;
int iI;
FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
FAssertMsg(eIndex < GC.getNumCivicOptionInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");
FAssertMsg(eNewValue >= 0, "eNewValue is expected to be non-negative (invalid Index)");
FAssertMsg(eNewValue < GC.getNumCivicInfos(), "eNewValue is expected to be within maximum bounds (invalid Index)");
eOldCivic = getCivics(eIndex);
if (eOldCivic != eNewValue)
{
m_paeCivics[eIndex] = eNewValue;
if (eOldCivic != NO_CIVIC)
{
processCivics(eOldCivic, -1);
}
if (getCivics(eIndex) != NO_CIVIC)
{
processCivics(getCivics(eIndex), 1);
}
GC.getGameINLINE().updateSecretaryGeneral();
GC.getGameINLINE().AI_makeAssignWorkDirty();
if (GC.getGameINLINE().isFinalInitialized())
{
if (gDLL->isDiplomacy() && (gDLL->getDiplomacyPlayer() == getID()))
{
gDLL->updateDiplomacyAttitude(true);
}
/************************************************************************************************/
/* REVOLUTION_MOD 04/28/08 jdog5000 */
/* */
/* */
/************************************************************************************************/
/*
if (!isBarbarian())
*/
// Silence announcement for civs that are not alive, ie rebel civs who may not be born
// and also for minor civs
if (!isBarbarian() && !isMinorCiv() && isAlive())
/************************************************************************************************/
/* REVOLUTION_MOD END */
/************************************************************************************************/
{
if (getCivics(eIndex) != NO_CIVIC)
{
if (getCivics(eIndex) != GC.getCivilizationInfo(getCivilizationType()).getCivilizationInitialCivics(eIndex))
{
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
{
if (GET_TEAM(getTeam()).isHasMet(GET_PLAYER((PlayerTypes)iI).getTeam()))
{
szBuffer = gDLL->getText("TXT_KEY_MISC_PLAYER_ADOPTED_CIVIC", getNameKey(), GC.getCivicInfo(getCivics(eIndex)).getTextKeyWide());
gDLL->getInterfaceIFace()->addMessage(((PlayerTypes)iI), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MAJOR_EVENT);
}
}
}
szBuffer = gDLL->getText("TXT_KEY_MISC_PLAYER_ADOPTED_CIVIC", getNameKey(), GC.getCivicInfo(getCivics(eIndex)).getTextKeyWide());
GC.getGameINLINE().addReplayMessage(REPLAY_MESSAGE_MAJOR_EVENT, getID(), szBuffer);
}
[COLOR="SeaGreen"]// < ZLATKO RECONSTRUCTION START > EXPERIMENT[/COLOR]
[COLOR="Red"]GC.getCivilizationInfo(getCivilizationType()).setArtStyleType(2);[/COLOR]
[COLOR="SeaGreen"]// < ZLATKO RECONSTRUCTION END >[/COLOR]
}
}
}
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 09/03/09 poyuzhe & jdog5000 */
/* */
/* Efficiency */
/************************************************************************************************/
// From Sanguo Mod Performance, ie the CAR Mod
// Attitude cache
for (int iI = 0; iI < MAX_PLAYERS; iI++)
{
GET_PLAYER(getID()).AI_invalidateAttitudeCache((PlayerTypes)iI);
GET_PLAYER((PlayerTypes)iI).AI_invalidateAttitudeCache(getID());
}
/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/
}
}