v0.3.3a: bugfixes and safety checks to tengu and ranged attacks
This commit is contained in:
parent
fe1fade887
commit
2bb18fcd14
|
@ -114,6 +114,8 @@ public abstract class Char extends Actor {
|
|||
|
||||
public boolean attack( Char enemy ) {
|
||||
|
||||
if (enemy == null || !enemy.isAlive()) return false;
|
||||
|
||||
boolean visibleFight = Dungeon.visible[pos] || Dungeon.visible[enemy.pos];
|
||||
|
||||
if (hit( this, enemy, false )) {
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
|
||||
|
@ -75,11 +77,14 @@ public class TenguSprite extends MobSprite {
|
|||
public void attack( int cell ) {
|
||||
if (!Level.adjacent( cell, ch.pos )) {
|
||||
|
||||
final Char enemy = Actor.findChar(cell);
|
||||
|
||||
((MissileSprite)parent.recycle( MissileSprite.class )).
|
||||
reset( ch.pos, cell, new Shuriken(), new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
ch.onAttackComplete();
|
||||
ch.next();
|
||||
if (enemy != null) ch.attack(enemy);
|
||||
}
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user