private void reset() throws IOException { DriedRose.holdGhostHero( Dungeon.level ); SpecialRoom.resetPitRoom(Dungeon.depth+1); Dungeon.depth--; Level level = Dungeon.newLevel(); Dungeon.switchLevel( level, level.entrance ); }
@Override public String desc() { if (!Ghost.Quest.completed() && !isIdentified()){ return Messages.get(this, "desc_no_quest"); } String desc = super.desc(); if (isEquipped( Dungeon.hero )){ if (!cursed){ if (level() < levelCap) desc+= "\n\n" + Messages.get(this, "desc_hint"); } else desc += "\n\n" + Messages.get(this, "desc_cursed"); } return desc; }
@Override public void charge(Hero target) { if (ghost == null && charge < chargeCap){ partialCharge += 0.25f; if (partialCharge >= 1){ partialCharge--; charge++; updateQuickslot(); if (charge == chargeCap){ partialCharge = 0f; GLog.p( Messages.get(DriedRose.class, "charged") ); } } } }
@Override public ArrayList<String> actions( Hero hero ) { ArrayList<String> actions = super.actions( hero ); if (!Ghost.Quest.completed()){ actions.remove(AC_EQUIP); return actions; } if (isEquipped( hero ) && charge == chargeCap && !cursed) { actions.add(AC_SUMMON); } if (isIdentified() && !cursed){ actions.add(AC_OUTFIT); } return actions; }
private void descend() throws IOException { if (Dungeon.hero == null) { DriedRose.clearHeldGhostHero(); Dungeon.init(); if (noStory) { Dungeon.chapters.add( WndStory.ID_SEWERS ); noStory = false; } GameLog.wipe(); } else { DriedRose.holdGhostHero( Dungeon.level ); Dungeon.saveAll(); } Level level; if (Dungeon.depth >= Statistics.deepestFloor) { level = Dungeon.newLevel(); } else { Dungeon.depth++; level = Dungeon.loadLevel( GamesInProgress.curSlot ); } Dungeon.switchLevel( level, level.entrance ); }
@Override public boolean doPickUp( Hero hero ) { DriedRose rose = hero.belongings.getItem( DriedRose.class ); if (rose == null){ GLog.w( Messages.get(this, "no_rose") ); return false; } if ( rose.level() >= rose.levelCap ){ GLog.i( Messages.get(this, "no_room") ); hero.spendAndNext(TIME_TO_PICK_UP); return true; } else { rose.upgrade(); if (rose.level() == rose.levelCap) { GLog.p( Messages.get(this, "maxlevel") ); } else GLog.i( Messages.get(this, "levelup") ); Sample.INSTANCE.play( Assets.SND_DEWDROP ); hero.spendAndNext(TIME_TO_PICK_UP); return true; } }
else if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); else if (charge != chargeCap) GLog.i( Messages.get(this, "no_charge") ); else if (cursed) GLog.i( Messages.get(this, "cursed") ); updateQuickslot();
"_-_ Max charges reduced from 3-8 to 2-6\n\n" + "_-_ Recharge speed has been reduced slightly" )); changes.addButton( new ChangeButton( new DriedRose().upgrade(10), "The ghost hero summoned by the rose is now much more capable and is also much less temporary:\n\n" + "_-_ Ghost can now be equipped with a weapon and armor and uses them just like the hero.\n" +
public int ghostStrength(){ return 13 + level()/2; }
private void restore() throws IOException { DriedRose.clearHeldGhostHero(); GameLog.wipe(); Dungeon.loadGame( GamesInProgress.curSlot ); if (Dungeon.depth == -1) { Dungeon.depth = Statistics.deepestFloor; Dungeon.switchLevel( Dungeon.loadLevel( GamesInProgress.curSlot ), -1 ); } else { Level level = Dungeon.loadLevel( GamesInProgress.curSlot ); Dungeon.switchLevel( level, Dungeon.hero.pos ); } }
@Override protected boolean act() { updateRose(); if (rose == null || !rose.isEquipped(Dungeon.hero)){ damage(1, this); } if (!isAlive()) return true; if (!Dungeon.hero.isAlive()){ sayHeroKilled(); sprite.die(); destroy(); return true; } return super.act(); }
DriedRose.restoreGhostHero( level, pos ); Actor.init();
if (rose != null && rose.isIdentified() && !rose.cursed){
PixelScene.renderMultiline(Messages.get(this, "desc", rose.ghostStrength()), 6); message.maxWidth( WIDTH ); message.setPos(0, titlebar.bottom() + GAP);
@Override public ArrayList<String> actions( Hero hero ) { ArrayList<String> actions = super.actions( hero ); if (!Ghost.Quest.completed()){ actions.remove(AC_EQUIP); return actions; } if (isEquipped( hero ) && charge == chargeCap && !cursed) { actions.add(AC_SUMMON); } if (isIdentified() && !cursed){ actions.add(AC_OUTFIT); } return actions; }
private void descend() throws IOException { if (Dungeon.hero == null) { DriedRose.clearHeldGhostHero(); Dungeon.init(); if (noStory) { Dungeon.chapters.add( WndStory.ID_SEWERS ); noStory = false; } GameLog.wipe(); } else { DriedRose.holdGhostHero( Dungeon.level ); Dungeon.saveAll(); } Level level; if (Dungeon.depth >= Statistics.deepestFloor) { level = Dungeon.newLevel(); } else { Dungeon.depth++; level = Dungeon.loadLevel( GamesInProgress.curSlot ); } Dungeon.switchLevel( level, level.entrance ); }
@Override public boolean doPickUp( Hero hero ) { DriedRose rose = hero.belongings.getItem( DriedRose.class ); if (rose == null){ GLog.w( Messages.get(this, "no_rose") ); return false; } if ( rose.level() >= rose.levelCap ){ GLog.i( Messages.get(this, "no_room") ); hero.spendAndNext(TIME_TO_PICK_UP); return true; } else { rose.upgrade(); if (rose.level() == rose.levelCap) { GLog.p( Messages.get(this, "maxlevel") ); } else GLog.i( Messages.get(this, "levelup") ); Sample.INSTANCE.play( Assets.SND_DEWDROP ); hero.spendAndNext(TIME_TO_PICK_UP); return true; } }
else if (!isEquipped( hero )) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); else if (charge != chargeCap) GLog.i( Messages.get(this, "no_charge") ); else if (cursed) GLog.i( Messages.get(this, "cursed") ); updateQuickslot();
"_-_ Max charges reduced from 3-8 to 2-6\n\n" + "_-_ Recharge speed has been reduced slightly" )); changes.addButton( new ChangeButton( new DriedRose().upgrade(10), "The ghost hero summoned by the rose is now much more capable and is also much less temporary:\n\n" + "_-_ Ghost can now be equipped with a weapon and armor and uses them just like the hero.\n" +
public int ghostStrength(){ return 13 + level()/2; }