diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index fdd1fb371..2fcddef90 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -97,7 +97,7 @@ public class Hunger extends Buff implements Hero.Doom { GLog.w( Messages.get(this, "onhungry") ); - if (!Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_FOOD)){ + if (!Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_FOOD)){ GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.GUIDE_FOOD); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 42cabea5b..0914ad8a5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -43,7 +43,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Combo; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Foresight; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Fury; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.HoldFast; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; @@ -60,10 +59,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.En import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Monk; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Snake; -import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell; -import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; -import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.items.Amulet; import com.shatteredpixel.shatteredpixeldungeon.items.Ankh; @@ -1256,7 +1252,7 @@ public class Hero extends Char { target = m; } if (m instanceof Snake - && !Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_EXAMINING)){ + && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_EXAMINING)){ GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.GUIDE_EXAMINING); //we set to read here to prevent this message popping up a bunch diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java index c6f668d8d..7f37cb985 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Snake.java @@ -21,7 +21,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; -import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.journal.Guidebook; @@ -62,7 +61,7 @@ public class Snake extends Mob { @Override public String defenseVerb() { dodges++; - if (dodges >= 2 && !Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_SURPRISE_ATKS)){ + if (dodges >= 2 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)){ GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.GUIDE_SURPRISE_ATKS); dodges = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java index 7991847c9..cece711db 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/EquipableItem.java @@ -36,8 +36,6 @@ import com.watabou.noosa.audio.Sample; import java.util.ArrayList; -import javax.print.Doc; - public abstract class EquipableItem extends Item { public static final String AC_EQUIP = "EQUIP"; @@ -57,7 +55,7 @@ public abstract class EquipableItem extends Item { @Override public boolean doPickUp(Hero hero) { if (super.doPickUp(hero)){ - if (!isIdentified() && !Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_IDING)){ + if (!isIdentified() && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_IDING)){ GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.GUIDE_IDING); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index 09cd84cbb..d2b3fd4d1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -417,10 +417,10 @@ public class Heap implements Bundlable { for (Item item : items.toArray(new Item[0])){ if (item instanceof DocumentPage && ( !((DocumentPage) item).document().pageNames().contains(((DocumentPage) item).page()) - || ((DocumentPage) item).document().pageFound(((DocumentPage) item).page()))){ + || ((DocumentPage) item).document().isPageFound(((DocumentPage) item).page()))){ items.remove(item); } - if (item instanceof Guidebook && Document.ADVENTURERS_GUIDE.pageRead(0)){ + if (item instanceof Guidebook && Document.ADVENTURERS_GUIDE.isPageRead(0)){ items.remove(item); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java index 4ab9e74b3..ecfd94fa1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Document.java @@ -56,12 +56,12 @@ public enum Document { return findPage( pagesStates.keySet().toArray(new String[0])[pageIdx] ); } - public boolean pageFound( String page ){ + public boolean isPageFound( String page ){ return pagesStates.containsKey(page) && pagesStates.get(page) > NOT_FOUND; } - public boolean pageFound( int pageIdx ){ - return pageFound( pagesStates.keySet().toArray(new String[0])[pageIdx] ); + public boolean isPageFound( int pageIdx ){ + return isPageFound( pagesStates.keySet().toArray(new String[0])[pageIdx] ); } public boolean readPage( String page ) { @@ -77,12 +77,12 @@ public enum Document { return readPage( pagesStates.keySet().toArray(new String[0])[pageIdx] ); } - public boolean pageRead( String page ){ + public boolean isPageRead( String page ){ return pagesStates.containsKey(page) && pagesStates.get(page) == READ; } - public boolean pageRead( int pageIdx ){ - return pageRead( pagesStates.keySet().toArray(new String[0])[pageIdx] ); + public boolean isPageRead( int pageIdx ){ + return isPageRead( pagesStates.keySet().toArray(new String[0])[pageIdx] ); } public Collection pageNames(){ 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 a511dcccd..0d5241359 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -439,7 +439,7 @@ public abstract class RegularLevel extends Level { Collection allPages = Document.ADVENTURERS_GUIDE.pageNames(); ArrayList missingPages = new ArrayList<>(); for ( String page : allPages){ - if (!Document.ADVENTURERS_GUIDE.pageFound(page)){ + if (!Document.ADVENTURERS_GUIDE.isPageFound(page)){ missingPages.add(page); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java index 32fa1c439..026509e1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java @@ -216,7 +216,7 @@ public abstract class RegularPainter extends Painter { //entrance doors on floor 2 are hidden if the player hasn't picked up 2nd guidebook page if (Dungeon.depth == 2 - && !Document.ADVENTURERS_GUIDE.pageFound(Document.GUIDE_SEARCHING) + && !Document.ADVENTURERS_GUIDE.isPageFound(Document.GUIDE_SEARCHING) && r instanceof EntranceRoom){ d.type = Room.Door.Type.HIDDEN; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java index c70eff1e0..1c797fa65 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/LaboratoryRoom.java @@ -79,7 +79,7 @@ public class LaboratoryRoom extends SpecialRoom { Collection allPages = Document.ALCHEMY_GUIDE.pageNames(); ArrayList missingPages = new ArrayList<>(); for ( String page : allPages){ - if (!Document.ALCHEMY_GUIDE.pageFound(page)){ + if (!Document.ALCHEMY_GUIDE.isPageFound(page)){ missingPages.add(page); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EntranceRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EntranceRoom.java index a62f803a3..8c1d0adcd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EntranceRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/standard/EntranceRoom.java @@ -67,7 +67,7 @@ public class EntranceRoom extends StandardRoom { Random.pushGenerator(); //places the first guidebook page on floor 1 - if (Dungeon.depth == 1 && !Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_INTRO)){ + if (Dungeon.depth == 1 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_INTRO)){ int pos; do { //can't be on bottom row of tiles @@ -78,7 +78,7 @@ public class EntranceRoom extends StandardRoom { } //places the third guidebook page on floor 2 - if (Dungeon.depth == 2 && !Document.ADVENTURERS_GUIDE.pageFound(Document.GUIDE_SEARCHING)){ + if (Dungeon.depth == 2 && !Document.ADVENTURERS_GUIDE.isPageFound(Document.GUIDE_SEARCHING)){ int pos; do { //can't be on bottom row of tiles diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 5c8d093ff..093383903 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -538,7 +538,7 @@ public class GameScene extends PixelScene { } - if (Rankings.INSTANCE.totalNumber > 0 && !Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_DIEING)){ + if (Rankings.INSTANCE.totalNumber > 0 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_DIEING)){ GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.GUIDE_DIEING); } @@ -1178,7 +1178,7 @@ public class GameScene extends PixelScene { GameScene.show( new WndHero() ); } else if ( o instanceof Mob ){ GameScene.show(new WndInfoMob((Mob) o)); - if (o instanceof Snake && !Document.ADVENTURERS_GUIDE.pageRead(Document.GUIDE_SURPRISE_ATKS)){ + if (o instanceof Snake && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)){ GLog.p(Messages.get(Guidebook.class, "hint")); GameScene.flashForDocument(Document.GUIDE_SURPRISE_ATKS); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java index 2c32f5450..f741a218e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java @@ -269,7 +269,7 @@ public class WndJournal extends WndTabbed { super( iconForPage(page), Messages.titleCase(Document.ADVENTURERS_GUIDE.pageTitle(page))); this.page = page; - found = Document.ADVENTURERS_GUIDE.pageFound(page); + found = Document.ADVENTURERS_GUIDE.isPageFound(page); if (!found) { icon.hardlight( 0.5f, 0.5f, 0.5f); @@ -295,7 +295,7 @@ public class WndJournal extends WndTabbed { //TODO might just want this to be part of the Document class public static Image iconForPage( String page ){ - if (!Document.ADVENTURERS_GUIDE.pageFound(page)){ + if (!Document.ADVENTURERS_GUIDE.isPageFound(page)){ return new ItemSprite( ItemSpriteSheet.GUIDE_PAGE ); } switch (page){ @@ -357,7 +357,7 @@ public class WndJournal extends WndTabbed { updateList(); } }; - if (Document.ALCHEMY_GUIDE.pageFound(i)) { + if (Document.ALCHEMY_GUIDE.isPageFound(i)) { pageButtons[i].icon(new ItemSprite(ItemSpriteSheet.SOMETHING + spriteIndexes[i], null)); } else { pageButtons[i].icon(new ItemSprite(ItemSpriteSheet.SOMETHING, null));