EugeneStyles
Prince
- Joined
- May 21, 2007
- Messages
- 307
Could always add code to dominate to loop through the promotions of the original unit and the new unit (Best to loop new unit promos, then a nested loop of old unit promos to compare), and remove any promos from the new unit that aren't found.
1) Is there something like "getPromotionList" that can do that? I was unable to find a function for that.
2) The easiest way to do it seems to be to just clear all promotions from the new unit before calling "convert". Assuming I can figure out how to get all of the unit's current promotions. But the question is, should I? I plan to just override the function for Dominate, but if I did so, it would change functionality for other civs that use it. It would change it to what *I* think it should always do anyway, but I'm thinking that's imposing my will outside of the Myu civ, and not appropriate for this module. So, I might just do
Code:
if (newUnit.isHasPromotion('PROMOTION_PSIONIC')):
newUnit.setHasPromotion('PROMOTION_PSIONIC', false))
newUnit.setHasPromotion('PROMOTION_CHANNELING1', false))
newUnit.setHasPromotion('PROMOTION_CHANNELING2', false))
newUnit.setHasPromotion('PROMOTION_CHANNELING3', false))
Then call convert. If the converting unit has channeling, it'll get added back in, so should work as intended.