v2.3.0: fixed amok not properly resetting aggro in some cases
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
|
||||||
@@ -38,9 +40,20 @@ public class Amok extends FlavourBuff {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
super.detach();
|
//if our target is an enemy, reset any enemy-to-enemy aggro involving it
|
||||||
if (target instanceof Mob && target.isAlive()) {
|
if (target.isAlive()) {
|
||||||
((Mob) target).aggro(null);
|
if (target.alignment == Char.Alignment.ENEMY) {
|
||||||
|
for (Mob m : Dungeon.level.mobs) {
|
||||||
|
if (m.alignment == Char.Alignment.ENEMY && m.isTargeting(target)) {
|
||||||
|
m.aggro(null);
|
||||||
|
}
|
||||||
|
if (target instanceof Mob && ((Mob) target).isTargeting(m)){
|
||||||
|
((Mob) target).aggro(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ public class StoneOfAggression extends Runestone {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
//if our target is an enemy, reset the aggro of any enemies targeting it
|
//if our target is an enemy, reset any enemy-to-enemy aggro involving it
|
||||||
if (target.isAlive()) {
|
if (target.isAlive()) {
|
||||||
if (target.alignment == Char.Alignment.ENEMY) {
|
if (target.alignment == Char.Alignment.ENEMY) {
|
||||||
for (Mob m : Dungeon.level.mobs) {
|
for (Mob m : Dungeon.level.mobs) {
|
||||||
|
|||||||
Reference in New Issue
Block a user