Change to Fix migration power lockdown

I think this will migrate every value over to have 1000 casts, which will then get reset to the lower of the value or character max once the actor is loaded.  Essentially pushing a long rest for power casting limits upon migration.
This commit is contained in:
supervj 2021-02-15 09:15:36 -05:00
parent 95fc015a87
commit a893212b22
4 changed files with 4 additions and 6 deletions

View file

@ -516,7 +516,7 @@ export default class Actor5e extends Actor {
if ( Number.isNaN(i) ) continue;
if ( Number.isNumeric(lvl.foverride) ) lvl.fmax = Math.max(parseInt(lvl.foverride), 0);
else lvl.fmax = forcePowerLimit[i-1] || 0;
lvl.fvalue = parseInt(lvl.fvalue);
lvl.fvalue = Math.min(parseInt(lvl.fvalue),lvl.fmax);
}
let techPowerLimit = SW5E.powerLimit['none'];
@ -529,7 +529,7 @@ export default class Actor5e extends Actor {
if ( Number.isNaN(i) ) continue;
if ( Number.isNumeric(lvl.toverride) ) lvl.tmax = Math.max(parseInt(lvl.toverride), 0);
else lvl.tmax = techPowerLimit[i-1] || 0;
lvl.tvalue = parseInt(lvl.tvalue);
lvl.tvalue = Math.max(parseInt(lvl.tvalue),lvl.tmax);
}
// Set Force and tech power