From 82411ee96c78276991d7696c20c9af426fd6cbe4 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 7 Sep 2022 13:43:59 -0400 Subject: [PATCH] v1.4.0: reworked bounty hunter to boost drop rate instead of award gold --- .../assets/messages/actors/actors.properties | 2 +- .../actors/mobs/Mob.java | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 11da32d91..e431bbf0d 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -690,7 +690,7 @@ actors.hero.talent.enhanced_lethality.desc=_+1:_ The Assassin can assassinate en actors.hero.talent.assassins_reach.title=assassin's reach actors.hero.talent.assassins_reach.desc=_+1:_ The Assassin's blink range per level of preparation is increased to _1/3/4/6 tiles_, from 1/2/3/4.\n\n_+2:_ The Assassin's blink range per level of preparation is increased to _2/4/6/8 tiles_, from 1/2/3/4.\n\n_+3:_ The Assassin's blink range per level of preparation is increased to _2/5/7/10 tiles_, from 1/2/3/4. actors.hero.talent.bounty_hunter.title=bounty hunter -actors.hero.talent.bounty_hunter.desc=_+1:_ When the Assassin kills an enemy with a prepared strike they have a 25/50/75/100% chance to drop _15 extra gold_, per level of preparation.\n\n_+2:_ When the Assassin kills an enemy with a prepared strike they have a 25/50/75/100% chance to drop _30 extra gold_, per level of preparation.\n\n_+3:_ When the Assassin kills an enemy with a prepared strike they have a 25/50/75/100% chance to drop _45 extra gold_, per level of preparation. +actors.hero.talent.bounty_hunter.desc=_+1:_ When the Assassin kills an enemy with a prepared strike their item drop chance is increased by _2/4/8/16%_, per level of preparation.\n\n_+2:_ When the Assassin kills an enemy with a prepared strike their item drop chance is increased by _4/8/16/32%_, per level of preparation.\n\n_+3:_ When the Assassin kills an enemy with a prepared strike their item drop chance is increased by _6/12/24/48%_, per level of preparation. actors.hero.talent.evasive_armor.title=evasive armor actors.hero.talent.evasive_armor.desc=_+1:_ While freerunning, the Freerunner gains an additional _+1 evasion_ per excess point of strength on his armor.\n\n_+2:_ While freerunning, the Freerunner gains an additional _+2 evasion_ per excess point of strength on his armor.\n\n_+3:_ While freerunning, the Freerunner gains an additional _+3 evasion_ per excess point of strength on his armor. 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 498ad57fb..350c4bc0f 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 @@ -767,9 +767,20 @@ public abstract class Mob extends Char { public float lootChance(){ float lootChance = this.lootChance; - lootChance *= RingOfWealth.dropChanceMultiplier( Dungeon.hero ); + float dropBonus = RingOfWealth.dropChanceMultiplier( Dungeon.hero ); - return lootChance; + Talent.BountyHunterTracker bhTracker = Dungeon.hero.buff(Talent.BountyHunterTracker.class); + if (bhTracker != null){ + Preparation prep = Dungeon.hero.buff(Preparation.class); + if (prep != null){ + // 2/4/8/16% per prep level, multiplied by talent points + float bhBonus = 0.02f * (float)Math.pow(2, prep.attackLevel()-1); + bhBonus *= Dungeon.hero.pointsInTalent(Talent.BOUNTY_HUNTER); + dropBonus += bhBonus; + } + } + + return lootChance * dropBonus; } public void rollToDropLoot(){ @@ -809,14 +820,6 @@ public abstract class Mob extends Char { Talent.onFoodEaten(Dungeon.hero, 0, null); } - //bounty hunter talent - if (Dungeon.hero.buff(Talent.BountyHunterTracker.class) != null) { - Preparation prep = Dungeon.hero.buff(Preparation.class); - if (prep != null && Random.Float() < 0.25f * prep.attackLevel()) { - Dungeon.level.drop(new Gold(15 * Dungeon.hero.pointsInTalent(Talent.BOUNTY_HUNTER)), pos).sprite.drop(); - } - } - } protected Object loot = null;