@egezort(View Post) I won't be that hard! Why use tmp and not just a chance value? Use the code if ((r&0xFF) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP<br/> { if (parts[i].life<=95)<br/> parts[i].life += 5; else parts[i].life = 100; kill_part(r>>8); }
An example of chance from watr.c: if ((r&0xFF)==PT_SALT && 1>(rand()%250)) { part_change_type(i,x,y,PT_SLTW); part_change_type(r>>8,x+rx,y+ry,PT_SLTW); }
the 1>(rand()%250) means there is a 1 in 250 chance of such and such happening