ok this is my chance method that i use for drops..
Code:
public static boolean chance(int percent) {
if (percent > 100) {
percent = 100;
}
for (int x = 0; x < percent; x++) {
if (x == prob) {
return true;
}
}
return false;
}
}
was thinking how how i could better put that, so i can add maybe ring of wealth later. but also so i don't have to use if statements to use chance.
this is what i came up with so far.
Code:
public static boolean chance(int percent) {
if (percent > 101) {
percent = 101;
}
int prob = Misc.random(100);
for (int x = 0; x < percent; x++) {
if prob < 1) { // allows for wealth to work =p
prob = 0;
}
if (playerRing == wealth) {
prob = -5
}
if (x > prob) {
return true;
}
}
return false;
}