@Override public String desc() { String desc = super.desc(); if (returnDepth != -1){ desc += "\n\n" + Messages.get(this, "desc_set", returnDepth); } return desc; }
@Override protected void onCast(Hero hero) { curItem = detach( hero.belongings.backpack ); GameScene.selectItem( itemSelector, mode, inventoryTitle ); }
@Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( DEPTH, returnDepth ); if (returnDepth != -1) { bundle.put( POS, returnPos ); } }
@Override protected void onCast(final Hero hero) { if (returnDepth == -1){ setBeacon(hero); } else { GameScene.show(new WndOptions(Messages.titleCase(name()), Messages.get(BeaconOfReturning.class, "wnd_body"), Messages.get(BeaconOfReturning.class, "wnd_set"), Messages.get(BeaconOfReturning.class, "wnd_return")){ @Override protected void onSelect(int index) { if (index == 0){ setBeacon(hero); } else if (index == 1){ returnBeacon(hero); } } }); } }
@Override protected void onCast(Hero hero) { if (hero.visibleEnemies() > hero.mindVisionEnemies.size()) { GLog.i( Messages.get(this, "enemy_near") ); return; } detach( curUser.belongings.backpack ); updateQuickslot(); AlchemyScene.setProvider(this); ShatteredPixelDungeon.switchScene(AlchemyScene.class); }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); returnDepth = bundle.getInt( DEPTH ); returnPos = bundle.getInt( POS ); }
@Override protected void onCast(Hero hero) { if (Dungeon.depth >= 25){ GLog.w(Messages.get(this, "nowhere")); } else { super.onCast(hero); } }
@Override public void execute( final Hero hero, String action ) { super.execute( hero, action ); if (action.equals( AC_CAST )) { if (curUser.buff(MagicImmune.class) != null){ GLog.w( Messages.get(this, "no_magic") ); return; } onCast( hero ); } }
private void setBeacon(Hero hero ){ returnDepth = Dungeon.depth; returnPos = hero.pos; hero.spend( 1f ); hero.busy(); GLog.i( Messages.get(this, "set") ); hero.sprite.operate( hero.pos ); Sample.INSTANCE.play( Assets.SND_BEACON ); updateQuickslot(); }
@Override public void onSelect( Item item ) { //FIXME this safety check shouldn't be necessary //it would be better to eliminate the curItem static variable. if (!(curItem instanceof InventorySpell)){ return; } if (item != null) { ((InventorySpell)curItem).onItemSelected( item ); curUser.spend( 1f ); curUser.busy(); (curUser.sprite).operate( curUser.pos ); Sample.INSTANCE.play( Assets.SND_READ ); Invisibility.dispel(); } else { curItem.collect( curUser.belongings.backpack ); } } };
@Override protected void onCast(final Hero hero) { if (returnDepth == -1){ setBeacon(hero); } else { GameScene.show(new WndOptions(Messages.titleCase(name()), Messages.get(BeaconOfReturning.class, "wnd_body"), Messages.get(BeaconOfReturning.class, "wnd_set"), Messages.get(BeaconOfReturning.class, "wnd_return")){ @Override protected void onSelect(int index) { if (index == 0){ setBeacon(hero); } else if (index == 1){ returnBeacon(hero); } } }); } }
@Override protected void onCast(Hero hero) { if (hero.visibleEnemies() > hero.mindVisionEnemies.size()) { GLog.i( Messages.get(this, "enemy_near") ); return; } detach( curUser.belongings.backpack ); updateQuickslot(); AlchemyScene.setProvider(this); ShatteredPixelDungeon.switchScene(AlchemyScene.class); }
@Override public String desc() { String desc = super.desc(); if (returnDepth != -1){ desc += "\n\n" + Messages.get(this, "desc_set", returnDepth); } return desc; }
@Override public void storeInBundle( Bundle bundle ) { super.storeInBundle( bundle ); bundle.put( DEPTH, returnDepth ); if (returnDepth != -1) { bundle.put( POS, returnPos ); } }
@Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); returnDepth = bundle.getInt( DEPTH ); returnPos = bundle.getInt( POS ); }
@Override protected void onCast(Hero hero) { curItem = detach( hero.belongings.backpack ); GameScene.selectItem( itemSelector, mode, inventoryTitle ); }
@Override protected void onCast(Hero hero) { if (Dungeon.depth >= 25){ GLog.w(Messages.get(this, "nowhere")); } else { super.onCast(hero); } }
@Override public void execute( final Hero hero, String action ) { super.execute( hero, action ); if (action.equals( AC_CAST )) { if (curUser.buff(MagicImmune.class) != null){ GLog.w( Messages.get(this, "no_magic") ); return; } onCast( hero ); } }
private void setBeacon(Hero hero ){ returnDepth = Dungeon.depth; returnPos = hero.pos; hero.spend( 1f ); hero.busy(); GLog.i( Messages.get(this, "set") ); hero.sprite.operate( hero.pos ); Sample.INSTANCE.play( Assets.SND_BEACON ); updateQuickslot(); }
@Override public void onSelect( Item item ) { //FIXME this safety check shouldn't be necessary //it would be better to eliminate the curItem static variable. if (!(curItem instanceof InventorySpell)){ return; } if (item != null) { ((InventorySpell)curItem).onItemSelected( item ); curUser.spend( 1f ); curUser.busy(); (curUser.sprite).operate( curUser.pos ); Sample.INSTANCE.play( Assets.SND_READ ); Invisibility.dispel(); } else { curItem.collect( curUser.belongings.backpack ); } } };