v0.7.1c: Fixed:

- Dwarf King not being able to summon if he could not see an enemy
- recycle generating health potions when it shouldn't
- soul mark being substantially more common than intended
- rare cases where DM-300 could fail to spawn due to too small a level
- magical porter rarely causing soft-locks
- thrown weapons not having their level IDed from remains
This commit is contained in:
Evan Debenham 2019-01-10 02:28:31 -05:00
parent f3705520ed
commit e70c5bbb41
6 changed files with 17 additions and 18 deletions

View File

@ -172,7 +172,8 @@ public class Bones {
if (item.level() > 3) { if (item.level() > 3) {
item.degrade( item.level() - 3 ); item.degrade( item.level() - 3 );
} }
item.levelKnown = false; //thrown weapons are always IDed, otherwise set unknown
item.levelKnown = !(item instanceof MissileWeapon);
} }
item.reset(); item.reset();

View File

@ -108,13 +108,6 @@ public class King extends Mob {
super.getCloser( target ); super.getCloser( target );
} }
@Override
protected boolean canAttack( Char enemy ) {
return canTryToSummon() ?
pos == ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) :
Dungeon.level.adjacent( pos, enemy.pos );
}
private boolean canTryToSummon() { private boolean canTryToSummon() {
if (Undead.count < maxArmySize()) { if (Undead.count < maxArmySize()) {
Char ch = Actor.findChar( ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) ); Char ch = Actor.findChar( ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) );
@ -125,15 +118,15 @@ public class King extends Mob {
} }
@Override @Override
public boolean attack( Char enemy ) { protected boolean act() {
if (canTryToSummon() && pos == ((CityBossLevel)Dungeon.level).pedestal( nextPedestal )) { if (canTryToSummon() && pos == ((CityBossLevel)Dungeon.level).pedestal( nextPedestal )) {
summon(); summon();
return true; return true;
} else { } else {
if (Actor.findChar( ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) ) == enemy) { if (enemy != null && Actor.findChar( ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) ) == enemy) {
nextPedestal = !nextPedestal; nextPedestal = !nextPedestal;
} }
return super.attack(enemy); return super.act();
} }
} }
@ -218,6 +211,7 @@ public class King extends Mob {
} }
yell( Messages.get(this, "arise") ); yell( Messages.get(this, "arise") );
spend( TICK );
} }
@Override @Override

View File

@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.spells; package com.shatteredpixel.shatteredpixeldungeon.items.spells;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -75,7 +76,7 @@ public class Recycle extends InventorySpell {
} else { } else {
result = Generator.random(Generator.Category.STONE); result = Generator.random(Generator.Category.STONE);
} }
} while (result.getClass() == item.getClass()); } while (result.getClass() == item.getClass() || Challenges.isItemBlocked(result));
item.detach(curUser.belongings.backpack); item.detach(curUser.belongings.backpack);
GLog.p(Messages.get(this, "recycled", result.name())); GLog.p(Messages.get(this, "recycled", result.name()));

View File

@ -146,7 +146,7 @@ public abstract class Wand extends Item {
if (target != Dungeon.hero && if (target != Dungeon.hero &&
Dungeon.hero.subClass == HeroSubClass.WARLOCK && Dungeon.hero.subClass == HeroSubClass.WARLOCK &&
//standard 1 - 0.92^x chance, plus 7%. Starts at 15% //standard 1 - 0.92^x chance, plus 7%. Starts at 15%
Random.Float() > (Math.pow(0.92f, (level()*chargesUsed)+1) - 0.7f)){ Random.Float() > (Math.pow(0.92f, (level()*chargesUsed)+1) - 0.07f)){
SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION + level()); SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION + level());
} }
} }

View File

@ -106,10 +106,10 @@ public class CavesBossLevel extends Level {
Rect space = new Rect(); Rect space = new Rect();
space.set( space.set(
Random.IntRange(2, 2 + (int)(width*0.2f)), Random.IntRange(2, 6),
Random.IntRange(2, 2 + (int)(height*0.2f)), Random.IntRange(2, 6),
Random.IntRange((int)(width * 0.8f - 2), width-2 ), Random.IntRange(width-6, width-2),
Random.IntRange((int)(height * 0.8f - 2), height-2 ) Random.IntRange(height-6, height-2)
); );
Painter.fillEllipse( this, space, Terrain.EMPTY ); Painter.fillEllipse( this, space, Terrain.EMPTY );

View File

@ -396,9 +396,12 @@ public class GameScene extends PixelScene {
//TODO currently items are only ported to boss rooms, so this works well //TODO currently items are only ported to boss rooms, so this works well
//might want to have a 'near entrance' function if items can be ported elsewhere //might want to have a 'near entrance' function if items can be ported elsewhere
int pos; int pos;
//try to find a tile with no heap, otherwise just stick items onto a heap.
int tries = 100;
do { do {
pos = Dungeon.level.randomRespawnCell(); pos = Dungeon.level.randomRespawnCell();
} while (Dungeon.level.heaps.get(pos) != null); tries--;
} while (tries > 0 && Dungeon.level.heaps.get(pos) != null);
for (Item item : ported) { for (Item item : ported) {
Dungeon.level.drop( item, pos ).type = Heap.Type.CHEST; Dungeon.level.drop( item, pos ).type = Heap.Type.CHEST;
} }