v0.7.4c: class armor abilities no longer affect allies
This commit is contained in:
parent
406ed4c6ca
commit
10b772a583
|
@ -22,6 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
|
||||
|
@ -40,7 +41,7 @@ public class HuntressArmor extends ClassArmor {
|
|||
image = ItemSpriteSheet.ARMOR_HUNTRESS;
|
||||
}
|
||||
|
||||
private HashMap<Callback, Mob> targets = new HashMap<Callback, Mob>();
|
||||
private HashMap<Callback, Mob> targets = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void doSpecial() {
|
||||
|
@ -49,7 +50,8 @@ public class HuntressArmor extends ClassArmor {
|
|||
|
||||
for (Mob mob : Dungeon.level.mobs) {
|
||||
if (Dungeon.level.distance(curUser.pos, mob.pos) <= 12
|
||||
&& Dungeon.level.heroFOV[mob.pos]) {
|
||||
&& Dungeon.level.heroFOV[mob.pos]
|
||||
&& mob.alignment != Char.Alignment.ALLY) {
|
||||
|
||||
Callback callback = new Callback() {
|
||||
@Override
|
||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||
|
@ -42,7 +43,8 @@ public class MageArmor extends ClassArmor {
|
|||
public void doSpecial() {
|
||||
|
||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
|
||||
if (Dungeon.level.heroFOV[mob.pos]) {
|
||||
if (Dungeon.level.heroFOV[mob.pos]
|
||||
&& mob.alignment != Char.Alignment.ALLY) {
|
||||
Buff.affect( mob, Burning.class ).reignite( mob );
|
||||
Buff.prolong( mob, Roots.class, 3 );
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
|
@ -68,8 +69,8 @@ public class RogueArmor extends ClassArmor {
|
|||
|
||||
curUser.HP -= (curUser.HP / 3);
|
||||
|
||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])) {
|
||||
if (Dungeon.level.heroFOV[mob.pos]) {
|
||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
|
||||
if (Dungeon.level.heroFOV[mob.pos] && mob.alignment != Char.Alignment.ALLY) {
|
||||
Buff.prolong( mob, Blindness.class, 2 );
|
||||
if (mob.state == mob.HUNTING) mob.state = mob.WANDERING;
|
||||
mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 );
|
||||
|
|
|
@ -79,7 +79,7 @@ public class WarriorArmor extends ClassArmor {
|
|||
|
||||
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
|
||||
Char mob = Actor.findChar(curUser.pos + PathFinder.NEIGHBOURS8[i]);
|
||||
if (mob != null && mob != curUser) {
|
||||
if (mob != null && mob != curUser && mob.alignment != Char.Alignment.ALLY) {
|
||||
Buff.prolong(mob, Paralysis.class, SHOCK_TIME);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user