diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index a440911fc..37d452960 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -94,7 +94,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.features.AlchemyPot; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; -import com.shatteredpixel.shatteredpixeldungeon.levels.features.Sign; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; import com.shatteredpixel.shatteredpixeldungeon.plants.Sungrass; @@ -586,15 +585,10 @@ public class Hero extends Char { private boolean actMove( HeroAction.Move action ) { if (getCloser( action.dst )) { - return true; } else { - if (Dungeon.level.map[pos] == Terrain.SIGN) { - Sign.read(pos); - } ready(); - return false; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 7fdd3c575..cae26ceb5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -322,6 +322,11 @@ public abstract class Level implements Bundlable { if (version <= ShatteredPixelDungeon.v0_4_2b){ map = Terrain.convertTilesFrom129( map ); } + + // pre-0.6.1 saves + if (version <= ShatteredPixelDungeon.v0_6_0b){ + map = Terrain.convertTilesFrom0_6_0b( map ); + } Collection collection = bundle.getCollection( HEAPS ); for (Bundlable h : collection) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java index 293c0f96e..59f7bf45a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Terrain.java @@ -135,4 +135,14 @@ public class Terrain { return map; } + //removes signs, places floors instead + public static int[] convertTilesFrom0_6_0b(int[] map){ + for (int i = 0; i < map.length; i++){ + if (map[i] == 23){ + map[i] = 1; + } + } + return map; + } + } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Sign.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Sign.java deleted file mode 100644 index da5cf79fe..000000000 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/Sign.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Pixel Dungeon - * Copyright (C) 2012-2015 Oleg Dolya - * - * Shattered Pixel Dungeon - * Copyright (C) 2014-2017 Evan Debenham - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package com.shatteredpixel.shatteredpixeldungeon.levels.features; - -import com.shatteredpixel.shatteredpixeldungeon.Assets; -import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; -import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; -import com.shatteredpixel.shatteredpixeldungeon.levels.DeadEndLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; -import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; -import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; -import com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage; -import com.watabou.noosa.audio.Sample; - -public class Sign { - - public static void read( int pos ) { - - if (Dungeon.level instanceof DeadEndLevel) { - - GameScene.show( new WndMessage( Messages.get(Sign.class, "dead_end") ) ); - - } else { - - if (Dungeon.depth <= 21) { - GameScene.show( new WndMessage( Messages.get(Sign.class, "tip_"+Dungeon.depth) ) ); - } else { - - Dungeon.level.destroy( pos ); - GameScene.updateMap( pos ); - GameScene.discoverTile( pos, Terrain.SIGN ); - - GLog.w( Messages.get(Sign.class, "burn") ); - - CellEmitter.get( pos ).burst( ElmoParticle.FACTORY, 6 ); - Sample.INSTANCE.play( Assets.SND_BURNING ); - } - - } - } -}