v0.3.5: refactored guard item drop code, now works with ring of wealth.
This commit is contained in:
parent
dd08be8d97
commit
c3910a1277
|
@ -52,7 +52,7 @@ public class Guard extends Mob {
|
||||||
maxLvl = 14;
|
maxLvl = 14;
|
||||||
|
|
||||||
loot = null; //see createloot.
|
loot = null; //see createloot.
|
||||||
lootChance = 1;
|
lootChance = 0.25f;
|
||||||
|
|
||||||
properties.add(Property.DEMONIC);
|
properties.add(Property.DEMONIC);
|
||||||
}
|
}
|
||||||
|
@ -136,13 +136,13 @@ public class Guard extends Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Item createLoot() {
|
protected Item createLoot() {
|
||||||
//first see if we drop armor, chance is 1/8 (0.125f)
|
//first see if we drop armor, overall chance is 1/8
|
||||||
if (Random.Int(8) == 0){
|
if (Random.Int(2) == 0){
|
||||||
return Generator.randomArmor();
|
return Generator.randomArmor();
|
||||||
//otherwise, we may drop a health potion. Chance is 1/(7+potions dropped)
|
//otherwise, we may drop a health potion. overall chance is 7/(8 * (7 + potions dropped))
|
||||||
//including the chance for armor before it, effective droprate is ~1/(8 + (1.15*potions dropped))
|
//with 0 potions dropped that simplifies to 1/8
|
||||||
} else {
|
} else {
|
||||||
if (Random.Int(7 + Dungeon.limitedDrops.guardHP.count) == 0){
|
if (Random.Int(7 + Dungeon.limitedDrops.guardHP.count) < 7){
|
||||||
Dungeon.limitedDrops.guardHP.drop();
|
Dungeon.limitedDrops.guardHP.drop();
|
||||||
return new PotionOfHealing();
|
return new PotionOfHealing();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user