Valkrionn
The Hamster King
Code:for i in range(pUnit.countHasPromotion(iProm)): pUnit.setHasPromotion(iProm, false)
That strips all of the stacked promotions from a unit
Actually..... It does not. Here's the code I used (mostly, it's on a different comp)
Code:
for i in range (pCaster.countHasPromotion(iMechanosAffinity)):
pCaster.setHasPromotion(iMechanosAffinity, false)
for i in range iNumRefinedMana:
pCaster.setHasPromotion(iMechanosAffinity, true)
Necessary to strip/readd the promotions to account for lost/traded/gained mana.
Now, this appears to work... The promotion correctly applies the number needed. However, the EFFECTS of the promotion are never stripped... Leading to a rapidly escalating ranged combat on the unit. Going to try a While loop next, but any idea why the promotion is not removed correctly?
Edit: Alright. The While loop has the same issue, as does using the countHasPromotion tag to set the number to a variable, and use a For loop to remove the promotion once for each value in the variable... All methods APPEAR to work, but do not wipe the stats. Interestingly, while I have 3 mana in the test I am gaining 5 strength a turn... This implies to me that even via python, you can only remove one stack effect promotion a turn. Just to be clear, I got the display working through 5 different methods... A While loop, a For loop using the tag, the one Xienwolf posted, and two different ways telling the function to jump to a different function, remove the promotion, and jump back to the first one... Hence running over the jump tag if the promotion is still there. ALL methods had the same issue, so I'm pretty sure it's inherent in the code.
Looks like I'm going to have to revert to my initial system, kludge though it is.