v0.9.2: fixed various vfx issues with Goo when it is not visible
This commit is contained in:
parent
8992a492eb
commit
13588b1699
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
|
@ -40,7 +39,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.GooSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.audio.Sample;
|
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
import com.watabou.utils.PathFinder;
|
import com.watabou.utils.PathFinder;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
@ -66,7 +64,6 @@ public class Goo extends Mob {
|
||||||
int max = (HP*2 <= HT) ? 12 : 8;
|
int max = (HP*2 <= HT) ? 12 : 8;
|
||||||
if (pumpedUp > 0) {
|
if (pumpedUp > 0) {
|
||||||
pumpedUp = 0;
|
pumpedUp = 0;
|
||||||
Sample.INSTANCE.play( Assets.Sounds.BURNING );
|
|
||||||
return Random.NormalIntRange( min*3, max*3 );
|
return Random.NormalIntRange( min*3, max*3 );
|
||||||
} else {
|
} else {
|
||||||
return Random.NormalIntRange( min, max );
|
return Random.NormalIntRange( min, max );
|
||||||
|
@ -95,7 +92,9 @@ public class Goo extends Mob {
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
|
|
||||||
if (Dungeon.level.water[pos] && HP < HT) {
|
if (Dungeon.level.water[pos] && HP < HT) {
|
||||||
|
if (Dungeon.level.heroFOV[pos] ){
|
||||||
sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
||||||
|
}
|
||||||
if (HP*2 == HT) {
|
if (HP*2 == HT) {
|
||||||
BossHealthBar.bleed(false);
|
BossHealthBar.bleed(false);
|
||||||
((GooSprite)sprite).spray(false);
|
((GooSprite)sprite).spray(false);
|
||||||
|
@ -144,7 +143,6 @@ public class Goo extends Mob {
|
||||||
if (pumpedUp == 1) {
|
if (pumpedUp == 1) {
|
||||||
((GooSprite)sprite).pumpUp( 2 );
|
((GooSprite)sprite).pumpUp( 2 );
|
||||||
pumpedUp++;
|
pumpedUp++;
|
||||||
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP );
|
|
||||||
|
|
||||||
spend( attackDelay() );
|
spend( attackDelay() );
|
||||||
|
|
||||||
|
@ -161,6 +159,7 @@ public class Goo extends Mob {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
attack( enemy );
|
attack( enemy );
|
||||||
|
((GooSprite)sprite).triggerEmitters();
|
||||||
}
|
}
|
||||||
|
|
||||||
spend( attackDelay() );
|
spend( attackDelay() );
|
||||||
|
@ -176,7 +175,6 @@ public class Goo extends Mob {
|
||||||
if (Dungeon.level.heroFOV[pos]) {
|
if (Dungeon.level.heroFOV[pos]) {
|
||||||
sprite.showStatus( CharSprite.NEGATIVE, Messages.get(this, "!!!") );
|
sprite.showStatus( CharSprite.NEGATIVE, Messages.get(this, "!!!") );
|
||||||
GLog.n( Messages.get(this, "pumpup") );
|
GLog.n( Messages.get(this, "pumpup") );
|
||||||
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP, 1f, 0.8f );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spend( attackDelay() );
|
spend( attackDelay() );
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||||
import com.watabou.noosa.TextureFilm;
|
import com.watabou.noosa.TextureFilm;
|
||||||
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.noosa.particles.Emitter;
|
import com.watabou.noosa.particles.Emitter;
|
||||||
import com.watabou.noosa.particles.Emitter.Factory;
|
import com.watabou.noosa.particles.Emitter.Factory;
|
||||||
import com.watabou.noosa.particles.PixelParticle;
|
import com.watabou.noosa.particles.PixelParticle;
|
||||||
|
@ -87,12 +88,10 @@ public class GooSprite extends MobSprite {
|
||||||
|
|
||||||
public void pumpUp( int warnDist ) {
|
public void pumpUp( int warnDist ) {
|
||||||
if (warnDist == 0){
|
if (warnDist == 0){
|
||||||
for (Emitter e : pumpUpEmitters){
|
clearEmitters();
|
||||||
e.on = false;
|
|
||||||
}
|
|
||||||
pumpUpEmitters.clear();
|
|
||||||
} else {
|
} else {
|
||||||
play(pump);
|
play(pump);
|
||||||
|
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP, 1f, warnDist == 1 ? 0.8f : 1f );
|
||||||
PathFinder.buildDistanceMap(ch.pos, BArray.not(Dungeon.level.solid, null), 2);
|
PathFinder.buildDistanceMap(ch.pos, BArray.not(Dungeon.level.solid, null), 2);
|
||||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||||
if (PathFinder.distance[i] <= warnDist) {
|
if (PathFinder.distance[i] <= warnDist) {
|
||||||
|
@ -104,15 +103,27 @@ public class GooSprite extends MobSprite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearEmitters(){
|
||||||
|
for (Emitter e : pumpUpEmitters){
|
||||||
|
e.on = false;
|
||||||
|
}
|
||||||
|
pumpUpEmitters.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void triggerEmitters(){
|
||||||
|
for (Emitter e : pumpUpEmitters){
|
||||||
|
e.burst(ElmoParticle.FACTORY, 10);
|
||||||
|
}
|
||||||
|
Sample.INSTANCE.play( Assets.Sounds.BURNING );
|
||||||
|
pumpUpEmitters.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public void pumpAttack() { play(pumpAttack); }
|
public void pumpAttack() { play(pumpAttack); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void play(Animation anim) {
|
public void play(Animation anim) {
|
||||||
if (anim != pump && anim != pumpAttack){
|
if (anim != pump && anim != pumpAttack){
|
||||||
for (Emitter e : pumpUpEmitters){
|
clearEmitters();
|
||||||
e.on = false;
|
|
||||||
}
|
|
||||||
pumpUpEmitters.clear();
|
|
||||||
}
|
}
|
||||||
super.play(anim);
|
super.play(anim);
|
||||||
}
|
}
|
||||||
|
@ -177,10 +188,7 @@ public class GooSprite extends MobSprite {
|
||||||
|
|
||||||
if (anim == pumpAttack) {
|
if (anim == pumpAttack) {
|
||||||
|
|
||||||
for (Emitter e : pumpUpEmitters){
|
triggerEmitters();
|
||||||
e.burst(ElmoParticle.FACTORY, 10);
|
|
||||||
}
|
|
||||||
pumpUpEmitters.clear();
|
|
||||||
|
|
||||||
idle();
|
idle();
|
||||||
ch.onAttackComplete();
|
ch.onAttackComplete();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user