From 5be4201cfe62a582fdc7b46fd66b52caa54cff86 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 17 Dec 2022 14:05:47 -0500 Subject: [PATCH] v2.0.0: added metamorph effects for the remaining talents without one --- .../main/assets/messages/actors/actors.properties | 5 ++++- .../shatteredpixeldungeon/items/ArcaneResin.java | 11 ++++++++++- .../shatteredpixeldungeon/items/armor/Armor.java | 13 +++++++++++-- .../items/scrolls/exotic/ScrollOfMetamorphosis.java | 11 ----------- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index f7007cdb7..e89a4d5b2 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -567,6 +567,7 @@ actors.hero.talent.restored_willpower.desc=_+1:_ Drinking a potion of healing in actors.hero.talent.restored_willpower.meta_desc=_If this talent is gained by a different hero_ it will instead grant shielding equal to 5% max hp at +1, or 7.5% max hp at +2. actors.hero.talent.runic_transference.title=runic transference actors.hero.talent.runic_transference.desc=_+1:_ The Warrior's broken seal can transfer _regular glyphs_ in the same way it transfers an upgrade.\n\n_+2:_ The Warrior's broken seal can transfer _regular, powerful, and curse glyphs_ in the same way it transfers an upgrade. +actors.hero.talent.runic_transference.meta_desc=_If this talent is gained by a different hero_ it will instead increase the level that armor glyphs are guaranteed to be preserved at when upgrading armor up to level 6 from 4 at +1, or level 7 from 4 at +2. actors.hero.talent.lethal_momentum.title=lethal momentum actors.hero.talent.lethal_momentum.desc=_+1:_ When the Warrior lands a killing blow with a physical weapon, it has a _67% chance_ to take 0 turns.\n\n_+2:_ When the Warrior lands a killing blow with a physical weapon, it has a _100% chance_ to take 0 turns. actors.hero.talent.improvised_projectiles.title=improvised projectiles @@ -630,6 +631,7 @@ actors.hero.talent.energizing_upgrade.desc=_+1:_ Using a scroll of upgrade insta actors.hero.talent.energizing_upgrade.meta_desc=_If this talent is gained by a different hero_ it will instead grant 12 turns of wand recharging at +1, or 20 turns at +2. actors.hero.talent.wand_preservation.title=wand preservation actors.hero.talent.wand_preservation.desc=_+1:_ When the Mage imbues a new wand into his staff, the old wand has a _67% chance_ of being returned at +0, otherwise it will be returned as 1 arcane resin.\n\n_+2:_ When the Mage imbues a new wand into his staff, the old wand has a _100% chance_ of being returned at +0.\n\nThis talent can preserve wands a maximum of five times, afterward it will always grant 1 arcane resin. +actors.hero.talent.wand_preservation.meta_desc=_If this talent is gained by a different hero_ it will instead increase the amount of arcane resin gained when putting a wand into an alchemy pot by 1 at +1, or by 2 at +2. actors.hero.talent.arcane_vision.title=arcane vision actors.hero.talent.arcane_vision.desc=_+1:_ When the Mage zaps an enemy, he gains mind vision on them for _10 turns_.\n\n_+2:_ When the Mage zaps an enemy, he gains mind vision on them for _15 turns_. actors.hero.talent.shield_battery.title=shield battery @@ -806,7 +808,8 @@ actors.hero.talent.strengthening_meal.title=strengthening meal actors.hero.talent.strengthening_meal.desc=_+1:_ Eating food grants the Duelist 2 bonus damage on her next _2 physical attacks_.\n\n_+2:_ Eating food grants the Duelist 2 bonus damage on her next _3 physical attacks_. actors.hero.talent.adventurers_intuition.title=adventurer's intuition actors.hero.talent.adventurers_intuition.desc=_+1:_ The Duelist identifies weapons _2.5x faster_ and armor _1.75x faster_.\n\n_+2:_ The Duelist identifies weapons _when she equips them_ and armor _2.5x faster_. - +actors.hero.talent.aaa.title=aaa +actors.hero.talent.aaa.desc= actors.hero.talent.aggressive_barrier.title=aggressive barrier actors.hero.talent.aggressive_barrier.desc=_+1:_ The Duelist gain 2 shielding when she uses a weapon ability and is below _33% health_.\n\n_+2:_ The Duelist gain 2 shielding when she uses a weapon ability and is below _50% health_. actors.hero.talent.aggressive_barrier.meta_desc=_If this talent is gained by a different hero_ it will instead grant shielding when making a melee attack at low health, with a 50 turn cooldown. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ArcaneResin.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ArcaneResin.java index b614240dd..b566623c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ArcaneResin.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ArcaneResin.java @@ -25,6 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster; @@ -172,7 +174,14 @@ public class ArcaneResin extends Item { public Item sampleOutput(ArrayList ingredients) { Wand w = (Wand)ingredients.get(0); int level = w.level() - w.resinBonus; - return new ArcaneResin().quantity(2*(level+1)); + + Item output = new ArcaneResin().quantity(2*(level+1)); + + if (Dungeon.hero.heroClass != HeroClass.MAGE && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION)){ + output.quantity(output.quantity() + Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION)); + } + + return output; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index ba6681391..68f66cc11 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; 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.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; @@ -411,8 +412,16 @@ public class Armor extends EquipableItem { } else { if (hasCurseGlyph()){ if (Random.Int(3) == 0) inscribe(null); - } else if (level() >= 4 && Random.Float(10) < Math.pow(2, level()-4)){ - inscribe(null); + } else { + + int lossChanceStart = 4; + if (Dungeon.hero != null && Dungeon.hero.heroClass != HeroClass.WARRIOR && Dungeon.hero.hasTalent(Talent.RUNIC_TRANSFERENCE)){ + lossChanceStart += 1+Dungeon.hero.pointsInTalent(Talent.RUNIC_TRANSFERENCE); + } + + if (level() >= lossChanceStart && Random.Float(10) < Math.pow(2, level()-4)) { + inscribe(null); + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMetamorphosis.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMetamorphosis.java index dd411ea9d..37f4a62a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMetamorphosis.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMetamorphosis.java @@ -170,13 +170,6 @@ public class ScrollOfMetamorphosis extends ExoticScroll { public static class WndMetamorphReplace extends Window { - //talents that can only be used by one hero class - private static HashMap restrictedTalents = new HashMap<>(); - static { - restrictedTalents.put(Talent.RUNIC_TRANSFERENCE, HeroClass.WARRIOR); - restrictedTalents.put(Talent.WAND_PRESERVATION, HeroClass.MAGE); - } - public static WndMetamorphReplace INSTANCE; public Talent replacing; @@ -223,10 +216,6 @@ public class ScrollOfMetamorphosis extends ExoticScroll { if (curTalentsAtTier.contains(talent)){ clsTalentsAtTier.remove(talent); } - if (restrictedTalents.containsKey(talent) - && restrictedTalents.get(talent) != curUser.heroClass){ - clsTalentsAtTier.remove(talent); - } } } if (!replacingIsInSet && !clsTalentsAtTier.isEmpty()) {