v0.9.4: fixed a few more ankh edge cases

This commit is contained in:
Evan Debenham
2021-07-28 20:46:12 -04:00
parent 1a35359edb
commit c0d064d91b
11 changed files with 28 additions and 8 deletions
@@ -377,7 +377,6 @@ public class Dungeon {
hero.curAction = hero.lastAction = null; hero.curAction = hero.lastAction = null;
observe();
try { try {
saveAll(); saveAll();
} catch (IOException e) { } catch (IOException e) {
@@ -45,6 +45,9 @@ public class Buff extends Actor {
//whether or not the buff announces its name //whether or not the buff announces its name
public boolean announced = false; public boolean announced = false;
//whether a buff should persist through revive effects for the hero
public boolean revivePersists = false;
protected HashSet<Class> resistances = new HashSet<>(); protected HashSet<Class> resistances = new HashSet<>();
public HashSet<Class> resistances() { public HashSet<Class> resistances() {
@@ -380,7 +380,7 @@ public class Hero extends Char {
public void live() { public void live() {
for (Buff b : buffs()){ for (Buff b : buffs()){
b.detach(); if (!b.revivePersists) b.detach();
} }
Buff.affect( this, Regeneration.class ); Buff.affect( this, Regeneration.class );
Buff.affect( this, Hunger.class ); Buff.affect( this, Hunger.class );
@@ -157,7 +157,7 @@ public enum Talent {
}; };
public static class LethalMomentumTracker extends FlavourBuff{}; public static class LethalMomentumTracker extends FlavourBuff{};
public static class StrikingWaveTracker extends FlavourBuff{}; public static class StrikingWaveTracker extends FlavourBuff{};
public static class WandPreservationCounter extends CounterBuff{}; public static class WandPreservationCounter extends CounterBuff{{revivePersists = true;}};
public static class EmpoweredStrikeTracker extends FlavourBuff{}; public static class EmpoweredStrikeTracker extends FlavourBuff{};
public static class BountyHunterTracker extends FlavourBuff{}; public static class BountyHunterTracker extends FlavourBuff{};
public static class RejuvenatingStepsCooldown extends FlavourBuff{ public static class RejuvenatingStepsCooldown extends FlavourBuff{
@@ -167,7 +167,7 @@ public enum Talent {
public String toString() { return Messages.get(this, "name"); } public String toString() { return Messages.get(this, "name"); }
public String desc() { return Messages.get(this, "desc", dispTurns(visualcooldown())); } public String desc() { return Messages.get(this, "desc", dispTurns(visualcooldown())); }
}; };
public static class RejuvenatingStepsFurrow extends CounterBuff{}; public static class RejuvenatingStepsFurrow extends CounterBuff{{revivePersists = true;}};
public static class SeerShotCooldown extends FlavourBuff{ public static class SeerShotCooldown extends FlavourBuff{
public int icon() { return target.buff(RevealedArea.class) != null ? BuffIndicator.NONE : BuffIndicator.TIME; } public int icon() { return target.buff(RevealedArea.class) != null ? BuffIndicator.NONE : BuffIndicator.TIME; }
public void tintIcon(Image icon) { icon.hardlight(0.7f, 0.4f, 0.7f); } public void tintIcon(Image icon) { icon.hardlight(0.7f, 0.4f, 0.7f); }
@@ -269,8 +269,8 @@ public enum Talent {
} }
} }
public static class CachedRationsDropped extends CounterBuff{}; public static class CachedRationsDropped extends CounterBuff{{revivePersists = true;}};
public static class NatureBerriesAvailable extends CounterBuff{}; public static class NatureBerriesAvailable extends CounterBuff{{revivePersists = true;}};
public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){ public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){
if (hero.hasTalent(HEARTY_MEAL)){ if (hero.hasTalent(HEARTY_MEAL)){
@@ -212,6 +212,10 @@ public class WarpBeacon extends ArmorAbility {
public static class WarpBeaconTracker extends Buff { public static class WarpBeaconTracker extends Buff {
{
revivePersists = true;
}
int pos; int pos;
int depth; int depth;
@@ -55,6 +55,10 @@ public class Noisemaker extends Bomb {
public static class Trigger extends Buff { public static class Trigger extends Buff {
{
revivePersists = true;
}
int cell; int cell;
int floor; int floor;
int left; int left;
@@ -63,5 +63,5 @@ public class Berry extends Food {
return 5 * quantity; return 5 * quantity;
} }
public static class SeedCounter extends CounterBuff{}; public static class SeedCounter extends CounterBuff{{revivePersists = true;}};
} }
@@ -66,6 +66,10 @@ public class HeavyBoomerang extends MissileWeapon {
public static class CircleBack extends Buff { public static class CircleBack extends Buff {
{
revivePersists = true;
}
private MissileWeapon boomerang; private MissileWeapon boomerang;
private int thrownPos; private int thrownPos;
private int returnPos; private int returnPos;
@@ -73,6 +73,10 @@ public class PitfallTrap extends Trap {
public static class DelayedPit extends FlavourBuff { public static class DelayedPit extends FlavourBuff {
{
revivePersists = true;
}
int pos; int pos;
int depth; int depth;
@@ -361,9 +361,10 @@ public class GameScene extends PixelScene {
switch (InterlevelScene.mode) { switch (InterlevelScene.mode) {
case RESURRECT: case RESURRECT:
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos ); ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );
SpellSprite.show(Dungeon.hero, SpellSprite.ANKH); SpellSprite.show(Dungeon.hero, SpellSprite.ANKH);
new Flare( 5, 16 ).color( 0xFFFF00, true ).show( hero, 6f ) ; new Flare( 5, 16 ).color( 0xFFFF00, true ).show( hero, 4f ) ;
break; break;
case RETURN: case RETURN:
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos ); ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );
@@ -455,6 +455,7 @@ public class InterlevelScene extends PixelScene {
} else { } else {
Dungeon.hero.resurrect(); Dungeon.hero.resurrect();
level = Dungeon.level; level = Dungeon.level;
BArray.setFalse(level.heroFOV);
BArray.setFalse(level.visited); BArray.setFalse(level.visited);
BArray.setFalse(level.mapped); BArray.setFalse(level.mapped);
int invPos = Dungeon.hero.pos; int invPos = Dungeon.hero.pos;