Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Вероятность выпадения (1 к ...)
- private int p = 700;
- // Предельная разница фонда между голдами
- private int lim = 700;
- // Предельно возможное отклонение от lim
- private int deviation = 10;
- private int droppedGolds = 0;
- private int lastDroppedGolds = 0;
- private int lastGoldFund = 0;
- int regionIndex = rnd.nextInt(bonuses.getBonusGoldInfo().size());
- BonusInfo bonusGold = bonuses.getBonusGoldInfo().get(regionIndex);
- int fund = (int)model.tanksKillModel.getBattleFund();
- int fundDelta = fund - bonuses.getPrevFund();
- int golds = 0;
- int currentLim = lim + deviation * (int)RandomUtils.getRandom(-1, 1);
- if((fund - lastGoldFund) >= currentLim) {
- if(lastDroppedGolds == droppedGolds) {
- golds += 1;
- lastDroppedGolds += 1;
- lastGoldFund = fund;
- } else {
- lastDroppedGolds = droppedGolds;
- }
- }
- else {
- for (int i = 0; i < fundDelta; i++) {
- if((int)RandomUtils.getRandom(0, p) == 0) {
- golds += 1;
- lastGoldFund = fund;
- }
- }
- }
- droppedGolds += golds;
- for (int i = 0; i < golds + 1; i++) {
- // ... Дропнуть голд
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement