diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index b5eeee007..1055c27e8 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -849,6 +849,11 @@ items.rings.ringofaccuracy.stats=When worn, this ring will increase your accurac items.rings.ringofaccuracy.typical_stats=When worn, this ring will typically increase your accuracy by _%s%%._ items.rings.ringofaccuracy.desc=This ring increases your focus, making it easier for your attacks to find their mark. A cursed ring will instead make it harder for your attacks to connect. +items.rings.ringofarcana.name=ring of arcana +items.rings.ringofarcana.stats=When worn, this ring will increase the power of enchants and glyphs by _%s%%._ +items.rings.ringofarcana.typical_stats=When worn, this ring will typically increase the power of enchants and glyphs by _%s%%._ +items.rings.ringofarcana.desc=This ring enhances magical enchantments on weapons and glyphs on armor, first increasing their activation chance and then the strength of their effects. A cursed ring will instead weaken enchantments and glyphs. + items.rings.ringofelements.name=ring of elements items.rings.ringofelements.stats=When worn, this ring will provide _%s%%_ elemental resistance. items.rings.ringofelements.typical_stats=When worn, this ring will typically provide _%s%%_ elemental resistance. diff --git a/core/src/main/assets/sprites/item_icons.png b/core/src/main/assets/sprites/item_icons.png index 0479b2741..818b95732 100644 Binary files a/core/src/main/assets/sprites/item_icons.png and b/core/src/main/assets/sprites/item_icons.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 cacb3d3f8..57baa5a6a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -81,6 +81,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfCleansing; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; @@ -668,7 +669,12 @@ public abstract class Char extends Actor { if (HP < 0 && src instanceof Char){ if (((Char) src).buff(Kinetic.KineticTracker.class) != null){ - Buff.affect((Char) src, Kinetic.ConservedDamage.class).setBonus(-HP); + int dmgToAdd = -HP; + dmgToAdd -= ((Char) src).buff(Kinetic.KineticTracker.class).conservedDamage; + dmgToAdd = Math.round(dmgToAdd * RingOfArcana.enchantPowerMultiplier((Char) src)); + if (dmgToAdd > 0) { + Buff.affect((Char) src, Kinetic.ConservedDamage.class).setBonus(dmgToAdd); + } ((Char) src).buff(Kinetic.KineticTracker.class).detach(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 35ca5529a..5b92a555b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1263,7 +1263,7 @@ public class Hero extends Char { //TODO improve this when I have proper damage source logic if (belongings.armor() != null && belongings.armor().hasGlyph(AntiMagic.class, this) && AntiMagic.RESISTS.contains(src.getClass())){ - dmg -= AntiMagic.drRoll(belongings.armor().buffedLvl()); + dmg -= AntiMagic.drRoll(this, belongings.armor().buffedLvl()); } if (buff(Talent.WarriorFoodImmunity.class) != null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java index 7cda1fe17..78254db5d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java @@ -271,7 +271,7 @@ public class ShadowClone extends ArmorAbility { && Dungeon.hero.belongings.armor() != null && Dungeon.hero.belongings.armor().hasGlyph(AntiMagic.class, this) && AntiMagic.RESISTS.contains(src.getClass())){ - dmg -= AntiMagic.drRoll(Dungeon.hero.belongings.armor().buffedLvl()); + dmg -= AntiMagic.drRoll(Dungeon.hero, Dungeon.hero.belongings.armor().buffedLvl()); } super.damage(dmg, src); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/ArmoredStatue.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/ArmoredStatue.java index 39fae814a..6eb903e39 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/ArmoredStatue.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/ArmoredStatue.java @@ -100,7 +100,7 @@ public class ArmoredStatue extends Statue { //TODO improve this when I have proper damage source logic if (armor != null && armor.hasGlyph(AntiMagic.class, this) && AntiMagic.RESISTS.contains(src.getClass())){ - dmg -= AntiMagic.drRoll(armor.buffedLvl()); + dmg -= AntiMagic.drRoll(this, armor.buffedLvl()); } super.damage( dmg, src ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 8a6fdde05..889164c71 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -799,7 +799,7 @@ public abstract class Mob extends Char { //lucky enchant logic if (buff(Lucky.LuckProc.class) != null){ - Dungeon.level.drop(Lucky.genLoot(), pos).sprite.drop(); + Dungeon.level.drop(buff(Lucky.LuckProc.class).genLoot(), pos).sprite.drop(); Lucky.showFlare(sprite); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java index 299065933..f143fbfe6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java @@ -199,7 +199,7 @@ public class PrismaticImage extends NPC { //TODO improve this when I have proper damage source logic if (hero != null && hero.belongings.armor() != null && hero.belongings.armor().hasGlyph(AntiMagic.class, this) && AntiMagic.RESISTS.contains(src.getClass())){ - dmg -= AntiMagic.drRoll(hero.belongings.armor().buffedLvl()); + dmg -= AntiMagic.drRoll(hero, hero.belongings.armor().buffedLvl()); } super.damage(dmg, src); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 111da2fde..f8e7b5132 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -60,6 +60,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion; @@ -437,6 +438,7 @@ public class Generator { RING.classes = new Class[]{ RingOfAccuracy.class, + RingOfArcana.class, RingOfEvasion.class, RingOfElements.class, RingOfForce.class, @@ -447,7 +449,7 @@ public class Generator { RingOfSharpshooting.class, RingOfTenacity.class, RingOfWealth.class}; - RING.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; + RING.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; ARTIFACT.classes = new Class[]{ CapeOfThorns.class, diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index 0a8380d6c..6d62da0fa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -56,6 +56,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stone; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Thorns; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -352,15 +353,15 @@ public class Armor extends EquipableItem { break; } } - if (!enemyNear) speed *= (1.2f + 0.04f * buffedLvl()); + if (!enemyNear) speed *= (1.2f + 0.04f * buffedLvl()) * RingOfArcana.enchantPowerMultiplier(owner); } else if (hasGlyph(Flow.class, owner) && Dungeon.level.water[owner.pos]){ - speed *= (2f + 0.25f*buffedLvl()); + speed *= (2f + 0.25f*buffedLvl()) * RingOfArcana.enchantPowerMultiplier(owner); } if (hasGlyph(Bulk.class, owner) && (Dungeon.level.map[owner.pos] == Terrain.DOOR || Dungeon.level.map[owner.pos] == Terrain.OPEN_DOOR )) { - speed /= 3f; + speed /= 3f * RingOfArcana.enchantPowerMultiplier(owner); } return speed; @@ -370,7 +371,7 @@ public class Armor extends EquipableItem { public float stealthFactor( Char owner, float stealth ){ if (hasGlyph(Obfuscation.class, owner)){ - stealth += 1 + buffedLvl()/3f; + stealth += (1 + buffedLvl()/3f) * RingOfArcana.enchantPowerMultiplier(owner); } return stealth; @@ -642,6 +643,10 @@ public class Armor extends EquipableItem { }; public abstract int proc( Armor armor, Char attacker, Char defender, int damage ); + + protected float procChanceMultiplier( Char defender ){ + return RingOfArcana.enchantPowerMultiplier(defender); + } public String name() { if (!curse()) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/AntiEntropy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/AntiEntropy.java index d573faeeb..4bd18583d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/AntiEntropy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/AntiEntropy.java @@ -44,7 +44,8 @@ public class AntiEntropy extends Glyph { @Override public int proc( Armor armor, Char attacker, Char defender, int damage) { - if (Random.Int( 8 ) == 0) { + float procChance = 1/8f * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { for (int i : PathFinder.NEIGHBOURS8){ Freezing.affect(defender.pos+i); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Corrosion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Corrosion.java index f24da305e..bbe892be6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Corrosion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Corrosion.java @@ -38,7 +38,8 @@ public class Corrosion extends Armor.Glyph { @Override public int proc(Armor armor, Char attacker, Char defender, int damage) { - if (Random.Int(10) == 0){ + float procChance = 1/10f * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { int pos = defender.pos; for (int i : PathFinder.NEIGHBOURS9){ Splash.at(pos+i, 0x000000, 5); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Displacement.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Displacement.java index 948f663c9..b99c7304c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Displacement.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Displacement.java @@ -35,8 +35,9 @@ public class Displacement extends Armor.Glyph { @Override public int proc(Armor armor, Char attacker, Char defender, int damage ) { - if (defender == Dungeon.hero && Random.Int(20) == 0){ - ScrollOfTeleportation.teleportChar(Dungeon.hero); + float procChance = 1/20f * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { + ScrollOfTeleportation.teleportChar(defender); return 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java index 3ff6829ed..b89b8844b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java @@ -40,7 +40,8 @@ public class Metabolism extends Glyph { @Override public int proc( Armor armor, Char attacker, Char defender, int damage) { - if (Random.Int( 6 ) == 0 && defender instanceof Hero) { + float procChance = 1/6f * procChanceMultiplier(defender); + if ( Random.Float() < procChance && defender instanceof Hero) { //assumes using up 10% of starving, and healing of 1 hp per 10 turns; int healing = Math.min((int)Hunger.STARVING/100, defender.HT - defender.HP); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java index 213ff9d5d..676206298 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Multiplicity.java @@ -49,7 +49,8 @@ public class Multiplicity extends Armor.Glyph { @Override public int proc(Armor armor, Char attacker, Char defender, int damage) { - if (Random.Int(20) == 0){ + float procChance = 1/20f * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { ArrayList spawnPoints = new ArrayList<>(); for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java index 01b25018e..4125f5ff3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java @@ -38,8 +38,9 @@ public class Overgrowth extends Armor.Glyph { @Override public int proc(Armor armor, Char attacker, Char defender, int damage) { - - if ( Random.Int( 20 ) == 0) { + + float procChance = 1/20f * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { Plant p = ((Plant.Seed) Generator.randomUsingDefaults(Generator.Category.SEED)).couch(defender.pos, null); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Stench.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Stench.java index 2abee2547..395deadd2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Stench.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Stench.java @@ -36,7 +36,8 @@ public class Stench extends Armor.Glyph { @Override public int proc(Armor armor, Char attacker, Char defender, int damage) { - if ( Random.Int( 8 ) == 0) { + float procChance = 1/8f * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { GameScene.add( Blob.seed( defender.pos, 250, ToxicGas.class ) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java index 58eb7e1c0..6c10e3fd1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java @@ -43,9 +43,12 @@ public class Affection extends Glyph { // lvl 0 - 15% // lvl 1 ~ 19% // lvl 2 ~ 23% - if (Random.Int( level + 20 ) >= 17) { + float procChance = (level+3f)/(level+20f) * procChanceMultiplier(defender); + if (Random.Float() < procChance) { - Buff.affect( attacker, Charm.class, Charm.DURATION ).object = defender.id(); + float powerMulti = Math.max(1f, procChance); + + Buff.affect( attacker, Charm.class, Math.round(Charm.DURATION*powerMulti) ).object = defender.id(); attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java index f1b0e2c72..3d6bf9e18 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java @@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Warlock; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogFist; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfDisintegration; @@ -106,8 +107,10 @@ public class AntiMagic extends Armor.Glyph { return damage; } - public static int drRoll( int level ){ - return Random.NormalIntRange(level, 3 + Math.round(level*1.5f)); + public static int drRoll( Char ch, int level ){ + return Random.NormalIntRange( + Math.round(level * RingOfArcana.enchantPowerMultiplier(ch)), + Math.round((3 + (level*1.5f)) * RingOfArcana.enchantPowerMultiplier(ch))); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java index 1e6223961..fb8e68e28 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.watabou.noosa.audio.Sample; @@ -41,7 +42,7 @@ public class Camouflage extends Armor.Glyph { } public static void activate(Char ch, int level){ - Buff.prolong(ch, Invisibility.class, 3 + level/2); + Buff.prolong(ch, Invisibility.class, Math.round((3 + level/2f)* RingOfArcana.enchantPowerMultiplier(ch))); if ( Dungeon.level.heroFOV[ch.pos] ) { Sample.INSTANCE.play( Assets.Sounds.MELD ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java index 10710ec4d..40c6df217 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java @@ -41,10 +41,13 @@ public class Entanglement extends Glyph { public int proc(Armor armor, Char attacker, final Char defender, final int damage ) { final int level = Math.max( 0, armor.buffedLvl() ); - - if (Random.Int( 4 ) == 0) { - - Buff.affect( defender, Earthroot.Armor.class ).level( 5 + 2 * level ); + float procChance = 1/4f * procChanceMultiplier(defender); + + if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); + + Buff.affect( defender, Earthroot.Armor.class ).level( Math.round((5 + 2 * level)*powerMulti) ); CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 ); Camera.main.shake( 1, 0.4f ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java index 16bec6a35..15a941e4e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java @@ -42,8 +42,12 @@ public class Potential extends Glyph { // lvl 0 - 16.7% // lvl 1 - 28.6% // lvl 2 - 37.5% - if (defender instanceof Hero && Random.Int( level + 6 ) >= 5 ) { - int wands = ((Hero) defender).belongings.charge( 1f ); + float procChance = (level+1f)/(level+6f) * procChanceMultiplier(defender); + if (Random.Float() < procChance && defender instanceof Hero) { + + float powerMulti = Math.max(1f, procChance); + + int wands = ((Hero) defender).belongings.charge( powerMulti ); if (wands > 0) { defender.sprite.centerEmitter().burst(EnergyParticle.FACTORY, 10); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java index 16fe30824..17e589e7d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java @@ -34,15 +34,25 @@ public class Repulsion extends Armor.Glyph { @Override public int proc( Armor armor, Char attacker, Char defender, int damage) { + + int level = Math.max( 0, armor.buffedLvl() ); + // lvl 0 - 20% // lvl 1 - 33% // lvl 2 - 43% - int level = Math.max( 0, armor.buffedLvl() ); + float procChance = (level+1f)/(level+5f) * procChanceMultiplier(defender); + if (Random.Float() < procChance){ + + float powerMulti = Math.max(1f, procChance); - if (Random.Int( level + 5 ) >= 4){ int oppositeHero = attacker.pos + (attacker.pos - defender.pos); Ballistica trajectory = new Ballistica(attacker.pos, oppositeHero, Ballistica.MAGIC_BOLT); - WandOfBlastWave.throwChar(attacker, trajectory, 2, true, true, getClass()); + WandOfBlastWave.throwChar(attacker, + trajectory, + Math.round(2 * powerMulti), + true, + true, + getClass()); } return damage; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java index d166bb266..50c5508e5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.watabou.utils.GameMath; @@ -37,6 +38,8 @@ public class Stone extends Armor.Glyph { float evasion = defender.defenseSkill(attacker); float accuracy = attacker.attackSkill(defender); testing = false; + + evasion *= RingOfArcana.enchantPowerMultiplier(defender); float hitChance; if (evasion >= accuracy){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java index 00ba1ae26..232afa542 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java @@ -40,9 +40,12 @@ public class Thorns extends Armor.Glyph { // lvl 0 - 16.7% // lvl 1 - 23.1% // lvl 2 - 28.5% - if ( Random.Int( level + 12) >= 10) { + float procChance = (level+2f)/(level+12f) * procChanceMultiplier(defender); + if ( Random.Float() < procChance ) { - Buff.affect( attacker, Bleeding.class).set( 4 + level ); + float powerMulti = Math.max(1f, procChance); + + Buff.affect( attacker, Bleeding.class).set( Math.round((4 + level)*powerMulti) ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java index a40a028e2..ca85641e6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -76,7 +77,15 @@ public class Viscosity extends Glyph { int level = Math.max( 0, this.level ); float percent = (level+1)/(float)(level+6); - int amount = (int)Math.ceil(dmg * percent); + percent *= RingOfArcana.enchantPowerMultiplier(target); + + int amount; + if (percent > 1f){ + dmg = Math.round(dmg / percent); + amount = dmg; + } else { + amount = (int)Math.ceil(dmg * percent); + } if (amount > 0){ DeferedDamage deferred = Buff.affect( target, DeferedDamage.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 6904a2429..80e37e519 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -644,7 +644,7 @@ public class DriedRose extends Artifact { //TODO improve this when I have proper damage source logic if (rose != null && rose.armor != null && rose.armor.hasGlyph(AntiMagic.class, this) && AntiMagic.RESISTS.contains(src.getClass())){ - dmg -= AntiMagic.drRoll(rose.armor.buffedLvl()); + dmg -= AntiMagic.drRoll(this, rose.armor.buffedLvl()); } super.damage( dmg, src ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfArcana.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfArcana.java new file mode 100644 index 000000000..92d1c1fb2 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfArcana.java @@ -0,0 +1,56 @@ +/* + * 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.items.rings; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; + +import java.text.DecimalFormat; + +public class RingOfArcana extends Ring { + + { + icon = ItemSpriteSheet.Icons.RING_ARCANA; + } + + public String statsInfo() { + if (isIdentified()){ + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBuffedBonus()) - 1f))); + } else { + return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f)); + } + } + + @Override + protected RingBuff buff( ) { + return new Arcana(); + } + + public static float enchantPowerMultiplier(Char target ){ + return (float)Math.pow(1.15f, getBuffedBonus(target, Arcana.class)); + } + + public class Arcana extends RingBuff { + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index 698c446eb..038dd1ea3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -179,6 +179,8 @@ public class WandOfBlastWave extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { + //acts like elastic enchantment + //FIXME this benefits from ring of arcana atm, change this new Elastic().proc(staff, attacker, defender, damage); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index c793fd628..6c9e201ab 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -145,6 +145,7 @@ public class WandOfFireblast extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { //acts like blazing enchantment + //FIXME this benefits from ring of arcana atm, change this new Blazing().proc( staff, attacker, defender, damage); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java index 1c2796cdb..fb6cc475c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLightning.java @@ -99,6 +99,7 @@ public class WandOfLightning extends DamageWand { @Override public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) { //acts like shocking enchantment + //FIXME this benefits from ring of arcana atm, change this new Shocking().proc(staff, attacker, defender, damage); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index 0b542fe65..8a46797fc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing; @@ -208,7 +209,11 @@ abstract public class Weapon extends KindOfWeapon { @Override public int reachFactor(Char owner) { - return hasEnchant(Projecting.class, owner) ? RCH+1 : RCH; + if (hasEnchant(Projecting.class, owner)){ + return RCH + Math.round(RingOfArcana.enchantPowerMultiplier(owner)); + } else { + return RCH; + } } public int STRReq(){ @@ -361,7 +366,7 @@ abstract public class Weapon extends KindOfWeapon { public abstract int proc( Weapon weapon, Char attacker, Char defender, int damage ); protected float procChanceMultiplier( Char attacker ){ - float multi = 1f; + float multi = RingOfArcana.enchantPowerMultiplier(attacker); if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.ENRAGED_CATALYST)){ Berserk rage = attacker.buff(Berserk.class); if (rage != null) { 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 bef31305d..96bfaf6c4 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 @@ -44,11 +44,13 @@ public class Blazing extends Weapon.Enchantment { // lvl 2 - 60% float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker); if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); if (defender.buff(Burning.class) != null){ Buff.affect(defender, Burning.class).reignite(defender, 8f); int burnDamage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 ); - defender.damage( Math.round(burnDamage * 0.67f), this ); + defender.damage( Math.round(burnDamage * 0.67f * powerMulti), this ); } else { Buff.affect(defender, Burning.class).reignite(defender, 8f); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blocking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blocking.java index b25f16fc1..26810d196 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blocking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blocking.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; @@ -41,7 +42,8 @@ public class Blocking extends Weapon.Enchantment { int level = Math.max( 0, weapon.buffedLvl() ); - Buff.prolong(attacker, BlockBuff.class, 2 + level/2).setBlocking(level + 1); + Buff.prolong(attacker, BlockBuff.class, 2 + level/2 * RingOfArcana.enchantPowerMultiplier(attacker)) + .setBlocking(Math.round((level + 1) * RingOfArcana.enchantPowerMultiplier(attacker))); return damage; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blooming.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blooming.java index 73db64428..4d007109a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blooming.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Blooming.java @@ -48,11 +48,21 @@ public class Blooming extends Weapon.Enchantment { // lvl 2 - 60% float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker); if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); + + float plants = (1f + 0.1f*level) * powerMulti; + if (Random.Float() < plants%1){ + plants = (float)Math.ceil(plants); + } else { + plants = (float)Math.floor(plants); + } - boolean secondPlant = level > Random.Int(10); if (plantGrass(defender.pos)){ - if (secondPlant) secondPlant = false; - else return damage; + plants--; + if (plants <= 0){ + return damage; + } } ArrayList positions = new ArrayList<>(); @@ -62,8 +72,10 @@ public class Blooming extends Weapon.Enchantment { Random.shuffle( positions ); for (int i : positions){ if (plantGrass(defender.pos + i)){ - if (secondPlant) secondPlant = false; - else return damage; + plants--; + if (plants <= 0) { + return damage; + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Chilling.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Chilling.java index 9cf46a7ca..0068caa6f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Chilling.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Chilling.java @@ -43,12 +43,14 @@ public class Chilling extends Weapon.Enchantment { // lvl 2 - 50% float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker); if (Random.Float() < procChance) { - + + float powerMulti = Math.max(1f, procChance); + //adds 3 turns of chill per proc, with a cap of 6 turns - float durationToAdd = 3f; + float durationToAdd = 3f * powerMulti; Chill existing = defender.buff(Chill.class); if (existing != null){ - durationToAdd = Math.min(durationToAdd, 6f-existing.cooldown()); + durationToAdd = Math.min(durationToAdd, (6f*powerMulti)-existing.cooldown()); } Buff.affect( defender, Chill.class, durationToAdd ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java index 02b9176a4..d04ef28b4 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Corrupting.java @@ -25,6 +25,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.Adrenaline; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption; @@ -63,6 +64,12 @@ public class Corrupting extends Weapon.Enchantment { Corruption.corruptionHeal(enemy); AllyBuff.affectAndLoot(enemy, hero, Corruption.class); + + float powerMulti = Math.max(1f, procChance); + if (powerMulti > 1.1f){ + //1 turn of adrenaline for each 20% above 100% proc rate + Buff.affect(enemy, Adrenaline.class, Math.round(5*(powerMulti-1f))); + } return 0; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Elastic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Elastic.java index abf9db571..2f2035904 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Elastic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Elastic.java @@ -43,6 +43,9 @@ public class Elastic extends Weapon.Enchantment { // lvl 2 - 43% float procChance = (level+1f)/(level+5f) * procChanceMultiplier(attacker); if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); + //trace a ballistica to our target (which will also extend past them Ballistica trajectory = new Ballistica(attacker.pos, defender.pos, Ballistica.STOP_TARGET); //trim it to just be the part that goes past them @@ -50,7 +53,7 @@ public class Elastic extends Weapon.Enchantment { //knock them back along that ballistica WandOfBlastWave.throwChar(defender, trajectory, - 2, + Math.round(2 * powerMulti), !(weapon instanceof MissileWeapon || weapon instanceof SpiritBow), true, getClass()); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java index ee5af06ee..712f43bc0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java @@ -45,7 +45,7 @@ public class Kinetic extends Weapon.Enchantment { } //use a tracker so that we can know the true final damage - Buff.affect(attacker, KineticTracker.class); + Buff.affect(attacker, KineticTracker.class).conservedDamage = conservedDamage; return damage + conservedDamage; } @@ -61,6 +61,8 @@ public class Kinetic extends Weapon.Enchantment { actPriority = Actor.VFX_PRIO; } + public int conservedDamage; + @Override public boolean act() { detach(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java index 1247680d0..21d335dda 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Lucky.java @@ -44,7 +44,12 @@ public class Lucky extends Weapon.Enchantment { // lvl 2 ~ 14% float procChance = (level+4f)/(level+40f) * procChanceMultiplier(attacker); if (defender.HP <= damage && Random.Float() < procChance){ - Buff.affect(defender, LuckProc.class); + + float powerMulti = Math.max(1f, procChance); + + //default is -5: 80% common, 20% uncommon, 0% rare + //ring level increases by 1 for each 20% above 100% proc rate + Buff.affect(defender, LuckProc.class).ringLevel = -10 + Math.round(5*powerMulti); } return damage; @@ -67,12 +72,19 @@ public class Lucky extends Weapon.Enchantment { //used to keep track of whether a luck proc is incoming. see Mob.die() public static class LuckProc extends Buff { + + private int ringLevel = -5; @Override public boolean act() { detach(); return true; } + + public Item genLoot(){ + detach(); + return RingOfWealth.genConsumableDrop(ringLevel); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java index bfa809413..23c2a643e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Shocking.java @@ -49,6 +49,8 @@ public class Shocking extends Weapon.Enchantment { // lvl 2 - 50% float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker); if (Random.Float() < procChance) { + + float powerMulti = Math.max(1f, procChance); affected.clear(); arcs.clear(); @@ -58,7 +60,7 @@ public class Shocking extends Weapon.Enchantment { affected.remove(defender); //defender isn't hurt by lightning for (Char ch : affected) { if (ch.alignment != attacker.alignment) { - ch.damage(Math.round(damage * 0.4f), this); + ch.damage(Math.round(damage * 0.4f * powerMulti), this); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Vampiric.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Vampiric.java index e1639de70..869ac3117 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Vampiric.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Vampiric.java @@ -43,9 +43,11 @@ public class Vampiric extends Weapon.Enchantment { healChance *= procChanceMultiplier(attacker); if (Random.Float() < healChance){ + + float powerMulti = Math.max(1f, healChance); //heals for 50% of damage dealt - int healAmt = Math.round(damage * 0.5f); + int healAmt = Math.round(damage * 0.5f * powerMulti); healAmt = Math.min( healAmt, attacker.HT - attacker.HP ); if (healAmt > 0 && attacker.isAlive()) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 8366a574d..6500a5f26 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; +import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; @@ -163,7 +164,9 @@ abstract public class MissileWeapon extends Weapon { } } - if (projecting && !Dungeon.level.solid[dst] && Dungeon.level.distance(user.pos, dst) <= 4){ + if (projecting + && !Dungeon.level.solid[dst] + && Dungeon.level.distance(user.pos, dst) <= Math.round(4 * RingOfArcana.enchantPowerMultiplier(user))){ return dst; } else { return super.throwPos(user, dst); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index e0024cd20..7ca27123c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -720,19 +720,20 @@ public class ItemSpriteSheet { private static final int RINGS = xy(1, 1); //16 slots public static final int RING_ACCURACY = RINGS+0; - public static final int RING_ELEMENTS = RINGS+1; - public static final int RING_ENERGY = RINGS+2; - public static final int RING_EVASION = RINGS+3; - public static final int RING_FORCE = RINGS+4; - public static final int RING_FUROR = RINGS+5; - public static final int RING_HASTE = RINGS+6; - public static final int RING_MIGHT = RINGS+7; - public static final int RING_SHARPSHOOT = RINGS+8; - public static final int RING_TENACITY = RINGS+9; - public static final int RING_WEALTH = RINGS+10; - public static final int RING_UNUSED = RINGS+11; + public static final int RING_ARCANA = RINGS+1; + public static final int RING_ELEMENTS = RINGS+2; + public static final int RING_ENERGY = RINGS+3; + public static final int RING_EVASION = RINGS+4; + public static final int RING_FORCE = RINGS+5; + public static final int RING_FUROR = RINGS+6; + public static final int RING_HASTE = RINGS+7; + public static final int RING_MIGHT = RINGS+8; + public static final int RING_SHARPSHOOT = RINGS+9; + public static final int RING_TENACITY = RINGS+10; + public static final int RING_WEALTH = RINGS+11; static { assignIconRect( RING_ACCURACY, 7, 7 ); + assignIconRect( RING_ARCANA, 7, 7 ); assignIconRect( RING_ELEMENTS, 7, 7 ); assignIconRect( RING_ENERGY, 7, 5 ); assignIconRect( RING_EVASION, 7, 7 );