MagisterCultuum
Great Sage
Yes, although since I of course could not check that code for errors you'll want to do that too before the next release.I see calls to RealTerrainType in both CvWBDesc and WBPlotScreen. Should all of these be uncommented?
WBPlotScreen should let the player alter the type in worldbuilder, while the CvWBDesc should let it be saved to and read from scenario files.
It seemed to work ok in my version.I dont think this code will work. It assumes that TempTerrainTimers are tied to Temp Features, which they are not. And you can't access the TempFeatureTimer for a number because it has already been set to 0 at this point.
For a quick short-term fix, I've simply made it so that Blizzards wont move onto plots with temporary features (note: Call Blizzard still ignores all these checks for the moment)
There is no reason why TempTerrainTimers and TempFeatureTimer must always be tied together, but it just so happens that the End of Winter game option code does always use the same number for them both.
There are other things which may change the terrain or feature and make the timers no longer correspond, but they are good enough in most cases. I found it better than loosing most of the Floodplains.
It is a bit harder for python modders to do if you still overwrite temp types in C++, but ok I guess.That's something that modders could add to but I won't be doing it for MNAI. The player gets no insight as to what the "real" versions might be.
MNAI will be sticking with the philosophy that permanent terrain changes always override temporary changes.
I guess that would be fine in base MNAI, but in my modmod there are still cases where I would want to decrement the counts of units who do not have a racial promotion with <iCombatHealPercent>100</iCombatHealPercent>Here is the code I added to the Unit kill function
Code:if (bIllusion) // Make sure that we properly adjust the stats when an Illusionary unit is removed from the game { GC.getGameINLINE().decrementUnitCreatedCount(getUnitType()); GC.getGameINLINE().decrementUnitClassCreatedCount((UnitClassTypes)(m_pUnitInfo->getUnitClassType())); }
I use a "Dark Reflection" promotion for some things, where I used to use Illusion but wanted to preserve the race. Also, Illusions but not Dark Reflections are defensive only in my modmod.
More of the issues related to decrementing in my modmod have to do with Gibbon Goetia's "Shape Shifting" ability. The unit can turn into other units types and back. His "Assume True Form" ability converts him back to his normal type, in the process initializing a new unit and incrementing those counts. When he is shapeshifted, I use python to force him to abandon an owner who leaves his state religion. I need to decrement things then too to let another player train him the way they would be able to if he had abandoned the player without shapeshifting first.
In regards to your changes to CvGameUtils, I don't think that you really want tolerant civs building Temples of the Hand and Demons Altar (or maybe you do). I edited those two parts for MNAI.
It looks like I deleted the Demons Altar push a while back and did not realize that it was till in the MNAI version. However, it would still make sense for a a city that would be producing demons to have a building that gives demons free xp.
I think you are probably right that we shouldn't want tolerant trait non-Illlians civs making Temples of the Hand in their Illian cities. In the event that there is a tolerant Illian leader (probably with Unrestricted leaders), we probably would want to check for the city's civ type as well as the player civ type though.
----
Oh, and if you are updating how the bAlwaysHostile tag anyway, it would be nice to make it so that it does not count as a declaration of war when such units damage neutral units with spells.