@Override public ArrayList<String> actions(Hero hero) { ArrayList<String> actions = super.actions( hero ); actions.add( AC_USE ); return actions; }
@Override protected void onThrow(int cell) { if (Dungeon.level.pit[cell] || !defaultAction.equals(AC_THROW)){ super.onThrow( cell ); } else { activate(cell); } }
@Override protected void onThrow(int cell) { if (Actor.findChar(cell) != null && throwPath.dist >= 1){ cell = throwPath.path.get(throwPath.dist-1); } throwPath = null; super.onThrow(cell); }
@Override public Item sampleOutput(ArrayList<Item> ingredients) { if (!testIngredients(ingredients)) return null; try{ Scroll s = (Scroll) ingredients.get(0); return stones.get(s.getClass()).newInstance().quantity(amnts.get(s.getClass())); } catch (Exception e) { ShatteredPixelDungeon.reportException(e); return null; } } }
@Override public void execute(Hero hero, String action) { super.execute(hero, action); if (action.equals(AC_USE)){ curItem = detach( hero.belongings.backpack ); activate(curUser.pos); } }
@Override public Item sampleOutput(ArrayList<Item> ingredients) { if (!testIngredients(ingredients)) return null; try{ Scroll s = (Scroll) ingredients.get(0); return stones.get(s.getClass()).newInstance().quantity(amnts.get(s.getClass())); } catch (Exception e) { ShatteredPixelDungeon.reportException(e); return null; } } }
@Override public void execute(Hero hero, String action) { super.execute(hero, action); if (action.equals(AC_USE)){ curItem = detach( hero.belongings.backpack ); activate(curUser.pos); } }
@Override public Item brew(ArrayList<Item> ingredients) { if (!testIngredients(ingredients)) return null; Scroll s = (Scroll) ingredients.get(0); s.quantity(s.quantity() - 1); try{ return stones.get(s.getClass()).newInstance().quantity(amnts.get(s.getClass())); } catch (Exception e) { ShatteredPixelDungeon.reportException(e); return null; } }
@Override public ArrayList<String> actions(Hero hero) { ArrayList<String> actions = super.actions( hero ); actions.add( AC_USE ); return actions; }
@Override protected void onThrow(int cell) { if (Actor.findChar(cell) != null && throwPath.dist >= 1){ cell = throwPath.path.get(throwPath.dist-1); } throwPath = null; super.onThrow(cell); }
@Override protected void onThrow(int cell) { if (Dungeon.level.pit[cell] || !defaultAction.equals(AC_THROW)){ super.onThrow( cell ); } else { activate(cell); } }
@Override public Item brew(ArrayList<Item> ingredients) { if (!testIngredients(ingredients)) return null; Scroll s = (Scroll) ingredients.get(0); s.quantity(s.quantity() - 1); try{ return stones.get(s.getClass()).newInstance().quantity(amnts.get(s.getClass())); } catch (Exception e) { ShatteredPixelDungeon.reportException(e); return null; } }