private void anonymize(Item item){ if (item instanceof Potion){ ((Potion) item).anonymize(); } else if (item instanceof Scroll){ ((Scroll) item).anonymize(); } }
public void setKnown() { if (!anonymous) { if (!isKnown()) { handler.know(this); updateQuickslot(); } if (Dungeon.hero.isAlive()) { Catalog.setSeen(getClass()); } } }
@Override //20 gold more than its none-exotic equivalent public int price() { try { return (exoToReg.get(getClass()).newInstance().price() + 20) * quantity; } catch (Exception e){ ShatteredPixelDungeon.reportException(e); return 0; } }
@Override public boolean isIdentified() { return isKnown(); }
@Override public void execute( Hero hero, String action ) { super.execute( hero, action ); if (action.equals( AC_READ )) { if (hero.buff(MagicImmune.class) != null){ GLog.w( Messages.get(this, "no_magic") ); } else if (hero.buff( Blindness.class ) != null) { GLog.w( Messages.get(this, "blinded") ); } else if (hero.buff(UnstableSpellbook.bookRecharge.class) != null && hero.buff(UnstableSpellbook.bookRecharge.class).isCursed() && !(this instanceof ScrollOfRemoveCurse || this instanceof ScrollOfAntiMagic)){ GLog.n( Messages.get(this, "cursed") ); } else { curUser = hero; curItem = detach( hero.belongings.backpack ); doRead(); } } }
HashSet<Class<? extends Scroll>> scrolls = Scroll.getUnknown(); HashSet<Class<? extends Ring>> rings = Ring.getUnknown(); s.setKnown(); IDed.add(s); scrolls.remove(s.getClass());
Scroll.initLabels(); Potion.initColors(); Ring.initGems();
} else if (currentItemIdx == SCROLL_IDX) { itemClasses = new ArrayList<>(Catalog.SCROLLS.items()); for (Class<? extends Item> cls : itemClasses) known.put(cls, Scroll.getKnown().contains(cls)); } else { itemClasses = new ArrayList<>();
iconInt = ((Scroll) item).initials(); } else { iconInt = ((Potion) item).initials();
unIDed.addAll(Scroll.getUnknown()); all = scrolls.clone(); if (item instanceof ExoticScroll){
@Override public int price() { return isKnown() ? 30 * quantity : super.price(); } }
public void anonymize(){ if (!isKnown()) image = ItemSpriteSheet.SCROLL_HOLDER; anonymous = true; }
public void setKnown() { if (!anonymous) { if (!isKnown()) { handler.know(this); updateQuickslot(); } if (Dungeon.hero.isAlive()) { Catalog.setSeen(getClass()); } } }
@Override public void execute( Hero hero, String action ) { super.execute( hero, action ); if (action.equals( AC_READ )) { if (hero.buff(MagicImmune.class) != null){ GLog.w( Messages.get(this, "no_magic") ); } else if (hero.buff( Blindness.class ) != null) { GLog.w( Messages.get(this, "blinded") ); } else if (hero.buff(UnstableSpellbook.bookRecharge.class) != null && hero.buff(UnstableSpellbook.bookRecharge.class).isCursed() && !(this instanceof ScrollOfRemoveCurse || this instanceof ScrollOfAntiMagic)){ GLog.n( Messages.get(this, "cursed") ); } else { curUser = hero; curItem = detach( hero.belongings.backpack ); doRead(); } } }
Scroll.initLabels(); Potion.initColors(); Ring.initGems();
} else if (currentItemIdx == SCROLL_IDX) { itemClasses = new ArrayList<>(Catalog.SCROLLS.items()); for (Class<? extends Item> cls : itemClasses) known.put(cls, Scroll.getKnown().contains(cls)); } else { itemClasses = new ArrayList<>();