diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index 40802de80..03e854791 100644 Binary files a/core/src/main/assets/interfaces/buffs.png and b/core/src/main/assets/interfaces/buffs.png differ diff --git a/core/src/main/assets/interfaces/large_buffs.png b/core/src/main/assets/interfaces/large_buffs.png index 5bf96a473..6a9533b71 100644 Binary files a/core/src/main/assets/interfaces/large_buffs.png and b/core/src/main/assets/interfaces/large_buffs.png differ 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 03720f13f..11b321533 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArcaneArmor; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; @@ -314,7 +315,7 @@ public abstract class Char extends Actor { } else if (hit( this, enemy, accMulti )) { - int dr = enemy.drRoll(); + int dr = Math.round(enemy.drRoll() * AscensionChallenge.statModifier(this)); Barkskin bark = enemy.buff(Barkskin.class); if (bark != null) dr += Random.NormalIntRange( 0 , bark.level() ); @@ -330,7 +331,7 @@ public abstract class Char extends Actor { dr = 0; } } - + int dmg; Preparation prep = buff(Preparation.class); if (prep != null){ @@ -467,6 +468,7 @@ public abstract class Char extends Actor { for (ChampionEnemy buff : attacker.buffs(ChampionEnemy.class)){ acuRoll *= buff.evasionAndAccuracyFactor(); } + acuRoll *= AscensionChallenge.statModifier(attacker); float defRoll = Random.Float( defStat ); if (defender.buff(Bless.class) != null) defRoll *= 1.25f; @@ -474,6 +476,7 @@ public abstract class Char extends Actor { for (ChampionEnemy buff : defender.buffs(ChampionEnemy.class)){ defRoll *= buff.evasionAndAccuracyFactor(); } + defRoll *= AscensionChallenge.statModifier(defender); return (acuRoll * accMulti) >= defRoll; } @@ -509,6 +512,7 @@ public abstract class Char extends Actor { damage *= buff.meleeDamageFactor(); buff.onAttackProc( enemy ); } + damage = Math.round( damage * AscensionChallenge.statModifier(this)); return damage; } @@ -557,6 +561,7 @@ public abstract class Char extends Actor { for (ChampionEnemy buff : buffs(ChampionEnemy.class)){ dmg = (int) Math.ceil(dmg * buff.damageTakenFactor()); } + dmg = (int)Math.ceil(dmg / AscensionChallenge.statModifier(this)); if (!(src instanceof LifeLink) && buff(LifeLink.class) != null){ HashSet links = buffs(LifeLink.class); 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 new file mode 100644 index 000000000..18ef890df --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AscensionChallenge.java @@ -0,0 +1,106 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2022 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.*; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.watabou.noosa.Image; + +import java.util.HashMap; + +public class AscensionChallenge extends Buff{ + + { + revivePersists = true; + } + + private static HashMap, Float> modifiers = new HashMap<>(); + static { + modifiers.put(Rat.class, 10f); + modifiers.put(Snake.class, 8f); + modifiers.put(Gnoll.class, 8f); + modifiers.put(Swarm.class, 7f); + modifiers.put(Crab.class, 6f); + modifiers.put(Slime.class, 6f); + + modifiers.put(Skeleton.class, 4.5f); + modifiers.put(Thief.class, 4.5f); + modifiers.put(DM100.class, 4f); + modifiers.put(Guard.class, 3.5f); + modifiers.put(Necromancer.class, 3.5f); + + modifiers.put(Bat.class, 2.5f); + modifiers.put(Brute.class, 2.25f); + modifiers.put(Shaman.class, 2.25f); + modifiers.put(Spinner.class, 2f); + modifiers.put(DM200.class, 2f); + + modifiers.put(Ghoul.class, 1.67f); + modifiers.put(Elemental.class, 1.5f); + modifiers.put(Warlock.class, 1.33f); + modifiers.put(Monk.class, 1.33f); + modifiers.put(Golem.class, 1.25f); + + modifiers.put(RipperDemon.class, 1.2f); + modifiers.put(Succubus.class, 1.2f); + modifiers.put(Eye.class, 1f); + modifiers.put(Scorpio.class, 1f); + } + + public static float statModifier(Char ch){ + if (Dungeon.hero.buff(AscensionChallenge.class) == null){ + return 1; + } + + for (Class cls : modifiers.keySet()){ + if (ch.getClass().isAssignableFrom(cls)){ + return modifiers.get(cls); + } + } + + return 1; + } + + //TODO lots of impl still to do here + + //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? + + @Override + public int icon() { + return BuffIndicator.AMULET; + } + + @Override + public void tintIcon(Image icon) { + icon.hardlight(1, 1, 0); + } + + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java index b8dc3e8c7..38867ee01 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM100.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; @@ -91,6 +92,7 @@ public class DM100 extends Mob implements Callback { if (hit( this, enemy, true )) { int dmg = Random.NormalIntRange(3, 10); + dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); enemy.damage( dmg, new LightningBolt() ); if (enemy.sprite.visible) { 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 94ebfb513..7db029380 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 @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle; @@ -177,7 +178,9 @@ public class Eye extends Mob { } if (hit( this, ch, true )) { - ch.damage( Random.NormalIntRange( 30, 50 ), new DeathGaze() ); + int dmg = Random.NormalIntRange( 30, 50 ); + dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); + ch.damage( dmg, new DeathGaze() ); if (Dungeon.level.heroFOV[pos]) { ch.sprite.flash(); 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 ad667bce6..baca38d11 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 @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Badges; 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.actors.buffs.Hex; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable; @@ -117,6 +118,7 @@ public abstract class Shaman extends Mob { } int dmg = Random.NormalIntRange( 6, 15 ); + dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); enemy.damage( dmg, new EarthenBolt() ); if (!enemy.isAlive() && enemy == Dungeon.hero) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index d3171865b..926b96048 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; @@ -68,7 +69,8 @@ public class Skeleton extends Mob { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { Char ch = findChar( pos + PathFinder.NEIGHBOURS8[i] ); if (ch != null && ch.isAlive()) { - int damage = Random.NormalIntRange(6, 12); + int damage = Math.round(Random.NormalIntRange(6, 12)); + damage = Math.round( damage * AscensionChallenge.statModifier(this)); damage = Math.max( 0, damage - (ch.drRoll() + ch.drRoll()) ); ch.damage( damage, this ); if (ch == Dungeon.hero && !ch.isAlive()) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java index 7d0b2de9d..0c1b1e343 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Web; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; @@ -119,7 +120,10 @@ public class Spinner extends Mob { public int attackProc(Char enemy, int damage) { damage = super.attackProc( enemy, damage ); if (Random.Int(2) == 0) { - Buff.affect(enemy, Poison.class).set(Random.IntRange(7, 8) ); + int duration = Random.IntRange(7, 8); + //we only use half the ascension modifier here as total poison dmg doesn't scale linearly + duration = Math.round(duration * (AscensionChallenge.statModifier(this)/2f + 0.5f)); + Buff.affect(enemy, Poison.class).set(duration); webCoolDown = 0; state = FLEEING; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java index 800b061cc..27645ddd2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Warlock.java @@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Badges; 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.actors.buffs.Degrade; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; @@ -110,6 +111,7 @@ public class Warlock extends Mob implements Callback { } int dmg = Random.NormalIntRange( 12, 18 ); + dmg = Math.round(dmg * AscensionChallenge.statModifier(this)); enemy.damage( dmg, new DarkBolt() ); if (enemy == Dungeon.hero && !enemy.isAlive()) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index c142249b5..a70bcc0a8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -109,6 +109,7 @@ public class BuffIndicator extends Component { public static final int ENDURE = 56; public static final int INVERT_MARK = 57; public static final int NATURE_POWER= 58; + public static final int AMULET = 59; public static final int SIZE_SMALL = 7; public static final int SIZE_LARGE = 16;