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