v0.8.1a: various bugfixes:

- warlocks not playing debuff sound if hero is already debuffed
- various small logic errors with ring of wealth
- wand of warding incorrectly refusing to place a new ward with 1 energy left
- runes appearing on top of each other in runestone rooms
- particles on item sprites being visible when the sprite isn't
This commit is contained in:
Evan Debenham 2020-07-02 14:46:03 -04:00
parent ea4d45da7f
commit 91b7b14ea4
5 changed files with 13 additions and 11 deletions

View File

@ -105,10 +105,8 @@ public class Warlock extends Mob implements Callback {
if (hit( this, enemy, true )) { if (hit( this, enemy, true )) {
//TODO would be nice for this to work on ghost/statues too //TODO would be nice for this to work on ghost/statues too
if (enemy == Dungeon.hero && Random.Int( 2 ) == 0) { if (enemy == Dungeon.hero && Random.Int( 2 ) == 0) {
if (enemy.buff( Degrade.class ) == null){
Sample.INSTANCE.play( Assets.Sounds.DEBUFF );
}
Buff.prolong( enemy, Degrade.class, Degrade.DURATION ); Buff.prolong( enemy, Degrade.class, Degrade.DURATION );
Sample.INSTANCE.play( Assets.Sounds.DEBUFF );
} }
int dmg = Random.NormalIntRange( 12, 18 ); int dmg = Random.NormalIntRange( 12, 18 );

View File

@ -179,11 +179,11 @@ public class RingOfWealth extends Ring {
if (roll < (0.6f - 0.04f * level)) { if (roll < (0.6f - 0.04f * level)) {
latestDropTier = 1; latestDropTier = 1;
return genLowValueConsumable(); return genLowValueConsumable();
//30% chance + 2% per level. Starting from +15: 60%-2%*lvl //30% chance + 2% per level. Starting from +15: 60%-2%*(lvl-15)
} else if (roll < (0.9f - 0.02f * level)) { } else if (roll < (0.9f - 0.02f * level)) {
latestDropTier = 2; latestDropTier = 2;
return genMidValueConsumable(); return genMidValueConsumable();
//10% chance + 2% per level. Starting from +15: 40%+2%*lvl //10% chance + 2% per level. Starting from +15: 40%+2%*(lvl-15)
} else { } else {
latestDropTier = 3; latestDropTier = 3;
return genHighValueConsumable(); return genHighValueConsumable();
@ -227,11 +227,11 @@ public class RingOfWealth extends Ring {
private static Item genHighValueConsumable(){ private static Item genHighValueConsumable(){
switch (Random.Int(4)){ switch (Random.Int(4)){
case 0: default: case 0: default:
Item i = genLowValueConsumable(); Item i = genMidValueConsumable();
if (i instanceof Bomb){ if (i instanceof Bomb){
return new Bomb.DoubleBomb(); return new Bomb.DoubleBomb();
} else { } else {
return i.quantity(i.quantity() * 2); return i.quantity(i.quantity()*2);
} }
case 1: case 1:
return new StoneOfEnchantment(); return new StoneOfEnchantment();
@ -249,13 +249,13 @@ public class RingOfWealth extends Ring {
switch (Random.Int(5)){ switch (Random.Int(5)){
default: case 0: case 1: default: case 0: case 1:
Weapon w = Generator.randomWeapon(floorset); Weapon w = Generator.randomWeapon(floorset);
if (!w.hasGoodEnchant() && Random.Int(10-level) == 0) w.enchant(); if (!w.hasGoodEnchant() && Random.Int(10) < level) w.enchant();
else if (w.hasCurseEnchant()) w.enchant(null); else if (w.hasCurseEnchant()) w.enchant(null);
result = w; result = w;
break; break;
case 2: case 2:
Armor a = Generator.randomArmor(floorset); Armor a = Generator.randomArmor(floorset);
if (!a.hasGoodGlyph() && Random.Int(10-level) == 0) a.inscribe(); if (!a.hasGoodGlyph() && Random.Int(10) < level) a.inscribe();
else if (a.hasCurseGlyph()) a.inscribe(null); else if (a.hasCurseGlyph()) a.inscribe(null);
result = a; result = a;
break; break;

View File

@ -68,7 +68,7 @@ public class WandOfWarding extends Wand {
return false; return false;
} }
} else { } else {
if ((currentWardEnergy + 2) > maxWardEnergy){ if ((currentWardEnergy + 1) > maxWardEnergy){
GLog.w( Messages.get(this, "no_more_wards")); GLog.w( Messages.get(this, "no_more_wards"));
return false; return false;
} }

View File

@ -55,7 +55,7 @@ public class RunestoneRoom extends SpecialRoom {
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
do { do {
dropPos = level.pointToCell(random()); dropPos = level.pointToCell(random());
} while (level.map[dropPos] != Terrain.EMPTY); } while (level.map[dropPos] != Terrain.EMPTY || level.heaps.get( dropPos ) != null);
level.drop(prize(level), dropPos); level.drop(prize(level), dropPos);
} }

View File

@ -307,6 +307,10 @@ public class ItemSprite extends MovieClip {
visible = (heap == null || heap.seen); visible = (heap == null || heap.seen);
if (emitter != null){
emitter.visible = visible;
}
if (dropInterval > 0){ if (dropInterval > 0){
shadowOffset -= speed.y * Game.elapsed * 0.8f; shadowOffset -= speed.y * Game.elapsed * 0.8f;