v0.8.1: significant tweaks to consumable droprates
This commit is contained in:
parent
a1cdafe76c
commit
806e829000
|
@ -48,7 +48,7 @@ public class DM100 extends Mob implements Callback {
|
|||
maxLvl = 13;
|
||||
|
||||
loot = Generator.Category.SCROLL;
|
||||
lootChance = 0.33f;
|
||||
lootChance = 0.25f;
|
||||
|
||||
properties.add(Property.ELECTRIC);
|
||||
properties.add(Property.INORGANIC);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class Warlock extends Mob implements Callback {
|
|||
maxLvl = 21;
|
||||
|
||||
loot = Generator.Category.POTION;
|
||||
lootChance = 0.83f;
|
||||
lootChance = 0.5f;
|
||||
|
||||
properties.add(Property.UNDEAD);
|
||||
}
|
||||
|
@ -134,21 +134,31 @@ public class Warlock extends Mob implements Callback {
|
|||
}
|
||||
|
||||
@Override
|
||||
//TODO refactor warlock drops, they shouldn't pull from regular healing potion pool
|
||||
public Item createLoot(){
|
||||
Item loot = super.createLoot();
|
||||
|
||||
if (loot instanceof PotionOfHealing){
|
||||
|
||||
//count/8 chance of not dropping potion
|
||||
if (Random.Float() < ((8f - Dungeon.LimitedDrops.WARLOCK_HP.count) / 8f)){
|
||||
Dungeon.LimitedDrops.WARLOCK_HP.count++;
|
||||
// 1/6 chance for healing, scaling to 0 over 8 drops
|
||||
if (Random.Int(2) == 0 && Random.Int(8) > Dungeon.LimitedDrops.WARLOCK_HP.count ){
|
||||
Dungeon.LimitedDrops.WARLOCK_HP.drop();
|
||||
return new PotionOfHealing();
|
||||
} else {
|
||||
return null;
|
||||
Item i = Generator.random(Generator.Category.POTION);
|
||||
int healingTried = 0;
|
||||
while (i instanceof PotionOfHealing){
|
||||
healingTried++;
|
||||
i = Generator.random(Generator.Category.POTION);
|
||||
}
|
||||
|
||||
//return the attempted healing potion drops to the pool
|
||||
if (healingTried > 0){
|
||||
for (int j = 0; j < Generator.Category.POTION.classes.length; j++){
|
||||
if (Generator.Category.POTION.classes[j] == PotionOfHealing.class){
|
||||
Generator.Category.POTION.probs[j] += healingTried;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return loot;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ public class Generator {
|
|||
|
||||
ARMOR ( 4, Armor.class ),
|
||||
|
||||
MISSILE ( 3, MissileWeapon.class ),
|
||||
MISSILE ( 4, MissileWeapon.class ),
|
||||
MIS_T1 ( 0, MissileWeapon.class ),
|
||||
MIS_T2 ( 0, MissileWeapon.class ),
|
||||
MIS_T3 ( 0, MissileWeapon.class ),
|
||||
|
@ -201,13 +201,13 @@ public class Generator {
|
|||
|
||||
FOOD ( 0, Food.class ),
|
||||
|
||||
POTION ( 20, Potion.class ),
|
||||
SEED ( 0, Plant.Seed.class ), //dropped by grass
|
||||
POTION ( 16, Potion.class ),
|
||||
SEED ( 2, Plant.Seed.class ),
|
||||
|
||||
SCROLL ( 20, Scroll.class ),
|
||||
SCROLL ( 16, Scroll.class ),
|
||||
STONE ( 2, Runestone.class),
|
||||
|
||||
GOLD ( 18, Gold.class );
|
||||
GOLD ( 20, Gold.class );
|
||||
|
||||
public Class<?>[] classes;
|
||||
|
||||
|
@ -270,8 +270,7 @@ public class Generator {
|
|||
Earthroot.Seed.class,
|
||||
Dreamfoil.Seed.class,
|
||||
Starflower.Seed.class};
|
||||
//TODO adjust these
|
||||
SEED.defaultProbs = new float[]{ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1 };
|
||||
SEED.defaultProbs = new float[]{ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 };
|
||||
SEED.probs = SEED.defaultProbs.clone();
|
||||
|
||||
SCROLL.classes = new Class<?>[]{
|
||||
|
@ -303,10 +302,9 @@ public class Generator {
|
|||
StoneOfAggression.class,
|
||||
StoneOfBlast.class,
|
||||
StoneOfAffection.class,
|
||||
StoneOfAugmentation.class //1 is also sold in each shop
|
||||
StoneOfAugmentation.class //1 is sold in each shop
|
||||
};
|
||||
//TODO adjust these
|
||||
STONE.defaultProbs = new float[]{ 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0 };
|
||||
STONE.defaultProbs = new float[]{ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0 };
|
||||
STONE.probs = STONE.defaultProbs.clone();
|
||||
|
||||
WAND.classes = new Class<?>[]{
|
||||
|
|
|
@ -45,7 +45,7 @@ public class LibraryRoom extends SpecialRoom {
|
|||
Painter.fill( level, left + 1, top+1, width() - 2, 1 , Terrain.BOOKSHELF );
|
||||
Painter.drawInside(level, this, entrance, 1, Terrain.EMPTY_SP );
|
||||
|
||||
int n = Random.IntRange( 2, 3 );
|
||||
int n = Random.NormalIntRange( 1, 3 );
|
||||
for (int i=0; i < n; i++) {
|
||||
int pos;
|
||||
do {
|
||||
|
|
|
@ -198,12 +198,10 @@ public class ShopRoom extends SpecialRoom {
|
|||
itemsToSpawn.add( new PotionOfHealing() );
|
||||
itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.POTION ) );
|
||||
itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.POTION ) );
|
||||
itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.POTION ) );
|
||||
|
||||
itemsToSpawn.add( new ScrollOfIdentify() );
|
||||
itemsToSpawn.add( new ScrollOfRemoveCurse() );
|
||||
itemsToSpawn.add( new ScrollOfMagicMapping() );
|
||||
itemsToSpawn.add( Generator.randomUsingDefaults( Generator.Category.SCROLL ) );
|
||||
|
||||
for (int i=0; i < 2; i++)
|
||||
itemsToSpawn.add( Random.Int(2) == 0 ?
|
||||
|
|
Loading…
Reference in New Issue
Block a user