From 591b1b570eeca110d105f9401828c9da3c968ef3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 29 Jul 2017 03:43:29 -0400 Subject: [PATCH] v0.6.1: reduced the spawn rate of guidebook pages on very early floors --- .../shatteredpixeldungeon/levels/RegularLevel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 6640bef72..da96d8bae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -369,9 +369,10 @@ public abstract class RegularLevel extends Level { missingPages.remove(Document.GUIDE_INTRO_PAGE); missingPages.remove(Document.GUIDE_SEARCH_PAGE); + int foundPages = allPages.size() - (missingPages.size() + 2); + //chance to find a page scales with pages missing and depth - if (missingPages.size() > 0 && - Random.Int(allPages.size()-2) < missingPages.size() + Dungeon.depth/2){ + if (missingPages.size() > 0 && Random.Float() < (Dungeon.depth/(float)(foundPages + 1))){ GuidePage p = new GuidePage(); p.page(missingPages.get(0)); int cell = randomDropCell();