From ad70ff52aa8a0afda90978acc8e0416aa7672ee5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 12 Nov 2020 18:21:41 -0500 Subject: [PATCH] v0.9.1: tweaked the warrior's T1 talents --- .../main/assets/interfaces/talent_icons.png | Bin 996 -> 986 bytes .../assets/messages/actors/actors.properties | 4 +-- .../actors/hero/Talent.java | 31 +++++++++++++++--- .../shatteredpixeldungeon/items/Item.java | 11 ++++--- .../items/potions/Potion.java | 15 ++------- .../items/scrolls/Scroll.java | 14 ++------ .../scrolls/exotic/ScrollOfDivination.java | 4 +-- 7 files changed, 43 insertions(+), 36 deletions(-) diff --git a/core/src/main/assets/interfaces/talent_icons.png b/core/src/main/assets/interfaces/talent_icons.png index 8239f73f274aa911a79be684e30b7c9098cad20d..a2c7a2d1119c417e155fc5b871503b575fbc5da2 100644 GIT binary patch delta 894 zcmV-^1A+YH2igaaBmqc~B`A?lB!7ehBN6}r00DGTPE!Ct=GbNc00TftL_t(|0qvTJ zavD1jMPYp4wf7Ak|Np0%JIXB~H`z(1s>{bVlCs|uEz`oA&30h3nFjLsX5jkcf6dka z%+1t*`D?ns&0l6k0lQrnz@AAT0z?<^-x);&LJK+oS~ zEOY@qb`b&bQ2^$h+zqMy0->VU%+kPO%NL}XcZtz3b++_x8Y;Z;hEfR`6a0C z444fF37A1&_prwT@DgdKfb$m;5DQHJ`nccg1MdRfBqs-VQ%``WKl^)_vH(YS{tCyS z1#HijfaZYOv;>*~QRY$D0)Mt*GMWMINd?{nZJT~Rfnj%L))GKN0yry!apx;V1w;f70{SM%9-4rjpPB+<5%BoP zY+&pBoC~0rgh-XCAs|Kp!t)*r&;Sd-)DRG2SOWA4c)BRy=?Q&GSbrS>4c7wrzrVf! z-v_uDNckr;&}U5n`98q;hg(tDmln{=;UPa3&?vkKb^$%Vx5G}wV=&(bjQKS*z*O!* zDBlO*{0#;J^#tVm0KoZkDO60rXE~e&{5bIQz}3gAmc#1!^iQWi+w^%}c$raqeO422 z8{v0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>W8y;O(uffYutkzVgb+bHJMg zyb%K4MHK<9!>bH%>LjS#D{49Z$H#{ZR1nYvp!^{K1_93@K=DNl0c`;dfe;`pz&s;X z0UregykY?YJO!RR&UUZ1@|O~j?gK)A@)H8k7a<_>mk==C2jEp;X?pydJOgS7$mKAO z?au|Y3Cck10$u`(3YbDbhf~|&x(6zM1p(uIfTw^}j0Yi~f{F+j?*lBL{!w_m4;Vff fDqalzl*4}lBwyoV#y^a600000NkvXXu0mjf{aJ!5 diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 0966e7e97..dec11a70b 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -314,11 +314,11 @@ actors.buffs.wellfed.desc=You feel quite satisfied and full.\n\nWhile well fed, ###hero actors.hero.talent.hearty_meal.title=hearty meal -actors.hero.talent.hearty_meal.desc=_+1:_ Eating at below 50% health heals the Warrior for _3 HP_.\n\n_+2:_ Eating at below 50% health heals the Warrior for _5 HP_. +actors.hero.talent.hearty_meal.desc=_+1:_ Eating heals the Warrior for _2 HP_ when he is below 50% health, and _3 HP_ when he is below 25% health.\n\n_+2:_ Eating heals the Warrior for _3 HP_ when he is below 50% health, and _5 HP_ when he is below 25% health. actors.hero.talent.armsmasters_intuition.title=armsmaster's intuition actors.hero.talent.armsmasters_intuition.desc=_+1:_ The Warrior identifies weapons and armor _2x faster_.\n\n_+2:_ The Warrior identifies weapons and armor _when he equips them_. actors.hero.talent.test_subject.title=test subject -actors.hero.talent.test_subject.desc=_+1:_ Whenever he identifies a potion by using it, the Warrior heals for _4 HP_.\n\n_+2:_ Whenever he identifies a potion by using it, the Warrior heals for _6 HP_. +actors.hero.talent.test_subject.desc=_+1:_ Whenever the Warrior identifies an item, he heals for _2 HP_.\n\n_+2:_ Whenever the Warrior identifies an item, he heals for _3 HP_. actors.hero.talent.iron_will.title=iron will actors.hero.talent.iron_will.desc=_+1:_ The max shield provided by the Warrior's seal is _increased by 1_.\n\n_+2:_ The max shield provided by the Warrior's seal is _increased by 2_. actors.hero.talent.energizing_meal.title=energizing meal 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 3894bbc44..40a7a101b 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 @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; @@ -33,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; @@ -40,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.noosa.audio.Sample; +import com.watabou.noosa.particles.Emitter; import com.watabou.utils.Bundle; import com.watabou.utils.Random; @@ -135,10 +138,16 @@ public enum Talent { } public static void onFoodEaten( Hero hero, float foodVal ){ - if (hero.hasTalent(HEARTY_MEAL) && hero.HP <= hero.HT/2){ - //3/5 HP healed, when hero is below 50% health - hero.HP = Math.min( hero.HP + 1 + 2*hero.pointsInTalent(HEARTY_MEAL), hero.HT ); - hero.sprite.emitter().burst( Speck.factory( Speck.HEALING ), hero.pointsInTalent(HEARTY_MEAL) ); + if (hero.hasTalent(HEARTY_MEAL)){ + //3/5 HP healed, when hero is below 25% health + if (hero.HP <= hero.HT/4) { + hero.HP = Math.min(hero.HP + 1 + 2 * hero.pointsInTalent(HEARTY_MEAL), hero.HT); + hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), hero.pointsInTalent(HEARTY_MEAL)); + //2/3 HP healed, when hero is below 50% health + } else if (hero.HP <= hero.HT/2){ + hero.HP = Math.min(hero.HP + 1 + hero.pointsInTalent(HEARTY_MEAL), hero.HT); + hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1+hero.pointsInTalent(HEARTY_MEAL)); + } } if (hero.hasTalent(ENERGIZING_MEAL)){ //5/8 turns of recharging @@ -196,6 +205,20 @@ public enum Talent { } } + //note that IDing can happen in alchemy scene, so be careful with VFX here + public static void onItemIdentified( Hero hero, Item item ){ + if (hero.hasTalent(TEST_SUBJECT)){ + //heal for 2/3 HP + hero.HP = Math.min(hero.HP + 1 + hero.pointsInTalent(TEST_SUBJECT), hero.HT); + Emitter e = hero.sprite.emitter(); + if (e != null) e.burst(Speck.factory(Speck.HEALING), hero.pointsInTalent(TEST_SUBJECT)); + } + if (item instanceof Scroll && hero.hasTalent(TESTED_HYPOTHESIS)){ + Buff.affect(hero, Barrier.class).setShield(3 + (3 * hero.pointsInTalent(Talent.TESTED_HYPOTHESIS)), 1); + ScrollOfRecharging.charge(hero); + } + } + public static int onAttackProc( Hero hero, Char enemy, int dmg ){ if (hero.hasTalent(Talent.SUCKER_PUNCH) && enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java index 8dbe7ee0e..cc7f3c1e6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Item.java @@ -373,14 +373,15 @@ public class Item implements Bundlable { } public Item identify() { - + + if (Dungeon.hero != null && Dungeon.hero.isAlive()){ + Catalog.setSeen(getClass()); + if (!isIdentified()) Talent.onItemIdentified(Dungeon.hero, this); + } + levelKnown = true; cursedKnown = true; - if (Dungeon.hero != null && Dungeon.hero.isAlive()) { - Catalog.setSeen(getClass()); - } - return this; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java index 3b321f5bd..40908cb61 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java @@ -33,8 +33,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; -import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -72,7 +70,6 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem; import com.watabou.noosa.audio.Sample; -import com.watabou.noosa.particles.Emitter; import com.watabou.utils.Bundle; import com.watabou.utils.Random; import com.watabou.utils.Reflection; @@ -354,18 +351,12 @@ public class Potion extends Item { @Override public Item identify() { + super.identify(); if (!isKnown()) { setKnown(); - //4/6 HP healed - Hero hero = Dungeon.hero; - if (hero.isAlive() && hero.hasTalent(Talent.TEST_SUBJECT)) { - hero.HP = Math.min(hero.HP + 2 * (1+hero.pointsInTalent(Talent.TEST_SUBJECT)), hero.HT); - Emitter e = hero.sprite.emitter(); - if (e != null) e.burst(Speck.factory(Speck.HEALING), hero.pointsInTalent(Talent.TEST_SUBJECT)); - } } - return super.identify(); + return this; } @Override @@ -512,7 +503,7 @@ public class Potion extends Item { } if (seeds.size() == 1){ - result.setKnown(); + result.identify(); } while (result instanceof PotionOfHealing diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java index 94b17c8e2..9f8bb9839 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/Scroll.java @@ -22,13 +22,10 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; 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.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler; @@ -206,17 +203,12 @@ public abstract class Scroll extends Item { @Override public Item identify() { + super.identify(); if (!isKnown()) { setKnown(); - //6/9 HP barrier - Hero hero = Dungeon.hero; - if (hero.isAlive() && hero.hasTalent(Talent.TESTED_HYPOTHESIS)) { - Buff.affect(hero, Barrier.class).setShield(3 + (3 * hero.pointsInTalent(Talent.TESTED_HYPOTHESIS)), 1); - ScrollOfRecharging.charge(hero); - } } - return super.identify(); + return this; } @Override @@ -344,7 +336,7 @@ public abstract class Scroll extends Item { Scroll s = (Scroll) ingredients.get(0); s.quantity(s.quantity() - 1); - s.setKnown(); + s.identify(); return Reflection.newInstance(stones.get(s.getClass())).quantity(amnts.get(s.getClass())); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java index 45b7823a3..026a73828 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfDivination.java @@ -85,7 +85,7 @@ public class ScrollOfDivination extends ExoticScroll { } probs[0]--; Potion p = Reflection.newInstance(Random.element(potions)); - p.setKnown(); + p.identify(); IDed.add(p); potions.remove(p.getClass()); break; @@ -96,7 +96,7 @@ public class ScrollOfDivination extends ExoticScroll { } probs[1]--; Scroll s = Reflection.newInstance(Random.element(scrolls)); - s.setKnown(); + s.identify(); IDed.add(s); scrolls.remove(s.getClass()); break;