ID:159344
 
How do I make something have a 1/4 chance that it works.

Like, in my catch, I want pokeball to have a 1/4 chance to catch the pokemon.
You want to look up prob()

if(prob(25))
This has a 25% chance of happening

if(prob(0.1))
0.1% of this happening

if(prob(2))
2% of this happening if the 0.1% chance happened
else if(prob(99))
99% of this happening otherwise
else
Man, you were so lucky to be the special 0.1% but unlucky in the second pick :(
mob/proc/checkIfCaught()
var/A = prob(25) //25% out of 100, or 1/4
if(A) //checks to see if it returned 1, and if it did...
//insert catch procedures
else //otherwise...
//insert non-catch procedures