v0.2.3: Hourglass bugfixes & some tweaks.
This commit is contained in:
@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
@@ -257,6 +258,13 @@ public abstract class Mob extends Char {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSpriteState() {
|
||||||
|
super.updateSpriteState();
|
||||||
|
if (Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class) != null)
|
||||||
|
sprite.add( CharSprite.State.PARALYSED );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void move( int step ) {
|
public void move( int step ) {
|
||||||
super.move( step );
|
super.move( step );
|
||||||
|
|||||||
+10
-3
@@ -253,13 +253,21 @@ public class TimekeepersHourglass extends Artifact {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delayedPress(int cell){
|
public void setDelayedPress(int cell){
|
||||||
if (!presses.contains(cell))
|
if (!presses.contains(cell))
|
||||||
presses.add(cell);
|
presses.add(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void triggerPresses(){
|
||||||
|
for (int cell : presses)
|
||||||
|
Dungeon.level.press(cell, null);
|
||||||
|
|
||||||
|
presses = new ArrayList<Integer>();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean attachTo(Char target) {
|
public boolean attachTo(Char target) {
|
||||||
|
if (Dungeon.level != null)
|
||||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0]))
|
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0]))
|
||||||
mob.sprite.add(CharSprite.State.PARALYSED);
|
mob.sprite.add(CharSprite.State.PARALYSED);
|
||||||
GameScene.freezeEmitters = true;
|
GameScene.freezeEmitters = true;
|
||||||
@@ -268,8 +276,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void detach(){
|
public void detach(){
|
||||||
for (int cell : presses)
|
triggerPresses();
|
||||||
Dungeon.level.press(cell, null);
|
|
||||||
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0]))
|
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0]))
|
||||||
mob.sprite.remove(CharSprite.State.PARALYSED);
|
mob.sprite.remove(CharSprite.State.PARALYSED);
|
||||||
GameScene.freezeEmitters = false;
|
GameScene.freezeEmitters = false;
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ public abstract class Level implements Bundlable {
|
|||||||
Level.set( cell, Terrain.discover( map[cell] ) );
|
Level.set( cell, Terrain.discover( map[cell] ) );
|
||||||
GameScene.updateMap( cell );
|
GameScene.updateMap( cell );
|
||||||
|
|
||||||
timeFreeze.delayedPress(cell);
|
timeFreeze.setDelayedPress( cell );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -298,6 +298,8 @@ public class GameScene extends PixelScene {
|
|||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
|
|
||||||
|
freezeEmitters = false;
|
||||||
|
|
||||||
scene = null;
|
scene = null;
|
||||||
Badges.saveGlobal();
|
Badges.saveGlobal();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user