v0.9.2: improved DM-300's ability to attack enemies it cannot see
This commit is contained in:
parent
45ac5377dc
commit
3df509b6f2
|
@ -54,6 +54,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCavesBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCavesBossLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ConeAOE;
|
||||||
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.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
|
@ -194,13 +195,16 @@ public class NewDM300 extends Mob {
|
||||||
|
|
||||||
if (enemy == null && Dungeon.hero.invisible <= 0) enemy = Dungeon.hero;
|
if (enemy == null && Dungeon.hero.invisible <= 0) enemy = Dungeon.hero;
|
||||||
|
|
||||||
|
//more aggressive ability usage when DM can't reach its target
|
||||||
if (enemy != null && !canReach){
|
if (enemy != null && !canReach){
|
||||||
|
|
||||||
if (fieldOfView[enemy.pos] && turnsSinceLastAbility >= MIN_COOLDOWN){
|
//try to fire gas at an enemy we can't reach
|
||||||
|
if (turnsSinceLastAbility >= MIN_COOLDOWN){
|
||||||
|
//use a coneAOE to try and account for trickshotting angles
|
||||||
|
ConeAOE aim = new ConeAOE(new Ballistica(pos, enemy.pos, Ballistica.PROJECTILE), 30);
|
||||||
|
if (aim.cells.contains(enemy.pos)) {
|
||||||
lastAbility = GAS;
|
lastAbility = GAS;
|
||||||
turnsSinceLastAbility = 0;
|
turnsSinceLastAbility = 0;
|
||||||
spend(TICK);
|
|
||||||
|
|
||||||
GLog.w(Messages.get(this, "vent"));
|
GLog.w(Messages.get(this, "vent"));
|
||||||
if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
|
if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
|
||||||
|
@ -211,6 +215,20 @@ public class NewDM300 extends Mob {
|
||||||
Sample.INSTANCE.play(Assets.Sounds.GAS);
|
Sample.INSTANCE.play(Assets.Sounds.GAS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
//if we can't gas, then drop rocks
|
||||||
|
} else {
|
||||||
|
lastAbility = GAS;
|
||||||
|
turnsSinceLastAbility = 0;
|
||||||
|
GLog.w(Messages.get(this, "rocks"));
|
||||||
|
if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
|
||||||
|
((DM300Sprite)sprite).slam(enemy.pos);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
dropRocks(enemy);
|
||||||
|
Sample.INSTANCE.play(Assets.Sounds.ROCKS);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user