TIMER_BU is specified in the BattleUnit tag. I had named it differently to avoid conflict. If you mean there's no initial value set, that's because unset tags have a value of 0 from my testing and that's the value I want as it represents the cumulative timers that gets updated in this line:
itemOwner.setTag Tag.TIMER_BU timer;
As I've mentioned, the randomness can be configured, if you set the RANDOM_DELAY to 0, there will be none and having DELAY set to 7 will follow your original pattern.
I did not add the script that handles the unpriming because your original design did that perfectly fine and worked in combination with my version of the 'createItem' hook. I saw no need to post your code as is without changes for the 'newTurnItem' hook. I probably should of made this clearer.
So TIMER_BU is internally counted up each turn as long as the battle units exists, correct? Or does it represent the total number of turns?
Which opens up a few more questions, will it behave the same way or not?
Despite of that i not really see the advantage of your way of implementing this even thou it might by a valid way of doing it.
And yes i get your point about the randomness being configureable, the point is I removed randomness from the timers for a reason. It was the only way (at least to my knowledge) to make sure the following things happen:
1.) Celatid Cloning occurs at the end of the Alien turn via timer.
2.) In the turn the Celatids clones the Unit will have 0 TU and can not move during its turn (since it is cloning).
3.) This gives the player the chance to kill both units in his next Turn with AOE damage (e.g. a Alien Grenade)
Of course the Celatid can clone also on X-Com turns, but this rather unfair, since the Cloning Unit does not suffer any penalties on its next turn, instead it has full TU and can do everything, also the CLone will have full TU on the next Alien turn, when it is spawned at the end of X-Com term.
Timers represent Turns, 0, 2, 4, 6, 8 etc.. is end of X-Com Turn, 1, 3, 5, 7, 9 is end of Alien Turn. The randomness could work but only if the random timer result would be in the pattern: 1, 3, 5, 7, 9 etc.. representing the ed of the Alien turn.
Also I have to update this standaline mod, since i found the expotential growth pattern to be to harsh on the player. At least for Hardmode Expansion, so i decided to give each Celatid there only one Embryo, which results in a linear growth pattern: 1, 2, 3, 4... / 2, 4, 6, 8 / 4, 8, 12, 16 / 6, 12, 18, 24
Which seems more reasonable. We are talking about free enemy units here. Of course Cydonia is the exception were those Celatids will grow expotentially in number (the brain is the players goal)
I appreciate your effort, nonethless. Thanks.