v0.8.2c: various minor fixes for Yog-Dzewa:
- Yog now calculates its FOV and can be surprised from outside of it - Yog is now formally immune to freeze/paralysis, instead of just being unaffected - Yog now properly pushes items
This commit is contained in:
parent
220c96fbb5
commit
5b7ef9dacf
|
@ -133,6 +133,12 @@ public abstract class Char extends Actor {
|
||||||
|
|
||||||
//throw any items that are on top of an immovable char
|
//throw any items that are on top of an immovable char
|
||||||
if (properties.contains(Property.IMMOVABLE)){
|
if (properties.contains(Property.IMMOVABLE)){
|
||||||
|
throwItems();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void throwItems(){
|
||||||
Heap heap = Dungeon.level.heaps.get( pos );
|
Heap heap = Dungeon.level.heaps.get( pos );
|
||||||
if (heap != null && heap.type == Heap.Type.HEAP) {
|
if (heap != null && heap.type == Heap.Type.HEAP) {
|
||||||
int n;
|
int n;
|
||||||
|
@ -142,8 +148,6 @@ public abstract class Char extends Actor {
|
||||||
Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( pos );
|
Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String name(){
|
public String name(){
|
||||||
return Messages.get(this, "name");
|
return Messages.get(this, "name");
|
||||||
|
|
|
@ -27,8 +27,10 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
||||||
|
@ -70,6 +72,8 @@ public class YogDzewa extends Mob {
|
||||||
//so that allies can attack it. States are never actually used.
|
//so that allies can attack it. States are never actually used.
|
||||||
state = HUNTING;
|
state = HUNTING;
|
||||||
|
|
||||||
|
viewDistance = 12;
|
||||||
|
|
||||||
properties.add(Property.BOSS);
|
properties.add(Property.BOSS);
|
||||||
properties.add(Property.IMMOVABLE);
|
properties.add(Property.IMMOVABLE);
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.DEMONIC);
|
||||||
|
@ -112,7 +116,19 @@ public class YogDzewa extends Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
enemySeen = true;
|
//char logic
|
||||||
|
if (fieldOfView == null || fieldOfView.length != Dungeon.level.length()){
|
||||||
|
fieldOfView = new boolean[Dungeon.level.length()];
|
||||||
|
}
|
||||||
|
Dungeon.level.updateFieldOfView( this, fieldOfView );
|
||||||
|
|
||||||
|
throwItems();
|
||||||
|
|
||||||
|
//mob logic
|
||||||
|
enemy = chooseEnemy();
|
||||||
|
|
||||||
|
enemySeen = enemy != null && enemy.isAlive() && fieldOfView[enemy.pos] && enemy.invisible <= 0;
|
||||||
|
//end of char/mob logic
|
||||||
|
|
||||||
if (phase == 0){
|
if (phase == 0){
|
||||||
if (Dungeon.hero.viewDistance >= Dungeon.level.distance(pos, Dungeon.hero.pos)) {
|
if (Dungeon.hero.viewDistance >= Dungeon.level.distance(pos, Dungeon.hero.pos)) {
|
||||||
|
@ -416,6 +432,8 @@ public class YogDzewa extends Mob {
|
||||||
immunities.add( Charm.class );
|
immunities.add( Charm.class );
|
||||||
immunities.add( Sleep.class );
|
immunities.add( Sleep.class );
|
||||||
immunities.add( Vertigo.class );
|
immunities.add( Vertigo.class );
|
||||||
|
immunities.add( Frost.class );
|
||||||
|
immunities.add( Paralysis.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String PHASE = "phase";
|
private static final String PHASE = "phase";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user