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