lushen124 / Universal-FE-Randomizer

Properly universal this time.
MIT License
98 stars 28 forks source link

Fix Issue #399, clamp minion stats after changing their classes #405

Closed Geeene closed 9 months ago

Geeene commented 1 year ago

As lushen mentioned in the Issue thread, the issue here is that some Characters in Lyn Mode have negative bases. In this instance it is FE7 Character number 0x96, who has -2 pow, so when randomizing into a Mage m/f, which have 1 Base pow, it would go to -1 Base, which then causes the underflow.

The easiest fix is to just clamp the bases for the minions bases + targetClass between the caps and Min Stats (10,0,0,0,0,0,0).

The pull request is a bit bigger since I copied over my changes from the character shuffler to make the GBAFECharacterData / GBAFEClassData into abstract classes instead of interfaces and the GBAFEStatDto to make this a much more simple fix.

The actual issue is only fixed in ClassRandomizer.randomizeMinionClasses().