Update V0.6.2.0-Beta1
|
@ -53,6 +53,32 @@ public class TextInput extends Component {
|
|||
|
||||
private NinePatch bg;
|
||||
|
||||
public void copyToClipboard(){
|
||||
if (textField.getSelection().isEmpty()) {
|
||||
textField.selectAll();
|
||||
}
|
||||
|
||||
textField.copy();
|
||||
}
|
||||
|
||||
public void pasteFromClipboard(){
|
||||
String contents = Gdx.app.getClipboard().getContents();
|
||||
if (contents == null) return;
|
||||
|
||||
if (!textField.getSelection().isEmpty()){
|
||||
//just use cut, but override clipboard
|
||||
textField.cut();
|
||||
Gdx.app.getClipboard().setContents(contents);
|
||||
}
|
||||
|
||||
String existing = textField.getText();
|
||||
int cursorIdx = textField.getCursorPosition();
|
||||
|
||||
textField.setText(existing.substring(0, cursorIdx) + contents + existing.substring(cursorIdx));
|
||||
textField.setCursorPosition(cursorIdx + contents.length());
|
||||
}
|
||||
|
||||
|
||||
public TextInput( NinePatch bg, boolean multiline, int size ){
|
||||
super();
|
||||
this.bg = bg;
|
||||
|
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
@ -2094,3 +2094,8 @@ actors.char.kill=%s杀害了你…
|
|||
actors.char.defeat=你击败了%s。
|
||||
actors.char.def_verb=闪避
|
||||
actors.char.invulnerable=无敌
|
||||
|
||||
|
||||
levels.features.chasm.name=
|
||||
actors.blobs.toxicgas.name=
|
||||
actors.buffs.hunger.name=
|
||||
|
|
|
@ -521,6 +521,9 @@ items.armor.mailarmor.desc=由金属链环环相扣制成的一套结实又不
|
|||
items.armor.platearmor.name=板甲
|
||||
items.armor.platearmor.desc=厚重的金属板拼接到一起,为能承受其骇人重量的冒险者提供无与伦比的防御。
|
||||
|
||||
items.armor.lamellararmor.name=札甲
|
||||
items.armor.lamellararmor.desc=用许多长方形甲片排起而成的盔甲,为能承受它重量的冒险者提供最强的防御。
|
||||
|
||||
items.armor.roguearmor.name=英雄风衣
|
||||
items.armor.roguearmor.desc=裹着这身与黑暗融为一体的风衣,盗贼能够施展独特的身法。
|
||||
|
||||
|
|
|
@ -10,6 +10,30 @@ windows.wndkeybindings.update=检查更新
|
|||
windows.newwndchallenges$1$1.title=挑战模式-Page1
|
||||
windows.newwndchallenges$2$1.title=挑战模式-Page2
|
||||
|
||||
windows.wndscorebreakdown.title=得分详情
|
||||
windows.wndscorebreakdown.progress_title=游戏
|
||||
windows.wndscorebreakdown.progress_desc=基于最深层数与英雄等级。
|
||||
windows.wndscorebreakdown.treasure_title=寻宝
|
||||
windows.wndscorebreakdown.treasure_desc=基于收集的金币与随身物品的价值。
|
||||
windows.wndscorebreakdown.treasure_desc_old=基于收集的金币。
|
||||
windows.wndscorebreakdown.explore_title=探索
|
||||
windows.wndscorebreakdown.explore_desc=基于完全收集物品,发现所有秘密,并且解开所有谜题的楼层数量。
|
||||
windows.wndscorebreakdown.bosses_title=Boss战
|
||||
windows.wndscorebreakdown.bosses_desc=基于击败的Boss数量,承受Boss战中可避免的伤害会降低该项得分。
|
||||
windows.wndscorebreakdown.quests_title=任务
|
||||
windows.wndscorebreakdown.quests_desc=基于完成的任务。
|
||||
windows.wndscorebreakdown.win_multiplier=通关倍率
|
||||
windows.wndscorebreakdown.challenge_multiplier=挑战倍率
|
||||
windows.wndscorebreakdown.total=总分
|
||||
windows.wndscorebreakdown.total_level=等级
|
||||
windows.wndscorebreakdown.old_score_desc=在 v0.5 版本之前开始的游戏得分项目较少,但来自【进度】项目的得分会增加约 50%,并且来自【寻宝】项目的得分上限也会增加。
|
||||
|
||||
windows.wndranking$statstab.score=得分
|
||||
windows.wndranking$statstab.copy_seed=复制种子
|
||||
windows.wndranking$statstab.copy_seed_desc=你确定要使用这条记录对应的地下城种子开始一场游戏吗?_\n\n如果这个排名来自较早的游戏,也要注意不同版本的《魔绫的像素地牢》可能会生成不同的地下城,即使使用相同的种子。
|
||||
windows.wndranking$statstab.copy_seed_copy=使用这个种子
|
||||
windows.wndranking$statstab.copy_seed_cancel=取消
|
||||
|
||||
windows.wndsettings$extendtab.fpsdisplay=显示日期与时间
|
||||
|
||||
windows.wndautoshop.welcome=自动食品售货机
|
||||
|
@ -93,7 +117,7 @@ windows.wndreddragon.flamec02_title=击败火焰机器人
|
|||
windows.wndreddragon.gnollshied=不戳!那个成天炸我的屑豺狼崽子终于爬了!
|
||||
windows.wndreddragon.skullgnoll=不戳!那个成天放电的屑豺狼崽子终于爬了!
|
||||
windows.wndreddragon.flamec02=不戳!那个成天噼里啪啦的屑机器人终于爬了!
|
||||
windows.wndreddragon.give_item=那本龙王就勉为其难的给你点东西,你看看需要哪个,这些都是从他们的尸体上那边借过来的,老强了。
|
||||
windows.wndreddragon.give_item=那本龙王就勉为其难的给你点东西,你看看需要哪个,这些都是从他们的尸体上那边借过来的,老强了。\n\n另外本王还会送你核子可乐,希望你喜欢这个礼物。
|
||||
windows.wndreddragon.confirm=确定
|
||||
windows.wndreddragon.cancel=取消
|
||||
windows.wndreddragon$rewardwindow$1.why=你为什么想多拿你的奖励?贪心是一种病,让本龙王给你治治!
|
||||
|
@ -245,6 +269,7 @@ windows.wndkeybindings.right_click=右键单击
|
|||
windows.wndkeybindings.middle_click=中键单击
|
||||
windows.wndkeybindings.menu=菜单
|
||||
windows.wndkeybindings.hero_info=英雄信息
|
||||
windows.wndkeybindings.score_info=积分统计
|
||||
windows.wndkeybindings.journal=事件记录
|
||||
windows.wndkeybindings.wait=等待
|
||||
windows.wndkeybindings.examine=检视
|
||||
|
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 14 KiB |
|
@ -141,7 +141,7 @@ public class BGMPlayer {
|
|||
} else if (Dungeon.bossLevel() && t == 15 && Statistics.spawnersIce > 0) {
|
||||
Music.INSTANCE.play(Assets.BGM_BOSSC3, true);
|
||||
} else if (Dungeon.bossLevel() && t == 15) {
|
||||
if((Statistics.boss_enhance & 0x8) != 0) Music.INSTANCE.play(Assets.BGM_BOSSC3, true);
|
||||
if((Statistics.boss_enhance & 0x4) != 0) Music.INSTANCE.play(Assets.BGM_BOSSC3, true);
|
||||
else Music.INSTANCE.play(Assets.BGM_BOSSC, true);
|
||||
} else if (Dungeon.bossLevel() && t == 20) {
|
||||
if((Statistics.boss_enhance & 0x8) != 0) Music.INSTANCE.play(Assets.BGM_BOSSD2, true);
|
||||
|
|
|
@ -49,7 +49,7 @@ public class Challenges {
|
|||
public static final int DHXD = 8192;
|
||||
public static final int ICEDIED = 16384;
|
||||
public static final int PRO = 32768;
|
||||
public static final int CS = 65536;
|
||||
public static final int CS = 65536;
|
||||
|
||||
|
||||
public static final int MAX_VALUE = 131072;
|
||||
|
|
|
@ -45,6 +45,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.RedDragon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
|
@ -76,6 +77,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.NewHallsBossLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonBossLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.SLMKingLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerBossLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel;
|
||||
|
@ -109,6 +111,12 @@ public class Dungeon {
|
|||
public static int nyzbuy;
|
||||
public static int boss;
|
||||
|
||||
public static boolean interfloorTeleportAllowed(){
|
||||
if (Dungeon.level.locked || (Dungeon.hero != null && Dungeon.hero.belongings.getItem(Amulet.class) != null)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//雪凛峡谷A
|
||||
public static Level ColdFlowerCanyon(){
|
||||
|
@ -263,14 +271,23 @@ public class Dungeon {
|
|||
public static SparseArray<ArrayList<Item>> droppedItems;
|
||||
public static SparseArray<ArrayList<Item>> portedItems;
|
||||
|
||||
public static int initialVersion;
|
||||
public static int version;
|
||||
|
||||
public static long seed;
|
||||
public static String customSeedText = "";
|
||||
|
||||
public static void init() {
|
||||
|
||||
version = Game.versionCode;
|
||||
public static int branch;
|
||||
|
||||
public static void updateLevelExplored(){
|
||||
if (branch == 0 && level instanceof RegularLevel && !Dungeon.bossLevel()){
|
||||
Statistics.floorsExplored.put( depth, level.isLevelExplored(depth));
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
initialVersion = version = Game.versionCode;
|
||||
challenges = SPDSettings.challenges();
|
||||
|
||||
//娱乐模式
|
||||
|
@ -314,7 +331,7 @@ public class Dungeon {
|
|||
QuickSlotButton.reset();
|
||||
|
||||
depth = -1;
|
||||
|
||||
branch = 0;
|
||||
gold = 0;
|
||||
energy = 0;
|
||||
nyzbuy = 1;
|
||||
|
@ -369,136 +386,151 @@ public class Dungeon {
|
|||
}
|
||||
|
||||
Level level;
|
||||
if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
switch (depth) {
|
||||
case 17: case 27:case 0:
|
||||
level = new AncityLevel();
|
||||
Buff.affect(hero, RandomBuff.class).set( (5), 1 );
|
||||
break;
|
||||
case 1: case 3: case 6:case 7:case 9: case 11: case 13: case 15:case 18: case 20: case 24:
|
||||
level = new ItemLevel();
|
||||
break;
|
||||
case 2:
|
||||
level = new ForestBossLevel();
|
||||
break;
|
||||
case 4:
|
||||
level = new SewerBossLevel();
|
||||
break;
|
||||
case 5:
|
||||
level = new SLMKingLevel();
|
||||
break;
|
||||
case 8:
|
||||
level = new PrisonBossLevel();
|
||||
break;
|
||||
case 10:
|
||||
level = new DimandKingLevel();
|
||||
break;
|
||||
case 12:
|
||||
level = new NewCavesBossLevel();
|
||||
break;
|
||||
case 14:
|
||||
level = new CaveTwoBossLevel();
|
||||
break;
|
||||
case 16:
|
||||
level = new CavesGirlDeadLevel();
|
||||
break;
|
||||
case 19:
|
||||
level = new ShopBossLevel();
|
||||
break;
|
||||
case 21:
|
||||
level = new NewCityBossLevel();
|
||||
Buff.affect(hero, TestDwarfMasterLock.class).set((1), 1);
|
||||
break;
|
||||
case 22:case 23:
|
||||
level = new CityLevel();
|
||||
break;
|
||||
//TODO FIXED LIST:矮人将军那里用没祝福的十字架复活,Boss会消失不见
|
||||
case 25:
|
||||
level = new DwarfMasterBossLevel();
|
||||
break;
|
||||
case 26:
|
||||
level = new YogGodHardBossLevel();
|
||||
break;
|
||||
case 28:
|
||||
level = new DM920BossLevel();
|
||||
Buff.affect(hero, TestDwarfMasterLock.class).set((1), 1);
|
||||
break;
|
||||
default:
|
||||
level = new DeadEndLevel();
|
||||
Statistics.deepestFloor--;
|
||||
}
|
||||
} else
|
||||
switch (depth) {
|
||||
case 0:
|
||||
level = new ZeroLevel();
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
level = new SewerLevel();
|
||||
break;
|
||||
case 5:
|
||||
level = new ForestBossLevel();
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
level = new PrisonLevel();
|
||||
break;
|
||||
case 10:
|
||||
if((Statistics.boss_enhance & 0x2) != 0 || Statistics.mimicking){
|
||||
level = new ColdChestBossLevel();
|
||||
}
|
||||
else
|
||||
if (branch == 0) {
|
||||
if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
switch (depth) {
|
||||
case 17:
|
||||
case 27:
|
||||
case 0:
|
||||
level = new AncityLevel();
|
||||
Buff.affect(hero, RandomBuff.class).set((5), 1);
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
case 13:
|
||||
case 15:
|
||||
case 18:
|
||||
case 20:
|
||||
case 24:
|
||||
level = new ItemLevel();
|
||||
break;
|
||||
case 2:
|
||||
level = new ForestBossLevel();
|
||||
break;
|
||||
case 4:
|
||||
level = new SewerBossLevel();
|
||||
break;
|
||||
case 5:
|
||||
level = new SLMKingLevel();
|
||||
break;
|
||||
case 8:
|
||||
level = new PrisonBossLevel();
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
level = new CavesLevel();
|
||||
break;
|
||||
case 15:
|
||||
if((Statistics.boss_enhance & 0x3) != 0){
|
||||
break;
|
||||
case 10:
|
||||
level = new DimandKingLevel();
|
||||
break;
|
||||
case 12:
|
||||
level = new NewCavesBossLevel();
|
||||
break;
|
||||
case 14:
|
||||
level = new CaveTwoBossLevel();
|
||||
break;
|
||||
case 16:
|
||||
level = new CavesGirlDeadLevel();
|
||||
}
|
||||
else
|
||||
level = Random.Float()<=0.4f ? new CaveTwoBossLevel() : new NewCavesBossLevel();
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
level = new CityLevel();
|
||||
break;
|
||||
case 20:
|
||||
if((Statistics.boss_enhance & 0x8) != 0) {
|
||||
break;
|
||||
case 19:
|
||||
level = new ShopBossLevel();
|
||||
break;
|
||||
case 21:
|
||||
level = new NewCityBossLevel();
|
||||
Buff.affect(hero, TestDwarfMasterLock.class).set((1), 1);
|
||||
break;
|
||||
case 22:
|
||||
case 23:
|
||||
level = new CityLevel();
|
||||
break;
|
||||
//TODO FIXED LIST:矮人将军那里用没祝福的十字架复活,Boss会消失不见
|
||||
case 25:
|
||||
level = new DwarfMasterBossLevel();
|
||||
break;
|
||||
}
|
||||
else
|
||||
level = new NewCityBossLevel();
|
||||
break;
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
level = new HallsLevel();
|
||||
break;
|
||||
case 25:
|
||||
if((Statistics.boss_enhance & 0x10) != 0) level = new YogGodHardBossLevel();
|
||||
else level = new NewHallsBossLevel();
|
||||
break;
|
||||
case 26:
|
||||
level = new LastLevel();
|
||||
break;
|
||||
default:
|
||||
level = new DeadEndLevel();
|
||||
Statistics.deepestFloor--;
|
||||
}
|
||||
case 26:
|
||||
level = new YogGodHardBossLevel();
|
||||
break;
|
||||
case 28:
|
||||
level = new DM920BossLevel();
|
||||
Buff.affect(hero, TestDwarfMasterLock.class).set((1), 1);
|
||||
break;
|
||||
default:
|
||||
level = new DeadEndLevel();
|
||||
Statistics.deepestFloor--;
|
||||
}
|
||||
} else
|
||||
switch (depth) {
|
||||
case 0:
|
||||
level = new ZeroLevel();
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
level = new SewerLevel();
|
||||
break;
|
||||
case 5:
|
||||
level = new ForestBossLevel();
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
level = new PrisonLevel();
|
||||
break;
|
||||
case 10:
|
||||
if ((Statistics.boss_enhance & 0x2) != 0 || Statistics.mimicking) {
|
||||
level = new ColdChestBossLevel();
|
||||
} else
|
||||
level = new PrisonBossLevel();
|
||||
break;
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
level = new CavesLevel();
|
||||
break;
|
||||
case 15:
|
||||
if ((Statistics.boss_enhance & 0x4) != 0) {
|
||||
level = new CavesGirlDeadLevel();
|
||||
} else
|
||||
level = Random.Float() <= 0.4f ? new CaveTwoBossLevel() : new NewCavesBossLevel();
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
level = new CityLevel();
|
||||
break;
|
||||
case 20:
|
||||
if ((Statistics.boss_enhance & 0x8) != 0) {
|
||||
Buff.affect(hero, TestDwarfMasterLock.class).set((1), 1);
|
||||
level = new DwarfMasterBossLevel();
|
||||
break;
|
||||
} else
|
||||
level = new NewCityBossLevel();
|
||||
break;
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
level = new HallsLevel();
|
||||
break;
|
||||
case 25:
|
||||
if ((Statistics.boss_enhance & 0x10) != 0) level = new YogGodHardBossLevel();
|
||||
else level = new NewHallsBossLevel();
|
||||
break;
|
||||
case 26:
|
||||
level = new LastLevel();
|
||||
break;
|
||||
default:
|
||||
level = new DeadEndLevel();
|
||||
Statistics.deepestFloor--;
|
||||
}
|
||||
} else {
|
||||
level = new DeadEndLevel();
|
||||
Statistics.deepestFloor--;
|
||||
}
|
||||
|
||||
if(Dungeon.hero.buff(BlessAnmy.class) != null && Statistics.TryUsedAnmy){
|
||||
Statistics.TryUsedAnmy = false;
|
||||
|
@ -520,16 +552,19 @@ public class Dungeon {
|
|||
}
|
||||
|
||||
public static long seedCurDepth(){
|
||||
return seedForDepth(depth);
|
||||
return seedForDepth(depth, branch);
|
||||
}
|
||||
|
||||
public static long seedForDepth(int depth){
|
||||
public static long seedForDepth(int depth, int branch){
|
||||
int lookAhead = depth;
|
||||
lookAhead += 30*branch; //Assumes depth is always 1-30, and branch is always 0 or higher
|
||||
|
||||
Random.pushGenerator( seed );
|
||||
|
||||
for (int i = 0; i < depth; i ++) {
|
||||
Random.Long(); //we don't care about these values, just need to go through them
|
||||
}
|
||||
long result = Random.Long();
|
||||
for (int i = 0; i < lookAhead; i ++) {
|
||||
Random.Long(); //we don't care about these values, just need to go through them
|
||||
}
|
||||
long result = Random.Long();
|
||||
|
||||
Random.popGenerator();
|
||||
return result;
|
||||
|
@ -730,13 +765,13 @@ public class Dungeon {
|
|||
private static final String CHAPTERS = "chapters";
|
||||
private static final String QUESTS = "quests";
|
||||
private static final String BADGES = "badges";
|
||||
|
||||
private static final String BRANCH = "branch";
|
||||
private static final String MOBS_TO_STATELING = "mobs_to_stateling";
|
||||
|
||||
private static final String INIT_VER = "init_ver";
|
||||
public static void saveGame( int save ) {
|
||||
try {
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.put( INIT_VER, initialVersion );
|
||||
version = Game.versionCode;
|
||||
bundle.put( VERSION, version );
|
||||
bundle.put( SEED, seed );
|
||||
|
@ -756,7 +791,7 @@ public class Dungeon {
|
|||
|
||||
bundle.put( HERO, hero );
|
||||
bundle.put( DEPTH, depth );
|
||||
|
||||
bundle.put( BRANCH, branch );
|
||||
bundle.put( GOLD, gold );
|
||||
bundle.put( ENERGY, energy );
|
||||
|
||||
|
@ -818,12 +853,12 @@ public class Dungeon {
|
|||
Bundle bundle = new Bundle();
|
||||
bundle.put( LEVEL, level );
|
||||
|
||||
FileUtils.bundleToFile(GamesInProgress.depthFile( save, depth), bundle);
|
||||
FileUtils.bundleToFile(GamesInProgress.depthFile( save, depth, branch ), bundle);
|
||||
}
|
||||
|
||||
public static void saveAll() throws IOException {
|
||||
if (hero != null && (hero.isAlive() || WndResurrect.instance != null)) {
|
||||
|
||||
updateLevelExplored();
|
||||
Actor.fixTime();
|
||||
saveGame( GamesInProgress.curSlot );
|
||||
saveLevel( GamesInProgress.curSlot );
|
||||
|
@ -841,7 +876,11 @@ public class Dungeon {
|
|||
|
||||
Bundle bundle = FileUtils.bundleFromFile( GamesInProgress.gameFile( save ) );
|
||||
|
||||
version = bundle.getInt( VERSION );
|
||||
if (bundle.contains(INIT_VER)){
|
||||
initialVersion = bundle.getInt( INIT_VER );
|
||||
} else {
|
||||
initialVersion = bundle.getInt( VERSION );
|
||||
}
|
||||
|
||||
seed = bundle.contains( SEED ) ? bundle.getLong( SEED ) : DungeonSeed.randomSeed();
|
||||
|
||||
|
@ -861,7 +900,7 @@ public class Dungeon {
|
|||
|
||||
Dungeon.level = null;
|
||||
Dungeon.depth = -1;
|
||||
|
||||
branch = bundle.getInt( BRANCH );
|
||||
Scroll.restore( bundle );
|
||||
Potion.restore( bundle );
|
||||
Ring.restore( bundle );
|
||||
|
@ -950,7 +989,7 @@ public class Dungeon {
|
|||
Dungeon.level = null;
|
||||
Actor.clear();
|
||||
|
||||
Bundle bundle = FileUtils.bundleFromFile( GamesInProgress.depthFile( save, depth)) ;
|
||||
Bundle bundle = FileUtils.bundleFromFile( GamesInProgress.depthFile( save, depth, branch)) ;
|
||||
|
||||
Level level = (Level)bundle.get( LEVEL );
|
||||
|
||||
|
@ -994,6 +1033,7 @@ public class Dungeon {
|
|||
|
||||
public static void fail( Class cause ) {
|
||||
if (WndResurrect.instance == null) {
|
||||
updateLevelExplored();
|
||||
Rankings.INSTANCE.submit( false, cause );
|
||||
}
|
||||
}
|
||||
|
@ -1001,7 +1041,7 @@ public class Dungeon {
|
|||
public static void win( Class cause ) {
|
||||
|
||||
hero.belongings.identify();
|
||||
|
||||
updateLevelExplored();
|
||||
Rankings.INSTANCE.submit( true, cause );
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@ public class GamesInProgress {
|
|||
private static final String GAME_FOLDER = "game%d";
|
||||
private static final String GAME_FILE = "game.dat";
|
||||
private static final String DEPTH_FILE = "depth%d.dat";
|
||||
|
||||
private static final String DEPTH_BRANCH_FILE = "depth%d-branch%d.dat";
|
||||
|
||||
public static boolean gameExists( int slot ){
|
||||
return FileUtils.dirExists(gameFolder(slot))
|
||||
|
@ -60,9 +62,13 @@ public class GamesInProgress {
|
|||
public static String gameFile( int slot ){
|
||||
return gameFolder(slot) + "/" + GAME_FILE;
|
||||
}
|
||||
|
||||
public static String depthFile( int slot, int depth ) {
|
||||
return gameFolder(slot) + "/" + Messages.format(DEPTH_FILE, depth);
|
||||
|
||||
public static String depthFile( int slot, int depth, int branch ) {
|
||||
if (branch == 0) {
|
||||
return gameFolder(slot) + "/" + Messages.format(DEPTH_FILE, depth);
|
||||
} else {
|
||||
return gameFolder(slot) + "/" + Messages.format(DEPTH_BRANCH_FILE, depth, branch);
|
||||
}
|
||||
}
|
||||
|
||||
public static int firstEmpty(){
|
||||
|
|
|
@ -30,60 +30,135 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.FileUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public enum Rankings {
|
||||
|
||||
|
||||
INSTANCE;
|
||||
|
||||
|
||||
public static final int TABLE_SIZE = 11;
|
||||
|
||||
|
||||
public static final String RANKINGS_FILE = "rankings.dat";
|
||||
|
||||
|
||||
public ArrayList<Record> records;
|
||||
|
||||
public int lastRecord;
|
||||
public int totalNumber;
|
||||
public int wonNumber;
|
||||
|
||||
public int calculateScore(){
|
||||
|
||||
|
||||
Statistics.progressScore = Dungeon.hero.lvl * Statistics.deepestFloor * 65;
|
||||
Statistics.progressScore = Math.min(Statistics.progressScore, 50_000);
|
||||
|
||||
if (Statistics.heldItemValue == 0) {
|
||||
for (Item i : Dungeon.hero.belongings) {
|
||||
Statistics.heldItemValue += i.value();
|
||||
if (i instanceof CorpseDust && Statistics.deepestFloor >= 10){
|
||||
// in case player kept the corpse dust, for a necromancer run
|
||||
Statistics.questScores[1] = 2000;
|
||||
}
|
||||
}
|
||||
}
|
||||
Statistics.treasureScore = Statistics.goldCollected + Statistics.heldItemValue;
|
||||
Statistics.treasureScore = Math.min(Statistics.treasureScore, 20_000);
|
||||
|
||||
Statistics.exploreScore = 0;
|
||||
int scorePerFloor = Statistics.floorsExplored.size * 50;
|
||||
for (Boolean b : Statistics.floorsExplored.valueList()){
|
||||
if (b) Statistics.exploreScore += scorePerFloor;
|
||||
}
|
||||
|
||||
Statistics.totalBossScore = 0;
|
||||
for (int i : Statistics.bossScores){
|
||||
if (i > 0) Statistics.totalBossScore += i;
|
||||
}
|
||||
|
||||
Statistics.totalQuestScore = 0;
|
||||
for (int i : Statistics.questScores){
|
||||
if (i > 0) Statistics.totalQuestScore += i;
|
||||
}
|
||||
|
||||
Statistics.winMultiplier = 1f;
|
||||
if (Statistics.gameWon) Statistics.winMultiplier += 1f;
|
||||
if (Statistics.ascended) Statistics.winMultiplier += 0.5f;
|
||||
|
||||
|
||||
Statistics.chalMultiplier = (float)Math.pow(1.25, Challenges.activeChallenges());
|
||||
Statistics.chalMultiplier = Math.round(Statistics.chalMultiplier*20f)/20f;
|
||||
|
||||
Statistics.totalScore = Statistics.progressScore + Statistics.treasureScore + Statistics.exploreScore
|
||||
+ Statistics.totalBossScore + Statistics.totalQuestScore;
|
||||
|
||||
Statistics.totalScore *= Statistics.winMultiplier * Statistics.chalMultiplier;
|
||||
|
||||
return Statistics.totalScore;
|
||||
}
|
||||
|
||||
public void submit( boolean win, Class cause ) {
|
||||
|
||||
if(Dungeon.isChallenged(Challenges.PRO)){
|
||||
return;
|
||||
load();
|
||||
|
||||
Record rec = new Record();
|
||||
|
||||
//we trim version to just the numbers, ignoring alpha/beta, etc.
|
||||
Pattern p = Pattern.compile("\\d+\\.\\d+\\.\\d+");
|
||||
Matcher m = p.matcher(ShatteredPixelDungeon.version);
|
||||
if (m.find()) {
|
||||
rec.version = "v" + m.group();
|
||||
} else {
|
||||
rec.version = "";
|
||||
}
|
||||
|
||||
load();
|
||||
|
||||
Record rec = new Record();
|
||||
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT);
|
||||
rec.date = format.format(new Date(Game.realTime));
|
||||
|
||||
rec.cause = cause;
|
||||
rec.win = win;
|
||||
rec.heroClass = Dungeon.hero.heroClass;
|
||||
rec.armorTier = Dungeon.hero.tier();
|
||||
rec.herolevel = Dungeon.hero.lvl;
|
||||
rec.depth = Dungeon.depth;
|
||||
rec.score = score( win );
|
||||
|
||||
if (Statistics.highestAscent == 0){
|
||||
rec.depth = Statistics.deepestFloor;
|
||||
rec.ascending = false;
|
||||
} else {
|
||||
rec.depth = Statistics.highestAscent;
|
||||
rec.ascending = true;
|
||||
}
|
||||
rec.score = calculateScore();
|
||||
rec.customSeed = Dungeon.customSeedText;
|
||||
|
||||
|
||||
INSTANCE.saveGameData(rec);
|
||||
|
||||
rec.gameID = UUID.randomUUID().toString();
|
||||
|
||||
|
||||
records.add( rec );
|
||||
|
||||
|
||||
Collections.sort( records, scoreComparator );
|
||||
|
||||
|
||||
lastRecord = records.indexOf( rec );
|
||||
int size = records.size();
|
||||
while (size > TABLE_SIZE) {
|
||||
|
@ -97,14 +172,16 @@ public enum Rankings {
|
|||
|
||||
size = records.size();
|
||||
}
|
||||
|
||||
totalNumber++;
|
||||
if (win) {
|
||||
wonNumber++;
|
||||
|
||||
if (rec.customSeed.isEmpty()) {
|
||||
totalNumber++;
|
||||
if (win) {
|
||||
wonNumber++;
|
||||
}
|
||||
}
|
||||
|
||||
Badges.validateGamesPlayed();
|
||||
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
|
@ -117,6 +194,8 @@ public enum Rankings {
|
|||
public static final String BADGES = "badges";
|
||||
public static final String HANDLERS = "handlers";
|
||||
public static final String CHALLENGES = "challenges";
|
||||
public static final String SEED = "seed";
|
||||
public static final String CUSTOM_SEED = "custom_seed";
|
||||
|
||||
public void saveGameData(Record rec){
|
||||
rec.gameData = new Bundle();
|
||||
|
@ -163,10 +242,10 @@ public enum Rankings {
|
|||
if (belongings.ring != null) belongings.backpack.items.add(belongings.ring);
|
||||
Ring.saveSelectively(handler, belongings.backpack.items);
|
||||
rec.gameData.put( HANDLERS, handler);
|
||||
|
||||
rec.gameData.put( SEED, Dungeon.seed );
|
||||
//restore items now that we're done saving
|
||||
belongings.backpack.items = allItems;
|
||||
|
||||
|
||||
//save challenges
|
||||
rec.gameData.put( CHALLENGES, Dungeon.challenges );
|
||||
}
|
||||
|
@ -192,11 +271,24 @@ public enum Rankings {
|
|||
Dungeon.hero = (Hero)data.get(HERO);
|
||||
|
||||
Statistics.restoreFromBundle(data.getBundle(STATS));
|
||||
|
||||
|
||||
Dungeon.challenges = data.getInt(CHALLENGES);
|
||||
|
||||
if (Dungeon.initialVersion <= ShatteredPixelDungeon.v1_0_3){
|
||||
Statistics.gameWon = rec.win;
|
||||
}
|
||||
rec.score = calculateScore();
|
||||
|
||||
if (rec.gameData.contains(SEED)){
|
||||
Dungeon.seed = rec.gameData.getLong(SEED);
|
||||
Dungeon.customSeedText = rec.gameData.getString(CUSTOM_SEED);
|
||||
} else {
|
||||
Dungeon.seed = -1;
|
||||
Dungeon.customSeedText = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static final String RECORDS = "records";
|
||||
private static final String LATEST = "latest";
|
||||
private static final String TOTAL = "total";
|
||||
|
@ -216,23 +308,23 @@ public enum Rankings {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void load() {
|
||||
|
||||
|
||||
if (records != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
records = new ArrayList<>();
|
||||
|
||||
|
||||
try {
|
||||
Bundle bundle = FileUtils.bundleFromFile( RANKINGS_FILE );
|
||||
|
||||
|
||||
for (Bundlable record : bundle.getCollection( RECORDS )) {
|
||||
records.add( (Record)record );
|
||||
}
|
||||
lastRecord = bundle.getInt( LATEST );
|
||||
|
||||
|
||||
totalNumber = bundle.getInt( TOTAL );
|
||||
if (totalNumber == 0) {
|
||||
totalNumber = records.size();
|
||||
|
@ -250,7 +342,7 @@ public enum Rankings {
|
|||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class Record implements Bundlable {
|
||||
|
||||
private static final String CAUSE = "cause";
|
||||
|
@ -262,18 +354,20 @@ public enum Rankings {
|
|||
private static final String DEPTH = "depth";
|
||||
private static final String DATA = "gameData";
|
||||
private static final String ID = "gameID";
|
||||
private static final String SEED = "custom_seed";
|
||||
|
||||
public Class cause;
|
||||
public boolean win;
|
||||
|
||||
public String date;
|
||||
public String version;
|
||||
public HeroClass heroClass;
|
||||
public int armorTier;
|
||||
public int herolevel;
|
||||
public int depth;
|
||||
|
||||
public String customSeed;
|
||||
public Bundle gameData;
|
||||
public String gameID;
|
||||
|
||||
public boolean ascending;
|
||||
public int score;
|
||||
|
||||
public String desc(){
|
||||
|
@ -288,45 +382,45 @@ public enum Rankings {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
|
||||
|
||||
if (bundle.contains( CAUSE )) {
|
||||
cause = bundle.getClass( CAUSE );
|
||||
} else {
|
||||
cause = null;
|
||||
}
|
||||
|
||||
|
||||
win = bundle.getBoolean( WIN );
|
||||
score = bundle.getInt( SCORE );
|
||||
|
||||
customSeed = bundle.getString( SEED );
|
||||
heroClass = bundle.getEnum( CLASS, HeroClass.class );
|
||||
armorTier = bundle.getInt( TIER );
|
||||
|
||||
|
||||
if (bundle.contains(DATA)) gameData = bundle.getBundle(DATA);
|
||||
if (bundle.contains(ID)) gameID = bundle.getString(ID);
|
||||
|
||||
|
||||
if (gameID == null) gameID = UUID.randomUUID().toString();
|
||||
|
||||
depth = bundle.getInt( DEPTH );
|
||||
herolevel = bundle.getInt( LEVEL );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
|
||||
|
||||
if (cause != null) bundle.put( CAUSE, cause );
|
||||
|
||||
bundle.put( WIN, win );
|
||||
bundle.put( SCORE, score );
|
||||
|
||||
|
||||
bundle.put( CLASS, heroClass );
|
||||
bundle.put( TIER, armorTier );
|
||||
bundle.put( LEVEL, herolevel );
|
||||
bundle.put( DEPTH, depth );
|
||||
|
||||
bundle.put( SEED, customSeed );
|
||||
if (gameData != null) bundle.put( DATA, gameData );
|
||||
bundle.put( ID, gameID );
|
||||
}
|
||||
|
|
|
@ -22,8 +22,29 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon;
|
||||
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.SparseArray;
|
||||
|
||||
public class Statistics {
|
||||
|
||||
//统计分数
|
||||
public static int progressScore;
|
||||
public static int treasureScore;
|
||||
public static SparseArray<Boolean> floorsExplored = new SparseArray<>();
|
||||
public static int exploreScore;
|
||||
public static int totalBossScore;
|
||||
public static int heldItemValue;
|
||||
public static int[] questScores = new int[5];
|
||||
public static int totalQuestScore;
|
||||
public static float winMultiplier;
|
||||
public static float chalMultiplier;
|
||||
public static int totalScore;
|
||||
|
||||
public static int[] bossScores = new int[5];
|
||||
public static int highestAscent;
|
||||
public static boolean gameWon = false;
|
||||
public static boolean ascended = false;
|
||||
|
||||
|
||||
public static int realdeepestFloor;
|
||||
public static int boss_enhance = 0;
|
||||
public static int goldCollected;
|
||||
|
@ -135,6 +156,21 @@ public class Statistics {
|
|||
second_elapsed = 0f;
|
||||
real_seconds = 0;
|
||||
turnsPassed = 0f;
|
||||
|
||||
|
||||
//得分
|
||||
progressScore = 0;
|
||||
heldItemValue = 0;
|
||||
treasureScore = 0;
|
||||
floorsExplored = new SparseArray<>();
|
||||
exploreScore = 0;
|
||||
bossScores = new int[5];
|
||||
totalBossScore = 0;
|
||||
questScores = new int[5];
|
||||
totalQuestScore = 0;
|
||||
winMultiplier = 1;
|
||||
chalMultiplier = 1;
|
||||
totalScore = 0;
|
||||
}
|
||||
|
||||
private static final String GOLD = "score";
|
||||
|
@ -191,8 +227,45 @@ public class Statistics {
|
|||
|
||||
private static final String BossSelect = "bossselect";
|
||||
|
||||
//分数
|
||||
private static final String PROG_SCORE = "prog_score";
|
||||
private static final String HIGHEST = "maxAscent";
|
||||
private static final String ITEM_VAL = "item_val";
|
||||
private static final String TRES_SCORE = "tres_score";
|
||||
private static final String FLR_EXPL = "flr_expl";
|
||||
private static final String EXPL_SCORE = "expl_score";
|
||||
private static final String BOSS_SCORES = "boss_scores";
|
||||
private static final String TOT_BOSS = "tot_boss";
|
||||
private static final String QUEST_SCORES = "quest_scores";
|
||||
private static final String TOT_QUEST = "tot_quest";
|
||||
private static final String WIN_MULT = "win_mult";
|
||||
private static final String CHAL_MULT = "chal_mult";
|
||||
private static final String TOTAL_SCORE = "total_score";
|
||||
private static final String WON = "won";
|
||||
private static final String ASCENDED = "ascended";
|
||||
|
||||
public static void storeInBundle( Bundle bundle ) {
|
||||
|
||||
//分数
|
||||
bundle.put( PROG_SCORE, progressScore );
|
||||
bundle.put( ITEM_VAL, heldItemValue );
|
||||
bundle.put( TRES_SCORE, treasureScore );
|
||||
for (int i = 1; i < 26; i++){
|
||||
if (floorsExplored.containsKey(i)){
|
||||
bundle.put( FLR_EXPL+i, floorsExplored.get(i) );
|
||||
}
|
||||
}
|
||||
bundle.put( EXPL_SCORE, exploreScore );
|
||||
bundle.put( BOSS_SCORES, bossScores );
|
||||
bundle.put( TOT_BOSS, totalBossScore );
|
||||
bundle.put( QUEST_SCORES,questScores );
|
||||
bundle.put( TOT_QUEST, totalQuestScore );
|
||||
bundle.put( WIN_MULT, winMultiplier );
|
||||
bundle.put( CHAL_MULT, chalMultiplier );
|
||||
bundle.put( TOTAL_SCORE, totalScore );
|
||||
bundle.put( WON, gameWon );
|
||||
bundle.put( ASCENDED, ascended );
|
||||
|
||||
bundle.put(BossSelect,boss_enhance);
|
||||
|
||||
bundle.put( LANTERACTIVE, lanterfireactive );
|
||||
|
@ -248,6 +321,32 @@ public class Statistics {
|
|||
|
||||
public static void restoreFromBundle( Bundle bundle ) {
|
||||
|
||||
//分数
|
||||
progressScore = bundle.getInt( PROG_SCORE );
|
||||
heldItemValue = bundle.getInt( ITEM_VAL );
|
||||
treasureScore = bundle.getInt( TRES_SCORE );
|
||||
floorsExplored.clear();
|
||||
for (int i = 1; i < 26; i++){
|
||||
if (bundle.contains( FLR_EXPL+i )){
|
||||
floorsExplored.put(i, bundle.getBoolean( FLR_EXPL+i ));
|
||||
}
|
||||
}
|
||||
bundle.put( HIGHEST, highestAscent );
|
||||
exploreScore = bundle.getInt( EXPL_SCORE );
|
||||
if (bundle.contains( BOSS_SCORES )) bossScores = bundle.getIntArray( BOSS_SCORES );
|
||||
else bossScores = new int[5];
|
||||
totalBossScore = bundle.getInt( TOT_BOSS );
|
||||
if (bundle.contains( QUEST_SCORES ))questScores = bundle.getIntArray( QUEST_SCORES );
|
||||
else questScores = new int[5];
|
||||
totalQuestScore = bundle.getInt( TOT_QUEST );
|
||||
winMultiplier = bundle.getFloat( WIN_MULT );
|
||||
chalMultiplier = bundle.getFloat( CHAL_MULT );
|
||||
totalScore = bundle.getInt( TOTAL_SCORE );
|
||||
highestAscent = bundle.getInt( HIGHEST );
|
||||
gameWon = bundle.getBoolean( WON );
|
||||
ascended = bundle.getBoolean( ASCENDED );
|
||||
|
||||
|
||||
dimandchestmazeCollected = bundle.getInt(DDK);
|
||||
|
||||
goldchestmazeCollected = bundle.getInt(GOLDCHEST);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.bosses.CrystalDiedTower;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Beam;
|
||||
|
@ -23,6 +24,7 @@ public class BeamTowerAdbility extends Buff {
|
|||
if (ch != null) {
|
||||
if (ch.alignment != Char.Alignment.ENEMY) {
|
||||
ch.damage(Random.IntRange(6, 10), CrystalDiedTower.class);
|
||||
Statistics.bossScores[3] -= 300;
|
||||
Buff.affect(ch, Cripple.class, 2f);
|
||||
if (ch == Dungeon.hero && !ch.isAlive()) {
|
||||
Dungeon.fail(getClass());
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2022 Evan Debenham
|
||||
* Copyright (C) 2014-2023 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -40,7 +40,7 @@ public class Invisibility extends FlavourBuff {
|
|||
type = buffType.POSITIVE;
|
||||
announced = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean attachTo( Char target ) {
|
||||
if (super.attachTo( target )) {
|
||||
|
@ -53,14 +53,14 @@ public class Invisibility extends FlavourBuff {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
if (target.invisible > 0)
|
||||
target.invisible--;
|
||||
super.detach();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int icon() {
|
||||
return BuffIndicator.INVISIBLE;
|
||||
|
@ -77,41 +77,41 @@ public class Invisibility extends FlavourBuff {
|
|||
else if (target.invisible == 0) target.sprite.remove( CharSprite.State.INVISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Messages.get(this, "name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return Messages.get(this, "desc", dispTurns());
|
||||
}
|
||||
|
||||
public static void dispel() {
|
||||
if (Dungeon.hero == null) return;
|
||||
|
||||
for ( Buff invis : Dungeon.hero.buffs( Invisibility.class )){
|
||||
dispel(Dungeon.hero);
|
||||
}
|
||||
|
||||
public static void dispel(Char ch){
|
||||
|
||||
for ( Buff invis : ch.buffs( Invisibility.class )){
|
||||
invis.detach();
|
||||
}
|
||||
CloakOfShadows.cloakStealth cloakBuff = Dungeon.hero.buff( CloakOfShadows.cloakStealth.class );
|
||||
CloakOfShadows.cloakStealth cloakBuff = ch.buff( CloakOfShadows.cloakStealth.class );
|
||||
if (cloakBuff != null) {
|
||||
cloakBuff.dispel();
|
||||
}
|
||||
|
||||
//these aren't forms of invisibilty, but do dispel at the same time as it.
|
||||
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class );
|
||||
|
||||
//these aren't forms of invisibility, but do dispel at the same time as it.
|
||||
TimekeepersHourglass.timeFreeze timeFreeze = ch.buff( TimekeepersHourglass.timeFreeze.class );
|
||||
if (timeFreeze != null) {
|
||||
timeFreeze.detach();
|
||||
}
|
||||
|
||||
Preparation prep = Dungeon.hero.buff( Preparation.class );
|
||||
|
||||
Preparation prep = ch.buff( Preparation.class );
|
||||
if (prep != null){
|
||||
prep.detach();
|
||||
}
|
||||
|
||||
Swiftthistle.TimeBubble bubble = Dungeon.hero.buff( Swiftthistle.TimeBubble.class );
|
||||
|
||||
Swiftthistle.TimeBubble bubble = ch.buff( Swiftthistle.TimeBubble.class );
|
||||
if (bubble != null){
|
||||
bubble.detach();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Messages.get(this, "name");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -573,7 +573,7 @@ public class Hero extends Char {
|
|||
public int tier() {
|
||||
Armor armor = belongings.armor();
|
||||
if (armor instanceof ClassArmor){
|
||||
return 6;
|
||||
return 7;
|
||||
} else if (armor != null){
|
||||
return armor.tier;
|
||||
} else {
|
||||
|
|
|
@ -116,6 +116,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortswor
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingKnife;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.ScrollOfAwareness;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public enum HeroClass {
|
||||
|
@ -171,6 +172,8 @@ public enum HeroClass {
|
|||
new WashCrime().quantity(1).identify().collect();
|
||||
new MagicTorch().quantity(1).identify().collect();
|
||||
|
||||
new ScrollOfAwareness().quantity(1).identify().collect();
|
||||
|
||||
new Cake().quantity(100).identify().collect();
|
||||
new TengusMask().quantity(1).identify().collect();
|
||||
new ScrollOfIdentify().quantity(45).identify().collect();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2022 Evan Debenham
|
||||
* Copyright (C) 2014-2023 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||
|
@ -35,12 +34,12 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Swiftthistle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
@ -110,11 +109,9 @@ public class WarpBeacon extends ArmorAbility {
|
|||
armor.charge -= chargeNeeded;
|
||||
armor.updateQuickslot();
|
||||
|
||||
if (tracker.depth == Dungeon.depth){
|
||||
if (tracker.depth == Dungeon.depth && tracker.branch == Dungeon.branch){
|
||||
Char existing = Actor.findChar(tracker.pos);
|
||||
|
||||
ScrollOfTeleportation.appear(hero, tracker.pos);
|
||||
|
||||
if (existing != null && existing != hero){
|
||||
if (hero.hasTalent(Talent.TELEFRAG)){
|
||||
int heroHP = hero.HP + hero.shielding();
|
||||
|
@ -144,34 +141,41 @@ public class WarpBeacon extends ArmorAbility {
|
|||
Random.shuffle(candidates);
|
||||
|
||||
if (!candidates.isEmpty()){
|
||||
ScrollOfTeleportation.appear(hero, tracker.pos);
|
||||
Actor.addDelayed( new Pushing( toPush, toPush.pos, candidates.get(0) ), -1 );
|
||||
|
||||
toPush.pos = candidates.get(0);
|
||||
Dungeon.level.occupyCell(toPush);
|
||||
hero.next();
|
||||
} else {
|
||||
GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") );
|
||||
}
|
||||
} else {
|
||||
ScrollOfTeleportation.appear(hero, tracker.pos);
|
||||
}
|
||||
} else {
|
||||
ScrollOfTeleportation.appear(hero, tracker.pos);
|
||||
}
|
||||
|
||||
Invisibility.dispel();
|
||||
Dungeon.observe();
|
||||
GameScene.updateFog();
|
||||
hero.checkVisibleMobs();
|
||||
AttackIndicator.updateState();
|
||||
|
||||
} else {
|
||||
|
||||
if (hero.buff(LockedFloor.class) != null){
|
||||
GLog.w( Messages.get(WarpBeacon.class, "locked_floor") );
|
||||
if (!Dungeon.interfloorTeleportAllowed()){
|
||||
GLog.w( Messages.get(ScrollOfTeleportation.class, "no_tele") );
|
||||
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();
|
||||
//transition before dispel, to cancel out trap effects
|
||||
Level.beforeTransition();
|
||||
Invisibility.dispel();
|
||||
|
||||
InterlevelScene.mode = InterlevelScene.Mode.RETURN;
|
||||
InterlevelScene.returnDepth = tracker.depth;
|
||||
InterlevelScene.returnBranch = tracker.branch;
|
||||
InterlevelScene.returnPos = tracker.pos;
|
||||
Game.switchScene( InterlevelScene.class );
|
||||
}
|
||||
|
@ -195,6 +199,7 @@ public class WarpBeacon extends ArmorAbility {
|
|||
PathFinder.buildDistanceMap(target, BArray.or(Dungeon.level.passable, Dungeon.level.avoid, null));
|
||||
if (Dungeon.level.pit[target] ||
|
||||
(Dungeon.level.solid[target] && !Dungeon.level.passable[target]) ||
|
||||
!(Dungeon.level.passable[target] || Dungeon.level.avoid[target]) ||
|
||||
PathFinder.distance[hero.pos] == Integer.MAX_VALUE){
|
||||
GLog.w( Messages.get(WarpBeacon.class, "invalid_beacon") );
|
||||
return;
|
||||
|
@ -203,6 +208,7 @@ public class WarpBeacon extends ArmorAbility {
|
|||
WarpBeaconTracker tracker = new WarpBeaconTracker();
|
||||
tracker.pos = target;
|
||||
tracker.depth = Dungeon.depth;
|
||||
tracker.branch = Dungeon.branch;
|
||||
tracker.attachTo(hero);
|
||||
|
||||
hero.sprite.operate(target);
|
||||
|
@ -220,6 +226,7 @@ public class WarpBeacon extends ArmorAbility {
|
|||
|
||||
int pos;
|
||||
int depth;
|
||||
int branch;
|
||||
|
||||
Emitter e;
|
||||
|
||||
|
@ -234,12 +241,14 @@ public class WarpBeacon extends ArmorAbility {
|
|||
|
||||
public static final String POS = "pos";
|
||||
public static final String DEPTH = "depth";
|
||||
public static final String BRANCH = "branch";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(POS, pos);
|
||||
bundle.put(DEPTH, depth);
|
||||
bundle.put(BRANCH, branch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -247,6 +256,7 @@ public class WarpBeacon extends ArmorAbility {
|
|||
super.restoreFromBundle(bundle);
|
||||
pos = bundle.getInt(POS);
|
||||
depth = bundle.getInt(DEPTH);
|
||||
branch = bundle.getInt(BRANCH);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LamellarArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
|
@ -46,10 +47,18 @@ public class ArmoredStatue extends Statue {
|
|||
public ArmoredStatue(){
|
||||
super();
|
||||
|
||||
do {
|
||||
armor = Generator.randomArmor();
|
||||
} while (armor.cursed);
|
||||
armor.inscribe(Armor.Glyph.random());
|
||||
|
||||
//为装甲石像添加在15层后有概率穿戴札甲
|
||||
if(Dungeon.depth >15 && Random.Int(10) == 0){
|
||||
armor = new LamellarArmor();
|
||||
armor.inscribe(Armor.Glyph.random());
|
||||
} else {
|
||||
do {
|
||||
armor = Generator.randomArmor();
|
||||
} while (armor.cursed);
|
||||
armor.inscribe(Armor.Glyph.random());
|
||||
}
|
||||
|
||||
|
||||
//double HP
|
||||
HP = HT = 30 + Dungeon.depth * 10;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Boss;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -497,7 +498,7 @@ public class DimandKing extends Boss {
|
|||
// GetBossLoot();
|
||||
// }
|
||||
GameScene.bossSlain();
|
||||
|
||||
Statistics.bossScores[1] += 1000;
|
||||
super.die( cause );
|
||||
if (Dungeon.hero.subClass == HeroSubClass.NONE) {
|
||||
Dungeon.level.drop( new TengusMask(), pos ).sprite.drop();
|
||||
|
@ -848,6 +849,7 @@ public class DimandKing extends Boss {
|
|||
if(ch != null){
|
||||
if(ch.alignment != Alignment.ENEMY){
|
||||
ch.damage(Random.IntRange(25, 36), m);
|
||||
Statistics.bossScores[1] -= 600;
|
||||
if(ch == Dungeon.hero && !ch.isAlive()){
|
||||
Dungeon.fail(getClass());
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
||||
|
@ -499,7 +500,7 @@ public class DwarfKing extends Mob {
|
|||
GetBossLoot();
|
||||
}
|
||||
GameScene.bossSlain();
|
||||
|
||||
Statistics.bossScores[3] += 4000;
|
||||
super.die( cause );
|
||||
|
||||
if (Dungeon.level.solid[pos]){
|
||||
|
@ -562,6 +563,13 @@ public class DwarfKing extends Mob {
|
|||
{
|
||||
state = HUNTING;
|
||||
}
|
||||
@Override
|
||||
protected void zap() {
|
||||
if (enemy == Dungeon.hero){
|
||||
Statistics.bossScores[3] -= 400;
|
||||
}
|
||||
super.zap();
|
||||
}
|
||||
}
|
||||
|
||||
public static class DKGolem extends Golem {
|
||||
|
|
|
@ -269,6 +269,7 @@ public abstract class Elemental extends Mob {
|
|||
rangedCooldown = Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void meleeProc( Char enemy, int damage ) {
|
||||
if (Random.Int( 2 ) == 0 && !level.water[enemy.pos]) {
|
||||
|
@ -280,9 +281,11 @@ public abstract class Elemental extends Mob {
|
|||
@Override
|
||||
public void die(Object cause) {
|
||||
super.die(cause);
|
||||
if (alignment == Alignment.ENEMY) Dungeon.level.drop( new Embers(), pos ).sprite.drop();
|
||||
|
||||
Badges.KILL_COLDELE();
|
||||
if (alignment == Alignment.ENEMY){
|
||||
Dungeon.level.drop( new Embers(), pos ).sprite.drop();
|
||||
Statistics.questScores[1] = 2000;
|
||||
Badges.KILL_COLDELE();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
||||
|
@ -119,6 +120,7 @@ public class GnollShiled extends Gnoll {
|
|||
if (mob instanceof RedDragon && mob.isAlive()) {
|
||||
RedDragon.Quest.process();
|
||||
}
|
||||
Statistics.questScores[2] += 1200;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SpellCaster;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Boss;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -253,10 +254,12 @@ public class MagicGirlDead extends Boss {
|
|||
if (buff instanceof RoseShiled) {
|
||||
buff.detach();
|
||||
GLog.b("……你妄图使用这种方法来逃脱吗?");
|
||||
Statistics.bossScores[2] -= 800;
|
||||
}
|
||||
if (buff instanceof HaloFireImBlue ||buff instanceof FireImbue) {
|
||||
buff.detach();
|
||||
GLog.b("……你妄图使用这种方法来逃脱吗?");
|
||||
Statistics.bossScores[2] -= 800;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,8 +298,10 @@ public class MagicGirlDead extends Boss {
|
|||
|
||||
Camera.main.shake( 1, 0.25f );
|
||||
|
||||
if (Dungeon.level.map[step] == Terrain.WATER && state == HUNTING) {
|
||||
|
||||
//冰雪魔女踩一次水扣300分
|
||||
if (Dungeon.level.map[step] == Terrain.WATER && state == HUNTING) {
|
||||
Statistics.bossScores[2] -= 300;
|
||||
if (Dungeon.level.heroFOV[step]) {
|
||||
if (buff(Haste.class) == null) {
|
||||
Buff.affect(this, Haste.class, 10f);
|
||||
|
@ -371,7 +376,7 @@ public class MagicGirlDead extends Boss {
|
|||
|
||||
@Override
|
||||
public void die(Object src){
|
||||
|
||||
Statistics.bossScores[2] += 5000;
|
||||
super.die(src);
|
||||
if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
|
@ -96,6 +97,7 @@ public class MoloHR extends Mob {
|
|||
int var2 = Random.Int(this.deathCurse.length);
|
||||
this.sprite.showStatus(16711680, this.deathCurse[var2]);
|
||||
}
|
||||
Statistics.bossScores[2] += 1000;
|
||||
Dungeon.level.drop( ( Generator.randomUsingDefaults( Generator.Category.SCROLL ) ), this.pos );
|
||||
Dungeon.level.drop( ( Generator.randomUsingDefaults( Generator.Category.POTION ) ), this.pos );
|
||||
Dungeon.level.drop( ( Generator.randomUsingDefaults( Generator.Category.WAND ) ), this.pos );
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
|
@ -514,7 +515,7 @@ public class NewDM300 extends Mob {
|
|||
|
||||
@Override
|
||||
public void die( Object cause ) {
|
||||
|
||||
Statistics.bossScores[2] += 3000;
|
||||
super.die( cause );
|
||||
if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
|
||||
|
@ -642,6 +643,9 @@ public class NewDM300 extends Mob {
|
|||
Char ch = Actor.findChar(i);
|
||||
if (ch != null && !(ch instanceof NewDM300)){
|
||||
Buff.prolong( ch, Paralysis.class, Dungeon.isChallenged(Challenges.STRONGER_BOSSES) ? 5 : 3 );
|
||||
if (ch == Dungeon.hero){
|
||||
Statistics.bossScores[2] -= 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
|
@ -529,6 +530,7 @@ public class NewDM720 extends MolotovHuntsman {
|
|||
// if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
// GetBossLoot();
|
||||
// }
|
||||
Statistics.bossScores[2] += 1000;
|
||||
super.die(cause);
|
||||
cause = new MoloHR();
|
||||
((MoloHR) cause).pos = pos;
|
||||
|
@ -671,6 +673,9 @@ public class NewDM720 extends MolotovHuntsman {
|
|||
Char ch = Actor.findChar(cell);
|
||||
if (ch != null && !(ch instanceof NewDM720)){
|
||||
Buff.prolong( ch, Paralysis.class, 3 );
|
||||
if (ch == Dungeon.hero){
|
||||
Statistics.bossScores[2] -= 400;
|
||||
}
|
||||
}
|
||||
|
||||
rocksFell = true;
|
||||
|
|
|
@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
|
@ -103,6 +104,7 @@ public class RotHeart extends Mob {
|
|||
super.die(cause);
|
||||
Dungeon.level.drop( new Rotberry.Seed(), pos ).sprite.drop();
|
||||
Badges.KILL_ROTHEART();
|
||||
Statistics.questScores[1] = 2000;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
|
@ -203,7 +204,7 @@ public class Tengu extends Mob {
|
|||
if (Dungeon.hero.subClass == HeroSubClass.NONE) {
|
||||
Dungeon.level.drop( new TengusMask(), pos ).sprite.drop();
|
||||
}
|
||||
|
||||
Statistics.bossScores[1] += 2000;
|
||||
GameScene.bossSlain();
|
||||
super.die( cause );
|
||||
|
||||
|
@ -611,8 +612,12 @@ public class Tengu extends Mob {
|
|||
ch.damage(dmg, Bomb.class);
|
||||
}
|
||||
|
||||
if (ch == Dungeon.hero && !ch.isAlive()) {
|
||||
Dungeon.fail(Tengu.class);
|
||||
if (ch == Dungeon.hero){
|
||||
Statistics.bossScores[1] -= 100;
|
||||
|
||||
if (!ch.isAlive()) {
|
||||
Dungeon.fail(Tengu.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -846,6 +851,10 @@ public class Tengu extends Mob {
|
|||
observe = true;
|
||||
GameScene.updateMap( cell );
|
||||
}
|
||||
|
||||
if (ch == Dungeon.hero){
|
||||
Statistics.bossScores[1] -= 200;
|
||||
}
|
||||
|
||||
burned = true;
|
||||
CellEmitter.get(cell).start(FlameParticle.FACTORY, 0.03f, 10);
|
||||
|
@ -1019,10 +1028,14 @@ public class Tengu extends Mob {
|
|||
Char ch = Actor.findChar(cell);
|
||||
if (ch != null && !(ch instanceof Tengu)){
|
||||
ch.damage(2 + Dungeon.depth, new Electricity());
|
||||
|
||||
if (ch == Dungeon.hero && !ch.isAlive()) {
|
||||
Dungeon.fail(Tengu.class);
|
||||
GLog.n( Messages.get(Electricity.class, "ondeath") );
|
||||
|
||||
if (ch == Dungeon.hero){
|
||||
|
||||
Statistics.bossScores[1] -= 200;
|
||||
if (!ch.isAlive()) {
|
||||
Dungeon.fail(Tengu.class);
|
||||
GLog.n(Messages.get(Electricity.class, "ondeath"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class Warlock extends Mob implements Callback {
|
|||
|
||||
{
|
||||
spriteClass = WarlockSprite.class;
|
||||
|
||||
|
||||
HP = HT = 70;
|
||||
defenseSkill = 18;
|
||||
|
||||
|
@ -102,7 +102,7 @@ public class Warlock extends Mob implements Callback {
|
|||
//used so resistances can differentiate between melee and magical attacks
|
||||
public static class DarkBolt{}
|
||||
|
||||
private void zap() {
|
||||
protected void zap() {
|
||||
spend( TIME_TO_ZAP );
|
||||
|
||||
if (hit( this, enemy, true )) {
|
||||
|
|
|
@ -220,6 +220,9 @@ public class YogDzewa extends Mob {
|
|||
Dungeon.observe();
|
||||
}
|
||||
for (Char ch : affected) {
|
||||
if (ch == Dungeon.hero) {
|
||||
Statistics.bossScores[4] -= 1000;
|
||||
}
|
||||
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){
|
||||
ch.damage(Random.NormalIntRange(30, 50), new Eye.DeathGaze());
|
||||
} else {
|
||||
|
@ -489,7 +492,7 @@ public class YogDzewa extends Mob {
|
|||
GameScene.bossSlain();
|
||||
Dungeon.level.unseal();
|
||||
super.die( cause );
|
||||
|
||||
Statistics.bossScores[4] += 10000 + 1250*Statistics.spawnersAlive;
|
||||
yell( Messages.get(this, "defeated") );
|
||||
}
|
||||
|
||||
|
|
|
@ -478,6 +478,7 @@ public class YogReal extends Boss {
|
|||
GameScene.flash(0x80FFFFFF);
|
||||
actScanning();
|
||||
actSummon();
|
||||
Statistics.bossScores[4] += 15000;
|
||||
actDestroy();
|
||||
if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
|
||||
|
@ -856,6 +857,7 @@ public class YogReal extends Boss {
|
|||
public int onHitProc(Char ch) {
|
||||
if (ch.alignment == Alignment.ENEMY) return 0;
|
||||
ch.damage(Random.Int(40, 70), YogReal.class);
|
||||
Statistics.bossScores[3] -= 500;
|
||||
ch.sprite.centerEmitter().burst(RainbowParticle.BURST, Random.Int(20, 35));
|
||||
ch.sprite.flash();
|
||||
Buff.affect(ch, Blindness.class, 50f);
|
||||
|
@ -929,6 +931,7 @@ public class YogReal extends Boss {
|
|||
if (ch != null) {
|
||||
if (ch.alignment == Alignment.ENEMY) continue;
|
||||
ch.damage(Random.Int(30, 50), YogReal.class);
|
||||
Statistics.bossScores[3] -= 500;
|
||||
Buff.affect(ch, Blindness.class, 5f);
|
||||
ch.sprite.flash();
|
||||
if (ch == Dungeon.hero) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
|
@ -202,6 +203,7 @@ public class CrivusFruits extends Mob {
|
|||
if( Dungeon.hero.buff(LockedFloor.class) != null) {
|
||||
//不为空为4 否则就是0
|
||||
ch.damage(Dungeon.hero.buff(LockedFloor.class) != null ? damage : 0, this);
|
||||
Statistics.bossScores[0] -= 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +239,7 @@ public class CrivusFruits extends Mob {
|
|||
Dungeon.level.drop( new IronKey( Dungeon.depth ), pos-1 ).sprite.drop();
|
||||
Dungeon.level.drop( new IronKey( Dungeon.depth ), pos+1 ).sprite.drop();
|
||||
Badges.validateBossSlain();
|
||||
|
||||
Statistics.bossScores[0] += 1000;
|
||||
|
||||
if (!Badges.isUnlocked(Badges.Badge.KILL_APPLE)){
|
||||
Dungeon.level.drop( new LifeTreeSword(), pos ).sprite.drop();
|
||||
|
|
|
@ -152,6 +152,7 @@ public class DMZERO extends Mob
|
|||
public void die(Object obj)
|
||||
{
|
||||
super.die(obj);
|
||||
|
||||
Dungeon.level.drop(new IronKey(Dungeon.depth), pos).sprite.drop();
|
||||
obj = new DM300SpiderMode();
|
||||
((DM300SpiderMode) obj).pos = pos;
|
||||
|
@ -380,7 +381,7 @@ public class DMZERO extends Mob
|
|||
((NullDiedTO) obj).pos = pos;
|
||||
GameScene.add(((Mob) (obj)));
|
||||
Actor.addDelayed(new Pushing(((Char) (obj)), pos, ((NullDiedTO) (obj)).pos), -1F);
|
||||
|
||||
Statistics.bossScores[4] += 3000;
|
||||
Badges.BOSSRUSH();
|
||||
|
||||
yell( Messages.get(this, "defeated") );
|
||||
|
|
|
@ -269,7 +269,7 @@ public class DiamondKnight extends Boss {
|
|||
super.die( cause );
|
||||
|
||||
Dungeon.level.unseal();
|
||||
|
||||
Statistics.bossScores[1] += 2500;
|
||||
Dungeon.level.drop( new TengusMask(), pos ).sprite.drop();
|
||||
int dropPos = this.pos;
|
||||
|
||||
|
@ -286,6 +286,7 @@ public class DiamondKnight extends Boss {
|
|||
|
||||
if(Statistics.dimandchestmazeCollected>=3){
|
||||
Badges.KILL_OMP();
|
||||
Statistics.bossScores[1] += 1000;
|
||||
}
|
||||
|
||||
phase++;
|
||||
|
@ -378,6 +379,7 @@ public class DiamondKnight extends Boss {
|
|||
if(Random.Float()<0.45f){
|
||||
Buff.affect( enemy, Bleeding.class ).set( 9 );
|
||||
Sample.INSTANCE.play( Assets.Sounds.CURSED );
|
||||
Statistics.bossScores[1] -= 300;
|
||||
}
|
||||
Sample.INSTANCE.play( Assets.Sounds.ZAP );
|
||||
} else {
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Boss;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -234,6 +235,7 @@ public class DwarfMaster extends Boss {
|
|||
public int onHitProc(Char ch) {
|
||||
if(ch.alignment == Alignment.ENEMY) return 0;
|
||||
ch.damage( Random.Int(50, 80), YogReal.class );
|
||||
Statistics.bossScores[3] -= 500;
|
||||
if(ch == Dungeon.hero){
|
||||
Sample.INSTANCE.play(Assets.Sounds.BLAST, Random.Float(1.1f, 1.5f));
|
||||
Buff.affect( ch, Poison.class ).set( (5f)+(ch.HP/8f) );
|
||||
|
@ -1601,7 +1603,7 @@ public class DwarfMaster extends Boss {
|
|||
public void die( Object cause ) {
|
||||
|
||||
super.die( cause );
|
||||
|
||||
Statistics.bossScores[3] += 6000;
|
||||
Dungeon.level.unseal();
|
||||
|
||||
for (Mob mob : (Iterable<Mob>)Dungeon.level.mobs.clone()) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||
|
@ -738,7 +739,7 @@ public class FireMagicDied extends Mob implements Callback {
|
|||
GetBossLoot();
|
||||
}
|
||||
super.die( cause );
|
||||
|
||||
Statistics.bossScores[3] += 5000;
|
||||
Dungeon.level.drop(new BackGoKey().quantity(1).identify(), pos).sprite.drop();
|
||||
Dungeon.level.drop(new ScrollOfMagicMapping().quantity(1).identify(), pos).sprite.drop();
|
||||
Dungeon.level.drop(new ScrollOfUpgrade().quantity(3).identify(), pos).sprite.drop();
|
||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
||||
|
@ -117,7 +118,7 @@ public class Blacksmith extends NPC {
|
|||
}
|
||||
pick.detach( Dungeon.hero.belongings.backpack );
|
||||
tell( Messages.get(this, "completed") );
|
||||
|
||||
Statistics.questScores[2] += 3000;
|
||||
Quest.completed = true;
|
||||
Quest.reforged = false;
|
||||
}
|
||||
|
@ -137,7 +138,7 @@ public class Blacksmith extends NPC {
|
|||
pick.detach( Dungeon.hero.belongings.backpack );
|
||||
gold.detachAll( Dungeon.hero.belongings.backpack );
|
||||
tell( Messages.get(this, "completed") );
|
||||
|
||||
Statistics.questScores[2] += 3000;
|
||||
Quest.completed = true;
|
||||
Quest.reforged = false;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LamellarArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LeatherArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.MailArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.PlateArmor;
|
||||
|
@ -213,7 +214,7 @@ public class Ghost extends NPC {
|
|||
private static boolean given;
|
||||
private static boolean processed;
|
||||
|
||||
private static int depth;
|
||||
public static int depth;
|
||||
|
||||
public static Weapon weapon;
|
||||
public static Armor armor;
|
||||
|
@ -310,12 +311,13 @@ public class Ghost extends NPC {
|
|||
depth = Dungeon.depth;
|
||||
|
||||
//50%:tier2, 30%:tier3, 15%:tier4, 5%:tier5
|
||||
switch (Random.chances(new float[]{0, 0, 10, 6, 3, 1})){
|
||||
switch (Random.chances(new float[]{0, 0, 10, 6, 3, 1,8})){
|
||||
default:
|
||||
case 2: armor = new LeatherArmor(); break;
|
||||
case 3: armor = new MailArmor(); break;
|
||||
case 4: armor = new ScaleArmor(); break;
|
||||
case 5: armor = new PlateArmor(); break;
|
||||
case 6: armor = new LamellarArmor(); break;
|
||||
}
|
||||
//50%:tier2, 30%:tier3, 15%:tier4, 5%:tier5
|
||||
int wepTier = Random.chances(new float[]{0, 0, 10, 6, 3, 1});
|
||||
|
@ -380,12 +382,13 @@ public class Ghost extends NPC {
|
|||
depth = Dungeon.depth;
|
||||
|
||||
//50%:tier2, 30%:tier3, 15%:tier4, 5%:tier5
|
||||
switch (Random.chances(new float[]{0, 0, 10, 6, 3, 1})){
|
||||
switch (Random.chances(new float[]{0, 0, 10, 6, 3, 1,8})){
|
||||
default:
|
||||
case 2: armor = new LeatherArmor(); break;
|
||||
case 3: armor = new MailArmor(); break;
|
||||
case 4: armor = new ScaleArmor(); break;
|
||||
case 5: armor = new PlateArmor(); break;
|
||||
case 6: armor = new LamellarArmor(); break;
|
||||
}
|
||||
//50%:tier2, 30%:tier3, 15%:tier4, 5%:tier5
|
||||
int wepTier = Random.chances(new float[]{0, 0, 10, 6, 3, 1});
|
||||
|
@ -436,6 +439,7 @@ public class Ghost extends NPC {
|
|||
GLog.n( Messages.get(Ghost.class, "find_me") );
|
||||
Sample.INSTANCE.play( Assets.Sounds.GHOST );
|
||||
processed = true;
|
||||
Statistics.questScores[0] = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Golem;
|
||||
|
@ -140,8 +141,9 @@ public class Imp extends NPC {
|
|||
}
|
||||
|
||||
public static class Quest {
|
||||
|
||||
private static boolean alternative;
|
||||
|
||||
public static int depth;
|
||||
private static boolean alternative;
|
||||
|
||||
private static boolean spawned;
|
||||
private static boolean given;
|
||||
|
@ -247,7 +249,7 @@ public class Imp extends NPC {
|
|||
public static void complete() {
|
||||
reward = null;
|
||||
completed = true;
|
||||
|
||||
Statistics.questScores[3] = 4000;
|
||||
Notes.remove( Notes.Landmark.IMP );
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,9 @@ public class LanFire extends NPC {
|
|||
hero.healIcehp(Math.max(0, 3));
|
||||
GameScene.pickUp(chargrilledMeat, Dungeon.hero.pos);
|
||||
chargrilledMeat.quantity(3).collect();
|
||||
mysteryMeat.quantity(mysteryMeat.quantity() - 3);
|
||||
//mysteryMeat.detach(hero.belongings.backpack);
|
||||
mysteryMeat.detach(hero.belongings.backpack);
|
||||
mysteryMeat.detach(hero.belongings.backpack);
|
||||
mysteryMeat.detach(hero.belongings.backpack);
|
||||
hero.spend(9f);
|
||||
hero.busy();
|
||||
hero.sprite.operate(hero.pos);
|
||||
|
|
|
@ -25,6 +25,7 @@ import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
|||
import static com.shatteredpixel.shatteredpixeldungeon.items.Generator.randomArtifact;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.FlameC02;
|
||||
|
@ -430,6 +431,7 @@ public class RedDragon extends NPC {
|
|||
GLog.b( Messages.get(RedDragon.class, "find_me") );
|
||||
//Sample.INSTANCE.play( Assets.Sounds.GHOST );
|
||||
processed = true;
|
||||
Statistics.questScores[2] += 4000;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
|
@ -195,8 +196,9 @@ public class Wandmaker extends NPC {
|
|||
|
||||
public static class Quest {
|
||||
|
||||
private static int type;
|
||||
// 1 = corpse dust quest
|
||||
public static int type;
|
||||
public static int depth;
|
||||
// 1 = corpse dust quest
|
||||
// 2 = elemental embers quest
|
||||
// 3 = rotberry quest
|
||||
|
||||
|
@ -342,7 +344,7 @@ public class Wandmaker extends NPC {
|
|||
public static void complete() {
|
||||
wand1 = null;
|
||||
wand2 = null;
|
||||
|
||||
Statistics.questScores[1] = 2000;
|
||||
Notes.remove( Notes.Landmark.WANDMAKER );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LamellarArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LeatherArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.MailArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.PlateArmor;
|
||||
|
@ -415,8 +416,9 @@ public class Generator {
|
|||
LeatherArmor.class,
|
||||
MailArmor.class,
|
||||
ScaleArmor.class,
|
||||
PlateArmor.class };
|
||||
ARMOR.probs = new float[]{ 0, 0, 0, 0, 0 };
|
||||
PlateArmor.class,
|
||||
LamellarArmor.class};
|
||||
ARMOR.probs = new float[]{ 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
//see Generator.randomMissile
|
||||
MISSILE.classes = new Class<?>[]{};
|
||||
|
@ -573,7 +575,7 @@ public class Generator {
|
|||
}
|
||||
|
||||
public static Armor randomArmor(){
|
||||
return randomArmor(Dungeon.depth / 5);
|
||||
return randomArmor((Dungeon.depth + 1) / 3);
|
||||
}
|
||||
|
||||
public static Armor randomArmor(int floorSet) {
|
||||
|
|
|
@ -55,7 +55,7 @@ abstract public class ClassArmor extends Armor {
|
|||
public float charge = 0;
|
||||
|
||||
public ClassArmor() {
|
||||
super( 5 );
|
||||
super( 6 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class LamellarArmor extends Armor {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.ARMOR_LAMELLAR;
|
||||
}
|
||||
|
||||
public LamellarArmor() {
|
||||
super( 6 );
|
||||
}
|
||||
|
||||
}
|
|
@ -55,8 +55,6 @@ public class SandalsOfNature extends Artifact {
|
|||
levelCap = 3;
|
||||
|
||||
charge = 0;
|
||||
|
||||
defaultAction = this.level() == 10 ? AC_ROOT : AC_FEED;
|
||||
}
|
||||
|
||||
public static final String AC_FEED = "FEED";
|
||||
|
@ -88,7 +86,6 @@ public class SandalsOfNature extends Artifact {
|
|||
else if (charge == 0) GLog.i( Messages.get(this, "no_charge") );
|
||||
else {
|
||||
Buff.prolong(hero, Roots.class, Roots.DURATION);
|
||||
//TODO NEED FIXED
|
||||
Buff.affect(hero, Earthroot.Armor.class).level(charge,hero);
|
||||
CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
|
||||
Camera.main.shake(1, 0.4f);
|
||||
|
|
|
@ -228,12 +228,12 @@ public class BloodthirstyThorn extends MeleeWeapon {
|
|||
|
||||
@Override
|
||||
public int min(int lvl) {
|
||||
return 4 +lvl*2;
|
||||
return 2 +lvl*2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max(int lvl) {
|
||||
return 14 + lvl*7;
|
||||
return 7 + lvl*7;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.HuntressArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LamellarArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LeatherArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.MageArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.MailArmor;
|
||||
|
@ -223,6 +224,7 @@ public enum Catalog {
|
|||
ARMOR.seen.put( MailArmor.class, false);
|
||||
ARMOR.seen.put( ScaleArmor.class, false);
|
||||
ARMOR.seen.put( PlateArmor.class, false);
|
||||
ARMOR.seen.put( LamellarArmor.class, false);
|
||||
ARMOR.seen.put( WarriorArmor.class, false);
|
||||
ARMOR.seen.put( MageArmor.class, false);
|
||||
ARMOR.seen.put( RogueArmor.class, false);
|
||||
|
|
|
@ -103,7 +103,19 @@ import java.util.HashSet;
|
|||
|
||||
public abstract class Level implements Bundlable {
|
||||
|
||||
//some buff effects have special logic or are cancelled from the hero before transitioning levels
|
||||
public static void beforeTransition(){
|
||||
|
||||
//time freeze effects need to resolve their pressed cells before transitioning
|
||||
// TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff(TimekeepersHourglass.timeFreeze.class);
|
||||
// if (timeFreeze != null) timeFreeze.disarmPresses();
|
||||
// Swiftthistle.TimeBubble timeBubble = Dungeon.hero.buff(Swiftthistle.TimeBubble.class);
|
||||
// if (timeBubble != null) timeBubble.disarmPresses();
|
||||
|
||||
//iron stomach does not persist through chasm falling
|
||||
Talent.WarriorFoodImmunity foodImmune = Dungeon.hero.buff(Talent.WarriorFoodImmunity.class);
|
||||
if (foodImmune != null) foodImmune.detach();
|
||||
}
|
||||
|
||||
|
||||
//静态地图改变的轮子调用
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LamellarArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
|
@ -145,13 +146,18 @@ public class CrystalPathRoom extends SpecialRoom {
|
|||
);
|
||||
break;
|
||||
case 3:
|
||||
item = Generator.random(Random.oneOf(
|
||||
Generator.Category.ARMOR,
|
||||
Generator.Category.STONE,
|
||||
Generator.Category.WAND,
|
||||
Generator.Category.ARTIFACT)
|
||||
);
|
||||
if(Random.Int(10)==0){
|
||||
item = new LamellarArmor();
|
||||
} else {
|
||||
item = Generator.random(Random.oneOf(
|
||||
Generator.Category.ARMOR,
|
||||
Generator.Category.STONE,
|
||||
Generator.Category.WAND,
|
||||
Generator.Category.ARTIFACT)
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
level.drop(item, pos);
|
||||
if (clockwise){
|
||||
|
|
|
@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Torch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LamellarArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.LeatherArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.MailArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.PlateArmor;
|
||||
|
@ -171,13 +172,22 @@ public class ShopRoom extends SpecialRoom {
|
|||
case 16:
|
||||
w = (MeleeWeapon) Generator.random(Generator.wepTiers[3]);
|
||||
itemsToSpawn.add( Generator.random(Generator.misTiers[3]).quantity(2).identify(false) );
|
||||
itemsToSpawn.add( new ScaleArmor().identify(false) );
|
||||
if(Random.Int(10) == 0){
|
||||
itemsToSpawn.add( new LeatherArmor().identify(false) );
|
||||
} else {
|
||||
itemsToSpawn.add( new ScaleArmor().identify(false) );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 20: case 21:
|
||||
w = (MeleeWeapon) Generator.random(Generator.wepTiers[4]);
|
||||
itemsToSpawn.add( Generator.random(Generator.misTiers[4]).quantity(2).identify(false) );
|
||||
itemsToSpawn.add( new PlateArmor().identify(false) );
|
||||
if(Random.Int(10) == 0){
|
||||
itemsToSpawn.add( new LamellarArmor().identify(false) );
|
||||
} else {
|
||||
itemsToSpawn.add( new PlateArmor().identify(false) );
|
||||
}
|
||||
itemsToSpawn.add( new Torch() );
|
||||
itemsToSpawn.add( new Torch() );
|
||||
itemsToSpawn.add( new Torch() );
|
||||
|
|
|
@ -71,6 +71,8 @@ public class InterlevelScene extends PixelScene {
|
|||
|
||||
private static float fadeTime;
|
||||
|
||||
public static int returnBranch;
|
||||
|
||||
public enum Mode {
|
||||
DESCEND, ASCEND, CONTINUE, RESURRECT, RETURN, FALL, RESET, NONE,EXBOSS,GOBACK,FRGIRLBOSS,DR,
|
||||
}
|
||||
|
@ -429,7 +431,7 @@ public class InterlevelScene extends PixelScene {
|
|||
private void returnTo() throws IOException {
|
||||
|
||||
Mob.holdAllies( Dungeon.level );
|
||||
|
||||
Dungeon.branch = returnBranch;
|
||||
Dungeon.saveAll();
|
||||
Dungeon.depth = returnDepth;
|
||||
Level level = Dungeon.loadLevel( GamesInProgress.curSlot );
|
||||
|
|
|
@ -355,16 +355,19 @@ public class ItemSpriteSheet {
|
|||
public static final int ARMOR_MAIL = ARMOR+2;
|
||||
public static final int ARMOR_SCALE = ARMOR+3;
|
||||
public static final int ARMOR_PLATE = ARMOR+4;
|
||||
public static final int ARMOR_WARRIOR = ARMOR+5;
|
||||
public static final int ARMOR_MAGE = ARMOR+6;
|
||||
public static final int ARMOR_ROGUE = ARMOR+7;
|
||||
public static final int ARMOR_HUNTRESS = ARMOR+8;
|
||||
|
||||
public static final int ARMOR_LAMELLAR = ARMOR+5;
|
||||
public static final int ARMOR_WARRIOR = ARMOR+6;
|
||||
public static final int ARMOR_MAGE = ARMOR+7;
|
||||
public static final int ARMOR_ROGUE = ARMOR+8;
|
||||
public static final int ARMOR_HUNTRESS = ARMOR+9;
|
||||
static{
|
||||
assignItemRect(ARMOR_CLOTH, 14, 14);
|
||||
assignItemRect(ARMOR_LEATHER, 15, 15);
|
||||
assignItemRect(ARMOR_MAIL, 15, 15);
|
||||
assignItemRect(ARMOR_SCALE, 16, 16);
|
||||
assignItemRect(ARMOR_PLATE, 15, 15);
|
||||
assignItemRect(ARMOR_LAMELLAR, 14, 14);
|
||||
assignItemRect(ARMOR_WARRIOR, 15, 13);
|
||||
assignItemRect(ARMOR_MAGE, 13, 13);
|
||||
assignItemRect(ARMOR_ROGUE, 11, 13);
|
||||
|
|
|
@ -49,10 +49,10 @@ public class StatueSprite extends MobSprite {
|
|||
play( idle );
|
||||
}
|
||||
|
||||
private static int[] tierFrames = {0, 21, 32, 43, 54, 65};
|
||||
private static int[] tierFrames = {0, 21, 32, 43, 54, 65, 76};
|
||||
|
||||
public void setArmor( int tier ){
|
||||
int c = tierFrames[(int)GameMath.gate(0, tier, 5)];
|
||||
int c = tierFrames[(int)GameMath.gate(0, tier, 6)];
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 12, 15 );
|
||||
|
||||
|
|
|
@ -112,7 +112,11 @@ public enum Icons {
|
|||
KRISTJAN,
|
||||
CUBE_CODE,
|
||||
PURIGRO,
|
||||
ARCNOR;
|
||||
ARCNOR,
|
||||
|
||||
PASTE,
|
||||
|
||||
COPY;
|
||||
|
||||
public Image get() {
|
||||
return get( this );
|
||||
|
@ -168,6 +172,12 @@ public enum Icons {
|
|||
case RIGHTBUTTON:
|
||||
icon.frame( icon.texture.uvRectBySize( 97, 16, 9, 9 ) );
|
||||
break;
|
||||
case PASTE:
|
||||
icon.frame( icon.texture.uvRectBySize( 113, 16, 13, 13 ) );
|
||||
break;
|
||||
case COPY:
|
||||
icon.frame( icon.texture.uvRectBySize( 129, 16, 13, 13 ) );
|
||||
break;
|
||||
|
||||
case EXIT:
|
||||
icon.frame( icon.texture.uvRectBySize( 0, 32, 15, 11 ) );
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
|
||||
public class LevelChecker {
|
||||
|
||||
private static final int SSS_SCORE = 10000;
|
||||
private static final int SS_SCORE = 8000;
|
||||
private static final int S_SCORE = 5000;
|
||||
private static final int A_SCORE = 4500;
|
||||
private static final int B_SCORE = 6000;
|
||||
private static final int C_SCORE = 5000;
|
||||
private static final int D_SCORE = 4000;
|
||||
private static final int E_SCORE = 3000;
|
||||
|
||||
public String checkLevel() {
|
||||
int totalScore = Statistics.totalScore;
|
||||
float chalMultiplier = Statistics.chalMultiplier;
|
||||
boolean amuletObtained = Statistics.amuletObtained;
|
||||
|
||||
String level;
|
||||
|
||||
if (totalScore >= SSS_SCORE * chalMultiplier * (amuletObtained ? 1 : 5)) {
|
||||
level = "SSS";
|
||||
} else if (totalScore >= SS_SCORE * chalMultiplier * (amuletObtained ? 1 : 4)) {
|
||||
level = "SS";
|
||||
} else if (totalScore >= S_SCORE * chalMultiplier * (amuletObtained ? 1 : 3)) {
|
||||
level = "S";
|
||||
} else if (totalScore >= A_SCORE * chalMultiplier * (amuletObtained ? 1 : 2)) {
|
||||
level = "A";
|
||||
} else if (totalScore >= B_SCORE * chalMultiplier * (amuletObtained ? 1 : 2)) {
|
||||
level = "B";
|
||||
} else if (totalScore >= C_SCORE * chalMultiplier * (amuletObtained ? 1 : 2)) {
|
||||
level = "C";
|
||||
} else if (totalScore >= D_SCORE * chalMultiplier * (amuletObtained ? 1 : 2)) {
|
||||
level = "D";
|
||||
} else if (totalScore >= E_SCORE * chalMultiplier) {
|
||||
level = "E";
|
||||
} else {
|
||||
level = "F";
|
||||
}
|
||||
|
||||
return level;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,199 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.EnergyCrystal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CeremonialCandle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Pickaxe;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ScrollOfAwareness extends Scroll {
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.SCROLL_FORESIGHT;
|
||||
image = ItemSpriteSheet.SCROLL_YNGVI;
|
||||
unique = true;
|
||||
}
|
||||
|
||||
List<Class<? extends Item>> blacklist;
|
||||
|
||||
private void addTextItems(String caption, ArrayList<Heap> items, StringBuilder builder) {
|
||||
if (!items.isEmpty()) {
|
||||
builder.append(caption + ":\n");
|
||||
|
||||
for (Heap h : items) {
|
||||
Item i = h.peek();
|
||||
|
||||
if (((i instanceof Armor && ((Armor) i).hasGoodGlyph()) ||
|
||||
(i instanceof Weapon && ((Weapon) i).hasGoodEnchant()) ||
|
||||
(i instanceof Ring) || (i instanceof Wand) || (i instanceof Artifact)) && i.cursed)
|
||||
builder.append("- cursed " + i.toString().toLowerCase());
|
||||
|
||||
else
|
||||
builder.append("- " + i.toString().toLowerCase());
|
||||
|
||||
if (h.type != Heap.Type.HEAP)
|
||||
builder.append(" (" + h.toString().toLowerCase() + ")");
|
||||
|
||||
builder.append("\n");
|
||||
}
|
||||
|
||||
builder.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
private void addTextQuest(String caption, ArrayList<Item> items, StringBuilder builder) {
|
||||
if (!items.isEmpty()) {
|
||||
builder.append(caption + ":\n");
|
||||
|
||||
for (Item i : items) {
|
||||
if (i.cursed)
|
||||
builder.append("- cursed " + i.toString().toLowerCase() + "\n");
|
||||
|
||||
else
|
||||
builder.append("- " + i.toString().toLowerCase() + "\n");
|
||||
}
|
||||
|
||||
builder.append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRead() {
|
||||
blacklist = Arrays.asList(Gold.class, Dewdrop.class, IronKey.class, GoldenKey.class, CrystalKey.class, EnergyCrystal.class,
|
||||
CorpseDust.class, Embers.class, CeremonialCandle.class, Pickaxe.class);
|
||||
|
||||
List<Heap> heaps = Dungeon.level.heaps.valueList();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
ArrayList<Heap> scrolls = new ArrayList<>();
|
||||
ArrayList<Heap> potions = new ArrayList<>();
|
||||
ArrayList<Heap> equipment = new ArrayList<>();
|
||||
ArrayList<Heap> rings = new ArrayList<>();
|
||||
ArrayList<Heap> artifacts = new ArrayList<>();
|
||||
ArrayList<Heap> wands = new ArrayList<>();
|
||||
ArrayList<Heap> others = new ArrayList<>();
|
||||
|
||||
// list quest rewards
|
||||
if (Ghost.Quest.armor != null && Ghost.Quest.depth == Dungeon.depth) {
|
||||
ArrayList<Item> rewards = new ArrayList<>();
|
||||
rewards.add(Ghost.Quest.armor);
|
||||
rewards.add(Ghost.Quest.weapon);
|
||||
|
||||
addTextQuest("_Ghost quest rewards_", rewards, builder);
|
||||
}
|
||||
|
||||
if (Wandmaker.Quest.wand1 != null && Wandmaker.Quest.depth == Dungeon.depth) {
|
||||
ArrayList<Item> rewards = new ArrayList<>();
|
||||
rewards.add(Wandmaker.Quest.wand1);
|
||||
rewards.add(Wandmaker.Quest.wand2);
|
||||
|
||||
builder.append("_Wandmaker quest item_: ");
|
||||
|
||||
switch (Wandmaker.Quest.type) {
|
||||
case 1: default:
|
||||
builder.append("corpse dust\n\n");
|
||||
break;
|
||||
case 2:
|
||||
builder.append("fresh embers\n\n");
|
||||
break;
|
||||
case 3:
|
||||
builder.append("rotberry seed\n\n");
|
||||
}
|
||||
|
||||
addTextQuest("_Wandmaker quest rewards_", rewards, builder);
|
||||
}
|
||||
|
||||
if (Imp.Quest.reward != null && Imp.Quest.depth == Dungeon.depth) {
|
||||
ArrayList<Item> rewards = new ArrayList<>();
|
||||
rewards.add(Imp.Quest.reward.identify());
|
||||
|
||||
addTextQuest("_Imp quest reward_", rewards, builder);
|
||||
}
|
||||
|
||||
// list items
|
||||
for (Heap h : heaps) {
|
||||
Item item = h.peek();
|
||||
|
||||
if (h.type == Heap.Type.FOR_SALE) continue;
|
||||
else if (blacklist.contains(item.getClass())) continue;
|
||||
else if (item instanceof Scroll) scrolls.add(h);
|
||||
else if (item instanceof Potion) potions.add(h);
|
||||
else if (item instanceof MeleeWeapon || item instanceof Armor) equipment.add(h);
|
||||
else if (item instanceof Ring) rings.add(h);
|
||||
else if (item instanceof Artifact) artifacts.add( h);
|
||||
else if (item instanceof Wand) wands.add(h);
|
||||
else others.add(h);
|
||||
}
|
||||
|
||||
addTextItems("_Scrolls_", scrolls, builder);
|
||||
addTextItems("_Potions_", potions, builder);
|
||||
addTextItems("_Equipment_", equipment, builder);
|
||||
addTextItems("_Rings_", rings, builder);
|
||||
addTextItems("_Artifacts_", artifacts, builder);
|
||||
addTextItems("_Wands_", wands, builder);
|
||||
addTextItems("_Other_", others, builder);
|
||||
|
||||
if (Dungeon.depth % 5 == 0) {
|
||||
GLog.i("No items found on this level");
|
||||
} else {
|
||||
builder.setLength(builder.length()-2); // remove trailing newlines
|
||||
GameScene.show(new ScrollableWindow(builder.toString()));
|
||||
}
|
||||
|
||||
collect();
|
||||
|
||||
Sample.INSTANCE.play( Assets.Sounds.READ );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "Scroll of Awareness";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append("When this scroll is read, it will list all the generated items in the current floor ");
|
||||
builder.append("and any quest rewards. ");
|
||||
builder.append("This scroll won't be consumed after being read.");
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override public boolean isIdentified() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public boolean isKnown() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
|
||||
public class ScrollableWindow extends Window {
|
||||
private static final int WIDTH_MIN = 180, WIDTH_MAX = 220;
|
||||
|
||||
public ScrollableWindow(String message) {
|
||||
int width = WIDTH_MIN;
|
||||
|
||||
RenderedTextBlock text = PixelScene.renderTextBlock(6);
|
||||
text.text(message, width);
|
||||
|
||||
while (PixelScene.landscape()
|
||||
&& text.bottom() > (PixelScene.MIN_HEIGHT_L - 10)
|
||||
&& width < WIDTH_MAX) {
|
||||
text.maxWidth(width += 20);
|
||||
}
|
||||
|
||||
int height = (int)text.bottom();
|
||||
int maxHeight = (int)(PixelScene.uiCamera.height * 0.9);
|
||||
boolean needScrollPane = height > maxHeight;
|
||||
|
||||
if (needScrollPane) height = maxHeight;
|
||||
resize((int)text.width(), height);
|
||||
|
||||
if (needScrollPane) {
|
||||
Component wrapper = new Component();
|
||||
wrapper.setSize(text.width(), text.height());
|
||||
ScrollPane sp = new ScrollPane(wrapper);
|
||||
add(sp);
|
||||
wrapper.add(text);
|
||||
text.setPos(0, 0);
|
||||
sp.setSize(wrapper.width(), height);
|
||||
} else {
|
||||
add(text);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -181,6 +181,22 @@ public class WndHero extends WndTabbed {
|
|||
infoButton.setRect(title.right(), 0, 16, 16);
|
||||
add(infoButton);
|
||||
|
||||
// IconButton scoreButton = new IconButton(Icons.get(Icons.BUFFS)){
|
||||
// @Override
|
||||
// protected void onClick() {
|
||||
// super.onClick();
|
||||
// ShatteredPixelDungeon.scene().addToFront(new WndScoreBreakdown());
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected String hoverText() {
|
||||
// return Messages.titleCase(Messages.get(WndKeyBindings.class, "score_info"));
|
||||
// }
|
||||
//
|
||||
// };
|
||||
// scoreButton.setRect(title.right()-16, 0, 16, 16);
|
||||
// add(scoreButton);
|
||||
|
||||
pos = title.bottom() + GAP;
|
||||
|
||||
int strBonus = hero.STR() - hero.STR;
|
||||
|
|
|
@ -26,38 +26,42 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesGrid;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesList;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Button;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.IconButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TalentButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TalentsPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.DungeonSeed;
|
||||
import com.watabou.noosa.ColorBlock;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Group;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
import com.watabou.utils.DeviceCompat;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
public class WndRanking extends WndTabbed {
|
||||
|
||||
private static final int WIDTH = 115;
|
||||
private static final int HEIGHT = 144;
|
||||
|
||||
private Rankings.Record record;
|
||||
private static Thread thread;
|
||||
private String error = null;
|
||||
|
||||
|
@ -72,7 +76,7 @@ public class WndRanking extends WndTabbed {
|
|||
hide();
|
||||
return;
|
||||
}
|
||||
|
||||
this.record = rec;
|
||||
thread = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -166,96 +170,128 @@ public class WndRanking extends WndTabbed {
|
|||
public StatsTab() {
|
||||
super();
|
||||
|
||||
String name = Dungeon.hero.className();
|
||||
IconTitle title = new IconTitle();
|
||||
Hero var4 = Dungeon.hero;
|
||||
title.icon(HeroSprite.avatar(var4.heroClass, var4.tier()));
|
||||
if (Dungeon.hero.name().equals(Dungeon.hero.className())) {
|
||||
title.label(Messages.get(this, "title", Dungeon.hero.lvl, name).toUpperCase(Locale.ENGLISH));
|
||||
} else {
|
||||
StringBuilder csname = new StringBuilder();
|
||||
csname.append(Dungeon.hero.name());
|
||||
csname.append("\n");
|
||||
csname.append(Messages.get(this, "title", Dungeon.hero.lvl, name).toUpperCase(Locale.ENGLISH));
|
||||
title.label(csname.toString());
|
||||
String heroClass = record.heroClass.name();
|
||||
if (Dungeon.hero != null){
|
||||
heroClass = Dungeon.hero.className();
|
||||
}
|
||||
|
||||
title.color(16777028);
|
||||
title.setRect(0.0F, 0.0F, 115.0F, 0.0F);
|
||||
this.add(title);
|
||||
float pos = title.bottom() + GAP;
|
||||
IconTitle title = new IconTitle();
|
||||
title.icon( HeroSprite.avatar( record.heroClass, record.armorTier ) );
|
||||
title.label( Messages.get(this, "title", record.herolevel, heroClass ).toUpperCase( Locale.ENGLISH ) );
|
||||
title.color(Window.TITLE_COLOR);
|
||||
title.setRect( 0, 0, WIDTH, 0 );
|
||||
add( title );
|
||||
|
||||
RedButton btnTalents = new RedButton( Messages.get(this, "talents") ){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
//removes talents from upper tiers
|
||||
int tiers = 1;
|
||||
if (Dungeon.hero.lvl >= 6) tiers++;
|
||||
if (Dungeon.hero.lvl >= 12 && Dungeon.hero.subClass != HeroSubClass.NONE) tiers++;
|
||||
if (Dungeon.hero.lvl >= 20 && Dungeon.hero.armorAbility != null) tiers++;
|
||||
while (Dungeon.hero.talents.size() > tiers){
|
||||
Dungeon.hero.talents.remove(Dungeon.hero.talents.size()-1);
|
||||
}
|
||||
Game.scene().addToFront( new Window(){
|
||||
{
|
||||
TalentsPane p = new TalentsPane(TalentButton.Mode.INFO);
|
||||
add(p);
|
||||
p.setPos(0, 0);
|
||||
p.setSize(120, p.content().height());
|
||||
resize((int)p.width(), (int)p.height());
|
||||
p.setPos(0, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
btnTalents.icon(Icons.get(Icons.TALENT));
|
||||
btnTalents.setRect( (WIDTH - btnTalents.reqWidth()+2)/2, pos, btnTalents.reqWidth()+2 , 16 );
|
||||
add(btnTalents);
|
||||
if (Dungeon.hero != null && Dungeon.seed != -1){
|
||||
GAP--;
|
||||
}
|
||||
|
||||
pos = btnTalents.bottom();
|
||||
float pos = title.bottom() + 1;
|
||||
|
||||
if (Dungeon.challenges > 0) {
|
||||
RedButton btnChallenges = new RedButton( Messages.get(this, "challenges") ) {
|
||||
RenderedTextBlock date = PixelScene.renderTextBlock(record.date, 7);
|
||||
date.hardlight(0xCCCCCC);
|
||||
date.setPos(0, pos);
|
||||
add(date);
|
||||
|
||||
RenderedTextBlock version = PixelScene.renderTextBlock(record.version, 7);
|
||||
version.hardlight(0xCCCCCC);
|
||||
version.setPos(WIDTH-version.width(), pos);
|
||||
add(version);
|
||||
|
||||
pos = date.bottom()+5;
|
||||
|
||||
NumberFormat num = NumberFormat.getInstance(Locale.US);
|
||||
|
||||
if (Dungeon.hero == null){
|
||||
pos = statSlot( this, Messages.get(this, "score"), num.format( record.score ), pos );
|
||||
pos += GAP;
|
||||
|
||||
Image errorIcon = Icons.WARNING.get();
|
||||
errorIcon.y = pos;
|
||||
add(errorIcon);
|
||||
|
||||
RenderedTextBlock errorText = PixelScene.renderTextBlock(Messages.get(WndRanking.class, "error"), 6);
|
||||
errorText.maxWidth((int)(WIDTH-errorIcon.width()-GAP));
|
||||
errorText.setPos(errorIcon.width()+GAP, pos + (errorIcon.height()-errorText.height())/2);
|
||||
add(errorText);
|
||||
|
||||
} else {
|
||||
|
||||
pos = statSlot(this, Messages.get(this, "score"), num.format(Statistics.totalScore), pos);
|
||||
|
||||
IconButton scoreInfo = new IconButton(Icons.get(Icons.INFO)) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
Game.scene().add( new WndChallenges( Dungeon.challenges, false,null ) );
|
||||
super.onClick();
|
||||
ShatteredPixelDungeon.scene().addToFront(new WndScoreBreakdown());
|
||||
}
|
||||
};
|
||||
scoreInfo.setSize(16, 16);
|
||||
scoreInfo.setPos(WIDTH - scoreInfo.width(), pos - 10 - GAP);
|
||||
add(scoreInfo);
|
||||
|
||||
btnChallenges.icon(Icons.get(Icons.CHALLENGE_ON));
|
||||
btnChallenges.setSize( btnChallenges.reqWidth()+2, 16 );
|
||||
add( btnChallenges );
|
||||
pos += GAP;
|
||||
|
||||
float left = (WIDTH - btnTalents.width() - btnChallenges.width())/3f;
|
||||
int strBonus = Dungeon.hero.STR() - Dungeon.hero.STR;
|
||||
if (strBonus > 0)
|
||||
pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + " + " + strBonus, pos);
|
||||
else if (strBonus < 0)
|
||||
pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + " - " + -strBonus, pos);
|
||||
else
|
||||
pos = statSlot(this, Messages.get(this, "str"), Integer.toString(Dungeon.hero.STR), pos);
|
||||
pos = statSlot(this, Messages.get(this, "duration"), num.format((int) Statistics.duration), pos);
|
||||
|
||||
btnTalents.setPos(left, btnTalents.top());
|
||||
btnChallenges.setPos(btnTalents.right() + left, btnTalents.top());
|
||||
if (Dungeon.seed != -1) {
|
||||
if (!Dungeon.customSeedText.isEmpty()) {
|
||||
pos = statSlot(this, Messages.get(this, "custom_seed"), "_" + Dungeon.customSeedText + "_", pos);
|
||||
} else {
|
||||
pos = statSlot(this, Messages.get(this, "seed"), DungeonSeed.convertToCode(Dungeon.seed), pos);
|
||||
}
|
||||
} else {
|
||||
pos += GAP + 5;
|
||||
}
|
||||
|
||||
pos += GAP;
|
||||
|
||||
pos = statSlot(this, Messages.get(this, "enemies"), num.format(Statistics.enemiesSlain), pos);
|
||||
pos = statSlot(this, Messages.get(this, "gold"), num.format(Statistics.goldCollected), pos);
|
||||
pos = statSlot(this, Messages.get(this, "food"), num.format(Statistics.foodEaten), pos);
|
||||
pos = statSlot(this, Messages.get(this, "alchemy"), num.format(Statistics.itemsCrafted), pos);
|
||||
}
|
||||
|
||||
pos += GAP;
|
||||
int buttontop = HEIGHT - 16;
|
||||
|
||||
int strBonus = Dungeon.hero.STR() - Dungeon.hero.STR;
|
||||
if (strBonus > 0) pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + " + " + strBonus, pos);
|
||||
else if (strBonus < 0) pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + " - " + -strBonus, pos );
|
||||
else pos = statSlot(this, Messages.get(this, "str"), Integer.toString(Dungeon.hero.STR), pos);
|
||||
pos = statSlot( this, Messages.get(this, "health"), Integer.toString( Dungeon.hero.HT ), pos );
|
||||
if (Dungeon.hero != null && Dungeon.seed != -1 &&
|
||||
(DeviceCompat.isDebug() || Badges.isUnlocked(Badges.Badge.VICTORY))){
|
||||
final Image icon = new ItemSprite(ItemSpriteSheet.SEED_SKYBLUEFIRE);
|
||||
RedButton btnSeed = new RedButton(Messages.get(this, "copy_seed")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
ShatteredPixelDungeon.scene().addToFront(new WndOptions(new Image(icon),
|
||||
Messages.get(WndRanking.StatsTab.this, "copy_seed"),
|
||||
Messages.get(WndRanking.StatsTab.this, "copy_seed_desc"),
|
||||
Messages.get(WndRanking.StatsTab.this, "copy_seed_copy"),
|
||||
Messages.get(WndRanking.StatsTab.this, "copy_seed_cancel")){
|
||||
@Override
|
||||
protected void onSelect(int index) {
|
||||
super.onSelect(index);
|
||||
if (index == 0){
|
||||
SPDSettings.customSeed(DungeonSeed.convertToCode(Dungeon.seed));
|
||||
icon.hardlight(1f, 1.5f, 0.67f);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
if (DungeonSeed.convertFromText(SPDSettings.customSeed()) == Dungeon.seed){
|
||||
icon.hardlight(1f, 1.5f, 0.67f);
|
||||
}
|
||||
btnSeed.icon(icon);
|
||||
btnSeed.setRect(0, buttontop, 115, 16);
|
||||
add(btnSeed);
|
||||
}
|
||||
|
||||
pos += GAP;
|
||||
|
||||
pos = statSlot( this, Messages.get(this, "duration"), Integer.toString( (int)Statistics.duration ), pos );
|
||||
|
||||
pos += GAP;
|
||||
|
||||
pos = statSlot( this, Messages.get(this, "depth"), Integer.toString( Statistics.deepestFloor ), pos );
|
||||
pos = statSlot( this, Messages.get(this, "enemies"), Integer.toString( Statistics.enemiesSlain ), pos );
|
||||
pos = statSlot( this, Messages.get(this, "gold"), Integer.toString( Statistics.goldCollected ), pos );
|
||||
|
||||
pos += GAP;
|
||||
|
||||
pos = statSlot( this, Messages.get(this, "food"), Integer.toString( Statistics.foodEaten ), pos );
|
||||
pos = statSlot( this, Messages.get(this, "alchemy"), Integer.toString( Statistics.itemsCrafted ), pos );
|
||||
|
||||
pos = statSlot( this, Messages.get(this, "ankhs"), Integer.toString( Statistics.ankhsUsed ), pos );
|
||||
}
|
||||
|
||||
private float statSlot( Group parent, String label, String value, float pos ) {
|
||||
|
@ -265,7 +301,7 @@ public class WndRanking extends WndTabbed {
|
|||
parent.add( txt );
|
||||
|
||||
txt = PixelScene.renderTextBlock( value, 7 );
|
||||
txt.setPos(WIDTH * 0.7f, pos);
|
||||
txt.setPos(WIDTH * 0.6f, pos);
|
||||
PixelScene.align(txt);
|
||||
parent.add( txt );
|
||||
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.Group;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
public class WndScoreBreakdown extends Window {
|
||||
|
||||
private static final int WIDTH = 115;
|
||||
|
||||
private int GAP = 4;
|
||||
|
||||
public WndScoreBreakdown(){
|
||||
|
||||
IconTitle title = new IconTitle( Icons.get(Icons.INFO), Messages.get(this, "title"));
|
||||
title.setRect(0, 0, WIDTH, 16);
|
||||
add(title);
|
||||
|
||||
float pos = title.bottom()+2;
|
||||
|
||||
NumberFormat num = NumberFormat.getInstance(Locale.US);
|
||||
|
||||
pos = statSlot(this, Messages.get(this, "progress_title"),
|
||||
num.format(Statistics.progressScore), pos, Statistics.progressScore >= 50_000);
|
||||
pos = addInfo(this, Messages.get(this, "progress_desc"), pos);
|
||||
pos = statSlot(this, Messages.get(this, "treasure_title"),
|
||||
num.format(Statistics.treasureScore), pos, Statistics.treasureScore >= 20_000);
|
||||
pos = addInfo(this, Messages.get(this, "treasure_desc"), pos);
|
||||
pos = statSlot(this, Messages.get(this, "explore_title"),
|
||||
num.format(Statistics.exploreScore), pos, Statistics.exploreScore >= 20_000);
|
||||
pos = addInfo(this, Messages.get(this, "explore_desc"), pos);
|
||||
pos = statSlot(this, Messages.get(this, "bosses_title"),
|
||||
num.format(Statistics.totalBossScore), pos, Statistics.totalBossScore >= 15_000);
|
||||
pos = addInfo(this, Messages.get(this, "bosses_desc"), pos);
|
||||
pos = statSlot(this, Messages.get(this, "quests_title"),
|
||||
num.format(Statistics.totalQuestScore), pos, Statistics.totalQuestScore >= 10_000);
|
||||
pos = addInfo(this, Messages.get(this, "quests_desc"), pos);
|
||||
|
||||
if (Statistics.winMultiplier > 1) {
|
||||
pos = statSlot(this, Messages.get(this, "win_multiplier"), Statistics.winMultiplier + "x", pos, false);
|
||||
}
|
||||
if (Statistics.chalMultiplier > 1) {
|
||||
pos = statSlot(this, Messages.get(this, "challenge_multiplier"), Statistics.chalMultiplier + "x", pos, false);
|
||||
}
|
||||
pos = statSlot(this, Messages.get(this, "total"), num.format(Statistics.totalScore), pos, false);
|
||||
|
||||
//评分系统
|
||||
LevelChecker result = new LevelChecker();
|
||||
pos = statSlot(this, Messages.get(this, "total_level"), result.checkLevel(), pos, false);
|
||||
|
||||
resize(WIDTH, (int)pos);
|
||||
|
||||
}
|
||||
|
||||
private float statSlot(Group parent, String label, String value, float pos, boolean highlight ) {
|
||||
|
||||
RenderedTextBlock txt = PixelScene.renderTextBlock( label, 7 );
|
||||
if (highlight) txt.hardlight(Window.TITLE_COLOR);
|
||||
txt.setPos(0, pos);
|
||||
parent.add( txt );
|
||||
|
||||
txt = PixelScene.renderTextBlock( value, 7 );
|
||||
if (highlight) txt.hardlight(Window.TITLE_COLOR);
|
||||
txt.setPos(WIDTH * 0.7f, pos);
|
||||
PixelScene.align(txt);
|
||||
parent.add( txt );
|
||||
|
||||
return pos + GAP + txt.height();
|
||||
}
|
||||
|
||||
private float addInfo(Group parent, String info, float pos){
|
||||
|
||||
RenderedTextBlock txt = PixelScene.renderTextBlock( info, 5 );
|
||||
txt.maxWidth(WIDTH);
|
||||
txt.hardlight(0x999999);
|
||||
txt.setPos(0, pos-2);
|
||||
parent.add( txt );
|
||||
|
||||
return pos - 2 + GAP + txt.height();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -665,7 +665,7 @@ public class WndSettings extends WndTabbed {
|
|||
if (width > 200){
|
||||
ClassUI.setRect(0, bottom, width, SLIDER_HEIGHT);
|
||||
optSplashScreen.setRect(0, ClassUI.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
optFPSLimit.setRect(0, optSplashScreen.bottom() + GAP, width/2-1, SLIDER_HEIGHT);
|
||||
optFPSLimit.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
|
||||
quickslots.setRect(optFPSLimit.right(), optFPSLimit.top(), width/2, SLIDER_HEIGHT);
|
||||
wxts.visible = false;
|
||||
|
|
|
@ -21,34 +21,37 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.input.PointerEvent;
|
||||
import com.watabou.noosa.TextInput;
|
||||
import com.watabou.utils.DeviceCompat;
|
||||
|
||||
public class WndTextInput extends Window {
|
||||
|
||||
private static final int WIDTH = 130;
|
||||
private static final int W_LAND_EXTRA = 200; //extra width is sometimes used in landscape
|
||||
private static final int MARGIN = 2;
|
||||
private static final int WIDTH = 135;
|
||||
private static final int W_LAND_EXTRA = 220; //extra width is sometimes used in landscape
|
||||
private static final int MARGIN = 1;
|
||||
private static final int BUTTON_HEIGHT = 16;
|
||||
|
||||
protected TextInput textBox;
|
||||
|
||||
protected RedButton btnCopy;
|
||||
protected RedButton btnPaste;
|
||||
|
||||
public WndTextInput(final String title, final String body, final String initialValue, final int maxLength,
|
||||
final boolean multiLine, final String posTxt, final String negTxt) {
|
||||
super();
|
||||
|
||||
//need to offset to give space for the soft keyboard
|
||||
if (!DeviceCompat.isDesktop()) {
|
||||
if (PixelScene.landscape()) {
|
||||
offset(0, -45);
|
||||
} else {
|
||||
offset(0, multiLine ? -60 : -45);
|
||||
}
|
||||
if (PixelScene.landscape()) {
|
||||
offset(0, -45);
|
||||
} else {
|
||||
offset(0, multiLine ? -60 : -45);
|
||||
}
|
||||
|
||||
final int width;
|
||||
|
@ -67,14 +70,13 @@ public class WndTextInput extends Window {
|
|||
txtTitle.setPos((width - txtTitle.width()) / 2, 2);
|
||||
add(txtTitle);
|
||||
|
||||
pos = txtTitle.bottom() + 2 * MARGIN;
|
||||
pos = txtTitle.bottom() + 4 * MARGIN;
|
||||
}
|
||||
|
||||
if (body != null) {
|
||||
final RenderedTextBlock txtBody = PixelScene.renderTextBlock(body, 6);
|
||||
txtBody.maxWidth(width);
|
||||
txtBody.setPos(0, pos);
|
||||
|
||||
add(txtBody);
|
||||
|
||||
pos = txtBody.bottom() + 2 * MARGIN;
|
||||
|
@ -99,8 +101,59 @@ public class WndTextInput extends Window {
|
|||
} else {
|
||||
inputHeight = 36;
|
||||
}
|
||||
|
||||
float textBoxWidth = width-3*MARGIN-BUTTON_HEIGHT;
|
||||
|
||||
add(textBox);
|
||||
textBox.setRect(MARGIN, pos, width-2*MARGIN, inputHeight);
|
||||
textBox.setRect(MARGIN, pos, textBoxWidth, inputHeight);
|
||||
|
||||
btnCopy = new RedButton(""){
|
||||
@Override
|
||||
protected void onPointerDown() {
|
||||
super.onPointerDown();
|
||||
PointerEvent.clearKeyboardThisPress = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPointerUp() {
|
||||
super.onPointerUp();
|
||||
PointerEvent.clearKeyboardThisPress = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
textBox.copyToClipboard();
|
||||
}
|
||||
};
|
||||
btnCopy.icon(Icons.COPY.get());
|
||||
add(btnCopy);
|
||||
|
||||
btnPaste = new RedButton(""){
|
||||
@Override
|
||||
protected void onPointerDown() {
|
||||
super.onPointerDown();
|
||||
PointerEvent.clearKeyboardThisPress = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPointerUp() {
|
||||
super.onPointerUp();
|
||||
PointerEvent.clearKeyboardThisPress = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
textBox.pasteFromClipboard();
|
||||
}
|
||||
|
||||
};
|
||||
btnPaste.icon(Icons.PASTE.get());
|
||||
add(btnPaste);
|
||||
|
||||
btnCopy.setRect(textBoxWidth + 2*MARGIN, pos, BUTTON_HEIGHT+3, BUTTON_HEIGHT+10);
|
||||
btnPaste.setRect(textBoxWidth + 2*MARGIN, btnCopy.bottom()+MARGIN+2, BUTTON_HEIGHT+3, BUTTON_HEIGHT+10);
|
||||
|
||||
pos += inputHeight + MARGIN;
|
||||
|
||||
|
@ -125,27 +178,36 @@ public class WndTextInput extends Window {
|
|||
negativeBtn = null;
|
||||
}
|
||||
|
||||
float btnWidth = multiLine ? width-2*MARGIN : textBoxWidth;
|
||||
if (negTxt != null) {
|
||||
positiveBtn.setRect(MARGIN, pos, (width - MARGIN * 3) / 2, BUTTON_HEIGHT);
|
||||
positiveBtn.setRect(MARGIN, pos, (btnWidth - MARGIN) / 2, BUTTON_HEIGHT);
|
||||
add(positiveBtn);
|
||||
negativeBtn.setRect(positiveBtn.right() + MARGIN, pos, (width - MARGIN * 3) / 2, BUTTON_HEIGHT);
|
||||
negativeBtn.setRect(positiveBtn.right() + MARGIN, pos, (btnWidth - MARGIN) / 2, BUTTON_HEIGHT);
|
||||
add(negativeBtn);
|
||||
} else {
|
||||
positiveBtn.setRect(MARGIN, pos, width - MARGIN * 2, BUTTON_HEIGHT);
|
||||
positiveBtn.setRect(MARGIN, pos, btnWidth, BUTTON_HEIGHT);
|
||||
add(positiveBtn);
|
||||
}
|
||||
|
||||
pos += BUTTON_HEIGHT + MARGIN;
|
||||
pos += BUTTON_HEIGHT;
|
||||
|
||||
//need to resize first before laying out the text box, as it depends on the window's camera
|
||||
resize(width, (int) pos);
|
||||
|
||||
textBox.setRect(MARGIN, textBox.top(), width-2*MARGIN, inputHeight);
|
||||
textBox.setRect(MARGIN, textBox.top(), textBoxWidth, inputHeight);
|
||||
|
||||
PointerEvent.clearKeyboardThisPress = false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
super.update();
|
||||
btnCopy.enable(!textBox.getText().isEmpty());
|
||||
btnPaste.enable(Gdx.app.getClipboard().hasContents());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void offset(int xOffset, int yOffset) {
|
||||
super.offset(xOffset, yOffset);
|
||||
if (textBox != null){
|
||||
|
|
|
@ -229,7 +229,7 @@ public class WndTradeItem extends WndInfoItem {
|
|||
|
||||
//selling items in the sell interface doesn't spend time
|
||||
hero.spend(-hero.cooldown());
|
||||
|
||||
Statistics.totalScore += 400;
|
||||
new Gold( item.value() ).doPickUp( hero );
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ public class WndTradeItem extends WndInfoItem {
|
|||
} else {
|
||||
|
||||
Hero hero = Dungeon.hero;
|
||||
|
||||
Statistics.totalScore += 100;
|
||||
item = item.detach( hero.belongings.backpack );
|
||||
|
||||
//selling items in the sell interface doesn't spend time
|
||||
|
|