davidlallen
Deity
In Dune Wars, we have added a screen which allows you to buy reinforcements. It is not a full-up mercenary system. The idea is that your civ has an offworld capitol, and if you pay the local space ship owners (the navigator's guild), you can bring in reinforcements from your homeworld. You can see the work in progress at this post, screenshot at this post.
When the new units appear, it is via python player.initUnit(). A playtester has reported a bug, which is, units purchased this way do not have the starting promotions which should be granted by their leaderhead's traits. For example, archers bought by a leader with the Protective trait should start with Drill, etc.
My question is, how can I tell what promotions are supposed to be added to new units? I do not want to hard code assumptions about what Aggressive does, what Protective does, etc. Is there a function like AddInitialPromotions()?
If I have to roll my own, how would I go about it? It looks like CvTraitInfo.isFreePromotion() could help, if I looped over all promotions, but I do not see how to get the traits of the current player.
When the new units appear, it is via python player.initUnit(). A playtester has reported a bug, which is, units purchased this way do not have the starting promotions which should be granted by their leaderhead's traits. For example, archers bought by a leader with the Protective trait should start with Drill, etc.
My question is, how can I tell what promotions are supposed to be added to new units? I do not want to hard code assumptions about what Aggressive does, what Protective does, etc. Is there a function like AddInitialPromotions()?
If I have to roll my own, how would I go about it? It looks like CvTraitInfo.isFreePromotion() could help, if I looped over all promotions, but I do not see how to get the traits of the current player.