From c9a21e5417dda73b1476ee89b7a4e7ffa05c8ae1 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 26 Jan 2021 22:09:47 -0500 Subject: [PATCH] v0.9.2: implemented the soul siphon talent --- .../src/main/assets/messages/actors/actors.properties | 2 ++ .../shatteredpixeldungeon/actors/hero/Talent.java | 4 ++-- .../shatteredpixeldungeon/actors/mobs/Mob.java | 11 ++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index f47151aca..0f4a72e86 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -357,6 +357,8 @@ 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 actors.hero.talent.shield_battery.desc=_+1:_ The Mage can self-target with a wand to convert its charges into shielding at a rate of _5% max HP per charge_.\n\n_+2:_ The Mage can self-target with a wand to convert its charges into shielding at a rate of _7.5% max HP per charge_. +actors.hero.talent.soul_siphon.title=soul siphon +actors.hero.talent.soul_siphon.desc=_+1:_ Melee damage dealt by other characters triggers the Warlock's soul mark at _15% effectiveness_.\n\n_+2:_ Melee damage dealt by other characters triggers the Warlock's soul mark at _30% effectiveness_.\n\n_+3:_ Melee damage dealt by other characters triggers the Warlock's soul mark at _45% effectiveness_. actors.hero.talent.cached_rations.title=cached rations actors.hero.talent.cached_rations.desc=_+1:_ The Rogue can find _4 small rations_ placed in chests while he explores the earlier stages of the dungeon.\n\n_+2:_ The Rogue can find _6 small rations_ placed in chests while he explores the earlier stages of the the dungeon. 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 aef97f874..175d3341b 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 @@ -86,7 +86,7 @@ public enum Talent { //Battlemage T3 BATTLEMAGE_T3_1(43, 3), BATTLEMAGE_T3_2(44, 3), BATTLEMAGE_T3_3(45, 3), //Warlock T3 - WARLOCK_T3_1(46, 3), WARLOCK_T3_2(47, 3), WARLOCK_T3_3(48, 3), + SOUL_SIPHON(46, 3), WARLOCK_T3_2(47, 3), WARLOCK_T3_3(48, 3), //Rogue T1 CACHED_RATIONS(64), THIEFS_INTUITION(65), SUCKER_PUNCH(66), PROTECTIVE_SHADOWS(67), @@ -465,7 +465,7 @@ public enum Talent { Collections.addAll(tierTalents, BATTLEMAGE_T3_1, BATTLEMAGE_T3_2, BATTLEMAGE_T3_3); break; case WARLOCK: - Collections.addAll(tierTalents, WARLOCK_T3_1, WARLOCK_T3_2, WARLOCK_T3_3); + Collections.addAll(tierTalents, SOUL_SIPHON, WARLOCK_T3_2, WARLOCK_T3_3); break; case ASSASSIN: Collections.addAll(tierTalents, ASSASSIN_T3_1, ASSASSIN_T3_2, ASSASSIN_T3_3); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 4e33f4b4c..d9c4f01b8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -594,12 +594,13 @@ public abstract class Mob extends Char { //physical damage that doesn't come from the hero is less effective if (enemy != Dungeon.hero){ - restoration = Math.round(restoration * 0.4f); + restoration = Math.round(restoration * 0.15f*Dungeon.hero.pointsInTalent(Talent.SOUL_SIPHON)); + } + if (restoration > 0) { + Buff.affect(Dungeon.hero, Hunger.class).satisfy(restoration); + Dungeon.hero.HP = (int) Math.ceil(Math.min(Dungeon.hero.HT, Dungeon.hero.HP + (restoration * 0.4f))); + Dungeon.hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); } - - Buff.affect(Dungeon.hero, Hunger.class).satisfy(restoration); - Dungeon.hero.HP = (int)Math.ceil(Math.min(Dungeon.hero.HT, Dungeon.hero.HP+(restoration*0.4f))); - Dungeon.hero.sprite.emitter().burst( Speck.factory(Speck.HEALING), 1 ); } return damage;