diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index fe4162817..778b2e530 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WarpBeacon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GoldenMimic; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep; @@ -81,7 +82,7 @@ import java.util.ArrayList; public class CursedWand { private static float COMMON_CHANCE = 0.6f; - private static float UNCOMMON_CHANCE = 10.3f; + private static float UNCOMMON_CHANCE = 0.3f; private static float RARE_CHANCE = 0.09f; private static float VERY_RARE_CHANCE = 0.01f; @@ -97,6 +98,12 @@ public class CursedWand { }); } + public static void tryForWandProc( Char target, Item origin ){ + if (target != null && origin instanceof Wand){ + Wand.wandProc(target, origin.buffedLvl(), 1); + } + } + public static boolean cursedEffect(final Item origin, final Char user, final Char target){ return cursedEffect(origin, user, target.pos); } @@ -127,11 +134,13 @@ public class CursedWand { Buff.affect(user, Burning.class).reignite(user); if (target != null) Buff.affect(target, Frost.class, Frost.DURATION); } + tryForWandProc(target, origin); return true; //spawns some regrowth case 1: GameScene.add( Blob.seed(targetPos, 30, Regrowth.class)); + tryForWandProc(Actor.findChar(targetPos), origin); return true; //random teleportation @@ -146,6 +155,7 @@ public class CursedWand { Char ch = Actor.findChar( targetPos ); if (ch != null && !ch.properties().contains(Char.Property.IMMOVABLE)) { ScrollOfTeleportation.teleportChar(ch); + tryForWandProc(ch, origin); } else { return cursedEffect(origin, user, targetPos); } @@ -155,6 +165,7 @@ public class CursedWand { //random gas at location case 3: Sample.INSTANCE.play( Assets.Sounds.GAS ); + tryForWandProc(Actor.findChar(targetPos), origin); switch (Random.Int(3)) { case 0: default: GameScene.add( Blob.seed( targetPos, 800, ConfusionGas.class ) ); @@ -182,6 +193,7 @@ public class CursedWand { && Dungeon.level.traps.get(pos) == null && !Dungeon.isChallenged(Challenges.NO_HERBALISM)) { Dungeon.level.plant((Plant.Seed) Generator.randomUsingDefaults(Generator.Category.SEED), pos); + tryForWandProc(Actor.findChar(pos), origin); } else { return cursedEffect(origin, user, targetPos); } @@ -220,6 +232,7 @@ public class CursedWand { } else { Sample.INSTANCE.play(Assets.Sounds.BURNING); } + tryForWandProc(target, origin); } else { return cursedEffect(origin, user, targetPos); } @@ -228,6 +241,7 @@ public class CursedWand { //Bomb explosion case 2: new Bomb().explode(targetPos); + tryForWandProc(Actor.findChar(targetPos), origin); return true; //shock and recharge diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 973bcd408..e7d715ce5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -175,12 +175,12 @@ public abstract class Wand extends Item { charger.setScaleFactor( chargeScaleFactor ); } - protected void processSoulMark(Char target, int chargesUsed){ - processSoulMark(target, buffedLvl(), chargesUsed); + protected void wandProc(Char target, int chargesUsed){ + wandProc(target, buffedLvl(), chargesUsed); } - //TODO some naming issues here. Consider renaming this method and externalizing char awareness buff - protected static void processSoulMark(Char target, int wandLevel, int chargesUsed){ + //TODO Consider externalizing char awareness buff + protected static void wandProc(Char target, int wandLevel, int chargesUsed){ if (Dungeon.hero.hasTalent(Talent.ARCANE_VISION)) { int dur = 5 + 5*Dungeon.hero.pointsInTalent(Talent.ARCANE_VISION); Buff.append(Dungeon.hero, TalismanOfForesight.CharAwareness.class, dur).charID = target.id(); 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 026d7d49b..6c5c6cc97 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 @@ -79,7 +79,7 @@ public class WandOfBlastWave extends DamageWand { Char ch = Actor.findChar(bolt.collisionPos + i); if (ch != null){ - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); if (ch.alignment != Char.Alignment.ALLY) ch.damage(damageRoll(), this); if (ch.pos == bolt.collisionPos + i) { @@ -94,7 +94,7 @@ public class WandOfBlastWave extends DamageWand { //throws the char at the center of the blast Char ch = Actor.findChar(bolt.collisionPos); if (ch != null){ - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage(damageRoll(), this); if (bolt.path.size() > bolt.dist+1 && ch.pos == bolt.collisionPos) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java index e4340885d..f3ef84aef 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorrosion.java @@ -63,7 +63,7 @@ public class WandOfCorrosion extends Wand { for (int i : PathFinder.NEIGHBOURS9) { Char ch = Actor.findChar(bolt.collisionPos + i); if (ch != null) { - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 42284f67a..393d9ac23 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -173,7 +173,7 @@ public class WandOfCorruption extends Wand { } } - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.8f * Random.Float(0.87f, 1.15f) ); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java index be0b8f964..b30152f2f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java @@ -110,7 +110,7 @@ public class WandOfDisintegration extends DamageWand { int lvl = level + (chars.size()-1) + terrainBonus; for (Char ch : chars) { - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage( damageRoll(lvl), this ); ch.sprite.centerEmitter().burst( PurpleParticle.BURST, Random.IntRange( 1, 2 ) ); ch.sprite.flash(); 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 1e045e0a0..b728240ba 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 @@ -114,7 +114,7 @@ public class WandOfFireblast extends DamageWand { } for ( Char ch : affectedChars ){ - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage(damageRoll(), this); if (ch.isAlive()) { Buff.affect(ch, Burning.class).reignite(ch); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java index c7d6eb9e2..fcd410a9d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFrost.java @@ -77,7 +77,7 @@ public class WandOfFrost extends DamageWand { ch.sprite.burst( 0xFF99CCFF, buffedLvl() / 2 + 2 ); } - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage(damage, this); Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 1.1f * Random.Float(0.87f, 1.15f) ); 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 2c0e0158f..002314fe8 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 @@ -78,7 +78,7 @@ public class WandOfLightning extends DamageWand { if (ch != curUser && ch.alignment == curUser.alignment && ch.pos != bolt.collisionPos){ continue; } - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); if (ch == curUser) { ch.damage(Math.round(damageRoll() * multipler * 0.5f), this); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java index 3492c3e1f..9f37df67e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java @@ -93,7 +93,7 @@ public class WandOfLivingEarth extends DamageWand { if (guardian != null && guardian == ch){ guardian.sprite.centerEmitter().burst(MagicMissile.EarthParticle.ATTRACT, 8 + buffedLvl() / 2); guardian.setInfo(curUser, buffedLvl(), armorToAdd); - processSoulMark(guardian, chargesPerCast()); + wandProc(guardian, chargesPerCast()); Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.9f * Random.Float(0.87f, 1.15f) ); //shooting the guardian at a location @@ -109,7 +109,7 @@ public class WandOfLivingEarth extends DamageWand { ch.sprite.centerEmitter().burst(MagicMissile.EarthParticle.BURST, 5 + buffedLvl()/2); - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage(damage, this); int closest = -1; @@ -153,7 +153,7 @@ public class WandOfLivingEarth extends DamageWand { ch.sprite.centerEmitter().burst(MagicMissile.EarthParticle.BURST, 5 + buffedLvl() / 2); - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage(damage, this); Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, 0.8f * Random.Float(0.87f, 1.15f) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java index 7bdbc0e9c..9b1bb0635 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfMagicMissile.java @@ -58,7 +58,7 @@ public class WandOfMagicMissile extends DamageWand { Char ch = Actor.findChar( bolt.collisionPos ); if (ch != null) { - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); ch.damage(damageRoll(), this); Sample.INSTANCE.play( Assets.Sounds.HIT_MAGIC, 1, Random.Float(0.87f, 1.15f) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java index 803d0cc9d..53df8726f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java @@ -78,7 +78,7 @@ public class WandOfPrismaticLight extends DamageWand { Char ch = Actor.findChar(beam.collisionPos); if (ch != null){ - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); affectTarget(ch); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index 52f483e47..3bab3c718 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -113,7 +113,7 @@ public class WandOfRegrowth extends Wand { } Char ch = Actor.findChar(cell); if (ch != null){ - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); Buff.prolong( ch, Roots.class, 4f * chrgUsed ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java index 21baea36a..07d540536 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java @@ -69,7 +69,7 @@ public class WandOfTransfusion extends Wand { if (ch instanceof Mob){ - processSoulMark(ch, chargesPerCast()); + wandProc(ch, chargesPerCast()); //this wand does different things depending on the target. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java index 15934d562..d12680178 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java @@ -302,7 +302,7 @@ public class WandOfWarding extends Wand { int dmg = Random.NormalIntRange( 2 + wandLevel, 8 + 4*wandLevel ); enemy.damage( dmg, this ); if (enemy.isAlive()){ - Wand.processSoulMark(enemy, wandLevel, 1); + Wand.wandProc(enemy, wandLevel, 1); } if (!enemy.isAlive() && enemy == Dungeon.hero) {