v1.3.0: added a bunch of functionality for ascension challenge
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
|
||||
@@ -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") );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<?extends Mob> 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() {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() ) );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
actions.add( AC_END );
|
||||
if (hero.buff(AscensionChallenge.class) != null){
|
||||
actions.clear();
|
||||
} else {
|
||||
actions.add(AC_END);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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()){
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user