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:
Evan Debenham 2019-11-05 14:17:04 -05:00
parent bc9cd6e926
commit 438ce6f0a9
5 changed files with 57 additions and 10 deletions

View File

@ -40,7 +40,7 @@ public class StormCloud extends Blob {
for (int i = area.left; i < area.right; i++){
for (int j = area.top; j < area.bottom; j++){
cell = i + j*Dungeon.level.width();
if (off[cell] > 0) {
if (cur[cell] > 0) {
int terr = Dungeon.level.map[cell];
if (terr == Terrain.EMPTY || terr == Terrain.GRASS ||
terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP ||

View File

@ -283,6 +283,12 @@ public class TimekeepersHourglass extends Artifact {
activeBuff = null;
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 {

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
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.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
@ -121,15 +122,20 @@ public class UnstableSpellbook extends Artifact {
scroll instanceof ScrollOfMagicMapping) && Random.Int(2) == 0)
//don't roll teleportation scrolls on boss floors
|| (scroll instanceof ScrollOfTeleportation && Dungeon.bossLevel())
//cannot roll transmutation
|| (scroll instanceof ScrollOfTransmutation));
scroll.anonymize();
curItem = scroll;
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())) {
final Scroll fScroll = scroll;
final ExploitHandler handler = Buff.affect(hero, ExploitHandler.class);
handler.scroll = scroll;
GameScene.show(new WndOptions(
Messages.get(this, "prompt"),
Messages.get(this, "read_empowered"),
@ -137,6 +143,7 @@ public class UnstableSpellbook extends Artifact {
Messages.get(ExoticScroll.regToExo.get(scroll.getClass()), "name")){
@Override
protected void onSelect(int index) {
handler.detach();
if (index == 1){
Scroll scroll = Reflection.newInstance(ExoticScroll.regToExo.get(fScroll.getClass()));
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
protected ArtifactBuff passiveBuff() {
return new bookRecharge();

View File

@ -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
public Item upgrade() {
if (!bundleRestoring) {
durability = MAX_DURABILITY;
if (quantity > 1) {
MissileWeapon upgraded = (MissileWeapon) split(1);
upgraded.parent = null;
@ -112,7 +113,6 @@ abstract public class MissileWeapon extends Weapon {
updateQuickslot();
return upgraded;
} else {
durability = MAX_DURABILITY;
super.upgrade();
Item similar = Dungeon.hero.belongings.getSimilar(this);

View File

@ -27,6 +27,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
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.NewTengu;
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++) {
if (maze[x][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 );
setTrap(new TenguDartTrap().hide(), cell);
CellEmitter.get(cell).burst(Speck.factory(Speck.LIGHT), 2);
@ -664,11 +668,12 @@ public class NewPrisonBossLevel extends Level {
int x = i % 7;
int y = i / 7;
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);
setTrap(new TenguDartTrap().hide(), cell);
CellEmitter.get(cell).burst(Speck.factory(Speck.LIGHT), 2);
} else {
}
}
}