Adding new Resource Yields to Future Techs

Oops... I broke it...

Added some code to CvTeam.cpp, CvPlayer.cpp, CvPlayer.h, CvDLLWidgetData.cpp, CvDLLWidgetData.h, in addition to my original changes that got the 'Pedia working. BUt I tried to do too much at once, and now the game crashes when trying to start a new game, and even when mousing over the "Exit" button of the 'Pedia (accessed through the Main Menu).

So, here are my changes, all of them. Everything commented with "RichMod", I've been good about that...

(file removed, please see post #52)

Thanks!
 
Can't look at the actual source still (working out my own major glitches ;)), but it sounds like the error is in WidgetData if hover of the exit button of the pedia causes you issues.

While I am recompiling though I'll add some thoughts here.


First, I don't think you'll need to modify CvPlayer at all. Add your fields to CvTeam to track them, and then since you are making changes to the output of a city, just cut straight to CvCity.

Happiness and health already exist, right? So no need to worry about those ones. That leaves Food/Hammers/Commerce, which happen to all be Yields, so will be in the same place if we are lucky.


Looks like you might be able to just modify int CvCity::getYieldRate to account for the new yields. It would look something like this:

Current:
Code:
int CvCity::getYieldRate(YieldTypes eIndex) const
{
	return ((getBaseYieldRate(eIndex) * getBaseYieldRateModifier(eIndex)) / 100);
}

New:
Code:
int CvCity::getYieldRate(YieldTypes eIndex) const
{
    int iFutureYield = 0;
    if (eIndex == YIELD_PRODUCTION)
        iFutureYield = GET_TEAM(getTeam()).getFutureProduction();
    else if (eIndex == YIELD_COMMERCE)
        iFutureYield = GET_TEAM(getTeam()).getFutureCommerce();
    else if (eIndex == YIELD_FOOD)
        iFutureYield = GET_TEAM(getTeam()).getFutureFood();
	return (((getBaseYieldRate(eIndex) + iFutureYield) * getBaseYieldRateModifier(eIndex)) / 100);
}

Or if you used an Array to begin with in CvTeam:

Code:
int CvCity::getYieldRate(YieldTypes eIndex) const
{
	return (((getBaseYieldRate(eIndex) + GET_TEAM(getTeam()).getFutureYield(eIndex)) * getBaseYieldRateModifier(eIndex)) / 100);
}


For the moment, I would say ignore the widgets and python completely, just get the city to actually gain something, THEN worry about letting the display show what/why
 
While the values should be stored in CvTeam, I think you'll need to modify CvPlot to take them into consideration so that the player sees the correct yields on the map. That is why I suggested tracking the Financial trait: it adds commerce to tiles that is visible on the map and affects cities' yields.
 
I thought the intention was to modify per city, not per plot? Per plot would be pretty insanely powerful pretty quickly. Unless you mean to modify the plot of the city tile to show all the bonuses, but that still runs into an error that each plot can only show so much (I think 13?) of each yield type without causing a serious error (BUG would know more about it, one of them was semi-recently trying to get around the limit)
 
EF, thanks for the advice re: the Financial Trait, but it's not quite the effect I'm looking for... The Financial Trait will add one commerce to each tile, over the specified minimum. That's way too powerful for what I'm trying to do. I want just one commerce per city. It'll be far more subtle, perhaps too much so, but +1 :commerce: per tile, or even +1 for only tiles that're already producing over 5 or 6 commerce, will be too much. My goal with FutureCommerce is, for a civilization with 40 cities, for that civ as a whole to be netting 40 extra commerce per turn for each FutureCommerceTech learnt. 20 cities = 20 commerce, etc. Tying the function to plots will wind up with way more than that...

xienwolf, I will try starting over this weekend with no changes the the Widget file, and jump from CvTeam to CvCity. One question though (I feel like an utter noob): What's an array?
 
I assumed per-plot bonuses, but per-city is a lot more balanced. :) Therefore, go with what xienwolf was saying about adding the check to CvCity.getYieldRate().

An array is another term for a list: a collection of values that can be indexed with an integer. They are often fixed in size, but this isn't a requirement.

Examples of an array would be a deck of 52 cards or a 5-card poker hand. In those cases the index carries no significance beyond locating the position in the list.

In Civ4, arrays of often used for storing values tied to lists of things. The total yield for a city is a list of yields, one per yield type. Thus the yield type becomes the index into the array of yield values.

In C++ you use square brackets [] to access the individual elements of an array. There are plenty of examples in the SDK of using arrays to store values for yield types. The advantage to using an array is that if someone added a new yield type, most of your code would work with it without any changes. The reason is that your code would refer to NUM_YIELD_TYPES instead of YIELD_PRODUCTION directly.

If you search the SDK code for NUM_YIELD_TYPES you'll see plenty of places where arrays are used and methods for accessing them correctly.

You would probably want to eventually change your XML from

Code:
<iFutureFood>1</iFutureFood>
<iFutureProduction>0</iFutureProduction>
<iFutureCommerce>0</iFutureCommerce>

to

Code:
<FutureYields>
    <iFood>1</iFood>
    <iProduction>0</iProduction>
    <iCommerce>0</iCommerce>
</FutureYields>

or something along those lines. I think that if you do that you can reuse some existing code to read the values directly into your array without referring to individual yield types, but I haven't looked into that.
 
The format would be for each one to just be called iYield if you wish to follow the trend, but the name doesn't actually matter at all once you get past the schema.


And yes, there are many functions you can reuse for loading Yields easily, and numerous examples you can look at for how to use an array of yields. If you search in CvInfos.cpp for NUM_YIELD_TYPES that will show you fairly quickly how to do everything you would need. But for the time being it might be best to remain with the simpler approach since you already have it designed halfway. Once it works nicely then you can learn how to use Arrays by re-writing all of this :)
 
Oooh... Ouch... Yes, please, let's stick with getting it cobbled together first. Once we have it working, then I can try to make it look pretty. But let me ask, does it save on processor time by using an array? Looking at what you wrote EF, it's definately cleaner to use an array, and easier too for a person to read, but I think the machine needs to do the same amount of work, so will it be worth the effort?
 
Using an array will be imperceptibly slower. With modern processors as fast as they are, developer time is far more precious than computing time.

Xienwolf's suggestions of a) getting it up and working first and b) adding each small change individually are spot on. Working code trumps neat code, and if you get each small piece working, it will be easier to track down problems as you go.

There are ways to bridge the gap between the array and the individual field implementations. The main function that will be affected by your changes is CvCity::getYieldRate(YieldType eYieldType). You currently have one function for each yield type that returns the extra yield. This will require getYieldRate() to test the yield type against the three types and call the correct function. All that will need to be recoded if you switch to an array.

Suggestion: move that code to a new function: CvTeam::getFutureYieldRate(YieldType eYieldType). Initially, it can do that same check of the yield type and return the correct field.

Code:
int CvTeam::getFutureYieldRate(YieldType eYieldType) const
{
	if (eYieldType == YieldType.YIELD_FOOD)
	{
		return m_iFutureFood;
	}
	else if (eYieldType == YieldType.YIELD_PRODUCTION)
	{
		return m_iFutureProduction;
	}
	else if (eYieldType == YieldType.YIELD_COMMERCE)
	{
		return m_iFutureCommerce;
	}
	else
	{
		// error, so throw an assertion error (need to check code)
		return 0
	}
}

When (if) you ever change over to using an array, the only function that changes is this new function.

Code:
int CvTeam::getFutureYieldRate(YieldType eYieldType) const
{
	// check that eYieldType is valid; grab from existing function
	// FASSERT_MSG(...)
	return m_aiFutureYield[eYieldType];
}

The one in CvCity won't need to change because it uses this function. This is the real power of creating short functions that do one simple task. If you change how that task needs to be done, all the other functions that use it won't need to change.

A side note: this may be useful for non-future techs, so perhaps rename it to "ExtraYield" instead of "FutureYield". Maybe you'll want to add +1:hammers: to some other tech like Industrialism or +1:food: to Electricity.
 
xienwolf, I finally had a chance to sit down with this again, and your suggestion for CvCity looks reasonable, so I confirmed the spelling and just copied it (preserving the original code of course). But trying to compile it, I get:

Code:
CvCity.cpp|7655|error C2039: 'getFutureProduction' : is not a member of 'CvTeamAI'|
CvCity.cpp|7657|error C2039: 'getFutureCommerce' : is not a member of 'CvTeamAI'|
CvCity.cpp|7659|error C2039: 'getFutureFood' : is not a member of 'CvTeamAI'|
||=== Build finished: 3 errors, 0 warnings ===|

I can't find anywhere in CvTeamAI, either the .cpp or the .h, to add in mention of my future yields... Don't even know what to look for actually...

I'm still trying, but I decided to write this first. Maybe I'll figure it out, but if not, maybe you or EF will have seen and answered this already...

Thanks again! :goodjob:
 
As long as the functions exist in CvTeam, you can use them from CvTeamAI just fine. But I am not quite certain why it is attempting to call there instead of directly to CvTeam. Did you define your functions in CvTeam already? (both cpp & h files)
 
Well, I've got them defined in CvTeam.cpp. Not quite sure where or how to add them in CvTeam.h, as none of other items in this FOR statement are listed in CvTeam.h...

Code:
for (iI = 0; iI < MAX_PLAYERS; iI++)
	{
		if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())
		{
			GET_PLAYER((PlayerTypes)iI).changeFeatureProductionModifier(GC.getTechInfo(eTech).getFeatureProductionModifier() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeWorkerSpeedModifier(GC.getTechInfo(eTech).getWorkerSpeedModifier() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeTradeRoutes(GC.getTechInfo(eTech).getTradeRoutes() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeExtraHealth(GC.getTechInfo(eTech).getHealth() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeExtraHappiness(GC.getTechInfo(eTech).getHappiness() * iChange);
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			// RichMod Start - Future Bonuses
			GET_PLAYER((PlayerTypes)iI).changeExtraFutureFood(GC.getTechInfo(eTech).getFutureFood() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeExtraFutureProduction(GC.getTechInfo(eTech).getFutureProduction() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeExtraFutureCommerce(GC.getTechInfo(eTech).getFutureCommerce() * iChange);
			// RichMod End - Future Bonuses
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			GET_PLAYER((PlayerTypes)iI).changeAssets(GC.getTechInfo(eTech).getAssetValue() * iChange);
			GET_PLAYER((PlayerTypes)iI).changePower(GC.getTechInfo(eTech).getPowerValue() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeTechScore(getTechScore(eTech) * iChange);
		}
	}


And looking at the header file again, why do some lines start with "DllExport"?
 
DllExport means that they are available for the .exe to use. So you don't need to add it to anything new you add to the DLL.

EDIT: Ignore this first part, I just realized what precisely was happening. You already know this bit.

Anytime that you add to the Cpp something which states:

___ CvTeam::_____(___)

Or whatever the current file you are working in, that means you must also state the item in the .h file. And any new variables you add to track data also need added to the .h files.


Easy example I can find would be "EverAliveCount" Just search for that and you'll find a variable m_iEverAliveCount, and 3 functions (get/change/is). Each of these are also defined in the .h file, and if you define yours in the same manner and rough location you'll be good to go.


It would probably be easier to use CvTeam directly rather than to load everything on each of the players during processTech. But if you want to keep with the Player loading (if it works, why bother changing now?), then just change to GET_PLAYER(getOwner()) instead of GET_TEAM(getTeam()) in the CvCity function.
 
OK... So, based on your prev suggestion, I had deleted my changes out of CvPlayer. I now see, this means of course that my lines in CvTeam.cpp shouldn't say GET_PLAYER, cause I have nothing in the Player files anymore. Duh, ok, I should have seen that before.

But changing the contents of CvCity.cpp to say GET_PLAYER(getOwner()) instead of GET_TEAM(getTeam()) , and reinstating my changes in CvPlayer.cpp & CvPlayer.h only changed the problem, not removed it, becuase now the error I get when compiling is:

Code:
CvCity.cpp|7655|error C2039: 'getFutureProduction' : is not a member of 'CvPlayerAI'|
CvCity.cpp|7657|error C2039: 'getFutureCommerce' : is not a member of 'CvPlayerAI'|
CvCity.cpp|7659|error C2039: 'getFutureFood' : is not a member of 'CvPlayerAI'|
||=== Build finished: 3 errors, 0 warnings ===|

So, I must be missing something basic here, but I haven't a clue what it is... I also can't find anywhere convenient in CvPlayerAI, .h or .cpp, where I could add mention of the FutureYields... -sigh-

Here're my changed files again... Thanks guys...
File removed. Please see post #52.
 
Ok, finally actually looking at your code :)


All the stuff in CvCity.cpp which is commented out can be ditched completely. Also the lines you added to CvCity.h can be dropped since you ditch the other parts.

Are your new Symbols working without issue? Haven't gotten around to adding more for myself just yet, but had understood it was a bit of a hassle long ago when I started out coding and read something about it. Anyway, you could access the normal food character directly by using:

(GC.getTechInfo(eTech).getFutureFood() > 0 ? GC.getYieldInfo(YIELD_FOOD).getChar() : gDLL->getSymbolID(BAD_FOOD_CHAR))


Same basic format for Production and whatnot as well. Might be best to create a red hammer icon for negative production, or just display a "-2 :production: in all cities" instead of using the angry face, would be easy to mis-translate that one.

You have a typo on the searchtag for ->Write function on the UpgradeCostmodifier, made me think the code would be broken since it didn't pop up on my search :) (RicMod instead of RichMod)



The only thing I see about your CvPlayer that I would change is that the DllExport is useless, so can be skipped, and your functions are NOT exposed to python, but comments can always be skipped anyway ;)


Try doing a complete recompile. Helped someone else recently, might be that one of the compilers out there is capable of not realizing that it needs to do such a thing when it ought to.
 
xienwolf, thanks again.

I have deleted the large section commented out of CvCity.cpp (lines 3507-3556) and the referencing material from CvCity.h (lines 580-586). It was leftover from when I first started trying to do this, and I commented it out when you made your first suggestion of just starting with CvGTM etc.

The Symbols work like a charm, it was nice and braindead to implement. ;) :D

Your choice of terms for food and production leaves me a little concerned that you might think I'm trying to set this up so that the FutureYields deduct Food/Prod/Comm from a city's output. I just want to be sure we're both on the same page, the goal is to add.

Fixed the RicMod typo on line 8113 of CvInfos.cpp. ;)

For the DLLExport, I think you meant CvInfos.h (lines 318-324). The DLLExport parts have been removed. I'll get to the Python exposing later I guess, if it becomes necessary.

Am starting a new compile from scratch. I've been using the method espoused by Kael here. Will see what happens and edit this post. Thanks again!

EDIT: Didn't work. Same error as in post #34, referring to lines 7603-7610 of CvCity.cpp... -sigh-
 
Nah, removing the DllExport and any comment tags is never required, I just like to let people know what they actually mean since it took me a while to figure it out when I started as well :)

Will see if I can figure something else out later today. It could be that the format of GET_PLAYER(getOwner()).____() is wrong, but I am reasonably certain that it is correct. Could be a simple typo issue that we are overlooking somewhere.
 
Decided to go through all the changes I've made so far, put them all together in one place side-by-side so that I could properly compare everything without having to flip back & forth between all the open files. Maybe this'll help... :crazyeye:

Spoiler :
Code:
CvGameTextMgr.h
line 121
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses
	DllExport void buildFutureFoodRateString( CvWStringBuffer& szBuffer, TechTypes eTech, bool bList = false, bool bPlayerContext = false );
	DllExport void buildFutureProductionRateString( CvWStringBuffer& szBuffer, TechTypes eTech, bool bList = false, bool bPlayerContext = false );
	DllExport void buildFutureCommerceRateString( CvWStringBuffer& szBuffer, TechTypes eTech, bool bList = false, bool bPlayerContext = false );
	// RichMod End - Future Bonuses
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvGameTextMgr.cpp
line 4939
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses 
	//	Food increase...
	buildFutureFoodRateString(szBuffer, eTech, true, bPlayerContext);
	
	//	Production increase...
	buildFutureProductionRateString(szBuffer, eTech, true, bPlayerContext);
	
	//	Commerce increase...
	buildFutureCommerceRateString(szBuffer, eTech, true, bPlayerContext);
	// RichMod End - Future Bonuses
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

line 9678
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// RichMod Start - Future Bonuses
void CvGameTextMgr::buildFutureFoodRateString(CvWStringBuffer &szBuffer, TechTypes eTech, bool bList, bool bPlayerContext)
{
	if (GC.getTechInfo(eTech).getFutureFood() != 0)
	{
		if (bList)
		{
			szBuffer.append(NEWLINE);
		}
		szBuffer.append(gDLL->getText("TXT_KEY_MISC_FUTUREFOOD_ALL_CITIES", abs(GC.getTechInfo(eTech).getFutureFood()), ((GC.getTechInfo(eTech).getFutureFood() > 0) ? gDLL->getSymbolID(FOOD2_CHAR): gDLL->getSymbolID(BAD_FOOD_CHAR))));
	}
}

void CvGameTextMgr::buildFutureProductionRateString(CvWStringBuffer &szBuffer, TechTypes eTech, bool bList, bool bPlayerContext)
{
	if (GC.getTechInfo(eTech).getFutureProduction() != 0)
	{
		if (bList)
		{
			szBuffer.append(NEWLINE);
		}
		szBuffer.append(gDLL->getText("TXT_KEY_MISC_FUTUREPRODUCTION_ALL_CITIES", abs(GC.getTechInfo(eTech).getFutureProduction()), ((GC.getTechInfo(eTech).getFutureProduction() > 0) ? gDLL->getSymbolID(PRODUCTION2_CHAR): gDLL->getSymbolID(ANGRYFACE_CHAR))));
	}
}

void CvGameTextMgr::buildFutureCommerceRateString(CvWStringBuffer &szBuffer, TechTypes eTech, bool bList, bool bPlayerContext)
{
	if (GC.getTechInfo(eTech).getFutureCommerce() != 0)
	{
		if (bList)
		{
			szBuffer.append(NEWLINE);
		}
		szBuffer.append(gDLL->getText("TXT_KEY_MISC_FUTURECOMMERCE_ALL_CITIES", abs(GC.getTechInfo(eTech).getFutureCommerce()), ((GC.getTechInfo(eTech).getFutureCommerce() > 0) ? gDLL->getSymbolID(COMMERCE2_CHAR): gDLL->getSymbolID(BAD_GOLD_CHAR))));
	}
}
// RichMod End - Future Bonuses
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvEnums.h
line 468
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses
	WIDGET_HELP_FUTUREFOOD_RATE,
	WIDGET_HELP_FUTUREPRODUCTION_RATE,
	WIDGET_HELP_FUTURECOMMERCE_RATE,
	// RichMod End - Future Bonuses
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CyEnumsInterface.cpp
line 317
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// RichMod Start - Future Bonuses
		.value("WIDGET_HELP_FUTUREFOOD_RATE", WIDGET_HELP_FUTUREFOOD_RATE)
		.value("WIDGET_HELP_FUTUREPRODUCTION_RATE", WIDGET_HELP_FUTUREPRODUCTION_RATE)
		.value("WIDGET_HELP_FUTURECOMMERCE_RATE", WIDGET_HELP_FUTURECOMMERCE_RATE)
		// RichMod End - Future Bonuses
		/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvInfos.h
line 318
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses
	int getFutureFood() const;								// Exposed to Python
	int getFutureProduction() const;								// Exposed to Python
	int getFutureCommerce() const;								// Exposed to Python
	// RichMod End - Future Bonuses
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

line 392
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses 
	int m_iFutureFood;
	int m_iFutureProduction;
	int m_iFutureCommerce;
	// RichMod End - Future Bonuses 
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvInfos.cpp
line 986
/////////////////////////////////////////////////////////////////////////////////
// RichMod Start - Future Bonuses 
m_iFutureFood(0),
m_iFutureProduction(0),
m_iFutureCommerce(0),
// RichMod End - Future Bonuses 
/////////////////////////////////////////////////////////////////////////////////

line 1108
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// RichMod Start - Future Bonuses 
int CvTechInfo::getFutureFood() const
{
	return m_iFutureFood;
}

int CvTechInfo::getFutureProduction() const
{
	return m_iFutureProduction;
}

int CvTechInfo::getFutureCommerce() const
{
	return m_iFutureCommerce;
}
// RichMod End - Future Bonuses 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

line 1333
	///////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses 
	stream->Read(&m_iFutureFood);
	stream->Read(&m_iFutureProduction);
	stream->Read(&m_iFutureCommerce);
	// RichMod End - Future Bonuses 
	///////////////////////////////////////////////////////////////////////////////////////////////////////////

line 1414
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses 
	stream->Write(m_iFutureFood);
	stream->Write(m_iFutureProduction);
	stream->Write(m_iFutureCommerce);
	// RichMod End - Future Bonuses 
	//////////////////////////////////////////////////////////////////////////////////////////////////////////////

line 1486
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// RichMod Start - Future Bonuses 
	pXML->GetChildXmlValByName(&m_iFutureFood, "iFutureFood");
	pXML->GetChildXmlValByName(&m_iFutureProduction, "iFutureProduction");
	pXML->GetChildXmlValByName(&m_iFutureCommerce, "iFutureCommerce");
	// RichMod End - Future Bonuses 
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvCity.h
NO CHANGES


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvCity.cpp
line 7591
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// RichMod Start - Future Bonuses
// 
// Original Code:
// int CvCity::getYieldRate(YieldTypes eIndex) const
// {
// 	return ((getBaseYieldRate(eIndex) * getBaseYieldRateModifier(eIndex)) / 100);
// }
// 
// New Code:
int CvCity::getYieldRate(YieldTypes eIndex) const
{
    int iFutureYield = 0;
    if (eIndex == YIELD_PRODUCTION)
        iFutureYield = GET_PLAYER(getOwner()).getFutureProduction();
    else if (eIndex == YIELD_COMMERCE)
        iFutureYield = GET_PLAYER(getOwner()).getFutureCommerce();
    else if (eIndex == YIELD_FOOD)
        iFutureYield = GET_PLAYER(getOwner()).getFutureFood();
	return (((getBaseYieldRate(eIndex) + iFutureYield) * getBaseYieldRateModifier(eIndex)) / 100);
}
// RichMod End - Future Bonuses
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvTeam.h
NO CHANGES


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CvTeam.cpp
line 5482
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			// RichMod Start - Future Bonuses
			GET_PLAYER((PlayerTypes)iI).changeExtraFutureFood(GC.getTechInfo(eTech).getFutureFood() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeExtraFutureProduction(GC.getTechInfo(eTech).getFutureProduction() * iChange);
			GET_PLAYER((PlayerTypes)iI).changeExtraFutureCommerce(GC.getTechInfo(eTech).getFutureCommerce() * iChange);
			// RichMod End - Future Bonuses
			/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

CyInfoInterface1.cpp
line 63
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		// RichMod Start - Future Bonuses
		.def("getFutureFood", &CvTechInfo::getFutureFood, "int ()")
		.def("getFutureProduction", &CvTechInfo::getFutureProduction, "int ()")
		.def("getFutureCommerce", &CvTechInfo::getFutureCommerce, "int ()")
		// RichMod End - Future Bonuses
		///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
Top Bottom