diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index 79b8d229f..3bcf5317c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSight; @@ -37,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker; +import com.shatteredpixel.shatteredpixeldungeon.items.Amulet; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -373,6 +375,23 @@ public class Dungeon { public static boolean bossLevel( int depth ) { return depth == 5 || depth == 10 || depth == 15 || depth == 20 || depth == 25; } + + //value used for scaling of damage values and other effects. + //is usually the dungeon depth, but can be set to 26 when ascending + public static int scalingDepth(){ + if (Dungeon.hero != null && Dungeon.hero.buff(AscensionChallenge.class) != null){ + return 26; + } else { + return depth; + } + } + + public static boolean interfloorTeleportAllowed(){ + if (Dungeon.hero != null && Dungeon.hero.belongings.getItem(Amulet.class) != null){ + return false; + } + return true; + } public static void switchLevel( final Level level, int pos ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java index d7dc57145..69291212b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Electricity.java @@ -74,7 +74,7 @@ public class Electricity extends Blob { Buff.prolong( ch, Paralysis.class, cur[cell]); } if (cur[cell] % 2 == 1) { - ch.damage(Math.round(Random.Float(2 + Dungeon.depth / 5f)), this); + ch.damage(Math.round(Random.Float(2 + Dungeon.scalingDepth() / 5f)), this); if (!ch.isAlive() && ch == Dungeon.hero){ Dungeon.fail( getClass() ); GLog.n( Messages.get(this, "ondeath") ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java index ef4296560..4b5f49713 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ToxicGas.java @@ -37,7 +37,7 @@ public class ToxicGas extends Blob implements Hero.Doom { protected void evolve() { super.evolve(); - int damage = 1 + Dungeon.depth/5; + int damage = 1 + Dungeon.scalingDepth()/5; Char ch; int cell; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AscensionChallenge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AscensionChallenge.java index 18ef890df..81085ddc8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AscensionChallenge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AscensionChallenge.java @@ -82,15 +82,25 @@ public class AscensionChallenge extends Buff{ return 1; } - //TODO lots of impl still to do here + //used for internal calculations like corruption, not actual exp gain + public static int AscensionExp(Mob m){ + if (Dungeon.hero.buff(AscensionChallenge.class) == null){ + return m.EXP; + } - //for Exp: treat all enemies with multiplier as needing 14 EXP (except ghouls/rippers, which are 7/10) - - //For damage scaling effects: Treat as if floor 26 (bombs, toxic gas, corrosion, electricity, sac fire(?) - // Burning, ooze, - - //for allies/enemies with depth scaling effects, treat as if floor 26 - // How though? + if (m instanceof RipperDemon){ + return 10; //reduced due to their numbers + } else if (m instanceof Ghoul){ + return 7; //half of 14 + } else { + for (Class cls : modifiers.keySet()){ + if (m.getClass().isAssignableFrom(cls)){ + return Math.max(13, m.EXP); //same exp as an eye + } + } + } + return m.EXP; + } @Override public int icon() { 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 0a97ead1d..e202bfe5f 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 @@ -89,7 +89,7 @@ public class Burning extends Buff implements Hero.Doom { if (target.isAlive() && !target.isImmune(getClass())) { - int damage = Random.NormalIntRange( 1, 3 + Dungeon.depth/4 ); + int damage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 ); Buff.detach( target, Chill.class); if (target instanceof Hero && target.buff(TimekeepersHourglass.timeStasis.class) == null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Corrosion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Corrosion.java index 10e0b9415..f5df277af 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Corrosion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Corrosion.java @@ -108,7 +108,7 @@ public class Corrosion extends Buff implements Hero.Doom { public boolean act() { if (target.isAlive()) { target.damage((int)damage, this); - if (damage < (Dungeon.depth/2)+2) { + if (damage < (Dungeon.scalingDepth()/2)+2) { damage++; } else { damage += 0.5f; 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 ea90de09f..49d26d4e4 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 @@ -89,9 +89,9 @@ public class Ooze extends Buff { @Override public boolean act() { if (target.isAlive()) { - if (Dungeon.depth > 5) { - target.damage(1 + Dungeon.depth / 5, this); - } else if (Dungeon.depth == 5){ + if (Dungeon.scalingDepth() > 5) { + target.damage(1 + Dungeon.scalingDepth() / 5, this); + } else if (Dungeon.scalingDepth() == 5){ target.damage(1, this); //1 dmg per turn vs Goo } else if (Random.Int(2) == 0) { target.damage(1, this); //0.5 dmg per turn in sewers diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WarpBeacon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WarpBeacon.java index 3800017ca..f81556694 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WarpBeacon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/mage/WarpBeacon.java @@ -159,8 +159,8 @@ public class WarpBeacon extends ArmorAbility { } else { - if (hero.buff(LockedFloor.class) != null){ - GLog.w( Messages.get(WarpBeacon.class, "locked_floor") ); + if (!Dungeon.interfloorTeleportAllowed()){ + GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); return; } 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 b3ca15084..d362bc304 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 @@ -68,7 +68,7 @@ public abstract class Elemental extends Mob { if (!summonedALly) { return Random.NormalIntRange(20, 25); } else { - int regionScale = Math.max(2, (1 + Dungeon.depth/5)); + int regionScale = Math.max(2, (1 + Dungeon.scalingDepth()/5)); return Random.NormalIntRange(5*regionScale, 5 + 5*regionScale); } } @@ -78,7 +78,7 @@ public abstract class Elemental extends Mob { if (!summonedALly) { return 25; } else { - int regionScale = Math.max(2, (1 + Dungeon.depth/5)); + int regionScale = Math.max(2, (1 + Dungeon.scalingDepth()/5)); return 5 + 5*regionScale; } } @@ -86,7 +86,7 @@ public abstract class Elemental extends Mob { public void setSummonedALly(){ summonedALly = true; //sewers are prison are equivalent, otherwise scales as normal (2/2/3/4/5) - int regionScale = Math.max(2, (1 + Dungeon.depth/5)); + int regionScale = Math.max(2, (1 + Dungeon.scalingDepth()/5)); defenseSkill = 5*regionScale; HT = 15*regionScale; } 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 73f8a51d9..43a55a00a 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 @@ -610,7 +610,7 @@ public class Tengu extends Mob { if (PathFinder.distance[cell] < Integer.MAX_VALUE) { Char ch = Actor.findChar(cell); if (ch != null && !(ch instanceof Tengu)) { - int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth * 2); + int dmg = Random.NormalIntRange(5 + Dungeon.scalingDepth(), 10 + Dungeon.scalingDepth() * 2); dmg -= ch.drRoll(); if (dmg > 0) { @@ -1033,7 +1033,7 @@ public class Tengu extends Mob { Char ch = Actor.findChar(cell); if (ch != null && !(ch instanceof Tengu)){ - ch.damage(2 + Dungeon.depth, new Electricity()); + ch.damage(2 + Dungeon.scalingDepth(), new Electricity()); if (ch == Dungeon.hero){ Statistics.qualifiedForBossChallengeBadge = false; 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 493038643..b524376ea 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 @@ -103,7 +103,7 @@ public class Wraith extends Mob { if ((!Dungeon.level.solid[pos] || Dungeon.level.passable[pos]) && Actor.findChar( pos ) == null) { Wraith w = new Wraith(); - w.adjustStats( Dungeon.depth ); + w.adjustStats( Dungeon.scalingDepth() ); w.pos = pos; w.state = w.HUNTING; GameScene.add( w, SPAWN_DELAY ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index 8682e995f..78c7de34d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; @@ -62,6 +63,10 @@ public class Blacksmith extends NPC { @Override protected boolean act() { + if (Dungeon.hero.buff(AscensionChallenge.class) != null){ + die(null); + return true; + } if (Dungeon.level.heroFOV[pos] && !Quest.reforged){ Notes.add( Notes.Landmark.TROLL ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index 58e6e8e1b..e0d44c51b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.FetidRat; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollTrickster; @@ -67,6 +68,10 @@ public class Ghost extends NPC { @Override protected boolean act() { + if (Dungeon.hero.buff(AscensionChallenge.class) != null){ + die(null); + return true; + } if (Quest.processed()) { target = Dungeon.hero.pos; } 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 c0b704911..b42fd36ba 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 @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Golem; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; @@ -56,7 +57,10 @@ public class Imp extends NPC { @Override protected boolean act() { - + if (Dungeon.hero.buff(AscensionChallenge.class) != null){ + die(null); + return true; + } if (!Quest.given && Dungeon.level.heroFOV[pos]) { if (!seenBefore) { yell( Messages.get(this, "hey", Dungeon.hero.name() ) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java index a6f600337..3dba2f142 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; @@ -52,6 +53,11 @@ public class Shopkeeper extends NPC { if (Dungeon.level.heroFOV[pos]){ Notes.add(Notes.Landmark.SHOP); } + + if (Dungeon.depth < 20 && Dungeon.hero.buff(AscensionChallenge.class) != null){ + flee(); + return true; + } sprite.turnTo( pos, Dungeon.hero.pos ); spend( TICK ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index 457ceb362..740aa90b0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -61,6 +62,10 @@ public class Wandmaker extends NPC { @Override protected boolean act() { + if (Dungeon.hero.buff(AscensionChallenge.class) != null){ + die(null); + return true; + } if (Dungeon.level.heroFOV[pos] && Quest.wand1 != null){ Notes.add( Notes.Landmark.WANDMAKER ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java index da8c76535..05cc477d9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.scenes.AmuletScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -48,7 +49,11 @@ public class Amulet extends Item { @Override public ArrayList actions( Hero hero ) { ArrayList actions = super.actions( hero ); - actions.add( AC_END ); + if (hero.buff(AscensionChallenge.class) != null){ + actions.clear(); + } else { + actions.add(AC_END); + } return actions; } 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 db66345c8..e5901c087 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Honeypot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Honeypot.java @@ -114,7 +114,7 @@ public class Honeypot extends Item { if (newPos != -1) { Bee bee = new Bee(); - bee.spawn( Dungeon.depth ); + bee.spawn( Dungeon.scalingDepth() ); bee.setPotInfo( pos, owner ); bee.HP = bee.HT; bee.pos = newPos; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java index a1442edba..85ffd969f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java @@ -111,7 +111,7 @@ public class LloydsBeacon extends Artifact { if (action == AC_SET || action == AC_RETURN) { - if (Dungeon.bossLevel()) { + if (Dungeon.bossLevel() || !Dungeon.interfloorTeleportAllowed()) { hero.spend( LloydsBeacon.TIME_TO_USE ); GLog.w( Messages.get(this, "preventing") ); return; @@ -200,7 +200,7 @@ public class LloydsBeacon extends Artifact { if (target == null) return; Invisibility.dispel(); - charge -= Dungeon.depth > 20 ? 2 : 1; + charge -= Dungeon.scalingDepth() > 20 ? 2 : 1; updateQuickslot(); if (Actor.findChar(target) == curUser){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java index c4c81c8c1..85cc9eb0f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ArcaneBomb.java @@ -81,7 +81,7 @@ public class ArcaneBomb extends Bomb { for (Char ch : affected){ // 100%/83%/67% bomb damage based on distance, but pierces armor. - int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); + int damage = Math.round(Random.NormalIntRange( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 )); float multiplier = 1f - (.16667f*Dungeon.level.distance(cell, ch.pos)); ch.damage(Math.round(damage*multiplier), this); if (ch == Dungeon.hero && !ch.isAlive()){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java index c0dfccc76..b5a41a6ad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/Bomb.java @@ -178,7 +178,7 @@ public class Bomb extends Item { continue; } - int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth*2); + int dmg = Random.NormalIntRange(5 + Dungeon.scalingDepth(), 10 + Dungeon.scalingDepth()*2); //those not at the center of the blast take less damage if (ch.pos != cell){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java index 3cd38232e..26fef30e9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/HolyBomb.java @@ -68,7 +68,7 @@ public class HolyBomb extends Bomb { ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 ); //bomb deals an additional 50% damage to unholy enemies in a 5x5 range - int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 ) * 0.5f); + int damage = Math.round(Random.NormalIntRange( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 ) * 0.5f); ch.damage(damage, this); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java index f6f31c3c4..31999cd77 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShockBomb.java @@ -71,7 +71,7 @@ public class ShockBomb extends Bomb { int power = 16 - 4*Dungeon.level.distance(ch.pos, cell); if (power > 0){ //32% to 8% regular bomb damage - int damage = Math.round(Random.NormalIntRange(5 + Dungeon.depth, 10 + 2*Dungeon.depth) * (power/50f)); + int damage = Math.round(Random.NormalIntRange(5 + Dungeon.scalingDepth(), 10 + 2*Dungeon.scalingDepth()) * (power/50f)); ch.damage(damage, this); if (ch.isAlive()) Buff.prolong(ch, Paralysis.class, power); arcs.add(new Lightning.Arc(DungeonTilemap.tileCenterToWorld(cell), ch.sprite.center())); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java index 688c9e93f..42bdf6040 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bombs/ShrapnelBomb.java @@ -68,7 +68,7 @@ public class ShrapnelBomb extends Bomb { for (Char ch : affected){ //regular bomb damage, which falls off at a rate of 5% per tile of distance - int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 )); + int damage = Math.round(Random.NormalIntRange( Dungeon.scalingDepth()+5, 10 + Dungeon.scalingDepth() * 2 )); damage = Math.round(damage * (1f - .05f*Dungeon.level.distance(cell, ch.pos))); damage -= ch.drRoll(); ch.damage(damage, this); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java index 4dbfe5d74..1246ef8e5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfCorrosiveGas.java @@ -50,12 +50,12 @@ public class PotionOfCorrosiveGas extends ExoticPotion { int centerVolume = 25; for (int i : PathFinder.NEIGHBOURS8){ if (!Dungeon.level.solid[cell+i]){ - GameScene.add( Blob.seed( cell+i, 25, CorrosiveGas.class ).setStrength( 2 + Dungeon.depth/5)); + GameScene.add( Blob.seed( cell+i, 25, CorrosiveGas.class ).setStrength( 2 + Dungeon.scalingDepth()/5)); } else { centerVolume += 25; } } - GameScene.add( Blob.seed( cell, centerVolume, CorrosiveGas.class ).setStrength( 2 + Dungeon.depth/5)); + GameScene.add( Blob.seed( cell, centerVolume, CorrosiveGas.class ).setStrength( 2 + Dungeon.scalingDepth()/5)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java index d51f0c54f..4d5b12714 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfPassage.java @@ -44,7 +44,7 @@ public class ScrollOfPassage extends ExoticScroll { identify(); readAnimation(); - if (Dungeon.level.locked) { + if (!Dungeon.interfloorTeleportAllowed()) { GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); return; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java index c5688e4ee..3d0176da7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java @@ -109,7 +109,7 @@ public class BeaconOfReturning extends Spell { } private void returnBeacon( Hero hero ){ - if (Dungeon.level.locked) { + if (!Dungeon.interfloorTeleportAllowed()) { GLog.w( Messages.get(this, "preventing") ); return; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index 34e92164b..244771ca9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -205,7 +205,7 @@ public class CursedWand { case 1: final Char target = Actor.findChar( targetPos ); if (target != null) { - int damage = Dungeon.depth * 2; + int damage = Dungeon.scalingDepth() * 2; Char toHeal, toDamage; if (Random.Int(2) == 0){ @@ -295,7 +295,7 @@ public class CursedWand { //inter-level teleportation case 2: - if (Dungeon.depth > 1 && !Dungeon.bossLevel() && user == Dungeon.hero) { + if (Dungeon.depth > 1 && Dungeon.interfloorTeleportAllowed() && user == Dungeon.hero) { //each depth has 1 more weight than the previous depth. float[] depths = new float[Dungeon.depth-1]; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 3cfd395cf..c1a7083e0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; @@ -133,17 +134,20 @@ public class WandOfCorruption extends Wand { float corruptingPower = 3 + buffedLvl()/2f; //base enemy resistance is usually based on their exp, but in special cases it is based on other criteria - float enemyResist = 1 + enemy.EXP; + float enemyResist; if (ch instanceof Mimic || ch instanceof Statue){ enemyResist = 1 + Dungeon.depth; } else if (ch instanceof Piranha || ch instanceof Bee) { enemyResist = 1 + Dungeon.depth/2f; } else if (ch instanceof Wraith) { //divide by 5 as wraiths are always at full HP and are therefore ~5x harder to corrupt - enemyResist = (1f + Dungeon.depth/3f) / 5f; + enemyResist = (1f + Dungeon.scalingDepth()/3f) / 5f; } else if (ch instanceof Swarm){ //child swarms don't give exp, so we force this here. - enemyResist = 1 + 3; + enemyResist = 1 + AscensionChallenge.AscensionExp(enemy); + if (enemyResist == 1) enemyResist = 1 + 3; + } else { + enemyResist = 1 + AscensionChallenge.AscensionExp(enemy); } //100% health: 5x resist 75%: 3.25x resist 50%: 2x resist 25%: 1.25x resist diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java index 12e084266..1ec0cc2a2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java @@ -343,7 +343,7 @@ public class WandOfLivingEarth extends DamageWand { @Override public int damageRoll() { - return Random.NormalIntRange(2, 4 + Dungeon.depth/2); + return Random.NormalIntRange(2, 4 + Dungeon.scalingDepth()/2); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java index fe6db7d10..89985987b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java @@ -287,7 +287,7 @@ public class WandOfWarding extends Wand { @Override public int defenseSkill(Char enemy) { if (tier > 3){ - defenseSkill = 4 + Dungeon.depth; + defenseSkill = 4 + Dungeon.scalingDepth(); } return super.defenseSkill(enemy); } @@ -295,7 +295,7 @@ public class WandOfWarding extends Wand { @Override public int drRoll() { if (tier > 3){ - return Math.round(Random.NormalIntRange(0, 3 + Dungeon.depth/2) / (7f - tier)); + return Math.round(Random.NormalIntRange(0, 3 + Dungeon.scalingDepth()/2) / (7f - tier)); } else { return 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blazing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blazing.java index 005c265f7..bef31305d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blazing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blazing.java @@ -47,7 +47,7 @@ public class Blazing extends Weapon.Enchantment { if (defender.buff(Burning.class) != null){ Buff.affect(defender, Burning.class).reignite(defender, 8f); - int burnDamage = Random.NormalIntRange( 1, 3 + Dungeon.depth/4 ); + int burnDamage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 ); defender.damage( Math.round(burnDamage * 0.67f), this ); } else { Buff.affect(defender, Burning.class).reignite(defender, 8f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java index f10bd1b57..ae611087c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/HolyDart.java @@ -48,7 +48,7 @@ public class HolyDart extends TippedDart { if (Char.hasProp(defender, Char.Property.UNDEAD) || Char.hasProp(defender, Char.Property.DEMONIC)){ defender.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+buffedLvl() ); Sample.INSTANCE.play(Assets.Sounds.BURNING); - defender.damage(Random.NormalIntRange(10 + Dungeon.depth/3, 20 + Dungeon.depth/3), this); + defender.damage(Random.NormalIntRange(10 + Dungeon.scalingDepth()/3, 20 + Dungeon.scalingDepth()/3), this); } else { Buff.affect(defender, Bless.class, Math.round(Bless.DURATION)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java index f8f738d6f..cef51d4c2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/PoisonDart.java @@ -36,7 +36,7 @@ public class PoisonDart extends TippedDart { @Override public int proc(Char attacker, Char defender, int damage) { - Buff.affect( defender, Poison.class ).set( 3 + Dungeon.depth / 2 ); + Buff.affect( defender, Poison.class ).set( 3 + Dungeon.scalingDepth() / 2 ); return super.proc(attacker, defender, damage); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java index d807a9c99..9fa2c7a3f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/RotDart.java @@ -39,9 +39,9 @@ public class RotDart extends TippedDart { if (defender.properties().contains(Char.Property.BOSS) || defender.properties().contains(Char.Property.MINIBOSS)){ - Buff.affect(defender, Corrosion.class).set(5f, Dungeon.depth/3); + Buff.affect(defender, Corrosion.class).set(5f, Dungeon.scalingDepth()/3); } else{ - Buff.affect(defender, Corrosion.class).set(10f, Dungeon.depth); + Buff.affect(defender, Corrosion.class).set(10f, Dungeon.scalingDepth()); } return super.proc(attacker, defender, damage); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java index 72ddcbbf7..da8e7d8d7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/ShockingDart.java @@ -42,7 +42,7 @@ public class ShockingDart extends TippedDart { @Override public int proc(Char attacker, Char defender, int damage) { - defender.damage(Random.NormalIntRange(5 + Dungeon.depth/4, 10 + Dungeon.depth/4), this); + defender.damage(Random.NormalIntRange(5 + Dungeon.scalingDepth()/4, 10 + Dungeon.scalingDepth()/4), this); CharSprite s = defender.sprite; if (s != null && s.parent != null) { 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 d888fc750..f4da7d360 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -608,6 +608,9 @@ public abstract class Level implements Bundlable { Actor.addDelayed(respawner, respawnCooldown()); } else { Actor.add(respawner); + if (respawner.cooldown() > respawnCooldown()){ + respawner.resetCooldown(); + } } return respawner; } @@ -635,11 +638,20 @@ public abstract class Level implements Bundlable { return true; } + + protected void resetCooldown(){ + spend(-cooldown()); + spend(Dungeon.level.respawnCooldown()); + } } public float respawnCooldown(){ if (Statistics.amuletObtained){ - return TIME_TO_RESPAWN/2f; + if (Dungeon.level.mobCount() <= 2){ + return TIME_TO_RESPAWN / 10f; + } else { + return TIME_TO_RESPAWN / 2f; + } } else if (Dungeon.level.feeling == Feeling.DARK){ return 2*TIME_TO_RESPAWN/3f; } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java index fd3229620..563813feb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java @@ -96,7 +96,7 @@ public class Earthroot extends Plant { } private static int blocking(){ - return (Dungeon.depth + 5)/2; + return (Dungeon.scalingDepth() + 5)/2; } public int absorb( int damage ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java index c893a3913..b09fcf413 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java @@ -51,13 +51,7 @@ public class Fadeleaf extends Plant { ((Hero)ch).curAction = null; - if (((Hero) ch).subClass == HeroSubClass.WARDEN){ - - if (Dungeon.level.locked) { - GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") ); - return; - - } + if (((Hero) ch).subClass == HeroSubClass.WARDEN && Dungeon.interfloorTeleportAllowed()){ TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class); if (timeFreeze != null) timeFreeze.disarmPressedTraps(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java index 068dbf49f..c44314123 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sorrowmoss.java @@ -46,7 +46,7 @@ public class Sorrowmoss extends Plant { } if (ch != null) { - Buff.affect( ch, Poison.class ).set( 5 + Math.round(2*Dungeon.depth / 3f) ); + Buff.affect( ch, Poison.class ).set( 5 + Math.round(2*Dungeon.scalingDepth() / 3f) ); } if (Dungeon.level.heroFOV[pos]) {