diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index e7c82786f..268ec49e9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Chains; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; @@ -138,7 +139,13 @@ public class Guard extends Mob { protected Item createLoot() { //first see if we drop armor, overall chance is 1/8 if (Random.Int(2) == 0){ - return Generator.randomArmor(); + Armor loot; + do{ + loot = Generator.randomArmor(); + //50% chance of re-rolling tier 4 or 5 items + } while (loot.tier >= 4 && Random.Int(2) == 0); + loot.level(0); + return loot; //otherwise, we may drop a health potion. overall chance is 7/(8 * (7 + potions dropped)) //with 0 potions dropped that simplifies to 1/8 } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index ba408752f..4c179be09 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.SkeletonSprite; @@ -88,13 +89,12 @@ public class Skeleton extends Mob { @Override protected Item createLoot() { - Item loot = Generator.random( Generator.Category.WEAPON ); - for (int i=0; i < 2; i++) { - Item l = Generator.random( Generator.Category.WEAPON ); - if (l.level() < loot.level()) { - loot = l; - } - } + Item loot; + do { + loot = Generator.random(Generator.Category.WEAPON); + //50% chance of re-rolling tier 4 or 5 items + } while (loot instanceof MeleeWeapon && ((MeleeWeapon) loot).tier >= 4 && Random.Int(2) == 0); + loot.level(0); return loot; }