v2.0.0: implemented the weapon recharging talent

This commit is contained in:
Evan Debenham
2022-12-12 16:11:08 -05:00
parent 322e0f9b64
commit 2319d367c2
4 changed files with 25 additions and 8 deletions

View File

@@ -811,7 +811,7 @@ actors.hero.talent.focused_meal.meta_desc=_If this talent is gained by a differe
actors.hero.talent.restored_agility.title=restored agility
actors.hero.talent.restored_agility.desc=_+1:_ The Duelist has _2x evasion_ while drinking potions of healing.\n\n_+2:_ The Duelist has _5x evasion_ while drinking potions of healing.\n\nThis talent also triggers when drinking potions or elixirs based on potions of healing.
actors.hero.talent.weapon_recharging.title=weapon recharging
actors.hero.talent.weapon_recharging.desc=_+1:_ Wand and artifact recharging buffs also give the duelist one weapon charge every _15 turns_.\n\n_+2:_ Wand and artifact recharging buffs also give the duelist one weapon charge every _10 turns_.
actors.hero.talent.weapon_recharging.desc=_+1:_ The Duelist gains one weapon charge every _15 turns_ when under the effect of wand or artifact recharging buffs.\n\n_+2:_ The Duelist gains one weapon charge every _10 turns_ when under the effect of wand or artifact recharging buffs.
actors.hero.talent.weapon_recharging.meta_desc=_If this talent is gained by a different hero_ it will instead cause them to deal +5% melee damage while recharging at +1, and +7.5% melee damage while recharging at +2.
actors.hero.talent.swift_equip.title=swift equip

View File

@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SacrificialFire;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AdrenalineSurge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AnkhInvulnerability;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
@@ -54,6 +55,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PhysicalEmpower;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SnipersMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
@@ -581,6 +583,12 @@ public class Hero extends Char {
Sample.INSTANCE.play(Assets.Sounds.HIT_STRONG, 0.75f, 1.2f);
}
if (heroClass != HeroClass.DUELIST
&& hasTalent(Talent.WEAPON_RECHARGING)
&& (buff(Recharging.class) != null || buff(ArtifactRecharge.class) != null)){
dmg = Math.round(dmg * 1.025f + (.025f*pointsInTalent(Talent.WEAPON_RECHARGING)));
}
if (dmg < 0) dmg = 0;
return dmg;
}

View File

@@ -149,7 +149,7 @@ public enum Talent {
//Duelist T1
STRENGTHENING_MEAL(128), ADVENTURERS_INTUITION(129), DUELIST_T1_3(130), AGGRESSIVE_BARRIER(131),
//Duelist T2
FOCUSED_MEAL(132), RESTORED_AGILITY(133), DUELIST_T2_3(134), DUELIST_T2_4(135), DUELIST_T2_5(136),
FOCUSED_MEAL(132), RESTORED_AGILITY(133), WEAPON_RECHARGING(134), DUELIST_T2_4(135), DUELIST_T2_5(136),
//Duelist T3
DUELIST_T3_1(137, 3), DUELIST_T3_2(138, 3),
//Duelist S1 T3
@@ -634,7 +634,7 @@ public enum Talent {
Collections.addAll(tierTalents, INVIGORATING_MEAL, RESTORED_NATURE, REJUVENATING_STEPS, HEIGHTENED_SENSES, DURABLE_PROJECTILES);
break;
case DUELIST:
Collections.addAll(tierTalents, FOCUSED_MEAL, RESTORED_AGILITY, DUELIST_T2_3, DUELIST_T2_4, DUELIST_T2_5);
Collections.addAll(tierTalents, FOCUSED_MEAL, RESTORED_AGILITY, WEAPON_RECHARGING, DUELIST_T2_4, DUELIST_T2_5);
break;
}
for (Talent talent : tierTalents){

View File

@@ -23,9 +23,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
@@ -280,11 +282,18 @@ public class MeleeWeapon extends Weapon {
if (charges < chargeCap()){
if (lock == null || lock.regenOn()){
partialCharge += 1/(50f-(chargeCap()-charges)); // 50 to 40 turns per charge
if (partialCharge >= 1){
charges++;
partialCharge--;
updateQuickslot();
}
}
int points = ((Hero)target).pointsInTalent(Talent.WEAPON_RECHARGING);
if (points > 0 && target.buff(Recharging.class) != null || target.buff(ArtifactRecharge.class) != null){
//1 every 15 turns at +1, 10 turns at +2
partialCharge += 1/(20f - 5f*points);
}
if (partialCharge >= 1){
charges++;
partialCharge--;
updateQuickslot();
}
} else {
partialCharge = 0;