v0.7.0: bugfixes:

- fixed preparation not being cleared with invisibility in some cases
- fixed the ghost hero rarely attacking nonexistant enemies
- fixed elixir of vitality
- fixed wand of blast wave registering a dungeon fail when it isn't what killed the hero
- fixed bones rarely appearing inside of bookcases on floor 20
This commit is contained in:
Evan Debenham 2018-10-06 00:13:15 -04:00
parent 702401607b
commit a6d744c6a7
5 changed files with 16 additions and 8 deletions

View File

@ -104,6 +104,11 @@ public class Invisibility extends FlavourBuff {
timeFreeze.detach(); timeFreeze.detach();
} }
Preparation prep = Dungeon.hero.buff( Preparation.class );
if (prep != null){
prep.detach();
}
Swiftthistle.TimeBubble bubble = Dungeon.hero.buff( Swiftthistle.TimeBubble.class ); Swiftthistle.TimeBubble bubble = Dungeon.hero.buff( Swiftthistle.TimeBubble.class );
if (bubble != null){ if (bubble != null){
bubble.detach(); bubble.detach();

View File

@ -474,7 +474,8 @@ public class DriedRose extends Artifact {
Char enemy = super.chooseEnemy(); Char enemy = super.chooseEnemy();
//will never attack something far from the player //will never attack something far from the player
if (enemy != null && Dungeon.level.distance(enemy.pos, Dungeon.hero.pos) <= 8){ if (enemy != null && Dungeon.level.mobs.contains(enemy)
&& Dungeon.level.distance(enemy.pos, Dungeon.hero.pos) <= 8){
return enemy; return enemy;
} else { } else {
return null; return null;

View File

@ -38,6 +38,7 @@ public class ElixirOfVitality extends Elixir {
@Override @Override
public void apply(Hero hero) { public void apply(Hero hero) {
Buff.affect( hero, Healing.class ).setHeal((int)(0.8f*hero.HT + 14), 0.25f, 0); Buff.affect( hero, Healing.class ).setHeal((int)(0.8f*hero.HT + 14), 0.25f, 0);
PotionOfHealing.cure(hero);
Buff.affect(hero, Barrier.class).set((int)(0.6f*hero.HT + 10)); Buff.affect(hero, Barrier.class).set((int)(0.6f*hero.HT + 10));
} }

View File

@ -84,6 +84,9 @@ public class WandOfBlastWave extends DamageWand {
Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT); Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT);
int strength = 1 + Math.round(level() / 2f); int strength = 1 + Math.round(level() / 2f);
throwChar(ch, trajectory, strength); throwChar(ch, trajectory, strength);
} else if (ch == Dungeon.hero){
Dungeon.fail( getClass() );
GLog.n( Messages.get( this, "ondeath") );
} }
} }
} }
@ -100,11 +103,7 @@ public class WandOfBlastWave extends DamageWand {
throwChar(ch, trajectory, strength); throwChar(ch, trajectory, strength);
} }
} }
if (!curUser.isAlive()) {
Dungeon.fail( getClass() );
GLog.n( Messages.get( this, "ondeath") );
}
} }
public static void throwChar(final Char ch, final Ballistica trajectory, int power){ public static void throwChar(final Char ch, final Ballistica trajectory, int power){
@ -140,6 +139,7 @@ public class WandOfBlastWave extends DamageWand {
} }
Dungeon.level.press(ch.pos, ch, true); Dungeon.level.press(ch.pos, ch, true);
if (ch == Dungeon.hero){ if (ch == Dungeon.hero){
//FIXME currently no logic here if the throw effect kills the hero
Dungeon.observe(); Dungeon.observe();
} }
} }

View File

@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.King;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
@ -165,13 +166,13 @@ public class CityBossLevel extends Level {
@Override @Override
protected void createItems() { protected void createItems() {
Item item = Bones.get(); Item item = new Gold(10);
if (item != null) { if (item != null) {
int pos; int pos;
do { do {
pos = pos =
Random.IntRange( LEFT + 1, LEFT + HALL_WIDTH - 2 ) + Random.IntRange( LEFT + 1, LEFT + HALL_WIDTH - 2 ) +
Random.IntRange( TOP + HALL_HEIGHT + 1, TOP + HALL_HEIGHT + CHAMBER_HEIGHT ) * width(); Random.IntRange( TOP + HALL_HEIGHT + 2, TOP + HALL_HEIGHT + CHAMBER_HEIGHT ) * width();
} while (pos == entrance); } while (pos == entrance);
drop( item, pos ).type = Heap.Type.REMAINS; drop( item, pos ).type = Heap.Type.REMAINS;
} }