Closed LAMaglan closed 7 months ago
In the battle_simulator, intially, the attacker is chosen based on who has highest updated_speed:
attacker, defender = ( (pokemon1, pokemon2) if pokemon1.speed_updated > pokemon2.speed_updated else (pokemon2, pokemon1) )
However, when the speed is the same, it will bias towards pokemon2. In such cases, it should be random which pokemon becomes the attacker
Although this should be a quick fix, somehow, this can sometimes mean that the attacker is the same across rounds?
The issue seemed to only occur when trying to encapsulate in a function...
In the battle_simulator, intially, the attacker is chosen based on who has highest updated_speed:
However, when the speed is the same, it will bias towards pokemon2. In such cases, it should be random which pokemon becomes the attacker