v0.8.1: fixed shadows sfx playing on game load
This commit is contained in:
parent
79767810fc
commit
9cd9cb5730
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.blobs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Shadows;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Shadows;
|
||||||
|
@ -31,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
|
||||||
public class Foliage extends Blob {
|
public class Foliage extends Blob {
|
||||||
|
|
||||||
|
@ -65,7 +67,13 @@ public class Foliage extends Blob {
|
||||||
|
|
||||||
Hero hero = Dungeon.hero;
|
Hero hero = Dungeon.hero;
|
||||||
if (hero.isAlive() && hero.visibleEnemies() == 0 && cur[hero.pos] > 0) {
|
if (hero.isAlive() && hero.visibleEnemies() == 0 && cur[hero.pos] > 0) {
|
||||||
|
Shadows s = hero.buff(Shadows.class);
|
||||||
|
if (s == null){
|
||||||
Buff.affect( hero, Shadows.class ).prolong();
|
Buff.affect( hero, Shadows.class ).prolong();
|
||||||
|
Sample.INSTANCE.play( Assets.Sounds.MELD );
|
||||||
|
} else {
|
||||||
|
s.prolong();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
|
|
@ -56,7 +56,6 @@ public class Shadows extends Invisibility {
|
||||||
@Override
|
@Override
|
||||||
public boolean attachTo( Char target ) {
|
public boolean attachTo( Char target ) {
|
||||||
if (super.attachTo( target )) {
|
if (super.attachTo( target )) {
|
||||||
Sample.INSTANCE.play( Assets.Sounds.MELD );
|
|
||||||
if (Dungeon.level != null)
|
if (Dungeon.level != null)
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user