diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 4a61e362a..7a7db0f16 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -365,6 +365,8 @@ actors.hero.talent.shield_battery.title=shield battery actors.hero.talent.shield_battery.desc=_+1:_ The Mage can self-target with a wand to convert its charges into shielding at a rate of _5% max HP per charge_.\n\n_+2:_ The Mage can self-target with a wand to convert its charges into shielding at a rate of _7.5% max HP per charge_. actors.hero.talent.empowered_strike.title=empowered strike actors.hero.talent.empowered_strike.desc=_+1:_ The Battlemage's first melee strike with his staff after zapping with it deals _+17% damage_.\n\n_+2:_ The Battlemage's first melee strike with his staff after zapping with it deals _+33% damage_.\n\n_+3:_ The Battlemage's first melee strike with his staff after zapping with it deals _+50% damage_. +actors.hero.talent.mystical_charge.title=mystical charge +actors.hero.talent.mystical_charge.desc=_+1:_ Striking with his staff grants the Battlemage _0.5 turns_ worth of artifact recharging.\n\n_+2:_ Striking with his staff grants the Battlemage _1 turn_ worth of artifact recharging.\n\n_+3:_ Striking with his staff grants the Battlemage _1.5 turns_ worth of artifact recharging. actors.hero.talent.soul_siphon.title=soul siphon actors.hero.talent.soul_siphon.desc=_+1:_ Melee damage dealt by other characters triggers the Warlock's soul mark at _15% effectiveness_.\n\n_+2:_ Melee damage dealt by other characters triggers the Warlock's soul mark at _30% effectiveness_.\n\n_+3:_ Melee damage dealt by other characters triggers the Warlock's soul mark at _45% effectiveness_. actors.hero.talent.soul_eater.title=soul eater diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java index 46aec3f84..177d3ab0e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java @@ -38,7 +38,7 @@ public class ArtifactRecharge extends Buff { type = buffType.POSITIVE; } - private int left; + private float left; public boolean ignoreHornOfPlenty; @Override @@ -46,15 +46,17 @@ public class ArtifactRecharge extends Buff { if (target instanceof Hero){ Belongings b = ((Hero) target).belongings; + + float chargeAmount = Math.min(1, left); if (b.artifact instanceof Artifact){ if (!(b.artifact instanceof HornOfPlenty) || !ignoreHornOfPlenty) { - ((Artifact) b.artifact).charge((Hero) target); + ((Artifact) b.artifact).charge((Hero) target, chargeAmount); } } if (b.misc instanceof Artifact){ if (!(b.misc instanceof HornOfPlenty) || !ignoreHornOfPlenty) { - ((Artifact) b.misc).charge((Hero) target); + ((Artifact) b.misc).charge((Hero) target, chargeAmount); } } } @@ -69,12 +71,12 @@ public class ArtifactRecharge extends Buff { return true; } - public ArtifactRecharge set( int amount ){ - left = amount; + public ArtifactRecharge set( float amount ){ + if (left < amount) left = amount; return this; } - public ArtifactRecharge prolong( int amount ){ + public ArtifactRecharge prolong( float amount ){ left += amount; return this; } @@ -117,7 +119,7 @@ public class ArtifactRecharge extends Buff { @Override public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); - left = bundle.getInt(LEFT); + left = bundle.getFloat(LEFT); ignoreHornOfPlenty = bundle.getBoolean(IGNORE_HORN); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index 9a23ae584..2ab5b8dee 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -84,7 +84,7 @@ public enum Talent { //Mage T3 MAGE_T3_1(41), MAGE_T3_2(42), //Battlemage T3 - EMPOWERED_STRIKE(43, 3), BATTLEMAGE_T3_2(44, 3), BATTLEMAGE_T3_3(45, 3), + EMPOWERED_STRIKE(43, 3), MYSTICAL_CHARGE(44, 3), BATTLEMAGE_T3_3(45, 3), //Warlock T3 SOUL_SIPHON(46, 3), SOUL_EATER(47, 3), WARLOCK_T3_3(48, 3), @@ -464,7 +464,7 @@ public enum Talent { Collections.addAll(tierTalents, CLEAVE, LETHAL_DEFENSE, GLADIATOR_T3_3); break; case BATTLEMAGE: - Collections.addAll(tierTalents, EMPOWERED_STRIKE, BATTLEMAGE_T3_2, BATTLEMAGE_T3_3); + Collections.addAll(tierTalents, EMPOWERED_STRIKE, MYSTICAL_CHARGE, BATTLEMAGE_T3_3); break; case WARLOCK: Collections.addAll(tierTalents, SOUL_SIPHON, SOUL_EATER, WARLOCK_T3_3); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java index eb547f597..330198e59 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/AlchemistsToolkit.java @@ -89,9 +89,9 @@ public class AlchemistsToolkit extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - partialCharge += 0.5f; + partialCharge += 0.5f*amount; if (partialCharge >= 1){ partialCharge--; charge++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index bd663a96a..c81ce9db9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -208,7 +208,7 @@ public class Artifact extends KindofMisc { protected ArtifactBuff activeBuff() {return null; } - public void charge(Hero target){ + public void charge(Hero target, float amount){ //do nothing by default; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java index 639695b18..a69a52736 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java @@ -50,9 +50,9 @@ public class CapeOfThorns extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (cooldown == 0) { - charge += 4; + charge += Math.round(4*amount); updateQuickslot(); } if (charge >= chargeCap){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index 9e713e2a6..33253f7ac 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -143,9 +143,10 @@ public class ChaliceOfBlood extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { //grants 5 turns of healing up-front float healDelay = 10f - level()*0.9f; + healDelay /= amount; //effectively 1HP at lvl 0-5, 2HP lvl 6-8, 3HP lvl 9, and 5HP lvl 10. target.HP = Math.min( target.HT, target.HP + (int)Math.ceil(5/healDelay)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index 5cd5d27e8..2cb27ac10 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -139,9 +139,9 @@ public class CloakOfShadows extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap) { - partialCharge += 0.25f; + partialCharge += 0.25f*amount; if (partialCharge >= 1){ partialCharge--; charge++; 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 180ab9498..6ff80bc29 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 @@ -271,10 +271,10 @@ public class DriedRose extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (ghost == null){ if (charge < chargeCap) { - charge += 4; + charge += Math.round(4*amount); if (charge >= chargeCap) { charge = chargeCap; partialCharge = 0; @@ -283,7 +283,8 @@ public class DriedRose extends Artifact { updateQuickslot(); } } else { - ghost.HP = Math.min( ghost.HT, ghost.HP + 1 + level()/3); + int heal = Math.round((1 + level()/3f)*amount); + ghost.HP = Math.min( ghost.HT, ghost.HP + heal); updateQuickslot(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java index 0f4e6f54d..e543549e2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/EtherealChains.java @@ -251,10 +251,10 @@ public class EtherealChains extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { int chargeTarget = 5+(level()*2); if (charge < chargeTarget*2){ - partialCharge += 0.5f; + partialCharge += 0.5f*amount; if (partialCharge >= 1){ partialCharge--; charge++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java index 689decd8f..98a81ddd8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java @@ -142,9 +142,9 @@ public class HornOfPlenty extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - partialCharge += 0.25f; + partialCharge += 0.25f*amount; if (partialCharge >= 1){ partialCharge--; charge++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java index 921ff4285..abec3c331 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java @@ -278,9 +278,9 @@ public class LloydsBeacon extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - partialCharge += 0.25f; + partialCharge += 0.25f*amount; if (partialCharge >= 1){ partialCharge--; charge++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java index 291354399..61f8fba7c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/MasterThievesArmband.java @@ -46,9 +46,9 @@ public class MasterThievesArmband extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - charge += 10; + charge += Math.round(10*amount); updateQuickslot(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index 956cdc7d2..049d46710 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -102,8 +102,8 @@ public class SandalsOfNature extends Artifact { } @Override - public void charge(Hero target) { - target.buff(Naturalism.class).charge(); + public void charge(Hero target, float amount) { + target.buff(Naturalism.class).charge(amount); } @Override @@ -172,10 +172,11 @@ public class SandalsOfNature extends Artifact { } public class Naturalism extends ArtifactBuff{ - public void charge() { + public void charge(float amount) { if (level() > 0 && charge < target.HT){ //gain 1+(1*level)% of the difference between current charge and max HP. float chargeGain = (target.HT-charge) * (.01f+ level()*0.01f); + chargeGain *= amount; chargeGain *= RingOfEnergy.artifactChargeMultiplier(target); partialCharge += Math.max(0, chargeGain); while (partialCharge > 1){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index 9631dda54..862b1528b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -88,9 +88,9 @@ public class TalismanOfForesight extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - charge += 2f; + charge += Math.round(2*amount); if (charge >= chargeCap) { charge = chargeCap; partialCharge = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index 3944fa509..755ecedc2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -141,9 +141,9 @@ public class TimekeepersHourglass extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - partialCharge += 0.25f; + partialCharge += 0.25f*amount; if (partialCharge >= 1){ partialCharge--; charge++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java index 0663c7f67..5d3059d63 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java @@ -212,9 +212,9 @@ public class UnstableSpellbook extends Artifact { } @Override - public void charge(Hero target) { + public void charge(Hero target, float amount) { if (charge < chargeCap){ - partialCharge += 0.1f; + partialCharge += 0.1f*amount; if (partialCharge >= 1){ partialCharge--; charge++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java index 0a483e6f8..baba83862 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/WildEnergy.java @@ -58,10 +58,8 @@ public class WildEnergy extends TargetedSpell { ScrollOfRecharging.charge(hero); hero.belongings.charge(1f); - for (int i = 0; i < 4; i++){ - if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero); - if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero); - } + if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero, 4); + if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero, 4); Buff.affect(hero, Recharging.class, 8f); Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java index 1bd6e58c5..fba47db5e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MagesStaff.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; @@ -151,6 +152,12 @@ public class MagesStaff extends MeleeWeapon { damage = Math.round( damage * (1f + Dungeon.hero.pointsInTalent(Talent.EMPOWERED_STRIKE)/6f)); } + if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.MYSTICAL_CHARGE)){ + Hero hero = (Hero) attacker; + if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f); + if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero, hero.pointsInTalent(Talent.MYSTICAL_CHARGE)/2f); + } + if (wand != null && attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) { if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.5f; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index ab63c229e..bef98c0c1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -79,7 +79,7 @@ public class HighGrass { if (naturalism != null) { if (!naturalism.isCursed()) { naturalismLevel = naturalism.itemLevel() + 1; - naturalism.charge(); + naturalism.charge(1); } else { naturalismLevel = -1; }