|
@ -3,7 +3,10 @@ apply plugin: 'com.google.gms.google-services'
|
|||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
|
||||
android {
|
||||
compileSdkVersion appAndroidCompileSDK
|
||||
compileSdkVersion 30
|
||||
|
||||
buildToolsVersion "30.0.2"
|
||||
// compileSdkVersion appAndroidCompileSDK
|
||||
compileOptions.sourceCompatibility = compileOptions.targetCompatibility = appJavaCompatibility
|
||||
|
||||
sourceSets.main.assets.srcDirs = [new File(project(':core').projectDir, "/src/main/assets")]
|
||||
|
@ -81,8 +84,6 @@ dependencies {
|
|||
|
||||
implementation project(path: ':services:news:shatteredNews')
|
||||
|
||||
// implementation project(path: ':services:analytics:analyticsFirebase')
|
||||
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:label="${appName}"
|
||||
android:exported="true"
|
||||
android:name=".AndroidGame"
|
||||
android:screenOrientation="nosensor"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize">
|
||||
|
|
|
@ -33,7 +33,6 @@ import com.badlogic.gdx.backends.android.AndroidApplication;
|
|||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
import com.badlogic.gdx.backends.android.AndroidAudio;
|
||||
import com.badlogic.gdx.backends.android.AsynchronousAndroidAudio;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.news.GameNesImpl;
|
||||
|
@ -48,8 +47,6 @@ public class AndroidGame extends AndroidApplication {
|
|||
|
||||
public static AndroidApplication instance;
|
||||
|
||||
public FirebaseAnalytics mFirebaseAnalytics;
|
||||
|
||||
private static AndroidPlatformSupport support;
|
||||
|
||||
@Override
|
||||
|
|
|
@ -198,7 +198,8 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
|||
} else if (Gdx.files.absolute("/system/fonts/DroidSans.ttf").exists()){
|
||||
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/DroidSans.ttf"));
|
||||
}
|
||||
if (!systemfont) {
|
||||
|
||||
|
||||
if (basicFontGenerator == null) {
|
||||
basicFontGenerator = fallbackFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
|
||||
}
|
||||
|
@ -206,7 +207,7 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
|||
fallbackFontGenerator = basicFontGenerator;
|
||||
basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel_font.ttf"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//android 7.0+. all asian fonts are nicely contained in one spot
|
||||
if (Gdx.files.absolute("/system/fonts/NotoSansCJK-Regular.ttc").exists()) {
|
||||
|
@ -216,9 +217,6 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
|||
case JAPANESE:
|
||||
typeFace = 0;
|
||||
break;
|
||||
// case KOREAN:
|
||||
// typeFace = 1;
|
||||
// break;
|
||||
case HARDCHINESE:
|
||||
case CHINESE:
|
||||
default:
|
||||
|
@ -284,6 +282,18 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
|||
break;
|
||||
}
|
||||
KRFontGenerator = SCFontGenerator = TCFontGenerator = JPFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/fusion_pixel.ttf"));
|
||||
} else {
|
||||
switch (SPDSettings.language()) {
|
||||
case CHINESE:
|
||||
fallbackFontGenerator = SCFontGenerator;
|
||||
break;
|
||||
case HARDCHINESE:
|
||||
fallbackFontGenerator = TCFontGenerator;
|
||||
break;
|
||||
case JAPANESE:
|
||||
fallbackFontGenerator = JPFontGenerator;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (basicFontGenerator != null) fonts.put(basicFontGenerator, new HashMap<>());
|
||||
|
|
|
@ -18,14 +18,14 @@ allprojects {
|
|||
appName = 'Magic Ling Pixel Dungeon'
|
||||
appPackageName = 'com.ansdomagiclingpixeldungeon.ling'
|
||||
|
||||
appVersionCode =903000
|
||||
appVersionName = '0.6.4.0-Beta9'
|
||||
appVersionCode =907300
|
||||
appVersionName = '0.6.5.0-Alpha2'
|
||||
|
||||
appJavaCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
appAndroidCompileSDK = 30
|
||||
appAndroidCompileSDK = 33
|
||||
appAndroidMinSDK = 19
|
||||
appAndroidTargetSDK = 30
|
||||
appAndroidTargetSDK = 33
|
||||
|
||||
gdxControllersVersion = '2.2.1'
|
||||
|
||||
|
|
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.7 KiB |
BIN
core/src/main/assets/interfaces/passwordbadges.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.7 KiB |
|
@ -1,5 +1,11 @@
|
|||
#####MLPD-P3文本
|
||||
|
||||
actors.mobs.spical.gnollhero.name=豺狼部族长老
|
||||
actors.mobs.spical.gnollhero.desc=与其他豺狼不同的是,它清楚最大的威胁不是冒险者。同时,它会使用古老的占卜魔法狩猎预知告知玩家即将要狩猎的稀有生物在何处。\n\n但它们并不是完全帮助冒险者,如果冒险者有出格的举动,部族长老会让冒险者知道”叛徒“的下场……
|
||||
actors.mobs.spical.gnollhero.chat_1=哦,看看这是谁,这不是为了寻找水晶之心的冒险者吗?
|
||||
actors.mobs.spical.gnollhero.chat_2=你和祂正式签下了狩猎契约?好吧,这个荒无人烟的地方确实有很多需要狩猎的生物。
|
||||
actors.mobs.spical.gnollhero.chat_3=集中精神,寻找交错的房间,你需要的猎物就在那里……
|
||||
|
||||
actors.mobs.bosses.sakafishboss.name=萨卡班甲鱼
|
||||
actors.mobs.bosses.sakafishboss.desc=曾经远古时代的海洋王者,因为不可避免的末日来临时,潜入了地底的阴暗水潭进入了沉睡。想着有朝一日回到大海,然而地牢的魔力和陆上的变化,它再也不可能回到那片理想的海洋。
|
||||
actors.mobs.bosses.sakafishboss.notice=sakasaka……saka?腻……系……甚磨?!
|
||||
|
@ -1438,13 +1444,13 @@ actors.hero.heroclass.warrior_desc_loadout=蕾零安洁初始携带一把_破损
|
|||
actors.hero.heroclass.warrior_desc_misc=蕾零安洁每次食用食物时都能恢复少量生命值。\n\n蕾零安洁开局鉴定的物品有:\n- 鉴定卷轴\n- 治疗药水\n- 盛怒卷轴\n\n蕾零安洁初始携带一个不会被消耗的_唤魔晶柱_
|
||||
actors.hero.heroclass.warrior_desc_subclasses=在击杀第二个Boss后可以选择一种专精。蕾零安洁可以在两种专精中二选一:
|
||||
|
||||
actors.hero.heroclass.warrior_story=蕾蕶安洁--战术策略\n\n她出生于霜落帝国,这里常年都是寒风刺骨的状态。蕾蕶安洁是毕业于战术高等学府的优秀学员。她不主张使用魔法,而是在于攻防兼备。她的家族世世代代都以战术策略为主,她的家族是霜落帝国中为数不多的仍然未使用魔法或者特殊能力的家族。\n如今由于地表三巨头的诱人悬赏,加上她自己也有来地牢的一些调查,她就此来到了这里。
|
||||
actors.hero.heroclass.warrior_story=蕾蕶安洁--战术策略\n\n她出生于常年都是寒风刺骨的霜落帝国。蕾蕶安洁是毕业于战术高等学府的优秀学员。她不主张使用魔法,而是倾向于使用精明的战术策略去击败敌人。她的家族世世代代都是以战术策略闻名于世,她的家族是霜落帝国中为数不多的不使用魔法或者特殊能力却仍在帝国中占有一席之地的家族。如今在地表三巨头巨额悬赏的诱惑下,原本就想要来到地牢调查的她来到了这里。
|
||||
|
||||
actors.hero.heroclass.huntress_story=颐莲梅錵--精灵血裔\n\n颐莲梅錵诞生于绿林圣境,这里是精灵的聚集地。她的母亲是这里的最高管理者,然而,她向往外面的世界,不希望自己就一直在母亲的保护和圣境的结界中过完一生。为此,她私自开启了结界,这带来了一场重大的变故。最后还是她母亲发现异常后重新修补了结界,但她本人从此在圣境中消失了。最高管理者其实什么都知道,为此也没有派人寻找她....\n\n多年后,她为了提升自己的力量前往了这里。地牢深处的宝物是她此行的目的,而她不知道的是,她已是最后一位精灵血裔...
|
||||
actors.hero.heroclass.huntress_story=颐莲梅錵--精灵血裔\n\n颐莲梅錵诞生于绿林圣境,那里是精灵的聚集地,而她的母亲是那里的最高管理者。然而,向往着外面的世界,不希望自己就一直在母亲的保护和圣境的结界中过完一生的她,私自开启了结界。这带来了一场可怕的灾难。最后她母亲虽然重新修补了结界,但颐莲梅錵本人却从此在圣境中消失了。最高管理者其实什么都知道,但是却没有派人寻找她……\n\n多年后,她为了提升自己的力量来到了这里,寻找地牢深处的宝物。而她不知道的是,她已是最后一位精灵血裔……
|
||||
|
||||
actors.hero.heroclass.rogue_story=极影铃虹--迷离少女\n\n极影铃虹出生于深渊魔都,是拥有皇家血脉的人。然而,她在每次外出的时候,都会看见底层的人们深受生活的折磨,并且遭到贵族的歧视。这些现象都给纯洁无知的她带来了很多影响,自那以后,皇室中总有一个黑影盗窃东西,都是由于这个黑影每次盗窃的都是食物方面。为此皇室高层是搁置不管此事。皇室高层在外巡游的时候,听到底层的人们谈论有一个蒙着面纱的女性将食物送给他们。皇室高层自然联想到了那个黑影......\n但是,并没有人知道是她。而她听说地牢最深处的东西可以实现愿望,便说服自己的父亲来到了这里,父亲在她的斗篷中植入了一颗暗黑的种子,必要时刻,它会保护她前行。
|
||||
actors.hero.heroclass.rogue_story=极影铃虹--迷离少女\n\n极影铃虹出生于深渊魔都皇室,拥有纯正的皇家血脉。然而,她在每次外出的时候,都会看见底层的人们深受生活的折磨,以及贵族对他们深入骨髓的歧视。这些现象都给她纯洁的思想带来了巨大的冲击。自那以后,皇室中总有一个盗窃东西的黑影,并且这个黑影每次盗窃的都是食物,而皇室也一直没有成功抓住这个黑影。皇室高层在外巡游的时候,听到底层的人们谈论有一个蒙着面纱的女性将食物送给他们。皇室高层自然联想到了那个黑影……但是,并没有人知道是她。而她在听说地牢最深处的东西可以实现愿望之后,便说服自己的父亲来到了这里。父亲在她的斗篷中植入了一颗暗黑的种子,必要时刻,它会保护她前行。
|
||||
|
||||
actors.hero.heroclass.mage_story=茉莉伊洛--渊初少女\n\n茉莉伊洛的出生地并不是这片国土,而是远在天边的神秘之境。那里魔力满溢,每个人都是这里的顶尖魔法师。她因为一些变故,离开了自己的家乡,来到了地表三巨头管辖的区域,并且在法师学府毕业。懂得强大的冰与火的魔力,能在战斗中随机应变。但由于她并不属于这里,这里的魔力束缚了她,为此她的真正力量从未显现。她为了调查有关于水晶之心的谜团,便前往来到这地牢的面前....
|
||||
actors.hero.heroclass.mage_story=茉莉伊洛--渊初少女\n\n茉莉伊洛的出生地并不是这片国土,而是在遥远天边的神秘之境。那里魔力满溢,每个人都可以成为顶尖魔法师。而她因为一些变故,不得不离开自己的家乡,来到了地表三巨头管辖的区域。法师学府的多年深造使得她懂得强大的冰与火的魔力,能在战斗中随机应变。但由于她并不属于这里,这里的魔力在排斥她,所以她的真正力量从未显现。她为了调查有关于水晶之心的谜团,只好以孱弱的姿态来到这地牢的面前……
|
||||
|
||||
actors.hero.heroclass.mage=茉莉伊洛
|
||||
actors.hero.heroclass.mage_unlock=茉莉伊洛精通各类法杖,并在开局时持有一根_独特的魔杖_。\n\n_在一局游戏中使用两张升级卷轴_以解锁茉莉伊洛。
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
####MLPD-P3文本
|
||||
|
||||
### 传奇武器
|
||||
|
||||
items.weapon.melee.legend.legendweapon.typical_stats_desc=这是一件_%1$s阶_传奇武器,这件传奇武器的技能通常造成为:%2$s\n这个技能通常可以造成_%3$s~%4$s点伤害_。
|
||||
items.weapon.melee.legend.legendweapon.stats_desc=这是一件_%1$s阶_传奇武器,这件传奇武器的技能为:%2$s\n这个技能当前可以造成_%3$s~%4$s点伤害_。
|
||||
|
||||
items.weapon.melee.legend.diedcrossbow.name=重型弩炮
|
||||
items.weapon.melee.legend.diedcrossbow.desc=这是一件非常精密复杂的装置,能将数个飞镖一样的小型箭矢以极高的速度射出。这把重型弩炮十分的沉重,如果使用者的力量不足可能会因为装置失灵波及到自己。其本身也相当致命,在肉搏战中可以起到很好的作用。
|
||||
items.weapon.melee.legend.diedcrossbow.king_desc=_战术扇形爆炸弩炮_\n\n当玩家背包拥有5个以上任意飞镖时,它允许玩家将它们装置上并发射出去。发射后需要重新装填,通过升级可以减少装填的时间。\n\n在发射的尽头或遭遇敌对目标时立刻产生_4x4_的爆炸并造成范围伤害。每次爆炸完毕后弩炮需要_重新装填_。弩炮伤害会根据自身等级成长。
|
||||
items.weapon.melee.legend.diedcrossbow.ac_king=战术扇形爆炸弩炮
|
||||
items.weapon.melee.legend.diedcrossbow.no_king=没有足够的飞镖以装填爆炸弩炮装置,请至少背包有5个飞镖以上。
|
||||
items.weapon.melee.legend.diedcrossbow.no_cooldown=弩炮装置正在重新装填,请稍后……
|
||||
items.weapon.melee.legend.diedcrossbow.no_equip=必须装备重型弩炮才能使用它。
|
||||
|
||||
items.weapon.melee.sdbsword.name=钻石大剑
|
||||
items.weapon.melee.sdbsword.desc=钻石制成的奇特大剑,现在它已经给予了足够多的能量,它回到了巅峰时刻\n剑身残留着钻石宝箱王的魔力,因此对其他魔力有着莫名的亲和性。相比于其他武器,这把武器会随着等级的提升增加更多伤害。\n这把武器攻击速度极慢,但精准极高。\n该武器已经重回巅峰,可以发射剑气。(该武器尚未完成,切勿使用)
|
||||
|
||||
|
@ -320,7 +334,7 @@ items.books.playbookslist.deyizibooks.name=《我们是柏林联合》
|
|||
items.books.playbookslist.deyizibooks.desc=在山的那边,海的那边,有一座小球场。\n球场里有一群纯粹到不敢相信的踢球的人,他们就是柏林联合,即使我们刚刚进去甲级联赛,但是我们有一往无前的气势。\n旅行者,愿柏林联合的钢铁意志保佑你。
|
||||
items.books.playbookslist.deyizibooks.author=--作者:_Pedro_
|
||||
|
||||
items.mainbooks.mustread=书本的厚重感让你不敢轻易翻开,但若是不翻开,你将无法获得它的力量。
|
||||
items.mainbooks.desc=书本的厚重感让你不敢轻易翻开,但若是不翻开,你将无法获得它的力量。
|
||||
items.mainbooks.readed=你已经阅读过这本书了。所以你不再需要再看这本书的内容了。
|
||||
items.mainbooks.no=就当你准备阅读的时候,一道力量让你无法翻阅书籍,看来有人希望你将书籍带出地牢,而不是阅读完它们。
|
||||
|
||||
|
@ -365,7 +379,7 @@ items.quest.goldbao.desc=由钻石宝箱王守护的东西,据说是商人的
|
|||
items.quest.red.name=死灵精华十字架
|
||||
items.quest.red.desc=死灵领主的好东西,如果交给想要的人必然会有好运。
|
||||
|
||||
items.weapon.melee.skyshield.name=风筝盾牌
|
||||
items.weapon.melee.skyshield.name=筝型盾
|
||||
items.weapon.melee.skyshield.typical_stats_desc=这件武器通常能格挡0~%d点伤害。通过升级可以使格挡量增长。
|
||||
items.weapon.melee.skyshield.stats_desc=这件武器能格挡0~%d点伤害。通过升级可以使格挡量增长。
|
||||
items.weapon.melee.skyshield.desc=这是"霜落帝国"的产物,由"霜落女帝"亲自监督研发。
|
||||
|
|
|
@ -155,12 +155,11 @@ badges$badge.games_played_1.desc=进行 10 场游戏,你已经知悉了地牢
|
|||
badges$badge.games_played_2.title=进阶调查者
|
||||
badges$badge.games_played_2.desc=进行 50 场游戏,你已经熟悉了地牢的潜规则。
|
||||
badges$badge.games_played_3.title=资深调查家
|
||||
badges$badge.games_played_3.desc=进行 250 场游戏,你的威望已经在地牢中传颂。
|
||||
badges$badge.games_played_3.desc=进行 75 场游戏,你的威望已经在地牢中传颂。
|
||||
badges$badge.games_played_4.title=大师调查员
|
||||
badges$badge.games_played_4.desc=进行 100 场游戏,你的名声已经传到地表三巨头的耳里。小心夜路遇到他们哦。
|
||||
|
||||
badges$badge.godd_make.title=暗室逢灯
|
||||
badges$badge.godd_make.desc=累计完成老杖匠的全部委托任务,现在,是他回报恩人的时候了。\n\n_奖励:0层随机戒指(四大基座上)_
|
||||
|
||||
|
||||
badges$badge.clear_water.title=净化大师
|
||||
badges$badge.clear_water.desc=完成挑战:污泥浊水
|
||||
|
@ -189,21 +188,15 @@ badges$badge.champion_2x.desc=开启3项以上挑战通关,在地牢的轮回中
|
|||
badges$badge.champion_3x.title=不屈斗士
|
||||
badges$badge.champion_3x.desc=开启6项以上挑战通关,在地牢的重重考验下你活了下来,你的惊人测试成绩已经为世人歌颂。
|
||||
|
||||
badges$badge.champion_4x.title=超凡脱俗
|
||||
badges$badge.champion_4x.title=乘风破浪
|
||||
badges$badge.champion_4x.desc=开启8项以上挑战通关,无论结局怎样,你的尝试已经让衪们知晓你的能力。或许在未来,你会直面衪们。
|
||||
|
||||
badges$badge.champion_5x.title=登神之路
|
||||
badges$badge.champion_5x.title=披荆斩棘
|
||||
badges$badge.champion_5x.desc=开启10项以上挑战通关,你的信念与威望已经人人知晓,你已经引起世界各个势力的注意。今后你将踏上新的征程。
|
||||
|
||||
badges$badge.kill_slmking.title=粘体终结者
|
||||
badges$badge.kill_slmking.desc=击杀栖息在水晶异变的史莱姆王子
|
||||
|
||||
badges$badge.big_x.title=突变风波
|
||||
badges$badge.big_x.desc=基因突变开启通关!你见证了地牢的突变体,同时也看见了玩火必自焚的道理……\n\n_奖励:0层随机护甲(四大基座上)_
|
||||
|
||||
badges$badge.exsg.title=大症若愚
|
||||
badges$badge.exsg.desc=药水癔症只是一个假象,你仍然坚持过来了!\n\n_奖励:720初始金币_
|
||||
|
||||
badges$badge.kill_dm720.title=兵不厌“炸”
|
||||
badges$badge.kill_dm720.desc=击杀冰雪矿洞中的DM-720和它的驾驶员。\n\n_奖励:0层额外2阶武器(四大基座上,与冰雪魔女不叠加)_
|
||||
|
||||
|
@ -229,24 +222,9 @@ badges$badge.storm.desc=在拿到了水晶之心离开地牢后,天突然黑
|
|||
badges$badge.kill_mg.title=冰雪挽歌
|
||||
badges$badge.kill_mg.desc=请尝试重创冰雪之地的她,让她能够清醒过来\n\n_奖励:0层额外2阶武器(四大基座上,与DM720不叠加)_
|
||||
|
||||
badges$badge.firegirl.title=圣火赞歌
|
||||
badges$badge.firegirl.desc=重创雪凛峡谷的圣火魔女,让她接纳你。
|
||||
|
||||
badges$badge.drawf_head.title=“旧时代”的终结
|
||||
badges$badge.drawf_head.desc=击败矮人将军,让他从诅咒中解脱。
|
||||
|
||||
badges$badge.brcler.title=起始归一
|
||||
badges$badge.brcler.desc=尽管死灵法师创造了这个恐怖的机器,但你已经粉碎了DM-ZERO的阴谋,现在是时候回归正常生活了。\n[击败最终兵器-DM-ZERO(未实装)]
|
||||
|
||||
badges$badge.take_item.title=宝藏探索者
|
||||
badges$badge.take_item.desc=获得宝藏迷宫的三个隐藏宝藏,切记,对决不是拟态王的本意。
|
||||
|
||||
badges$badge.kill_apple.title=毒果铲除计划
|
||||
badges$badge.kill_apple.desc=击杀盘踞在森林底部的幕后“主谋"。
|
||||
|
||||
badges$badge.spicealboss.title=弱肉强食
|
||||
badges$badge.spicealboss.desc=累计击败全部特殊BOSS,你的威望已经让每个首领对你望而生畏和敬佩不已。
|
||||
|
||||
badges$badge.nyz_shop.title=奈亚大亨
|
||||
badges$badge.nyz_shop.desc=购买终端的物品,让奈亚子自愿入驻0层!\n\n_奖励:0层奈亚子常驻,320初始金币,5次奈亚子终端商店购买权限_
|
||||
|
||||
|
@ -269,22 +247,49 @@ badges$badge.read_book_one.title=薅书人
|
|||
badges$badge.read_book_one.desc=一局累计阅读一本书籍。
|
||||
|
||||
badges$badge.read_book_two.title=图书管理员
|
||||
badges$badge.read_book_two.desc=一局累计阅读三本不同的书籍。
|
||||
badges$badge.read_book_two.desc=一局累计阅读三本书籍。
|
||||
|
||||
badges$badge.read_book_three.title=藏书狂热者
|
||||
badges$badge.read_book_three.desc=一局累计阅读五本不同的书籍。
|
||||
badges$badge.read_book_three.desc=一局累计阅读五本书籍。
|
||||
|
||||
badges$badge.read_book_four.title=书籍博学家
|
||||
badges$badge.read_book_four.desc=一局累计阅读七本不同的书籍。
|
||||
|
||||
badges$badge.saka_died.title=远古生物档案调查员
|
||||
badges$badge.saka_died.desc=击败栖息在阴暗水潭的神秘古生物
|
||||
|
||||
badges$badge.reset_day.title=重见天日?
|
||||
badges$badge.reset_day.desc=携带神秘生物的遗物离开地牢,完成它未尽的心愿。
|
||||
badges$badge.read_book_four.desc=一局累计阅读七本书籍。
|
||||
|
||||
|
||||
###隐藏
|
||||
|
||||
paswordbadges$badge.spicealboss.title=弱肉强食
|
||||
paswordbadges$badge.spicealboss.desc=累计击败全部特殊BOSS,你的威望已经让每个首领对你望而生畏和敬佩不已。
|
||||
|
||||
paswordbadges$badge.firegirl.title=圣火赞歌
|
||||
paswordbadges$badge.firegirl.desc=重创雪凛峡谷的圣火魔女,让她接纳你。
|
||||
|
||||
paswordbadges$badge.drawf_head.title=“旧时代”的终结
|
||||
paswordbadges$badge.drawf_head.desc=击败矮人将军,让他从诅咒中解脱。
|
||||
|
||||
paswordbadges$badge.brcler.title=起始归一
|
||||
paswordbadges$badge.brcler.desc=尽管死灵法师创造了这个恐怖的机器,但你已经粉碎了DM-ZERO的阴谋,现在是时候回归正常生活了。\n[击败最终兵器-DM-ZERO(未实装)]
|
||||
|
||||
paswordbadges$badge.saka_died.title=远古生物档案调查员
|
||||
paswordbadges$badge.saka_died.desc=击败栖息在阴暗水潭的神秘古生物
|
||||
|
||||
paswordbadges$badge.reset_day.title=重见天日?
|
||||
paswordbadges$badge.reset_day.desc=携带神秘生物的遗物离开地牢,完成它未尽的心愿。
|
||||
|
||||
paswordbadges$badge.take_item.title=宝藏探索者
|
||||
paswordbadges$badge.take_item.desc=获得宝藏迷宫的三个隐藏宝藏,切记,对决不是拟态王的本意。
|
||||
|
||||
paswordbadges$badge.allcs.title=履险蹈危
|
||||
paswordbadges$badge.allcs.desc=开启13项以上挑战通关,你就是传说中的救世主吗?
|
||||
|
||||
paswordbadges$badge.big_x.title=突变风波
|
||||
paswordbadges$badge.big_x.desc=基因突变开启通关!你见证了地牢的突变体,同时也看见了玩火必自焚的道理……\n\n_奖励:0层随机护甲(四大基座上)_
|
||||
|
||||
paswordbadges$badge.exsg.title=大症若愚
|
||||
paswordbadges$badge.exsg.desc=药水癔症只是一个假象,你仍然坚持过来了!\n\n_奖励:720初始金币_
|
||||
|
||||
paswordbadges$badge.godd_make.title=暗室逢灯
|
||||
paswordbadges$badge.godd_make.desc=累计完成老杖匠的全部委托任务,现在,是他回报恩人的时候了。\n\n_奖励:0层随机戒指(四大基座上)_
|
||||
|
||||
|
||||
challenges.no_food=缩餐节食
|
||||
|
@ -308,9 +313,8 @@ challenges.aquaphobia_desc=地牢的水也被污染了\n\n(圣境层到矮人
|
|||
|
||||
challenges.champion_enemies=精英战场
|
||||
challenges.champion_enemies_desc=会升级的不止你一个!\n\n・普通敌人刷出时有 1/8 \
|
||||
的机率拥有特殊的精英属性。\n・精英敌人刷出时会立即醒来。\n・精英敌人免疫腐化效果。\n\n精英敌人有九种:\n_烈焰(橙色):_ 近战伤害 \
|
||||
+25% 且带有点燃效果,免疫火焰,死亡时引燃周围。\n_索敌(紫色):_ 近战伤害 +25%,近战范围 +4。\n_敌法(绿色):_ 受到伤害 -25%,拥有魔法免疫。\n_巨型(蓝色):_ 受到伤害 -75%,近战范围 +1,无法进入门与过道。\n_祝福(黄色):_ 精准与躲避 +200%。\n_成长(红色):_ 精准、躲避、攻击伤害与有效生命值 +20%。每过 3 回合会再增长 1%。\n_鬼磷(天蓝色):_ 近战伤害 +15% 且带有磷火效果,免疫火焰与磷火。\n_苦痛(暗紫色):_受到的伤害延缓释放,近战伤害+45%\n_炼狱(深红色):_造成 45% 额外近战伤害,拥有30%的伤害减免。攻击有概率召唤1个火焰怨灵进行攻击。
|
||||
|
||||
的机率拥有特殊的精英属性。\n・精英敌人刷出时会立即醒来。\n・精英敌人免疫腐化效果。\n\n精英敌人有8种:\n_烈焰(橙色):_ 近战伤害 \
|
||||
+25% 且带有点燃效果,免疫火焰,死亡时引燃周围。\n_索敌(紫色):_ 近战伤害 +25%,近战范围 +4。\n_敌法(绿色):_ 受到伤害 -25%,拥有魔法免疫。\n_巨型(蓝色):_ 受到伤害 -75%,近战范围 +1,无法进入门与过道。\n_祝福(黄色):_ 精准与躲避 +200%。\n_成长(红色):_ 精准、躲避、攻击伤害与有效生命值 +20%。每过 3 回合会再增长 1%。\n_鬼磷(天蓝色):_ 近战伤害 +15% 且带有磷火效果,免疫火焰与磷火。\n_苦痛(暗紫色):_受到的伤害延缓释放,近战伤害+45%
|
||||
challenges.stronger_bosses=梦魇领袖-测试版
|
||||
challenges.stronger_bosses_desc=这项挑战让挑战 Boss 变得更有挑战性了!\n\n_克里弗斯之果:_\n_-_ 第二阶段:触手和本体可以远程攻击,并造成更加大的威胁\n_-_ 触手和本体在战斗过程中拥有额外护盾加成。\n_天狗:_生命 +25%\n_-_ 第一阶段:陷阱更加致命\n_-_ 第二阶段:技能频率更高\n_DM-300:_生命 +60%\n_-_ 能量塔更坚固。\n_-_ 技能频率更高,威力也更强大\n_-_ 超载时移动速度更高\n_-_ 击败时必掉落荆棘斗篷\n_矮人国王:_生命 +50%\n_-_ 整场战斗内召唤的随从都更强大\n_-_ 第一阶段:技能与召唤频率都更高\n_-_ 第二阶段:每轮额外召唤两个随从\n_-_ 第三阶段:生命值 +100%,召唤频率更高\n_Yog-Dzewa:_\n_-_ 同时召唤两个古神之拳!\n_-_ 激光攻击伤害 +60%\n_-_ 召唤更强大的随从
|
||||
actors.char.aquaphobia=你受到了来自水的伤害!
|
||||
|
|
|
@ -12,6 +12,8 @@ scenes.gamescene.examine=调查这里
|
|||
scenes.gamescene.interact=与之对话
|
||||
scenes.gamescene.pick_up=拾取此物
|
||||
|
||||
|
||||
|
||||
#挑战模式
|
||||
scenes.heroselectscene$4$1.title0=挑战模式
|
||||
windows.wndchallenges.title0=挑战-Page1
|
||||
|
@ -126,7 +128,8 @@ scenes.amuletscene.exit=回到主城,未完待续
|
|||
scenes.amuletscene.stay=留在这里,稍后离开
|
||||
scenes.amuletscene.text=当你打败了古神了之后,这个发着微弱的光芒的水晶之心就是你最后的东西。\n\n前面已经没有了道路,留给你的只有无尽深渊。\n\n耳旁却似乎仍然有人在窃窃私语。\n\n无论如何,尘埃落定,你确实已经探索完了地牢。但确实是无功而返?\n\n不,水晶之心证明你曾经来过,而且这个肯定能让他们眼前一亮。
|
||||
|
||||
scenes.badgesscene.title=你的徽章
|
||||
scenes.badgesscene.title=你的常规徽章
|
||||
scenes.passwordbadgesscene.title=你的加密徽章
|
||||
|
||||
scenes.changesscene.title=近期更新变动
|
||||
scenes.changesscene.new=新内容
|
||||
|
|
|
@ -550,6 +550,8 @@ ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x80=1.修复灯火值不扣减的错
|
|||
|
||||
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x81=1.优化灯火体验\n其他错误修复。
|
||||
|
||||
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x82=1.修复商店抢劫的一些错误\n2.修复部分崩溃错误\n3.修复Beta2古神无限循环的错误\n4.修复黄金时代的一些错误\n5.修复部分徽章获取错误问题\n6.修复部分成就无法获得的问题\n7.改善部分房间不会在1层生成为隐藏层\n7.修复商人的一些错误\n8.修复部分怪物掉落问题\n8.修复部分错误
|
||||
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x82=1.修复商店抢劫的一些错误\n2.修复部分崩溃错误\n3.修复Beta2古神无限循环的错误\n4.修复黄金时代的一些错误\n5.修复部分徽章获取错误问题\n6.修复部分成就无法获得的问题\n7.改善部分房间不会在1层生成为隐藏层\n7.修复商人的一些错误\n8.修复部分怪物掉落问题\n9.修复部分错误\n10.修复系统字体导致游戏的闪退的重大错误\n11.PC布局优化,整体UI优化
|
||||
|
||||
ui.changelist.mlpd.vm0_6_7_x_changes.bug_06x83=1.修复上个版本的FireBase崩溃记录的问题\nK2.修复部分珍宝加成异常的问题\nS2.修复拟态王宝物重复获取的问题\n3.修复幽妹还能获得+5的问题\n4.部分房间优化,少量数据平衡\n5.改进游戏内部分文案
|
||||
|
||||
//ui.changelist.mlpd.vm0_5_x_changes.xxx//
|
|
@ -11,7 +11,7 @@ scenes.gamenewsscene.title=正在检查更新
|
|||
scenes.gamenewsscene.update=请稍后,我们正在向服务器请求你的版本数据。若长时间未检查到版本,你可在倒计时结束后通过下方按钮继续游玩该版本
|
||||
scenes.gamenewsscene.continue=继续游玩
|
||||
|
||||
|
||||
windows.wndsettings$datatab.autoupdate=关闭更新界面
|
||||
windows.newwndchallenges$1$1.title=挑战模式-Page1
|
||||
windows.newwndchallenges$2$1.title=挑战模式-Page2
|
||||
|
||||
|
@ -83,7 +83,7 @@ windows.wndshopking.yes=是的
|
|||
windows.wndshopking.no=还没有
|
||||
windows.wndshopking.notbad=当你准备好后,我会带你前往雪凛峡谷的最深的区域……
|
||||
|
||||
windows.wndsettings$extendtab.quickslots=快捷栏设置
|
||||
windows.wndsettings$extendtab.quickslots=快捷栏设置(V1)
|
||||
windows.wndsettings$extendtab.wxts=温馨提示:进入游戏后才能调整快捷栏\n\n这是因为技术问题,但是这里已经提醒你了。\n\n当你进入游戏后,这里就会变成快捷栏设置区!
|
||||
|
||||
windows.wnddlc.mode=娱乐模式
|
||||
|
@ -374,16 +374,20 @@ windows.wndsettings$displaytab.visual_grid=可视网格
|
|||
windows.wndsettings$displaytab.off=关闭
|
||||
windows.wndsettings$displaytab.high=高亮
|
||||
windows.wndsettings$uitab.title=界面设置
|
||||
windows.wndsettings$uitab.size=界面尺寸
|
||||
windows.wndsettings$uitab.ui_mode=界面模式
|
||||
windows.wndsettings$uitab.scale=界面尺寸
|
||||
windows.wndsettings$uitab.mobile=移动端风格
|
||||
windows.wndkeybindings.quickslot_switch=切换
|
||||
windows.wndsettings$uitab.full=PC端风格
|
||||
windows.wndsettings$uitab.toolbar_settings=工具栏设置
|
||||
windows.wndsettings$uitab.mode=工具栏模式:
|
||||
windows.wndsettings$uitab.split=分散
|
||||
windows.wndsettings$uitab.group=组合
|
||||
windows.wndsettings$uitab.center=居中
|
||||
windows.wndsettings$uitab.flip_toolbar=翻转工具栏
|
||||
windows.wndsettings$uitab.flip_indicators=翻转指示器
|
||||
windows.wndsettings$uitab.quickslots=快捷栏
|
||||
windows.wndsettings$uitab.quickslot_swapper=使用V1快捷栏
|
||||
windows.wndsettings$uitab.swapper_desc=仅手机端布局可在V1,V2快捷栏进行切换,\n而PC端布局只能使用V2快捷栏。{\n_注意:仅V2快捷栏支持三类布局,使用V1会无效。_
|
||||
windows.wndsettings$uitab.system_font=系统字体
|
||||
windows.wndsettings$uitab.key_bindings=键位设置
|
||||
windows.wndsettings$datatab.title=网络相关设置
|
||||
|
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
BIN
core/src/main/assets/sprites/npc/whitepinkgirl.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
core/src/main/assets/sprites/tribesman.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
|
@ -123,6 +123,7 @@ public class Assets {
|
|||
public static final String BANNERSSD = "interfaces/banners_sd.png";
|
||||
|
||||
public static final String BADGES = "interfaces/badges.png";
|
||||
public static final String PROBADGES = "interfaces/passwordbadges.png";
|
||||
public static final String LOCKED = "interfaces/locked_badge.png";
|
||||
|
||||
public static final String CHROME = "interfaces/chrome.png";
|
||||
|
@ -131,8 +132,6 @@ public class Assets {
|
|||
public static final String STATUS = "interfaces/status_pane.png";
|
||||
public static final String TOOLBARDRAK = "interfaces/toolbar_normal.png";
|
||||
public static final String STATUS_DARK = "interfaces/status_pane_normal.png";
|
||||
public static final String STATUSSOUL = "interfaces/status_pane-puresoul.png";
|
||||
public static final String STATUSSOUL_DARK = "interfaces/status_pane-puresoul_dark.png";
|
||||
public static final String MENU = "interfaces/menu_pane.png";
|
||||
public static final String MENU_BTN = "interfaces/menu_button.png";
|
||||
public static final String TOOLBAR = "interfaces/toolbar.png";
|
||||
|
@ -423,6 +422,9 @@ public class Assets {
|
|||
public static final String ROT_LASH = "sprites/rot_lasher.png";
|
||||
public static final String ROT_HEART= "sprites/rot_heart.png";
|
||||
public static final String GUARD = "sprites/guard.png";
|
||||
|
||||
public static final String HEROGNOLL = "sprites/tribesman.png";
|
||||
|
||||
public static final String WARDS = "sprites/wards.png";
|
||||
public static final String GUARDIAN = "sprites/guardian.png";
|
||||
public static final String SLIME = "sprites/slime.png";
|
||||
|
|
|
@ -144,7 +144,7 @@ public class Badges {
|
|||
VICTORY ( 78 ),
|
||||
YASD ( 79, true ),
|
||||
|
||||
GODD_MAKE ( 82 ),
|
||||
|
||||
CLEAR_WATER ( 83 ),
|
||||
GHOSTDAGE ( 84 ),
|
||||
// ENDIED ( 85 ),
|
||||
|
@ -190,27 +190,15 @@ public class Badges {
|
|||
NYZ_SHOP ( 117 ),
|
||||
DAGETO ( 118 ),
|
||||
KILL_SM ( 119 ),
|
||||
|
||||
TAKE_ITEM ( 120 ),
|
||||
|
||||
//rudy
|
||||
FIREGIRL ( 128 ),
|
||||
//SLIMEPR ( 129 ),
|
||||
DRAWF_HEAD ( 130 ),
|
||||
SPICEALBOSS ( 131),
|
||||
|
||||
|
||||
|
||||
STORM ( 132),
|
||||
|
||||
KILL_MG (133),
|
||||
BIG_X (134),
|
||||
EXSG (135),
|
||||
BRCLER (136),
|
||||
|
||||
HIGH_SCORE_5 ( 137 ),
|
||||
|
||||
SAKA_DIED ( 138 ),
|
||||
|
||||
RESET_DAY ( 139 );
|
||||
HIGH_SCORE_5 ( 137 );
|
||||
|
||||
public boolean meta;
|
||||
|
||||
|
@ -265,7 +253,7 @@ public class Badges {
|
|||
displayBadge( badge );
|
||||
}
|
||||
|
||||
private static HashSet<Badge> global;
|
||||
public static HashSet<Badge> global;
|
||||
private static HashSet<Badge> local = new HashSet<>();
|
||||
|
||||
private static boolean saveNeeded = false;
|
||||
|
@ -755,17 +743,18 @@ public class Badges {
|
|||
global.contains( Badge.GET_SC ) &&
|
||||
global.contains( Badge.KILL_COLDELE)) {
|
||||
|
||||
Badge badge = Badge.GODD_MAKE;
|
||||
displayBadge( badge );
|
||||
PaswordBadges.Badge badge = PaswordBadges.Badge.GODD_MAKE;
|
||||
PaswordBadges.displayBadge( badge );
|
||||
}
|
||||
}
|
||||
|
||||
private static void validateAMZ() {
|
||||
if (global.contains( Badge.KILL_APPLE ) &&global.contains( Badge.KILL_DM720 ) &&
|
||||
global.contains( Badge.KILL_MG) && global.contains( Badge.FIREGIRL) && global.contains( Badge.DRAWF_HEAD) && global.contains( Badge.SAKA_DIED)) {
|
||||
public static void validateAMZ() {
|
||||
List<PaswordBadges.Badge> passwordbadges = PaswordBadges.filtered( true );
|
||||
if (global.contains( Badge.KILL_APPLE ) && global.contains( Badge.KILL_DM720 ) &&
|
||||
global.contains( Badge.KILL_MG) && passwordbadges.contains(PaswordBadges.Badge.FIREGIRL) && passwordbadges.contains(PaswordBadges.Badge.DRAWF_HEAD) && passwordbadges.contains(PaswordBadges.Badge.SAKA_DIED)) {
|
||||
|
||||
Badge badge = Badge.SPICEALBOSS;
|
||||
displayBadge( badge );
|
||||
PaswordBadges.Badge badge = PaswordBadges.Badge.SPICEALBOSS;
|
||||
PaswordBadges.displayBadge( badge );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1009,10 +998,10 @@ public class Badges {
|
|||
if (Rankings.INSTANCE.totalNumber >= 50) {
|
||||
badge = Badge.GAMES_PLAYED_2;
|
||||
}
|
||||
if (Rankings.INSTANCE.totalNumber >= 250) {
|
||||
if (Rankings.INSTANCE.totalNumber >= 75) {
|
||||
badge = Badge.GAMES_PLAYED_3;
|
||||
}
|
||||
if (Rankings.INSTANCE.totalNumber >= 1000) {
|
||||
if (Rankings.INSTANCE.totalNumber >= 100) {
|
||||
badge = Badge.GAMES_PLAYED_4;
|
||||
}
|
||||
|
||||
|
@ -1035,14 +1024,9 @@ public class Badges {
|
|||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void KILLSAKA() {
|
||||
displayBadge( Badge.SAKA_DIED);
|
||||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void REHOMESKY() {
|
||||
displayBadge( Badge.RESET_DAY );
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void STORM() {
|
||||
displayBadge( Badge.STORM);
|
||||
|
@ -1061,15 +1045,6 @@ public class Badges {
|
|||
displayBadge( Badge.CLEAR_WATER );
|
||||
}
|
||||
|
||||
public static void KILLDWARF() {
|
||||
displayBadge( Badge.DRAWF_HEAD );
|
||||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void KILLFIREGIRL() {
|
||||
displayBadge( Badge.FIREGIRL );
|
||||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void KILLMG() {
|
||||
displayBadge( Badge.KILL_MG );
|
||||
|
@ -1081,22 +1056,6 @@ public class Badges {
|
|||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void KILL_OMP() {
|
||||
displayBadge( Badge.TAKE_ITEM );
|
||||
}
|
||||
|
||||
|
||||
public static void BIGX() {
|
||||
displayBadge( Badge.BIG_X );
|
||||
}
|
||||
public static void EXSG() {
|
||||
displayBadge( Badge.EXSG );
|
||||
}
|
||||
|
||||
public static void BOSSRUSH() {
|
||||
displayBadge( Badge.BRCLER );
|
||||
}
|
||||
|
||||
public static void GOODRLPT() {
|
||||
displayBadge( Badge.RLPT );
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.custom.CustomArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
|
@ -86,8 +85,6 @@ public class Challenges {
|
|||
if (Dungeon.isChallenged(NO_FOOD)) {
|
||||
if (item instanceof SmallRation) {
|
||||
return true;
|
||||
} else if (item instanceof HornOfPlenty) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -836,8 +836,10 @@ public class Dungeon {
|
|||
Bundle badges = bundle.getBundle(BADGES);
|
||||
if (!badges.isNull()) {
|
||||
Badges.loadLocal( badges );
|
||||
PaswordBadges.loadLocal( badges );
|
||||
} else {
|
||||
Badges.reset();
|
||||
PaswordBadges.reset();
|
||||
}
|
||||
|
||||
Notes.restoreFromBundle( bundle );
|
||||
|
|
|
@ -0,0 +1,280 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon;
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Badges.validateAMZ;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.PRO;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.FileUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class PaswordBadges {
|
||||
|
||||
public static void KILLDWARF() {
|
||||
displayBadge( PaswordBadges.Badge.DRAWF_HEAD );
|
||||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void KILLFIREGIRL() {
|
||||
displayBadge( PaswordBadges.Badge.FIREGIRL );
|
||||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void KILLSAKA() {
|
||||
displayBadge( PaswordBadges.Badge.SAKA_DIED);
|
||||
validateAMZ();
|
||||
}
|
||||
|
||||
public static void REHOMESKY() {
|
||||
displayBadge( PaswordBadges.Badge.RESET_DAY );
|
||||
}
|
||||
|
||||
public static void BOSSRUSH() {
|
||||
displayBadge( PaswordBadges.Badge.BRCLER );
|
||||
}
|
||||
|
||||
public static void ALLCS(int challenges){
|
||||
if (challenges == 0) return;
|
||||
if (challenges >= 13 && !(Dungeon.isChallenged(PRO))||!Statistics.happyMode && challenges >= 13){
|
||||
displayBadge(PaswordBadges.Badge.ALLCHSX );
|
||||
}
|
||||
}
|
||||
|
||||
public static void BIGX() {
|
||||
displayBadge( PaswordBadges.Badge.BIG_X );
|
||||
}
|
||||
public static void EXSG() {
|
||||
displayBadge( PaswordBadges.Badge.EXSG );
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum Badge {
|
||||
|
||||
TAKE_ITEM( 0 ),
|
||||
FIREGIRL(1),
|
||||
SLIMEPRS(2),
|
||||
DRAWF_HEAD(3),
|
||||
SPICEALBOSS (4),
|
||||
SAKA_DIED(5),
|
||||
RESET_DAY(6),
|
||||
BRCLER(7),
|
||||
ALLCHSX(8),
|
||||
|
||||
GODD_MAKE(12),
|
||||
|
||||
BIG_X(13),
|
||||
EXSG(14);
|
||||
|
||||
|
||||
public boolean meta;
|
||||
|
||||
public int image;
|
||||
|
||||
Badge( int image ) {
|
||||
this( image, false );
|
||||
}
|
||||
|
||||
Badge( int image, boolean meta ) {
|
||||
this.image = image;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public String title(){
|
||||
return Messages.get(this, name()+".title");
|
||||
}
|
||||
|
||||
public String desc(){
|
||||
return Messages.get(this, name()+".desc");
|
||||
}
|
||||
|
||||
Badge() {
|
||||
this( -1 );
|
||||
}
|
||||
}
|
||||
|
||||
public static HashSet<Badge> global;
|
||||
private static HashSet<Badge> local = new HashSet<>();
|
||||
|
||||
|
||||
|
||||
private static boolean saveNeeded = false;
|
||||
|
||||
public static void reset() {
|
||||
local.clear();
|
||||
loadGlobal();
|
||||
}
|
||||
|
||||
public static final String BADGES_FILE = "badges.dat";
|
||||
private static final String BADGES = "badges";
|
||||
|
||||
private static final HashSet<String> removedBadges = new HashSet<>();
|
||||
static{
|
||||
//removed in 0.6.5
|
||||
removedBadges.addAll(Arrays.asList("RARE_ALBINO", "RARE_BANDIT", "RARE_SHIELDED",
|
||||
"RARE_SENIOR", "RARE_ACIDIC", "RARE", "TUTORIAL_WARRIOR", "TUTORIAL_MAGE"));
|
||||
}
|
||||
|
||||
private static final HashMap<String, String> renamedBadges = new HashMap<>();
|
||||
static{
|
||||
//0.6.5
|
||||
renamedBadges.put("CHAMPION", "CHAMPION_1");
|
||||
}
|
||||
|
||||
public static HashSet<Badge> restore( Bundle bundle ) {
|
||||
HashSet<Badge> badges = new HashSet<>();
|
||||
if (bundle == null) return badges;
|
||||
|
||||
String[] names = bundle.getStringArray( BADGES );
|
||||
for (int i=0; i < names.length; i++) {
|
||||
try {
|
||||
if (renamedBadges.containsKey(names[i])){
|
||||
names[i] = renamedBadges.get(names[i]);
|
||||
}
|
||||
if (!removedBadges.contains(names[i])){
|
||||
badges.add( Badge.valueOf( names[i] ) );
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ShatteredPixelDungeon.reportException(e);
|
||||
}
|
||||
}
|
||||
|
||||
return badges;
|
||||
}
|
||||
|
||||
public static void store( Bundle bundle, HashSet<Badge> badges ) {
|
||||
int count = 0;
|
||||
String names[] = new String[badges.size()];
|
||||
|
||||
for (Badge badge:badges) {
|
||||
names[count++] = badge.toString();
|
||||
}
|
||||
bundle.put( BADGES, names );
|
||||
}
|
||||
|
||||
public static void loadLocal( Bundle bundle ) {
|
||||
local = restore( bundle );
|
||||
}
|
||||
|
||||
public static void saveLocal( Bundle bundle ) {
|
||||
store( bundle, local );
|
||||
}
|
||||
|
||||
public static void loadGlobal() {
|
||||
if (global == null) {
|
||||
try {
|
||||
Bundle bundle = FileUtils.bundleFromFile( BADGES_FILE );
|
||||
global = restore( bundle );
|
||||
|
||||
} catch (IOException e) {
|
||||
global = new HashSet<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void saveGlobal() {
|
||||
if (saveNeeded) {
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
store( bundle, global );
|
||||
|
||||
try {
|
||||
FileUtils.bundleToFile(BADGES_FILE, bundle);
|
||||
saveNeeded = false;
|
||||
} catch (IOException e) {
|
||||
ShatteredPixelDungeon.reportException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void validateOMP() {
|
||||
displayBadge( Badge.TAKE_ITEM );
|
||||
}
|
||||
|
||||
public static void displayBadge( Badge badge ) {
|
||||
|
||||
if (badge == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (global.contains( badge )) {
|
||||
|
||||
if (!badge.meta) {
|
||||
GLog.h( Messages.get(Badges.class, "endorsed", badge.desc()) );
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
global.add( badge );
|
||||
saveNeeded = true;
|
||||
|
||||
if (badge.meta) {
|
||||
GLog.h( Messages.get(Badges.class, "new_super", badge.desc()) );
|
||||
} else {
|
||||
GLog.h( Messages.get(Badges.class, "new", badge.desc()) );
|
||||
}
|
||||
PixelScene.showProBadge( badge );
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isUnlocked( Badge badge ) {
|
||||
return global.contains( badge );
|
||||
}
|
||||
|
||||
public static HashSet<Badge> allUnlocked(){
|
||||
loadGlobal();
|
||||
return new HashSet<>(global);
|
||||
}
|
||||
|
||||
public static void disown( Badge badge ) {
|
||||
loadGlobal();
|
||||
global.remove( badge );
|
||||
saveNeeded = true;
|
||||
}
|
||||
|
||||
public static void addGlobal( Badge badge ){
|
||||
if (!global.contains(badge)){
|
||||
global.add( badge );
|
||||
saveNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Badge> filtered( boolean global ) {
|
||||
|
||||
HashSet<Badge> filtered = new HashSet<>(global ? PaswordBadges.global : PaswordBadges.local);
|
||||
|
||||
Iterator<Badge> iterator = filtered.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Badge badge = iterator.next();
|
||||
if ((!global && badge.meta) || badge.image == -1) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<Badge> list = new ArrayList<>(filtered);
|
||||
Collections.sort( list );
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private static void leaveBest( HashSet<Badge> list, Badge...badges ) {
|
||||
for (int i=badges.length-1; i > 0; i--) {
|
||||
if (list.contains( badges[i])) {
|
||||
for (int j=0; j < i; j++) {
|
||||
list.remove( badges[j] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.custom.utils.Constants;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
@ -38,8 +37,12 @@ public class QuickSlot {
|
|||
*/
|
||||
|
||||
//note that the current max size is coded at 4, due to UI constraints, but it could be much much bigger with no issue.
|
||||
public static int SIZE = Constants.MAX_QUICKSLOTS;
|
||||
private Item[] slots = new Item[SIZE];
|
||||
public static int SIZE = 12;
|
||||
|
||||
public static int VSIZE = 9;
|
||||
|
||||
public int quickslots;
|
||||
private Item[] slots = new Item[SIZE];
|
||||
|
||||
|
||||
//direct array interaction methods, everything should build from these methods.
|
||||
|
|
|
@ -55,6 +55,8 @@ public class SPDAction extends GameAction {
|
|||
public static final GameAction SE = new SPDAction("se");
|
||||
public static final GameAction WAIT = new SPDAction("wait");
|
||||
|
||||
public static final GameAction SLPD = new SPDAction("slpd");
|
||||
|
||||
public static final GameAction INVENTORY = new SPDAction("inventory");
|
||||
public static final GameAction QUICKSLOT_1 = new SPDAction("quickslot_1");
|
||||
public static final GameAction QUICKSLOT_2 = new SPDAction("quickslot_2");
|
||||
|
@ -101,6 +103,8 @@ public class SPDAction extends GameAction {
|
|||
defaultBindings.put( Input.Keys.D, SPDAction.E );
|
||||
defaultBindings.put( Input.Keys.SPACE, SPDAction.WAIT );
|
||||
|
||||
defaultBindings.put( Input.Keys.K, SPDAction.SLPD );
|
||||
|
||||
defaultBindings.put( Input.Keys.UP, SPDAction.N );
|
||||
defaultBindings.put( Input.Keys.LEFT, SPDAction.W );
|
||||
defaultBindings.put( Input.Keys.DOWN, SPDAction.S );
|
||||
|
|
|
@ -137,6 +137,8 @@ public class SPDSettings extends GameSettings {
|
|||
|
||||
private static final String ATBSettings = "ATBsettings";
|
||||
|
||||
private static final String V1TOOL = "v1tool";
|
||||
|
||||
public static void fullscreen( boolean value ) {
|
||||
put( KEY_FULLSCREEN, value );
|
||||
|
||||
|
@ -231,7 +233,7 @@ public class SPDSettings extends GameSettings {
|
|||
}
|
||||
|
||||
public static int interfaceSize(){
|
||||
int size = getInt( KEY_UI_SIZE, DeviceCompat.isDesktop() ? 2 : 0 );
|
||||
int size = getInt( KEY_UI_SIZE, DeviceCompat.isDesktop() ? 1 : 0 );
|
||||
if (size > 0){
|
||||
//force mobile UI if there is not enough space for full UI
|
||||
float wMin = Game.width / PixelScene.MIN_WIDTH_FULL;
|
||||
|
@ -240,6 +242,10 @@ public class SPDSettings extends GameSettings {
|
|||
size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(size == 2){
|
||||
size = 1;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -429,6 +435,10 @@ public class SPDSettings extends GameSettings {
|
|||
}
|
||||
}
|
||||
|
||||
public static void systemFont(boolean value){
|
||||
put(KEY_SYSTEMFONT, value);
|
||||
}
|
||||
|
||||
public static boolean systemFont(){
|
||||
return getBoolean(KEY_SYSTEMFONT,
|
||||
(language() == Languages.CHINESE || language() == Languages.JAPANESE));
|
||||
|
@ -544,4 +554,10 @@ public class SPDSettings extends GameSettings {
|
|||
public static void ClassPage(boolean value) {
|
||||
put( KEY_PAGE, value );
|
||||
}
|
||||
|
||||
public static boolean quickSwapper() {
|
||||
return getBoolean(V1TOOL, false);
|
||||
}
|
||||
|
||||
public static void quickSwapper(boolean value ){ put( V1TOOL, value ); }
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
|
@ -1323,7 +1324,7 @@ public class Hero extends Char {
|
|||
if (Dungeon.depth == 0) {
|
||||
|
||||
if (belongings.getItem(SakaFishSketon.class) != null) {
|
||||
Badges.REHOMESKY();
|
||||
PaswordBadges.REHOMESKY();
|
||||
}
|
||||
|
||||
if (belongings.getItem(Amulet.class) == null) {
|
||||
|
|
|
@ -26,6 +26,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.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionHero;
|
||||
|
@ -61,7 +62,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.custom.AncityArmor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.WraithAmulet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.BookBag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.HerbBag;
|
||||
|
@ -69,7 +69,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.KingBag;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.books.bookslist.BrokenBooks;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.books.bookslist.DimandBook;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.books.bookslist.IceCityBooks;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.books.bookslist.TestBooks;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.books.bookslist.YellowSunBooks;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||
|
@ -114,13 +113,17 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sai;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.SkyShield;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WashCrime;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.legend.DiedCrossBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingKnife;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.HaloDart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.AikeLaier;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Firebloom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.SkyBlueFireBloom;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public enum HeroClass {
|
||||
|
||||
WARRIOR( HeroSubClass.BERSERKER, HeroSubClass.GLADIATOR ),
|
||||
|
@ -151,7 +154,9 @@ public enum HeroClass {
|
|||
Dungeon.gold += 320;
|
||||
}
|
||||
|
||||
if ( Badges.isUnlocked(Badges.Badge.EXSG)){
|
||||
PaswordBadges.loadGlobal();
|
||||
List<PaswordBadges.Badge> passwordbadges = PaswordBadges.filtered( true );
|
||||
if(passwordbadges.contains(PaswordBadges.Badge.EXSG)){
|
||||
Dungeon.gold += 720;
|
||||
}
|
||||
|
||||
|
@ -165,12 +170,10 @@ public enum HeroClass {
|
|||
new LockSword().quantity(1).identify().collect();
|
||||
new IceFishSword().quantity(1).identify().collect();
|
||||
new PotionOfInvisibility().quantity(45).identify().collect();
|
||||
//new CommRelay().quantity(1).identify().collect();
|
||||
new AncityArmor().quantity(1).identify().collect();
|
||||
new TengusMask().quantity(1).identify().collect();
|
||||
new RingOfWealth().quantity(1).identify().collect();
|
||||
new TimekeepersHourglass().quantity(1).identify().collect();
|
||||
//new WandOfAnmy().quantity(1).identify().collect();
|
||||
new DiedCrossBow().quantity(1).identify().collect();
|
||||
Buff.affect(hero, ChampionHero.AntiMagic.class, 50000f);
|
||||
new WraithAmulet().quantity(1).identify().collect();
|
||||
new BloodthirstyThorn().quantity(1).identify().collect();
|
||||
|
@ -197,7 +200,6 @@ public enum HeroClass {
|
|||
new SkyBlueFireBloom.Seed().quantity(51).identify().collect();
|
||||
new AikeLaier.Seed().quantity(51).identify().collect();
|
||||
new Firebloom.Seed().quantity(15).identify().collect();
|
||||
|
||||
new WandOfRegrowth().quantity(1).identify().collect();
|
||||
new WandOfFrost().quantity(1).identify().collect();
|
||||
new MagicalInfusion().quantity(1).identify().collect();
|
||||
|
@ -220,7 +222,7 @@ public enum HeroClass {
|
|||
new PotionOfLiquidFlameX().quantity(100).identify().collect();
|
||||
new YellowSunBooks().quantity(1).identify().collect();
|
||||
new BrokenBooks().quantity(12).identify().collect();
|
||||
new IceCityBooks().quantity(12).identify().collect();
|
||||
new HaloDart().quantity(100).identify().collect();
|
||||
new ScrollOfFlameCursed().quantity(44).identify().collect();
|
||||
|
||||
new MailArmor().quantity(1).identify().collect();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Rat extends Mob {
|
|||
|
||||
HP = HT = 8;
|
||||
defenseSkill = 2;
|
||||
maxLvl = 30;
|
||||
maxLvl = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,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.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -493,11 +494,11 @@ public class YogDzewa extends Mob {
|
|||
}
|
||||
|
||||
if(Dungeon.isChallenged(SBSG)){
|
||||
Badges.BIGX();
|
||||
PaswordBadges.BIGX();
|
||||
}
|
||||
|
||||
if(Dungeon.isChallenged(EXSG)){
|
||||
Badges.EXSG();
|
||||
PaswordBadges.EXSG();
|
||||
}
|
||||
|
||||
updateVisibility(Dungeon.level);
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.bosses;
|
|||
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -382,7 +382,7 @@ public class DMZERO extends Mob
|
|||
GameScene.add(((Mob) (obj)));
|
||||
Actor.addDelayed(new Pushing(((Char) (obj)), pos, ((NullDiedTO) (obj)).pos), -1F);
|
||||
Statistics.bossScores[4] += 3000;
|
||||
Badges.BOSSRUSH();
|
||||
PaswordBadges.BOSSRUSH();
|
||||
|
||||
yell( Messages.get(this, "defeated") );
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import static com.shatteredpixel.shatteredpixeldungeon.levels.Level.set;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
|
@ -278,7 +279,7 @@ public class DiamondKnight extends Boss {
|
|||
Badges.KILL_SMK();
|
||||
|
||||
if(Statistics.dimandchestmazeCollected>=3){
|
||||
Badges.KILL_OMP();
|
||||
PaswordBadges.validateOMP();
|
||||
Statistics.bossScores[1] += 1000;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Boss;
|
||||
|
@ -1642,7 +1643,7 @@ public class DwarfMaster extends Boss {
|
|||
Dungeon.level.drop(new KingsCrown(), pos).sprite.drop();
|
||||
Dungeon.level.drop(new PotionOfHealing().quantity(Random.NormalIntRange(2,4)), pos).sprite.drop();
|
||||
Dungeon.level.drop(new MeatPie().quantity(Random.NormalIntRange(1,2)), pos).sprite.drop();
|
||||
Badges.KILLDWARF();
|
||||
PaswordBadges.KILLDWARF();
|
||||
Badges.validateBossSlain();
|
||||
|
||||
yell( Messages.get(this, "defeated") );
|
||||
|
|
|
@ -7,9 +7,9 @@ import static com.shatteredpixel.shatteredpixeldungeon.levels.ShopBossLevel.FALS
|
|||
import static com.shatteredpixel.shatteredpixeldungeon.levels.ShopBossLevel.TRUEPosition;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -763,7 +763,7 @@ public class FireMagicDied extends Mob implements Callback {
|
|||
|
||||
GameScene.bossSlain();
|
||||
|
||||
Badges.KILLFIREGIRL();
|
||||
PaswordBadges.KILLFIREGIRL();
|
||||
|
||||
yell( Messages.get(this, "defeated",Dungeon.hero.name()) );
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.bosses;
|
|||
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Boss;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
|
@ -169,7 +169,7 @@ public class SakaFishBoss extends Boss {
|
|||
@Override
|
||||
public int drRoll() {
|
||||
AncientMysteryCityBossLevel.State level = ((AncientMysteryCityBossLevel)Dungeon.level).pro();
|
||||
return level == AncientMysteryCityBossLevel.State.FALL_BOSS ? 10 : 45;
|
||||
return level == AncientMysteryCityBossLevel.State.FALL_BOSS ? 10 : 40;
|
||||
}
|
||||
|
||||
|
||||
|
@ -279,7 +279,7 @@ public class SakaFishBoss extends Boss {
|
|||
Dungeon.level.drop( new SakaFishSketon(), pos ).sprite.drop();
|
||||
Dungeon.level.drop( new WaterSoul(), pos ).sprite.drop();
|
||||
|
||||
Badges.KILLSAKA();
|
||||
PaswordBadges.KILLSAKA();
|
||||
|
||||
yell( Messages.get(this, "defeated") );
|
||||
|
||||
|
@ -445,6 +445,7 @@ public class SakaFishBoss extends Boss {
|
|||
} else {
|
||||
endPos = leapPos;
|
||||
}
|
||||
|
||||
//do leap
|
||||
sprite.visible = Dungeon.level.heroFOV[pos] || Dungeon.level.heroFOV[leapPos] || Dungeon.level.heroFOV[endPos];
|
||||
sprite.dirtcar(pos, leapPos, new Callback() {
|
||||
|
@ -462,9 +463,12 @@ public class SakaFishBoss extends Boss {
|
|||
Sample.INSTANCE.play(Assets.Sounds.HIT);
|
||||
}
|
||||
|
||||
if (!enemy.isAlive() && enemy == hero) {
|
||||
Dungeon.fail( getClass() );
|
||||
GLog.n( Messages.get(SakaFishBoss.class, "dictcar_kill"),Dungeon.hero.name() );
|
||||
Char ch = hero;
|
||||
if(hero != null){
|
||||
if (!ch.isAlive()) {
|
||||
Dungeon.fail( getClass() );
|
||||
GLog.n( Messages.get(SakaFishBoss.class, "dictcar_kill"),Dungeon.hero.name() );
|
||||
}
|
||||
}
|
||||
|
||||
if (endPos != leapPos){
|
||||
|
|
|
@ -50,7 +50,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.ItemLevel;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerLevel;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.GhostSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
|
||||
|
@ -291,6 +290,35 @@ public class Ghost extends NPC {
|
|||
reset();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ghostQuest(){
|
||||
float itemLevelRoll = Random.Float();
|
||||
int itemLevel;
|
||||
if (itemLevelRoll < 0.74f){
|
||||
itemLevel = 0;
|
||||
} else if (itemLevelRoll < 0.75f){
|
||||
itemLevel = 1;
|
||||
} else if (itemLevelRoll < 0.85f){
|
||||
itemLevel = 2;
|
||||
} else if (itemLevelRoll < 0.90f) {
|
||||
itemLevel = 3;
|
||||
if ((!Badges.isUnlocked(Badges.Badge.GHOSTDAGE))) {
|
||||
Statistics.dageCollected = 1;
|
||||
}
|
||||
} else if (itemLevelRoll < 0.95f && Badges.isUnlocked(Badges.Badge.GHOSTDAGE)) {
|
||||
if ((!Badges.isUnlocked(Badges.Badge.DAGETO))) {
|
||||
Statistics.dageCollected = 2;
|
||||
}
|
||||
itemLevel = 4;
|
||||
} else {
|
||||
if ((!Badges.isUnlocked(Badges.Badge.GHOSTDAGE))) {
|
||||
Statistics.dageCollected = 1;
|
||||
}
|
||||
itemLevel = 3;
|
||||
}
|
||||
weapon.upgrade(itemLevel);
|
||||
armor.upgrade(itemLevel);
|
||||
}
|
||||
|
||||
public static void spawn( SewerLevel level ) {
|
||||
if (!spawned && Dungeon.depth > 1 && Random.Int( 5 - Dungeon.depth ) == 0) {
|
||||
|
@ -325,35 +353,7 @@ public class Ghost extends NPC {
|
|||
weapon = (MeleeWeapon) Reflection.newInstance(c.classes[Random.chances(c.probs)]);
|
||||
|
||||
//26%:+0, 25%:+1, 15%:+2, 10%:+3, 5%:+4
|
||||
float itemLevelRoll = Random.Float();
|
||||
int itemLevel;
|
||||
if (itemLevelRoll < 0.74f){
|
||||
itemLevel = 0;
|
||||
} else if (itemLevelRoll < 0.75f){
|
||||
itemLevel = 1;
|
||||
} else if (itemLevelRoll < 0.85f){
|
||||
itemLevel = 2;
|
||||
} else if (itemLevelRoll < 0.90f) {
|
||||
itemLevel = 3;
|
||||
if ((!Badges.isUnlocked(Badges.Badge.GHOSTDAGE))) {
|
||||
Statistics.dageCollected = 1;
|
||||
Badges.GhostDageCollected();
|
||||
}
|
||||
} else if (itemLevelRoll < 0.95f && Badges.isUnlocked(Badges.Badge.GHOSTDAGE)) {
|
||||
if ((!Badges.isUnlocked(Badges.Badge.DAGETO))) {
|
||||
Statistics.dageCollected = 2;
|
||||
Badges.GhostDageCollected();
|
||||
}
|
||||
itemLevel = 4;
|
||||
} else {
|
||||
if ((!Badges.isUnlocked(Badges.Badge.GHOSTDAGE))) {
|
||||
Statistics.dageCollected = 1;
|
||||
Badges.GhostDageCollected();
|
||||
}
|
||||
itemLevel = 3;
|
||||
}
|
||||
weapon.upgrade(itemLevel);
|
||||
armor.upgrade(itemLevel);
|
||||
ghostQuest();
|
||||
|
||||
//10% to be enchanted. We store it separately so enchant status isn't revealed early
|
||||
if (Random.Int(10) == 0){
|
||||
|
@ -396,35 +396,7 @@ public class Ghost extends NPC {
|
|||
Generator.Category c = Generator.wepTiers[wepTier - 1];
|
||||
weapon = (MeleeWeapon) Reflection.newInstance(c.classes[Random.chances(c.probs)]);
|
||||
|
||||
//26%:+0, 25%:+1, 15%:+2, 10%:+3, 5%:+4, 5%+5
|
||||
float itemLevelRoll = Random.Float();
|
||||
int itemLevel;
|
||||
if (itemLevelRoll < 0.74f){
|
||||
itemLevel = 0;
|
||||
} else if (itemLevelRoll < 0.75f){
|
||||
itemLevel = 1;
|
||||
} else if (itemLevelRoll < 0.85f){
|
||||
itemLevel = 2;
|
||||
} else if (itemLevelRoll < 0.90f) {
|
||||
itemLevel = 3;
|
||||
hero.sprite.showStatus( CharSprite.NEGATIVE, "+3!!!" );
|
||||
} else if (itemLevelRoll < 0.95f && Badges.isUnlocked(Badges.Badge.GHOSTDAGE)){
|
||||
hero.sprite.showStatus( CharSprite.POSITIVE, "+5!!!" );
|
||||
if(( !Badges.isUnlocked(Badges.Badge.DAGETO))) {
|
||||
Statistics.dageCollected = 2;
|
||||
Badges.GhostDageCollected();
|
||||
}
|
||||
itemLevel = 5;
|
||||
} else {
|
||||
itemLevel = 4;
|
||||
hero.sprite.showStatus( CharSprite.WARNING, "+4!!!" );
|
||||
if(( !Badges.isUnlocked(Badges.Badge.GHOSTDAGE))) {
|
||||
Statistics.dageCollected = 1;
|
||||
Badges.GhostDageCollected();
|
||||
}
|
||||
}
|
||||
weapon.upgrade(itemLevel);
|
||||
armor.upgrade(itemLevel);
|
||||
ghostQuest();
|
||||
|
||||
//10% to be enchanted. We store it separately so enchant status isn't revealed early
|
||||
if (Random.Int(10) == 0){
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.spical;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NTNPC;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TribesmanSprite;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GnollHero extends NTNPC {
|
||||
|
||||
{
|
||||
spriteClass = TribesmanSprite.class;
|
||||
HP = HT = 120;
|
||||
properties.add(Property.NPC);
|
||||
baseSpeed = 2f;
|
||||
chat = new ArrayList<String>() {
|
||||
{
|
||||
add(Messages.get(GnollHero.class, "chat_1"));
|
||||
add(Messages.get(GnollHero.class, "chat_2"));
|
||||
add(Messages.get(GnollHero.class, "chat_3"));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public float attackDelay() {
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageRoll() {
|
||||
return Random.NormalIntRange( 20, 40 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 30;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int drRoll() {
|
||||
return Random.NormalIntRange(10, 16);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,9 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.custom.utils;
|
||||
|
||||
import com.watabou.noosa.Game;
|
||||
|
||||
public class Constants {
|
||||
public static final int MAX_DEPTH = 26;
|
||||
|
||||
public static final int MAX_QUICKSLOTS = 12;
|
||||
public static final int MOX_QUICKSLOTS = 8;
|
||||
public static final int MOX_QUICKSLOTS = 4;
|
||||
public static final int MIN_QUICKSLOTS = 3;
|
||||
|
||||
public static boolean gameIsAndroid(){
|
||||
return Game.platform.getClass().getSimpleName().contains("Android");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,198 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.effects;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.watabou.gltextures.SmartTexture;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class PasswordBadgeBanner extends Image {
|
||||
|
||||
private enum State {
|
||||
FADE_IN, STATIC, FADE_OUT
|
||||
}
|
||||
private PasswordBadgeBanner.State state;
|
||||
|
||||
public static final float DEFAULT_SCALE = 3;
|
||||
public static final int SIZE = 16;
|
||||
|
||||
private static final float FADE_IN_TIME = 0.25f;
|
||||
private static final float STATIC_TIME = 1f;
|
||||
private static final float FADE_OUT_TIME = 1.75f;
|
||||
|
||||
private int index;
|
||||
private float time;
|
||||
|
||||
private static TextureFilm atlas;
|
||||
|
||||
public static ArrayList<PasswordBadgeBanner> showing = new ArrayList<>();
|
||||
|
||||
private PasswordBadgeBanner( int index ) {
|
||||
|
||||
super( Assets.Interfaces.PROBADGES );
|
||||
|
||||
if (atlas == null) {
|
||||
atlas = new TextureFilm( texture, SIZE, SIZE );
|
||||
}
|
||||
|
||||
setup(index);
|
||||
}
|
||||
|
||||
public void setup( int index ){
|
||||
this.index = index;
|
||||
|
||||
frame( atlas.get( index ) );
|
||||
origin.set( width / 2, height / 2 );
|
||||
|
||||
alpha( 0 );
|
||||
scale.set( 2 * DEFAULT_SCALE );
|
||||
|
||||
state = PasswordBadgeBanner.State.FADE_IN;
|
||||
time = FADE_IN_TIME;
|
||||
|
||||
Sample.INSTANCE.play( Assets.Sounds.BADGE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
time -= Game.elapsed;
|
||||
if (time >= 0) {
|
||||
|
||||
switch (state) {
|
||||
case FADE_IN:
|
||||
float p = time / FADE_IN_TIME;
|
||||
scale.set( (1 + p) * DEFAULT_SCALE );
|
||||
alpha( 1 - p );
|
||||
break;
|
||||
case STATIC:
|
||||
break;
|
||||
case FADE_OUT:
|
||||
alpha( time / FADE_OUT_TIME );
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
switch (state) {
|
||||
case FADE_IN:
|
||||
time = STATIC_TIME;
|
||||
state = PasswordBadgeBanner.State.STATIC;
|
||||
scale.set( DEFAULT_SCALE );
|
||||
alpha( 1 );
|
||||
highlight( this, index );
|
||||
break;
|
||||
case STATIC:
|
||||
time = FADE_OUT_TIME;
|
||||
state = PasswordBadgeBanner.State.FADE_OUT;
|
||||
break;
|
||||
case FADE_OUT:
|
||||
killAndErase();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() {
|
||||
showing.remove(this);
|
||||
super.kill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
showing.remove(this);
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
//map to cache highlight positions so we don't have to keep looking at texture pixels
|
||||
private static HashMap<Integer, Point> highlightPositions = new HashMap<>();
|
||||
|
||||
//we also hardcode any special cases
|
||||
static {
|
||||
highlightPositions.put(Badges.Badge.MASTERY_COMBO.image, new Point(3, 7));
|
||||
}
|
||||
|
||||
//adds a shine to an appropriate pixel on a badge
|
||||
public static void highlight(Image image, int index ) {
|
||||
|
||||
PointF p = new PointF();
|
||||
|
||||
if (highlightPositions.containsKey(index)){
|
||||
p.x = highlightPositions.get(index).x * image.scale.x;
|
||||
p.y = highlightPositions.get(index).y * image.scale.y;
|
||||
} else {
|
||||
|
||||
SmartTexture tx = TextureCache.get(Assets.Interfaces.PROBADGES);
|
||||
|
||||
int size = 16;
|
||||
|
||||
int cols = tx.width / size;
|
||||
int row = index / cols;
|
||||
int col = index % cols;
|
||||
|
||||
int x = 3;
|
||||
int y = 4;
|
||||
int bgColor = tx.getPixel(col * size + x, row * size + y);
|
||||
int curColor = 0;
|
||||
|
||||
for (x = 3; x <= 12; x++) {
|
||||
curColor = tx.getPixel(col * size + x, row * size + y);
|
||||
if (curColor != bgColor) break;
|
||||
}
|
||||
|
||||
if (curColor == bgColor) {
|
||||
y++;
|
||||
for (x = 3; x <= 12; x++) {
|
||||
curColor = tx.getPixel(col * size + x, row * size + y);
|
||||
if (curColor != bgColor) break;
|
||||
}
|
||||
}
|
||||
|
||||
p.x = x * image.scale.x;
|
||||
p.y = y * image.scale.y;
|
||||
|
||||
highlightPositions.put(index, new Point(x, y));
|
||||
}
|
||||
|
||||
p.offset(
|
||||
-image.origin.x * (image.scale.x - 1),
|
||||
-image.origin.y * (image.scale.y - 1) );
|
||||
p.offset( image.point() );
|
||||
|
||||
Speck star = new Speck();
|
||||
star.reset( 0, p.x, p.y, Speck.DISCOVER );
|
||||
star.camera = image.camera();
|
||||
image.parent.add( star );
|
||||
}
|
||||
|
||||
public static PasswordBadgeBanner show( int image ) {
|
||||
PasswordBadgeBanner banner = new PasswordBadgeBanner(image);
|
||||
showing.add(banner);
|
||||
return banner;
|
||||
}
|
||||
|
||||
public static boolean isShowingBadges(){
|
||||
return !showing.isEmpty();
|
||||
}
|
||||
|
||||
public static Image image( int index ) {
|
||||
Image image = new Image( Assets.Interfaces.PROBADGES );
|
||||
if (atlas == null) {
|
||||
atlas = new TextureFilm( image.texture, 16, 16 );
|
||||
}
|
||||
image.frame( atlas.get( index ) );
|
||||
return image;
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,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.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
|
@ -111,6 +112,7 @@ public class Amulet extends Item {
|
|||
public void afterCreate() {
|
||||
Badges.validateVictory();
|
||||
Badges.validateChampion(Challenges.activeChallenges());
|
||||
PaswordBadges.ALLCS(Challenges.activeChallenges());
|
||||
Badges.saveGlobal();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -154,6 +154,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WarHammer;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WashCrime;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Whip;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.legend.DiedCrossBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Bolas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.FishingSpear;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ForceCube;
|
||||
|
@ -211,7 +212,7 @@ public class Generator {
|
|||
return randomWeapon(Dungeon.depth / 5, useDefaults);
|
||||
}
|
||||
|
||||
public enum Category {
|
||||
public enum Category {
|
||||
WEAPON ( 2, 2, MeleeWeapon.class),
|
||||
WEP_T1 ( 0, 0, MeleeWeapon.class),
|
||||
WEP_T2 ( 0, 0, MeleeWeapon.class),
|
||||
|
@ -219,30 +220,30 @@ public class Generator {
|
|||
WEP_T4 ( 0, 0, MeleeWeapon.class),
|
||||
WEP_T5 ( 0, 0, MeleeWeapon.class),
|
||||
WEP_T6 ( 0, 0, MeleeWeapon.class),
|
||||
|
||||
|
||||
ARMOR ( 2, 1, Armor.class ),
|
||||
|
||||
|
||||
MISSILE ( 1, 2, MissileWeapon.class ),
|
||||
MIS_T1 ( 0, 0, MissileWeapon.class ),
|
||||
MIS_T2 ( 0, 0, MissileWeapon.class ),
|
||||
MIS_T3 ( 0, 0, MissileWeapon.class ),
|
||||
MIS_T4 ( 0, 0, MissileWeapon.class ),
|
||||
MIS_T5 ( 0, 0, MissileWeapon.class ),
|
||||
|
||||
|
||||
WAND ( 1, 1, Wand.class ),
|
||||
RING ( 1, 0, Ring.class ),
|
||||
ARTIFACT( 0, 1, Artifact.class),
|
||||
|
||||
|
||||
FOOD ( 0, 0, Food.class ),
|
||||
|
||||
|
||||
POTION ( 8, 8, Potion.class ),
|
||||
SEED ( 1, 1, Plant.Seed.class ),
|
||||
|
||||
|
||||
SCROLL ( 8, 8, Scroll.class ),
|
||||
STONE ( 1, 1, Runestone.class),
|
||||
|
||||
|
||||
GOLD ( 10, 10, Gold.class );
|
||||
|
||||
|
||||
public Class<?>[] classes;
|
||||
|
||||
//some item types use a deck-based system, where the probs decrement as items are picked
|
||||
|
@ -257,13 +258,13 @@ public class Generator {
|
|||
public float firstProb;
|
||||
public float secondProb;
|
||||
public Class<? extends Item> superClass;
|
||||
|
||||
|
||||
private Category( float firstProb, float secondProb, Class<? extends Item> superClass ) {
|
||||
this.firstProb = firstProb;
|
||||
this.secondProb = secondProb;
|
||||
this.superClass = superClass;
|
||||
}
|
||||
|
||||
|
||||
public static int order( Item item ) {
|
||||
for (int i=0; i < values().length; i++) {
|
||||
if (values()[i].superClass.isInstance( item )) {
|
||||
|
@ -421,17 +422,21 @@ public class Generator {
|
|||
Glaive.class,
|
||||
Greataxe.class,
|
||||
Greatshield.class,
|
||||
WashCrime.class
|
||||
WashCrime.class,
|
||||
|
||||
|
||||
//传奇武器
|
||||
DiedCrossBow.class,
|
||||
|
||||
};
|
||||
WEP_T5.probs = new float[]{ 3, 3, 3, 3, 3, 3,3};
|
||||
WEP_T5.probs = new float[]{ 3, 3, 3, 3, 3, 3,3,1};
|
||||
|
||||
WEP_T6.classes = new Class<?>[]{
|
||||
IceFishSword.class,
|
||||
IceDewVialSword.class
|
||||
};
|
||||
WEP_T6.probs = new float[]{ 1,0 };
|
||||
|
||||
|
||||
//see Generator.randomArmor
|
||||
ARMOR.classes = new Class<?>[]{
|
||||
ClothArmor.class,
|
||||
|
@ -441,38 +446,38 @@ public class Generator {
|
|||
PlateArmor.class,
|
||||
LamellarArmor.class};
|
||||
ARMOR.probs = new float[]{ 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
|
||||
//see Generator.randomMissile
|
||||
MISSILE.classes = new Class<?>[]{};
|
||||
MISSILE.probs = new float[]{};
|
||||
|
||||
|
||||
MIS_T1.classes = new Class<?>[]{
|
||||
ThrowingStone.class,
|
||||
ThrowingKnife.class
|
||||
};
|
||||
MIS_T1.probs = new float[]{ 6, 5 };
|
||||
|
||||
|
||||
MIS_T2.classes = new Class<?>[]{
|
||||
FishingSpear.class,
|
||||
ThrowingClub.class,
|
||||
Shuriken.class
|
||||
};
|
||||
MIS_T2.probs = new float[]{ 6, 5, 4 };
|
||||
|
||||
|
||||
MIS_T3.classes = new Class<?>[]{
|
||||
ThrowingSpear.class,
|
||||
Kunai.class,
|
||||
Bolas.class
|
||||
};
|
||||
MIS_T3.probs = new float[]{ 6, 5, 4 };
|
||||
|
||||
|
||||
MIS_T4.classes = new Class<?>[]{
|
||||
Javelin.class,
|
||||
Tomahawk.class,
|
||||
HeavyBoomerang.class
|
||||
};
|
||||
MIS_T4.probs = new float[]{ 6, 5, 4 };
|
||||
|
||||
|
||||
MIS_T5.classes = new Class<?>[]{
|
||||
Trident.class,
|
||||
ThrowingHammer.class,
|
||||
|
@ -491,10 +496,10 @@ public class Generator {
|
|||
RiceDumplings.RiceDumplingsBottle.class,
|
||||
RiceDumplings.RiceDumplingsRed.class,
|
||||
RiceDumplings.RiceDumplingsOrange.class,
|
||||
RiceDumplings.RiceDumplingsPink.class,
|
||||
RiceDumplings.RiceDumplingsPink.class,
|
||||
};
|
||||
FOOD.probs = new float[]{ 4, 1, 0, isDWJ,isDWJ,isDWJ,isDWJ,isDWJ };
|
||||
|
||||
|
||||
RING.classes = new Class<?>[]{
|
||||
RingOfAccuracy.class,
|
||||
RingOfEvasion.class,
|
||||
|
@ -508,7 +513,7 @@ public class Generator {
|
|||
RingOfTenacity.class,
|
||||
RingOfWealth.class};
|
||||
RING.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
|
||||
|
||||
ARTIFACT.classes = new Class<?>[]{
|
||||
CapeOfThorns.class,
|
||||
ChaliceOfBlood.class,
|
||||
|
@ -558,7 +563,7 @@ public class Generator {
|
|||
public static void reset(Category cat){
|
||||
if (cat.defaultProbs != null) cat.probs = cat.defaultProbs.clone();
|
||||
}
|
||||
|
||||
|
||||
public static Item random() {
|
||||
Category cat = Random.chances( categoryProbs );
|
||||
if (cat == null){
|
||||
|
@ -569,7 +574,7 @@ public class Generator {
|
|||
categoryProbs.put( cat, categoryProbs.get( cat ) - 1);
|
||||
return random( cat );
|
||||
}
|
||||
|
||||
|
||||
public static Item random( Category cat ) {
|
||||
switch (cat) {
|
||||
case ARMOR:
|
||||
|
@ -601,7 +606,7 @@ public class Generator {
|
|||
return ((Item) Reflection.newInstance(cat.classes[Random.chances(cat.defaultProbs)])).random();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Item random( Class<? extends Item> cl ) {
|
||||
return Reflection.newInstance(cl).random();
|
||||
}
|
||||
|
@ -609,11 +614,11 @@ public class Generator {
|
|||
public static Armor randomArmor(){
|
||||
return randomArmor((Dungeon.depth + 1) / 3);
|
||||
}
|
||||
|
||||
|
||||
public static Armor randomArmor(int floorSet) {
|
||||
|
||||
floorSet = (int)GameMath.gate(0, floorSet, floorSetTierProbs.length-1);
|
||||
|
||||
|
||||
Armor a = (Armor)Reflection.newInstance(Category.ARMOR.classes[Random.chances(floorSetTierProbs[floorSet])]);
|
||||
a.random();
|
||||
return a;
|
||||
|
@ -631,17 +636,17 @@ public class Generator {
|
|||
public static MeleeWeapon randomWeapon(){
|
||||
return randomWeapon(Dungeon.depth / 5);
|
||||
}
|
||||
|
||||
|
||||
public static MeleeWeapon randomWeapon(int floorSet) {
|
||||
|
||||
floorSet = (int)GameMath.gate(0, floorSet, floorSetTierProbs.length-1);
|
||||
|
||||
|
||||
Category c = wepTiers[Random.chances(floorSetTierProbs[floorSet])];
|
||||
MeleeWeapon w = (MeleeWeapon)Reflection.newInstance(c.classes[Random.chances(c.probs)]);
|
||||
w.random();
|
||||
return w;
|
||||
}
|
||||
|
||||
|
||||
public static final Category[] misTiers = new Category[]{
|
||||
Category.MIS_T1,
|
||||
Category.MIS_T2,
|
||||
|
@ -649,15 +654,15 @@ public class Generator {
|
|||
Category.MIS_T4,
|
||||
Category.MIS_T5
|
||||
};
|
||||
|
||||
|
||||
public static MissileWeapon randomMissile(){
|
||||
return randomMissile(Dungeon.depth / 5);
|
||||
}
|
||||
|
||||
|
||||
public static MissileWeapon randomMissile(int floorSet) {
|
||||
|
||||
|
||||
floorSet = (int)GameMath.gate(0, floorSet, floorSetTierProbs.length-1);
|
||||
|
||||
|
||||
Category c = misTiers[Random.chances(floorSetTierProbs[floorSet])];
|
||||
MissileWeapon w = (MissileWeapon)Reflection.newInstance(c.classes[Random.chances(c.probs)]);
|
||||
w.random();
|
||||
|
@ -694,7 +699,7 @@ public class Generator {
|
|||
private static final String FIRST_DECK = "first_deck";
|
||||
private static final String GENERAL_PROBS = "general_probs";
|
||||
private static final String CATEGORY_PROBS = "_probs";
|
||||
|
||||
|
||||
public static void storeInBundle(Bundle bundle) {
|
||||
bundle.put(FIRST_DECK, usingFirstDeck);
|
||||
|
||||
|
@ -741,6 +746,6 @@ public class Generator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class Item implements Bundlable {
|
|||
|
||||
public int flasks;
|
||||
|
||||
protected int quantity = 1;
|
||||
public int quantity = 1;
|
||||
public boolean dropsDownHeap = false;
|
||||
|
||||
public int level = 0;
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
|||
|
||||
public class MainBooks extends Item {
|
||||
//extends 相当于 copyfrom,但不同的是 它是一种继承自己
|
||||
|
||||
@Override
|
||||
public String info() {
|
||||
return author;
|
||||
|
@ -13,7 +12,7 @@ public class MainBooks extends Item {
|
|||
public int value() {
|
||||
return 20 * quantity;
|
||||
}
|
||||
public String author = Messages.get(MainBooks.class, "mustread");
|
||||
public String author = Messages.get(MainBooks.class, "desc");
|
||||
|
||||
public String authorx = Messages.get(this, "author");
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ public class Artifact extends KindofMisc {
|
|||
|
||||
//display the current cooldown
|
||||
if (cooldown != 0)
|
||||
return Messages.format( "%d", cooldown );
|
||||
return Messages.format( "CD:%d", cooldown );
|
||||
|
||||
//display as percent
|
||||
if (chargeCap == 100)
|
||||
|
|
|
@ -5,20 +5,13 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.MainBooks;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBook;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Books extends MainBooks {
|
||||
|
||||
//每本书的计数只能计算一次,避免玩家重复阅读同一本书刷成就。
|
||||
public boolean readOnly = false;
|
||||
|
||||
{
|
||||
defaultAction = Read;
|
||||
stackable = true;
|
||||
|
@ -64,29 +57,10 @@ public class Books extends MainBooks {
|
|||
@Override
|
||||
public void execute(final Hero hero, String action ) {
|
||||
super.execute(hero, action);
|
||||
if (action.equals( Read ) && quantity>1) {
|
||||
if(!readOnly){
|
||||
if (action.equals( Read )) {
|
||||
Statistics.readBooks++;
|
||||
Badges.valiReadBooks();
|
||||
GameScene.show(new WndBook(this));
|
||||
readOnly = true;
|
||||
} else {
|
||||
GLog.w(Messages.get(MainBooks.class, "readed"));
|
||||
}
|
||||
} else {
|
||||
GLog.w( Messages.get(MainBooks.class, "no") );
|
||||
}
|
||||
}
|
||||
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
this.readOnly = bundle.getBoolean("readOnly");
|
||||
}
|
||||
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put("readOnly", this.readOnly);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.lightblack;
|
||||
//
|
||||
// Decompiled by Jadx - 759ms
|
||||
//
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
||||
|
||||
|
@ -71,14 +68,14 @@ public class OilLantern extends Item {
|
|||
}
|
||||
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
OilLantern.super.storeInBundle(bundle);
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put(ACTIVE, this.active);
|
||||
bundle.put(CHARGE, this.charge);
|
||||
bundle.put(FLASKS, this.flasks);
|
||||
}
|
||||
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
OilLantern.super.restoreFromBundle(bundle);
|
||||
super.restoreFromBundle(bundle);
|
||||
this.active = bundle.getBoolean(ACTIVE);
|
||||
this.charge = bundle.getInt(CHARGE);
|
||||
this.flasks = bundle.getInt(FLASKS);
|
||||
|
@ -146,7 +143,7 @@ public class OilLantern extends Item {
|
|||
}
|
||||
|
||||
public void refills(Hero hero) {
|
||||
this.flasks--;
|
||||
this.plingks--;
|
||||
this.charge += Math.min(MIX_CHARGE,100);
|
||||
hero.spend(TIME_TO_USE);
|
||||
hero.busy();
|
||||
|
|
|
@ -51,7 +51,7 @@ import com.watabou.utils.Random;
|
|||
import java.util.ArrayList;
|
||||
|
||||
public class LifeTreeSword extends MeleeWeapon {
|
||||
|
||||
private int getFood;
|
||||
{
|
||||
image = ItemSpriteSheet.LifeTreeSword;
|
||||
hitSoundPitch = 1f;
|
||||
|
@ -133,7 +133,7 @@ public class LifeTreeSword extends MeleeWeapon {
|
|||
return super.proc(attacker, defender, damage);
|
||||
}
|
||||
|
||||
private int getFood;
|
||||
|
||||
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
|
@ -159,6 +159,9 @@ public class LifeTreeSword extends MeleeWeapon {
|
|||
spriteClass = CrivusFruitsRedSprites.class;
|
||||
alignment = Alignment.ALLY;
|
||||
|
||||
|
||||
HT = HP = 10+level();
|
||||
|
||||
state = WANDERING = new Waiting();
|
||||
|
||||
properties.add(Property.IMMOVABLE);
|
||||
|
@ -171,12 +174,12 @@ public class LifeTreeSword extends MeleeWeapon {
|
|||
|
||||
@Override
|
||||
public int damageRoll() {
|
||||
return Random.NormalIntRange( 5, 8 );
|
||||
return Random.NormalIntRange( 5+level(), 8+level() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 6;
|
||||
return 6+level();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -61,7 +61,7 @@ public class Sai extends MeleeWeapon {
|
|||
//50x0.1+7x0.5+1=10+3.5+1=15
|
||||
if(attacker.HP >= attacker.HT){
|
||||
GLog.p("血量已满!无法回血");
|
||||
} else if (Random.Int(10)==2) {
|
||||
} else if (Random.Int(10)<=4) {
|
||||
R = (int) (attacker.HT * 0.1 + (buffedLvl() * 0.5) + 1.5);
|
||||
attacker.HP +=attacker.HT * 0.1 + (buffedLvl()) + 1.5;
|
||||
attacker.sprite.showStatus(CharSprite.POSITIVE, ("+" + R + "HP"));
|
||||
|
|
|
@ -0,0 +1,250 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.legend;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DiedCrossBow extends LegendWeapon {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.DIEDCROSSBOW;
|
||||
tier = 5;
|
||||
legend = 3;
|
||||
baseMin = 7;
|
||||
baseMax = 20;
|
||||
min = Lmin();
|
||||
max = Lmax();
|
||||
usesTargeting = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LegendWeapon.LegendWeaponBuff passiveBuff() {
|
||||
return new DiedCrossBow.Recharge();
|
||||
}
|
||||
|
||||
public class Recharge extends LegendWeapon.LegendWeaponBuff {
|
||||
@Override
|
||||
public boolean act() {
|
||||
if (cooldown < 0 ) {
|
||||
cooldown = 0;
|
||||
}
|
||||
if (cooldown > 0)
|
||||
cooldown--;
|
||||
updateQuickslot();
|
||||
spend(TICK);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String status() {
|
||||
|
||||
//display the current cooldown
|
||||
if (cooldown != 0){
|
||||
return Messages.format("CD:%d", cooldown);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(Hero hero, String action ) {
|
||||
|
||||
super.execute( hero, action );
|
||||
if (action.equals( AC_KING )) {
|
||||
|
||||
if (!isEquipped(hero)){
|
||||
GLog.i( Messages.get(this, "no_equip") );
|
||||
} else if(cooldown == 0) {
|
||||
GameScene.selectCell(bomb);
|
||||
} else {
|
||||
GLog.w(Messages.get(this, "no_cooldown"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public int targetingPos(Hero user, int dst) {
|
||||
return knockArrow().targetingPos(user, dst);
|
||||
}
|
||||
|
||||
private CellSelector.Listener bomb = new CellSelector.Listener() {
|
||||
@Override
|
||||
public void onSelect( Integer target ) {
|
||||
if (target != null) {
|
||||
final Ballistica shot = new Ballistica( curUser.pos, target, target);
|
||||
int cell = shot.collisionPos;
|
||||
Dart missile = Dungeon.hero.belongings.getItem(Dart.class);
|
||||
missile.quantity -= 5;
|
||||
if (Actor.findChar(target) != null) {
|
||||
QuickSlotButton.target(Actor.findChar(target));
|
||||
} else {
|
||||
QuickSlotButton.target(Actor.findChar(cell));
|
||||
}
|
||||
cooldown = 60-level()*2;
|
||||
knockArrow().cast(curUser, target-2);
|
||||
knockArrow().cast(curUser, target);
|
||||
knockArrow().cast(curUser, target+2);
|
||||
QuickSlotButton.target(Actor.findChar(target));
|
||||
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String prompt() {
|
||||
return Messages.get(SpiritBow.class, "prompt");
|
||||
}
|
||||
};
|
||||
|
||||
public DiedCrossBow.BombArrow knockArrow(){
|
||||
return new BombArrow();
|
||||
}
|
||||
|
||||
public static class BombArrow extends TippedDart {
|
||||
@Override
|
||||
public Emitter emitter() {
|
||||
Emitter emitter = new Emitter();
|
||||
emitter.pos(12.5f, 3.5f);
|
||||
emitter.fillTarget = false;
|
||||
emitter.pour(SmokeParticle.SPEW, 0.05f);
|
||||
return emitter;
|
||||
}
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.DISPLACING_DART;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int proc(Char attacker, Char defender, int damage) {
|
||||
DiedCrossBow dartGun = Dungeon.hero.belongings.getItem(DiedCrossBow.class);
|
||||
damage = Random.NormalIntRange(dartGun.Lmin(), dartGun.Lmax());
|
||||
this.explodeBomb(defender.pos);
|
||||
|
||||
return super.proc(attacker, defender, damage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemSprite.Glowing glowing() {
|
||||
return new ItemSprite.Glowing(0x880000, 6f);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onThrow( int cell ) {
|
||||
Char enemy = Actor.findChar( cell );
|
||||
if (enemy == null || enemy == curUser) {
|
||||
parent = null;
|
||||
Splash.at( cell, Window.CBLACK, 12 );
|
||||
this.explodeBomb(cell);
|
||||
} else {
|
||||
if (!curUser.shoot(enemy, this)) {
|
||||
Splash.at(cell, Window.CBLACK, 12);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void explodeBomb(int cell){
|
||||
//We're blowing up, so no need for a fuse anymore.
|
||||
|
||||
Sample.INSTANCE.play( Assets.Sounds.BLAST );
|
||||
|
||||
ArrayList<Char> affected = new ArrayList<>();
|
||||
|
||||
if (Dungeon.level.heroFOV[cell]) {
|
||||
CellEmitter.center(cell).burst(BlastParticle.FACTORY, 30);
|
||||
}
|
||||
|
||||
boolean terrainAffected = false;
|
||||
for (int n : PathFinder.NEIGHBOURS8) {
|
||||
int c = cell + n;
|
||||
if (c >= 0 && c < Dungeon.level.length()) {
|
||||
if (Dungeon.level.heroFOV[c]) {
|
||||
CellEmitter.get(c).burst(SmokeParticle.FACTORY, 4);
|
||||
}
|
||||
|
||||
if (Dungeon.level.flamable[c]) {
|
||||
Dungeon.level.destroy(c);
|
||||
GameScene.updateMap(c);
|
||||
terrainAffected = true;
|
||||
}
|
||||
|
||||
Char ch = Actor.findChar(c);
|
||||
if (ch != null) {
|
||||
affected.add(ch);
|
||||
}
|
||||
}
|
||||
|
||||
for (Char ch : affected){
|
||||
|
||||
//if they have already been killed by another bomb
|
||||
if(!ch.isAlive()){
|
||||
continue;
|
||||
}
|
||||
|
||||
DiedCrossBow diedCrossBow = Dungeon.hero.belongings.getItem(DiedCrossBow.class);
|
||||
int dmg = Random.NormalIntRange(diedCrossBow.Lmin(),diedCrossBow.Lmin());
|
||||
|
||||
//those not at the center of the blast take less damage
|
||||
if (ch.pos != cell){
|
||||
dmg = Math.round(dmg*0.67f);
|
||||
}
|
||||
|
||||
dmg -= ch.drRoll();
|
||||
|
||||
if (dmg > 0) {
|
||||
ch.damage(dmg, this);
|
||||
}
|
||||
|
||||
if (ch == Dungeon.hero && !ch.isAlive()) {
|
||||
Dungeon.fail(Bomb.class);
|
||||
}
|
||||
}
|
||||
|
||||
if (terrainAffected) {
|
||||
Dungeon.observe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int min(int lvl) {
|
||||
return 4 + lvl * (tier + 1); //scaling unchanged
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int max(int lvl) {
|
||||
return 25 + lvl * (tier + 5); //scaling unchanged
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.legend;
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class LegendWeapon extends MeleeWeapon {
|
||||
|
||||
{
|
||||
defaultAction = AC_KING;
|
||||
}
|
||||
protected Buff passiveBuff;
|
||||
protected Buff activeBuff;
|
||||
|
||||
public void activate( Char ch ) {
|
||||
passiveBuff = passiveBuff();
|
||||
passiveBuff.attachTo(ch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doUnequip( Hero hero, boolean collect, boolean single ) {
|
||||
if (super.doUnequip( hero, collect, single )) {
|
||||
|
||||
if (passiveBuff != null) {
|
||||
passiveBuff.detach();
|
||||
passiveBuff = null;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected static final String AC_KING = "KING";
|
||||
protected int legend;
|
||||
protected int min;
|
||||
protected int max;
|
||||
protected int baseMin;
|
||||
protected int baseMax;
|
||||
|
||||
|
||||
protected int cooldown = 0;
|
||||
|
||||
public class LegendWeaponBuff extends Buff {
|
||||
|
||||
public boolean isCursed() {
|
||||
return cursed;
|
||||
}
|
||||
|
||||
public void charge(Hero target, float amount){
|
||||
this.charge(target, amount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected LegendWeapon.LegendWeaponBuff passiveBuff() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected LegendWeapon.LegendWeaponBuff activeBuff() {return null; }
|
||||
|
||||
public void charge(Hero target, float amount){
|
||||
//do nothing by default;
|
||||
}
|
||||
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
cooldown = bundle.getInt("cooldown");
|
||||
|
||||
}
|
||||
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put("cooldown", cooldown);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions(Hero hero) {
|
||||
ArrayList<String> actions = super.actions(hero);
|
||||
actions.add(AC_KING);
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
||||
public int Lmin() {
|
||||
if(level()==0) {
|
||||
return baseMin;
|
||||
} else {
|
||||
return min * level();
|
||||
}
|
||||
}
|
||||
|
||||
public int Lmax() {
|
||||
if(level()==0){
|
||||
return baseMax;
|
||||
} else {
|
||||
return max*level(); //scaling unchanged
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String statsInfo() {
|
||||
if (isEquipped(hero)) {
|
||||
if (isIdentified()) {
|
||||
return Messages.get(LegendWeapon.class, "stats_desc", legend, Messages.get(this, "king_desc"), Lmin(),
|
||||
Lmax());
|
||||
} else {
|
||||
return Messages.get(LegendWeapon.class, "typical_stats_desc", 9);
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Crossbow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.legend.DiedCrossBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
|
@ -96,6 +97,8 @@ public class Dart extends MissileWeapon {
|
|||
}
|
||||
|
||||
private static Crossbow bow;
|
||||
|
||||
private static DiedCrossBow diedCrossBow;
|
||||
|
||||
private void updateCrossbow(){
|
||||
if (Dungeon.hero.belongings.weapon() instanceof Crossbow){
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||
|
||||
public class LaveCavesBossLevel extends Level{
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
protected boolean build() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
protected void createMobs() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
protected void createItems() {
|
||||
|
||||
}
|
||||
}
|
|
@ -25,6 +25,9 @@ import static com.shatteredpixel.shatteredpixeldungeon.items.Generator.randomArt
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NxhyNpc;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Nyz;
|
||||
|
@ -39,6 +42,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Pasty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ZeroLevel extends Level {
|
||||
private static final int[] pre_map = {190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 161, 4, 4, 4, 0, 0, 4, 0, 0, 0, 2, 0, 161, 190, 0, 0, 0, 0, 0, 0, 0, 190, 161, 0, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 161, 190, 190, 0, 4, 16, 4, 0, 0, 4, 0, 0, 0, 2, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 190, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 0, 4, 0, 4, 0, 0, 4, 0, 2, 0, 2, 0, 2, 190, 0, 0, 4, 4, 0, 0, 0, 190, 2, 2, 2, 2, 2, 2, 2, 4, 0, 0, 0, 0, 0, 190, 190, 0, 4, 0, 4, 0, 0, 4, 0, 0, 2, 2, 2, 0, 190, 0, 4, 0, 1, 4, 0, 0, 190, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 0, 4, 0, 4, 0, 0, 4, 0, 0, 0, 2, 0, 0, 190, 0, 4, 2, 3, 4, 0, 0, 190, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 0, 4, 0, 4, 0, 0, 4, 4, 4, 4, 4, 4, 4, 80, 4, 4, 4, 4, 4, 4, 4, 80, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 190, 190, 0, 4, 0, 4, 0, 0, 4, 0, 1, 4, 0, 0, 0, 190, 0, 4, 0, 1, 4, 0, 0, 190, 0, 0, 0, 4, 0, 0, 0, 1, 4, 4, 4, 4, 4, 190, 190, 0, 4, 4, 4, 0, 0, 4, 2, 3, 4, 0, 0, 0, 190, 0, 4, 2, 3, 4, 0, 0, 190, 0, 0, 0, 4, 0, 1, 1, 1, 4, 0, 0, 0, 0, 190, 190, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 0, 0, 0, 190, 0, 0, 4, 4, 0, 0, 0, 190, 0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 190, 190, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, 4, 0, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 2, 2, 2, 2, 2, 2, 4, 0, 0, 0, 0, 0, 0, 190, 0, 0, 4, 0, 4, 0, 0, 190, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0, 190, 0, 4, 0, 4, 0, 4, 0, 190, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 161, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 161, 190, 4, 0, 0, 0, 0, 0, 4, 190, 161, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 161, 190, 190, 190, 190, 190, 190, 190, 190, 80, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 80, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 80, 190, 190, 190, 190, 190, 190, 190, 0, 0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 4, 190, 123, 123, 123, 123, 123, 123, 123, 190, 4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 0, 0, 4, 0, 1, 4, 4, 0, 0, 0, 0, 4, 0, 190, 123, 98, 4, 10, 4, 98, 123, 190, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 0, 0, 4, 2, 3, 4, 4, 0, 0, 0, 4, 0, 0, 190, 123, 4, 0, 85, 0, 4, 123, 190, 0, 0, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 0, 80, 123, 10, 85, 17, 85, 10, 123, 80, 0, 4, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 190, 190, 0, 1, 4, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 190, 123, 4, 0, 85, 0, 4, 123, 190, 0, 0, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 2, 3, 4, 0, 0, 0, 4, 0, 0, 0, 0, 4, 0, 190, 123, 98, 4, 10, 4, 98, 123, 190, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 4, 4, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 190, 123, 123, 123, 123, 123, 123, 123, 190, 4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 190, 190, 190, 190, 190, 190, 80, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 80, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 80, 190, 190, 190, 190, 190, 190, 190, 124, 124, 124, 124, 124, 124, 4, 124, 124, 124, 124, 124, 124, 190, 4, 0, 0, 0, 0, 0, 4, 190, 161, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 161, 190, 190, 124, 124, 124, 124, 124, 124, 4, 124, 124, 124, 124, 124, 124, 190, 0, 4, 0, 4, 0, 4, 0, 190, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 0, 0, 4, 0, 4, 0, 0, 190, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, 4, 0, 0, 0, 190, 0, 0, 0, 0, 4, 0, 1, 4, 0, 1, 4, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, 4, 0, 0, 0, 190, 0, 0, 0, 0, 4, 2, 3, 4, 2, 3, 4, 0, 0, 190, 190, 124, 124, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 80, 4, 4, 4, 4, 4, 4, 4, 80, 4, 4, 4, 4, 4, 4, 4, 19, 4, 4, 4, 4, 4, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 0, 0, 0, 4, 0, 0, 0, 190, 0, 0, 2, 0, 4, 0, 1, 4, 0, 1, 4, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 4, 4, 4, 4, 4, 4, 4, 190, 0, 0, 2, 0, 4, 2, 3, 4, 2, 3, 4, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 4, 0, 1, 4, 0, 1, 4, 190, 0, 0, 2, 0, 4, 4, 4, 4, 4, 4, 4, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 4, 2, 3, 4, 2, 3, 4, 190, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 124, 124, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 190, 4, 4, 4, 4, 4, 4, 4, 190, 2, 0, 2, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 190, 0, 0, 0, 4, 0, 0, 0, 190, 0, 2, 2, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 190, 190, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 190, 0, 0, 0, 4, 0, 0, 0, 190, 161, 0, 2, 0, 0, 0, 0, 4, 0, 0, 0, 0, 161, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190};
|
||||
|
||||
|
@ -121,11 +126,18 @@ public class ZeroLevel extends Level {
|
|||
|
||||
drop( new Pasty(), this.width * 20 + 19 );
|
||||
|
||||
if ( Badges.isUnlocked(Badges.Badge.GODD_MAKE)){
|
||||
PaswordBadges.loadGlobal();
|
||||
List<PaswordBadges.Badge> passwordbadges = PaswordBadges.filtered( true );
|
||||
|
||||
if(passwordbadges.contains(PaswordBadges.Badge.GODD_MAKE)){
|
||||
drop( ( Generator.randomUsingDefaults( Generator.Category.RING ) ), this.width * 17 + 18 );
|
||||
}
|
||||
if ( Badges.isUnlocked(Badges.Badge.BIG_X)){
|
||||
drop( ( Generator.randomUsingDefaults( Generator.Category.ARMOR ) ), this.width * 19 + 18 );
|
||||
if(passwordbadges.contains(PaswordBadges.Badge.BIG_X)){
|
||||
if(Dungeon.isChallenged(Challenges.NO_ARMOR)){
|
||||
drop( ( Generator.randomUsingDefaults( Generator.Category.WAND ) ), this.width * 19 + 18 );
|
||||
} else {
|
||||
drop( ( Generator.randomUsingDefaults( Generator.Category.ARMOR ) ), this.width * 19 + 18 );
|
||||
}
|
||||
}
|
||||
if ( Badges.isUnlocked(Badges.Badge.KILL_DM720)||Badges.isUnlocked(Badges.Badge.KILL_MG) ){
|
||||
drop(( Generator.randomUsingDefaults( Generator.Category.WEP_T2 )), this.width * 18 + 17 );
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.levels.features;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.watabou.utils.Bundlable;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.Random;
|
||||
import com.watabou.utils.Rect;
|
||||
|
||||
public class LevelTransition extends Rect implements Bundlable {
|
||||
|
||||
public enum Type {
|
||||
SURFACE,
|
||||
REGULAR_ENTRANCE,
|
||||
REGULAR_EXIT,
|
||||
BRANCH_ENTRANCE,
|
||||
BRANCH_EXIT;
|
||||
}
|
||||
|
||||
public Type type;
|
||||
public int destDepth;
|
||||
public int destBranch;
|
||||
public Type destType;
|
||||
|
||||
public int centerCell;
|
||||
|
||||
//for bundling
|
||||
public LevelTransition(){
|
||||
super();
|
||||
}
|
||||
|
||||
public LevelTransition(Level level, int cell, Type type, int destDepth, int destBranch, Type destType){
|
||||
centerCell = cell;
|
||||
Point p = level.cellToPoint(cell);
|
||||
set(p.x, p.y, p.x, p.y);
|
||||
this.type = type;
|
||||
this.destDepth = destDepth;
|
||||
this.destBranch = destBranch;
|
||||
this.destType = destType;
|
||||
}
|
||||
|
||||
//gives default values for common transition types
|
||||
public LevelTransition(Level level, int cell, Type type){
|
||||
centerCell = cell;
|
||||
Point p = level.cellToPoint(cell);
|
||||
set(p.x, p.y, p.x, p.y);
|
||||
this.type = type;
|
||||
switch (type){
|
||||
case REGULAR_ENTRANCE: default:
|
||||
destDepth = Dungeon.depth-1;
|
||||
destBranch = Dungeon.branch;
|
||||
destType = Type.REGULAR_EXIT;
|
||||
break;
|
||||
case REGULAR_EXIT:
|
||||
destDepth = Dungeon.depth+1;
|
||||
destBranch = Dungeon.branch;
|
||||
destType = Type.REGULAR_ENTRANCE;
|
||||
break;
|
||||
case SURFACE:
|
||||
destDepth = 0;
|
||||
destBranch = 0;
|
||||
destType = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//note that the center cell isn't always the actual center.
|
||||
// It is important when game logic needs to pick a specific cell for some action
|
||||
// e.g. where to place the hero
|
||||
public int cell(){
|
||||
return centerCell;
|
||||
}
|
||||
|
||||
//Transitions are inclusive to their right and bottom sides
|
||||
@Override
|
||||
public int width() {
|
||||
return super.width()+1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int height() {
|
||||
return super.height()+1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inside(Point p) {
|
||||
return p.x >= left && p.x <= right && p.y >= top && p.y <= bottom;
|
||||
}
|
||||
|
||||
public boolean inside(int cell){
|
||||
return inside(new Point(Dungeon.level.cellToPoint(cell)));
|
||||
}
|
||||
|
||||
public Point center() {
|
||||
return new Point(
|
||||
(left + right) / 2 + (((right - left) % 2) == 1 ? Random.Int( 2 ) : 0),
|
||||
(top + bottom) / 2 + (((bottom - top) % 2) == 1 ? Random.Int( 2 ) : 0) );
|
||||
}
|
||||
|
||||
public static final String TYPE = "type";
|
||||
public static final String DEST_DEPTH = "dest_depth";
|
||||
public static final String DEST_BRANCH = "dest_branch";
|
||||
public static final String DEST_TYPE = "dest_type";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
bundle.put( "left", left );
|
||||
bundle.put( "top", top );
|
||||
bundle.put( "right", right );
|
||||
bundle.put( "bottom", bottom );
|
||||
|
||||
bundle.put( "center", centerCell );
|
||||
|
||||
bundle.put(TYPE, type);
|
||||
bundle.put(DEST_DEPTH, destDepth);
|
||||
bundle.put(DEST_BRANCH, destBranch);
|
||||
bundle.put(DEST_TYPE, destType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
left = bundle.getInt( "left" );
|
||||
top = bundle.getInt( "top" );
|
||||
right = bundle.getInt( "right" );
|
||||
bottom = bundle.getInt( "bottom" );
|
||||
|
||||
centerCell = bundle.getInt( "center" );
|
||||
|
||||
type = bundle.getEnum(TYPE, Type.class);
|
||||
destDepth = bundle.getInt(DEST_DEPTH);
|
||||
destBranch = bundle.getInt(DEST_BRANCH);
|
||||
if (bundle.contains(DEST_TYPE)) destType = bundle.getEnum(DEST_TYPE, Type.class);
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||
|
@ -150,7 +151,8 @@ public class CrystalPathRoom extends SpecialRoom {
|
|||
item = new LamellarArmor();
|
||||
} else {
|
||||
item = Generator.random(Random.oneOf(
|
||||
Generator.Category.ARMOR,
|
||||
Dungeon.isChallenged(Challenges.NO_ARMOR) ? Generator.Category.WAND :
|
||||
Generator.Category.ARMOR,
|
||||
Generator.Category.STONE,
|
||||
Generator.Category.WAND,
|
||||
Generator.Category.ARTIFACT)
|
||||
|
|
|
@ -12,7 +12,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.SRPDHBLR;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
|
@ -83,8 +82,7 @@ public class EyeRoom extends SpecialRoom {
|
|||
|
||||
int chestPos = (top + 6) * level.width() + left + 6;
|
||||
|
||||
/** 套五个宝箱 */
|
||||
level.drop( new Gold(),chestPos).type = Heap.Type.TELECRYSTL;
|
||||
/** 套4个宝箱 */
|
||||
level.mobs.add(Mimic.spawnAt(chestPos,( Generator.randomUsingDefaults( Generator.Category.POTION ) ), CrystalMimic.class));
|
||||
level.mobs.add(Mimic.spawnAt(chestPos,( Generator.randomUsingDefaults( Generator.Category.SCROLL ) ), CrystalMimic.class));
|
||||
level.mobs.add(Mimic.spawnAt(chestPos,( Generator.randomUsingDefaults( Generator.Category.WEAPON ) ),
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
|
@ -120,7 +121,8 @@ public class YinYangRoom extends SpecialRoom {
|
|||
if(Dungeon.depth == 1){
|
||||
door.set(Door.Type.REGULAR);
|
||||
} else {
|
||||
door.set(Door.Type.HIDDEN);
|
||||
level.addItemToSpawn( new IronKey( Dungeon.depth ) );
|
||||
door.set(Door.Type.LOCKED);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,8 +53,6 @@ public class Messages {
|
|||
return lang;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Setup Methods
|
||||
*/
|
||||
|
|
|
@ -96,8 +96,8 @@ public class CellSelector extends ScrollArea {
|
|||
}
|
||||
}
|
||||
|
||||
//then mobs
|
||||
for (Char mob : Dungeon.level.mobs.toArray(new Mob[0])){
|
||||
Mob[] mobs = Dungeon.level.mobs.toArray(new Mob[0]);
|
||||
for (Char mob : mobs) {
|
||||
if (mob.sprite != null && mob.sprite.overlapsPoint( p.x, p.y )){
|
||||
PointF c = DungeonTilemap.tileCenterToWorld(mob.pos);
|
||||
if (Math.abs(p.x - c.x) <= 12 && Math.abs(p.y - c.y) <= 12) {
|
||||
|
@ -106,6 +106,16 @@ public class CellSelector extends ScrollArea {
|
|||
}
|
||||
}
|
||||
}
|
||||
//then mobs
|
||||
// for (Char mob : Dungeon.level.mobs.toArray(new Mob[0])){
|
||||
// if (mob.sprite != null && mob.sprite.overlapsPoint( p.x, p.y )){
|
||||
// PointF c = DungeonTilemap.tileCenterToWorld(mob.pos);
|
||||
// if (Math.abs(p.x - c.x) <= 12 && Math.abs(p.y - c.y) <= 12) {
|
||||
// select(mob.pos, event.button);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//then heaps
|
||||
for (Heap heap : Dungeon.level.heaps.valueList()){
|
||||
|
|
|
@ -120,6 +120,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.ui.Tag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TargetHealthIndicator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Toast;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ToobarV;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
@ -217,7 +218,8 @@ public class GameScene extends PixelScene {
|
|||
private InventoryPane inventory;
|
||||
private static boolean invVisible = true;
|
||||
|
||||
private Toolbar toolbar;
|
||||
private ToobarV toolbar;
|
||||
private Toolbar toolbarv1;
|
||||
private Toast prompt;
|
||||
|
||||
private AttackIndicator attack;
|
||||
|
@ -414,19 +416,35 @@ public class GameScene extends PixelScene {
|
|||
bringToFront(status);
|
||||
}
|
||||
|
||||
toolbar = new Toolbar();
|
||||
toolbar.camera = uiCamera;
|
||||
add( toolbar );
|
||||
/**Toolbar V1+V2 */
|
||||
if(SPDSettings.quickSwapper()) {
|
||||
toolbarv1 = new Toolbar();
|
||||
toolbarv1.camera = uiCamera;
|
||||
add(toolbarv1);
|
||||
} else {
|
||||
toolbar = new ToobarV();
|
||||
toolbar.camera = uiCamera;
|
||||
add( toolbar );
|
||||
}
|
||||
|
||||
|
||||
if (uiSize == 2) {
|
||||
inventory = new InventoryPane();
|
||||
inventory.camera = uiCamera;
|
||||
inventory.setPos(uiCamera.width - inventory.width(), uiCamera.height - inventory.height());
|
||||
add(inventory);
|
||||
|
||||
toolbar.setRect( 0, uiCamera.height - toolbar.height() - inventory.height(), uiCamera.width, toolbar.height() );
|
||||
if(SPDSettings.quickSwapper()) {
|
||||
toolbarv1.setRect(0, uiCamera.height - toolbarv1.height() - inventory.height(), uiCamera.width,
|
||||
toolbarv1.height());
|
||||
} else {
|
||||
toolbar.setRect(0, uiCamera.height - toolbar.height() - inventory.height(), uiCamera.width, toolbar.height());
|
||||
}
|
||||
} else {
|
||||
toolbar.setRect( 0, uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height() );
|
||||
if(SPDSettings.quickSwapper()) {
|
||||
toolbarv1.setRect(0, uiCamera.height - toolbarv1.height(), uiCamera.width, toolbarv1.height());
|
||||
} else {
|
||||
toolbar.setRect(0, uiCamera.height - toolbar.height(), uiCamera.width, toolbar.height());
|
||||
}
|
||||
}
|
||||
|
||||
layoutTags();
|
||||
|
@ -935,7 +953,9 @@ public class GameScene extends PixelScene {
|
|||
|
||||
float invWidth = (scene.inventory != null && scene.inventory.visible) ? scene.inventory.width() : 0;
|
||||
|
||||
float y = SPDSettings.interfaceSize() == 0 ? scene.toolbar.top()-2 : scene.status.top()-2;
|
||||
float y = SPDSettings.interfaceSize() == 0 ? SPDSettings.quickSwapper()? scene.toolbarv1.top()-2:
|
||||
scene.toolbar.top()-2 :
|
||||
scene.status.top()-2;
|
||||
if (tagsOnLeft) {
|
||||
scene.log.setRect(tagWidth, y, uiCamera.width - tagWidth - insets.right - invWidth, 0);
|
||||
} else if (invWidth > 0) {
|
||||
|
@ -944,7 +964,7 @@ public class GameScene extends PixelScene {
|
|||
scene.log.setRect(insets.left, y, uiCamera.width - tagWidth - insets.left, 0);
|
||||
}
|
||||
|
||||
float pos = scene.toolbar.top();
|
||||
float pos = SPDSettings.quickSwapper()?scene.toolbarv1.top():scene.toolbar.top();
|
||||
if (tagsOnLeft && SPDSettings.interfaceSize() > 0){
|
||||
pos = scene.status.top();
|
||||
}
|
||||
|
@ -1190,7 +1210,13 @@ public class GameScene extends PixelScene {
|
|||
}
|
||||
|
||||
public static void pickUp( Item item, int pos ) {
|
||||
if (scene != null) scene.toolbar.pickup( item, pos );
|
||||
if (scene != null){
|
||||
if (SPDSettings.quickSwapper()) {
|
||||
scene.toolbarv1.pickup(item, pos);
|
||||
} else {
|
||||
scene.toolbar.pickup(item, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void pickUpJournal( Item item, int pos ) {
|
||||
|
@ -1308,10 +1334,19 @@ public class GameScene extends PixelScene {
|
|||
if (scene != null && scene.inventory != null){
|
||||
if (scene.inventory.visible){
|
||||
scene.inventory.visible = scene.inventory.active = invVisible = false;
|
||||
scene.toolbar.setPos(scene.toolbar.left(), uiCamera.height-scene.toolbar.height());
|
||||
if(SPDSettings.quickSwapper()){
|
||||
scene.toolbarv1.setPos(scene.toolbarv1.left(), uiCamera.height-scene.toolbarv1.height());
|
||||
} else {
|
||||
scene.toolbar.setPos(scene.toolbar.left(), uiCamera.height-scene.toolbar.height());
|
||||
}
|
||||
|
||||
} else {
|
||||
scene.inventory.visible = scene.inventory.active = invVisible = true;
|
||||
scene.toolbar.setPos(scene.toolbar.left(), scene.inventory.top()-scene.toolbar.height());
|
||||
if(SPDSettings.quickSwapper()) {
|
||||
scene.toolbarv1.setPos(scene.toolbarv1.left(), scene.inventory.top() - scene.toolbarv1.height());
|
||||
} else {
|
||||
scene.toolbar.setPos(scene.toolbar.left(), scene.inventory.top() - scene.toolbar.height());
|
||||
}
|
||||
}
|
||||
layoutTags();
|
||||
}
|
||||
|
@ -1605,7 +1640,18 @@ public class GameScene extends PixelScene {
|
|||
selectCell( defaultCellListener );
|
||||
QuickSlotButton.cancel();
|
||||
InventoryPane.cancelTargeting();
|
||||
if (scene != null && scene.toolbar != null) scene.toolbar.examining = false;
|
||||
|
||||
if(SPDSettings.quickSwapper()){
|
||||
if (scene != null && scene.toolbarv1 != null){
|
||||
scene.toolbarv1.examining = false;
|
||||
}
|
||||
} else {
|
||||
if (scene != null && scene.toolbar != null){
|
||||
scene.toolbar.examining = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void checkKeyHold(){
|
||||
|
|
|
@ -38,7 +38,7 @@ public class GoScene extends PixelScene {
|
|||
int w = Camera.main.width;
|
||||
int h = Camera.main.height;
|
||||
|
||||
gdx = new Image(Assets.Splashes.MLPD2Y) {
|
||||
gdx = new Image(Assets.Splashes.GDX) {
|
||||
@Override
|
||||
public void update() {
|
||||
if (SPDSettings.splashScreen() > 0 && sec < 1f) {
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.PasswordBadgeBanner;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Button;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndProBadge;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.audio.Music;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PassWordBadgesScene extends PixelScene {
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
|
||||
super.create();
|
||||
|
||||
Music.INSTANCE.play( Assets.Music.THEME, true );
|
||||
|
||||
uiCamera.visible = false;
|
||||
|
||||
int w = Camera.main.width;
|
||||
int h = Camera.main.height;
|
||||
|
||||
Archs archs = new Archs();
|
||||
archs.setSize( w, h );
|
||||
add( archs );
|
||||
|
||||
float left = 5;
|
||||
float top = 20;
|
||||
|
||||
RenderedTextBlock title = PixelScene.renderTextBlock( Messages.get(this, "title"), 9 );
|
||||
title.hardlight(Window.TITLE_COLOR);
|
||||
title.setPos(
|
||||
(w - title.width()) / 2f,
|
||||
(top - title.height()) / 2f
|
||||
);
|
||||
align(title);
|
||||
add(title);
|
||||
|
||||
PaswordBadges.loadGlobal();
|
||||
|
||||
List<PaswordBadges.Badge> badges = PaswordBadges.filtered( true );
|
||||
|
||||
int blankBadges = 8;
|
||||
blankBadges -= badges.size();
|
||||
if (badges.contains(Badges.Badge.ALL_ITEMS_IDENTIFIED)) blankBadges -= 6;
|
||||
if (badges.contains(Badges.Badge.YASD)) blankBadges -= 5;
|
||||
blankBadges = Math.max(0, blankBadges);
|
||||
|
||||
//guarantees a max of 5 rows in landscape, and 8 in portrait, assuming a max of 40 buttons
|
||||
int nCols = landscape() ? 7 : 4;
|
||||
if (badges.size() + blankBadges > 32 && !landscape()) nCols++;
|
||||
|
||||
int nRows = 1 + (blankBadges + badges.size())/nCols;
|
||||
|
||||
float badgeWidth = (w - 2*left)/nCols;
|
||||
float badgeHeight = (h - 2*top)/nRows;
|
||||
|
||||
for (int i = 0; i < badges.size() + blankBadges; i++){
|
||||
int row = i / nCols;
|
||||
int col = i % nCols;
|
||||
PaswordBadges.Badge b = i < badges.size() ? badges.get( i ) : null;
|
||||
BadgeButton button = new BadgeButton( b );
|
||||
button.setPos(
|
||||
left + col * badgeWidth + (badgeWidth - button.width()) / 2,
|
||||
top + row * badgeHeight + (badgeHeight - button.height()) / 2);
|
||||
align(button);
|
||||
add( button );
|
||||
}
|
||||
|
||||
ExitButton btnExit = new ExitButton();
|
||||
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
|
||||
add( btnExit );
|
||||
|
||||
fadeIn();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
Badges.saveGlobal();
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBackPressed() {
|
||||
ShatteredPixelDungeon.switchNoFade( TitleScene.class );
|
||||
}
|
||||
|
||||
private static class BadgeButton extends Button {
|
||||
|
||||
private PaswordBadges.Badge badge;
|
||||
|
||||
private Image icon;
|
||||
|
||||
public BadgeButton( PaswordBadges.Badge badge ) {
|
||||
super();
|
||||
|
||||
this.badge = badge;
|
||||
active = (badge != null);
|
||||
|
||||
icon = active ? PasswordBadgeBanner.image(badge.image) : new Image( Assets.Interfaces.LOCKED );
|
||||
add(icon);
|
||||
|
||||
setSize( icon.width(), icon.height() );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
|
||||
icon.x = x + (width - icon.width()) / 2;
|
||||
icon.y = y + (height - icon.height()) / 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (Random.Float() < Game.elapsed * 0.1) {
|
||||
BadgeBanner.highlight( icon, badge.image );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
Sample.INSTANCE.play( Assets.Sounds.CLICK, 0.7f, 0.7f, 1.2f );
|
||||
Game.scene().add( new WndProBadge( badge ) );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,8 +23,10 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BadgeBanner;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.PasswordBadgeBanner;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
|
@ -147,12 +149,12 @@ public class PixelScene extends Scene {
|
|||
renderedTextPageSize = 1024;
|
||||
}
|
||||
//asian languages have many more unique characters, so increase texture size to anticipate that
|
||||
if
|
||||
(Messages.lang() == Languages.CHINESE ||
|
||||
//asian languages have many more unique characters, so increase texture size to anticipate that
|
||||
if (Messages.lang() == Languages.CHINESE ||
|
||||
Messages.lang() == Languages.JAPANESE){
|
||||
renderedTextPageSize *= 2;
|
||||
}
|
||||
Game.platform.setupFontGenerators(renderedTextPageSize, false);
|
||||
Game.platform.setupFontGenerators(renderedTextPageSize, SPDSettings.systemFont());
|
||||
|
||||
Tooltip.resetLastUsedTime();
|
||||
|
||||
|
@ -289,6 +291,31 @@ public class PixelScene extends Scene {
|
|||
add( new Fader( color, light ) );
|
||||
}
|
||||
|
||||
public static void showProBadge( PaswordBadges.Badge badge ) {
|
||||
Game.runOnRenderThread(new Callback() {
|
||||
@Override
|
||||
public void call() {
|
||||
Scene s = Game.scene();
|
||||
if (s != null) {
|
||||
PasswordBadgeBanner banner = PasswordBadgeBanner.show(badge.image);
|
||||
s.add(banner);
|
||||
float offset = Camera.main.centerOffset.y;
|
||||
|
||||
int left = uiCamera.width/2 - PasswordBadgeBanner.SIZE/2;
|
||||
left -= (PasswordBadgeBanner.SIZE * PasswordBadgeBanner.DEFAULT_SCALE * (PasswordBadgeBanner.showing.size()-1))/2;
|
||||
for (int i = 0; i < PasswordBadgeBanner.showing.size(); i++){
|
||||
banner = PasswordBadgeBanner.showing.get(i);
|
||||
banner.camera = uiCamera;
|
||||
banner.x = align(banner.camera, left);
|
||||
banner.y = align(uiCamera, (uiCamera.height - banner.height) / 2 - banner.height / 2 - 16 - offset);
|
||||
left += PasswordBadgeBanner.SIZE * PasswordBadgeBanner.DEFAULT_SCALE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void showBadge( Badges.Badge badge ) {
|
||||
Game.runOnRenderThread(new Callback() {
|
||||
@Override
|
||||
|
|
|
@ -202,6 +202,11 @@ public class TitleScene extends PixelScene {
|
|||
protected void onClick() {
|
||||
ShatteredPixelDungeon.switchNoFade(BadgesScene.class);
|
||||
}
|
||||
@Override
|
||||
protected boolean onLongClick() {
|
||||
ShatteredPixelDungeon.switchNoFade(PassWordBadgesScene.class);
|
||||
return super.onLongClick();
|
||||
}
|
||||
};
|
||||
btnBadges.icon(new ItemSprite(ItemSpriteSheet.GREENBOOKS, null));
|
||||
add(btnBadges);
|
||||
|
|
|
@ -70,8 +70,10 @@ public class WelcomeScene extends PixelScene {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ShatteredPixelDungeon.versionCode == previousVersion && !SPDSettings.intro()) {
|
||||
if (ShatteredPixelDungeon.versionCode == previousVersion && !SPDSettings.intro() && !SPDSettings.firebase()) {
|
||||
ShatteredPixelDungeon.switchNoFade(GameNewsScene.class);
|
||||
} else {
|
||||
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -712,6 +712,33 @@ public class ItemSpriteSheet {
|
|||
assignItemRect(RiceDumplingsBottle, 14, 14);
|
||||
}
|
||||
|
||||
//传奇武器
|
||||
private static final int LENGYWEAPONS = xy(1, 39); //16 slots
|
||||
|
||||
public static final int MOONDAILY= LENGYWEAPONS+1;
|
||||
|
||||
public static final int DCSURANG= LENGYWEAPONS+2;
|
||||
|
||||
public static final int THEDIED= LENGYWEAPONS+3;
|
||||
|
||||
public static final int CURSEDAXE= LENGYWEAPONS+4;
|
||||
|
||||
public static final int EAGLEPOWER= LENGYWEAPONS+5;
|
||||
|
||||
public static final int GOLDLANGGUN= LENGYWEAPONS+6;
|
||||
|
||||
public static final int CLEARPRO= LENGYWEAPONS+7;
|
||||
|
||||
public static final int FORESTCROSSBOW= LENGYWEAPONS+8;
|
||||
|
||||
public static final int DIEDCROSSBOW = LENGYWEAPONS+9;
|
||||
|
||||
public static final int DIEDBOOK= LENGYWEAPONS+10;
|
||||
|
||||
static {
|
||||
assignItemRect(DIEDCROSSBOW, 16, 15);
|
||||
}
|
||||
|
||||
private static final int BAGS = xy(1, 31); //16 slots
|
||||
public static final int VIAL = BAGS+0;
|
||||
public static final int POUCH = BAGS+1;
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.sprites;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
|
||||
public class TribesmanSprite extends MobSprite {
|
||||
|
||||
public TribesmanSprite() {
|
||||
super();
|
||||
|
||||
texture( Assets.Sprites.HEROGNOLL );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 13, 16 );
|
||||
|
||||
idle = new Animation( 2, true );
|
||||
idle.frames( frames, 0, 0, 0, 1, 0, 0, 1, 1 );
|
||||
|
||||
run = new Animation( 12, true );
|
||||
run.frames( frames, 5, 6, 7, 8 );
|
||||
|
||||
attack = new Animation( 12, false );
|
||||
attack.frames( frames, 2, 3, 4, 0 );
|
||||
|
||||
die = new Animation( 12, false );
|
||||
die.frames( frames, 9, 10, 11 );
|
||||
|
||||
play( idle );
|
||||
}
|
||||
}
|
|
@ -166,11 +166,15 @@ public class BossHealthBar extends Component {
|
|||
float health = boss.HP;
|
||||
float shield = boss.shielding();
|
||||
float max = boss.HT;
|
||||
int maxHp = boss.HP;
|
||||
hp.scale.x = Math.max( 0, (health-shield)/max);
|
||||
shieldedHP.scale.x = health/max;
|
||||
rawShielding.scale.x = shield/max;
|
||||
|
||||
|
||||
if (hp.scale.x < 0.25f){
|
||||
bleed( true );
|
||||
}
|
||||
|
||||
if (shield <= 0){
|
||||
hpText.text(health + "/" + max);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class JoinIndicator extends Button {
|
|||
bg.hardlight(0x00ffff);
|
||||
add(bg);
|
||||
|
||||
add(slot = new Toolbar.Tool(48, 26, 48, 72) {
|
||||
add(slot = new Toolbar.Tool(48, 26, 24, 72) {
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
|
|
|
@ -70,6 +70,10 @@ public class QuickSlotButton extends Button {
|
|||
reset();
|
||||
}
|
||||
|
||||
public void slotMargins( int left, int top, int right, int bottom){
|
||||
slot.setMargins(left, top, right, bottom);
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
instance = new QuickSlotButton[Constants.MAX_QUICKSLOTS];
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ public class StatusPane extends Component {
|
|||
public JoinIndicator joinxxx;
|
||||
public LanterFireCator lanter;
|
||||
|
||||
private static String asset = Assets.Interfaces.STATUS;
|
||||
private static String asset = Assets.Interfaces.STATUS_DARK;
|
||||
|
||||
private boolean large;
|
||||
|
||||
|
@ -164,8 +164,10 @@ public class StatusPane extends Component {
|
|||
else hg = new Image(asset, 0, 45, 49, 4);
|
||||
add( hg );
|
||||
|
||||
if (large) icehp = new Image(asset, 0, 128, 128, 7);
|
||||
else icehp = new Image(asset, 0, 49, 52, 4);
|
||||
if (large)
|
||||
icehp = new Image(asset, 0, 135, 128, 6);
|
||||
else icehp = new Image(asset, 0, 49, 52, 4);
|
||||
|
||||
add( icehp );
|
||||
|
||||
lanterfirevae = new Image(Assets.Interfaces.LANTERLING);
|
||||
|
@ -175,7 +177,6 @@ public class StatusPane extends Component {
|
|||
hpText.alpha(0.6f);
|
||||
add(hpText);
|
||||
|
||||
|
||||
hgText = new BitmapText(PixelScene.pixelFont);
|
||||
hgText.alpha(0.6f);
|
||||
add(hgText);
|
||||
|
@ -280,14 +281,18 @@ public class StatusPane extends Component {
|
|||
PixelScene.align(hpText);
|
||||
|
||||
hg.x= x + 30;
|
||||
hg.y= y + 10;
|
||||
hg.y= y + 10f;
|
||||
|
||||
hgText.x = x+80;
|
||||
hgText.y = hg.y;
|
||||
PixelScene.align(hgText);
|
||||
|
||||
icehp.x = x+ 30;
|
||||
icehp.y = y + 4;
|
||||
icehp.y = y + 2f;
|
||||
|
||||
icehpText.x = x+80;
|
||||
icehpText.y = icehp.y-0.6f;
|
||||
PixelScene.align(icehpText);
|
||||
|
||||
expText.x = exp.x + (128 - expText.width())/2f;
|
||||
expText.y = exp.y;
|
||||
|
@ -378,6 +383,12 @@ public class StatusPane extends Component {
|
|||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (SPDSettings.ClassUI()) {
|
||||
asset = Assets.Interfaces.STATUS;
|
||||
} else {
|
||||
asset = Assets.Interfaces.STATUS_DARK;
|
||||
}
|
||||
|
||||
int maxHunger = (int) Hunger.STARVING;
|
||||
int maxPureSole = Dungeon.hero.lanterfire;
|
||||
int mtPureSole = 100;
|
||||
|
|
|
@ -0,0 +1,632 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.QuickSlot.VSIZE;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTerrainTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndKeyBindings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuickBag;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
import com.watabou.input.GameAction;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.ColorBlock;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Gizmo;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.PointerArea;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
import com.watabou.utils.Point;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class ToobarV extends Component {
|
||||
|
||||
private Tool btnWait;
|
||||
private Tool btnExamine;
|
||||
private Tool btnInventory;
|
||||
private SwitchQuickSlotTool btnSwitchSlot;
|
||||
private QuickslotTool[] btnQuick;
|
||||
private int numVisibleSlots;
|
||||
|
||||
private PickedUpItem pickedUp;
|
||||
|
||||
private boolean lastEnabled = true;
|
||||
public boolean examining = false;
|
||||
|
||||
private static ToobarV instance;
|
||||
|
||||
public enum Mode {
|
||||
SPLIT,
|
||||
GROUP,
|
||||
CENTER
|
||||
}
|
||||
|
||||
public ToobarV() {
|
||||
super();
|
||||
instance = this;
|
||||
height = btnInventory.height();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
|
||||
numVisibleSlots = 2;
|
||||
if (PixelScene.uiCamera.width > 120) numVisibleSlots++;
|
||||
if (PixelScene.uiCamera.width > 138) numVisibleSlots++;
|
||||
if (PixelScene.uiCamera.width > 156) numVisibleSlots++;
|
||||
if (PixelScene.uiCamera.width > 174) numVisibleSlots++;
|
||||
if (PixelScene.uiCamera.width > 192) numVisibleSlots++;
|
||||
if (PixelScene.uiCamera.width > 210) numVisibleSlots++;
|
||||
if (PixelScene.uiCamera.width > 228) numVisibleSlots++;
|
||||
|
||||
if (numVisibleSlots < VSIZE) {
|
||||
numVisibleSlots--;
|
||||
add( btnSwitchSlot = new SwitchQuickSlotTool( 125, 0, 16, 16) );
|
||||
}
|
||||
|
||||
btnQuick = new QuickslotTool[VSIZE];
|
||||
for (int i = 0; i < btnQuick.length; i++){
|
||||
add( btnQuick[i] = new QuickslotTool(64, 0, 22, 24, i) );
|
||||
}
|
||||
|
||||
add(btnWait = new Tool(24, 0, 20, 26) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
||||
examining = false;
|
||||
Dungeon.hero.rest(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
return SPDAction.WAIT;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String hoverText() {
|
||||
return Messages.titleCase(Messages.get(WndKeyBindings.class, "wait"));
|
||||
}
|
||||
|
||||
protected boolean onLongClick() {
|
||||
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
||||
examining = false;
|
||||
Dungeon.hero.rest(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
add(new Button(){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready && !GameScene.cancel()) {
|
||||
examining = false;
|
||||
Dungeon.hero.rest(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
if (btnWait.active) return SPDAction.REST;
|
||||
else return null;
|
||||
}
|
||||
});
|
||||
|
||||
add(btnExamine = new Tool(44, 0, 20, 26) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready) {
|
||||
if (!examining && !GameScene.cancel()) {
|
||||
GameScene.selectCell(informer);
|
||||
examining = true;
|
||||
} else if (examining) {
|
||||
informer.onSelect(null);
|
||||
Dungeon.hero.search(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
return SPDAction.EXAMINE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String hoverText() {
|
||||
return Messages.titleCase(Messages.get(WndKeyBindings.class, "examine"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onLongClick() {
|
||||
Dungeon.hero.search(true);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
addToBack(btnInventory = new Tool(0, 0, 24, 26) {
|
||||
private GoldIndicator gold;
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Dungeon.hero.ready || !Dungeon.hero.isAlive()) {
|
||||
if (!GameScene.cancel()) {
|
||||
GameScene.show(new WndBag(Dungeon.hero.belongings.backpack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
return SPDAction.INVENTORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String hoverText() {
|
||||
return Messages.titleCase(Messages.get(WndKeyBindings.class, "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onLongClick() {
|
||||
GameScene.show(new WndQuickBag(null));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
super.createChildren();
|
||||
gold = new GoldIndicator();
|
||||
add(gold);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
gold.fill(this);
|
||||
}
|
||||
});
|
||||
|
||||
add(pickedUp = new PickedUpItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
|
||||
float right = width;
|
||||
|
||||
final int quickSlots = numVisibleSlots == QuickSlot.VSIZE ? 0 : Dungeon.quickslot.quickslots;
|
||||
int slotIndex;
|
||||
for(int i = 0; i < numVisibleSlots; i++) {
|
||||
slotIndex = boundIndex(quickSlots + i);
|
||||
if (i == 0 && !SPDSettings.flipToolbar() ||
|
||||
i == numVisibleSlots -1 && SPDSettings.flipToolbar()){
|
||||
btnQuick[slotIndex].border(0, 2);
|
||||
btnQuick[slotIndex].frame(106, 0, 19, 24);
|
||||
} else if (i == 0 && SPDSettings.flipToolbar() ||
|
||||
i == numVisibleSlots -1 && !SPDSettings.flipToolbar()){
|
||||
btnQuick[slotIndex].border(2, 1);
|
||||
btnQuick[slotIndex].frame(86, 0, 20, 24);
|
||||
} else {
|
||||
btnQuick[slotIndex].border(0, 1);
|
||||
btnQuick[slotIndex].frame(88, 0, 18, 24);
|
||||
}
|
||||
}
|
||||
|
||||
boolean[] visible = new boolean[QuickSlot.VSIZE];
|
||||
slotIndex = boundIndex(quickSlots);
|
||||
visible[slotIndex] = true;
|
||||
|
||||
|
||||
if (SPDSettings.interfaceSize() == 0) {
|
||||
switch (Mode.valueOf(SPDSettings.toolbarMode())) {
|
||||
case SPLIT:
|
||||
btnWait.setPos(x, y);
|
||||
btnExamine.setPos(btnWait.right(), y);
|
||||
|
||||
btnInventory.setPos(right - btnInventory.width(), y);
|
||||
|
||||
btnQuick[slotIndex].setPos(btnInventory.left() - btnQuick[slotIndex].width(), y + 2);
|
||||
for (int i = 1; i < numVisibleSlots; i++) {
|
||||
slotIndex = boundIndex(quickSlots + i);
|
||||
visible[slotIndex] = true;
|
||||
btnQuick[slotIndex].setPos(btnQuick[boundIndex(quickSlots + i - 1)].left() - btnQuick[slotIndex].width(), y + 2);
|
||||
}
|
||||
if (numVisibleSlots < QuickSlot.VSIZE)
|
||||
btnSwitchSlot.setPos(btnQuick[slotIndex].left() - btnSwitchSlot.width(), y + 10);
|
||||
|
||||
break;
|
||||
|
||||
//center = group but.. well.. centered, so all we need to do is pre-emptively set the right side further in.
|
||||
case CENTER:
|
||||
float toolbarWidth = btnWait.width() + btnExamine.width() + btnInventory.width();
|
||||
for (int i = 0; i < numVisibleSlots; i++) {
|
||||
toolbarWidth += btnQuick[boundIndex(quickSlots + i)].width();
|
||||
}
|
||||
if (numVisibleSlots < QuickSlot.VSIZE) toolbarWidth += btnSwitchSlot.width();
|
||||
right = (width + toolbarWidth) / 2;
|
||||
|
||||
case GROUP:
|
||||
btnWait.setPos(right - btnWait.width(), y);
|
||||
btnExamine.setPos(btnWait.left() - btnExamine.width(), y);
|
||||
btnInventory.setPos(btnExamine.left() - btnInventory.width(), y);
|
||||
|
||||
btnQuick[slotIndex].setPos(btnInventory.left() - btnQuick[slotIndex].width(), y + 2);
|
||||
for (int i = 1; i < numVisibleSlots; i++) {
|
||||
slotIndex = boundIndex(quickSlots + i);
|
||||
visible[slotIndex] = true;
|
||||
btnQuick[slotIndex].setPos(btnQuick[boundIndex(quickSlots + i - 1)].left() - btnQuick[slotIndex].width(), y + 2);
|
||||
}
|
||||
if (numVisibleSlots < QuickSlot.VSIZE)
|
||||
btnSwitchSlot.setPos(btnQuick[slotIndex].left() - btnSwitchSlot.width(), y + 10);
|
||||
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
btnWait.setPos(x, y);
|
||||
btnExamine.setPos(btnWait.right(), y);
|
||||
|
||||
btnInventory.setPos(right - btnInventory.width(), y);
|
||||
|
||||
btnQuick[slotIndex].setPos(btnInventory.left() - btnQuick[slotIndex].width(), y + 2);
|
||||
for (int i = 1; i < numVisibleSlots; i++) {
|
||||
slotIndex = boundIndex(quickSlots + i);
|
||||
visible[slotIndex] = true;
|
||||
btnQuick[slotIndex].setPos(btnQuick[boundIndex(quickSlots + i - 1)].left() - btnQuick[slotIndex].width(), y + 2);
|
||||
}
|
||||
if (numVisibleSlots < QuickSlot.VSIZE)
|
||||
btnSwitchSlot.setPos(btnQuick[slotIndex].left() - btnSwitchSlot.width(), y + 10);
|
||||
}
|
||||
for (int i = 0; i < visible.length; i ++) {
|
||||
btnQuick[i].visible = visible[i];
|
||||
if (!visible[i]) btnQuick[i].setPos(Integer.MAX_VALUE, Integer.MAX_VALUE);
|
||||
}
|
||||
right = width;
|
||||
|
||||
if (SPDSettings.interfaceSize() > 0){
|
||||
btnInventory.setPos( right- btnInventory.width(), y);
|
||||
btnWait.setPos(right - btnInventory.width(), y/3);
|
||||
btnExamine.setPos(right - btnInventory.width(), btnWait.bottom());
|
||||
float toolbarWidth = btnWait.width() + btnExamine.width() + btnInventory.width();
|
||||
for (int i = 0; i < numVisibleSlots; i++) {
|
||||
toolbarWidth += btnQuick[boundIndex(quickSlots + i)].width();
|
||||
}
|
||||
if (numVisibleSlots < QuickSlot.VSIZE) toolbarWidth += btnSwitchSlot.width();
|
||||
right = (width + toolbarWidth)/2;
|
||||
}
|
||||
|
||||
if (SPDSettings.flipToolbar()) {
|
||||
|
||||
btnWait.setPos( (right - btnWait.right()), y);
|
||||
btnExamine.setPos( (right - btnExamine.right()), y);
|
||||
btnInventory.setPos( (right - btnInventory.right()), y);
|
||||
|
||||
for(int i = 0; i < numVisibleSlots; i++) {
|
||||
slotIndex = boundIndex(quickSlots + i);
|
||||
btnQuick[slotIndex].setPos( right - btnQuick[slotIndex].right(), y+2);
|
||||
}
|
||||
if (numVisibleSlots < QuickSlot.VSIZE) btnSwitchSlot.setPos(right - btnSwitchSlot.right(), y+10);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void updateLayout(){
|
||||
if (instance != null) instance.layout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (lastEnabled != (Dungeon.hero.ready && Dungeon.hero.isAlive())) {
|
||||
lastEnabled = (Dungeon.hero.ready && Dungeon.hero.isAlive());
|
||||
|
||||
for (Gizmo tool : members.toArray(new Gizmo[0])) {
|
||||
if (tool instanceof Tool) {
|
||||
((Tool)tool).enable( lastEnabled );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Dungeon.hero.isAlive()) {
|
||||
btnInventory.enable(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void pickup(Item item, int cell ) {
|
||||
pickedUp.reset( item,
|
||||
cell,
|
||||
btnInventory.centerX(),
|
||||
btnInventory.centerY());
|
||||
}
|
||||
|
||||
private int boundIndex(int index) {
|
||||
int result = index;
|
||||
while (result < 0) result += QuickSlot.VSIZE;
|
||||
while (result >= QuickSlot.VSIZE) result -= QuickSlot.VSIZE;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
private static CellSelector.Listener informer = new CellSelector.Listener() {
|
||||
@Override
|
||||
public void onSelect( Integer cell ) {
|
||||
instance.examining = false;
|
||||
GameScene.examineCell( cell );
|
||||
}
|
||||
@Override
|
||||
public String prompt() {
|
||||
return Messages.get(Toolbar.class, "examine_prompt");
|
||||
}
|
||||
};
|
||||
|
||||
private static class SwitchQuickSlotTool extends Tool {
|
||||
|
||||
Tool bg;
|
||||
ColorBlock[] fill;
|
||||
|
||||
public SwitchQuickSlotTool(int x, int y, int width, int height) {
|
||||
super(x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
//
|
||||
}
|
||||
private Toolbar.Tool slot;
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
|
||||
super.createChildren();
|
||||
|
||||
bg = new Tool(72, 26, 16, 16){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
Dungeon.quickslot.quickslots = instance.boundIndex(Dungeon.quickslot.quickslots + instance.numVisibleSlots);
|
||||
instance.layout();
|
||||
}
|
||||
@Override
|
||||
protected String hoverText() {
|
||||
return Messages.titleCase(Messages.get(WndKeyBindings.class, "quickslot_switch"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onLongClick() {
|
||||
GameScene.show(new WndQuickBag(null));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPointerDown() {
|
||||
Sample.INSTANCE.play( Assets.Sounds.CLICK, 0.7f, 0.7f, 1.2f );
|
||||
super.onPointerDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameAction keyAction() {
|
||||
return SPDAction.SLPD;
|
||||
}
|
||||
|
||||
};
|
||||
fill = new ColorBlock[9];
|
||||
for (int i = 0; i < fill.length; i ++) {
|
||||
fill[i] = new ColorBlock(4, 4, SPDSettings.ClassUI() ? 0xFF00ffff : 0xffffff00);
|
||||
add(fill[i]);
|
||||
}
|
||||
add(bg);
|
||||
}
|
||||
|
||||
protected void setFill(int quickslots) {
|
||||
boolean[] visible = new boolean[9];
|
||||
for (int i = 0; i < instance.numVisibleSlots; i ++) {
|
||||
visible[instance.boundIndex(i + quickslots)] = true;
|
||||
}
|
||||
fill[0].x = fill[3].x = fill[6].x = x + 2;
|
||||
fill[1].x = fill[4].x = fill[7].x = x + 6;
|
||||
fill[2].x = fill[5].x = fill[8].x = x + 10;
|
||||
fill[0].y = fill[1].y = fill[2].y = y + 2;
|
||||
fill[3].y = fill[4].y = fill[5].y = y + 6;
|
||||
fill[6].y = fill[7].y = fill[8].y = y + 10;
|
||||
for (int i = 0; i < visible.length; i ++) {
|
||||
PixelScene.align(fill[i]);
|
||||
fill[i].visible = visible[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout(){
|
||||
super.layout();
|
||||
bg.x = x;
|
||||
bg.y = y;
|
||||
PixelScene.align(bg);
|
||||
setFill(Dungeon.quickslot.quickslots);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static class Tool extends Button {
|
||||
|
||||
private static final int BGCOLOR = 0x7B8073;
|
||||
|
||||
private Image base;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
if (SPDSettings.ClassUI()) {
|
||||
base.texture = TextureCache.get(Assets.Interfaces.TOOLBAR);
|
||||
} else {
|
||||
base.texture = TextureCache.get(Assets.Interfaces.TOOLBARDRAK);
|
||||
}
|
||||
}
|
||||
|
||||
public Tool( int x, int y, int width, int height ) {
|
||||
super();
|
||||
|
||||
hotArea.blockLevel = PointerArea.ALWAYS_BLOCK;
|
||||
frame(x, y, width, height);
|
||||
}
|
||||
|
||||
public void frame( int x, int y, int width, int height) {
|
||||
base.frame( x, y, width, height );
|
||||
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
super.createChildren();
|
||||
|
||||
base = new Image( Assets.Interfaces.TOOLBAR );
|
||||
add( base );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
|
||||
base.x = x;
|
||||
base.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPointerDown() {
|
||||
base.brightness( 1.4f );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPointerUp() {
|
||||
if (active) {
|
||||
base.resetColor();
|
||||
} else {
|
||||
base.tint( BGCOLOR, 0.7f );
|
||||
}
|
||||
}
|
||||
|
||||
public void enable( boolean value ) {
|
||||
if (value != active) {
|
||||
if (value) {
|
||||
base.resetColor();
|
||||
} else {
|
||||
base.tint( BGCOLOR, 0.7f );
|
||||
}
|
||||
active = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
private static class QuickslotTool extends Tool {
|
||||
|
||||
private QuickSlotButton slot;
|
||||
private int borderLeft = 2;
|
||||
private int borderRight = 2;
|
||||
|
||||
public QuickslotTool( int x, int y, int width, int height, int slotNum ) {
|
||||
super( x, y, width, height );
|
||||
|
||||
slot = new QuickSlotButton( slotNum );
|
||||
add( slot );
|
||||
}
|
||||
|
||||
public void border( int left, int right ){
|
||||
borderLeft = left;
|
||||
borderRight = right;
|
||||
layout();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
slot.setRect( x, y, width, height );
|
||||
slot.slotMargins(borderLeft, 4, borderRight, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enable( boolean value ) {
|
||||
super.enable( value );
|
||||
slot.enable( value );
|
||||
}
|
||||
}
|
||||
|
||||
public static class PickedUpItem extends ItemSprite {
|
||||
|
||||
private static final float DURATION = 0.5f;
|
||||
|
||||
private float startScale;
|
||||
private float startX, startY;
|
||||
private float endX, endY;
|
||||
private float left;
|
||||
|
||||
public PickedUpItem() {
|
||||
super();
|
||||
|
||||
originToCenter();
|
||||
|
||||
active =
|
||||
visible =
|
||||
false;
|
||||
}
|
||||
|
||||
public void reset( Item item, int cell, float endX, float endY ) {
|
||||
view( item );
|
||||
|
||||
active =
|
||||
visible =
|
||||
true;
|
||||
|
||||
PointF tile = DungeonTerrainTilemap.raisedTileCenterToWorld(cell);
|
||||
Point screen = Camera.main.cameraToScreen(tile.x, tile.y);
|
||||
PointF start = camera().screenToCamera(screen.x, screen.y);
|
||||
|
||||
x = this.startX = start.x - width() / 2;
|
||||
y = this.startY = start.y - width() / 2;
|
||||
|
||||
this.endX = endX - width() / 2;
|
||||
this.endY = endY - width() / 2;
|
||||
left = DURATION;
|
||||
|
||||
scale.set( startScale = Camera.main.zoom / camera().zoom );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if ((left -= Game.elapsed) <= 0) {
|
||||
|
||||
visible =
|
||||
active =
|
||||
false;
|
||||
if (emitter != null) emitter.on = false;
|
||||
|
||||
} else {
|
||||
float p = left / DURATION;
|
||||
scale.set( startScale * (float)Math.sqrt( p ) );
|
||||
|
||||
x = startX*p + endX*(1-p);
|
||||
y = startY*p + endY*(1-p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -232,7 +232,7 @@ public class Toolbar extends Component {
|
|||
*/
|
||||
float wMin = Game.width / PixelScene.MIN_WIDTH_FULL;
|
||||
float hMin = Game.height / PixelScene.MIN_HEIGHT_FULL;
|
||||
final int maxHorizontalQuickslots = PixelScene.landscape() ? 8 : 4;
|
||||
final int maxHorizontalQuickslots = PixelScene.landscape() ? 9 : 3;
|
||||
float right = width;
|
||||
if (SPDSettings.interfaceSize() > 0){
|
||||
btnInventory.setPos(right - btnInventory.width(), y);
|
||||
|
@ -479,7 +479,8 @@ public class Toolbar extends Component {
|
|||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
slot.setRect( x + borderLeft, y + 2, width - borderLeft-borderRight, height - 4 );
|
||||
slot.setRect( x, y, width, height );
|
||||
slot.slotMargins(borderLeft, 4, borderRight, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -119,7 +119,7 @@ public class vM0_6_7_X_Changes {
|
|||
}
|
||||
|
||||
public static void add_v0_6_56_Changes( ArrayList<ChangeInfo> changeInfos ) {
|
||||
ChangeInfo changes = new ChangeInfo("Coming Soon V0.6.5.0", true, "");
|
||||
ChangeInfo changes = new ChangeInfo("Coming Soon V0.6.5.0-Alpha3", true, "");
|
||||
changes.hardlight(Window.CBLACK);
|
||||
changeInfos.add(changes);
|
||||
|
||||
|
@ -140,10 +140,44 @@ public class vM0_6_7_X_Changes {
|
|||
i.scale.set(PixelScene.align(0.74f));
|
||||
changes.addButton(new ChangeButton(i, ("熔岩火龙"),
|
||||
("丛林暴乱的真相")));
|
||||
|
||||
changes = new ChangeInfo("v0.6.5.0-Alpha1-2", true, "");
|
||||
changes.hardlight(Window.TITLE_COLOR);
|
||||
changeInfos.add(changes);
|
||||
|
||||
changes = new ChangeInfo("新内容", false, null);
|
||||
changes.hardlight(Window.GREEN_COLOR);
|
||||
changeInfos.add(changes);
|
||||
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.DIEDCROSSBOW), ("传奇武器"),
|
||||
("新类别传奇武器测试已经开始。在后续版本中需要通过货币解锁。")));
|
||||
|
||||
changes.addButton(new ChangeButton(Icons.get(Icons.BADGES), ("加密徽章"),
|
||||
("添加了加密徽章,长按徽章按钮进入。记录一些隐藏成就。\n\n_注意:_这些成就不会在获取之前不会显示出来")));
|
||||
|
||||
changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), ("杂项改动"),
|
||||
("1.添加了暂停更新界面的功能\n\n" +
|
||||
"2.少量bug修复")));
|
||||
|
||||
changes = new ChangeInfo("改动", false, null);
|
||||
changes.hardlight(Window.CYELLOW);
|
||||
changeInfos.add(changes);
|
||||
|
||||
Image a = new SakaFishBossSprites();
|
||||
a.scale.set(PixelScene.align(0.72f));
|
||||
changes.addButton(new ChangeButton(a, "萨卡班甲鱼",
|
||||
"数值方面进行了一定平衡。"));
|
||||
|
||||
changes.addButton(new ChangeButton(new Image("sprites/spinner.png", 144, 0, 16, 16),
|
||||
Messages.get(ChangesScene.class, "bugfixes"), Messages.get(vM0_6_7_X_Changes.class, "bug_06X83")));
|
||||
|
||||
changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), ("杂项调整"),
|
||||
("1.书籍现在不可堆积,且成就有一些变化\n\n" +
|
||||
"2.其它bug修复")));
|
||||
}
|
||||
|
||||
public static void add_v0_6_55_Changes( ArrayList<ChangeInfo> changeInfos ) {
|
||||
ChangeInfo changes = new ChangeInfo("v0.6.4.0-Beta2-9", true, "");
|
||||
ChangeInfo changes = new ChangeInfo("v0.6.4.0-BetaI-XIII", true, "");
|
||||
changes.hardlight(Window.TITLE_COLOR);
|
||||
changeInfos.add(changes);
|
||||
|
||||
|
@ -162,6 +196,9 @@ public class vM0_6_7_X_Changes {
|
|||
"现实仍然有很多东西,我是时候调节一下了。\n"+
|
||||
"那么还是祝各位游戏中冒险愉快吧!")));
|
||||
|
||||
changes.addButton(new ChangeButton(Icons.get(Icons.PREFS), ("快捷栏V1/V2"),
|
||||
("快捷栏降至9个,并且V1是魔绫原版快捷栏,V2是碳素那边借鉴优化的快捷栏。任君挑选。")));
|
||||
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.ALCH_PAGE), ("炼金界面优化"),
|
||||
("炼金指南进行优化。")));
|
||||
|
||||
|
@ -195,6 +232,9 @@ public class vM0_6_7_X_Changes {
|
|||
changes.hardlight(Window.CYELLOW);
|
||||
changeInfos.add(changes);
|
||||
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.SAI), ("吸血鬼刀-Beta13"),
|
||||
("修复了一些吸血权重问题。")));
|
||||
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.WRALIPS), ("暗金宝石护符"),
|
||||
("现在最高上限+10,并调整优化了一些问题")));
|
||||
|
||||
|
@ -216,7 +256,7 @@ public class vM0_6_7_X_Changes {
|
|||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.GREATSHIELD), ("5阶武器"),
|
||||
("现在5阶武器生成平均化")));
|
||||
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.SAI), ("吸血鬼刀"),
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.SAI), ("吸血鬼刀-Beta12"),
|
||||
("优化数值,调整吸血权重。")));
|
||||
|
||||
changes.addButton(new ChangeButton(new ItemSprite(ItemSpriteSheet.DG3), ("归溯钥剑"),
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.PaswordBadges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.PasswordBadgeBanner;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.Image;
|
||||
|
||||
public class WndProBadge extends Window {
|
||||
|
||||
private static final int WIDTH = 120;
|
||||
private static final int MARGIN = 4;
|
||||
|
||||
public WndProBadge(PaswordBadges.Badge badge) {
|
||||
|
||||
super();
|
||||
|
||||
Image icon = PasswordBadgeBanner.image( badge.image );
|
||||
icon.scale.set( 2 );
|
||||
|
||||
add( icon );
|
||||
|
||||
RenderedTextBlock title = PixelScene.renderTextBlock( badge.title(), 9 );
|
||||
title.maxWidth(WIDTH - MARGIN * 2);
|
||||
title.align(RenderedTextBlock.CENTER_ALIGN);
|
||||
title.hardlight(TITLE_COLOR);
|
||||
|
||||
add(title);
|
||||
|
||||
String desc = badge.desc();
|
||||
|
||||
RenderedTextBlock info = PixelScene.renderTextBlock( desc, 6 );
|
||||
info.maxWidth(WIDTH - MARGIN * 2);
|
||||
info.align(RenderedTextBlock.CENTER_ALIGN);
|
||||
add(info);
|
||||
|
||||
float w = Math.max( icon.width(), Math.max(title.width(), info.width()) ) + MARGIN * 2;
|
||||
|
||||
icon.x = (w - icon.width()) / 2f;
|
||||
icon.y = MARGIN;
|
||||
PixelScene.align(icon);
|
||||
|
||||
title.setPos((w - title.width()) / 2, icon.y + icon.height() + MARGIN);
|
||||
PixelScene.align(title);
|
||||
|
||||
info.setPos((w - info.width()) / 2, title.bottom() + MARGIN);
|
||||
PixelScene.align(info);
|
||||
resize( (int)w, (int)(info.bottom() + MARGIN) );
|
||||
|
||||
PasswordBadgeBanner.highlight( icon, badge.image );
|
||||
}
|
||||
}
|
|
@ -22,9 +22,9 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
|
@ -113,6 +113,9 @@ public class WndSadGhost extends Window {
|
|||
reward.identify(false);
|
||||
if (reward.doPickUp( Dungeon.hero )) {
|
||||
GLog.i( Messages.get(Dungeon.hero, "you_now_have", reward.name()) );
|
||||
if(reward.level() == 4 || reward.level() == 3){
|
||||
Badges.GhostDageCollected();
|
||||
}
|
||||
} else {
|
||||
Dungeon.level.drop( reward, ghost.pos ).sprite.drop();
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.ui.OptionSlider;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ToobarV;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Toolbar;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.ColorBlock;
|
||||
|
@ -406,14 +407,12 @@ public class WndSettings extends WndTabbed {
|
|||
RenderedTextBlock title;
|
||||
|
||||
ColorBlock sep1;
|
||||
OptionSlider optUISize;
|
||||
RenderedTextBlock barDesc;
|
||||
RedButton btnSplit;
|
||||
CheckBox chkFlipToolbar;
|
||||
OptionSlider optUIMode;
|
||||
OptionSlider optUIScale;
|
||||
RedButton btnToolbarSettings;
|
||||
CheckBox chkFlipTags;
|
||||
ColorBlock sep2;
|
||||
ColorBlock sep3;
|
||||
RedButton btnKeyBindings;
|
||||
CheckBox chkFont;
|
||||
|
||||
@Override
|
||||
protected void createChildren() {
|
||||
|
@ -427,10 +426,9 @@ public class WndSettings extends WndTabbed {
|
|||
//add slider for UI size only if device has enough space to support it
|
||||
float wMin = Game.width / PixelScene.MIN_WIDTH_FULL;
|
||||
float hMin = Game.height / PixelScene.MIN_HEIGHT_FULL;
|
||||
Boolean landscape = SPDSettings.landscape();
|
||||
if (Math.min(wMin, hMin) >= 2*Game.density){
|
||||
optUISize = new OptionSlider(
|
||||
Messages.get(this, "size"),
|
||||
if (Math.min(wMin, hMin) >= 2*Game.density && !SPDSettings.quickSwapper()){
|
||||
optUIMode = new OptionSlider(
|
||||
Messages.get(this, "ui_mode"),
|
||||
Messages.get(this, "mobile"),
|
||||
Messages.get(this, "full"),
|
||||
0,
|
||||
|
@ -442,141 +440,245 @@ public class WndSettings extends WndTabbed {
|
|||
ShatteredPixelDungeon.seamlessResetScene();
|
||||
}
|
||||
};
|
||||
optUISize.setSelectedValue(SPDSettings.interfaceSize());
|
||||
add(optUISize);
|
||||
optUIMode.setSelectedValue(SPDSettings.interfaceSize());
|
||||
add(optUIMode);
|
||||
}
|
||||
|
||||
if ((int)Math.ceil(2* Game.density) < PixelScene.maxDefaultZoom) {
|
||||
optUIScale = new OptionSlider(Messages.get(this, "scale"),
|
||||
(int)Math.ceil(2* Game.density)+ "X",
|
||||
PixelScene.maxDefaultZoom + "X",
|
||||
(int)Math.ceil(2* Game.density),
|
||||
PixelScene.maxDefaultZoom ) {
|
||||
@Override
|
||||
protected void onChange() {
|
||||
if (getSelectedValue() != SPDSettings.scale()) {
|
||||
SPDSettings.scale(getSelectedValue());
|
||||
ShatteredPixelDungeon.seamlessResetScene();
|
||||
}
|
||||
}
|
||||
};
|
||||
optUIScale.setSelectedValue(PixelScene.defaultZoom);
|
||||
add(optUIScale);
|
||||
}
|
||||
|
||||
if (SPDSettings.interfaceSize() == 0) {
|
||||
barDesc = PixelScene.renderTextBlock(Messages.get(this, "mode"), 9);
|
||||
add(barDesc);
|
||||
|
||||
btnSplit = new RedButton(Messages.get(this, "split")) {
|
||||
btnToolbarSettings = new RedButton(Messages.get(this, "toolbar_settings"), 9){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
SPDSettings.toolbarMode(Toolbar.Mode.SPLIT.name());
|
||||
Toolbar.updateLayout();
|
||||
ShatteredPixelDungeon.scene().addToFront(new Window(){
|
||||
|
||||
RenderedTextBlock barDesc;
|
||||
RedButton btnSplit; RedButton btnGrouped; RedButton btnCentered;
|
||||
CheckBox chkQuickSwapper;
|
||||
RenderedTextBlock swapperDesc;
|
||||
CheckBox chkFlipToolbar;
|
||||
CheckBox chkFlipTags;
|
||||
|
||||
{
|
||||
barDesc = PixelScene.renderTextBlock(Messages.get(WndSettings.UITab.this, "mode"), 9);
|
||||
add(barDesc);
|
||||
|
||||
btnSplit = new RedButton(Messages.get(WndSettings.UITab.this, "split")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
textColor(TITLE_COLOR);
|
||||
btnGrouped.textColor(WHITE);
|
||||
btnCentered.textColor(WHITE);
|
||||
SPDSettings.toolbarMode(ToobarV.Mode.SPLIT.name());
|
||||
ToobarV.updateLayout();
|
||||
}
|
||||
};
|
||||
if (SPDSettings.toolbarMode().equals(ToobarV.Mode.SPLIT.name())) {
|
||||
btnSplit.textColor(TITLE_COLOR);
|
||||
}
|
||||
add(btnSplit);
|
||||
|
||||
btnGrouped = new RedButton(Messages.get(WndSettings.UITab.this, "group")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
btnSplit.textColor(WHITE);
|
||||
textColor(TITLE_COLOR);
|
||||
btnCentered.textColor(WHITE);
|
||||
SPDSettings.toolbarMode(ToobarV.Mode.GROUP.name());
|
||||
ToobarV.updateLayout();
|
||||
}
|
||||
};
|
||||
if (SPDSettings.toolbarMode().equals(ToobarV.Mode.GROUP.name())) {
|
||||
btnGrouped.textColor(TITLE_COLOR);
|
||||
}
|
||||
add(btnGrouped);
|
||||
|
||||
btnCentered = new RedButton(Messages.get(WndSettings.UITab.this, "center")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
btnSplit.textColor(WHITE);
|
||||
btnGrouped.textColor(WHITE);
|
||||
textColor(TITLE_COLOR);
|
||||
SPDSettings.toolbarMode(ToobarV.Mode.CENTER.name());
|
||||
ToobarV.updateLayout();
|
||||
}
|
||||
};
|
||||
if (SPDSettings.toolbarMode().equals(ToobarV.Mode.CENTER.name())) {
|
||||
btnCentered.textColor(TITLE_COLOR);
|
||||
}
|
||||
add(btnCentered);
|
||||
|
||||
if(SPDSettings.quickSwapper()){
|
||||
btnSplit.alpha(0.5f);
|
||||
btnGrouped.alpha(0.5f);
|
||||
btnCentered.alpha(0.5f);
|
||||
btnCentered.active = false;
|
||||
btnGrouped.active = false;
|
||||
btnSplit.active = false;
|
||||
}
|
||||
|
||||
chkQuickSwapper = new CheckBox(Messages.get(WndSettings.UITab.this, "quickslot_swapper")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
SPDSettings.quickSwapper(checked());
|
||||
ShatteredPixelDungeon.resetScene();
|
||||
}
|
||||
};
|
||||
chkQuickSwapper.checked(SPDSettings.quickSwapper());
|
||||
add(chkQuickSwapper);
|
||||
|
||||
swapperDesc = PixelScene.renderTextBlock(Messages.get(WndSettings.UITab.this, "swapper_desc"), 5);
|
||||
swapperDesc.hardlight(0x888888);
|
||||
add(swapperDesc);
|
||||
|
||||
chkFlipToolbar = new CheckBox(Messages.get(WndSettings.UITab.this, "flip_toolbar")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
SPDSettings.flipToolbar(checked());
|
||||
//ToobarV.updateLayout();
|
||||
}
|
||||
};
|
||||
chkFlipToolbar.checked(SPDSettings.flipToolbar());
|
||||
add(chkFlipToolbar);
|
||||
|
||||
chkFlipTags = new CheckBox(Messages.get(WndSettings.UITab.this, "flip_indicators")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
SPDSettings.flipTags(checked());
|
||||
GameScene.layoutTags();
|
||||
}
|
||||
};
|
||||
chkFlipTags.checked(SPDSettings.flipTags());
|
||||
add(chkFlipTags);
|
||||
|
||||
//layout
|
||||
resize(WIDTH_P, 0);
|
||||
|
||||
barDesc.setPos((width - barDesc.width()) / 2f, GAP);
|
||||
PixelScene.align(barDesc);
|
||||
|
||||
int btnWidth = (int) (width - 2 * GAP) / 3;
|
||||
|
||||
btnSplit.setRect(0, barDesc.bottom() + GAP, btnWidth, BTN_HEIGHT-2);
|
||||
btnGrouped.setRect(btnSplit.right() + GAP, btnSplit.top(), btnWidth, BTN_HEIGHT-2);
|
||||
btnCentered.setRect(btnGrouped.right() + GAP, btnSplit.top(), btnWidth, BTN_HEIGHT-2);
|
||||
chkQuickSwapper.setRect(0, btnGrouped.bottom() + GAP, width, BTN_HEIGHT);
|
||||
|
||||
|
||||
swapperDesc.maxWidth(width);
|
||||
swapperDesc.setPos(0, chkQuickSwapper.bottom()+1);
|
||||
|
||||
if (width > 200) {
|
||||
chkFlipToolbar.setRect(0, swapperDesc.bottom() + GAP, width / 2 - 1, BTN_HEIGHT);
|
||||
chkFlipTags.setRect(chkFlipToolbar.right() + GAP, chkFlipToolbar.top(), width / 2 - 1, BTN_HEIGHT);
|
||||
} else {
|
||||
chkFlipToolbar.setRect(0, swapperDesc.bottom() + GAP, width, BTN_HEIGHT);
|
||||
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP, width, BTN_HEIGHT);
|
||||
}
|
||||
|
||||
resize(WIDTH_P, (int)chkFlipTags.bottom());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
if (SPDSettings.toolbarMode().equals(Toolbar.Mode.SPLIT.name()))
|
||||
btnSplit.textColor(TITLE_COLOR);
|
||||
add(btnSplit);
|
||||
add(btnToolbarSettings);
|
||||
|
||||
chkFlipToolbar = new CheckBox(Messages.get(this, "flip_toolbar")) {
|
||||
} else {
|
||||
|
||||
chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
SPDSettings.flipToolbar(checked());
|
||||
Toolbar.updateLayout();
|
||||
SPDSettings.flipTags(checked());
|
||||
GameScene.layoutTags();
|
||||
}
|
||||
};
|
||||
chkFlipToolbar.checked(SPDSettings.flipToolbar());
|
||||
add(chkFlipToolbar);
|
||||
}
|
||||
chkFlipTags.checked(SPDSettings.flipTags());
|
||||
add(chkFlipTags);
|
||||
|
||||
chkFlipTags = new CheckBox(Messages.get(this, "flip_indicators")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
SPDSettings.flipTags(checked());
|
||||
GameScene.layoutTags();
|
||||
}
|
||||
};
|
||||
chkFlipTags.checked(SPDSettings.flipTags());
|
||||
add(chkFlipTags);
|
||||
}
|
||||
|
||||
sep2 = new ColorBlock(1, 1, 0xFF000000);
|
||||
add(sep2);
|
||||
|
||||
// chkFont = new CheckBox(Messages.get(this, "system_font")){
|
||||
// @Override
|
||||
// protected void onClick() {
|
||||
// super.onClick();
|
||||
// ShatteredPixelDungeon.seamlessResetScene(new Game.SceneChangeCallback() {
|
||||
// @Override
|
||||
// public void beforeCreate() {
|
||||
// SPDSettings.systemFont();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void afterCreate() {
|
||||
// //do nothing
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
// chkFont.checked(SPDSettings.systemFont());
|
||||
// add(chkFont);
|
||||
chkFont = new CheckBox(Messages.get(this, "system_font")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
ShatteredPixelDungeon.seamlessResetScene(new Game.SceneChangeCallback() {
|
||||
@Override
|
||||
public void beforeCreate() {
|
||||
SPDSettings.systemFont(checked());
|
||||
}
|
||||
|
||||
if (DeviceCompat.hasHardKeyboard()){
|
||||
|
||||
sep3 = new ColorBlock(1, 1, 0xFF000000);
|
||||
add(sep3);
|
||||
|
||||
btnKeyBindings = new RedButton(Messages.get(this, "key_bindings")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
ShatteredPixelDungeon.scene().addToFront(new WndKeyBindings());
|
||||
}
|
||||
};
|
||||
|
||||
add(btnKeyBindings);
|
||||
}
|
||||
@Override
|
||||
public void afterCreate() {
|
||||
//do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
chkFont.checked(SPDSettings.systemFont());
|
||||
add(chkFont);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
title.setPos((width - title.width())/2, y + GAP);
|
||||
sep1.size(width, 1);
|
||||
sep1.y = title.bottom() + 2*GAP;
|
||||
sep1.y = title.bottom() + 3*GAP;
|
||||
|
||||
height = sep1.y + 1;
|
||||
|
||||
if (optUISize != null){
|
||||
optUISize.setRect(0, height + GAP, width, SLIDER_HEIGHT);
|
||||
height = optUISize.bottom();
|
||||
if (optUIMode != null && optUIScale != null && width > 200){
|
||||
optUIMode.setRect(0, height + GAP, width/2-1, SLIDER_HEIGHT);
|
||||
optUIScale.setRect(width/2+1, height + GAP, width/2-1, SLIDER_HEIGHT);
|
||||
height = optUIScale.bottom();
|
||||
} else {
|
||||
if (optUIMode != null) {
|
||||
optUIMode.setRect(0, height + GAP, width, SLIDER_HEIGHT);
|
||||
height = optUIMode.bottom();
|
||||
}
|
||||
|
||||
if (optUIScale != null) {
|
||||
optUIScale.setRect(0, height + GAP, width, SLIDER_HEIGHT);
|
||||
height = optUIScale.bottom();
|
||||
}
|
||||
}
|
||||
|
||||
if (barDesc != null) {
|
||||
barDesc.setPos((width - barDesc.width()) / 2f, height + GAP);
|
||||
PixelScene.align(barDesc);
|
||||
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
|
||||
btnSplit.setRect(0, barDesc.bottom() + GAP, width, 16);
|
||||
} else {
|
||||
btnSplit.setRect(500, barDesc.bottom() + GAP, width, 16);
|
||||
}
|
||||
|
||||
if (width > 200) {
|
||||
chkFlipToolbar.setRect(0, btnSplit.bottom() + GAP, width / 2 - 1, BTN_HEIGHT);
|
||||
chkFlipTags.setRect(chkFlipToolbar.right() + GAP, chkFlipToolbar.top(), width / 2 - 1, BTN_HEIGHT);
|
||||
} else {
|
||||
chkFlipToolbar.setRect(0, btnSplit.bottom() + GAP, width, BTN_HEIGHT);
|
||||
chkFlipTags.setRect(0, chkFlipToolbar.bottom() + GAP, width, BTN_HEIGHT);
|
||||
}
|
||||
if (btnToolbarSettings != null) {
|
||||
btnToolbarSettings.setRect(0, height + GAP, width, BTN_HEIGHT);
|
||||
height = btnToolbarSettings.bottom();
|
||||
} else {
|
||||
chkFlipTags.setRect(0, height + GAP, width, BTN_HEIGHT);
|
||||
height = chkFlipTags.bottom();
|
||||
}
|
||||
|
||||
sep2.size(width, 1);
|
||||
sep2.y = chkFlipTags.bottom() + 2;
|
||||
sep2.y = height + GAP;
|
||||
|
||||
if (btnKeyBindings != null){
|
||||
if (width > 200){
|
||||
chkFlipTags.setSize(width/2-1, BTN_HEIGHT);
|
||||
sep3.size(1, BTN_HEIGHT + 2*GAP);
|
||||
sep3.x = chkFlipTags.right() + 0.5f;
|
||||
sep3.y = sep2.y+1;
|
||||
PixelScene.align(sep3);
|
||||
btnKeyBindings.setRect(chkFlipTags.right()+2, chkFlipTags.top(), width/2 - 1, BTN_HEIGHT);
|
||||
} else {
|
||||
sep3.size(width, 1);
|
||||
sep3.y = chkFlipTags.bottom() + 2;
|
||||
btnKeyBindings.setRect(0, sep3.y + 1 + GAP, width, BTN_HEIGHT);
|
||||
}
|
||||
height = btnKeyBindings.bottom();
|
||||
} else {
|
||||
height = chkFlipTags.bottom();
|
||||
}
|
||||
chkFont.setRect(0, sep2.y + 1 + GAP, width, BTN_HEIGHT);
|
||||
height = chkFont.bottom();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -640,7 +742,12 @@ public class WndSettings extends WndTabbed {
|
|||
@Override
|
||||
protected void onChange() {
|
||||
SPDSettings.quickslots(getSelectedValue());
|
||||
Toolbar.updateLayout();
|
||||
if(SPDSettings.quickSwapper()){
|
||||
Toolbar.updateLayout();
|
||||
} else {
|
||||
ToobarV.updateLayout();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
quickslots.setSelectedValue(SPDSettings.quickslots());
|
||||
|
@ -662,11 +769,16 @@ public class WndSettings extends WndTabbed {
|
|||
|
||||
bottom = sep1.y + 1;
|
||||
|
||||
if(!SPDSettings.quickSwapper()){
|
||||
quickslots.active = false;
|
||||
quickslots.visible = false;
|
||||
}
|
||||
|
||||
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, SLIDER_HEIGHT);
|
||||
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
|
||||
if ((Game.scene() == null || Game.scene().getClass() != GameScene.class) && SPDSettings.quickSwapper()) {
|
||||
quickslots.setRect(optFPSLimit.right(), optFPSLimit.top(), width/2, SLIDER_HEIGHT);
|
||||
wxts.visible = false;
|
||||
} else {
|
||||
|
@ -677,7 +789,7 @@ public class WndSettings extends WndTabbed {
|
|||
ClassUI.setRect(0, bottom + GAP, width, SLIDER_HEIGHT);
|
||||
optSplashScreen.setRect(0, ClassUI.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
optFPSLimit.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
if (Game.scene() == null || Game.scene().getClass() != GameScene.class) {
|
||||
if ((Game.scene() == null || Game.scene().getClass() != GameScene.class) && SPDSettings.quickSwapper()) {
|
||||
quickslots.visible = false;
|
||||
} else {
|
||||
quickslots.setRect(0, optFPSLimit.bottom() + GAP, width, SLIDER_HEIGHT);
|
||||
|
@ -798,27 +910,11 @@ public class WndSettings extends WndTabbed {
|
|||
add(chkWifi);
|
||||
}
|
||||
|
||||
chkFireBase = new CheckBox("firebase") {
|
||||
chkFireBase = new CheckBox(Messages.get(this, "autoupdate")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
if (checked()) {
|
||||
checked(!checked());
|
||||
ShatteredPixelDungeon.scene().add(new WndOptions(Icons.get(Icons.DATA),
|
||||
"firebase_active",
|
||||
"firebase_desc",
|
||||
"cancel") {
|
||||
@Override
|
||||
protected void onSelect(int index) {
|
||||
if (index == 0) {
|
||||
checked(!checked());
|
||||
SPDSettings.firebase(checked());
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
SPDSettings.firebase(checked());
|
||||
}
|
||||
SPDSettings.firebase(checked());
|
||||
}
|
||||
};
|
||||
chkFireBase.checked( SPDSettings.firebase() );
|
||||
|
@ -837,14 +933,10 @@ public class WndSettings extends WndTabbed {
|
|||
chkNews.setRect(0, sep1.y + 1 + GAP, width/2-1, BTN_HEIGHT);
|
||||
//chkUpdates.setRect(chkNews.right() + GAP, chkNews.top(), width/2-1, BTN_HEIGHT);
|
||||
chkFireBase.setRect(chkNews.right() + GAP, chkNews.top(), width/2-1, BTN_HEIGHT);
|
||||
chkFireBase.visible = false;
|
||||
chkFireBase.active = false;
|
||||
pos = chkFireBase.bottom();
|
||||
} else {
|
||||
chkNews.setRect(0, sep1.y + 1 + GAP, width, BTN_HEIGHT);
|
||||
chkFireBase.setRect(0, chkNews.bottom() + GAP, width, BTN_HEIGHT);
|
||||
chkFireBase.visible = false;
|
||||
chkFireBase.active = false;
|
||||
pos = chkNews.bottom();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,4 +10,5 @@
|
|||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
android.enableJetifier=true
|
||||
android.suppressUnsupportedCompileSdk=33
|
|
@ -8,8 +8,4 @@ public class GameNesImpl{
|
|||
return newsChecker;
|
||||
}
|
||||
|
||||
public static boolean supportsNews(){
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|