v0.8.1: Various small fixes and improvements:

- fixed levitation applying occupyCell effects before it actually ended
- fixed ascend/descend working while rooted
- fixed FOV not updating sometimes when hero is interrupted from resting
- fixed rare errors with tengu's bombs not being visually destroyed
- fixed gold wall vfx rarely showing on city walls in DM-300's arena
- fixed items/characters being able to be inside of a wall in DM-300's arena
- fixed an error where Tengu's fading traps could visually layer
- fixed a bug where the Tengu fight could freeze due to new trap logic
- fixed tengu being able to place traps right beneath characters
- fixed fading traps disappearing immediately on load
- fixed scroll of remove curse not being usable while degraded
This commit is contained in:
Evan Debenham 2020-05-18 21:01:43 -04:00
parent cf085cc15c
commit e49eb27a12
6 changed files with 76 additions and 21 deletions

View File

@ -50,8 +50,8 @@ public class Levitation extends FlavourBuff {
@Override
public void detach() {
target.flying = false;
Dungeon.level.occupyCell(target );
super.detach();
Dungeon.level.occupyCell(target );
}
@Override

View File

@ -860,9 +860,13 @@ public class Hero extends Char {
private boolean actDescend( HeroAction.Descend action ) {
int stairs = action.dst;
if (rooted) {
Camera.main.shake(1, 1f);
ready();
return false;
//there can be multiple exit tiles, so descend on any of them
//TODO this is slightly brittle, it assumes there are no disjointed sets of exit tiles
if ((Dungeon.level.map[pos] == Terrain.EXIT || Dungeon.level.map[pos] == Terrain.UNLOCKED_EXIT)) {
} else if ((Dungeon.level.map[pos] == Terrain.EXIT || Dungeon.level.map[pos] == Terrain.UNLOCKED_EXIT)) {
curAction = null;
@ -889,9 +893,14 @@ public class Hero extends Char {
private boolean actAscend( HeroAction.Ascend action ) {
int stairs = action.dst;
if (rooted){
Camera.main.shake( 1, 1f );
ready();
return false;
//there can be multiple entrance tiles, so descend on any of them
//TODO this is slightly brittle, it assumes there are no disjointed sets of entrance tiles
if (Dungeon.level.map[pos] == Terrain.ENTRANCE) {
} else if (Dungeon.level.map[pos] == Terrain.ENTRANCE) {
if (Dungeon.depth == 1) {
@ -1108,7 +1117,10 @@ public class Hero extends Char {
if (newMob) {
interrupt();
resting = false;
if (resting){
Dungeon.observe();
resting = false;
}
}
visibleEnemies = visible;

View File

@ -640,6 +640,15 @@ public class NewTengu extends Mob {
}
}
Heap h = Dungeon.level.heaps.get(cell);
if (h != null){
for (Item it : h.items.toArray(new Item[0])){
if (it instanceof BombItem){
h.remove(it);
}
}
}
exploded = true;
CellEmitter.center(cell).burst(BlastParticle.FACTORY, 2);
}

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
@ -112,7 +113,9 @@ public class ScrollOfRemoveCurse extends InventoryScroll {
}
public static boolean uncursable( Item item ){
if ((item instanceof EquipableItem || item instanceof Wand) && (!item.isIdentified() || item.cursed)){
if (item.isEquipped(Dungeon.hero) && Dungeon.hero.buff(Degrade.class) != null) {
return true;
} if ((item instanceof EquipableItem || item instanceof Wand) && (!item.isIdentified() || item.cursed)){
return true;
} else if (item instanceof Weapon){
return ((Weapon)item).hasCurseEnchant();

View File

@ -92,16 +92,6 @@ public class NewCavesBossLevel extends Level {
setSize(WIDTH, HEIGHT);
//Painter.fill(this, 0, 0, width(), height(), Terrain.EMBERS);
//setup exit area above main boss arena
Painter.fill(this, 0, 3, width(), 4, Terrain.CHASM);
Painter.fill(this, 6, 7, 21, 1, Terrain.CHASM);
Painter.fill(this, 10, 8, 13, 1, Terrain.CHASM);
Painter.fill(this, 12, 9, 9, 1, Terrain.CHASM);
Painter.fill(this, 13, 10, 7, 1, Terrain.CHASM);
Painter.fill(this, 14, 3, 5, 10, Terrain.EMPTY);
//fill in special floor, statues, and exits
Painter.fill(this, 15, 2, 3, 3, Terrain.EMPTY_SP);
Painter.fill(this, 15, 5, 3, 1, Terrain.STATUE);
@ -132,6 +122,16 @@ public class NewCavesBossLevel extends Level {
buildEntrance();
buildCorners();
new CavesPainter().paint(this, null);
//setup exit area above main boss arena
Painter.fill(this, 0, 3, width(), 4, Terrain.CHASM);
Painter.fill(this, 6, 7, 21, 1, Terrain.CHASM);
Painter.fill(this, 10, 8, 13, 1, Terrain.CHASM);
Painter.fill(this, 12, 9, 9, 1, Terrain.CHASM);
Painter.fill(this, 13, 10, 7, 1, Terrain.CHASM);
Painter.fill(this, 14, 3, 5, 10, Terrain.EMPTY);
CustomTilemap customVisuals = new CityEntrance();
customVisuals.setRect(0, 0, width(), 11);
customTiles.add(customVisuals);
@ -144,8 +144,6 @@ public class NewCavesBossLevel extends Level {
customVisuals.setRect(0, 12, width(), 27);
customTiles.add(customVisuals);
new CavesPainter().paint(this, null);
return true;
}
@ -248,6 +246,26 @@ public class NewCavesBossLevel extends Level {
super.seal();
set( entrance, Terrain.WALL );
Heap heap = Dungeon.level.heaps.get( entrance );
if (heap != null) {
int n;
do {
n = entrance + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
} while (!Dungeon.level.passable[n]);
Dungeon.level.drop( heap.pickUp(), n ).sprite.drop( entrance );
}
Char ch = Actor.findChar( entrance );
if (ch != null) {
int n;
do {
n = entrance + PathFinder.NEIGHBOURS8[Random.Int( 8 )];
} while (!Dungeon.level.passable[n]);
ch.pos = n;
ch.sprite.place(n);
}
GameScene.updateMap( entrance );
Dungeon.observe();

View File

@ -546,6 +546,12 @@ public class NewPrisonBossLevel extends Level {
public void placeTrapsInTenguCell(float fill){
for (CustomTilemap vis : customTiles){
if (vis instanceof FadingTraps){
((FadingTraps) vis).remove();
}
}
Point tenguPoint = cellToPoint(tengu.pos);
Point heroPoint = cellToPoint(Dungeon.hero.pos);
@ -561,8 +567,8 @@ public class NewPrisonBossLevel extends Level {
PathFinder.buildDistanceMap(tenguPos, BArray.not(trapsPatch, null));
//note that the effective range of fill is 40%-90%
//so distance to tengu starts at 3-4 tiles and scales up to 7-8 as fill increases
} while (PathFinder.distance[heroPos] > Math.ceil(1 + 7*fill)
//so distance to tengu starts at 3-6 tiles and scales up to 7-8 as fill increases
} while (PathFinder.distance[heroPos] > Math.ceil(4 + 4*fill)
|| PathFinder.distance[heroPos] < Math.ceil(7*fill));
PathFinder.setMapSize(width(), height());
@ -574,7 +580,7 @@ public class NewPrisonBossLevel extends Level {
int cell = x+tenguCell.left+1 + (y+tenguCell.top+1)*width();
if (Blob.volumeAt(cell, StormCloud.class) == 0
&& Blob.volumeAt(cell, Regrowth.class) <= 9
&& Actor.findChar(cell) != tengu) {
&& Actor.findChar(cell) == null) {
Level.set(cell, Terrain.SECRET_TRAP);
setTrap(new TenguDartTrap().hide(), cell);
CellEmitter.get(cell).burst(Speck.factory(Speck.LIGHT), 2);
@ -636,7 +642,7 @@ public class NewPrisonBossLevel extends Level {
private float fadeDuration = 1f;
private float initialAlpha = .4f;
private float fadeDelay = 0f;
private float fadeDelay = 1f;
public void setCoveringArea(Rect area){
tileX = area.left;
@ -724,6 +730,13 @@ public class NewPrisonBossLevel extends Level {
}, fadeDelay);
}
private void remove(){
if (vis != null){
vis.killAndErase();
}
Dungeon.level.customTiles.remove(this);
}
}
public static class exitVisual extends CustomTilemap {