From 126172d6618426274156a1800c3427b90212c113 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 16 Sep 2017 00:27:22 -0400 Subject: [PATCH] v0.6.2: made several level properties none-static --- .../shatteredpixeldungeon/Dungeon.java | 10 ++-- .../shatteredpixeldungeon/actors/Char.java | 2 +- .../actors/blobs/Blob.java | 2 +- .../actors/blobs/Fire.java | 3 +- .../actors/blobs/Freezing.java | 3 +- .../actors/blobs/WellWater.java | 2 +- .../actors/buffs/Burning.java | 5 +- .../actors/buffs/Combo.java | 4 +- .../actors/buffs/Frost.java | 3 +- .../actors/buffs/Ooze.java | 3 +- .../actors/buffs/Preparation.java | 2 +- .../actors/hero/Hero.java | 20 ++++---- .../actors/mobs/DM300.java | 2 +- .../actors/mobs/Elemental.java | 4 +- .../actors/mobs/Eye.java | 2 +- .../actors/mobs/GnollTrickster.java | 3 +- .../actors/mobs/Goo.java | 9 ++-- .../actors/mobs/Guard.java | 6 ++- .../actors/mobs/King.java | 3 +- .../actors/mobs/Mimic.java | 3 +- .../actors/mobs/Mob.java | 8 +-- .../actors/mobs/Piranha.java | 6 +-- .../actors/mobs/Shaman.java | 2 +- .../actors/mobs/Succubus.java | 4 +- .../actors/mobs/Swarm.java | 3 +- .../actors/mobs/Tengu.java | 4 +- .../actors/mobs/Wraith.java | 5 +- .../actors/mobs/Yog.java | 7 ++- .../actors/mobs/npcs/Imp.java | 5 +- .../actors/mobs/npcs/NPC.java | 3 +- .../shatteredpixeldungeon/items/Bomb.java | 7 ++- .../shatteredpixeldungeon/items/Honeypot.java | 5 +- .../items/armor/RogueArmor.java | 2 +- .../items/armor/curses/Multiplicity.java | 3 +- .../items/artifacts/DriedRose.java | 10 ++-- .../items/artifacts/EtherealChains.java | 9 ++-- .../items/artifacts/TalismanOfForesight.java | 5 +- .../items/potions/Potion.java | 3 +- .../items/potions/PotionOfFrost.java | 3 +- .../items/potions/PotionOfLiquidFlame.java | 3 +- .../items/potions/PotionOfPurity.java | 3 +- .../items/quest/CeremonialCandle.java | 3 +- .../items/quest/CorpseDust.java | 3 +- .../items/scrolls/ScrollOfMagicMapping.java | 3 +- .../items/scrolls/ScrollOfMirrorImage.java | 4 +- .../items/scrolls/ScrollOfTeleportation.java | 5 +- .../items/wands/WandOfDisintegration.java | 7 ++- .../items/wands/WandOfFireblast.java | 7 ++- .../items/wands/WandOfFrost.java | 3 +- .../items/wands/WandOfLightning.java | 7 ++- .../items/wands/WandOfPrismaticLight.java | 3 +- .../items/wands/WandOfRegrowth.java | 10 ++-- .../items/weapon/enchantments/Shocking.java | 4 +- .../items/weapon/missiles/IncendiaryDart.java | 4 +- .../items/weapon/missiles/MissileWeapon.java | 3 +- .../shatteredpixeldungeon/levels/Level.java | 50 ++++++++++--------- .../levels/RegularLevel.java | 8 +-- .../levels/traps/BlazingTrap.java | 6 +-- .../levels/traps/FlockTrap.java | 22 ++++---- .../levels/traps/PitfallTrap.java | 6 +-- .../levels/traps/RockfallTrap.java | 3 +- .../levels/traps/SummoningTrap.java | 3 +- .../mechanics/Ballistica.java | 5 +- .../mechanics/ShadowCaster.java | 3 +- .../shatteredpixeldungeon/plants/Icecap.java | 3 +- .../shatteredpixeldungeon/plants/Plant.java | 5 +- .../sprites/CharSprite.java | 5 +- .../sprites/ItemSprite.java | 3 +- .../sprites/TenguSprite.java | 3 +- .../shatteredpixeldungeon/tiles/FogOfWar.java | 3 +- .../tiles/WallBlockingTilemap.java | 3 +- .../windows/WndInfoCell.java | 5 +- 72 files changed, 180 insertions(+), 213 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index 7111b39d4..44d949190 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -791,7 +791,7 @@ public class Dungeon { setupPassable(); if (ch.flying || ch.buff( Amok.class ) != null) { - BArray.or( pass, Level.avoid, passable ); + BArray.or( pass, Dungeon.level.avoid, passable ); } else { System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() ); } @@ -808,13 +808,13 @@ public class Dungeon { public static int findStep(Char ch, int from, int to, boolean pass[], boolean[] visible ) { - if (level.adjacent( from, to )) { - return Actor.findChar( to ) == null && (pass[to] || Level.avoid[to]) ? to : -1; + if (Dungeon.level.adjacent( from, to )) { + return Actor.findChar( to ) == null && (pass[to] || Dungeon.level.avoid[to]) ? to : -1; } setupPassable(); if (ch.flying || ch.buff( Amok.class ) != null) { - BArray.or( pass, Level.avoid, passable ); + BArray.or( pass, Dungeon.level.avoid, passable ); } else { System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() ); } @@ -833,7 +833,7 @@ public class Dungeon { setupPassable(); if (ch.flying) { - BArray.or( pass, Level.avoid, passable ); + BArray.or( pass, Dungeon.level.avoid, passable ); } else { System.arraycopy( pass, 0, passable, 0, Dungeon.level.length() ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 8589f89fc..20208f2a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -414,7 +414,7 @@ public abstract class Char extends Actor { if (Dungeon.level.adjacent( step, pos ) && buff( Vertigo.class ) != null) { sprite.interruptMotion(); int newPos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - if (!(Level.passable[newPos] || Level.avoid[newPos]) || Actor.findChar( newPos ) != null) + if (!(Dungeon.level.passable[newPos] || Dungeon.level.avoid[newPos]) || Actor.findChar( newPos ) != null) return; else { sprite.move(pos, newPos); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Blob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Blob.java index b35c005ae..c1e612971 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Blob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Blob.java @@ -139,7 +139,7 @@ public class Blob extends Actor { protected void evolve() { - boolean[] blocking = Level.solid; + boolean[] blocking = Dungeon.level.solid; int cell; for (int i=area.top-1; i <= area.bottom; i++) { for (int j = area.left-1; j <= area.right; j++) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java index 826d01c98..e1f8d8848 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -39,7 +38,7 @@ public class Fire extends Blob { @Override protected void evolve() { - boolean[] flamable = Level.flamable; + boolean[] flamable = Dungeon.level.flamable; int cell; int fire; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java index 34699dfde..b6b583bb3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.watabou.utils.Random; public class Freezing { @@ -39,7 +38,7 @@ public class Freezing { Char ch = Actor.findChar( cell ); if (ch != null) { - if (Level.water[ch.pos]){ + if (Dungeon.level.water[ch.pos]){ Buff.prolong(ch, Frost.class, Frost.duration(ch) * Random.Float(5f, 7.5f)); } else { Buff.prolong(ch, Frost.class, Frost.duration(ch) * Random.Float(1.0f, 1.5f)); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java index fa629b28a..9bde60b1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WellWater.java @@ -96,7 +96,7 @@ public abstract class WellWater extends Blob { int newPlace; do { newPlace = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - } while (!Level.passable[newPlace] && !Level.avoid[newPlace]); + } while (!Dungeon.level.passable[newPlace] && !Dungeon.level.avoid[newPlace]); Dungeon.level.drop( heap.pickUp(), newPlace ).sprite.drop( pos ); return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index f8f14b4c0..6e807ef8d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -38,7 +38,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -141,7 +140,7 @@ public class Burning extends Buff implements Hero.Doom { detach(); } - if (Level.flamable[target.pos] && Blob.volumeAt(target.pos, Fire.class) == 0) { + if (Dungeon.level.flamable[target.pos] && Blob.volumeAt(target.pos, Fire.class) == 0) { GameScene.add( Blob.seed( target.pos, 4, Fire.class ) ); } @@ -149,7 +148,7 @@ public class Burning extends Buff implements Hero.Doom { left -= TICK; if (left <= 0 || - (Level.water[target.pos] && !target.flying)) { + (Dungeon.level.water[target.pos] && !target.flying)) { detach(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java index 729f5385c..9489f0fdc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java @@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -248,7 +247,8 @@ public class Combo extends Buff implements ActionIndicator.Action { int ofs = PathFinder.NEIGHBOURS8[i]; if (enemy.pos - target.pos == ofs) { int newPos = enemy.pos + ofs; - if ((Level.passable[newPos] || Level.avoid[newPos]) && Actor.findChar( newPos ) == null) { + if ((Dungeon.level.passable[newPos] || Dungeon.level.avoid[newPos]) + && Actor.findChar( newPos ) == null) { Actor.addDelayed( new Pushing( enemy, enemy.pos, newPos ), -1 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java index 71acfba96..371e7649a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java @@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -97,7 +96,7 @@ public class Frost extends FlavourBuff { super.detach(); if (target.paralysed > 0) target.paralysed--; - if (Level.water[target.pos]) + if (Dungeon.level.water[target.pos]) Buff.prolong(target, Chill.class, 4f); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java index 5fef533fc..d45151dd0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Ooze.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -67,7 +66,7 @@ public class Ooze extends Buff { } spend( TICK ); } - if (Level.water[target.pos]) { + if (Dungeon.level.water[target.pos]) { detach(); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java index dee7c3d8d..585f4cfd8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java @@ -249,7 +249,7 @@ public class Preparation extends Buff implements ActionIndicator.Action { AttackLevel lvl = AttackLevel.getLvl(turnsInvis); boolean[] passable = new boolean[Dungeon.level.length()]; - PathFinder.buildDistanceMap(Dungeon.hero.pos, BArray.or(Level.passable, Level.avoid, passable), lvl.blinkDistance+1); + PathFinder.buildDistanceMap(Dungeon.hero.pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, passable), lvl.blinkDistance+1); if (PathFinder.distance[cell] == Integer.MAX_VALUE){ GLog.w(Messages.get(Preparation.class, "out_of_reach")); return; 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 b6e19ace5..a0efbdd54 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 @@ -379,7 +379,7 @@ public class Hero extends Char { if (armor.hasGlyph(Swiftness.class)) { speed *= (1.1f + 0.01f * belongings.armor.level()); - } else if (armor.hasGlyph(Flow.class) && Level.water[pos]){ + } else if (armor.hasGlyph(Flow.class) && Dungeon.level.water[pos]){ speed *= (1.5f + 0.05f * belongings.armor.level()); } } @@ -422,7 +422,7 @@ public class Hero extends Char { if (wep != null && Dungeon.level.distance( pos, enemy.pos ) <= wep.reachFactor(this)){ - boolean[] passable = BArray.not(Level.solid, null); + boolean[] passable = BArray.not(Dungeon.level.solid, null); for (Mob m : Dungeon.level.mobs) passable[m.pos] = false; @@ -1035,7 +1035,7 @@ public class Hero extends Char { path = null; if (Actor.findChar( target ) == null) { - if (Level.pit[target] && !flying && !Level.solid[target]) { + if (Dungeon.level.pit[target] && !flying && !Dungeon.level.solid[target]) { if (!Chasm.jumpConfirmed){ Chasm.heroJump(this); interrupt(); @@ -1044,7 +1044,7 @@ public class Hero extends Char { } return false; } - if (Level.passable[target] || Level.avoid[target]) { + if (Dungeon.level.passable[target] || Dungeon.level.avoid[target]) { step = target; } } @@ -1062,7 +1062,7 @@ public class Hero extends Char { int lookAhead = (int) GameMath.gate(0, path.size()-1, 2); for (int i = 0; i < lookAhead; i++){ int cell = path.get(i); - if (!Level.passable[cell] || (Dungeon.visible[cell] && Actor.findChar(cell) != null)) { + if (!Dungeon.level.passable[cell] || (Dungeon.visible[cell] && Actor.findChar(cell) != null)) { newPath = true; break; } @@ -1072,7 +1072,7 @@ public class Hero extends Char { if (newPath) { int len = Dungeon.level.length(); - boolean[] p = Level.passable; + boolean[] p = Dungeon.level.passable; boolean[] v = Dungeon.level.visited; boolean[] m = Dungeon.level.mapped; boolean[] passable = new boolean[len]; @@ -1336,7 +1336,7 @@ public class Hero extends Char { int length = Dungeon.level.length(); int[] map = Dungeon.level.map; boolean[] visited = Dungeon.level.visited; - boolean[] discoverable = Level.discoverable; + boolean[] discoverable = Dungeon.level.discoverable; for (int i=0; i < length; i++) { @@ -1363,7 +1363,7 @@ public class Hero extends Char { ArrayList passable = new ArrayList(); for (Integer ofs : PathFinder.NEIGHBOURS8) { int cell = pos + ofs; - if ((Level.passable[cell] || Level.avoid[cell]) && Dungeon.level.heaps.get( cell ) == null) { + if ((Dungeon.level.passable[cell] || Dungeon.level.avoid[cell]) && Dungeon.level.heaps.get( cell ) == null) { passable.add( cell ); } } @@ -1411,7 +1411,7 @@ public class Hero extends Char { if (!flying) { - if (Level.water[pos]) { + if (Dungeon.level.water[pos]) { Sample.INSTANCE.play( Assets.SND_WATER, 1, 1, Random.Float( 0.8f, 1.25f ) ); } else { Sample.INSTANCE.play( Assets.SND_STEP ); @@ -1514,7 +1514,7 @@ public class Hero extends Char { sprite.parent.addToBack( new CheckedCell( p ) ); } - if (Level.secret[p]){ + if (Dungeon.level.secret[p]){ float chance; //intentional searches always succeed diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java index c6cbee36a..64364adfc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM300.java @@ -120,7 +120,7 @@ public class DM300 extends Mob { Camera.main.shake( 3, 0.7f ); Sample.INSTANCE.play( Assets.SND_ROCKS ); - if (Level.water[cell]) { + if (Dungeon.level.water[cell]) { GameScene.ripple( cell ); } else if (Dungeon.level.map[cell] == Terrain.EMPTY) { Level.set( cell, Terrain.EMPTY_DECO ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Elemental.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Elemental.java index 9b6272f83..39eff71dc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Elemental.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Elemental.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; @@ -30,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blazing; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.sprites.ElementalSprite; import com.watabou.utils.Random; @@ -88,7 +88,7 @@ public class Elemental extends Mob { sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); } } else if (buff instanceof Frost || buff instanceof Chill) { - if (Level.water[this.pos]) + if (Dungeon.level.water[this.pos]) damage( Random.NormalIntRange( HT / 2, HT ), buff ); else damage( Random.NormalIntRange( 1, HT * 2 / 3 ), buff ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java index 8b16c4e69..2f236b122 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Eye.java @@ -163,7 +163,7 @@ public class Eye extends Mob { for (int pos : beam.subPath(1, beam.dist)) { - if (Level.flamable[pos]) { + if (Dungeon.level.flamable[pos]) { Dungeon.level.destroy( pos ); GameScene.updateMap( pos ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java index 334e37a3c..192cf165c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java @@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite; @@ -80,7 +79,7 @@ public class GnollTrickster extends Gnoll { if (effect >=6 && enemy.buff(Burning.class) == null){ - if (Level.flamable[enemy.pos]) + if (Dungeon.level.flamable[enemy.pos]) GameScene.add(Blob.seed(enemy.pos, 4, Fire.class)); Buff.affect(enemy, Burning.class).reignite( enemy ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java index c1281c204..5c8e52575 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Goo.java @@ -38,7 +38,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -77,7 +76,7 @@ public class Goo extends Mob { int max = (HP*2 <= HT) ? 15 : 10; if (pumpedUp > 0) { pumpedUp = 0; - PathFinder.buildDistanceMap( pos, BArray.not( Level.solid, null ), 2 ); + PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 ); for (int i = 0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE) CellEmitter.get(i).burst(ElmoParticle.FACTORY, 10); @@ -110,7 +109,7 @@ public class Goo extends Mob { @Override public boolean act() { - if (Level.water[pos] && HP < HT) { + if (Dungeon.level.water[pos] && HP < HT) { sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); if (HP*2 == HT) { BossHealthBar.bleed(false); @@ -146,7 +145,7 @@ public class Goo extends Mob { protected boolean doAttack( Char enemy ) { if (pumpedUp == 1) { ((GooSprite)sprite).pumpUp(); - PathFinder.buildDistanceMap( pos, BArray.not( Level.solid, null ), 2 ); + PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 ); for (int i = 0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE) GameScene.add(Blob.seed(i, 2, GooWarn.class)); @@ -182,7 +181,7 @@ public class Goo extends Mob { for (int i=0; i < PathFinder.NEIGHBOURS9.length; i++) { int j = pos + PathFinder.NEIGHBOURS9[i]; - if (!Level.solid[j]) { + if (!Dungeon.level.solid[j]) { GameScene.add(Blob.seed(j, 2, GooWarn.class)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index 942113490..f462bb3a0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -93,12 +93,14 @@ public class Guard extends Mob { Ballistica chain = new Ballistica(pos, target, Ballistica.PROJECTILE); - if (chain.collisionPos != enemy.pos || chain.path.size() < 2 || Level.pit[chain.path.get(1)]) + if (chain.collisionPos != enemy.pos + || chain.path.size() < 2 + || Dungeon.level.pit[chain.path.get(1)]) return false; else { int newPos = -1; for (int i : chain.subPath(1, chain.dist)){ - if (!Level.solid[i] && Actor.findChar(i) == null){ + if (!Dungeon.level.solid[i] && Actor.findChar(i) == null){ newPos = i; break; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java index 972117d15..ab74301bb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/King.java @@ -42,7 +42,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportat import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfDisintegration; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim; import com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.KingSprite; @@ -187,7 +186,7 @@ public class King extends Mob { sprite.centerEmitter().start( Speck.factory( Speck.SCREAM ), 0.4f, 2 ); Sample.INSTANCE.play( Assets.SND_CHALLENGE ); - boolean[] passable = Level.passable.clone(); + boolean[] passable = Dungeon.level.passable.clone(); for (Char c : Actor.chars()) { passable[c.pos] = false; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java index df88de59f..1ae3f8b91 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java @@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.MimicSprite; import com.watabou.noosa.audio.Sample; @@ -119,7 +118,7 @@ public class Mimic extends Mob { ArrayList candidates = new ArrayList<>(); for (int n : PathFinder.NEIGHBOURS8) { int cell = pos + n; - if ((Level.passable[cell] || Level.avoid[cell]) && Actor.findChar( cell ) == null) { + if ((Dungeon.level.passable[cell] || Dungeon.level.avoid[cell]) && Actor.findChar( cell ) == null) { candidates.add( cell ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index fab898175..fe159d793 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -309,7 +309,7 @@ public abstract class Mob extends Char { path = null; - if (Actor.findChar( target ) == null && Level.passable[target]) { + if (Actor.findChar( target ) == null && Dungeon.level.passable[target]) { step = target; } @@ -366,7 +366,7 @@ public abstract class Mob extends Char { int lookAhead = (int)GameMath.gate(1, path.size()-1, 4); for (int i = 0; i < lookAhead; i++) { int cell = path.get(i); - if (!Level.passable[cell] || ( Level.fieldOfView[cell] && Actor.findChar(cell) != null)) { + if (!Dungeon.level.passable[cell] || ( Level.fieldOfView[cell] && Actor.findChar(cell) != null)) { newPath = true; break; } @@ -375,7 +375,7 @@ public abstract class Mob extends Char { if (newPath) { path = Dungeon.findPath(this, pos, target, - Level.passable, + Dungeon.level.passable, Level.fieldOfView); } @@ -400,7 +400,7 @@ public abstract class Mob extends Char { protected boolean getFurther( int target ) { int step = Dungeon.flee( this, pos, target, - Level.passable, + Dungeon.level.passable, Level.fieldOfView ); if (step != -1) { move( step ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java index 5a25ddd90..a24cac470 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Piranha.java @@ -57,7 +57,7 @@ public class Piranha extends Mob { @Override protected boolean act() { - if (!Level.water[pos]) { + if (!Dungeon.level.water[pos]) { die( null ); sprite.killAndErase(); return true; @@ -120,7 +120,7 @@ public class Piranha extends Mob { } int step = Dungeon.findStep( this, pos, target, - Level.water, + Dungeon.level.water, Level.fieldOfView ); if (step != -1) { move( step ); @@ -133,7 +133,7 @@ public class Piranha extends Mob { @Override protected boolean getFurther( int target ) { int step = Dungeon.flee( this, pos, target, - Level.water, + Dungeon.level.water, Level.fieldOfView ); if (step != -1) { move( step ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java index fabfb71c2..f6199c114 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Shaman.java @@ -93,7 +93,7 @@ public class Shaman extends Mob implements Callback { if (hit( this, enemy, true )) { int dmg = Random.NormalIntRange(3, 10); - if (Level.water[enemy.pos] && !enemy.flying) { + if (Dungeon.level.water[enemy.pos] && !enemy.flying) { dmg *= 1.5f; } enemy.damage( dmg, LightningTrap.LIGHTNING ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Succubus.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Succubus.java index c62a3dfec..fa8f7fd08 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Succubus.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Succubus.java @@ -108,11 +108,11 @@ public class Succubus extends Mob { if (Actor.findChar( cell ) != null && cell != this.pos) cell = route.path.get(route.dist-1); - if (Level.avoid[ cell ]){ + if (Dungeon.level.avoid[ cell ]){ ArrayList candidates = new ArrayList<>(); for (int n : PathFinder.NEIGHBOURS8) { cell = route.collisionPos + n; - if (Level.passable[cell] && Actor.findChar( cell ) == null) { + if (Dungeon.level.passable[cell] && Actor.findChar( cell ) == null) { candidates.add( cell ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java index 7c95631fb..c61c0c949 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Swarm.java @@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -87,7 +86,7 @@ public class Swarm extends Mob { if (HP >= damage + 2) { ArrayList candidates = new ArrayList<>(); - boolean[] passable = Level.passable; + boolean[] passable = Dungeon.level.passable; int[] neighbours = {pos + 1, pos - 1, pos + Dungeon.level.width(), pos - Dungeon.level.width()}; for (int n : neighbours) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java index 8532a1d5c..47246ecdb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java @@ -170,7 +170,7 @@ public class Tengu extends Mob { int trapPos; do { trapPos = Random.Int( Dungeon.level.length() ); - } while (!Level.fieldOfView[trapPos] || Level.solid[trapPos]); + } while (!Level.fieldOfView[trapPos] || Dungeon.level.solid[trapPos]); if (Dungeon.level.map[trapPos] == Terrain.INACTIVE_TRAP) { Dungeon.level.setTrap( new SpearTrap().reveal(), trapPos ); @@ -196,7 +196,7 @@ public class Tengu extends Mob { do { newPos = Random.Int(Dungeon.level.length()); } while ( - Level.solid[newPos] || + Dungeon.level.solid[newPos] || Dungeon.level.distance(newPos, enemy.pos) < 8 || Actor.findChar(newPos) != null); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java index 9466c23e8..6da732704 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Wraith.java @@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.WraithSprite; import com.watabou.noosa.tweeners.AlphaTweener; @@ -94,14 +93,14 @@ public class Wraith extends Mob { public static void spawnAround( int pos ) { for (int n : PathFinder.NEIGHBOURS4) { int cell = pos + n; - if (Level.passable[cell] && Actor.findChar( cell ) == null) { + if (Dungeon.level.passable[cell] && Actor.findChar( cell ) == null) { spawnAt( cell ); } } } public static Wraith spawnAt( int pos ) { - if (Level.passable[pos] && Actor.findChar( pos ) == null) { + if (Dungeon.level.passable[pos] && Actor.findChar( pos ) == null) { Wraith w = new Wraith(); w.adjustStats( Dungeon.depth ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java index adf161af7..6c3559698 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Yog.java @@ -42,7 +42,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -87,7 +86,7 @@ public class Yog extends Mob { do { fist1.pos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; fist2.pos = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - } while (!Level.passable[fist1.pos] || !Level.passable[fist2.pos] || fist1.pos == fist2.pos); + } while (!Dungeon.level.passable[fist1.pos] || !Dungeon.level.passable[fist2.pos] || fist1.pos == fist2.pos); GameScene.add( fist1 ); GameScene.add( fist2 ); @@ -132,7 +131,7 @@ public class Yog extends Mob { for (int i=0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { + if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { spawnPoints.add( p ); } } @@ -255,7 +254,7 @@ public class Yog extends Mob { @Override public boolean act() { - if (Level.water[pos] && HP < HT) { + if (Dungeon.level.water[pos] && HP < HT) { sprite.emitter().burst( ShadowParticle.UP, 2 ); HP += REGENERATION; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java index 8189078f7..80eca3257 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Imp.java @@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.quest.DwarfToken; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ImpSprite; @@ -191,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 - !(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]])); + !(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.mobs.add( npc ); spawned = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java index c5ce80fba..7edd1eb2b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/NPC.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -44,7 +43,7 @@ public abstract class NPC extends Mob { int n; do { n = pos + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - } while (!Level.passable[n] && !Level.avoid[n]); + } while (!Dungeon.level.passable[n] && !Dungeon.level.avoid[n]); Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( pos ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java index cfcf0fc68..5b30ce316 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -87,13 +86,13 @@ public class Bomb extends Item { @Override protected void onThrow( int cell ) { - if (!Level.pit[ cell ] && lightingFuse) { + if (!Dungeon.level.pit[ cell ] && lightingFuse) { Actor.addDelayed(fuse = new Fuse().ignite(this), 2); } if (Actor.findChar( cell ) != null && !(Actor.findChar( cell ) instanceof Hero) ){ ArrayList candidates = new ArrayList<>(); for (int i : PathFinder.NEIGHBOURS8) - if (Level.passable[cell + i]) + if (Dungeon.level.passable[cell + i]) candidates.add(cell + i); int newCell = candidates.isEmpty() ? cell : Random.element(candidates); Dungeon.level.drop( this, newCell ).sprite.drop( cell ); @@ -128,7 +127,7 @@ public class Bomb extends Item { CellEmitter.get( c ).burst( SmokeParticle.FACTORY, 4 ); } - if (Level.flamable[c]) { + if (Dungeon.level.flamable[c]) { Dungeon.level.destroy( c ); GameScene.updateMap( c ); terrainAffected = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Honeypot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Honeypot.java index 9dd48105f..9a1f65f7a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Honeypot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Honeypot.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; @@ -80,7 +79,7 @@ public class Honeypot extends Item { @Override protected void onThrow( int cell ) { - if (Level.pit[cell]) { + if (Dungeon.level.pit[cell]) { super.onThrow( cell ); } else { Dungeon.level.drop(shatter( null, cell ), cell); @@ -97,7 +96,7 @@ public class Honeypot extends Item { int newPos = pos; if (Actor.findChar( pos ) != null) { ArrayList candidates = new ArrayList(); - boolean[] passable = Level.passable; + boolean[] passable = Dungeon.level.passable; for (int n : PathFinder.NEIGHBOURS4) { int c = pos + n; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java index d4c005d93..a758f71fb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/RogueArmor.java @@ -56,7 +56,7 @@ public class RogueArmor extends ClassArmor { if (target != null) { if (!Level.fieldOfView[target] || - !(Level.passable[target] || Level.avoid[target]) || + !(Dungeon.level.passable[target] || Dungeon.level.avoid[target]) || Actor.findChar( target ) != null) { GLog.w( Messages.get(RogueArmor.class, "fov") ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java index 686aa8be4..af31cfeef 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java @@ -33,7 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Thief; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.watabou.utils.Bundle; @@ -54,7 +53,7 @@ public class Multiplicity extends Armor.Glyph { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = defender.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { + if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { spawnPoints.add( p ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 98223e592..47bb4f9f1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -130,7 +130,7 @@ public class DriedRose extends Artifact { ArrayList spawnPoints = new ArrayList(); for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { + if (Actor.findChar(p) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { spawnPoints.add(p); } } @@ -269,7 +269,7 @@ public class DriedRose extends Artifact { int ghostPos; do { ghostPos = pos + PathFinder.NEIGHBOURS8[Random.Int(8)]; - } while (Level.solid[ghostPos] || level.findMob(ghostPos) != null); + } while (Dungeon.level.solid[ghostPos] || level.findMob(ghostPos) != null); heldGhost.pos = ghostPos; heldGhost = null; @@ -318,7 +318,7 @@ public class DriedRose extends Artifact { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = target.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar(p) == null && (Level.passable[p] || Level.avoid[p])) { + if (Actor.findChar(p) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { spawnPoints.add(p); } } @@ -573,7 +573,7 @@ public class DriedRose extends Artifact { if (rose != null && rose.armor != null){ if (rose.armor.hasGlyph(Swiftness.class)) { speed *= (1.1f + 0.01f * rose.armor.level()); - } else if (rose.armor.hasGlyph(Flow.class) && Level.water[pos]){ + } else if (rose.armor.hasGlyph(Flow.class) && Dungeon.level.water[pos]){ speed *= (1.5f + 0.05f * rose.armor.level()); } } @@ -627,7 +627,7 @@ public class DriedRose extends Artifact { rose.talkedTo = true; GameScene.show(new WndQuest(this, Messages.get(this, "introduce") )); return false; - } else if (Level.passable[pos] || Dungeon.hero.flying) { + } else if (Dungeon.level.passable[pos] || Dungeon.hero.flying) { int curPos = pos; moveSprite( pos, Dungeon.hero.pos ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java index 8f7b2e8bf..63cadaf28 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java @@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Chains; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; @@ -105,7 +104,7 @@ public class EtherealChains extends Artifact { if (target != null && (Dungeon.level.visited[target] || Dungeon.level.mapped[target])){ //chains cannot be used to go where it is impossible to walk to - PathFinder.buildDistanceMap(target, BArray.or(Level.passable, Level.avoid, null)); + PathFinder.buildDistanceMap(target, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null)); if (PathFinder.distance[curUser.pos] == Integer.MAX_VALUE){ GLog.w( Messages.get(EtherealChains.class, "cant_reach") ); return; @@ -140,7 +139,7 @@ public class EtherealChains extends Artifact { int bestPos = -1; for (int i : chain.subPath(1, chain.dist)){ //prefer to the earliest point on the path - if (!Level.solid[i] && Actor.findChar(i) == null){ + if (!Dungeon.level.solid[i] && Actor.findChar(i) == null){ bestPos = i; break; } @@ -182,7 +181,7 @@ public class EtherealChains extends Artifact { private void chainLocation( Ballistica chain, final Hero hero ){ //don't pull if the collision spot is in a wall - if (Level.solid[chain.collisionPos]){ + if (Dungeon.level.solid[chain.collisionPos]){ GLog.i( Messages.get(this, "inside_wall")); return; } @@ -190,7 +189,7 @@ public class EtherealChains extends Artifact { //don't pull if there are no solid objects next to the pull location boolean solidFound = false; for (int i : PathFinder.NEIGHBOURS8){ - if (Level.solid[chain.collisionPos + i]){ + if (Dungeon.level.solid[chain.collisionPos + i]){ solidFound = true; break; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index 15cd925c2..daf0fd7a0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -153,7 +152,9 @@ public class TalismanOfForesight extends Artifact { for (int y = ay; y <= by; y++) { for (int x = ax, p = ax + y * Dungeon.level.width(); x <= bx; x++, p++) { - if (Dungeon.visible[p] && Level.secret[p] && Dungeon.level.map[p] != Terrain.SECRET_DOOR) + if (Dungeon.visible[p] + && Dungeon.level.secret[p] + && Dungeon.level.map[p] != Terrain.SECRET_DOOR) smthFound = true; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java index 1d0fa4b14..4a7cc786f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java @@ -34,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler; import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -215,7 +214,7 @@ public class Potion extends Item { @Override protected void onThrow( int cell ) { - if (Dungeon.level.map[cell] == Terrain.WELL || Level.pit[cell]) { + if (Dungeon.level.map[cell] == Terrain.WELL || Dungeon.level.pit[cell]) { super.onThrow( cell ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java index 7c8a2c0b6..629d5a167 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfFrost.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; @@ -41,7 +40,7 @@ public class PotionOfFrost extends Potion { @Override public void shatter( int cell ) { - PathFinder.buildDistanceMap( cell, BArray.not( Level.losBlocking, null ), DISTANCE ); + PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.losBlocking, null ), DISTANCE ); Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java index a1809bb1e..ef832cc1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLiquidFlame.java @@ -28,7 +28,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.watabou.noosa.audio.Sample; import com.watabou.utils.PathFinder; @@ -50,7 +49,7 @@ public class PotionOfLiquidFlame extends Potion { } for (int offset : PathFinder.NEIGHBOURS9){ - if (Level.flamable[cell+offset] + if (Dungeon.level.flamable[cell+offset] || Actor.findChar(cell+offset) != null || Dungeon.level.heaps.get(cell+offset) != null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java index 77649ad01..5b7753e2b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java @@ -34,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.GasesImmunity; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -52,7 +51,7 @@ public class PotionOfPurity extends Potion { @Override public void shatter( int cell ) { - PathFinder.buildDistanceMap( cell, BArray.not( Level.losBlocking, null ), DISTANCE ); + PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.losBlocking, null ), DISTANCE ); boolean procd = false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java index 1d2071905..ad8caf254 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java @@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; @@ -104,7 +103,7 @@ public class CeremonialCandle extends Item { ArrayList candidates = new ArrayList<>(); for (int n : PathFinder.NEIGHBOURS8) { int cell = ritualPos + n; - if ((Level.passable[cell] || Level.avoid[cell]) && Actor.findChar( cell ) == null) { + if ((Dungeon.level.passable[cell] || Dungeon.level.avoid[cell]) && Actor.findChar( cell ) == null) { candidates.add( cell ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CorpseDust.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CorpseDust.java index 36cb9d47c..d1afbeee8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CorpseDust.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/quest/CorpseDust.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -104,7 +103,7 @@ public class CorpseDust extends Item { int pos = 0; do{ pos = Random.Int(Dungeon.level.length()); - } while (!Dungeon.visible[pos] || !Level.passable[pos] || Actor.findChar( pos ) != null); + } while (!Dungeon.visible[pos] || !Dungeon.level.passable[pos] || Actor.findChar( pos ) != null); Wraith.spawnAt(pos); Sample.INSTANCE.play(Assets.SND_CURSED); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java index ceae52ad6..ec651d44a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMagicMapping.java @@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -49,7 +48,7 @@ public class ScrollOfMagicMapping extends Scroll { int length = Dungeon.level.length(); int[] map = Dungeon.level.map; boolean[] mapped = Dungeon.level.mapped; - boolean[] discoverable = Level.discoverable; + boolean[] discoverable = Dungeon.level.discoverable; boolean noticed = false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java index e1d13856a..2f74e0f12 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java @@ -22,13 +22,13 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; @@ -79,7 +79,7 @@ public class ScrollOfMirrorImage extends Scroll { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { + if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { respawnPoints.add( p ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java index d224cf817..58a21df75 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfTeleportation.java @@ -28,7 +28,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -83,9 +82,9 @@ public class ScrollOfTeleportation extends Scroll { } public static void teleportToLocation(Hero hero, int pos){ - PathFinder.buildDistanceMap(pos, BArray.or(Level.passable, Level.avoid, null)); + PathFinder.buildDistanceMap(pos, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null)); if (PathFinder.distance[hero.pos] == Integer.MAX_VALUE - || (!Level.passable[pos] && !Level.avoid[pos]) + || (!Dungeon.level.passable[pos] && !Dungeon.level.avoid[pos]) || Actor.findChar(pos) != null){ GLog.w( Messages.get(ScrollOfTeleportation.class, "cant_reach") ); return; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java index 41a5f9460..dd6883f75 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java @@ -22,17 +22,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.effects.Beam; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.utils.Callback; import com.watabou.utils.Random; @@ -80,7 +79,7 @@ public class WandOfDisintegration extends DamageWand { chars.add( ch ); } - if (Level.flamable[c]) { + if (Dungeon.level.flamable[c]) { Dungeon.level.destroy( c ); GameScene.updateMap( c ); @@ -88,7 +87,7 @@ public class WandOfDisintegration extends DamageWand { } - if (Level.solid[c]) + if (Dungeon.level.solid[c]) terrainPassed++; CellEmitter.center( c ).burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index ad3993358..7b193ce4b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -34,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blazing; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -81,7 +80,7 @@ public class WandOfFireblast extends DamageWand { //only ignite cells directly near caster if they are flammable if (!Dungeon.level.adjacent(bolt.sourcePos, cell) - || Level.flamable[cell]){ + || Dungeon.level.flamable[cell]){ GameScene.add( Blob.seed( cell, 1+chargesPerCast(), Fire.class ) ); } @@ -105,7 +104,7 @@ public class WandOfFireblast extends DamageWand { //burn... BURNNNNN!..... private void spreadFlames(int cell, float strength){ - if (strength >= 0 && (Level.passable[cell] || Level.flamable[cell])){ + if (strength >= 0 && (Dungeon.level.passable[cell] || Dungeon.level.flamable[cell])){ affectedCells.add(cell); if (strength >= 1.5f) { visualCells.remove(cell); @@ -115,7 +114,7 @@ public class WandOfFireblast extends DamageWand { } else { visualCells.add(cell); } - } else if (!Level.passable[cell]) + } else if (!Dungeon.level.passable[cell]) visualCells.add(cell); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java index bd14a17f3..249035d00 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java @@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.noosa.audio.Sample; @@ -82,7 +81,7 @@ public class WandOfFrost extends DamageWand { ch.damage(damage, this); if (ch.isAlive()){ - if (Level.water[ch.pos]) + if (Dungeon.level.water[ch.pos]) Buff.prolong(ch, Chill.class, 4+level()); else Buff.prolong(ch, Chill.class, 2+level()); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java index c41639a62..c522c77c0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -68,7 +67,7 @@ public class WandOfLightning extends DamageWand { //lightning deals less damage per-target, the more targets that are hit. float multipler = 0.4f + (0.6f/affected.size()); //if the main target is in water, all affected take full damage - if (Level.water[bolt.collisionPos]) multipler = 1f; + if (Dungeon.level.water[bolt.collisionPos]) multipler = 1f; int min = 5 + level(); int max = 10 + 5*level(); @@ -99,12 +98,12 @@ public class WandOfLightning extends DamageWand { affected.add( ch ); int dist; - if (Level.water[ch.pos] && !ch.flying) + if (Dungeon.level.water[ch.pos] && !ch.flying) dist = 2; else dist = 1; - PathFinder.buildDistanceMap( ch.pos, BArray.not( Level.solid, null ), dist ); + PathFinder.buildDistanceMap( ch.pos, BArray.not( Dungeon.level.solid, null ), dist ); for (int i = 0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE){ Char n = Actor.findChar( i ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java index c94de685e..65dafecae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java @@ -36,7 +36,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.RainbowParticl import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -105,7 +104,7 @@ public class WandOfPrismaticLight extends DamageWand { for (int n : PathFinder.NEIGHBOURS9){ int cell = c+n; - if (Level.discoverable[cell]) + if (Dungeon.level.discoverable[cell]) Dungeon.level.mapped[cell] = true; int terr = Dungeon.level.map[cell]; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index e9b3c248c..a76f027fd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -109,7 +109,7 @@ public class WandOfRegrowth extends Wand { } private void spreadRegrowth(int cell, float strength){ - if (strength >= 0 && Level.passable[cell] && !Level.losBlocking[cell]){ + if (strength >= 0 && Dungeon.level.passable[cell] && !Dungeon.level.losBlocking[cell]){ affectedCells.add(cell); if (strength >= 1.5f) { spreadRegrowth(cell + PathFinder.CIRCLE8[left(direction)], strength - 1.5f); @@ -118,7 +118,7 @@ public class WandOfRegrowth extends Wand { } else { visualCells.add(cell); } - } else if (!Level.passable[cell] || Level.losBlocking[cell]) + } else if (!Dungeon.level.passable[cell] || Dungeon.level.losBlocking[cell]) visualCells.add(cell); } @@ -199,7 +199,7 @@ public class WandOfRegrowth extends Wand { float strength = maxDist; for (int c : bolt.subPath(1, dist)) { strength--; //as we start at dist 1, not 0. - if (!Level.losBlocking[c]) { + if (!Dungeon.level.losBlocking[c]) { affectedCells.add(c); spreadRegrowth(c + PathFinder.CIRCLE8[left(direction)], strength - 1); spreadRegrowth(c + PathFinder.CIRCLE8[direction], strength - 1); @@ -266,7 +266,7 @@ public class WandOfRegrowth extends Wand { ArrayList candidates = new ArrayList(); for (int i : PathFinder.NEIGHBOURS8){ - if (Level.passable[pos+i]){ + if (Dungeon.level.passable[pos+i]){ candidates.add(pos+i); } } @@ -300,7 +300,7 @@ public class WandOfRegrowth extends Wand { ArrayList candidates = new ArrayList(); for (int i : PathFinder.NEIGHBOURS8){ - if (Level.passable[pos+i]){ + if (Dungeon.level.passable[pos+i]){ candidates.add(pos+i); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java index b5bae9b82..16b2aeb99 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java @@ -21,12 +21,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.watabou.utils.PathFinder; @@ -78,7 +78,7 @@ public class Shocking extends Weapon.Enchantment { } affected.add(ch); - ch.damage(Level.water[ch.pos] && !ch.flying ? (int) (damage * 2) : damage, LightningTrap.LIGHTNING); + ch.damage(Dungeon.level.water[ch.pos] && !ch.flying ? 2*damage : damage, LightningTrap.LIGHTNING); ch.sprite.centerEmitter().burst(SparkParticle.FACTORY, 3); ch.sprite.flash(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java index c45fa21a1..33386fdb0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/IncendiaryDart.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; @@ -28,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.watabou.utils.Random; @@ -66,7 +66,7 @@ public class IncendiaryDart extends MissileWeapon { @Override protected void onThrow( int cell ) { Char enemy = Actor.findChar( cell ); - if ((enemy == null || enemy == curUser) && Level.flamable[cell]) + if ((enemy == null || enemy == curUser) && Dungeon.level.flamable[cell]) GameScene.add( Blob.seed( cell, 4, Fire.class ) ); else super.onThrow( cell ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 1d3eae670..d4fdf71a7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Projecting; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.utils.Random; @@ -58,7 +57,7 @@ abstract public class MissileWeapon extends Weapon { @Override public int throwPos(Hero user, int dst) { if (hasEnchant(Projecting.class) - && !Level.solid[dst] && Dungeon.level.distance(user.pos, dst) <= 4){ + && !Dungeon.level.solid[dst] && Dungeon.level.distance(user.pos, dst) <= 4){ return dst; } else { return super.throwPos(user, dst); 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 d3ea5c2b9..3de588058 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -109,25 +109,25 @@ public abstract class Level implements Bundlable { protected static final float TIME_TO_RESPAWN = 50; public int version; + public int[] map; public boolean[] visited; public boolean[] mapped; + public boolean[] discoverable; public int viewDistance = Dungeon.isChallenged( Challenges.DARKNESS ) ? 4 : 8; - //FIXME should not be static! + //TODO even though it would cost more memory, it may make more sense to have this be a property of char. public static boolean[] fieldOfView; - public static boolean[] passable; - public static boolean[] losBlocking; - public static boolean[] flamable; - public static boolean[] secret; - public static boolean[] solid; - public static boolean[] avoid; - public static boolean[] water; - public static boolean[] pit; - - public static boolean[] discoverable; + public boolean[] passable; + public boolean[] losBlocking; + public boolean[] flamable; + public boolean[] secret; + public boolean[] solid; + public boolean[] avoid; + public boolean[] water; + public boolean[] pit; public Feeling feeling = Feeling.NONE; @@ -620,22 +620,26 @@ public abstract class Level implements Bundlable { } } - public static void set( int cell, int terrain ) { - Painter.set( Dungeon.level, cell, terrain ); + public static void set( int cell, int terrain ){ + set( cell, terrain, Dungeon.level ); + } + + public static void set( int cell, int terrain, Level level ) { + Painter.set( level, cell, terrain ); if (terrain != Terrain.TRAP && terrain != Terrain.SECRET_TRAP && terrain != Terrain.INACTIVE_TRAP){ - Dungeon.level.traps.remove( cell ); + level.traps.remove( cell ); } int flags = Terrain.flags[terrain]; - passable[cell] = (flags & Terrain.PASSABLE) != 0; - losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0; - flamable[cell] = (flags & Terrain.FLAMABLE) != 0; - secret[cell] = (flags & Terrain.SECRET) != 0; - solid[cell] = (flags & Terrain.SOLID) != 0; - avoid[cell] = (flags & Terrain.AVOID) != 0; - pit[cell] = (flags & Terrain.PIT) != 0; - water[cell] = terrain == Terrain.WATER; + level.passable[cell] = (flags & Terrain.PASSABLE) != 0; + level.losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0; + level.flamable[cell] = (flags & Terrain.FLAMABLE) != 0; + level.secret[cell] = (flags & Terrain.SECRET) != 0; + level.solid[cell] = (flags & Terrain.SOLID) != 0; + level.avoid[cell] = (flags & Terrain.AVOID) != 0; + level.pit[cell] = (flags & Terrain.PIT) != 0; + level.water[cell] = terrain == Terrain.WATER; } public Heap drop( Item item, int cell ) { @@ -688,7 +692,7 @@ public abstract class Level implements Bundlable { int n; do { n = cell + PathFinder.NEIGHBOURS8[Random.Int( 8 )]; - } while (!Level.passable[n] && !Level.avoid[n]); + } while (!passable[n] && !avoid[n]); return drop( item, n ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 27b21affd..b1bcf6971 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -215,7 +215,7 @@ public abstract class RegularLevel extends Level { Mob mob = createMob(); mob.pos = pointToCell(roomToSpawn.random()); - if (findMob(mob.pos) == null && Level.passable[mob.pos]) { + if (findMob(mob.pos) == null && passable[mob.pos]) { mobsToSpawn--; mobs.add(mob); @@ -224,7 +224,7 @@ public abstract class RegularLevel extends Level { mob = createMob(); mob.pos = pointToCell(roomToSpawn.random()); - if (findMob(mob.pos) == null && Level.passable[mob.pos]) { + if (findMob(mob.pos) == null && passable[mob.pos]) { mobsToSpawn--; mobs.add(mob); } @@ -261,7 +261,7 @@ public abstract class RegularLevel extends Level { cell = pointToCell(room.random(1)); if ((Dungeon.level != this || !Dungeon.visible[cell]) && Actor.findChar( cell ) == null - && Level.passable[cell] + && passable[cell] && cell != exit) { return cell; } @@ -282,7 +282,7 @@ public abstract class RegularLevel extends Level { } cell = pointToCell(room.random()); - if (Level.passable[cell]) { + if (passable[cell]) { return cell; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/BlazingTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/BlazingTrap.java index a83559db1..caa6b77ab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/BlazingTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/BlazingTrap.java @@ -22,11 +22,11 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.traps; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.watabou.noosa.audio.Sample; @@ -42,10 +42,10 @@ public class BlazingTrap extends Trap { @Override public void activate() { - PathFinder.buildDistanceMap( pos, BArray.not( Level.solid, null ), 2 ); + PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 ); for (int i = 0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE) { - if (Level.pit[i] || Level.water[i]) + if (Dungeon.level.pit[i] || Dungeon.level.water[i]) GameScene.add(Blob.seed(i, 1, Fire.class)); else GameScene.add(Blob.seed(i, 5, Fire.class)); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java index 5838e0368..a57e8df70 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/FlockTrap.java @@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.watabou.noosa.audio.Sample; @@ -50,16 +49,19 @@ public class FlockTrap extends Trap { { actPriority = 3; } protected boolean act() { - PathFinder.buildDistanceMap( pos, BArray.not( Level.solid, null ), 2 ); + PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 ); for (int i = 0; i < PathFinder.distance.length; i++) { - if (PathFinder.distance[i] < Integer.MAX_VALUE) - if (Dungeon.level.insideMap(i) && Actor.findChar(i) == null && !(Level.pit[i])) { - Sheep sheep = new Sheep(); - sheep.lifespan = 2 + Random.Int(Dungeon.depth + 10); - sheep.pos = i; - Dungeon.level.mobPress(sheep); - GameScene.add(sheep); - CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4); + if (PathFinder.distance[i] < Integer.MAX_VALUE) { + if (Dungeon.level.insideMap(i) + && Actor.findChar(i) == null + && !(Dungeon.level.pit[i])) { + Sheep sheep = new Sheep(); + sheep.lifespan = 2 + Random.Int(Dungeon.depth + 10); + sheep.pos = i; + Dungeon.level.mobPress(sheep); + GameScene.add(sheep); + CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4); + } } } Sample.INSTANCE.play(Assets.SND_PUFF); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java index 402e5be63..5687fcac0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/PitfallTrap.java @@ -67,11 +67,11 @@ public class PitfallTrap extends Trap { super.disarm(); int stateChanges = 0; - boolean curPassable = Level.passable[pos + PathFinder.CIRCLE8[PathFinder.CIRCLE8.length-1]]; + boolean curPassable = Dungeon.level.passable[pos + PathFinder.CIRCLE8[PathFinder.CIRCLE8.length-1]]; for (int i : PathFinder.CIRCLE8){ - if (curPassable != Level.passable[pos + i]){ + if (curPassable != Dungeon.level.passable[pos + i]){ stateChanges++; - curPassable = Level.passable[pos + i]; + curPassable = Dungeon.level.passable[pos + i]; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java index b836ff817..c487ed6a2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/RockfallTrap.java @@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.watabou.noosa.Camera; @@ -51,7 +50,7 @@ public class RockfallTrap extends Trap { for (int i : PathFinder.NEIGHBOURS9){ - if (Level.solid[pos+i]) + if (Dungeon.level.solid[pos+i]) continue; if (Dungeon.visible[ pos+i ]){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java index 78ce4b481..d3556c330 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; @@ -60,7 +59,7 @@ public class SummoningTrap extends Trap { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Level.passable[p] || Level.avoid[p])) { + if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { candidates.add( p ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/Ballistica.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/Ballistica.java index 25ad671a7..b73b23393 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/Ballistica.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/Ballistica.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.mechanics; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import java.util.ArrayList; import java.util.List; @@ -103,13 +102,13 @@ public class Ballistica { while (Dungeon.level.insideMap(cell)) { //if we're in a wall, collide with the previous cell along the path. - if (stopTerrain && cell != sourcePos && !Level.passable[cell] && !Level.avoid[cell]) { + if (stopTerrain && cell != sourcePos && !Dungeon.level.passable[cell] && !Dungeon.level.avoid[cell]) { collide(path.get(path.size() - 1)); } path.add(cell); - if ((stopTerrain && cell != sourcePos && Level.losBlocking[cell]) + if ((stopTerrain && cell != sourcePos && Dungeon.level.losBlocking[cell]) || (cell != sourcePos && stopChars && Actor.findChar( cell ) != null) || (cell == to && stopTarget)){ collide(cell); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/ShadowCaster.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/ShadowCaster.java index b35ab87c6..794b2c8bf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/ShadowCaster.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/mechanics/ShadowCaster.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.mechanics; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; public final class ShadowCaster { @@ -48,7 +47,7 @@ public final class ShadowCaster { fieldOfView[y * Dungeon.level.width() + x] = true; - boolean[] losBlocking = Level.losBlocking; + boolean[] losBlocking = Dungeon.level.losBlocking; Obstacles obs = new Obstacles(); scanSector( distance, fieldOfView, losBlocking, obs, x, y, +1, +1, 0, 0 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java index a42d0938f..f1f3ec1b0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.BArray; import com.watabou.utils.PathFinder; @@ -39,7 +38,7 @@ public class Icecap extends Plant { @Override public void activate() { - PathFinder.buildDistanceMap( pos, BArray.not( Level.losBlocking, null ), 1 ); + PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.losBlocking, null ), 1 ); Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java index 754697d0e..6fd3a92f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java @@ -36,7 +36,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.noosa.audio.Sample; @@ -142,7 +141,9 @@ public abstract class Plant implements Bundlable { @Override protected void onThrow( int cell ) { - if (Dungeon.level.map[cell] == Terrain.ALCHEMY || Level.pit[cell] || Dungeon.level.traps.get(cell) != null) { + if (Dungeon.level.map[cell] == Terrain.ALCHEMY + || Dungeon.level.pit[cell] + || Dungeon.level.traps.get(cell) != null) { super.onThrow( cell ); } else { Dungeon.level.plant( this, cell ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index 5b93701a6..d5058208c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -34,7 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.TorchHalo; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -193,7 +192,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip isMoving = true; - if (visible && Level.water[from] && !ch.flying) { + if (visible && Dungeon.level.water[from] && !ch.flying) { GameScene.ripple( from ); } @@ -559,7 +558,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip public void onComplete( Tweener tweener ) { if (tweener == jumpTweener) { - if (visible && Level.water[ch.pos] && !ch.flying) { + if (visible && Dungeon.level.water[ch.pos] && !ch.flying) { GameScene.ripple( ch.pos ); } if (jumpCallback != null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java index a9f2b62a1..92ad53535 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java @@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; @@ -286,7 +285,7 @@ public class ItemSprite extends MovieClip { place(heap.pos); if (visible) { - boolean water = Level.water[heap.pos]; + boolean water = Dungeon.level.water[heap.pos]; if (water) { GameScene.ripple(heap.pos); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/TenguSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/TenguSprite.java index 28a1d1b0b..4b3440357 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/TenguSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/TenguSprite.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.watabou.noosa.TextureFilm; import com.watabou.utils.Callback; @@ -69,7 +68,7 @@ public class TenguSprite extends MobSprite { isMoving = true; - if (Level.water[to]) { + if (Dungeon.level.water[to]) { GameScene.ripple( to ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java index 5f078305c..1ba1db355 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/FogOfWar.java @@ -25,7 +25,6 @@ import android.opengl.GLES20; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.watabou.gltextures.SmartTexture; import com.watabou.gltextures.TextureCache; import com.watabou.glwrap.Texture; @@ -161,7 +160,7 @@ public class FogOfWar extends Image { if (cell >= Dungeon.level.length()) continue; //do nothing - if (!Level.discoverable[cell] + if (!Dungeon.level.discoverable[cell] || (!visible[cell] && !visited[cell] && !mapped[cell])){ //we skip filling cells here if it isn't a full update // because they must already be dark diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java index 2a0041f57..ac2e0749d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java @@ -22,7 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.tiles; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.watabou.noosa.TextureFilm; import com.watabou.noosa.Tilemap; @@ -58,7 +57,7 @@ public class WallBlockingTilemap extends Tilemap { if (prev == CLEARED){ return; - } else if (!Level.discoverable[cell]) { + } else if (!Dungeon.level.discoverable[cell]) { curr = CLEARED; //handles blocking wall overhang (which is technically on a none wall tile) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoCell.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoCell.java index 0fe2d82e4..49fa608e6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoCell.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndInfoCell.java @@ -23,7 +23,6 @@ package com.shatteredpixel.shatteredpixeldungeon.windows; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; -import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; @@ -45,9 +44,9 @@ public class WndInfoCell extends Window { super(); int tile = Dungeon.level.map[cell]; - if (Level.water[cell]) { + if (Dungeon.level.water[cell]) { tile = Terrain.WATER; - } else if (Level.pit[cell]) { + } else if (Dungeon.level.pit[cell]) { tile = Terrain.CHASM; }