v2.0.0: fixed magical attacks causing crashes due to changing enemy ref
This commit is contained in:
@@ -149,6 +149,7 @@ public abstract class Elemental extends Mob {
|
||||
spend( 1f );
|
||||
|
||||
Invisibility.dispel(this);
|
||||
Char enemy = this.enemy;
|
||||
if (hit( this, enemy, true )) {
|
||||
|
||||
rangedProc( enemy );
|
||||
|
||||
@@ -112,6 +112,7 @@ public abstract class Shaman extends Mob {
|
||||
spend( 1f );
|
||||
|
||||
Invisibility.dispel(this);
|
||||
Char enemy = this.enemy;
|
||||
if (hit( this, enemy, true )) {
|
||||
|
||||
if (Random.Int( 2 ) == 0) {
|
||||
|
||||
@@ -105,6 +105,7 @@ public class Warlock extends Mob implements Callback {
|
||||
spend( TIME_TO_ZAP );
|
||||
|
||||
Invisibility.dispel(this);
|
||||
Char enemy = this.enemy;
|
||||
if (hit( this, enemy, true )) {
|
||||
//TODO would be nice for this to work on ghost/statues too
|
||||
if (enemy == Dungeon.hero && Random.Int( 2 ) == 0) {
|
||||
|
||||
@@ -314,6 +314,7 @@ public abstract class YogFist extends Mob {
|
||||
spend( 1f );
|
||||
|
||||
Invisibility.dispel(this);
|
||||
Char enemy = this.enemy;
|
||||
if (hit( this, enemy, true )) {
|
||||
|
||||
Buff.affect( enemy, Roots.class, 3f );
|
||||
@@ -471,6 +472,7 @@ public abstract class YogFist extends Mob {
|
||||
spend( 1f );
|
||||
|
||||
Invisibility.dispel(this);
|
||||
Char enemy = this.enemy;
|
||||
if (hit( this, enemy, true )) {
|
||||
|
||||
enemy.damage( Random.NormalIntRange(10, 20), new LightBeam() );
|
||||
@@ -536,6 +538,7 @@ public abstract class YogFist extends Mob {
|
||||
spend( 1f );
|
||||
|
||||
Invisibility.dispel(this);
|
||||
Char enemy = this.enemy;
|
||||
if (hit( this, enemy, true )) {
|
||||
|
||||
enemy.damage( Random.NormalIntRange(10, 20), new DarkBolt() );
|
||||
|
||||
@@ -331,6 +331,7 @@ public class WandOfWarding extends Wand {
|
||||
|
||||
//always hits
|
||||
int dmg = Random.NormalIntRange( 2 + wandLevel, 8 + 4*wandLevel );
|
||||
Char enemy = this.enemy;
|
||||
enemy.damage( dmg, this );
|
||||
if (enemy.isAlive()){
|
||||
Wand.wandProc(enemy, wandLevel, 1);
|
||||
|
||||
Reference in New Issue
Block a user