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

View File

@ -377,7 +377,6 @@ public class Dungeon {
hero.curAction = hero.lastAction = null;
observe();
try {
saveAll();
} catch (IOException e) {

View File

@ -44,6 +44,9 @@ public class Buff extends Actor {
//whether or not the buff announces its name
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<>();

View File

@ -380,7 +380,7 @@ public class Hero extends Char {
public void live() {
for (Buff b : buffs()){
b.detach();
if (!b.revivePersists) b.detach();
}
Buff.affect( this, Regeneration.class );
Buff.affect( this, Hunger.class );

View File

@ -157,7 +157,7 @@ public enum Talent {
};
public static class LethalMomentumTracker 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 BountyHunterTracker 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 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 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); }
@ -269,8 +269,8 @@ public enum Talent {
}
}
public static class CachedRationsDropped extends CounterBuff{};
public static class NatureBerriesAvailable extends CounterBuff{};
public static class CachedRationsDropped extends CounterBuff{{revivePersists = true;}};
public static class NatureBerriesAvailable extends CounterBuff{{revivePersists = true;}};
public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){
if (hero.hasTalent(HEARTY_MEAL)){

View File

@ -212,6 +212,10 @@ public class WarpBeacon extends ArmorAbility {
public static class WarpBeaconTracker extends Buff {
{
revivePersists = true;
}
int pos;
int depth;

View File

@ -55,6 +55,10 @@ public class Noisemaker extends Bomb {
public static class Trigger extends Buff {
{
revivePersists = true;
}
int cell;
int floor;
int left;

View File

@ -63,5 +63,5 @@ public class Berry extends Food {
return 5 * quantity;
}
public static class SeedCounter extends CounterBuff{};
public static class SeedCounter extends CounterBuff{{revivePersists = true;}};
}

View File

@ -65,6 +65,10 @@ public class HeavyBoomerang extends MissileWeapon {
}
public static class CircleBack extends Buff {
{
revivePersists = true;
}
private MissileWeapon boomerang;
private int thrownPos;

View File

@ -73,6 +73,10 @@ public class PitfallTrap extends Trap {
public static class DelayedPit extends FlavourBuff {
{
revivePersists = true;
}
int pos;
int depth;

View File

@ -361,9 +361,10 @@ public class GameScene extends PixelScene {
switch (InterlevelScene.mode) {
case RESURRECT:
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );
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;
case RETURN:
ScrollOfTeleportation.appear( Dungeon.hero, Dungeon.hero.pos );

View File

@ -455,6 +455,7 @@ public class InterlevelScene extends PixelScene {
} else {
Dungeon.hero.resurrect();
level = Dungeon.level;
BArray.setFalse(level.heroFOV);
BArray.setFalse(level.visited);
BArray.setFalse(level.mapped);
int invPos = Dungeon.hero.pos;