v0.9.2b: fixed various cases of tele effects placing onto traps

This commit is contained in:
Evan Debenham 2021-03-19 22:54:39 -04:00
parent f0996a2b85
commit 023a5972f0
6 changed files with 11 additions and 11 deletions

View File

@ -91,7 +91,7 @@ public class ScrollOfTeleportation extends Scroll {
return; return;
} }
int count = 10; int count = 20;
int pos; int pos;
do { do {
pos = Dungeon.level.randomRespawnCell( ch ); pos = Dungeon.level.randomRespawnCell( ch );

View File

@ -45,14 +45,14 @@ public class PhaseShift extends TargetedSpell {
if (ch == hero){ if (ch == hero){
ScrollOfTeleportation.teleportHero(curUser); ScrollOfTeleportation.teleportHero(curUser);
} else if (ch != null) { } else if (ch != null) {
int count = 10; int count = 20;
int pos; int pos;
do { do {
pos = Dungeon.level.randomRespawnCell( hero ); pos = Dungeon.level.randomRespawnCell( hero );
if (count-- <= 0) { if (count-- <= 0) {
break; break;
} }
} while (pos == -1); } while (pos == -1 || Dungeon.level.secret[pos]);
if (pos == -1 || Dungeon.bossLevel()) { if (pos == -1 || Dungeon.bossLevel()) {

View File

@ -39,14 +39,14 @@ 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 = 10; int count = 20;
int newPos; int newPos;
do { do {
newPos = Dungeon.level.randomRespawnCell( defender ); newPos = Dungeon.level.randomRespawnCell( defender );
if (count-- <= 0) { if (count-- <= 0) {
break; break;
} }
} while (newPos == -1); } while (newPos == -1 || Dungeon.level.secret[newPos]);
if (newPos != -1 && !Dungeon.bossLevel()) { if (newPos != -1 && !Dungeon.bossLevel()) {

View File

@ -54,14 +54,14 @@ public class TeleportationTrap extends Trap {
if (ch instanceof Hero) { if (ch instanceof Hero) {
ScrollOfTeleportation.teleportHero((Hero) ch); ScrollOfTeleportation.teleportHero((Hero) ch);
} else { } else {
int count = 10; int count = 20;
int pos; int pos;
do { do {
pos = Dungeon.level.randomRespawnCell( ch ); pos = Dungeon.level.randomRespawnCell( ch );
if (count-- <= 0) { if (count-- <= 0) {
break; break;
} }
} while (pos == -1); } while (pos == -1 || Dungeon.level.secret[pos]);
if (pos == -1 || Dungeon.bossLevel()) { if (pos == -1 || Dungeon.bossLevel()) {

View File

@ -60,14 +60,14 @@ public class WarpingTrap extends Trap {
Dungeon.observe(); Dungeon.observe();
} else { } else {
int count = 10; int count = 20;
int pos; int pos;
do { do {
pos = Dungeon.level.randomRespawnCell( ch ); pos = Dungeon.level.randomRespawnCell( ch );
if (count-- <= 0) { if (count-- <= 0) {
break; break;
} }
} while (pos == -1); } while (pos == -1 || Dungeon.level.secret[pos]);
if (pos == -1 || Dungeon.bossLevel()) { if (pos == -1 || Dungeon.bossLevel()) {

View File

@ -77,14 +77,14 @@ public class Fadeleaf extends Plant {
if (!Dungeon.bossLevel()) { if (!Dungeon.bossLevel()) {
int count = 10; int count = 20;
int newPos; int newPos;
do { do {
newPos = Dungeon.level.randomRespawnCell(ch); newPos = Dungeon.level.randomRespawnCell(ch);
if (count-- <= 0) { if (count-- <= 0) {
break; break;
} }
} while (newPos == -1); } while (newPos == -1 || Dungeon.level.secret[newPos]);
if (newPos != -1) { if (newPos != -1) {