v2.2.0: crystal guardians are no longer attackable by allies when downed
This commit is contained in:
+11
@@ -27,6 +27,7 @@ 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.Cripple;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
@@ -135,6 +136,16 @@ public class CrystalGuardian extends Mob{
|
|||||||
return super.isAlive();
|
return super.isAlive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isInvulnerable(Class effect) {
|
||||||
|
if (recovering){
|
||||||
|
//while recovering, immune to chars that aren't the hero or spire
|
||||||
|
// this is sort of a hack to prevent allies from attacking downed guardians
|
||||||
|
return super.isInvulnerable(effect) || (Char.class.isAssignableFrom(effect) && !Hero.class.isAssignableFrom(effect) && !CrystalSpire.class.isAssignableFrom(effect));
|
||||||
|
}
|
||||||
|
return super.isInvulnerable(effect);
|
||||||
|
}
|
||||||
|
|
||||||
public CrystalGuardian(){
|
public CrystalGuardian(){
|
||||||
super();
|
super();
|
||||||
switch (Random.Int(3)){
|
switch (Random.Int(3)){
|
||||||
|
|||||||
Reference in New Issue
Block a user