v0.9.4: moving between floors now disarms pressed traps, instead of ending time freeze. Warping beacon also now dispells invis after moving the hero.
This commit is contained in:
parent
a0b6e77af2
commit
74762c158f
|
@ -993,10 +993,10 @@ public class Hero extends Char {
|
||||||
|
|
||||||
curAction = null;
|
curAction = null;
|
||||||
|
|
||||||
Buff buff = buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
InterlevelScene.mode = InterlevelScene.Mode.DESCEND;
|
||||||
Game.switchScene( InterlevelScene.class );
|
Game.switchScene( InterlevelScene.class );
|
||||||
|
@ -1046,10 +1046,10 @@ public class Hero extends Char {
|
||||||
|
|
||||||
curAction = null;
|
curAction = null;
|
||||||
|
|
||||||
Buff buff = buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
|
InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
|
||||||
Game.switchScene( InterlevelScene.class );
|
Game.switchScene( InterlevelScene.class );
|
||||||
|
|
|
@ -112,7 +112,6 @@ public class WarpBeacon extends ArmorAbility {
|
||||||
if (tracker.depth == Dungeon.depth){
|
if (tracker.depth == Dungeon.depth){
|
||||||
Char existing = Actor.findChar(tracker.pos);
|
Char existing = Actor.findChar(tracker.pos);
|
||||||
|
|
||||||
Invisibility.dispel();
|
|
||||||
ScrollOfTeleportation.appear(hero, tracker.pos);
|
ScrollOfTeleportation.appear(hero, tracker.pos);
|
||||||
|
|
||||||
if (existing != null && existing != hero){
|
if (existing != null && existing != hero){
|
||||||
|
@ -153,6 +152,7 @@ public class WarpBeacon extends ArmorAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Invisibility.dispel();
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -162,11 +162,11 @@ public class WarpBeacon extends ArmorAbility {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TimekeepersHourglass.timeFreeze timeFreeze = hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
|
Swiftthistle.TimeBubble timeBubble = hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
Invisibility.dispel();
|
Invisibility.dispel();
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
|
||||||
if (buff != null) buff.detach();
|
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
|
||||||
if (buff != null) buff.detach();
|
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||||
InterlevelScene.returnDepth = tracker.depth;
|
InterlevelScene.returnDepth = tracker.depth;
|
||||||
|
|
|
@ -177,10 +177,10 @@ public class LloydsBeacon extends Artifact {
|
||||||
GameScene.updateFog();
|
GameScene.updateFog();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||||
InterlevelScene.returnDepth = returnDepth;
|
InterlevelScene.returnDepth = returnDepth;
|
||||||
|
|
|
@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
|
@ -334,13 +335,22 @@ public class TimekeepersHourglass extends Artifact {
|
||||||
presses.add(cell);
|
presses.add(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void triggerPresses(){
|
public void triggerPresses(){
|
||||||
for (int cell : presses)
|
for (int cell : presses)
|
||||||
Dungeon.level.pressCell(cell);
|
Dungeon.level.pressCell(cell);
|
||||||
|
|
||||||
presses = new ArrayList<>();
|
presses = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void disarmPressedTraps(){
|
||||||
|
for (int cell : presses){
|
||||||
|
Trap t = Dungeon.level.traps.get(cell);
|
||||||
|
if (t != null) t.disarm();
|
||||||
|
}
|
||||||
|
|
||||||
|
presses = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach(){
|
public void detach(){
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
|
|
|
@ -50,10 +50,10 @@ public class ScrollOfPassage extends ExoticScroll {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||||
InterlevelScene.returnDepth = Math.max(1, (Dungeon.depth - 1 - (Dungeon.depth-2)%5));
|
InterlevelScene.returnDepth = Math.max(1, (Dungeon.depth - 1 - (Dungeon.depth-2)%5));
|
||||||
|
|
|
@ -142,10 +142,10 @@ public class BeaconOfReturning extends Spell {
|
||||||
GameScene.updateFog();
|
GameScene.updateFog();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||||
InterlevelScene.returnDepth = returnDepth;
|
InterlevelScene.returnDepth = returnDepth;
|
||||||
|
|
|
@ -299,11 +299,10 @@ public class CursedWand {
|
||||||
for (int i = 1; i < Dungeon.depth; i++) depths[i-1] = i;
|
for (int i = 1; i < Dungeon.depth; i++) depths[i-1] = i;
|
||||||
int depth = 1+Random.chances(depths);
|
int depth = 1+Random.chances(depths);
|
||||||
|
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
|
Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
if (buff != null) buff.detach();
|
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||||
InterlevelScene.returnDepth = depth;
|
InterlevelScene.returnDepth = depth;
|
||||||
|
|
|
@ -82,10 +82,10 @@ public class Chasm implements Hero.Doom {
|
||||||
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.FALLING );
|
Sample.INSTANCE.play( Assets.Sounds.FALLING );
|
||||||
|
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
if (Dungeon.hero.isAlive()) {
|
if (Dungeon.hero.isAlive()) {
|
||||||
Dungeon.hero.interrupt();
|
Dungeon.hero.interrupt();
|
||||||
|
|
|
@ -59,10 +59,10 @@ public class Fadeleaf extends Plant {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Buff buff = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeFreeze != null) timeFreeze.disarmPressedTraps();
|
||||||
buff = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||||
if (buff != null) buff.detach();
|
if (timeBubble != null) timeBubble.disarmPressedTraps();
|
||||||
|
|
||||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||||
InterlevelScene.returnDepth = Math.max(1, (Dungeon.depth - 1));
|
InterlevelScene.returnDepth = Math.max(1, (Dungeon.depth - 1));
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
@ -114,13 +115,24 @@ public class Swiftthistle extends Plant {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDelayedPress(int cell){
|
public void setDelayedPress(int cell){
|
||||||
if (!presses.contains(cell))
|
if (!presses.contains(cell)) {
|
||||||
presses.add(cell);
|
presses.add(cell);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void triggerPresses(){
|
public void triggerPresses() {
|
||||||
for (int cell : presses)
|
for (int cell : presses) {
|
||||||
Dungeon.level.pressCell(cell);
|
Dungeon.level.pressCell(cell);
|
||||||
|
}
|
||||||
|
|
||||||
|
presses = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disarmPressedTraps(){
|
||||||
|
for (int cell : presses){
|
||||||
|
Trap t = Dungeon.level.traps.get(cell);
|
||||||
|
if (t != null) t.disarm();
|
||||||
|
}
|
||||||
|
|
||||||
presses = new ArrayList<>();
|
presses = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user