v1.1.0: fixed some teleport effects still not working on boss levels

This commit is contained in:
Evan Debenham 2021-12-06 15:21:40 -05:00
parent d99e42eec5
commit f0a1ae8d45
4 changed files with 8 additions and 45 deletions

View File

@ -125,8 +125,6 @@ public class UnstableSpellbook extends Artifact {
||((scroll instanceof ScrollOfIdentify ||
scroll instanceof ScrollOfRemoveCurse ||
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));

View File

@ -61,9 +61,6 @@ public class ScrollOfTeleportation extends Scroll {
}
identify();
if (!Dungeon.bossLevel()) {
readAnimation();
}
}
public static boolean teleportToLocation(Char ch, int pos){

View File

@ -46,31 +46,11 @@ public class PhaseShift extends TargetedSpell {
//TODO probably want this to not work on the hero for balance reasons?
ScrollOfTeleportation.teleportChar(curUser);
} else if (ch != null) {
int count = 20;
int pos;
do {
pos = Dungeon.level.randomRespawnCell( hero );
if (count-- <= 0) {
break;
}
} while (pos == -1 || Dungeon.level.secret[pos]);
if (ScrollOfTeleportation.teleportChar(ch)){
if (pos == -1 || Dungeon.bossLevel()) {
GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") );
} else if (ch.properties().contains(Char.Property.IMMOVABLE)) {
GLog.w( Messages.get(this, "tele_fail") );
} else {
ch.pos = pos;
if (ch instanceof Mob && ((Mob) ch).state == ((Mob) ch).HUNTING){
((Mob) ch).state = ((Mob) ch).WANDERING;
}
ch.sprite.place(ch.pos);
ch.sprite.visible = Dungeon.level.heroFOV[pos];
}
}

View File

@ -26,6 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.watabou.utils.Random;
@ -39,30 +41,16 @@ public class Displacing extends Weapon.Enchantment {
float procChance = 1/12f * procChanceMultiplier(attacker);
if (Random.Float() < procChance && !defender.properties().contains(Char.Property.IMMOVABLE)){
int count = 20;
int newPos;
do {
newPos = Dungeon.level.randomRespawnCell( defender );
if (count-- <= 0) {
break;
}
} while (newPos == -1 || Dungeon.level.secret[newPos]);
if (newPos != -1 && !Dungeon.bossLevel()) {
if (Dungeon.level.heroFOV[defender.pos]) {
CellEmitter.get( defender.pos ).start( Speck.factory( Speck.LIGHT ), 0.2f, 3 );
int oldpos = defender.pos;
if (ScrollOfTeleportation.teleportChar(defender)){
if (Dungeon.level.heroFOV[oldpos]) {
CellEmitter.get( oldpos ).start( Speck.factory( Speck.LIGHT ), 0.2f, 3 );
}
defender.pos = newPos;
if (defender instanceof Mob && ((Mob) defender).state == ((Mob) defender).HUNTING){
((Mob) defender).state = ((Mob) defender).WANDERING;
}
defender.sprite.place( defender.pos );
defender.sprite.visible = Dungeon.level.heroFOV[defender.pos];
return 0;
}
}