v1.3.0: fixed nature's bounty not respecting drop cap

This commit is contained in:
Evan Debenham
2022-06-13 00:59:48 -04:00
parent c62dfbceb1
commit 1fafb140cb
@@ -101,7 +101,8 @@ 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) {
int targetFloor = 2 + 2 * ((Hero) ch).pointsInTalent(Talent.NATURES_BOUNTY);
targetFloor -= berriesAvailable; targetFloor -= berriesAvailable;
targetFloor += (targetFloor >= 5) ? 3 : 2; targetFloor += (targetFloor >= 5) ? 3 : 2;
@@ -111,10 +112,11 @@ public class HighGrass {
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();
} }
}
} }
} }