Psy-skill amounts and stuff should be in the ruleset.
void Soldier::trainPsi()
{
+ if (Options::getBool("quickPsiTraining"))
+ {
+ if (_currentStats.psiSkill > 0)
+ {
+ if (100 * 10/_currentStats.psiSkill > RNG::generate(0, 100))
+ _currentStats.psiSkill++;
+ if(_currentStats.psiSkill > 100)
+ _currentStats.psiSkill = 100;
+ }
+ else if (_currentStats.psiSkill < 0)
+ {
+ _currentStats.psiSkill++;
+ if (_currentStats.psiSkill == 0) https:// initial training is over
+ {
+ _currentStats.psiSkill = RNG::generate(16, 24);
+ }
+ }
+ else if (_currentStats.psiSkill == 0)
+ {
+ _currentStats.psiSkill = -RNG::generate(20, 40); https:// initial training from 20 to 40 days
+ }
+ return;
+ }
+
_improvement = 0;
if(_currentStats.psiSkill <= 16)
_improvement = RNG::generate(16, 24);
This forces everyone to use our training amounts. I don't know how to reference the ruleset so I'll just guess.
Also if we skip 0 and start training at -1, then all untrained soldiers in our system will have psy-skill < 0 and all untrained soldiers in the vanilla system will have psy-skill = 0.
Also, doesn't OXC use a lot of unsigned ints? If it does, we might have a problem with -13 psy-skill meaning 12 days until you get psy-skill.
Here is pseudo-code of what I'm thinking of.
void Soldier::trainPsi()
{
if (Options::getBool("quickPsiTraining"))
{
p =_currentStats.psiSkill;
r = Ruleset.PsyTraining;
https://Check for soldiers from legacy system or soldiers with too many training days left.
if(p = 0 || p < r.MaxDaysToTrain() * -1)
p = RNG::generate(r.MinDaysToTrain(), r.MaxDaysToTrain()) * -1; https:// Set soldier to first day of training
elseif (p < -1)
p++; https://Train soldier for one day
elseif(p = -1)
p = RNG::generate(Ruleset.Stats.Min.PsySkill, Ruleset.Stats.Max.PsySkill); https://Today is last day of training
}
elseif(p >= Ruleset.Stats.Cap.PsySkill())
https:// do nothing; soldier is at the cap.
else
{
/*Modders should be able to change the incriment probability calculations
*Defaults: r.Mult = 1, r.Base = 0, r.Good = 10 r.incriment = 1.
*Default chances are 10/psy-skill that soldier will learn 1 psy-skill today.*/
rnd = RNG::generate(0, (r.Mult * p) + r.Base);
if ( rnd <= r.Good )
p += r.Incriment; https:// Modders can have +2 or +3 psy-skill a day if they really want
}
}
else
{
https://normal monthly psy-training code
}
}