Somehow the job you've done on AE makes me strongly doubt that you're just a cut-and-paster
The place to implement cost requirements wouldn't be in CvPlot::canBuildImprovement(), but I'd rather do it in CvPlayer::canBuild(), as that's where the gold check would fit better. It's a simple matter of modifying the CvImprovementInfo class to add a gold-cost variable and properly read and expose it.
The AI is always more complicated than that. Sure, if it doesn't have enough gold, it'll see that the bool returns false and will, well, know that it can't build the improvement. It won't, however, realize that it needs more money for it, so you'd need additional AI changes to ensure that it knows how to keep some money for terrain improvements, etc.
Besides, if you set the costs to high enough, you'd need to rebalance several other game areas. For example, if you slow down the game by requiring considerable costs, you'll need to alter the amount of turns, etc.



Reply With Quote





Bookmarks