From 81a61f96629a705bb2214ff32cdd6ce7ce5aac83 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 13 Oct 2020 14:47:24 -0400 Subject: [PATCH] v0.9.0b: Adjusted hostile champions challenge: - Champion base spawn rate up to 1/10 from 1/15 - Champions per floor now have a cap to prevent terrible luck - Growing champion base power reduced by 20% - Growing champion power scaling reduced by 50% --- .../main/assets/messages/misc/misc.properties | 2 +- .../actors/buffs/ChampionEnemy.java | 22 +++++++++++++++---- .../shatteredpixeldungeon/levels/Level.java | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/core/src/main/assets/messages/misc/misc.properties b/core/src/main/assets/messages/misc/misc.properties index 4a3638089..b5191fffa 100644 --- a/core/src/main/assets/messages/misc/misc.properties +++ b/core/src/main/assets/messages/misc/misc.properties @@ -84,6 +84,6 @@ challenges.darkness_desc=It is a dungeon after all!\n\n- Regular visible distanc challenges.no_scrolls=Forbidden runes challenges.no_scrolls_desc=A certain rune is harder to find. Unfortunately, it's always the most useful one.\n\n- Half of the dungeon's upgrades scrolls are removed challenges.champion_enemies=Hostile champions -challenges.champion_enemies_desc=You're not the only one who can level up!\n\n- Regular enemies have a 1/15 chance to spawn with a special champion buff.\n- Champions wake up if they spawn asleep\n- The hero knows when a champion spawns\n- Champions are immune to corruption\n\nThere are six types of champion enemy:\n_Blazing (orange):_ +25% melee damage, ignites on hit, immune to fire, spreads flames on death\n_Projecting (purple):_ +25% melee damage, +8 melee range\n_Antimagic (green):_ -25% damage taken, immune to magical effects\n_Giant (blue):_ -75% damage taken, +1 melee range, cannot move into tunnels\n_Blessed (yellow):_ +200% accuracy, +200% evasion\n_Growing (red):_ +25% accuracy, evasion, damage, and effective HP. Increases by 1% every 2 turns. +challenges.champion_enemies_desc=You're not the only one who can level up!\n\n- Regular enemies have a 1/10 chance to spawn with a special champion buff.\n- Champions wake up if they spawn asleep\n- The hero knows when a champion spawns\n- Champions are immune to corruption\n\nThere are six types of champion enemy:\n_Blazing (orange):_ +25% melee damage, ignites on hit, immune to fire, spreads flames on death\n_Projecting (purple):_ +25% melee damage, can attack anything they see\n_Antimagic (green):_ -25% damage taken, immune to magical effects\n_Giant (blue):_ -75% damage taken, +1 melee range, cannot move into tunnels\n_Blessed (yellow):_ +200% accuracy, +200% evasion\n_Growing (red):_ +20% accuracy, evasion, damage, and effective HP. Increases by 1% every 3 turns. rankings$record.something=Killed by Something diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ChampionEnemy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ChampionEnemy.java index 2c21d3419..194d48269 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ChampionEnemy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ChampionEnemy.java @@ -34,6 +34,8 @@ import com.watabou.utils.Bundle; import com.watabou.utils.PathFinder; import com.watabou.utils.Random; +import java.util.HashSet; + public abstract class ChampionEnemy extends Buff { { @@ -92,8 +94,20 @@ public abstract class ChampionEnemy extends Buff { immunities.add(Corruption.class); } - public static void rollForChampion( Mob m ){ - if (Random.Int(15) == 0){ + public static void rollForChampion(Mob m, HashSet existing){ + int existingChamps = 0; + for (Mob e : existing){ + if (!e.buffs(ChampionEnemy.class).isEmpty()){ + existingChamps++; + } + } + + //cap of 2/2/3/3/4 champs for each region. Mainly to prevent terrible luck in the earlygame + if (existingChamps >= 2 + Dungeon.depth/10){ + return; + } + + if (Random.Int(10) == 0){ switch (Random.Int(6)){ case 0: default: Buff.affect(m, Blazing.class); break; case 1: Buff.affect(m, Projecting.class); break; @@ -208,12 +222,12 @@ public abstract class ChampionEnemy extends Buff { color = 0xFF0000; } - private float multiplier = 1.24f; + private float multiplier = 1.19f; @Override public boolean act() { multiplier += 0.01f; - spend(2*TICK); + spend(3*TICK); return true; } 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 12f80ac7d..aa05477f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -449,7 +449,7 @@ public abstract class Level implements Bundlable { Mob m = Reflection.newInstance(mobsToSpawn.remove(0)); if (Dungeon.isChallenged(Challenges.CHAMPION_ENEMIES)){ - ChampionEnemy.rollForChampion(m); + ChampionEnemy.rollForChampion(m, mobs); } return m; }