v0.6.2: several bugfixes and minor corrections
This commit is contained in:
parent
bd1ba18e52
commit
2306d0c271
|
@ -92,8 +92,9 @@ public class Bones {
|
|||
item = Dungeon.quickslot.randomNonePlaceholder();
|
||||
break;
|
||||
}
|
||||
if (item == null || item.bones)
|
||||
if (item == null || !item.bones) {
|
||||
return pickItem(hero);
|
||||
}
|
||||
} else {
|
||||
|
||||
Iterator<Item> iterator = hero.belongings.backpack.iterator();
|
||||
|
|
|
@ -25,6 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class Alchemy extends Blob {
|
||||
|
||||
|
@ -42,6 +44,16 @@ public class Alchemy extends Blob {
|
|||
if (off[cell] > 0 && Dungeon.level.heroFOV[cell]){
|
||||
Notes.add( Notes.Landmark.ALCHEMY );
|
||||
}
|
||||
|
||||
//for pre-0.6.2 saves
|
||||
while (off[cell] > 0 && Dungeon.level.heaps.get(cell) != null){
|
||||
|
||||
int n;
|
||||
do {
|
||||
n = cell + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
|
||||
} while (!Dungeon.level.passable[n]);
|
||||
Dungeon.level.drop( Dungeon.level.heaps.get(cell).pickUp(), n ).sprite.drop( pos );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
@ -57,7 +56,7 @@ public class Preparation extends Buff implements ActionIndicator.Action {
|
|||
LVL_2( 3, 0.2f, 0.0f, 1, 1),
|
||||
LVL_3( 6, 0.3f, 0.0f, 2, 3),
|
||||
LVL_4( 11, 0.4f, 0.4f, 2, 5),
|
||||
LVL_5( 16, 0.6f, 0.6f, 1, 7);
|
||||
LVL_5( 16, 0.6f, 0.6f, 3, 7);
|
||||
|
||||
final int turnsReq;
|
||||
final float baseDmgBonus, missingHPBonus;
|
||||
|
@ -72,7 +71,7 @@ public class Preparation extends Buff implements ActionIndicator.Action {
|
|||
public boolean canInstakill(Char defender){
|
||||
return this == LVL_5
|
||||
&& !defender.properties().contains(Char.Property.MINIBOSS)
|
||||
&& !defender.properties().contains(Char.Property.MINIBOSS);
|
||||
&& !defender.properties().contains(Char.Property.BOSS);
|
||||
}
|
||||
|
||||
public int damageRoll( Char attacker, Char defender){
|
||||
|
@ -242,13 +241,14 @@ public class Preparation extends Buff implements ActionIndicator.Action {
|
|||
if (Dungeon.hero.canAttack(enemy)){
|
||||
if (Dungeon.hero.handle( cell )) {
|
||||
Dungeon.hero.next();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
AttackLevel lvl = AttackLevel.getLvl(turnsInvis);
|
||||
|
||||
boolean[] passable = new boolean[Dungeon.level.length()];
|
||||
PathFinder.buildDistanceMap(Dungeon.hero.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, passable), lvl.blinkDistance+1);
|
||||
boolean[] passable = Dungeon.level.passable.clone();
|
||||
PathFinder.buildDistanceMap(Dungeon.hero.pos, passable, lvl.blinkDistance+1);
|
||||
if (PathFinder.distance[cell] == Integer.MAX_VALUE){
|
||||
GLog.w(Messages.get(Preparation.class, "out_of_reach"));
|
||||
return;
|
||||
|
|
|
@ -190,8 +190,8 @@ public class Imp extends NPC {
|
|||
level.heaps.get( npc.pos ) != null ||
|
||||
level.findMob( npc.pos ) != null ||
|
||||
//The imp doesn't move, so he cannot obstruct a passageway
|
||||
!(Dungeon.level.passable[npc.pos + PathFinder.CIRCLE4[0]] && Dungeon.level.passable[npc.pos + PathFinder.CIRCLE4[2]]) ||
|
||||
!(Dungeon.level.passable[npc.pos + PathFinder.CIRCLE4[1]] && Dungeon.level.passable[npc.pos + PathFinder.CIRCLE4[3]]));
|
||||
!(level.passable[npc.pos + PathFinder.CIRCLE4[0]] && level.passable[npc.pos + PathFinder.CIRCLE4[2]]) ||
|
||||
!(level.passable[npc.pos + PathFinder.CIRCLE4[1]] && level.passable[npc.pos + PathFinder.CIRCLE4[3]]));
|
||||
level.mobs.add( npc );
|
||||
|
||||
spawned = true;
|
||||
|
|
|
@ -49,7 +49,7 @@ public abstract class InventoryScroll extends Scroll {
|
|||
}
|
||||
|
||||
private void confirmCancelation() {
|
||||
GameScene.show( new WndOptions( name(), Messages.get(this, "warning"),
|
||||
GameScene.show( new WndOptions( Messages.titleCase(name()), Messages.get(this, "warning"),
|
||||
Messages.get(this, "yes"), Messages.get(this, "no") ) {
|
||||
@Override
|
||||
protected void onSelect( int index ) {
|
||||
|
|
|
@ -48,12 +48,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Torch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.SeedPouch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
|
@ -658,18 +656,6 @@ public abstract class Level implements Bundlable {
|
|||
return heap;
|
||||
|
||||
}
|
||||
|
||||
if ((map[cell] == Terrain.ALCHEMY) && (
|
||||
!(item instanceof Plant.Seed || item instanceof Blandfruit) ||
|
||||
item instanceof BlandfruitBush.Seed ||
|
||||
(item instanceof Blandfruit && (((Blandfruit) item).potionAttrib != null || heaps.get(cell) != null))||
|
||||
Dungeon.hero.buff(AlchemistsToolkit.alchemy.class) != null && Dungeon.hero.buff(AlchemistsToolkit.alchemy.class).isCursed())) {
|
||||
int n;
|
||||
do {
|
||||
n = cell + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
|
||||
} while (map[n] != Terrain.EMPTY_SP);
|
||||
cell = n;
|
||||
}
|
||||
|
||||
Heap heap = heaps.get( cell );
|
||||
if (heap == null) {
|
||||
|
|
|
@ -99,7 +99,7 @@ public class Terrain {
|
|||
flags[STATUE] = SOLID;
|
||||
flags[STATUE_SP] = flags[STATUE];
|
||||
flags[BOOKSHELF] = flags[BARRICADE];
|
||||
flags[ALCHEMY] = PASSABLE;
|
||||
flags[ALCHEMY] = SOLID;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user