v0.7.4: various bugfixes involving allies

This commit is contained in:
Evan Debenham 2019-07-11 21:52:35 -04:00
parent 9f73defba2
commit 5d65116170
5 changed files with 6 additions and 4 deletions

View File

@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AdrenalineSurge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
@ -1197,7 +1198,7 @@ public class Hero extends Char {
} else if (fieldOfView[cell] && (ch = Actor.findChar( cell )) instanceof Mob) {
if (ch.alignment != Alignment.ENEMY) {
if (ch.alignment != Alignment.ENEMY && ch.buff(Amok.class) == null) {
curAction = new HeroAction.Interact( ch );
} else {
curAction = new HeroAction.Attack( ch );

View File

@ -914,6 +914,7 @@ public abstract class Mob extends Char {
for (Mob ally : heldAllies) {
level.mobs.add(ally);
ally.state = ally.WANDERING;
if (!candidatePositions.isEmpty()){
ally.pos = candidatePositions.remove(0);

View File

@ -222,7 +222,7 @@ public class CavesBossLevel extends Level {
for (Mob m : mobs){
//bring the first ally with you
if (m.alignment == Char.Alignment.ALLY){
if (m.alignment == Char.Alignment.ALLY && !m.properties().contains(Char.Property.IMMOVABLE)){
m.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
m.sprite.place(m.pos);
break;

View File

@ -193,7 +193,7 @@ public class CityBossLevel extends Level {
for (Mob m : mobs){
//bring the first ally with you
if (m.alignment == Char.Alignment.ALLY){
if (m.alignment == Char.Alignment.ALLY && !m.properties().contains(Char.Property.IMMOVABLE)){
m.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
m.sprite.place(m.pos);
break;

View File

@ -415,7 +415,7 @@ public class PrisonBossLevel extends Level {
//remove all mobs, but preserve allies
ArrayList<Mob> allies = new ArrayList<>();
for(Mob m : mobs.toArray(new Mob[0])){
if (m.alignment == Char.Alignment.ALLY){
if (m.alignment == Char.Alignment.ALLY && !m.properties().contains(Char.Property.IMMOVABLE)){
allies.add(m);
mobs.remove(m);
}