diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java index 90c18e816..f847a1949 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java @@ -57,7 +57,7 @@ public class Fire extends Blob { if (fire <= 0 && flamable[pos]) { int oldTile = Dungeon.level.map[pos]; - Level.set( pos, Terrain.EMBERS ); + Dungeon.level.destroy( pos ); observe = true; GameScene.updateMap( pos ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java index b982b3908..ecd4c3210 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Regrowth.java @@ -39,21 +39,24 @@ public class Regrowth extends Blob { if (volume > 0) { - boolean mapUpdated = false; - for (int i=0; i < LENGTH; i++) { if (off[i] > 0) { int c = Dungeon.level.map[i]; + int c1 = c; if (c == Terrain.EMPTY || c == Terrain.EMBERS || c == Terrain.EMPTY_DECO) { - - Level.set( i, cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS ); - mapUpdated = true; - + c1 = cur[i] > 9 ? Terrain.HIGH_GRASS : Terrain.GRASS; } else if (c == Terrain.GRASS && cur[i] > 9 && Dungeon.level.plants.get(i) == null ) { - + c1 = Terrain.HIGH_GRASS; + } + + if (c1 != c) { Level.set( i, Terrain.HIGH_GRASS ); - mapUpdated = true; - + Dungeon.observe(); + + GameScene.updateMap( i ); + if (Dungeon.visible[i]) { + GameScene.discoverTile( i, c ); + } } Char ch = Actor.findChar( i ); @@ -62,11 +65,6 @@ public class Regrowth extends Blob { } } } - - if (mapUpdated) { - GameScene.updateMap(); - Dungeon.observe(); - } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java index 70aba6c8c..3859bd33f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java @@ -65,6 +65,7 @@ public class WaterOfHealth extends WellWater { protected Item affectItem( Item item ) { if (item instanceof DewVial && !((DewVial)item).isFull()) { ((DewVial)item).fill(); + Journal.remove( Feature.WELL_OF_HEALTH ); return item; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java index 88db55c06..4e81ec7fe 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfTransmutation.java @@ -112,7 +112,7 @@ public class WaterOfTransmutation extends WellWater { if (n != null) { - int level = w.level; + int level = w.level(); if (level > 0) { n.upgrade( level ); } else if (level < 0) { @@ -137,9 +137,9 @@ public class WaterOfTransmutation extends WellWater { n = (Ring)Generator.random( Category.RING ); } while (n.getClass() == r.getClass()); - n.level = 0; + n.level(0); - int level = r.level; + int level = r.level(); if (level > 0) { n.upgrade( level ); } else if (level < 0) { @@ -173,9 +173,8 @@ public class WaterOfTransmutation extends WellWater { n = (Wand)Generator.random( Category.WAND ); } while (n.getClass() == w.getClass()); - n.level = 0; - n.updateLevel(); - n.upgrade( w.level ); + n.level( 0 ); + n.upgrade( w.level() ); n.levelKnown = w.levelKnown; n.cursedKnown = w.cursedKnown; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 9ff1a7589..84ddd27dd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -321,7 +321,7 @@ public class Hero extends Char { @Override public int dr() { - int dr = belongings.armor != null ? Math.max( belongings.armor.DR, 0 ) : 0; + int dr = belongings.armor != null ? Math.max( belongings.armor.DR(), 0 ) : 0; Barkskin barkskin = buff( Barkskin.class ); if (barkskin != null) { dr += barkskin.level(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 6f0ecf53e..5efc242f1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -428,13 +428,18 @@ public abstract class Mob extends Char { } Badges.validateNightHunter(); } - - if (Dungeon.hero.lvl <= maxLvl && EXP > 0) { - Dungeon.hero.sprite.showStatus( CharSprite.POSITIVE, TXT_EXP, EXP ); - Dungeon.hero.earnExp( EXP ); + + int exp = exp(); + if (exp > 0) { + Dungeon.hero.sprite.showStatus( CharSprite.POSITIVE, TXT_EXP, exp ); + Dungeon.hero.earnExp( exp ); } } } + + public int exp() { + return Dungeon.hero.lvl <= maxLvl ? EXP : 0; + } @Override public void die( Object cause ) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index 71aa5fb3e..0aa6560f4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -91,7 +91,7 @@ public class Skeleton extends Mob { Item loot = Generator.random( Generator.Category.WEAPON ); for (int i=0; i < 2; i++) { Item l = Generator.random( Generator.Category.WEAPON ); - if (l.level < loot.level) { + if (l.level() < loot.level()) { loot = l; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java index 2e2e42983..d2b4094cd 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Statue.java @@ -55,7 +55,7 @@ public class Statue extends Mob { do { weapon = (Weapon)Generator.random( Generator.Category.WEAPON ); - } while (!(weapon instanceof MeleeWeapon) || weapon.level < 0); + } while (!(weapon instanceof MeleeWeapon) || weapon.level() < 0); weapon.identify(); weapon.enchant( Enchantment.random() ); @@ -88,7 +88,7 @@ public class Statue extends Mob { @Override public int damageRoll() { - return Random.NormalIntRange( weapon.MIN, weapon.MAX ); + return Random.NormalIntRange( weapon.min(), weapon.max() ); } @Override diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index d60baeefd..c2d6c9460 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -183,7 +183,7 @@ public class Blacksmith extends NPC { return "I don't work with cursed items!"; } - if (item1.level < 0 || item2.level < 0) { + if (item1.level() < 0 || item2.level() < 0) { return "It's a junk, the quality is too poor!"; } @@ -197,7 +197,7 @@ public class Blacksmith extends NPC { public static void upgrade( Item item1, Item item2 ) { Item first, second; - if (item2.level > item1.level) { + if (item2.level() > item1.level()) { first = item2; second = item1; } else {