v0.9.2: implemented the mystical charge talent

This commit is contained in:
Evan Debenham 2021-02-07 19:55:59 -05:00
parent b9f3f84e04
commit 33e17c1700
20 changed files with 54 additions and 42 deletions

View File

@ -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.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.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.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.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_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 actors.hero.talent.soul_eater.title=soul eater

View File

@ -38,7 +38,7 @@ public class ArtifactRecharge extends Buff {
type = buffType.POSITIVE; type = buffType.POSITIVE;
} }
private int left; private float left;
public boolean ignoreHornOfPlenty; public boolean ignoreHornOfPlenty;
@Override @Override
@ -47,14 +47,16 @@ public class ArtifactRecharge extends Buff {
if (target instanceof Hero){ if (target instanceof Hero){
Belongings b = ((Hero) target).belongings; Belongings b = ((Hero) target).belongings;
float chargeAmount = Math.min(1, left);
if (b.artifact instanceof Artifact){ if (b.artifact instanceof Artifact){
if (!(b.artifact instanceof HornOfPlenty) || !ignoreHornOfPlenty) { 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 Artifact){
if (!(b.misc instanceof HornOfPlenty) || !ignoreHornOfPlenty) { 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; return true;
} }
public ArtifactRecharge set( int amount ){ public ArtifactRecharge set( float amount ){
left = amount; if (left < amount) left = amount;
return this; return this;
} }
public ArtifactRecharge prolong( int amount ){ public ArtifactRecharge prolong( float amount ){
left += amount; left += amount;
return this; return this;
} }
@ -117,7 +119,7 @@ public class ArtifactRecharge extends Buff {
@Override @Override
public void restoreFromBundle(Bundle bundle) { public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle); super.restoreFromBundle(bundle);
left = bundle.getInt(LEFT); left = bundle.getFloat(LEFT);
ignoreHornOfPlenty = bundle.getBoolean(IGNORE_HORN); ignoreHornOfPlenty = bundle.getBoolean(IGNORE_HORN);
} }
} }

View File

@ -84,7 +84,7 @@ public enum Talent {
//Mage T3 //Mage T3
MAGE_T3_1(41), MAGE_T3_2(42), MAGE_T3_1(41), MAGE_T3_2(42),
//Battlemage T3 //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 //Warlock T3
SOUL_SIPHON(46, 3), SOUL_EATER(47, 3), WARLOCK_T3_3(48, 3), 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); Collections.addAll(tierTalents, CLEAVE, LETHAL_DEFENSE, GLADIATOR_T3_3);
break; break;
case BATTLEMAGE: case BATTLEMAGE:
Collections.addAll(tierTalents, EMPOWERED_STRIKE, BATTLEMAGE_T3_2, BATTLEMAGE_T3_3); Collections.addAll(tierTalents, EMPOWERED_STRIKE, MYSTICAL_CHARGE, BATTLEMAGE_T3_3);
break; break;
case WARLOCK: case WARLOCK:
Collections.addAll(tierTalents, SOUL_SIPHON, SOUL_EATER, WARLOCK_T3_3); Collections.addAll(tierTalents, SOUL_SIPHON, SOUL_EATER, WARLOCK_T3_3);

View File

@ -89,9 +89,9 @@ public class AlchemistsToolkit extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
partialCharge += 0.5f; partialCharge += 0.5f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -208,7 +208,7 @@ public class Artifact extends KindofMisc {
protected ArtifactBuff activeBuff() {return null; } protected ArtifactBuff activeBuff() {return null; }
public void charge(Hero target){ public void charge(Hero target, float amount){
//do nothing by default; //do nothing by default;
} }

View File

@ -50,9 +50,9 @@ public class CapeOfThorns extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (cooldown == 0) { if (cooldown == 0) {
charge += 4; charge += Math.round(4*amount);
updateQuickslot(); updateQuickslot();
} }
if (charge >= chargeCap){ if (charge >= chargeCap){

View File

@ -143,9 +143,10 @@ public class ChaliceOfBlood extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
//grants 5 turns of healing up-front //grants 5 turns of healing up-front
float healDelay = 10f - level()*0.9f; 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. //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)); target.HP = Math.min( target.HT, target.HP + (int)Math.ceil(5/healDelay));
} }

View File

@ -139,9 +139,9 @@ public class CloakOfShadows extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap) { if (charge < chargeCap) {
partialCharge += 0.25f; partialCharge += 0.25f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -271,10 +271,10 @@ public class DriedRose extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (ghost == null){ if (ghost == null){
if (charge < chargeCap) { if (charge < chargeCap) {
charge += 4; charge += Math.round(4*amount);
if (charge >= chargeCap) { if (charge >= chargeCap) {
charge = chargeCap; charge = chargeCap;
partialCharge = 0; partialCharge = 0;
@ -283,7 +283,8 @@ public class DriedRose extends Artifact {
updateQuickslot(); updateQuickslot();
} }
} else { } 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(); updateQuickslot();
} }
} }

View File

@ -251,10 +251,10 @@ public class EtherealChains extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
int chargeTarget = 5+(level()*2); int chargeTarget = 5+(level()*2);
if (charge < chargeTarget*2){ if (charge < chargeTarget*2){
partialCharge += 0.5f; partialCharge += 0.5f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -142,9 +142,9 @@ public class HornOfPlenty extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
partialCharge += 0.25f; partialCharge += 0.25f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -278,9 +278,9 @@ public class LloydsBeacon extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
partialCharge += 0.25f; partialCharge += 0.25f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -46,9 +46,9 @@ public class MasterThievesArmband extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
charge += 10; charge += Math.round(10*amount);
updateQuickslot(); updateQuickslot();
} }
} }

View File

@ -102,8 +102,8 @@ public class SandalsOfNature extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
target.buff(Naturalism.class).charge(); target.buff(Naturalism.class).charge(amount);
} }
@Override @Override
@ -172,10 +172,11 @@ public class SandalsOfNature extends Artifact {
} }
public class Naturalism extends ArtifactBuff{ public class Naturalism extends ArtifactBuff{
public void charge() { public void charge(float amount) {
if (level() > 0 && charge < target.HT){ if (level() > 0 && charge < target.HT){
//gain 1+(1*level)% of the difference between current charge and max HP. //gain 1+(1*level)% of the difference between current charge and max HP.
float chargeGain = (target.HT-charge) * (.01f+ level()*0.01f); float chargeGain = (target.HT-charge) * (.01f+ level()*0.01f);
chargeGain *= amount;
chargeGain *= RingOfEnergy.artifactChargeMultiplier(target); chargeGain *= RingOfEnergy.artifactChargeMultiplier(target);
partialCharge += Math.max(0, chargeGain); partialCharge += Math.max(0, chargeGain);
while (partialCharge > 1){ while (partialCharge > 1){

View File

@ -88,9 +88,9 @@ public class TalismanOfForesight extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
charge += 2f; charge += Math.round(2*amount);
if (charge >= chargeCap) { if (charge >= chargeCap) {
charge = chargeCap; charge = chargeCap;
partialCharge = 0; partialCharge = 0;

View File

@ -141,9 +141,9 @@ public class TimekeepersHourglass extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
partialCharge += 0.25f; partialCharge += 0.25f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -212,9 +212,9 @@ public class UnstableSpellbook extends Artifact {
} }
@Override @Override
public void charge(Hero target) { public void charge(Hero target, float amount) {
if (charge < chargeCap){ if (charge < chargeCap){
partialCharge += 0.1f; partialCharge += 0.1f*amount;
if (partialCharge >= 1){ if (partialCharge >= 1){
partialCharge--; partialCharge--;
charge++; charge++;

View File

@ -58,10 +58,8 @@ public class WildEnergy extends TargetedSpell {
ScrollOfRecharging.charge(hero); ScrollOfRecharging.charge(hero);
hero.belongings.charge(1f); hero.belongings.charge(1f);
for (int i = 0; i < 4; i++){ if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero, 4);
if (hero.belongings.artifact instanceof Artifact) ((Artifact) hero.belongings.artifact).charge(hero); if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero, 4);
if (hero.belongings.misc instanceof Artifact) ((Artifact) hero.belongings.misc).charge(hero);
}
Buff.affect(hero, Recharging.class, 8f); Buff.affect(hero, Recharging.class, 8f);
Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false; Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false;

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; 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.bags.Bag;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; 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)); 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 && if (wand != null &&
attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) { attacker instanceof Hero && ((Hero)attacker).subClass == HeroSubClass.BATTLEMAGE) {
if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.5f; if (wand.curCharges < wand.maxCharges) wand.partialCharge += 0.5f;

View File

@ -79,7 +79,7 @@ public class HighGrass {
if (naturalism != null) { if (naturalism != null) {
if (!naturalism.isCursed()) { if (!naturalism.isCursed()) {
naturalismLevel = naturalism.itemLevel() + 1; naturalismLevel = naturalism.itemLevel() + 1;
naturalism.charge(); naturalism.charge(1);
} else { } else {
naturalismLevel = -1; naturalismLevel = -1;
} }