v1.1.0: fixed some teleport effects still not working on boss levels
This commit is contained in:
parent
d99e42eec5
commit
f0a1ae8d45
|
@ -125,8 +125,6 @@ public class UnstableSpellbook extends Artifact {
|
||||||
||((scroll instanceof ScrollOfIdentify ||
|
||((scroll instanceof ScrollOfIdentify ||
|
||||||
scroll instanceof ScrollOfRemoveCurse ||
|
scroll instanceof ScrollOfRemoveCurse ||
|
||||||
scroll instanceof ScrollOfMagicMapping) && Random.Int(2) == 0)
|
scroll instanceof ScrollOfMagicMapping) && Random.Int(2) == 0)
|
||||||
//don't roll teleportation scrolls on boss floors
|
|
||||||
|| (scroll instanceof ScrollOfTeleportation && Dungeon.bossLevel())
|
|
||||||
//cannot roll transmutation
|
//cannot roll transmutation
|
||||||
|| (scroll instanceof ScrollOfTransmutation));
|
|| (scroll instanceof ScrollOfTransmutation));
|
||||||
|
|
||||||
|
|
|
@ -61,9 +61,6 @@ public class ScrollOfTeleportation extends Scroll {
|
||||||
}
|
}
|
||||||
identify();
|
identify();
|
||||||
|
|
||||||
if (!Dungeon.bossLevel()) {
|
|
||||||
readAnimation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean teleportToLocation(Char ch, int pos){
|
public static boolean teleportToLocation(Char ch, int pos){
|
||||||
|
|
|
@ -46,31 +46,11 @@ public class PhaseShift extends TargetedSpell {
|
||||||
//TODO probably want this to not work on the hero for balance reasons?
|
//TODO probably want this to not work on the hero for balance reasons?
|
||||||
ScrollOfTeleportation.teleportChar(curUser);
|
ScrollOfTeleportation.teleportChar(curUser);
|
||||||
} else if (ch != null) {
|
} else if (ch != null) {
|
||||||
int count = 20;
|
if (ScrollOfTeleportation.teleportChar(ch)){
|
||||||
int pos;
|
|
||||||
do {
|
|
||||||
pos = Dungeon.level.randomRespawnCell( hero );
|
|
||||||
if (count-- <= 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (pos == -1 || Dungeon.level.secret[pos]);
|
|
||||||
|
|
||||||
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){
|
if (ch instanceof Mob && ((Mob) ch).state == ((Mob) ch).HUNTING){
|
||||||
((Mob) ch).state = ((Mob) ch).WANDERING;
|
((Mob) ch).state = ((Mob) ch).WANDERING;
|
||||||
}
|
}
|
||||||
ch.sprite.place(ch.pos);
|
|
||||||
ch.sprite.visible = Dungeon.level.heroFOV[pos];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
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.items.weapon.Weapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
@ -39,30 +41,16 @@ public class Displacing extends Weapon.Enchantment {
|
||||||
|
|
||||||
float procChance = 1/12f * procChanceMultiplier(attacker);
|
float procChance = 1/12f * procChanceMultiplier(attacker);
|
||||||
if (Random.Float() < procChance && !defender.properties().contains(Char.Property.IMMOVABLE)){
|
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()) {
|
int oldpos = defender.pos;
|
||||||
|
if (ScrollOfTeleportation.teleportChar(defender)){
|
||||||
if (Dungeon.level.heroFOV[defender.pos]) {
|
if (Dungeon.level.heroFOV[oldpos]) {
|
||||||
CellEmitter.get( defender.pos ).start( Speck.factory( Speck.LIGHT ), 0.2f, 3 );
|
CellEmitter.get( oldpos ).start( Speck.factory( Speck.LIGHT ), 0.2f, 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
defender.pos = newPos;
|
|
||||||
if (defender instanceof Mob && ((Mob) defender).state == ((Mob) defender).HUNTING){
|
if (defender instanceof Mob && ((Mob) defender).state == ((Mob) defender).HUNTING){
|
||||||
((Mob) defender).state = ((Mob) defender).WANDERING;
|
((Mob) defender).state = ((Mob) defender).WANDERING;
|
||||||
}
|
}
|
||||||
defender.sprite.place( defender.pos );
|
|
||||||
defender.sprite.visible = Dungeon.level.heroFOV[defender.pos];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user