Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,281
Wouldn't it make sense to set the victory parts to be yields? That way the AI already knows how to transport them.Then all parts could be transported to a coastal city with dockyards and trigger the victory or you could be able to build the actual caravel at the dockyard having the four elements present in the city plus other additional goods.
It would be something like needing a shipyard, possibly a special version of a shipyard. Either way you somehow has to declare a city to be "this is the construction site for the exploring fleet". The AI would set the victory yields to import in that city and export in all other cities and presumably humans would do the same. Once the yield is unloaded, the construction "eats it" and it is added to a counter in CvPlayer. That way we will not have warehouse capacity problems. The AI values the yields based on this counter meaning it will not build masts exclusively and it will stop once the target number has been reached.
Victory yields can't be traded between players or in trade screens.
Combining this with my idea of making professions tell how many yields they have as input and output, we can make a mast builder, which each turn takes 6 lumber and produce a single mast yield.
Victory yields can only be used if there is a shipyard of the correct type (meaning the ship building race is on). My plan to automatically disable professions, which produce and consume unallowed yields will then disable all victory yield professions until the construction has started.
Maybe buildings should be able to give the owner a certain CivEffect. This can be used to enable the victory yields, but at the same time it can be used with a capital building to give other bonuses. Maybe we should cache how many buildings we have of each type and we can enable a CivEffect if we have more than a certain threshold. This threshold is set in buildingInfo and can be modified by map size. Since it would make no sense to require less than 1, it should be capped at 1, meaning setting it to 0 would always give the CivEffect when there is at least one building. Alternatively it could be a type of CivEffect, which triggers when certain criteria is met, such as minimum number of buldings.
I kind of like this because it could be interesting from a gameplay point of view and it seems reasonably doable to code and to get the AI to use it.