v0.6.4: increased the severity of potion of healing droprate caps
This commit is contained in:
parent
6e63c6db21
commit
1e714e43d2
|
@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.BatSprite;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
@ -45,7 +44,7 @@ public class Bat extends Mob {
|
|||
flying = true;
|
||||
|
||||
loot = new PotionOfHealing();
|
||||
lootChance = 0.1667f; //by default, see die()
|
||||
lootChance = 0.1667f; //by default, see rollToDropLoot()
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,14 +74,13 @@ public class Bat extends Mob {
|
|||
|
||||
return damage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void die( Object cause ){
|
||||
//sets drop chance
|
||||
lootChance = 1f/((6 + Dungeon.LimitedDrops.BAT_HP.count ));
|
||||
super.die( cause );
|
||||
public void rollToDropLoot() {
|
||||
lootChance *= ((7f - Dungeon.LimitedDrops.BAT_HP.count) / 7f);
|
||||
super.rollToDropLoot();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Item createLoot(){
|
||||
Dungeon.LimitedDrops.BAT_HP.count++;
|
||||
|
|
|
@ -135,10 +135,10 @@ public class Guard extends Mob {
|
|||
} 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))
|
||||
//otherwise, we may drop a health potion. overall chance is 1/8 * (6-potions dropped)/6
|
||||
//with 0 potions dropped that simplifies to 1/8
|
||||
} else {
|
||||
if (Random.Int(7 + Dungeon.LimitedDrops.GUARD_HP.count) < 7){
|
||||
if (Random.Float() < ((6f - Dungeon.LimitedDrops.GUARD_HP.count) / 6f)){
|
||||
Dungeon.LimitedDrops.GUARD_HP.drop();
|
||||
return new PotionOfHealing();
|
||||
}
|
||||
|
|
|
@ -26,11 +26,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ScorpioSprite;
|
||||
import com.watabou.utils.Random;
|
||||
|
@ -95,8 +93,8 @@ public class Scorpio extends Mob {
|
|||
|
||||
@Override
|
||||
protected Item createLoot() {
|
||||
//5/count+5 total chance of getting healing, failing the 2nd roll drops mystery meat instead.
|
||||
if (Random.Int( 5 + Dungeon.LimitedDrops.SCORPIO_HP.count ) < 5) {
|
||||
//(9-count) / 9 chance of getting healing, otherwise mystery meat
|
||||
if (Random.Float() < ((9f - Dungeon.LimitedDrops.SCORPIO_HP.count) / 9f)) {
|
||||
Dungeon.LimitedDrops.SCORPIO_HP.count++;
|
||||
return (Item)loot;
|
||||
} else {
|
||||
|
|
|
@ -139,8 +139,8 @@ public class Swarm extends Mob {
|
|||
|
||||
@Override
|
||||
public void rollToDropLoot() {
|
||||
//sets drop chance
|
||||
lootChance = 1f/((6 + 2* Dungeon.LimitedDrops.SWARM_HP.count ) * (generation+1) );
|
||||
lootChance = 1f/(6 * (generation+1) );
|
||||
lootChance *= (5f - Dungeon.LimitedDrops.SWARM_HP.count) / 5f;
|
||||
super.rollToDropLoot();
|
||||
}
|
||||
|
||||
|
|
|
@ -132,10 +132,11 @@ public class Warlock extends Mob implements Callback {
|
|||
if (loot instanceof PotionOfHealing){
|
||||
|
||||
//count/10 chance of not dropping potion
|
||||
if ((Random.Int(10) - Dungeon.LimitedDrops.WARLOCK_HP.count) < 0){
|
||||
return null;
|
||||
} else
|
||||
if (Random.Float() < ((8f - Dungeon.LimitedDrops.WARLOCK_HP.count) / 8f)){
|
||||
Dungeon.LimitedDrops.WARLOCK_HP.count++;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user