v0.8.0: various bugfixes and behaviour tweaks:
- fixed storm clouds spreading water faster than intended - fixed visual bugs with stealth and hourglass stasis effect - fixed an exploit where unstable spellbook scrolls could be cancelled - upgrading a stack of missile weapons now resets durability, just as upgrading a single one already did - fixed visual bugs when tengu traps would be created and immediately removed by some effects
This commit is contained in:
parent
bc9cd6e926
commit
438ce6f0a9
|
@ -40,7 +40,7 @@ public class StormCloud extends Blob {
|
||||||
for (int i = area.left; i < area.right; i++){
|
for (int i = area.left; i < area.right; i++){
|
||||||
for (int j = area.top; j < area.bottom; j++){
|
for (int j = area.top; j < area.bottom; j++){
|
||||||
cell = i + j*Dungeon.level.width();
|
cell = i + j*Dungeon.level.width();
|
||||||
if (off[cell] > 0) {
|
if (cur[cell] > 0) {
|
||||||
int terr = Dungeon.level.map[cell];
|
int terr = Dungeon.level.map[cell];
|
||||||
if (terr == Terrain.EMPTY || terr == Terrain.GRASS ||
|
if (terr == Terrain.EMPTY || terr == Terrain.GRASS ||
|
||||||
terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP ||
|
terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP ||
|
||||||
|
|
|
@ -283,6 +283,12 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
activeBuff = null;
|
activeBuff = null;
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fx(boolean on) {
|
||||||
|
if (on) target.sprite.add( CharSprite.State.INVISIBLE );
|
||||||
|
else if (target.invisible == 0) target.sprite.remove( CharSprite.State.INVISIBLE );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class timeFreeze extends ArtifactBuff {
|
public class timeFreeze extends ArtifactBuff {
|
||||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||||
|
@ -121,15 +122,20 @@ public class UnstableSpellbook extends Artifact {
|
||||||
scroll instanceof ScrollOfMagicMapping) && Random.Int(2) == 0)
|
scroll instanceof ScrollOfMagicMapping) && Random.Int(2) == 0)
|
||||||
//don't roll teleportation scrolls on boss floors
|
//don't roll teleportation scrolls on boss floors
|
||||||
|| (scroll instanceof ScrollOfTeleportation && Dungeon.bossLevel())
|
|| (scroll instanceof ScrollOfTeleportation && Dungeon.bossLevel())
|
||||||
|
//cannot roll transmutation
|
||||||
|| (scroll instanceof ScrollOfTransmutation));
|
|| (scroll instanceof ScrollOfTransmutation));
|
||||||
|
|
||||||
scroll.anonymize();
|
scroll.anonymize();
|
||||||
curItem = scroll;
|
curItem = scroll;
|
||||||
curUser = hero;
|
curUser = hero;
|
||||||
|
|
||||||
//if there are changes left and the scroll has been given to the book
|
//if there are charges left and the scroll has been given to the book
|
||||||
if (charge > 0 && !scrolls.contains(scroll.getClass())) {
|
if (charge > 0 && !scrolls.contains(scroll.getClass())) {
|
||||||
final Scroll fScroll = scroll;
|
final Scroll fScroll = scroll;
|
||||||
|
|
||||||
|
final ExploitHandler handler = Buff.affect(hero, ExploitHandler.class);
|
||||||
|
handler.scroll = scroll;
|
||||||
|
|
||||||
GameScene.show(new WndOptions(
|
GameScene.show(new WndOptions(
|
||||||
Messages.get(this, "prompt"),
|
Messages.get(this, "prompt"),
|
||||||
Messages.get(this, "read_empowered"),
|
Messages.get(this, "read_empowered"),
|
||||||
|
@ -137,6 +143,7 @@ public class UnstableSpellbook extends Artifact {
|
||||||
Messages.get(ExoticScroll.regToExo.get(scroll.getClass()), "name")){
|
Messages.get(ExoticScroll.regToExo.get(scroll.getClass()), "name")){
|
||||||
@Override
|
@Override
|
||||||
protected void onSelect(int index) {
|
protected void onSelect(int index) {
|
||||||
|
handler.detach();
|
||||||
if (index == 1){
|
if (index == 1){
|
||||||
Scroll scroll = Reflection.newInstance(ExoticScroll.regToExo.get(fScroll.getClass()));
|
Scroll scroll = Reflection.newInstance(ExoticScroll.regToExo.get(fScroll.getClass()));
|
||||||
charge--;
|
charge--;
|
||||||
|
@ -162,6 +169,35 @@ public class UnstableSpellbook extends Artifact {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//forces the reading of a regular scroll if the player tried to exploit by quitting the game when the menu was up
|
||||||
|
public static class ExploitHandler extends Buff {
|
||||||
|
{ actPriority = VFX_PRIO; }
|
||||||
|
|
||||||
|
public Scroll scroll;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean act() {
|
||||||
|
curUser = Dungeon.hero;
|
||||||
|
curItem = scroll;
|
||||||
|
scroll.anonymize();
|
||||||
|
scroll.doRead();
|
||||||
|
detach();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void storeInBundle(Bundle bundle) {
|
||||||
|
super.storeInBundle(bundle);
|
||||||
|
bundle.put( "scroll", scroll );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
|
super.restoreFromBundle(bundle);
|
||||||
|
scroll = (Scroll)bundle.get("scroll");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ArtifactBuff passiveBuff() {
|
protected ArtifactBuff passiveBuff() {
|
||||||
return new bookRecharge();
|
return new bookRecharge();
|
||||||
|
|
|
@ -99,6 +99,7 @@ abstract public class MissileWeapon extends Weapon {
|
||||||
//FIXME some logic here assumes the items are in the player's inventory. Might need to adjust
|
//FIXME some logic here assumes the items are in the player's inventory. Might need to adjust
|
||||||
public Item upgrade() {
|
public Item upgrade() {
|
||||||
if (!bundleRestoring) {
|
if (!bundleRestoring) {
|
||||||
|
durability = MAX_DURABILITY;
|
||||||
if (quantity > 1) {
|
if (quantity > 1) {
|
||||||
MissileWeapon upgraded = (MissileWeapon) split(1);
|
MissileWeapon upgraded = (MissileWeapon) split(1);
|
||||||
upgraded.parent = null;
|
upgraded.parent = null;
|
||||||
|
@ -112,7 +113,6 @@ abstract public class MissileWeapon extends Weapon {
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
return upgraded;
|
return upgraded;
|
||||||
} else {
|
} else {
|
||||||
durability = MAX_DURABILITY;
|
|
||||||
super.upgrade();
|
super.upgrade();
|
||||||
|
|
||||||
Item similar = Dungeon.hero.belongings.getSimilar(this);
|
Item similar = Dungeon.hero.belongings.getSimilar(this);
|
||||||
|
|
|
@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Regrowth;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StormCloud;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.NewTengu;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.NewTengu;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
|
@ -570,7 +572,9 @@ public class NewPrisonBossLevel extends Level {
|
||||||
for (int y = 1; y < maze[0].length-1; y++) {
|
for (int y = 1; y < maze[0].length-1; y++) {
|
||||||
if (maze[x][y]){
|
if (maze[x][y]){
|
||||||
int cell = mazeCells[i].left+x + width()*(mazeCells[i].top+y);
|
int cell = mazeCells[i].left+x + width()*(mazeCells[i].top+y);
|
||||||
if (heaps.get(cell) == null){
|
if (heaps.get(cell) == null
|
||||||
|
&& Blob.volumeAt(cell, StormCloud.class) == 0
|
||||||
|
&& Blob.volumeAt(cell, Regrowth.class) <= 9){
|
||||||
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);
|
||||||
|
@ -664,11 +668,12 @@ public class NewPrisonBossLevel extends Level {
|
||||||
int x = i % 7;
|
int x = i % 7;
|
||||||
int y = i / 7;
|
int y = i / 7;
|
||||||
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
|
||||||
|
&& Blob.volumeAt(cell, Regrowth.class) <= 9) {
|
||||||
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);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user