v0.8.2c: immovable chars now all throw items by default
This commit is contained in:
parent
c4e42cdab1
commit
593d4c26ac
|
@ -55,14 +55,15 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ShieldBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Speed;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Speed;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Stamina;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Stamina;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable;
|
|
||||||
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;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Elemental;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Elemental;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
||||||
|
@ -131,6 +132,18 @@ public abstract class Char extends Actor {
|
||||||
fieldOfView = new boolean[Dungeon.level.length()];
|
fieldOfView = new boolean[Dungeon.level.length()];
|
||||||
}
|
}
|
||||||
Dungeon.level.updateFieldOfView( this, fieldOfView );
|
Dungeon.level.updateFieldOfView( this, fieldOfView );
|
||||||
|
|
||||||
|
//throw any items that are on top of an immovable char
|
||||||
|
if (properties.contains(Property.IMMOVABLE)){
|
||||||
|
Heap heap = Dungeon.level.heaps.get( pos );
|
||||||
|
if (heap != null && heap.type == Heap.Type.HEAP) {
|
||||||
|
int n;
|
||||||
|
do {
|
||||||
|
n = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
|
||||||
|
} while (!Dungeon.level.passable[n] && !Dungeon.level.avoid[n]);
|
||||||
|
Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( pos );
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ public class Blacksmith extends NPC {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
throwItem();
|
|
||||||
if (Dungeon.level.heroFOV[pos] && !Quest.reforged){
|
if (Dungeon.level.heroFOV[pos] && !Quest.reforged){
|
||||||
Notes.add( Notes.Landmark.TROLL );
|
Notes.add( Notes.Landmark.TROLL );
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,8 +66,6 @@ public class Imp extends NPC {
|
||||||
seenBefore = false;
|
seenBefore = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
throwItem();
|
|
||||||
|
|
||||||
return super.act();
|
return super.act();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
|
||||||
import com.watabou.utils.PathFinder;
|
|
||||||
import com.watabou.utils.Random;
|
|
||||||
|
|
||||||
public abstract class NPC extends Mob {
|
public abstract class NPC extends Mob {
|
||||||
|
|
||||||
|
@ -37,17 +33,6 @@ public abstract class NPC extends Mob {
|
||||||
state = PASSIVE;
|
state = PASSIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void throwItem() {
|
|
||||||
Heap heap = Dungeon.level.heaps.get( pos );
|
|
||||||
if (heap != null && heap.type == Heap.Type.HEAP) {
|
|
||||||
int n;
|
|
||||||
do {
|
|
||||||
n = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
|
|
||||||
} while (!Dungeon.level.passable[n] && !Dungeon.level.avoid[n]);
|
|
||||||
Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( pos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beckon( int cell ) {
|
public void beckon( int cell ) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,15 +49,13 @@ public class Shopkeeper extends NPC {
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
|
|
||||||
throwItem();
|
|
||||||
|
|
||||||
if (Dungeon.level.heroFOV[pos]){
|
if (Dungeon.level.heroFOV[pos]){
|
||||||
Notes.add(Notes.Landmark.SHOP);
|
Notes.add(Notes.Landmark.SHOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprite.turnTo( pos, Dungeon.hero.pos );
|
sprite.turnTo( pos, Dungeon.hero.pos );
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
return true;
|
return super.act();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -60,7 +60,6 @@ public class Wandmaker extends NPC {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
throwItem();
|
|
||||||
if (Dungeon.level.heroFOV[pos] && Quest.wand1 != null){
|
if (Dungeon.level.heroFOV[pos] && Quest.wand1 != null){
|
||||||
Notes.add( Notes.Landmark.WANDMAKER );
|
Notes.add( Notes.Landmark.WANDMAKER );
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,7 +374,6 @@ public class WandOfRegrowth extends Wand {
|
||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
super.act();
|
super.act();
|
||||||
throwItem();
|
|
||||||
|
|
||||||
if (--HP <= 0){
|
if (--HP <= 0){
|
||||||
destroy();
|
destroy();
|
||||||
|
|
|
@ -190,12 +190,6 @@ public class WandOfWarding extends Wand {
|
||||||
state = WANDERING;
|
state = WANDERING;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean act() {
|
|
||||||
throwItem();
|
|
||||||
return super.act();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String name() {
|
public String name() {
|
||||||
return Messages.get(this, "name_" + tier );
|
return Messages.get(this, "name_" + tier );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user