public void renewPotential(int type, int line, int toLock, boolean bonus) { // 0 = normal miracle cube, 1 = premium, 2 = epic pot scroll, 3 = super, 5 = enlightening
int miracleRate = 1;
if (EventConstants.DoubleMiracleTime) {
miracleRate *= 2;
}
final int rank = type == 2 ? -18 : type == 5 ? (Randomizer.nextInt(100) < 3 * miracleRate && getState() != 20 ? -20 : Randomizer.nextInt(100) < 10 * miracleRate && getState() != 20 ? -(getState() + 1) : -(getState())) : (Randomizer.nextInt(100) < 4 * miracleRate && getState() != (type == 3 ? 20 : 19) ? -(getState() + 1) : -(getState())); // 4 % chance to up 1 tier
setPotential1(rank);
if (getPotential3() > 0) {
setPotential2(rank); // put back old 3rd line
} else {
switch (type) {
case 1: // premium-> suppose to be 25%
setPotential2(Randomizer.nextInt(10) == 0 ? rank : 0); //1/10 chance of 3 line
break;
case 2: // epic pot
setPotential2(Randomizer.nextInt(10) <= 1 ? rank : 0); //2/10 chance of 3 line
break;
case 3: // super
setPotential2(Randomizer.nextInt(10) <= 2 ? rank : 0); //3/10 chance of 3 line
break;
case 4: // revolutionary
setPotential2(Randomizer.nextInt(10) <= 3 ? rank : 0); //4/10 chance of 3 line
break;
case 5: // enlightening
setPotential2(Randomizer.nextInt(10) <= 2 ? rank : 0); //3/10 chance of 3 line
break;
case 6: // master
if (!bonus) {
return;
}
setBonusPotential1(Randomizer.nextInt(10) <= 2 ? rank : 0); //3/10 chance of 3 line
break;
default:
setPotential2(0);
break;
}
}
if (bonus) {
if (getBonusPotential2() > 0) {
setBonusPotential1(rank); // put back old 5th line
} else if (type == 6) { // super, revolutionary and enlightening
setBonusPotential1(Randomizer.nextInt(100) <= 1 ? rank : 0); // 2/100 to get 5 lines
} else {
setBonusPotential1(0); //just set it theoretically
}
setBonusPotential2(0); //just set it theoretically
}
switch (line) {
case 0:
//Don't lock
break;
case 1:
setPotential1(-(toLock + line * 100000 + (rank > getState() ? 10000 : 0)));
break;
case 2:
setPotential2(-(toLock + line * 100000));
break;
case 3:
setPotential3(-(toLock + line * 100000));
break;
default:
System.out.println("[Hacking Attempt] Try to lock potential line which does not exists.");
break;
}
}