v2.1.3: added a slider for screen shake in the game settings (0x to 2x)
This commit is contained in:
@@ -56,6 +56,7 @@ public class SPDSettings extends GameSettings {
|
||||
public static final String KEY_BRIGHTNESS = "brightness";
|
||||
public static final String KEY_GRID = "visual_grid";
|
||||
public static final String KEY_CAMERA_FOLLOW= "camera_follow";
|
||||
public static final String KEY_SCREEN_SHAKE = "screen_shake";
|
||||
|
||||
public static void fullscreen( boolean value ) {
|
||||
put( KEY_FULLSCREEN, value );
|
||||
@@ -119,12 +120,19 @@ public class SPDSettings extends GameSettings {
|
||||
|
||||
public static void cameraFollow( int value ){
|
||||
put( KEY_CAMERA_FOLLOW, value );
|
||||
GameScene.updateMap();
|
||||
}
|
||||
|
||||
public static int cameraFollow() {
|
||||
return getInt( KEY_CAMERA_FOLLOW, 4, 1, 4 );
|
||||
}
|
||||
|
||||
public static void screenShake( int value ){
|
||||
put( KEY_SCREEN_SHAKE, value );
|
||||
}
|
||||
|
||||
public static int screenShake() {
|
||||
return getInt( KEY_SCREEN_SHAKE, 2, 0, 4 );
|
||||
}
|
||||
|
||||
//Interface
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndCombo;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.Visual;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
@@ -475,7 +474,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
||||
if (!Dungeon.level.passable[leapPos] && !(target.flying && Dungeon.level.avoid[leapPos])){
|
||||
GLog.w(Messages.get(Combo.class, "bad_target"));
|
||||
} else if (Dungeon.hero.rooted) {
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
GLog.w(Messages.get(Combo.class, "bad_target"));
|
||||
} else {
|
||||
Dungeon.hero.busy();
|
||||
|
||||
@@ -50,7 +50,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndMonkAbilities;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.Visual;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
@@ -482,7 +481,7 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
|
||||
}
|
||||
|
||||
if (Dungeon.hero.rooted){
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
GLog.w(Messages.get(MeleeWeapon.class, "ability_bad_position"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.Visual;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
@@ -308,7 +307,7 @@ public class Preparation extends Buff implements ActionIndicator.Action {
|
||||
|
||||
if (dest == -1 || PathFinder.distance[dest] == Integer.MAX_VALUE || Dungeon.hero.rooted){
|
||||
GLog.w(Messages.get(Preparation.class, "out_of_reach"));
|
||||
if (Dungeon.hero.rooted) Camera.main.shake( 1, 1f );
|
||||
if (Dungeon.hero.rooted) PixelScene.shake( 1, 1f );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.AlchemyScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.SurfaceScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
@@ -157,7 +158,6 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndResurrect;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndTradeItem;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
@@ -1059,7 +1059,7 @@ public class Hero extends Char {
|
||||
switch (heap.type) {
|
||||
case TOMB:
|
||||
Sample.INSTANCE.play( Assets.Sounds.TOMB );
|
||||
Camera.main.shake( 1, 0.5f );
|
||||
PixelScene.shake( 1, 0.5f );
|
||||
break;
|
||||
case SKELETON:
|
||||
case REMAINS:
|
||||
@@ -1138,7 +1138,7 @@ public class Hero extends Char {
|
||||
LevelTransition transition = Dungeon.level.getTransition(stairs);
|
||||
|
||||
if (rooted) {
|
||||
Camera.main.shake(1, 1f);
|
||||
PixelScene.shake(1, 1f);
|
||||
ready();
|
||||
return false;
|
||||
} else if (!Dungeon.level.locked && transition != null && transition.inside(pos)) {
|
||||
@@ -1489,7 +1489,7 @@ public class Hero extends Char {
|
||||
return false;
|
||||
|
||||
if (rooted) {
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1600,7 +1600,7 @@ public class Hero extends Char {
|
||||
|
||||
Char ch = Actor.findChar( cell );
|
||||
Heap heap = Dungeon.level.heaps.get( cell );
|
||||
|
||||
|
||||
if (Dungeon.level.map[cell] == Terrain.ALCHEMY && cell != pos) {
|
||||
|
||||
curAction = new HeroAction.Alchemy( cell );
|
||||
|
||||
@@ -41,12 +41,12 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -137,13 +137,13 @@ public class Challenge extends ArmorAbility {
|
||||
|
||||
if (reachable[blinkpos] == Integer.MAX_VALUE){
|
||||
GLog.w(Messages.get(this, "unreachable_target"));
|
||||
if (hero.rooted) Camera.main.shake( 1, 1f );
|
||||
if (hero.rooted) PixelScene.shake( 1, 1f );
|
||||
return;
|
||||
}
|
||||
|
||||
if (Dungeon.level.distance(blinkpos, targetCh.pos) > 5){
|
||||
GLog.w(Messages.get(this, "distant_target"));
|
||||
if (hero.rooted) Camera.main.shake( 1, 1f );
|
||||
if (hero.rooted) PixelScene.shake( 1, 1f );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.tweeners.AlphaTweener;
|
||||
import com.watabou.noosa.tweeners.Delayer;
|
||||
@@ -85,7 +85,7 @@ public class Feint extends ArmorAbility {
|
||||
}
|
||||
|
||||
if (Dungeon.hero.rooted){
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
GLog.w(Messages.get(this, "bad_location"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MobSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -88,7 +88,7 @@ public class SmokeBomb extends ArmorAbility {
|
||||
if (target != null) {
|
||||
|
||||
if (target != hero.pos && hero.rooted){
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
@@ -68,7 +68,7 @@ public class HeroicLeap extends ArmorAbility {
|
||||
if (target != null) {
|
||||
|
||||
if (hero.rooted){
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class HeroicLeap extends ArmorAbility {
|
||||
}
|
||||
|
||||
WandOfBlastWave.BlastWave.blast(dest);
|
||||
Camera.main.shake(2, 0.5f);
|
||||
PixelScene.shake(2, 0.5f);
|
||||
|
||||
Invisibility.dispel();
|
||||
hero.spendAndNext(Actor.TICK);
|
||||
|
||||
@@ -40,9 +40,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ConeAOE;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.Random;
|
||||
@@ -99,7 +99,7 @@ public class Shockwave extends ArmorAbility {
|
||||
|
||||
hero.sprite.zap(target);
|
||||
Sample.INSTANCE.play(Assets.Sounds.BLAST, 1f, 0.5f);
|
||||
Camera.main.shake(2, 0.5f);
|
||||
PixelScene.shake(2, 0.5f);
|
||||
//final zap at 2/3 distance, for timing of the actual effect
|
||||
MagicMissile.boltFromChar(hero.sprite.parent,
|
||||
MagicMissile.FORCE_CONE,
|
||||
|
||||
@@ -30,10 +30,10 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.DM100Sprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
@@ -106,7 +106,7 @@ public class DM100 extends Mob implements Callback {
|
||||
|
||||
if (enemy == Dungeon.hero) {
|
||||
|
||||
Camera.main.shake( 2, 0.3f );
|
||||
PixelScene.shake( 2, 0.3f );
|
||||
|
||||
if (!enemy.isAlive()) {
|
||||
Badges.validateDeathFromEnemyMagic();
|
||||
|
||||
@@ -59,12 +59,12 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ConeAOE;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.DM300Sprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.watabou.utils.Bundle;
|
||||
@@ -323,7 +323,7 @@ public class DM300 extends Mob {
|
||||
public void move(int step, boolean travelling) {
|
||||
super.move(step, travelling);
|
||||
|
||||
if (travelling) Camera.main.shake( supercharged ? 3 : 1, 0.25f );
|
||||
if (travelling) PixelScene.shake( supercharged ? 3 : 1, 0.25f );
|
||||
|
||||
if (Dungeon.level.map[step] == Terrain.INACTIVE_TRAP && state == HUNTING) {
|
||||
|
||||
@@ -627,7 +627,7 @@ public class DM300 extends Mob {
|
||||
if (bestpos != pos) {
|
||||
move(bestpos);
|
||||
}
|
||||
Camera.main.shake( 5, 1f );
|
||||
PixelScene.shake( 5, 1f );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -686,7 +686,7 @@ public class DM300 extends Mob {
|
||||
}
|
||||
}
|
||||
|
||||
Camera.main.shake( 3, 0.7f );
|
||||
PixelScene.shake( 3, 0.7f );
|
||||
Sample.INSTANCE.play(Assets.Sounds.ROCKS);
|
||||
|
||||
detach();
|
||||
|
||||
@@ -38,11 +38,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.quest.GooBlob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GooSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BossHealthBar;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.GameMath;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -160,7 +160,7 @@ public class Goo extends Mob {
|
||||
}
|
||||
|
||||
if (pumpedUp > 0) {
|
||||
Camera.main.shake( 3, 0.2f );
|
||||
PixelScene.shake( 3, 0.2f );
|
||||
}
|
||||
|
||||
return damage;
|
||||
|
||||
@@ -28,9 +28,9 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class Entanglement extends Glyph {
|
||||
@@ -49,7 +49,7 @@ public class Entanglement extends Glyph {
|
||||
|
||||
Buff.affect( defender, Earthroot.Armor.class ).level( Math.round((5 + 2 * level)*powerMulti) );
|
||||
CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
|
||||
Camera.main.shake( 1, 0.4f );
|
||||
PixelScene.shake( 1, 0.4f );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -207,7 +207,7 @@ public class EtherealChains extends Artifact {
|
||||
|
||||
//don't pull if rooted
|
||||
if (hero.rooted){
|
||||
Camera.main.shake( 1, 1f );
|
||||
PixelScene.shake( 1, 1f );
|
||||
GLog.w( Messages.get(EtherealChains.class, "rooted") );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,11 +35,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocki
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -74,7 +74,7 @@ public class WandOfLightning extends DamageWand {
|
||||
if (Dungeon.level.water[bolt.collisionPos]) multiplier = 1f;
|
||||
|
||||
for (Char ch : affected){
|
||||
if (ch == Dungeon.hero) Camera.main.shake( 2, 0.3f );
|
||||
if (ch == Dungeon.hero) PixelScene.shake( 2, 0.3f );
|
||||
ch.sprite.centerEmitter().burst( SparkParticle.FACTORY, 3 );
|
||||
ch.sprite.flash();
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
import com.watabou.utils.PathFinder;
|
||||
@@ -90,7 +90,7 @@ public class Rapier extends MeleeWeapon {
|
||||
if (hero.rooted || Dungeon.level.distance(hero.pos, target) < 2
|
||||
|| Dungeon.level.distance(hero.pos, target)-1 > wep.reachFactor(hero)){
|
||||
GLog.w(Messages.get(wep, "ability_bad_position"));
|
||||
if (hero.rooted) Camera.main.shake( 1, 1f );
|
||||
if (hero.rooted) PixelScene.shake( 1, 1f );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.painters.CavesPainter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.PylonSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Group;
|
||||
import com.watabou.noosa.Image;
|
||||
@@ -295,7 +295,7 @@ public class CavesBossLevel extends Level {
|
||||
Dungeon.observe();
|
||||
|
||||
CellEmitter.get( entrance ).start( Speck.factory( Speck.ROCK ), 0.07f, 10 );
|
||||
Camera.main.shake( 3, 0.7f );
|
||||
PixelScene.shake( 3, 0.7f );
|
||||
Sample.INSTANCE.play( Assets.Sounds.ROCKS );
|
||||
|
||||
DM300 boss = new DM300();
|
||||
|
||||
@@ -38,10 +38,10 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.WeakFloorRo
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MobSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
@@ -138,7 +138,7 @@ public class Chasm implements Hero.Doom {
|
||||
return;
|
||||
}
|
||||
|
||||
Camera.main.shake( 4, 1f );
|
||||
PixelScene.shake( 4, 1f );
|
||||
|
||||
Dungeon.level.occupyCell(hero );
|
||||
Buff.prolong( hero, Cripple.class, Cripple.DURATION );
|
||||
|
||||
@@ -32,9 +32,9 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Point;
|
||||
@@ -108,7 +108,7 @@ public class RockfallTrap extends Trap {
|
||||
}
|
||||
|
||||
if (seen){
|
||||
Camera.main.shake(3, 0.7f);
|
||||
PixelScene.shake(3, 0.7f);
|
||||
Sample.INSTANCE.play(Assets.Sounds.ROCKS);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
public class Earthroot extends Plant {
|
||||
@@ -55,7 +55,7 @@ public class Earthroot extends Plant {
|
||||
|
||||
if (Dungeon.level.heroFOV[pos]) {
|
||||
CellEmitter.bottom( pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
|
||||
Camera.main.shake( 1, 0.4f );
|
||||
PixelScene.shake( 1, 0.4f );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,6 +385,11 @@ public class PixelScene extends Scene {
|
||||
});
|
||||
}
|
||||
|
||||
public static void shake( float magnitude, float duration){
|
||||
magnitude *= SPDSettings.screenShake();
|
||||
Camera.main.shake(magnitude, duration);
|
||||
}
|
||||
|
||||
protected static class Fader extends ColorBlock {
|
||||
|
||||
private static float FADE_TIME = 1f;
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DM300;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
@@ -107,7 +107,7 @@ public class DM300Sprite extends MobSprite {
|
||||
turnTo( ch.pos , cell );
|
||||
play( slam );
|
||||
Sample.INSTANCE.play( Assets.Sounds.ROCKS );
|
||||
Camera.main.shake( 3, 0.7f );
|
||||
PixelScene.shake( 3, 0.7f );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,8 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
@@ -140,7 +140,7 @@ public abstract class FistSprite extends MobSprite {
|
||||
public void onComplete( Animation anim ) {
|
||||
super.onComplete( anim );
|
||||
if (anim == attack) {
|
||||
Camera.main.shake( 4, 0.2f );
|
||||
PixelScene.shake( 4, 0.2f );
|
||||
} else if (anim == zap) {
|
||||
idle();
|
||||
}
|
||||
|
||||
@@ -227,6 +227,7 @@ public class WndSettings extends WndTabbed {
|
||||
OptionSlider optBrightness;
|
||||
OptionSlider optVisGrid;
|
||||
OptionSlider optFollowIntensity;
|
||||
OptionSlider optScreenShake;
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
@@ -331,6 +332,16 @@ public class WndSettings extends WndTabbed {
|
||||
optFollowIntensity.setSelectedValue(SPDSettings.cameraFollow());
|
||||
add(optFollowIntensity);
|
||||
|
||||
optScreenShake = new OptionSlider(Messages.get(this, "screenshake"),
|
||||
Messages.get(this, "off"), Messages.get(this, "high"), 0, 4) {
|
||||
@Override
|
||||
protected void onChange() {
|
||||
SPDSettings.screenShake(getSelectedValue());
|
||||
}
|
||||
};
|
||||
optScreenShake.setSelectedValue(SPDSettings.screenShake());
|
||||
add(optScreenShake);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,14 +386,18 @@ public class WndSettings extends WndTabbed {
|
||||
if (width > 200){
|
||||
optBrightness.setRect(0, bottom + GAP, width/2-GAP/2, SLIDER_HEIGHT);
|
||||
optVisGrid.setRect(optBrightness.right() + GAP, optBrightness.top(), width/2-GAP/2, SLIDER_HEIGHT);
|
||||
|
||||
optFollowIntensity.setRect(0, optVisGrid.bottom() + GAP, width/2-GAP/2, SLIDER_HEIGHT);
|
||||
optScreenShake.setRect(optFollowIntensity.right() + GAP, optFollowIntensity.top(), width/2-GAP/2, SLIDER_HEIGHT);
|
||||
} else {
|
||||
optBrightness.setRect(0, bottom + GAP, width, SLIDER_HEIGHT);
|
||||
optVisGrid.setRect(0, optBrightness.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
|
||||
optFollowIntensity.setRect(0, optVisGrid.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
optScreenShake.setRect(0, optFollowIntensity.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
}
|
||||
|
||||
optFollowIntensity.setRect(0, optVisGrid.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
|
||||
height = optFollowIntensity.bottom();
|
||||
height = optScreenShake.bottom();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user