From 11a684bb1f5cdf8940ba32f1526842ebf064109f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 13 Oct 2020 17:31:57 -0400 Subject: [PATCH] v0.9.0b: Balance tweaks to equip drops in the sewers: - Sewer droprate of T4/T5 gear halved - T2 is slightly more common in the sewers - Player now gets to see what type of weapon/armor the ghost has --- .../actors/mobs/npcs/Ghost.java | 24 +++++++------------ .../items/Generator.java | 2 +- .../windows/WndSadGhost.java | 4 ++-- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index 4ea5aebf4..e12a6814f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -281,23 +281,15 @@ public class Ghost extends NPC { depth = Dungeon.depth; //50%:tier2, 30%:tier3, 15%:tier4, 5%:tier5 - float itemTierRoll = Random.Float(); - int wepTier; - - if (itemTierRoll < 0.5f) { - wepTier = 2; - armor = new LeatherArmor(); - } else if (itemTierRoll < 0.8f) { - wepTier = 3; - armor = new MailArmor(); - } else if (itemTierRoll < 0.95f) { - wepTier = 4; - armor = new ScaleArmor(); - } else { - wepTier = 5; - armor = new PlateArmor(); + switch (Random.chances(new float[]{0, 0, 10, 6, 3, 1})){ + default: + case 2: armor = new LeatherArmor(); break; + case 3: armor = new MailArmor(); break; + case 4: armor = new ScaleArmor(); break; + case 5: armor = new PlateArmor(); break; } - + //50%:tier2, 30%:tier3, 15%:tier4, 5%:tier5 + int wepTier = Random.chances(new float[]{0, 10, 6, 3, 1}); Generator.Category c = Generator.wepTiers[wepTier - 1]; weapon = (MeleeWeapon) Reflection.newInstance(c.classes[Random.chances(c.probs)]); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 2a2e340ae..ff300d676 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -461,7 +461,7 @@ public class Generator { } private static final float[][] floorSetTierProbs = new float[][] { - {0, 70, 20, 8, 2}, + {0, 75, 20, 4, 1}, {0, 25, 50, 20, 5}, {0, 0, 40, 50, 10}, {0, 0, 20, 40, 40}, diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java index 60d3c0018..79ce4bebb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndSadGhost.java @@ -72,7 +72,7 @@ public class WndSadGhost extends Window { message.setPos(0, titlebar.bottom() + GAP); add( message ); - RedButton btnWeapon = new RedButton( Messages.get(this, "weapon") ) { + RedButton btnWeapon = new RedButton( Ghost.Quest.weapon.trueName() + " :" + Ghost.Quest.weapon.STRReq(0) ) { @Override protected void onClick() { selectReward( ghost, Ghost.Quest.weapon ); @@ -81,7 +81,7 @@ public class WndSadGhost extends Window { btnWeapon.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT ); add( btnWeapon ); - RedButton btnArmor = new RedButton( Messages.get(this, "armor") ) { + RedButton btnArmor = new RedButton( Ghost.Quest.armor.trueName() + " :" + Ghost.Quest.armor.STRReq(0) ) { @Override protected void onClick() { selectReward(ghost, Ghost.Quest.armor);