v2.3.0: fixed potion shatters not cleansing fire/ooze outside of FOV
This commit is contained in:
+12
-9
@@ -315,10 +315,10 @@ public class Potion extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
GLog.i( Messages.get(Potion.class, "shatter") );
|
GLog.i( Messages.get(Potion.class, "shatter") );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
splash( cell );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,20 +391,23 @@ public class Potion extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void splash( int cell ) {
|
protected void splash( int cell ) {
|
||||||
|
|
||||||
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
|
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
|
||||||
if (fire != null)
|
if (fire != null) {
|
||||||
fire.clear( cell );
|
fire.clear(cell);
|
||||||
|
}
|
||||||
final int color = splashColor();
|
|
||||||
|
|
||||||
Char ch = Actor.findChar(cell);
|
Char ch = Actor.findChar(cell);
|
||||||
if (ch != null && ch.alignment == Char.Alignment.ALLY) {
|
if (ch != null && ch.alignment == Char.Alignment.ALLY) {
|
||||||
Buff.detach(ch, Burning.class);
|
Buff.detach(ch, Burning.class);
|
||||||
Buff.detach(ch, Ooze.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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -38,11 +38,11 @@ public class PotionOfFrost extends Potion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -43,10 +43,10 @@ public class PotionOfLevitation extends Potion {
|
|||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -39,10 +39,10 @@ public class PotionOfLiquidFlame extends Potion {
|
|||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.BURNING );
|
Sample.INSTANCE.play( Assets.Sounds.BURNING );
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -38,10 +38,10 @@ public class PotionOfParalyticGas extends Potion {
|
|||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -77,10 +77,10 @@ public class PotionOfPurity extends Potion {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
splash(cell);
|
|
||||||
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
|
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
|
||||||
|
|
||||||
identify();
|
identify();
|
||||||
|
|||||||
+1
-1
@@ -38,10 +38,10 @@ public class PotionOfToxicGas extends Potion {
|
|||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -40,8 +40,8 @@ public class BlizzardBrew extends Brew {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -43,9 +43,9 @@ public class CausticBrew extends Brew {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -40,9 +40,9 @@ public class InfernalBrew extends Brew {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -41,8 +41,8 @@ public class ShockingBrew extends Brew {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
|
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -51,9 +51,9 @@ public class ElixirOfHoneyedHealing extends Elixir {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
splash( cell );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Char ch = Actor.findChar(cell);
|
Char ch = Actor.findChar(cell);
|
||||||
|
|||||||
+1
-1
@@ -56,9 +56,9 @@ public class PotionOfCleansing extends ExoticPotion {
|
|||||||
if (Actor.findChar(cell) == null){
|
if (Actor.findChar(cell) == null){
|
||||||
super.shatter(cell);
|
super.shatter(cell);
|
||||||
} else {
|
} else {
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
|
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
|
||||||
splash(cell);
|
|
||||||
identify();
|
identify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -38,11 +38,11 @@ public class PotionOfCorrosiveGas extends ExoticPotion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -38,11 +38,11 @@ public class PotionOfShroudingFog extends ExoticPotion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter( int cell ) {
|
public void shatter( int cell ) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -40,11 +40,11 @@ public class PotionOfSnapFreeze extends ExoticPotion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -38,11 +38,11 @@ public class PotionOfStormClouds extends ExoticPotion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shatter(int cell) {
|
public void shatter(int cell) {
|
||||||
|
|
||||||
|
splash( cell );
|
||||||
if (Dungeon.level.heroFOV[cell]) {
|
if (Dungeon.level.heroFOV[cell]) {
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
splash( cell );
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
Sample.INSTANCE.play( Assets.Sounds.GAS );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user