Hey, just letting you know that there are some for loops which are not working in the setup.build_encounter function:
ln 61144 and 61152
for (let i = 0; i <= partners; i++)
should be:
for (let i = 0; i <= partners.length; i++)
But you possibly need to rewrite the whole conditions function because it's currently broken