diff --git a/core/src/main/assets/interfaces/talent_icons.png b/core/src/main/assets/interfaces/talent_icons.png index fa9bb1153..cfbfabe7e 100644 Binary files a/core/src/main/assets/interfaces/talent_icons.png and b/core/src/main/assets/interfaces/talent_icons.png differ diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 51f2bcc90..58ac4ea1e 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -867,7 +867,7 @@ actors.hero.talent.rogues_foresight.title=rogue's foresight actors.hero.talent.rogues_foresight.desc=_+1:_ When the Rogue is on a level with a secret room, he has a _75% chance to notice_ that the level contains a secret.\n\n_+2:_ When the Rogue is on a level with a secret room, he has a _100% chance to notice_ that the level contains a secret. actors.hero.talent.light_cloak.title=light cloak -actors.hero.talent.light_cloak.desc=_+1:_ The Rogue can use his cloak of shadows when it is not equipped, but it recharges at _25% speed_.\n\n_+2:_ The Rogue can use his cloak of shadows when it is not equipped, but it recharges at _50% speed_.\n\n_+3:_ The Rogue can use his cloak of shadows when it is not equipped, but it recharges at _75% speed_. +actors.hero.talent.light_cloak.desc=_+1:_ The Rogue can use his cloak of shadows when it is not equipped, but it recharges at _25% speed_ when unequipped.\n\n_+2:_ The Rogue can use his cloak of shadows when it is not equipped, but it recharges at _50% speed_ when unequipped.\n\n_+3:_ The Rogue can use his cloak of shadows when it is not equipped, but it recharges at _75% speed_ when unequipped. actors.hero.talent.light_cloak.meta_desc=_If this talent is gained by a different hero_ it will instead increase the charging speed of all artifacts by 7/13/20% at +1/+2/+3. actors.hero.talent.enhanced_rings.title=enhanced rings actors.hero.talent.enhanced_rings.desc=_+1:_ When the Rogue uses an artifact, his rings gain +1 upgrade for _3 turns_.\n\n_+2:_ When the Rogue uses an artifact, his rings gain +1 upgrade for _6 turns_.\n\n_+3:_ When the Rogue uses an artifact, his rings gain +1 upgrade for _9 turns_. @@ -1058,8 +1058,8 @@ actors.hero.talent.clerict2e.desc=This talent hasn't been implemented yet, it cu actors.hero.talent.clerict3a.title=Unknown actors.hero.talent.clerict3a.desc=This talent hasn't been implemented yet, it currently does nothing. -actors.hero.talent.clerict3b.title=Unknown -actors.hero.talent.clerict3b.desc=This talent hasn't been implemented yet, it currently does nothing. +actors.hero.talent.light_reading.title=Light Reading +actors.hero.talent.light_reading.desc=_+1:_ The Cleric can use his holy tome when it is not equipped, but it recharges at _25% speed_ when unequipped.\n\n_+2:_ The Cleric can use his holy tome when it is not equipped, but it recharges at _50% speed_ when unequipped.\n\n_+3:_ The Cleric can use his holy tome when it is not equipped, but it recharges at _75% speed_ when unequipped. actors.hero.talent.priestt3a.title=Unknown actors.hero.talent.priestt3a.desc=This talent hasn't been implemented yet, it currently does nothing. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 67d697c22..a54779935 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -2481,8 +2481,10 @@ public class Hero extends Char { for (Item i : belongings){ if (i instanceof EquipableItem && i.isEquipped(this)){ ((EquipableItem) i).activate(this); - } else if (i instanceof CloakOfShadows && i.keptThroughLostInventory() && hasTalent(Talent.LIGHT_CLOAK)){ + } else if (i instanceof CloakOfShadows && i.keptThroughLostInventory() && hasTalent(Talent.LIGHT_CLOAK)) { ((CloakOfShadows) i).activate(this); + } else if (i instanceof HolyTome && i.keptThroughLostInventory() && hasTalent(Talent.LIGHT_READING)) { + ((HolyTome) i).activate(this); } else if (i instanceof Wand && i.keptThroughLostInventory()){ if (holster != null && holster.contains(i)){ ((Wand) i).charge(this, MagicalHolster.HOLSTER_SCALE_FACTOR); 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 3a9398f24..3d8851796 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 @@ -179,7 +179,7 @@ public enum Talent { //Cleric T2 ENLIGHTENING_MEAL(164), RECALL_GLYPH(165), SUNRAY(166), DIVINE_SENSE(167), CLERICT2E(168), //Cleric T3 - CLERICT3A(169, 3), CLERICT3B(170, 3), + CLERICT3A(169, 3), LIGHT_READING(170, 3), //Priest T3 PRIESTT3A(171, 3), PRIESTT3B(172, 3), PRIESTT3C(173, 3), //Paladin T3 @@ -540,6 +540,16 @@ public enum Talent { Dungeon.level.drop(toGive, hero.pos).sprite.drop(); } } + + if (talent == LIGHT_READING && hero.heroClass == HeroClass.CLERIC){ + for (Item item : Dungeon.hero.belongings.backpack){ + if (item instanceof HolyTome){ + if (!hero.belongings.lostInventory() || item.keptThroughLostInventory()) { + ((HolyTome) item).activate(Dungeon.hero); + } + } + } + } } public static class CachedRationsDropped extends CounterBuff{{revivePersists = true;}}; @@ -954,7 +964,7 @@ public enum Talent { Collections.addAll(tierTalents, PRECISE_ASSAULT, DEADLY_FOLLOWUP); break; case CLERIC: - Collections.addAll(tierTalents, CLERICT3A, CLERICT3B); + Collections.addAll(tierTalents, CLERICT3A, LIGHT_READING); break; } for (Talent talent : tierTalents){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java index 5068627c5..e5ed4af1d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/LostBackpack.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; @@ -57,6 +58,8 @@ public class LostBackpack extends Item { ((EquipableItem) i).activate(hero); } else if ( i instanceof CloakOfShadows && hero.hasTalent(Talent.LIGHT_CLOAK)){ ((CloakOfShadows) i).activate(hero); + } else if ( i instanceof HolyTome && hero.hasTalent(Talent.LIGHT_READING)){ + ((HolyTome) i).activate(hero); } else if (i instanceof Wand){ if (holster != null && holster.contains(i)){ ((Wand) i).charge(hero, MagicalHolster.HOLSTER_SCALE_FACTOR); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java index f8c885193..f41bd7259 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HolyTome.java @@ -24,8 +24,10 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.ClericSpell; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -59,7 +61,7 @@ public class HolyTome extends Artifact { @Override public ArrayList actions( Hero hero ) { ArrayList actions = super.actions( hero ); - if (isEquipped( hero ) + if ((isEquipped( hero ) || hero.hasTalent(Talent.LIGHT_READING)) && !cursed && hero.buff(MagicImmune.class) == null) { actions.add(AC_CAST); @@ -76,7 +78,7 @@ public class HolyTome extends Artifact { if (action.equals(AC_CAST)) { - if (!isEquipped(hero)) GLog.i(Messages.get(Artifact.class, "need_to_equip")); + if (!isEquipped(hero) && !hero.hasTalent(Talent.LIGHT_READING)) GLog.i(Messages.get(Artifact.class, "need_to_equip")); else { GameScene.show(new WndClericSpells(this, hero, false)); @@ -86,6 +88,40 @@ public class HolyTome extends Artifact { } } + @Override + public boolean doUnequip(Hero hero, boolean collect, boolean single) { + if (super.doUnequip(hero, collect, single)){ + if (collect && hero.hasTalent(Talent.LIGHT_READING)){ + activate(hero); + } + + return true; + } else + return false; + } + + @Override + public boolean collect( Bag container ) { + if (super.collect(container)){ + if (container.owner instanceof Hero + && passiveBuff == null + && ((Hero) container.owner).hasTalent(Talent.LIGHT_READING)){ + activate((Hero) container.owner); + } + return true; + } else{ + return false; + } + } + + @Override + protected void onDetach() { + if (passiveBuff != null){ + passiveBuff.detach(); + passiveBuff = null; + } + } + public boolean canCast( Hero hero, ClericSpell spell ){ return (charge >= spell.chargeUse(hero) && spell.canCast(hero)); } @@ -153,6 +189,7 @@ public class HolyTome extends Artifact { if (cursed || target.buff(MagicImmune.class) != null) return; if (charge < chargeCap) { + if (!isEquipped(target)) amount *= 0.75f*target.pointsInTalent(Talent.LIGHT_READING)/3f; partialCharge += 0.25f*amount; while (partialCharge >= 1f) { charge++; @@ -184,6 +221,10 @@ public class HolyTome extends Artifact { chargeGain *= 0.67f; } + if (!isEquipped(Dungeon.hero)){ + chargeGain *= 0.75f*Dungeon.hero.pointsInTalent(Talent.LIGHT_READING)/3f; + } + partialCharge += chargeGain; //charge is in increments of 1/5 max hunger value. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndQuickBag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndQuickBag.java index ba116315c..fca0bcead 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndQuickBag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndQuickBag.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -72,7 +73,8 @@ public class WndQuickBag extends Window { } if (i instanceof Artifact && !i.isEquipped(Dungeon.hero) - && (!(i instanceof CloakOfShadows) || !Dungeon.hero.hasTalent(Talent.LIGHT_CLOAK))){ + && (!(i instanceof CloakOfShadows) || !Dungeon.hero.hasTalent(Talent.LIGHT_CLOAK)) + && (!(i instanceof HolyTome) || !Dungeon.hero.hasTalent(Talent.LIGHT_READING))){ continue; } items.add(i);