v3.0.0: implemented passive Paladin effect for holy weapon and ward

This commit is contained in:
Evan Debenham
2025-01-14 13:15:24 -05:00
parent 3333377c9f
commit 02bbe17a0b
8 changed files with 106 additions and 20 deletions

View File

@@ -627,16 +627,21 @@ actors.hero.spells.holyward.glyph_name=%s of light
actors.hero.spells.holyward.glyph_desc=This glyph slightly increases the amount of damage armor can block.
actors.hero.spells.holyward.short_desc=Temporarily overrides glyphs to boost armor blocking.
actors.hero.spells.holyward.desc=The Cleric imbues their worn armor with glyphs of holy light, increasing the armor's damage blocking by 1.\n\nThis glyph lasts for 50 turns, and will override any beneficial glyph the armor has for the duration. The Cleric will benefit from this effect even if they have no armor.
actors.hero.spells.holyward.desc_paladin=_This spell is more powerful when cast by the Paladin._ The additional damage blocking is increased to 3, the spell no longer overrides existing glyphs, and casting other spells while holy ward is active will extend its duration by 10 turns per charge used.
actors.hero.spells.holyward$holyarmbuff.name=holy ward
actors.hero.spells.holyward$holyarmbuff.desc=The Cleric has imbued their worn armor with holy energy, temporarily overriding any existing glyph and causing the armor to block an extra 1 point of damage.\n\nTurns Remaining: %s.
actors.hero.spells.holyward$holyarmbuff.desc_paladin=The Paladin has imbued their worn armor with holy energy, causing the armor to block an extra 3 points of damage.\n\nCasting other spells while holy ward is active will extend its duration by 10 turns per charge spent.\n\nTurns Remaining: %s.
actors.hero.spells.holyweapon.name=holy weapon
actors.hero.spells.holyweapon.ench_name=holy %s
actors.hero.spells.holyweapon.ench_desc=Enemies struck by a holy weapon will take extra magical damage.
actors.hero.spells.holyweapon.short_desc=Temporarily overrides enchantments to boost damage.
actors.hero.spells.holyweapon.desc=The Cleric enchants their worn weapon with holy energy, causing the weapon to deal an additional 2 magical damage any time they strike an enemy with it.\n\nThis enchantment lasts for 50 turns, and will override any beneficial enchantment the weapon has for the duration. Unarmed strikes can also benefit from this effect.
actors.hero.spells.holyweapon.desc_paladin=_This spell is more powerful when cast by the Paladin._ The additional magical damage is increased to 6, the spell no longer overrides existing enchantments, and casting other spells while holy weapon is active will extend its duration by 10 turns per charge used.
actors.hero.spells.holyweapon$holywepbuff.name=holy weapon
actors.hero.spells.holyweapon$holywepbuff.desc=The Cleric has imbued their worn weapon with holy energy, temporarily overriding any existing enchantment and causing the weapon to deal an extra 2 magical damage on each attack.\n\nTurns Remaining: %s.
actors.hero.spells.holyweapon$holywepbuff.desc_paladin=The Paladin has imbued their worn weapon with holy energy, causing their attacks to deal an extra 6 magical damage.\n\nCasting other spells while holy weapon is active will extend its duration by 10 turns per charge spent.\n\nTurns Remaining: %s.
actors.hero.spells.judgement.name=judgement
actors.hero.spells.judgement.short_desc=Damages all visible enemies.
@@ -756,10 +761,10 @@ actors.hero.herosubclass.monk_short_desc=The _Monk_ builds energy while fighting
actors.hero.herosubclass.monk_desc=The Monk is a master of physical technique. As she defeats enemies, she gains energy which can be used on a variety of defensive and utility-focused abilities. This energy does not fade over time, but has a cap based on the Monk's level.\n\n1 Energy: quickly strike with fists\n2 Energy: focus to dodge next attack\n3 Energy: instantly dash nearby\n4 Energy: kick an enemy away\n5 Energy: meditate to clear statuses and restore wand & artifact charge
actors.hero.herosubclass.priest=priest
actors.hero.herosubclass.priest_short_desc=The _Priest_ gains new long-range spells and an empowered version of guiding light.
actors.hero.herosubclass.priest_desc=The Priest gains a variety of new and upgraded spells that emphasize ranged combat and synergy with magical items.\n\nThe Priest can cast _Guiding Light_ for free once every 100 turns, and can trigger the illumination debuff with allies, wands, and some artifacts for bonus damage equal to their level.\n\nThey also gain the _Radiance_ spell, which dispels darkness and illuminates and briefly stuns all visible enemies at the cost of 2 charges.
actors.hero.herosubclass.priest_desc=The Priest gains a variety of new and upgraded spells that emphasize ranged combat and synergy with magical items.\n\nThe Priest can cast _Guiding Light_ for free once every 100 turns, and can trigger the illumination debuff with allies, wands, and some artifacts for bonus damage equal to their level.\n\nThe Priest also gains the _Radiance_ spell, which dispels darkness and illuminates and briefly stuns all visible enemies at the cost of 2 charges.
actors.hero.herosubclass.paladin=paladin
actors.hero.herosubclass.paladin_short_desc=_(UNFINISHED)_ The _Paladin_ gains new short-range spells and empowered versions of holy weapon and ward.
actors.hero.herosubclass.paladin_desc=_The Paladin has not been implemented yet, and so is currently unselectable._\n\nThe Paladin gains a variety of new and upgraded spells that emphasize melee combat and synergy with weapons and armor.\n\nThe Paladin's _Holy Weapon_ and _Holy Ward_ spells grant larger bonuses, and no longer override existing enchantments and glyphs.\n\nThey also gain the _Smite_ spell, which lets them perform a guaranteed melee hit with bonus damage and enchantment power.
actors.hero.herosubclass.paladin_desc=_The Paladin has not been implemented yet, and so is currently unselectable._\n\nThe Paladin gains a variety of new and upgraded spells that emphasize melee combat and synergy with weapons and armor.\n\nThe Paladin's _Holy Weapon_ and _Holy Ward_ spells grant larger bonuses, no longer override existing enchantments and glyphs, and can be extended by casting other spells.\n\nThe Paladin also gains the _Smite_ spell, which lets them perform a guaranteed melee hit with bonus damage and enchantment power.
##talents
actors.hero.talent$provokedangertracker.name=provoked anger

View File

@@ -1451,7 +1451,8 @@ public class Hero extends Char {
if (wep != null) {
damage = wep.proc( this, enemy, damage );
} else if (buff(HolyWeapon.HolyWepBuff.class) != null) {
enemy.damage(Math.round(2f * Weapon.Enchantment.genericProcChanceMultiplier(this)), HolyWeapon.INSTANCE);
int dmg = subClass == HeroSubClass.PALADIN ? 6 : 2;
enemy.damage(Math.round(dmg * Weapon.Enchantment.genericProcChanceMultiplier(this)), HolyWeapon.INSTANCE);
}
switch (subClass) {
@@ -1500,7 +1501,8 @@ public class Hero extends Char {
if (belongings.armor() != null) {
damage = belongings.armor().proc( enemy, this, damage );
} else if (buff(HolyWard.HolyArmBuff.class) != null){
damage -= Math.round(1f * Armor.Glyph.genericProcChanceMultiplier(enemy));
int blocking = subClass == HeroSubClass.PALADIN ? 3 : 1;
damage -= Math.round(blocking * Armor.Glyph.genericProcChanceMultiplier(enemy));
}
WandOfLivingEarth.RockArmor rockArmor = buff(WandOfLivingEarth.RockArmor.class);

View File

@@ -79,6 +79,15 @@ public abstract class ClericSpell {
}
tome.spendCharge(chargeUse(hero));
Talent.onArtifactUsed(hero);
if (hero.subClass == HeroSubClass.PALADIN){
if (this != HolyWeapon.INSTANCE && hero.buff(HolyWeapon.HolyWepBuff.class) != null){
Buff.affect(hero, HolyWeapon.HolyWepBuff.class, 10*chargeUse(hero));
}
if (this != HolyWard.INSTANCE && hero.buff(HolyWard.HolyArmBuff.class) != null){
Buff.affect(hero, HolyWard.HolyArmBuff.class, 10*chargeUse(hero));
}
}
if (hero.buff(AscendedForm.AscendBuff.class) != null){
hero.buff(AscendedForm.AscendBuff.class).spellCasts++;
hero.buff(AscendedForm.AscendBuff.class).incShield((int)(10*chargeUse(hero)));

View File

@@ -22,12 +22,15 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.watabou.noosa.audio.Sample;
@@ -57,6 +60,15 @@ public class HolyWard extends ClericSpell {
onSpellCast(tome, hero);
}
@Override
public String desc(){
String desc = Messages.get(this, "desc");
if (Dungeon.hero.subClass == HeroSubClass.PALADIN){
desc += "\n\n" + Messages.get(this, "desc_paladin");
}
return desc + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero));
}
public static class HolyArmBuff extends FlavourBuff {
public static final float DURATION = 50f;
@@ -75,6 +87,15 @@ public class HolyWard extends ClericSpell {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String desc() {
if (Dungeon.hero.subClass == HeroSubClass.PALADIN){
return Messages.get(this, "desc_paladin", dispTurns());
} else {
return Messages.get(this, "desc", dispTurns());
}
}
@Override
public void detach() {
super.detach();

View File

@@ -22,12 +22,15 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.watabou.noosa.audio.Sample;
@@ -62,6 +65,15 @@ public class HolyWeapon extends ClericSpell {
onSpellCast(tome, hero);
}
@Override
public String desc(){
String desc = Messages.get(this, "desc");
if (Dungeon.hero.subClass == HeroSubClass.PALADIN){
desc += "\n\n" + Messages.get(this, "desc_paladin");
}
return desc + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero));
}
public static class HolyWepBuff extends FlavourBuff {
public static final float DURATION = 50f;
@@ -80,6 +92,15 @@ public class HolyWeapon extends ClericSpell {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public String desc() {
if (Dungeon.hero.subClass == HeroSubClass.PALADIN){
return Messages.get(this, "desc_paladin", dispTurns());
} else {
return Messages.get(this, "desc", dispTurns());
}
}
@Override
public void detach() {
super.detach();

View File

@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWard;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
@@ -472,7 +473,11 @@ public class Armor extends EquipableItem {
if (defender.buff(MagicImmune.class) == null) {
if (defender instanceof Hero && isEquipped((Hero) defender)
&& defender.buff(HolyWard.HolyArmBuff.class) != null){
damage -= Math.round(1f * Glyph.genericProcChanceMultiplier(defender));
if (((Hero) defender).subClass == HeroSubClass.PALADIN && glyph != null){
damage = glyph.proc( this, attacker, defender, damage );
}
int blocking = ((Hero) defender).subClass == HeroSubClass.PALADIN ? 3 : 1;
damage -= Math.round(blocking * Glyph.genericProcChanceMultiplier(defender));
} else if (glyph != null) {
damage = glyph.proc( this, attacker, defender, damage );
}
@@ -510,10 +515,12 @@ public class Armor extends EquipableItem {
@Override
public String name() {
if (isEquipped(Dungeon.hero) && !hasCurseGlyph() && Dungeon.hero.buff(HolyWard.HolyArmBuff.class) != null){
if (isEquipped(Dungeon.hero) && !hasCurseGlyph() && Dungeon.hero.buff(HolyWard.HolyArmBuff.class) != null
&& (Dungeon.hero.subClass != HeroSubClass.PALADIN || glyph == null)){
return Messages.get(HolyWard.class, "glyph_name", super.name());
} else {
return glyph != null && (cursedKnown || !glyph.curse()) ? glyph.name( super.name() ) : super.name();
}
}
@@ -546,7 +553,8 @@ public class Armor extends EquipableItem {
case NONE:
}
if (isEquipped(Dungeon.hero) && !hasCurseGlyph() && Dungeon.hero.buff(HolyWard.HolyArmBuff.class) != null){
if (isEquipped(Dungeon.hero) && !hasCurseGlyph() && Dungeon.hero.buff(HolyWard.HolyArmBuff.class) != null
&& (Dungeon.hero.subClass != HeroSubClass.PALADIN || glyph == null)){
info += "\n\n" + Messages.capitalize(Messages.get(Armor.class, "inscribed", Messages.get(HolyWard.class, "glyph_name", Messages.get(Glyph.class, "glyph"))));
info += " " + Messages.get(HolyWard.class, "glyph_desc");
} else if (glyph != null && (cursedKnown || !glyph.curse())) {
@@ -687,7 +695,11 @@ public class Armor extends EquipableItem {
return false;
} else if (owner.buff(MagicImmune.class) != null) {
return false;
} else if (!glyph.curse() && owner instanceof Hero && isEquipped((Hero) owner) && owner.buff(HolyWard.HolyArmBuff.class) != null){
} else if (!glyph.curse()
&& owner instanceof Hero
&& isEquipped((Hero) owner)
&& owner.buff(HolyWard.HolyArmBuff.class) != null
&& ((Hero) owner).subClass != HeroSubClass.PALADIN){
return false;
} else {
return glyph.getClass() == type;
@@ -707,7 +719,8 @@ public class Armor extends EquipableItem {
@Override
public ItemSprite.Glowing glowing() {
if (isEquipped(Dungeon.hero) && !hasCurseGlyph() && Dungeon.hero.buff(HolyWard.HolyArmBuff.class) != null){
if (isEquipped(Dungeon.hero) && !hasCurseGlyph() && Dungeon.hero.buff(HolyWard.HolyArmBuff.class) != null
&& (Dungeon.hero.subClass != HeroSubClass.PALADIN || glyph == null)){
return HOLY;
} else {
return glyph != null && (cursedKnown || !glyph.curse()) ? glyph.glowing() : null;

View File

@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike;
@@ -119,7 +120,13 @@ abstract public class Weapon extends KindOfWeapon {
if (attacker.buff(MagicImmune.class) == null) {
if (attacker instanceof Hero && isEquipped((Hero) attacker)
&& attacker.buff(HolyWeapon.HolyWepBuff.class) != null){
defender.damage(Math.round(2f * Enchantment.genericProcChanceMultiplier(attacker)), HolyWeapon.INSTANCE);
if (((Hero) attacker).subClass == HeroSubClass.PALADIN && enchantment != null){
damage = enchantment.proc(this, attacker, defender, damage);
}
if (defender.isAlive()) {
int dmg = ((Hero) attacker).subClass == HeroSubClass.PALADIN ? 6 : 2;
defender.damage(Math.round(dmg * Enchantment.genericProcChanceMultiplier(attacker)), HolyWeapon.INSTANCE);
}
} else if (enchantment != null) {
damage = enchantment.proc(this, attacker, defender, damage);
}
@@ -341,10 +348,12 @@ abstract public class Weapon extends KindOfWeapon {
@Override
public String name() {
if (isEquipped(Dungeon.hero) && !hasCurseEnchant() && Dungeon.hero.buff(HolyWeapon.HolyWepBuff.class) != null){
if (isEquipped(Dungeon.hero) && !hasCurseEnchant() && Dungeon.hero.buff(HolyWeapon.HolyWepBuff.class) != null
&& (Dungeon.hero.subClass != HeroSubClass.PALADIN || enchantment == null)){
return Messages.get(HolyWeapon.class, "ench_name", super.name());
} else {
return enchantment != null && (cursedKnown || !enchantment.curse()) ? enchantment.name(super.name()) : super.name();
}
}
@@ -405,7 +414,11 @@ abstract public class Weapon extends KindOfWeapon {
return false;
} else if (owner.buff(MagicImmune.class) != null) {
return false;
} else if (!enchantment.curse() && owner instanceof Hero && isEquipped((Hero) owner) && owner.buff(HolyWeapon.HolyWepBuff.class) != null){
} else if (!enchantment.curse()
&& owner instanceof Hero
&& isEquipped((Hero) owner)
&& owner.buff(HolyWeapon.HolyWepBuff.class) != null
&& ((Hero) owner).subClass != HeroSubClass.PALADIN){
return false;
} else {
return enchantment.getClass() == type;
@@ -425,7 +438,8 @@ abstract public class Weapon extends KindOfWeapon {
@Override
public ItemSprite.Glowing glowing() {
if (isEquipped(Dungeon.hero) && !hasCurseEnchant() && Dungeon.hero.buff(HolyWeapon.HolyWepBuff.class) != null){
if (isEquipped(Dungeon.hero) && !hasCurseEnchant() && Dungeon.hero.buff(HolyWeapon.HolyWepBuff.class) != null
&& (Dungeon.hero.subClass != HeroSubClass.PALADIN || enchantment == null)){
return HOLY;
} else {
return enchantment != null && (cursedKnown || !enchantment.curse()) ? enchantment.glowing() : null;

View File

@@ -336,7 +336,8 @@ public class MeleeWeapon extends Weapon {
case NONE:
}
if (isEquipped(Dungeon.hero) && !hasCurseEnchant() && Dungeon.hero.buff(HolyWeapon.HolyWepBuff.class) != null){
if (isEquipped(Dungeon.hero) && !hasCurseEnchant() && Dungeon.hero.buff(HolyWeapon.HolyWepBuff.class) != null
&& (Dungeon.hero.subClass != HeroSubClass.PALADIN || enchantment == null)){
info += "\n\n" + Messages.capitalize(Messages.get(Weapon.class, "enchanted", Messages.get(HolyWeapon.class, "ench_name", Messages.get(Enchantment.class, "enchant"))));
info += " " + Messages.get(HolyWeapon.class, "ench_desc");
} else if (enchantment != null && (cursedKnown || !enchantment.curse())){