v1.3.0: fixed nature's bounty not respecting drop cap
This commit is contained in:
+13
-11
@@ -101,19 +101,21 @@ public class HighGrass {
|
|||||||
Talent.NatureBerriesDropped dropped = Buff.affect(ch, Talent.NatureBerriesDropped.class);
|
Talent.NatureBerriesDropped dropped = Buff.affect(ch, Talent.NatureBerriesDropped.class);
|
||||||
berriesAvailable -= dropped.count();
|
berriesAvailable -= dropped.count();
|
||||||
|
|
||||||
int targetFloor = 2 + 2*((Hero)ch).pointsInTalent(Talent.NATURES_BOUNTY);
|
if (berriesAvailable > 0) {
|
||||||
targetFloor -= berriesAvailable;
|
int targetFloor = 2 + 2 * ((Hero) ch).pointsInTalent(Talent.NATURES_BOUNTY);
|
||||||
targetFloor += (targetFloor >= 5) ? 3 : 2;
|
targetFloor -= berriesAvailable;
|
||||||
|
targetFloor += (targetFloor >= 5) ? 3 : 2;
|
||||||
|
|
||||||
//If we're behind: 1/10, if we're on page: 1/30, if we're ahead: 1/90
|
//If we're behind: 1/10, if we're on page: 1/30, if we're ahead: 1/90
|
||||||
boolean droppingBerry = false;
|
boolean droppingBerry = false;
|
||||||
if (Dungeon.depth > targetFloor) droppingBerry = Random.Int(10) == 0;
|
if (Dungeon.depth > targetFloor) droppingBerry = Random.Int(10) == 0;
|
||||||
else if (Dungeon.depth == targetFloor) droppingBerry = Random.Int(30) == 0;
|
else if (Dungeon.depth == targetFloor) droppingBerry = Random.Int(30) == 0;
|
||||||
else if (Dungeon.depth < targetFloor) droppingBerry = Random.Int(90) == 0;
|
else if (Dungeon.depth < targetFloor) droppingBerry = Random.Int(90) == 0;
|
||||||
|
|
||||||
if (droppingBerry){
|
if (droppingBerry) {
|
||||||
dropped.countUp(1);
|
dropped.countUp(1);
|
||||||
level.drop(new Berry(), pos).sprite.drop();
|
level.drop(new Berry(), pos).sprite.drop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user