v0.7.4c: class armor abilities no longer affect allies

This commit is contained in:
Evan Debenham 2019-08-12 15:21:11 -04:00
parent 406ed4c6ca
commit 10b772a583
4 changed files with 11 additions and 6 deletions

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.armor; package com.shatteredpixel.shatteredpixeldungeon.items.armor;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; 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.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken;
@ -40,7 +41,7 @@ public class HuntressArmor extends ClassArmor {
image = ItemSpriteSheet.ARMOR_HUNTRESS; image = ItemSpriteSheet.ARMOR_HUNTRESS;
} }
private HashMap<Callback, Mob> targets = new HashMap<Callback, Mob>(); private HashMap<Callback, Mob> targets = new HashMap<>();
@Override @Override
public void doSpecial() { public void doSpecial() {
@ -49,7 +50,8 @@ public class HuntressArmor extends ClassArmor {
for (Mob mob : Dungeon.level.mobs) { for (Mob mob : Dungeon.level.mobs) {
if (Dungeon.level.distance(curUser.pos, mob.pos) <= 12 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() { Callback callback = new Callback() {
@Override @Override

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; 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.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
@ -42,7 +43,8 @@ public class MageArmor extends ClassArmor {
public void doSpecial() { public void doSpecial() {
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) { 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.affect( mob, Burning.class ).reignite( mob );
Buff.prolong( mob, Roots.class, 3 ); Buff.prolong( mob, Roots.class, 3 );
} }

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; 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.Blindness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
@ -68,8 +69,8 @@ public class RogueArmor extends ClassArmor {
curUser.HP -= (curUser.HP / 3); curUser.HP -= (curUser.HP / 3);
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])) { 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.prolong( mob, Blindness.class, 2 ); Buff.prolong( mob, Blindness.class, 2 );
if (mob.state == mob.HUNTING) mob.state = mob.WANDERING; if (mob.state == mob.HUNTING) mob.state = mob.WANDERING;
mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 ); mob.sprite.emitter().burst( Speck.factory( Speck.LIGHT ), 4 );

View File

@ -79,7 +79,7 @@ public class WarriorArmor extends ClassArmor {
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
Char mob = Actor.findChar(curUser.pos + PathFinder.NEIGHBOURS8[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); Buff.prolong(mob, Paralysis.class, SHOCK_TIME);
} }
} }