stolenrays
Deity
- Joined
- Aug 2, 2009
- Messages
- 2,061
I'd like to make it so that Missionaries gain XP after spreading their religion. I'm still learning SDK, so I'd appreciate any suggestions. I figure I'd have to add some info in the CvCity.cpp file and then any relevant corresponding .cpp/.h files. I've been messing around with it any used super spies as an example, but I really am unsure of how to do it.
CvCity.cpp Code:
CvCity.cpp Code:
Spoiler :
Code:
void CvCity::setHasReligion(ReligionTypes eIndex, bool bNewValue, bool bAnnounce, bool bArrows)
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumReligionInfos(), "eIndex expected to be < GC.getNumReligionInfos()");
PlayerTypes eTargetPlayer = plot()->getOwnerINLINE();
if (isHasReligion(eIndex) != bNewValue)
{
for (int iVoteSource = 0; iVoteSource < GC.getNumVoteSourceInfos(); ++iVoteSource)
{
processVoteSourceBonus((VoteSourceTypes)iVoteSource, false);
}
m_pabHasReligion[eIndex] = bNewValue;
for (int iVoteSource = 0; iVoteSource < GC.getNumVoteSourceInfos(); ++iVoteSource)
{
processVoteSourceBonus((VoteSourceTypes)iVoteSource, true);
}
GET_PLAYER(getOwnerINLINE()).changeHasReligionCount(eIndex, ((isHasReligion(eIndex)) ? 1 : -1));
updateMaintenance();
updateReligionHappiness();
updateReligionCommerce();
AI_setAssignWorkDirty(true);
setInfoDirty(true);
if (isHasReligion(eIndex))
{
GC.getGameINLINE().makeReligionFounded(eIndex, getOwnerINLINE());
if (bAnnounce)
{
if (GC.getGameINLINE().getHolyCity(eIndex) != this)
{
for (int iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
{
if (isRevealed(GET_PLAYER((PlayerTypes)iI).getTeam(), false))
{
if ((getOwnerINLINE() == iI) || (GET_PLAYER((PlayerTypes)iI).getStateReligion() == eIndex) || GET_PLAYER((PlayerTypes)iI).hasHolyCity(eIndex))
{
CvWString szBuffer = gDLL->getText("TXT_KEY_MISC_RELIGION_SPREAD", GC.getReligionInfo(eIndex).getTextKeyWide(), getNameKey());
gDLL->getInterfaceIFace()->addMessage(((PlayerTypes)iI), false, GC.getDefineINT("EVENT_MESSAGE_TIME_LONG"), szBuffer, GC.getReligionInfo(eIndex).getSound(), MESSAGE_TYPE_MAJOR_EVENT, GC.getReligionInfo(eIndex).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_WHITE"), getX_INLINE(), getY_INLINE(), bArrows, bArrows);
}
//TSHEEP Give spies xp for successful missions
awardMissionaryExperience(GET_PLAYER(eTargetPlayer).getTeam(),GC.getReligionInfo(eIndex));
//TSHEEP end
}