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;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
|
||||
@@ -38,9 +40,20 @@ public class Amok extends FlavourBuff {
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
super.detach();
|
||||
if (target instanceof Mob && target.isAlive()) {
|
||||
((Mob) target).aggro(null);
|
||||
//if our target is an enemy, reset any enemy-to-enemy aggro involving it
|
||||
if (target.isAlive()) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class StoneOfAggression extends Runestone {
|
||||
|
||||
@Override
|
||||
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.alignment == Char.Alignment.ENEMY) {
|
||||
for (Mob m : Dungeon.level.mobs) {
|
||||
|
||||
Reference in New Issue
Block a user