v0.7.4: various bugfixes involving allies
This commit is contained in:
parent
9f73defba2
commit
5d65116170
|
@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Alchemy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AdrenalineSurge;
|
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.Awareness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
|
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) {
|
} 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 );
|
curAction = new HeroAction.Interact( ch );
|
||||||
} else {
|
} else {
|
||||||
curAction = new HeroAction.Attack( ch );
|
curAction = new HeroAction.Attack( ch );
|
||||||
|
|
|
@ -914,6 +914,7 @@ public abstract class Mob extends Char {
|
||||||
|
|
||||||
for (Mob ally : heldAllies) {
|
for (Mob ally : heldAllies) {
|
||||||
level.mobs.add(ally);
|
level.mobs.add(ally);
|
||||||
|
ally.state = ally.WANDERING;
|
||||||
|
|
||||||
if (!candidatePositions.isEmpty()){
|
if (!candidatePositions.isEmpty()){
|
||||||
ally.pos = candidatePositions.remove(0);
|
ally.pos = candidatePositions.remove(0);
|
||||||
|
|
|
@ -222,7 +222,7 @@ public class CavesBossLevel extends Level {
|
||||||
|
|
||||||
for (Mob m : mobs){
|
for (Mob m : mobs){
|
||||||
//bring the first ally with you
|
//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.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
|
||||||
m.sprite.place(m.pos);
|
m.sprite.place(m.pos);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class CityBossLevel extends Level {
|
||||||
|
|
||||||
for (Mob m : mobs){
|
for (Mob m : mobs){
|
||||||
//bring the first ally with you
|
//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.pos = Dungeon.hero.pos + (Random.Int(2) == 0 ? +1 : -1);
|
||||||
m.sprite.place(m.pos);
|
m.sprite.place(m.pos);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -415,7 +415,7 @@ public class PrisonBossLevel extends Level {
|
||||||
//remove all mobs, but preserve allies
|
//remove all mobs, but preserve allies
|
||||||
ArrayList<Mob> allies = new ArrayList<>();
|
ArrayList<Mob> allies = new ArrayList<>();
|
||||||
for(Mob m : mobs.toArray(new Mob[0])){
|
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);
|
allies.add(m);
|
||||||
mobs.remove(m);
|
mobs.remove(m);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user