v2.3.0: fixed potion shatters not cleansing fire/ooze outside of FOV

This commit is contained in:
Evan Debenham
2023-10-30 14:08:04 -04:00
parent 008a65140a
commit cf8e53f9aa
17 changed files with 42 additions and 39 deletions

View File

@@ -315,10 +315,10 @@ public class Potion extends Item {
}
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
GLog.i( Messages.get(Potion.class, "shatter") );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
splash( cell );
}
}
@@ -391,20 +391,23 @@ public class Potion extends Item {
}
protected void splash( int cell ) {
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
if (fire != null)
fire.clear( cell );
final int color = splashColor();
if (fire != null) {
fire.clear(cell);
}
Char ch = Actor.findChar(cell);
if (ch != null && ch.alignment == Char.Alignment.ALLY) {
Buff.detach(ch, Burning.class);
Buff.detach(ch, Ooze.class);
Splash.at( ch.sprite.center(), color, 5 );
} else {
Splash.at( cell, color, 5 );
}
if (Dungeon.level.heroFOV[cell]) {
if (ch != null) {
Splash.at(ch.sprite.center(), splashColor(), 5);
} else {
Splash.at(cell, splashColor(), 5);
}
}
}

View File

@@ -38,11 +38,11 @@ public class PotionOfFrost extends Potion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
}

View File

@@ -43,10 +43,10 @@ public class PotionOfLevitation extends Potion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -39,10 +39,10 @@ public class PotionOfLiquidFlame extends Potion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.BURNING );
}

View File

@@ -38,10 +38,10 @@ public class PotionOfParalyticGas extends Potion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -77,10 +77,10 @@ public class PotionOfPurity extends Potion {
}
}
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
splash(cell);
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
identify();

View File

@@ -38,10 +38,10 @@ public class PotionOfToxicGas extends Potion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -40,8 +40,8 @@ public class BlizzardBrew extends Brew {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -43,9 +43,9 @@ public class CausticBrew extends Brew {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
}

View File

@@ -40,9 +40,9 @@ public class InfernalBrew extends Brew {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -41,8 +41,8 @@ public class ShockingBrew extends Brew {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
}

View File

@@ -51,9 +51,9 @@ public class ElixirOfHoneyedHealing extends Elixir {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
splash( cell );
}
Char ch = Actor.findChar(cell);

View File

@@ -56,9 +56,9 @@ public class PotionOfCleansing extends ExoticPotion {
if (Actor.findChar(cell) == null){
super.shatter(cell);
} else {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
splash(cell);
identify();
}

View File

@@ -38,11 +38,11 @@ public class PotionOfCorrosiveGas extends ExoticPotion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -38,11 +38,11 @@ public class PotionOfShroudingFog extends ExoticPotion {
@Override
public void shatter( int cell ) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}

View File

@@ -40,11 +40,11 @@ public class PotionOfSnapFreeze extends ExoticPotion {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
}

View File

@@ -38,11 +38,11 @@ public class PotionOfStormClouds extends ExoticPotion {
@Override
public void shatter(int cell) {
splash( cell );
if (Dungeon.level.heroFOV[cell]) {
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );
}