diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 88ec43b64..d033d62fa 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -109,8 +109,8 @@ actors.buffs.berserk.angered=angered actors.buffs.berserk.berserk=berserking actors.buffs.berserk.exhausted=exhausted actors.buffs.berserk.recovering=recovering -actors.buffs.berserk.angered_desc=The severity of the Berserker's injuries strengthen his blows. As the berserker takes physical damage, his rage will build, granting him bonus damage. Damage which is blocked by armor still counts towards building rage.\n\nRage will fade over time. The lower the berserker's health, the longer it will last.\n\nAt 100%% rage, the Berserker can go berserk, granting him 2x his seal's max shielding, increasing to 6x if he has very low health. This shielding decays over time and once it runs out the berserker will have to rest before building rage again.\n\nCurrent Rage: _%.0f%%_\n_+%.0f%%_ damage -actors.buffs.berserk.berserk_desc=Fear and uncertainty bleed away, leaving only anger. In this state the Berserker is extremely powerful, _dealing +50% damage and gaining bonus shielding._\n\nThis bonus shielding is equal to 2x his seal's max shielding, increasing to 6x if he has very low health. When this shielding is reduced to 0, berserking will end.\n\nAfter raging, the Berserker will need to recover before being able to build rage again. +actors.buffs.berserk.angered_desc=The severity of the Berserker's injuries strengthen his blows. As the berserker takes physical damage, his rage will build, granting him bonus damage. Damage which is blocked by armor still counts towards building rage.\n\nRage will fade over time. The lower the berserker's health, the longer it will last.\n\nAt 100%% rage, the Berserker can go berserk, granting him shielding equal to 10 plus 2x his armor's level. This shielding can have up to a 3x multiplier if he has very low health. His shielding decays over time and once it runs out the berserker will have to rest before building rage again.\n\nCurrent Rage: _%.0f%%_\n_+%.0f%%_ damage +actors.buffs.berserk.berserk_desc=Fear and uncertainty bleed away, leaving only anger. In this state the Berserker is extremely powerful, _dealing +50% damage and gaining bonus shielding._\n\nWhen all of his shielding is reduced to 0, berserking will end.\n\nAfter raging, the Berserker will need to recover before being able to build rage again. actors.buffs.berserk.recovering_desc=Inner strength has its limits. The Berserker must rest before using his rage again.\n\nWhile recovering the Berserker does not build any rage from taking damage. actors.buffs.berserk.recovering_desc_turns=Turns until recovered: _%d_ actors.buffs.berserk.recovering_desc_levels=Levels until recovered: _%.2f_ @@ -829,7 +829,7 @@ actors.hero.heroclass.cleric_unlock=To unlock the Cleric _fully cleanse the curs actors.hero.herosubclass.berserker=berserker actors.hero.herosubclass.berserker_short_desc=The _Berserker_ builds rage as he takes damage. Rage increases his damage and can be activated at 100% for bonus shielding. -actors.hero.herosubclass.berserker_desc=The Berserker gains rage as he takes physical damage, including damage that gets blocked by his armor! Rage steadily fades away over time, but fades more slowly if he is at low HP.\n\nThe Berserker deals up to +50% damage at 100% rage. At 100% rage he can also go berserk, gaining 2-6x his seal's maximum shielding depending on his missing health and keeping his rage at 100% as long as he has shielding left. However, the Berserker needs time to recover after he goes berserk. +actors.hero.herosubclass.berserker_desc=The Berserker gains rage as he takes physical damage, including damage that gets blocked by his armor! Rage steadily fades away over time, but fades more slowly if he is at low HP.\n\nThe Berserker deals up to +50% damage at 100% rage. At 100% rage he can also go berserk, gaining a burst of shielding and keeping his rage at 100% as long as he has shielding left. The shielding gained has a base value of 10 plus 2x the level of the berserker's armor, but can be boosted by up to 3x based on his missing health. The Berserker needs time to recover after he goes berserk. actors.hero.herosubclass.gladiator=gladiator actors.hero.herosubclass.gladiator_short_desc=The _Gladiator_ builds combo when he makes successful attacks. He can spend combo to use unique abilities. actors.hero.herosubclass.gladiator_desc=The Gladiator builds one point of combo every time he makes a successful attack with a melee or thrown weapon. If the Gladiator does not make a successful attack within 5 turns, his combo is reset.\n\nAs he builds combo the Gladiator can use a variety of abilities that are guaranteed to hit:\n2 Combo: knock enemy back, preserves combo\n4 Combo: deal damage based on armor\n6 Combo: parry, preserves combo\n8 Combo: damage target and nearby enemies\n10 Combo: attack once for each combo diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java index 21d990b6c..2a710e80d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java @@ -43,10 +43,13 @@ import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.GameMath; -public class Berserk extends Buff implements ActionIndicator.Action { +public class Berserk extends ShieldBuff implements ActionIndicator.Action { { type = buffType.POSITIVE; + + detachesAtZero = false; + shieldUsePriority = -1; //other shielding buffs are always consumed first } private enum State{ @@ -97,21 +100,11 @@ public class Berserk extends Buff implements ActionIndicator.Action { @Override public boolean act() { if (state == State.BERSERK){ - ShieldBuff buff = target.buff(WarriorShield.class); if (target.shielding() > 0) { //lose 2.5% of shielding per turn, but no less than 1 int dmg = (int)Math.ceil(target.shielding() * 0.025f); - if (buff != null && buff.shielding() > 0) { - dmg = buff.absorbDamage(dmg); - } - if (dmg > 0){ - //if there is leftover damage, then try to remove from other shielding buffs - for (ShieldBuff s : target.buffs(ShieldBuff.class)){ - dmg = s.absorbDamage(dmg); - if (dmg == 0) break; - } - } + dmg = ShieldBuff.processDamage(target, dmg, this); if (target.shielding() <= 0){ state = State.RECOVERING; @@ -177,7 +170,6 @@ public class Berserk extends Buff implements ActionIndicator.Action { if (target.HP == 0 && state == State.NORMAL && power >= 1f - && target.buff(WarriorShield.class) != null && ((Hero)target).hasTalent(Talent.DEATHLESS_FURY)){ startBerserking(); ActionIndicator.clearAction(this); @@ -200,8 +192,8 @@ public class Berserk extends Buff implements ActionIndicator.Action { turnRecovery = 0; } - //base multiplier scales at 2/3/4/5/6x at 100/37/20/9/0% HP - float shieldMultiplier = 2f + 4*(float)Math.pow((1f-(target.HP/(float)target.HT)), 3); + //base multiplier scales at 1/1.5/2/2.5/3x at 100/37/20/9/0% HP + float shieldMultiplier = 1f + 2*(float)Math.pow((1f-(target.HP/(float)target.HT)), 3); //Endless rage effect on shield and cooldown if (power > 1f){ @@ -210,9 +202,12 @@ public class Berserk extends Buff implements ActionIndicator.Action { turnRecovery *= 2f - power; } - WarriorShield shield = target.buff(WarriorShield.class); - int shieldAmount = Math.round(shield.maxShield() * shieldMultiplier); - shield.supercharge(shieldAmount); + int baseShield = 10; + if (target instanceof Hero && ((Hero) target).belongings.armor() != null){ + baseShield += 2*((Hero) target).belongings.armor().buffedLvl(); + } + int shieldAmount = Math.round(baseShield * shieldMultiplier); + setShield(shieldAmount); target.sprite.showStatusWithIcon( CharSprite.POSITIVE, Integer.toString(shieldAmount), FloatingText.SHIELDING ); BuffIndicator.refreshHero(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index ede09dd28..697eb7987 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -48,6 +48,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.He import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Shockwave; import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.TengusMask; import com.shatteredpixel.shatteredpixeldungeon.items.Waterskin; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows; @@ -60,6 +61,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlam import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; +import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfShielding; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfLullaby; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; @@ -67,6 +69,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMirrorImag import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; +import com.shatteredpixel.shatteredpixeldungeon.items.spells.CurseInfusion; +import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Cudgel; @@ -142,6 +146,15 @@ public enum HeroClass { break; } + new ClothArmor().collect(); + + new CurseInfusion().quantity(4).collect(); + new StoneOfEnchantment().quantity(3).collect(); + + new PotionOfShielding().quantity(5).collect(); + + new TengusMask().collect(); + if (SPDSettings.quickslotWaterskin()) { for (int s = 0; s < QuickSlot.SIZE; s++) { if (Dungeon.quickslot.getItem(s) == null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java index 33f982907..f2eb66d64 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/BrokenSeal.java @@ -372,9 +372,10 @@ public class BrokenSeal extends Item { cooldown = bundle.getInt(COOLDOWN); turnsSinceEnemies = bundle.getInt(TURNS_SINCE_ENEMIES); } else { - //TODO what about berserker runs in progress? - // we could potentially screw someone who had a big shield prior to v3.1 - setShield(0); //clears old pre-v3.1 shield + //pre-3.1 shield, normally just clear it, but retain if it's big and possibly from berserking + if (shielding() < maxShield()+5 && target.HP > 0){ + setShield(0); + } } } }