$attackProbabilty = 99 - pow(($d1Speed - $speedmax), 2); // So as speed of attacker less than defender goes from 0 up, the attack odds go from 99 to 98, 95, 90, 83, 74, 63, 50, 35, 18, 10.
if ($attackProbabilty < 10) $attackProbabilty = 10; // Attack odds never go under 10%
Example: Your card has a speed of 4 and it is this card's turn to attack a card with a speed of 9. You have a 74% chance of actually attacking and a 26% change to fail at the attack.
Example: Your card has a speed of 3 and you are attacking a card with speed 3. You attack 99% of the time and fail 1% of the time.
Example: Your card has a speed of 4 and you are attacking a card with speed 3. You attack 100% of the time and never fail.
Example: Your card in the first position has a speed of 15 and it is being attacked by a card with speed of 3. The attack against you only lands successfully 10% of the time.
RE: Pepe Game - Frog Battle Card Game Rules