chinhodado / persona5_calculator

A tool to help calculate fusions in Persona 5.
https://chinhodado.github.io/persona5_calculator/
Apache License 2.0
330 stars 133 forks source link

Fix an issue where rare fusions could yield a special persona (ex. Regent + Cu Chulainn) #33

Closed Gredelston closed 5 years ago

Gredelston commented 5 years ago

When performing a Rare Fusion, the existing code ensures that the resulting persona is not a special persona; if it is, it proceeds to the next persona of the same arcana, and returns the result. However, it does not check whether this next persona is special, so it can yield false results.

Example: Regent (Emperor/10) + Cu Chulainn (Star/67) When fusing with a Star persona, Regent yields a modifier of +1. We look for the next Star persona after Cu Chulainn: Sraosha (Star/80). Sraosha is a special persona, so we skip to the next Star persona: Lucifer (Star/93). The existing code would return Lucifer. This is improper, since Lucifer is also special. The intended result would be to look for the next Star persona after Lucifer, and again return the result (in this case null -- the fusion is invalid).

chinhodado commented 5 years ago

Thanks, can you also update the tests?

Gredelston commented 5 years ago

Tests updated. I'm impressed you responded so quick!

chinhodado commented 5 years ago

Thanks!