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:
parent
cf085cc15c
commit
e49eb27a12
|
@ -50,8 +50,8 @@ public class Levitation extends FlavourBuff {
|
||||||
@Override
|
@Override
|
||||||
public void detach() {
|
public void detach() {
|
||||||
target.flying = false;
|
target.flying = false;
|
||||||
Dungeon.level.occupyCell(target );
|
|
||||||
super.detach();
|
super.detach();
|
||||||
|
Dungeon.level.occupyCell(target );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -860,9 +860,13 @@ public class Hero extends Char {
|
||||||
private boolean actDescend( HeroAction.Descend action ) {
|
private boolean actDescend( HeroAction.Descend action ) {
|
||||||
int stairs = action.dst;
|
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
|
//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
|
//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;
|
curAction = null;
|
||||||
|
|
||||||
|
@ -889,9 +893,14 @@ public class Hero extends Char {
|
||||||
private boolean actAscend( HeroAction.Ascend action ) {
|
private boolean actAscend( HeroAction.Ascend action ) {
|
||||||
int stairs = action.dst;
|
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
|
//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
|
//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) {
|
if (Dungeon.depth == 1) {
|
||||||
|
|
||||||
|
@ -1108,7 +1117,10 @@ public class Hero extends Char {
|
||||||
|
|
||||||
if (newMob) {
|
if (newMob) {
|
||||||
interrupt();
|
interrupt();
|
||||||
resting = false;
|
if (resting){
|
||||||
|
Dungeon.observe();
|
||||||
|
resting = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visibleEnemies = visible;
|
visibleEnemies = visible;
|
||||||
|
|
|
@ -639,6 +639,15 @@ public class NewTengu extends Mob {
|
||||||
Dungeon.fail(NewTengu.class);
|
Dungeon.fail(NewTengu.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
exploded = true;
|
||||||
CellEmitter.center(cell).burst(BlastParticle.FACTORY, 2);
|
CellEmitter.center(cell).burst(BlastParticle.FACTORY, 2);
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
@ -112,7 +113,9 @@ public class ScrollOfRemoveCurse extends InventoryScroll {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean uncursable( Item item ){
|
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;
|
return true;
|
||||||
} else if (item instanceof Weapon){
|
} else if (item instanceof Weapon){
|
||||||
return ((Weapon)item).hasCurseEnchant();
|
return ((Weapon)item).hasCurseEnchant();
|
||||||
|
|
|
@ -92,16 +92,6 @@ public class NewCavesBossLevel extends Level {
|
||||||
|
|
||||||
setSize(WIDTH, HEIGHT);
|
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
|
//fill in special floor, statues, and exits
|
||||||
Painter.fill(this, 15, 2, 3, 3, Terrain.EMPTY_SP);
|
Painter.fill(this, 15, 2, 3, 3, Terrain.EMPTY_SP);
|
||||||
Painter.fill(this, 15, 5, 3, 1, Terrain.STATUE);
|
Painter.fill(this, 15, 5, 3, 1, Terrain.STATUE);
|
||||||
|
@ -132,6 +122,16 @@ public class NewCavesBossLevel extends Level {
|
||||||
buildEntrance();
|
buildEntrance();
|
||||||
buildCorners();
|
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();
|
CustomTilemap customVisuals = new CityEntrance();
|
||||||
customVisuals.setRect(0, 0, width(), 11);
|
customVisuals.setRect(0, 0, width(), 11);
|
||||||
customTiles.add(customVisuals);
|
customTiles.add(customVisuals);
|
||||||
|
@ -144,8 +144,6 @@ public class NewCavesBossLevel extends Level {
|
||||||
customVisuals.setRect(0, 12, width(), 27);
|
customVisuals.setRect(0, 12, width(), 27);
|
||||||
customTiles.add(customVisuals);
|
customTiles.add(customVisuals);
|
||||||
|
|
||||||
new CavesPainter().paint(this, null);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -248,6 +246,26 @@ public class NewCavesBossLevel extends Level {
|
||||||
super.seal();
|
super.seal();
|
||||||
|
|
||||||
set( entrance, Terrain.WALL );
|
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 );
|
GameScene.updateMap( entrance );
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
|
|
||||||
|
|
|
@ -545,6 +545,12 @@ public class NewPrisonBossLevel extends Level {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void placeTrapsInTenguCell(float fill){
|
public void placeTrapsInTenguCell(float fill){
|
||||||
|
|
||||||
|
for (CustomTilemap vis : customTiles){
|
||||||
|
if (vis instanceof FadingTraps){
|
||||||
|
((FadingTraps) vis).remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Point tenguPoint = cellToPoint(tengu.pos);
|
Point tenguPoint = cellToPoint(tengu.pos);
|
||||||
Point heroPoint = cellToPoint(Dungeon.hero.pos);
|
Point heroPoint = cellToPoint(Dungeon.hero.pos);
|
||||||
|
@ -561,8 +567,8 @@ public class NewPrisonBossLevel extends Level {
|
||||||
|
|
||||||
PathFinder.buildDistanceMap(tenguPos, BArray.not(trapsPatch, null));
|
PathFinder.buildDistanceMap(tenguPos, BArray.not(trapsPatch, null));
|
||||||
//note that the effective range of fill is 40%-90%
|
//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
|
//so distance to tengu starts at 3-6 tiles and scales up to 7-8 as fill increases
|
||||||
} while (PathFinder.distance[heroPos] > Math.ceil(1 + 7*fill)
|
} while (PathFinder.distance[heroPos] > Math.ceil(4 + 4*fill)
|
||||||
|| PathFinder.distance[heroPos] < Math.ceil(7*fill));
|
|| PathFinder.distance[heroPos] < Math.ceil(7*fill));
|
||||||
|
|
||||||
PathFinder.setMapSize(width(), height());
|
PathFinder.setMapSize(width(), height());
|
||||||
|
@ -574,7 +580,7 @@ public class NewPrisonBossLevel extends Level {
|
||||||
int cell = x+tenguCell.left+1 + (y+tenguCell.top+1)*width();
|
int cell = x+tenguCell.left+1 + (y+tenguCell.top+1)*width();
|
||||||
if (Blob.volumeAt(cell, StormCloud.class) == 0
|
if (Blob.volumeAt(cell, StormCloud.class) == 0
|
||||||
&& Blob.volumeAt(cell, Regrowth.class) <= 9
|
&& Blob.volumeAt(cell, Regrowth.class) <= 9
|
||||||
&& Actor.findChar(cell) != tengu) {
|
&& Actor.findChar(cell) == null) {
|
||||||
Level.set(cell, Terrain.SECRET_TRAP);
|
Level.set(cell, Terrain.SECRET_TRAP);
|
||||||
setTrap(new TenguDartTrap().hide(), cell);
|
setTrap(new TenguDartTrap().hide(), cell);
|
||||||
CellEmitter.get(cell).burst(Speck.factory(Speck.LIGHT), 2);
|
CellEmitter.get(cell).burst(Speck.factory(Speck.LIGHT), 2);
|
||||||
|
@ -636,7 +642,7 @@ public class NewPrisonBossLevel extends Level {
|
||||||
|
|
||||||
private float fadeDuration = 1f;
|
private float fadeDuration = 1f;
|
||||||
private float initialAlpha = .4f;
|
private float initialAlpha = .4f;
|
||||||
private float fadeDelay = 0f;
|
private float fadeDelay = 1f;
|
||||||
|
|
||||||
public void setCoveringArea(Rect area){
|
public void setCoveringArea(Rect area){
|
||||||
tileX = area.left;
|
tileX = area.left;
|
||||||
|
@ -723,6 +729,13 @@ public class NewPrisonBossLevel extends Level {
|
||||||
}
|
}
|
||||||
}, fadeDelay);
|
}, fadeDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void remove(){
|
||||||
|
if (vis != null){
|
||||||
|
vis.killAndErase();
|
||||||
|
}
|
||||||
|
Dungeon.level.customTiles.remove(this);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user