diff --git a/core/src/main/assets/messages/windows/windows.properties b/core/src/main/assets/messages/windows/windows.properties index bfc155db7..32237a50a 100644 --- a/core/src/main/assets/messages/windows/windows.properties +++ b/core/src/main/assets/messages/windows/windows.properties @@ -74,6 +74,10 @@ windows.bosssettingwindows.boss_3 = 直面冰雪魔女 windows.bosssettingwindows.boss_4 = 直面矮人大师 windows.bosssettingwindows.boss_5 = 直面Yog-Zot +windows.bosssettingwindows.dm300=DM-300 +windows.bosssettingwindows.ice=冰雪魔女 + + windows.wndstartgame.title=选择一位英雄 windows.wndstartgame.start=开始游戏 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index f4dbe95d2..7d222e9b7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -385,17 +385,13 @@ public class Dungeon { } break; case 15: - if((Statistics.boss_enhance & 0x4) != 0) level = new CavesGirlDeadLevel(); - else - switch (Random.NormalIntRange(1,7)) { - case 1:case 2:case 3: - default: - level = new NewCavesBossLevel(); - break; - case 4:case 5: - level = new CaveTwoBossLevel(); - break; - } + if (SPDSettings.level3boss()==3){ + level = new CavesGirlDeadLevel(); + } else if (SPDSettings.level3boss()==2){ + level = new CaveTwoBossLevel(); + } else { + level = new NewCavesBossLevel(); + } break; case 16: case 17: @@ -465,17 +461,13 @@ public class Dungeon { level = new CavesLevel(); break; case 15: - if((Statistics.boss_enhance & 0x4) != 0) level = new CavesGirlDeadLevel(); - else - switch (Random.NormalIntRange(1,7)) { - case 1:case 2:case 3: case 4: case 5: - default: - level = new NewCavesBossLevel(); - break; - case 6:case 7: - level = new CaveTwoBossLevel(); - break; - } + if (SPDSettings.level3boss()==3){ + level = new CavesGirlDeadLevel(); + } else if (SPDSettings.level3boss()==2){ + level = new CaveTwoBossLevel(); + } else { + level = new NewCavesBossLevel(); + } break; case 16: case 17: diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java index 3624a899b..8aaffae37 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/SPDSettings.java @@ -47,6 +47,15 @@ public class SPDSettings extends GameSettings { public static int quickslots(){ return getInt( KEY_QUICKSLOTS, 4, Constants.MIN_QUICKSLOTS, Constants.MAX_QUICKSLOTS); } + + public static void level3boss( int value ){ + put( KEY_L3BOSS, value ); + } + + public static int level3boss(){ + return getInt( KEY_L3BOSS, 1, 1, 3); + } + private static final String DEBUG_REPORT = "debug_report"; public static boolean debugReport() { return getBoolean(DEBUG_REPORT,false); @@ -185,6 +194,7 @@ public class SPDSettings extends GameSettings { public static final String KEY_UI_SIZE = "full_ui"; public static final String KEY_QUICKSLOTS = "quickslots"; + public static final String KEY_L3BOSS = "bossl3"; public static final String KEY_FLIPTOOLBAR = "flipped_ui"; public static final String KEY_FLIPTAGS = "flip_tags"; public static final String KEY_BARMODE = "toolbar_mode"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CaveTwoBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CaveTwoBossLevel.java index 91d56eb3a..b3d5102ec 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CaveTwoBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CaveTwoBossLevel.java @@ -61,6 +61,7 @@ import com.watabou.utils.Random; import com.watabou.utils.Rect; import java.util.ArrayList; +import java.util.Objects; public class CaveTwoBossLevel extends Level { @@ -272,7 +273,7 @@ public class CaveTwoBossLevel extends Level { NewDM720 boss = new NewDM720(); boss.state = boss.WANDERING; do { - boss.pos = pointToCell(Random.element(mainArena.getPoints())); + boss.pos = pointToCell(Objects.requireNonNull(Random.element(mainArena.getPoints()))); } while (!openSpace[boss.pos] || map[boss.pos] == Terrain.EMPTY); GameScene.add( boss ); @@ -282,7 +283,7 @@ public class CaveTwoBossLevel extends Level { public void unseal() { super.unseal(); - //blobs.get(PylonEnergy.class).fullyClear(); + blobs.get(PylonEnergy.class).fullyClear(); set( entrance, Terrain.ENTRANCE ); int i = 14 + 13*width(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 7dfce1273..893f7a048 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -175,7 +175,7 @@ public class InterlevelScene extends PixelScene { fadeTime += 0.9f; //adds 1 second total //speed up transition when debugging } else if (DeviceCompat.isDebug()){ - fadeTime = 0.8f; + fadeTime = 0.1f; } SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/BossSettingWindows.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/BossSettingWindows.java index d10f1bc3e..b60831dc0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/BossSettingWindows.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/BossSettingWindows.java @@ -1,9 +1,11 @@ package com.shatteredpixel.shatteredpixeldungeon.windows; +import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.ui.CheckBox; +import com.shatteredpixel.shatteredpixeldungeon.ui.OptionSlider; import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock; import com.shatteredpixel.shatteredpixeldungeon.ui.Window; @@ -11,36 +13,51 @@ import java.util.ArrayList; public class BossSettingWindows extends Window { private static final int WIDTH = 120; + private static final int HEIGHT = 100; private static final int BOX_HEIGHT = 16; private static final int TTL_HEIGHT = 12; private static final int GAP= 2; private ArrayList cbs; - + OptionSlider level3; public BossSettingWindows(){ - resize(WIDTH, 1); + resize(WIDTH, HEIGHT); RenderedTextBlock rtb = PixelScene.renderTextBlock(Messages.get(this, "title"), TTL_HEIGHT - GAP); rtb.setPos(WIDTH/2f - rtb.width()/2, GAP); PixelScene.align(rtb); rtb.hardlight(0x00FF00); add(rtb); - float pos = TTL_HEIGHT + GAP; cbs = new ArrayList<>(); for(int i = 0; i<5; ++i){ CheckBox cb = new CheckBox(Messages.get(this, "boss_"+String.valueOf(i+1))); cb.setRect(GAP, pos, WIDTH - GAP * 2, BOX_HEIGHT); + if(i == 2){ + cb.setRect(GAP, 500, WIDTH - GAP * 2, BOX_HEIGHT); + } add(cb); cbs.add(cb); pos += BOX_HEIGHT + GAP; cb.checked((Statistics.boss_enhance & (1<0); cb.enable(Statistics.deepestFloor < (5+i*5)); } + level3 = new OptionSlider("", Messages.get(this, "dm300"), + Messages.get(this, "ice"), 1, 3) { + @Override + protected void onChange() { + SPDSettings.level3boss(getSelectedValue()); + } + }; + level3.setRect(GAP, 50, WIDTH - GAP * 2, BOX_HEIGHT); + level3.setSelectedValue(SPDSettings.level3boss()); + add(level3); - resize(WIDTH, (int) Math.floor(pos)); + resize(WIDTH, HEIGHT); } + + @Override public void onBackPressed() { Statistics.boss_enhance = 0; @@ -51,4 +68,5 @@ public class BossSettingWindows extends Window { } super.onBackPressed(); } + }