update 0.6 Beta21

This commit is contained in:
LingASDJ 2022-08-11 14:17:24 +08:00
parent cddd192c8d
commit da3ed13aeb
44 changed files with 953 additions and 158 deletions

4
.gitignore vendored
View File

@ -18,3 +18,7 @@ local.properties
#intellij project files
*.iml
*.idea
core/src/main/assets/messages/actors/actors - 副本.txt
core/src/main/assets/messages/items/items - 副本.txt
replay_pid14552.log
hs_err_pid14552.log

View File

@ -1,4 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion appAndroidCompileSDK
@ -57,9 +59,31 @@ android {
configurations { natives }
dependencies {
implementation 'com.github.RohitSurwase.UCE-Handler:uce_handler:1.4'
implementation project(':core')
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:30.3.1')
// Declare the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
// Add the dependency for the Firebase SDK for Google Analytics
// When using the BoM, don't specify versions in Firebase dependencies
implementation 'com.google.firebase:firebase-analytics'
// Add the dependencies for any other desired Firebase products
// https://firebase.google.com/docs/android/setup#available-libraries
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"

View File

@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "352691001887",
"project_id": "magic-ling-pixel-dungeon",
"storage_bucket": "magic-ling-pixel-dungeon.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:352691001887:android:c9e419b794f309eae8d32a",
"android_client_info": {
"package_name": "com.ansdomagiclingpixeldungeon.ling.indev"
}
},
"oauth_client": [
{
"client_id": "352691001887-krfrqeg524uuat6ie4hsgs5vjvsp3hru.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA9mI7GUoXZg0MWTF4Pc0HuJiWcw5dkMI4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "352691001887-krfrqeg524uuat6ie4hsgs5vjvsp3hru.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "352691001887",
"project_id": "magic-ling-pixel-dungeon",
"storage_bucket": "magic-ling-pixel-dungeon.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:352691001887:android:c9e419b794f309eae8d32a",
"android_client_info": {
"package_name": "com.ansdomagiclingpixeldungeon.ling.indev"
}
},
"oauth_client": [
{
"client_id": "352691001887-krfrqeg524uuat6ie4hsgs5vjvsp3hru.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA9mI7GUoXZg0MWTF4Pc0HuJiWcw5dkMI4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "352691001887-krfrqeg524uuat6ie4hsgs5vjvsp3hru.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "352691001887",
"project_id": "magic-ling-pixel-dungeon",
"storage_bucket": "magic-ling-pixel-dungeon.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:352691001887:android:c9e419b794f309eae8d32a",
"android_client_info": {
"package_name": "com.ansdomagiclingpixeldungeon.ling.indev"
}
},
"oauth_client": [
{
"client_id": "352691001887-krfrqeg524uuat6ie4hsgs5vjvsp3hru.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyA9mI7GUoXZg0MWTF4Pc0HuJiWcw5dkMI4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "352691001887-krfrqeg524uuat6ie4hsgs5vjvsp3hru.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@ -53,6 +53,9 @@
<data android:scheme="um.62aafe4488ccdf4b7e9b49ff" />
</intent-filter>
</activity>
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
</application>

View File

@ -33,7 +33,8 @@ 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.rohitss.uceh.UCEHandler;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.services.news.News;
@ -47,7 +48,7 @@ import com.watabou.utils.FileUtils;
public class AndroidGame extends AndroidApplication {
public static AndroidApplication instance;
private FirebaseAnalytics mFirebaseAnalytics;
private static AndroidPlatformSupport support;
@Override
@ -85,8 +86,14 @@ public class AndroidGame extends AndroidApplication {
// this is the default prefs filename given to an android app (.xml is automatically added to it)
SPDSettings.set(instance.getPreferences("ShatteredPixelDungeon"));
UCEHandler.Builder builder = new UCEHandler.Builder(this);
builder.build();
//UCEHandler.Builder builder = new UCEHandler.Builder(this);
//builder.build();
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
if (SPDSettings.firebase()){
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
}
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false);
} else {
instance = this;

View File

@ -5,6 +5,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
}
}
@ -20,7 +22,7 @@ allprojects {
appJavaCompatibility = JavaVersion.VERSION_1_8
appAndroidCompileSDK = 30
appAndroidMinSDK = 14
appAndroidMinSDK = 19
appAndroidTargetSDK = 30
gdxControllersVersion = '2.2.1'

View File

@ -2,6 +2,10 @@
actors.buffs.watersoulx.name=水灵祝福
actors.buffs.watersoulx.desc=水灵的祝福已经在你身上,现在你可以免疫水上的所有诅咒,并且得到你应当得到的祝福。\n\n剩余回合:%s。
scenes.heroselectscene.custom_seed_title=Custom Name
scenes.heroselectscene.custom_seed_desc=Enter Your Name
text.herostat.hunger = 饥饿
text.herostat.skill = 命中/闪避
text.herostat.duration = 总回合数

View File

@ -1,4 +1,9 @@
###MLPD
items.artifacts.wraithamulet.name=暗金宝石护符
items.artifacts.wraithamulet.desc=来自于异世界的产物,能使自己进入虚无化。当护符能量足够多的时候,你还可以对敌人实行一次暗夜袭击,护符能量将会随着时间自动恢复。\n\n这个护符是证明给强者之人用的冰雪魔女已经输的心服口服现在她将此护身符给予给你。
items.artifacts.wraithamulet.ac_ghost=遁入虚无
items.artifacts.wraithamulet.ac_darkkill=暗夜袭击
items.scrolls.exotic.scrollofpolymorph.name=羊化秘卷
items.scrolls.exotic.scrollofpolymorph.desc=这张秘卷富含强大的转换能力。当使用时,所有在使用者视野范围内的单位都将变形成一只魔法绵羊!\n\n这种变形过程是不可逆的但不是所有敌人都会被影响。强大的敌人将抵抗这种魔法。同时变形后目标敌人身上的物品将会消失。
@ -197,7 +202,7 @@ items.wands.wandofgodice.desc=这根法杖的蔚蓝色色主干顶端镶嵌着
items.wands.wandofgodice.stats_desc=这根法杖能射出冰冻冲击波,\n会造成_%1$d~%2$d点伤害_。\n对首领的可以造成双倍伤害\n-翼绫,我很抱歉,我只能这样杀死你吗?
items.quest.goldbao.name=黄金珍宝
items.quest.goldbao.desc=由钻石宝箱王守护的东西,据说是商人的喜爱产品。\n\n无论怎么样现在珍宝已经在你手中你已经打败了钻石宝箱王。\n提示如果资金不够可以重新给商人展示,或许能让他心动!
items.quest.goldbao.desc=由钻石宝箱王守护的东西,据说是商人的喜爱产品。\n\n无论怎么样现在珍宝已经在你手中你已经打败了钻石宝箱王。\n提示出价资金可能会和实际资金不同,因为商人随时可能变卦。
items.quest.red.name=死灵精华十字架
items.quest.red.desc=死灵领主的好东西,如果交给想要的人必然会有好运。

View File

@ -69,15 +69,15 @@ badges$badge.godd_make=老人与海\n累计完成老杖匠的全部任务\n\n_
badges$badge.clear_water=净化大师\n完成挑战:污泥浊水\n\n_奖励敬请期待_
badges$badge.halofire_died=死于磷火烈焰
badges$badge.happy_end=幸福结局
badges$badge.champion_1=开启1项挑战通关
badges$badge.champion_1x=开启1项挑战通关
badges$badge.kill_slmking=击杀史莱姆王子
badges$badge.big_x=巨人之殇\n\n突变巨兽开启通关你已克服许多困难\n\n_奖励0层随机护甲(四大基座上)_
badges$badge.exsg=大症若愚\n\n癔症只是一个假象你仍然坚持过来了\n\n_奖励1500初始金币两个经验药水_
badges$badge.kill_dm720=击杀DM720\n\n矿洞的终极兵器\n\n_奖励0层额外十字架(四大基座上,与冰雪魔女不叠加)_
badges$badge.champion_2=地牢勇者\n\n_开启3项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_3=不屈斗士\n\n_开启6项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_4=超凡脱俗\n\n_开启8项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_5=救世之主\n\n_开启10项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_2x=地牢勇者\n\n_开启3项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_3x=不屈斗士\n\n_开启6项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_4x=超凡脱俗\n\n_开启8项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.champion_5x=救世之主\n\n_开启10项以上挑战通关\n\n[不包含BR模式和开发者模式]_
badges$badge.unlock_mage=解锁法师
badges$badge.unlock_rogue=解锁盗贼
badges$badge.unlock_huntress=解锁女猎手
@ -112,7 +112,7 @@ challenges.champion_enemies_desc=会升级的不止你一个!\n\n・普通敌
的机率拥有特殊的精英属性。\n・精英敌人刷出时会立即醒来。\n・精英敌人免疫腐化效果。\n\n精英敌人有七种\n_烈焰橙色_ 近战伤害 \
+25% 且带有点燃效果,免疫火焰,死亡时引燃周围。\n_索敌紫色_ 近战伤害 +25%,近战范围 +8。\n_敌法绿色_ 受到伤害 -25%,拥有魔法免疫。\n_巨型蓝色_ 受到伤害 -75%,近战范围 +1无法进入门与过道。\n_祝福黄色_ 精准与躲避 +200%。\n_成长红色_ 精准、躲避、攻击伤害与有效生命值 +20%。每过 3 回合会再增长 1%。\n_鬼磷天蓝色_ 近战伤害 +65% 且带有磷火效果,免疫火焰与磷火,死亡时引燃周围。
challenges.stronger_bosses=Π梦魇Boss
challenges.stronger_bosses_desc=这项挑战让挑战 Boss 变得更有挑战性了!\n\n_粘咕_生命值 +20%\n_-_ 水中恢复量增长,每回合恢复 3 点生命\n_-_ 爆发攻击蓄力时间由 2 回合缩短至 1 回合\n_天狗_生命 +25%\n_-_ 第一阶段:陷阱更加致命\n_-_ 第二阶段:技能频率更高\n_DM-300_生命 +33%\n_-_ 能量塔更坚固,并且需要击毁 3 座\n_-_ 技能频率更高,威力也更强大\n_-_ 超载时移动速度更高\n_-_ 地表导线数量为原先的两倍\n_矮人国王:_生命 +50%\n_-_ 整场战斗内召唤的随从都更强大\n_-_ 第一阶段:技能与召唤频率都更高\n_-_ 第二阶段:每轮额外召唤两个随从\n_-_ 第三阶段:生命值 +100%,召唤频率更高\n_Yog-Dzewa:_\n_-_ 同时召唤两个古神之拳!\n_-_ 激光攻击伤害 +60%\n_-_ 召唤更强大的随从
challenges.stronger_bosses_desc=这项挑战让挑战 Boss 变得更有挑战性了!\n\n_粘咕_生命值 +20%\n_-_ 水中恢复量增长,每回合恢复 6 点生命\n_-_ 爆发攻击蓄力时间由 2 回合缩短至 1 回合\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_-_ 召唤更强大的随从\n_冰雪魔女:_\n_-_生命+25%\n_-_ 水中召唤的仆从更多\n-击败时必定掉落紫金宝石护符\n_矮人大师:_\n_-_ 致命技能更加频繁\n_-_ 生命值+50%\n-击败时必定掉落自然神圣护符\n_史莱姆王:_\n_-_ 生命值+100%\n_-_ 伤害更高,速度更快\n_-_ 在开局额外召唤豺狼诡术师,巨钳螃蟹,腐臭老鼠,蚀化史莱姆\n_-_ 击败时必定掉落凝胶手套\n_DM720:_\n_-_ 获得全新技能\n_-_ 击败时必定掉落DM150控制终端
actors.char.aquaphobia=你受到了来自水的伤害!
challenges.pro=Δ开发者模式Δ
challenges.pro_desc=注解版?\n开局_几乎是全物品_同时你将无法通关

View File

@ -3,6 +3,8 @@ windows.wndsettings$extendtab.splash_screen=启动界面
windows.wndsettings$extendtab.disable=关闭
windows.wndsettings$extendtab.full=开启
scenes.titlescene.spawnerror=楼层生成错误!!!
scenes.feedbackscene$1.title=确定退出游戏?
scenes.feedbackscene$1.intro=你确定要退出游戏吗?
scenes.feedbackscene$1.sponsor_msg=如果是,请点击退出游戏。如果不是,请点击回到游戏。

View File

@ -1,10 +1,16 @@
windows.textchallenges.seed_custom_title = 种子
windows.textchallenges.hint = 不输入即为随机种子
windows.textchallenges.delete_seed_input = 清除
windows.wndsettings$datatab.firebase=FireBase数据提交
windows.wndsettings$displaytab.firebase_active=FireBase数据提交
windows.wndsettings$displaytab.firebase_desc=FireBase是一款由_Google_推出的一种开发者服务。Ling在魔绫这边添加了_FireBase崩溃日志收集报告_。\n当你尚未开启此功能时你的_所有崩溃报告都会保存在本地Data数据区域(使用Root才能访问)_\n\n当你开启本功能后你在魔绫游玩的所有崩溃报告将会在下次启动魔绫一并提交到程序后台以便JDSALing我维护。\n-开启此功能代表你同意提交你的崩溃数据和Δ手机的基本公开信息Δ_(手机型号,ROOT权限检测,安卓版本,运存检测,屏幕方向,手机内存)_,同时非常感谢你开启此功能以供Ling后续维护魔绫。\nΔ感谢你的支持与理解同时感谢你的游玩Δ\n\nΞ开启此功能后重启游戏后本地崩溃数据将自动提交到魔绫控制终端Ξ
windows.wndsettings$extendtab.quickslots=快捷栏设置
windows.wndsettings$extendtab.wxts=温馨提示:进入游戏后才能调整快捷栏\n\n这是因为技术问题但是这里已经提醒你了。\n\n当你进入游戏后,这里就会变成快捷栏设置区!
windows.wndstartgame.hard=难度选择
windows.wndstartgame.news=章节选择
windows.wndinfomob.dsinfo = 闪避概率:
windows.wndinfomob.maxinfo = 掉落限制LV:
windows.wndinfomob.getexp = 上次伤害:
@ -53,7 +59,7 @@ windows.bosssettingwindows.boss_5 = 直面Yog-Zot
windows.wndstartgame.title=选择一位英雄
windows.wndstartgame.start=开始游戏
windows.wndchallenges.title=挑战
windows.wndchallenges.title=挑战模式
windows.wndchooseability.message=手指还未离开,头顶上的皇冠就开始与你的护甲共鸣,发光、发热,好像坐上你的颅骨就是它的创造使命。皇冠的魔力包覆起你的护甲,摩挲起你的意志,像等待帝王下旨的臣子。陛下,哪项护甲技能更合圣意?
windows.wndchooseability.message_no_crown=请陛下选一项护甲技能!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -152,7 +152,7 @@ public class Badges {
VICTORY_HUNTRESS,
VICTORY_ALL_CLASSES ( 98, true ),
GAMES_PLAYED_3 ( 99, true ),
CHAMPION_1 ( 100 ),
CHAMPION_1X ( 100 ),
KILL_SLMKING (101),
KILL_DM720 (102),
RLPT (103),
@ -160,10 +160,10 @@ public class Badges {
//diamond
GAMES_PLAYED_4 ( 112, true ),
CHAMPION_2 ( 113 ),
CHAMPION_3 ( 114 ),
CHAMPION_4 ( 115 ),
CHAMPION_5 ( 116 ),
CHAMPION_2X ( 113 ),
CHAMPION_3X ( 114 ),
CHAMPION_4X ( 115 ),
CHAMPION_5X ( 116 ),
NYZ_SHOP ( 117 ),
//rudy
@ -930,24 +930,24 @@ public class Badges {
public static void validateChampion( int challenges ) {
if (challenges == 0) return;
Badge badge = null;
if (challenges >= 1 && !(Dungeon.isChallenged(PRO))||!(Dungeon.isChallenged(ALLBOSS))) {
badge = Badge.CHAMPION_1;
if (challenges >= 1 && !(Dungeon.isChallenged(PRO))||challenges >= 1 &&!(Dungeon.isChallenged(ALLBOSS))) {
badge = Badge.CHAMPION_1X;
}
if (challenges >= 3 && !(Dungeon.isChallenged(PRO))||!(Dungeon.isChallenged(ALLBOSS))){
if (challenges >= 3 && !(Dungeon.isChallenged(PRO))||challenges >= 3 &&!(Dungeon.isChallenged(ALLBOSS))){
addGlobal(badge);
badge = Badge.CHAMPION_2;
badge = Badge.CHAMPION_2X;
}
if (challenges >= 6 && !(Dungeon.isChallenged(PRO))||!(Dungeon.isChallenged(ALLBOSS))){
if (challenges >= 6 && !(Dungeon.isChallenged(PRO))||challenges >= 6 &&!(Dungeon.isChallenged(ALLBOSS))){
addGlobal(badge);
badge = Badge.CHAMPION_3;
badge = Badge.CHAMPION_3X;
}
if (challenges >= 8 && !(Dungeon.isChallenged(PRO))||!(Dungeon.isChallenged(ALLBOSS))){
if (challenges >= 8 && !(Dungeon.isChallenged(PRO))||challenges >= 8 &&!(Dungeon.isChallenged(ALLBOSS))){
addGlobal(badge);
badge = Badge.CHAMPION_4;
badge = Badge.CHAMPION_4X;
}
if (challenges >= 10 && !(Dungeon.isChallenged(PRO))||!(Dungeon.isChallenged(ALLBOSS))){
if (challenges >= 10 && !(Dungeon.isChallenged(PRO))||challenges >= 10 &&!(Dungeon.isChallenged(ALLBOSS))){
addGlobal(badge);
badge = Badge.CHAMPION_5;
badge = Badge.CHAMPION_5X;
}
local.add(badge);
displayBadge( badge );
@ -1029,7 +1029,7 @@ public class Badges {
{Badge.ITEMS_CRAFTED_1, Badge.ITEMS_CRAFTED_2, Badge.ITEMS_CRAFTED_3, Badge.ITEMS_CRAFTED_4},
{Badge.BOSS_SLAIN_1, Badge.BOSS_SLAIN_2, Badge.BOSS_SLAIN_3, Badge.BOSS_SLAIN_4},
{Badge.GAMES_PLAYED_1, Badge.GAMES_PLAYED_2, Badge.GAMES_PLAYED_3, Badge.GAMES_PLAYED_4},
{Badge.CHAMPION_1, Badge.CHAMPION_2, Badge.CHAMPION_3,Badge.CHAMPION_4,Badge.CHAMPION_5}
{Badge.CHAMPION_1X, Badge.CHAMPION_2X, Badge.CHAMPION_3X,Badge.CHAMPION_4X,Badge.CHAMPION_5X}
};
private static final Badge[][] metaBadgeReplacements = new Badge[][]{
@ -1059,7 +1059,8 @@ public class Badges {
leaveBest( badges, Badge.FOOD_EATEN_1, Badge.FOOD_EATEN_2, Badge.FOOD_EATEN_3, Badge.FOOD_EATEN_4 );
leaveBest( badges, Badge.ITEM_LEVEL_1, Badge.ITEM_LEVEL_2, Badge.ITEM_LEVEL_3, Badge.ITEM_LEVEL_4 );
leaveBest( badges, Badge.GAMES_PLAYED_1, Badge.GAMES_PLAYED_2, Badge.GAMES_PLAYED_3, Badge.GAMES_PLAYED_4 );
leaveBest( badges, Badge.CHAMPION_1, Badge.CHAMPION_2, Badge.CHAMPION_3,Badge.CHAMPION_4,Badge.CHAMPION_5 );
leaveBest( badges, Badge.CHAMPION_1X, Badge.CHAMPION_2X, Badge.CHAMPION_3X,Badge.CHAMPION_4X,
Badge.CHAMPION_5X );
for (Badge[] tierReplace : tierBadgeReplacements){
leaveBest( badges, tierReplace );

View File

@ -101,6 +101,9 @@ public class Dungeon {
public static int cycle;
public static int depth;
public static int gold;
public static String customSeedText = "";
public static int nyzbuy;
public static int boss;
public static int escalatingDepth() {
@ -209,6 +212,8 @@ public class Dungeon {
public static void init() {
version = Game.versionCode;
challenges = SPDSettings.challenges();
mobsToChampion = -1;
@ -678,12 +683,17 @@ public class Dungeon {
private static final String QUESTS = "quests";
private static final String BADGES = "badges";
private static final String CUSTOM_NAME = "custom_name";
public static void saveGame( int save ) {
try {
Bundle bundle = new Bundle();
version = Game.versionCode;
bundle.put( VERSION, version );
bundle.put( CUSTOM_NAME, customSeedText );
bundle.put( SEED, seed );
bundle.put( CHALLENGES, challenges );
bundle.put( MOBS_TO_CHAMPION, mobsToChampion );
@ -761,7 +771,7 @@ public class Dungeon {
saveGame( GamesInProgress.curSlot );
saveLevel( GamesInProgress.curSlot );
GamesInProgress.set( GamesInProgress.curSlot, depth, challenges, hero );
GamesInProgress.set( GamesInProgress.curSlot, depth, challenges, seed, customSeedText, hero );
}
}

View File

@ -122,7 +122,7 @@ public class GamesInProgress {
}
public static void set(int slot, int depth, int challenges,
Hero hero) {
long seed, String customSeedText, Hero hero) {
Info info = new Info();
info.slot = slot;
@ -156,7 +156,7 @@ public class GamesInProgress {
public static class Info {
public int slot;
public int depth;
public int version;
public int challenges;

View File

@ -37,12 +37,13 @@ import java.util.Locale;
public class SPDSettings extends GameSettings {
//Version info
public static final String KEY_AUTH_KEY = "net_auth_key";
public static final String KEY_VERSION = "version";
public static String DEFAULT_KEY = "debug";
public static void quickslots( int value ){
put( KEY_QUICKSLOTS, value );
}
public static String auth_key() { return getString(KEY_AUTH_KEY, DEFAULT_KEY); }
public static int quickslots(){
return getInt( KEY_QUICKSLOTS, 4, Constants.MIN_QUICKSLOTS, Constants.MAX_QUICKSLOTS);
}
@ -58,17 +59,27 @@ public class SPDSettings extends GameSettings {
public static int version() {
return getInt( KEY_VERSION, 0 );
}
//Graphics
public static void customSeed( String value ){
put( KEY_CUSTOM_SEED, value );
}
public static String customSeed() {
return getString( KEY_CUSTOM_SEED, "", 20);
}
public static final String KEY_FULLSCREEN = "fullscreen";
public static final String KEY_LANDSCAPE = "landscape";
public static final String KEY_POWER_SAVER = "power_saver";
public static final String KEY_FIRE_BASE = "fire_base";
public static final String KEY_SCALE = "scale";
public static final String KEY_ZOOM = "zoom";
public static final String KEY_BRIGHTNESS = "brightness";
public static final String KEY_GRID = "visual_grid";
public static final String KEY_SPLASH_SCREEN= "splash_screen";
public static final String KEY_CUSTOM_SEED = "custom_seed";
//瀑布系统
public static void splashScreen( int value ) {
@ -123,6 +134,15 @@ public class SPDSettings extends GameSettings {
public static boolean powerSaver(){
return getBoolean( KEY_POWER_SAVER, false );
}
public static void firebase( boolean value ){
put( KEY_FIRE_BASE, value );
((ShatteredPixelDungeon)ShatteredPixelDungeon.instance).updateDisplaySize();
}
public static boolean firebase(){
return getBoolean( KEY_FIRE_BASE, false );
}
public static void scale( int value ) {
put( KEY_SCALE, value );

View File

@ -34,7 +34,7 @@ public class Statistics {
public static int ankhsUsed;
public static int spawnersIce;
public static int naiyaziCollected;
public static boolean isCustomSeed = false;
public static boolean iscustomName = false;
//used for hero unlock badges
public static int upgradesUsed;
public static int sneakAttacks;

View File

@ -219,7 +219,6 @@ public abstract class Char extends Actor {
GameScene.updateFog();
return true;
}
//can't swap places if one char has restricted movement
if (rooted || c.rooted || buff(Vertigo.class) != null || c.buff(Vertigo.class) != null){
return true;

View File

@ -102,7 +102,7 @@ public abstract class ChampionHero extends FlavourBuff {
}
@Override
public void fx(boolean on) {
//
//解决光斑问题
}
@Override
public void onAttackProc(Char hero) {

View File

@ -68,7 +68,6 @@ public class Sanity extends Buff {
//-1-(1/10)+2=-1-0.1+2=0
sanity -= Dungeon.depth/5+1;
if(sanity == 179) {
//GLog.w("我感到身体十分的沉重……奇怪的话语在你耳边环绕……");
GLog.w(Messages.get(Sanity.class,"bad"));
}
} else if (sanity >= 120) {
@ -82,7 +81,6 @@ public class Sanity extends Buff {
if(--sanity-(Dungeon.depth/5) == 0){
detach();
target.die(this);
//GLog.n("你彻底失去理智了……你的灵魂彻底裂开了……");
GLog.n(Messages.get(Sanity.class,"diedsoul"));
}
}

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Bones;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
@ -180,6 +181,7 @@ public class Hero extends Char {
alignment = Alignment.ALLY;
}
public boolean isClass(HeroClass clazz){
if (heroClass == HeroClass.ROGUE) return true;
return clazz == this.heroClass;
@ -201,7 +203,7 @@ public class Hero extends Char {
private static final float TIME_TO_REST = 1f;
private static final float TIME_TO_SEARCH = 2f;
private static final float HUNGER_FOR_SEARCH = 6f;
public HeroClass heroClass = HeroClass.ROGUE;
public HeroSubClass subClass = HeroSubClass.NONE;
public ArmorAbility armorAbility = null;
@ -225,7 +227,7 @@ public class Hero extends Char {
public int STR;
public float awareness;
public int lvl = 1;
public int exp = 0;
@ -302,7 +304,7 @@ public class Hero extends Char {
bundle.put( SUBCLASS, subClass );
bundle.put( ABILITY, armorAbility );
Talent.storeTalentsInBundle( bundle, this );
bundle.put( ATTACK, attackSkill );
bundle.put( DEFENSE, defenseSkill );
@ -410,9 +412,14 @@ public class Hero extends Char {
return subClass == null || subClass == HeroSubClass.NONE ? heroClass.title() : subClass.title();
}
public static String customname = SPDSettings.customSeed();
@Override
public String name(){
return className();
if (customname == null) {
return className();
} else {
return SPDSettings.customSeed();
}
}
@Override

View File

@ -55,6 +55,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.WraithAmulet;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.BookBag;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.HerbBag;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.KingBag;
@ -202,7 +203,7 @@ public enum HeroClass {
new ScrollOfMysticalEnergy().quantity(1).identify().collect();
new AquaBlast().quantity(1).identify().collect();
new WandOfCorruption().quantity(1).identify().collect();
new WandOfCorruption().quantity(1/0).identify().collect();
new MasterThievesArmband().quantity(1).identify().collect();
new Dart().quantity(1).identify().collect();
@ -239,6 +240,7 @@ public enum HeroClass {
new PotionOfLightningShiled().quantity(42).collect();
new ScrollOfRoseShiled().quantity(45).identify().collect();
new ScrollOfTerror().quantity(45).identify().collect();
new WraithAmulet().quantity(1).identify().collect();
Dungeon.gold = 600000000;
hero.STR = 27;
hero.lvl = 31;

View File

@ -28,7 +28,7 @@ public class BloodBat extends Mob implements Callback {
{
HP = HT = 20;
defenseSkill = 7;
baseSpeed = 1.5f;
baseSpeed = 2.5f;
spriteClass = BlueBatSprite.class;
alignment = Alignment.ALLY;
WANDERING = new Wandering();

View File

@ -27,12 +27,12 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EnergyParticle
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.HalomethaneFlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Ankh;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.TengusMask;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.GoldBAo;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlueFuck;
@ -514,7 +514,7 @@ public class DimandKing extends Boss {
Ankh ankh = new Ankh();
ankh.bless();
Dungeon.level.drop(new Ankh(), dropPos).sprite.drop(pos);
Dungeon.level.drop(new GoldBAo().quantity(1), dropPos).sprite.drop(pos);
Dungeon.level.drop(new Gold().quantity(Random.Int(2200, 5500)), pos).sprite.drop();
Badges.validateBossSlain();
Dungeon.level.unseal();

View File

@ -65,9 +65,10 @@ public class Eye extends Mob {
properties.add(Property.DEMONIC);
}
public static void spawnAround() {
public static void spawnAround(int pos) {
for (int n : PathFinder.NEIGHBOURS4) {
spawnAt( Random.Int(Dungeon.level.length()) + n );
int cell = pos + n;
spawnAt( Random.Int(Dungeon.level.length()) + cell );
}
}

View File

@ -183,12 +183,12 @@ public abstract class Mob extends Char {
alerted = false;
if (Dungeon.isChallenged(Challenges.SBSG) && scaleFactor == 1f && !properties().contains(Property.NOBIG)&&!properties().contains(Property.BOSS)){
scaleFactor = Random.Float(0.7f, 1.4f);
scaleFactor = Random.Float(1f, 1.8f);
HP = HT = (int) (HT * scaleFactor);
if (scaleFactor >= 1.25f){
HP = HT = (int) (HT * 1.25f);
}else if (scaleFactor >= 1f) {
HP = HT = (int) (HT * 1f);
if (scaleFactor >= 1.15f){
HP = HT = (int) (HT * 1.15f);
}else if (scaleFactor >= 1.4f) {
HP = HT = (int) (HT * 1.4f);
}
sprite.linkVisuals(this);
sprite.link(this);

View File

@ -21,6 +21,8 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
@ -80,7 +82,7 @@ public class NewDM300 extends Mob {
{
spriteClass = DM300Sprite.class;
HP = HT = Dungeon.isChallenged(Challenges.STRONGER_BOSSES) ? 400 : 300;
HP = HT = Dungeon.isChallenged(Challenges.STRONGER_BOSSES) ? 480 : 300;
EXP = 30;
defenseSkill = 15;
@ -151,7 +153,7 @@ public class NewDM300 extends Mob {
if (turnsSinceLastAbility != -1){
BossHealthBar.assignBoss(this);
if (!supercharged && pylonsActivated == totalPylonsToActivate()) BossHealthBar.bleed(true);
if (!supercharged && pylonsActivated == 4) BossHealthBar.bleed(true);
}
}
@ -448,16 +450,11 @@ public class NewDM300 extends Mob {
int dmgTaken = preHP - HP;
if (dmgTaken > 0) {
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
LockedFloor lock = hero.buff(LockedFloor.class);
if (lock != null && !isImmune(src.getClass())) lock.addTime(dmgTaken*1.5f);
}
int threshold;
if (Dungeon.isChallenged(Challenges.STRONGER_BOSSES)){
threshold = HT / 4 * (3 - pylonsActivated);
} else {
threshold = HT / 3 * (2 - pylonsActivated);
}
int threshold = HT/4 * (4- pylonsActivated);
if (HP < threshold){
HP = threshold;
@ -466,10 +463,6 @@ public class NewDM300 extends Mob {
}
public int totalPylonsToActivate(){
return Dungeon.isChallenged(Challenges.STRONGER_BOSSES) ? 3 : 2;
}
@Override
public boolean isInvulnerable(Class effect) {
if (supercharged && !invulnWarned){
@ -501,7 +494,7 @@ public class NewDM300 extends Mob {
supercharged = false;
((DM300Sprite)sprite).updateChargeState(false);
if (pylonsActivated < totalPylonsToActivate()){
if (pylonsActivated < 4){
yell(Messages.get(this, "charge_lost"));
} else {
yell(Messages.get(this, "pylons_destroyed"));
@ -511,7 +504,7 @@ public class NewDM300 extends Mob {
@Override
public boolean isAlive() {
return super.isAlive() || pylonsActivated < totalPylonsToActivate();
return super.isAlive() || pylonsActivated < 4;
}
@Override

View File

@ -1208,7 +1208,7 @@ public class DwarfMaster extends Boss {
int bestPos = pos;
Ballistica trajectory = new Ballistica(enemy.pos, pos, Ballistica.STOP_TARGET);
int targetCell = trajectory.path.get(trajectory.dist+1);
int targetCell = trajectory.path.get(trajectory.dist);
//if the position opposite the direction of the hero is open, go there
if (Actor.findChar(targetCell) == null && !Dungeon.level.solid[targetCell]){
bestPos = targetCell;
@ -1326,7 +1326,7 @@ public class DwarfMaster extends Boss {
spend(TICK*15);
}else if(wave == 3){
yell(Messages.get(this, "wave_2"));
new Eye().spawnAround();
Eye.spawnAround(pos);
summonSubject(1, DwarfMaster.DKGhoul.class);
summonSubject(2, DwarfMaster.DKWarlock.class);
summonSubject(2, DwarfMaster.DKGhoul.class);

View File

@ -0,0 +1,188 @@
package com.shatteredpixel.shatteredpixeldungeon.custom.visuals;
import com.badlogic.gdx.Gdx;
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.custom.TextInput;
import com.shatteredpixel.shatteredpixeldungeon.custom.utils.Constants;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.watabou.noosa.NinePatch;
public abstract class ClassName extends RedButton {
private NinePatch inputWnd;
private RenderedTextBlock inputText;
private String hint = "";
private static final int MIN_HEIGHT_LARGE = 26;
private static final int MIN_HEIGHT_PACKED = 18;
private int max_str_length = Integer.MAX_VALUE;
//defines if title and input window are in separate lines.
private boolean large = true;
public ClassName( String label ) {
this(label,"");
}
public ClassName( String label, String txt ){
super(label, 8);
inputText = PixelScene.renderTextBlock( 6 );
inputText.text( txt );
add( inputText );
}
public void setTitle(String title){
text.text(title);
}
public void setHint(String hint){
this.hint = hint;
}
public void setMaxStringLength(int maxLength){
this.max_str_length = Math.max(0, maxLength);
}
public void setLarge(boolean isLarge){
this.large = isLarge;
}
@Override
protected void createChildren() {
super.createChildren();
inputWnd = Chrome.get(Chrome.Type.TOAST);
add(inputWnd);
}
@Override
protected void onClick() {
TextInput tinp = new TextInput(){
@Override
public void input(String text) {
if(parent != null) {
if (text.length() > max_str_length) {
text = text.substring(0, max_str_length);
}
text(text);
onTextChange();
}
}
@Override
public void canceled() {
if(parent != null) {
onTextCancel();
}
}
};
if(Constants.gameIsAndroid()) {
Gdx.input.getTextInput(tinp, text.text(), inputText.text(), hint);
}else{
TextInput.getTextInput(tinp, text.text(), inputText.text(), hint);
}
}
public abstract void onTextChange();
public abstract void onTextCancel();
@Override
public void text(String value) {
inputText.text(value);
if(value.equals("")){
inputText.clear();
}
layout();
}
public void label(String value){
text.text(value);
layout();
}
public String text(){
return inputText.text();
}
@Override
public void enable(boolean value) {
super.enable(value);
inputText.alpha( value ? 1.0f : 0.3f );
inputWnd.alpha( value ? 1.0f : 0.3f );
}
@Override
protected void layout() {
if(large) {
bg.x = x;
bg.y = y;
height = Math.max(height, MIN_HEIGHT_LARGE);
bg.size(width, height);
hotArea.x = x;
hotArea.y = y;
hotArea.width = width;
hotArea.height = height;
if (icon != null) {
text.setPos((width - text.width() - text.height() - 2) / 2, bg.y + 2);
PixelScene.align(text);
icon.scale.set((text.height() + 2) / icon.height);
icon.x = text.right() + 2;
icon.y = text.top() - 2;
} else {
text.setPos((width - text.width()) / 2, bg.y + 2);
PixelScene.align(text);
}
inputWnd.x = x + 2;
inputWnd.y = text.bottom() + 2;
inputWnd.size(width - 4, height - 7 - text.height());
inputText.maxWidth((int) inputWnd.width);
inputText.setPos((inputWnd.width() - inputText.width()) / 2 + inputWnd.x, inputWnd.y + (inputWnd.height - inputText.height()) / 2);
PixelScene.align(inputText);
}else{
bg.x = x;
bg.y = y;
height = Math.max(height, MIN_HEIGHT_PACKED);
bg.size(width, height);
hotArea.x = x;
hotArea.y = y;
hotArea.width = width;
hotArea.height = height;
if (icon != null) {
icon.x = 1;
icon.y = (bg.height - icon.height)/2 + bg.y;
text.setPos(icon.x + icon.width() + 1, (bg.height - text.height())/2 + bg.y);
PixelScene.align(text);
} else {
text.setPos( 2, (bg.height - text.height())/2 + bg.y);
PixelScene.align(text);
}
inputWnd.x = text.right() + 2;
inputWnd.y = bg.y + 2;
inputWnd.size(bg.x + bg.width - text.right() - 4, bg.height - 4);
inputText.maxWidth((int) inputWnd.width);
inputText.setPos((inputWnd.width() - inputText.width()) / 2 + inputWnd.x, inputWnd.y + (inputWnd.height - inputText.height()) / 2);
PixelScene.align(inputText);
}
}
}

View File

@ -71,13 +71,13 @@ public class Item implements Bundlable {
//TODO should these be private and accessed through methods?
public int image = 0;
public int icon = -1; //used as an identifier for items with randomized images
public boolean stackable = false;
public int flasks;
protected int quantity = 1;
public boolean dropsDownHeap = false;
private int level = 0;
public int level = 0;
public boolean levelKnown = false;

View File

@ -0,0 +1,197 @@
package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Random;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Objects;
public class WraithAmulet extends Artifact {
{
image = ItemSpriteSheet.WRALIPS;
cooldown = 0;
charge = Math.min(level()+3, 10);
partialCharge = 0;
chargeCap = Math.min(level()+3, 10);
level = 0;
levelCap = 10;
defaultAction = AC_GHOST;
}
private static final String AC_GHOST = "ghost";
private static final String AC_ASSASSINATE = "darkkill";
@Override
public Item upgrade(){
chargeCap++;
return super.upgrade();
}
@Override
public int visiblyUpgraded() {
return levelKnown ? Math.round((level()*8)/(float)levelCap): 0;
}
@Override
public void execute(Hero hero, String action) {
super.execute(hero, action);
if(action.equals(AC_GHOST)){
if (cooldown > 0) {
GLog.i(Messages.get(this,"cooddown"));
} else if(useableBasic()) {
if(this.isEquipped(Dungeon.hero)){
if(this.charge > 0) {
exp += 5;
Buff.affect(Dungeon.hero, Invisibility.class, Invisibility.DURATION);
GLog.i(Messages.get(this,"ghost"));
cooldown = 12 - (level / 2);
charge--;
} else {
GLog.i(Messages.get(this,"nochareup"));
}
} else {
GLog.i(Messages.get(this,"noequip"));
}
} else {
GLog.i(Messages.get(this,"whoareyou"));
}
} else if (action.equals(AC_ASSASSINATE)) {
if(this.charge >= 5){
GameScene.selectCell(porter);
charge-=5;
} else {
GLog.i(Messages.get(this,"nochareup"));
}
}
}
protected boolean useableBasic(){
return true;
}
protected boolean useable(){
return true;
}
@Override
public ArrayList<String> actions(Hero hero) {
ArrayList<String> actions = super.actions(hero);
if (isEquipped(hero))
actions.add(AC_GHOST);
if (isEquipped(hero) && charge >= 7)
actions.add(AC_ASSASSINATE);
return actions;
}
@Override
protected ArtifactBuff passiveBuff() {
return new WraithRecharge();
}
public class WraithRecharge extends ArtifactBuff{
@Override
public boolean act() {
if (charge < chargeCap && !cursed && useableBasic()) {
partialCharge += 1 / (150f - (chargeCap - charge) * 15f);
if (partialCharge >= 1) {
partialCharge--;
charge++;
if (charge == chargeCap) {
partialCharge = 0;
}
}
} else if(cursed){
if(Random.Int(40) == 0){
GLog.i(Messages.get(this,"cursed"));
}
}
if(exp > level * 50){
exp = 0;
if(level < levelCap){
//I must add Complete WraithAmulet
//Ok,Ling will Complete WraithAmulet
upgrade();
exp += level * 50;
GLog.p(Messages.get(this,"ghoststong"));
}
}
if (cooldown > 0)
cooldown--;
updateQuickslot();
spend(TICK);
return true;
}
}
@Override
public String desc() {
return Messages.get(this, "desc");
}
public int getCharge(){
return this.charge;
}
protected static CellSelector.Listener porter = new CellSelector.Listener() {
@Override
public String prompt() {
return Messages.get(this,"selectkill");
}
@Override
public void onSelect(Integer target) {
HashSet<Mob> victim = new HashSet<Mob>();
if (target != null ) {
if (target == curUser.pos) {
GLog.i(Messages.get(this,"select"));
return;
}
QuickSlotButton.target(Actor.findChar(target));
if(Actor.findChar(target) != null){
if(Level.distancex(Dungeon.hero.pos, target) == 1) {
final WraithAmulet amulet = (WraithAmulet) Item.curItem;
amulet.charge--;
amulet.exp += 10;
Objects.requireNonNull(Actor.findChar(target)).damage(Objects.requireNonNull(Actor.findChar(target)).HT, WraithAmulet.class);
Dungeon.hero.pos = target;
Dungeon.hero.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10);
ScrollOfTeleportation.appear(Dungeon.hero, target);
Dungeon.observe();
GLog.i(Messages.get(this,"killmobs"));
}
} else {
GLog.i(Messages.get(this,"far"));
}
} else {
GLog.i(Messages.get(this,"notthere"));
}
}
};
}

View File

@ -179,6 +179,24 @@ public abstract class Level implements Bundlable {
private static final String BLOBS = "blobs";
private static final String FEELING = "feeling";
public static int distancex(int a, int b) {
int ax = a % getWidth();
int ay = a / getWidth();
int bx = b % getWidth();
int by = b / getWidth();
return Math.max(Math.abs(ax - bx), Math.abs(ay - by));
}
public static final int WIDTHX = 48;
public static final int HEIGHTX = 48;
public static int getWidth() {
return WIDTHX;
}
public static boolean[] fieldOfView = new boolean[getLength()];
public static int getLength() {
return 48*48;
}
public void create() {
Random.pushGenerator( Dungeon.seedCurDepth() );

View File

@ -32,7 +32,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ChillingTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ConfusionTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FlockTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.GatewayTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.GeyserTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.OozeTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ShockingTrap;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SummoningTrap;

View File

@ -26,7 +26,6 @@ import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
@ -176,7 +175,7 @@ public class InterlevelScene extends PixelScene {
fadeTime += 0.9f; //adds 1 second total
//speed up transition when debugging
} else if (DeviceCompat.isDebug()){
fadeTime = 0.7f;
fadeTime = 0.1f;
}
SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){
@ -354,11 +353,9 @@ public class InterlevelScene extends PixelScene {
s += "\n";
s += t.toString();
}
ShatteredPixelDungeon.reportException(
new RuntimeException("waited more than 10 seconds on levelgen. " +
throw new RuntimeException(Messages.get(TitleScene.class,"spawnerror") +
"Seed:" + Dungeon.seed + " depth:" + Dungeon.depth + " trace:" +
s)
);
s);
}
break;
}

View File

@ -740,6 +740,7 @@ public class ItemSpriteSheet {
public static final int SKPOTION = BAGS+57;
public static final int SKNANO = BAGS+58;
public static final int WATERSOUL = BAGS+59;
public static final int WRALIPS = BAGS+60;
static{
assignItemRect(VIAL, 16, 16);
@ -754,6 +755,7 @@ public class ItemSpriteSheet {
assignItemRect(SKPOTION, 12, 14);
assignItemRect(SKNANO, 15, 14);
assignItemRect(WATERSOUL, 14, 14);
assignItemRect(WRALIPS, 16, 16);
}
private static final int MAINBOOKINDEX = xy(1, 37); //16 slots

View File

@ -304,16 +304,16 @@ public class StatusPane extends Component {
if (SPDSettings.ClassPage()) {
page.setPos(0, 40);
pageb.setPos(0, 9999);
pageb.visible = false;
mainhand.setPos(0, 51);
joinxxx.setPos(0, 78);
bossselect.setPos(0, 104);
} else {
page.setPos(0, 9999);
page.visible = false;
pageb.setPos(0, 40);
mainhand.setPos(0, 9999);
joinxxx.setPos(0, 9999);
bossselect.setPos(0, 9999);
mainhand.visible = false;
joinxxx.visible = false;
bossselect.visible = false;
}
if (!Dungeon.hero.isAlive()) {

View File

@ -214,7 +214,7 @@ public class Window extends Group implements Signal.Listener<KeyEvent> {
return new Point(xOffset, yOffset);
}
public final void offset( Point offset ){
public final void offset(Point offset ){
offset(offset.x, offset.y);
}

View File

@ -104,7 +104,7 @@ public class v0_6_X_Changes {
"_-_ Bulk curse makes armor large, slowing movement through doorways.\n" +
"_-_ Overgrowth curse causes random plant effects when you are struck."));
changes.addButton( new ChangeButton(BadgeBanner.image(Badges.Badge.CHAMPION_3.image), "New and Changed Badges",
changes.addButton( new ChangeButton(BadgeBanner.image(Badges.Badge.CHAMPION_3X.image), "New and Changed Badges",
"_-_ Added badges for winning with 3 challenges at once and 6 challenges at once.\n\n" +
"_-_ 'Death by glyph' badge is now 'death by deferred damage'.\n\n" +
"_-_ Removed rare monster slayer badge."));

View File

@ -643,19 +643,19 @@ public class WndSettings extends WndTabbed {
optSplashScreen.setRect(0, ClassUI.bottom() + GAP, width, SLIDER_HEIGHT);
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
quickslots.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
wxts.setRect(9999, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
wxts.visible = false;
} else {
quickslots.setRect(9999, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
quickslots.visible = false;
wxts.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
}
} else {
ClassUI.setRect(0, bottom + GAP, width, SLIDER_HEIGHT);
optSplashScreen.setRect(0, ClassUI.bottom() + GAP, width, SLIDER_HEIGHT);
if(Game.scene()!=null && Game.scene().getClass() == GameScene.class) {
wxts.setRect(9999, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
wxts.visible = false;
quickslots.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
} else {
quickslots.setRect(9999, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
quickslots.visible = false;
wxts.setRect(0, optSplashScreen.bottom() + GAP, width, SLIDER_HEIGHT);
}
//GameScene
@ -674,6 +674,7 @@ public class WndSettings extends WndTabbed {
CheckBox chkUpdates;
CheckBox chkBetas;
CheckBox chkWifi;
CheckBox chkFireBase;
@Override
protected void createChildren() {
@ -732,6 +733,33 @@ public class WndSettings extends WndTabbed {
chkWifi.checked(SPDSettings.WiFi());
add(chkWifi);
}
chkFireBase = new CheckBox(Messages.get(this, "firebase")) {
@Override
protected void onClick() {
super.onClick();
if (checked()) {
checked(!checked());
ShatteredPixelDungeon.scene().add(new WndOptions(Icons.get(Icons.DATA),
Messages.get(DisplayTab.class, "firebase_active"),
Messages.get(DisplayTab.class, "firebase_desc"),
Messages.get(DisplayTab.class, "okay"),
Messages.get(DisplayTab.class, "cancel")) {
@Override
protected void onSelect(int index) {
if (index == 0) {
checked(!checked());
SPDSettings.firebase(checked());
}
}
});
} else {
SPDSettings.firebase(checked());
}
}
};
chkFireBase.checked( SPDSettings.firebase() );
add( chkFireBase );
}
@Override
@ -741,17 +769,16 @@ public class WndSettings extends WndTabbed {
sep1.y = title.bottom() + 2*GAP;
float pos;
if (width > 200 && chkUpdates != null){
if (width > 200 && chkFireBase != null){
chkNews.setRect(0, sep1.y + 1 + GAP, width/2-1, BTN_HEIGHT);
chkUpdates.setRect(chkNews.right() + GAP, chkNews.top(), width/2-1, BTN_HEIGHT);
pos = chkUpdates.bottom();
//chkUpdates.setRect(chkNews.right() + GAP, chkNews.top(), width/2-1, BTN_HEIGHT);
chkFireBase.setRect(chkNews.right() + GAP, chkNews.top(), width/2-1, BTN_HEIGHT);
pos = chkFireBase.bottom();
} else {
chkNews.setRect(0, sep1.y + 1 + GAP, width, BTN_HEIGHT);
chkFireBase.setRect(0, chkNews.bottom() + GAP, width, BTN_HEIGHT);
pos = chkNews.bottom();
if (chkUpdates != null) {
chkUpdates.setRect(0, chkNews.bottom() + GAP, width, BTN_HEIGHT);
pos = chkUpdates.bottom();
}
}
if (chkBetas != null){

View File

@ -23,6 +23,7 @@ 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.GamesInProgress;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
@ -31,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.journal.Journal;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.HeroSelectScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.IntroScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
@ -41,18 +43,154 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.IconButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.ui.Component;
import com.watabou.utils.DeviceCompat;
import java.util.ArrayList;
public class WndStartGame extends Window {
private static final int WIDTH = 120;
private static final int HEIGHT = 160;
private static class GameOptions extends Component {
private NinePatch bg;
private ArrayList<StyledButton> buttons;
private ArrayList<ColorBlock> spacers;
@Override
protected void createChildren() {
bg = Chrome.get(Chrome.Type.GREY_BUTTON_TR);
add(bg);
buttons = new ArrayList<>();
spacers = new ArrayList<>();
if (DeviceCompat.isDebug() || Badges.isUnlocked(Badges.Badge.VICTORY)){
StyledButton seedButton = new StyledButton(Chrome.Type.RED_BUTTON, Messages.get(HeroSelectScene.class,
"custom_seed"), 6){
@Override
protected void onClick() {
Game.runOnRenderThread(() -> ShatteredPixelDungeon.scene().add(new WndTextInput(Messages.get(WndTextInput.class,"enter_name"),
SPDSettings.customSeed(), 20,
false, Messages.get(WndTextInput.class,"yes"), Messages.get(WndTextInput.class,"no")){
@Override
public void onSelect(boolean positive, String text) {
if(positive){
SPDSettings.customSeed(text);
}
}
}));
}
};
seedButton.leftJustify = true;
seedButton.icon(new ItemSprite(ItemSpriteSheet.MASTERY, null));
if (!SPDSettings.customSeed().isEmpty()) seedButton.icon().hardlight(1f, 1.5f, 0.67f);;
buttons.add(seedButton);
add(seedButton);
StyledButton challengeButton = new StyledButton(Chrome.Type.RED_BUTTON, Messages.get(WndChallenges.class,
"title"), 5){
@Override
protected void onClick() {
ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) {
public void onBackPressed() {
super.onBackPressed();
icon(new ItemSprite(SPDSettings.challenges() > 0 ? ItemSpriteSheet.ARTIFACT_CHALICE3 :
ItemSpriteSheet.ARTIFACT_CHALICE1));
}
} );
}
};
challengeButton.leftJustify = true;
challengeButton.icon(new ItemSprite(SPDSettings.challenges() > 0 ? ItemSpriteSheet.ARTIFACT_CHALICE3 :
ItemSpriteSheet.ARTIFACT_CHALICE1));
add(challengeButton);
buttons.add(challengeButton);
StyledButton hardButton = new StyledButton(Chrome.Type.RED_BUTTON, Messages.get(WndStartGame.class,
"hard"), 5){
@Override
protected void onClick() {
ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) {
public void onBackPressed() {
super.onBackPressed();
icon(Icons.get(SPDSettings.challenges() > 0 ? Icons.CHALLENGE_ON : Icons.CHALLENGE_OFF));
}
} );
}
};
hardButton.leftJustify = true;
hardButton.active = false;
hardButton.icon(new ItemSprite(ItemSpriteSheet.ARTIFACT_HOURGLASS, null));
hardButton.alpha(0.5f);
add(hardButton);
buttons.add(hardButton);
StyledButton csbutton = new StyledButton(Chrome.Type.RED_BUTTON, Messages.get(WndStartGame.class,
"news"), 5){
@Override
protected void onClick() {
ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) {
public void onBackPressed() {
super.onBackPressed();
icon(Icons.get(SPDSettings.challenges() > 0 ? Icons.CHALLENGE_ON : Icons.CHALLENGE_OFF));
}
} );
}
};
csbutton.leftJustify = true;
csbutton.active = false;
csbutton.icon(new ItemSprite(ItemSpriteSheet.ARTIFACT_SPELLBOOK, null));
csbutton.alpha(0.5f);
add(csbutton);
buttons.add(csbutton);
}
}
@Override
protected void layout() {
super.layout();
bg.x = x;
bg.y = y;
int width = 0;
for (StyledButton btn : buttons){
if (width < btn.reqWidth()) width = (int)btn.reqWidth();
}
width += bg.marginHor();
int top = (int)y + bg.marginTop() - 1;
int i = 0;
for (StyledButton btn : buttons){
btn.setRect(x+bg.marginLeft(), top, width - bg.marginHor(), 16);
top = (int)btn.bottom();
if (i < spacers.size()) {
spacers.get(i).size(btn.width(), 1);
spacers.get(i).x = btn.left();
spacers.get(i).y = PixelScene.align(btn.bottom()-0.5f);
i++;
}
}
this.width = width;
this.height = top+bg.marginBottom()-y-1;
bg.size(this.width, this.height);
}
}
private GameOptions optionsPane;
public WndStartGame(final int slot){
Badges.loadGlobal();
@ -116,38 +254,21 @@ public class WndStartGame extends Window {
start.setRect(0, HEIGHT - 20, WIDTH, 20);
add(start);
if (DeviceCompat.isDebug() || Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_1)){
IconButton challengeButton = new IconButton(
Icons.get( SPDSettings.challenges() > 0 ? Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF)){
@Override
protected void onClick() {
ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) {
public void onBackPressed() {
super.onBackPressed();
if (parent != null) {
icon(Icons.get(SPDSettings.challenges() > 0 ?
Icons.CHALLENGE_ON : Icons.CHALLENGE_OFF));
}
}
} );
}
@Override
public void update() {
if( !visible && GamesInProgress.selectedClass != null){
visible = true;
}
super.update();
}
};
challengeButton.setRect(WIDTH - 20, HEIGHT - 20, 20, 20);
challengeButton.visible = false;
add(challengeButton);
} else {
Dungeon.challenges = 0;
SPDSettings.challenges(0);
}
optionsPane = new GameOptions(){
public void update() {
if( !visible && GamesInProgress.selectedClass != null){
visible = true;
}
super.update();
}
};
optionsPane.layout();
optionsPane.setRect(WIDTH-50, HEIGHT-120, 20, 20);
optionsPane.visible = false;
add(optionsPane);
resize(WIDTH, HEIGHT);
@ -285,6 +406,24 @@ public class WndStartGame extends Window {
Telnetsc.setSize(BTN_SIZE, BTN_SIZE);
add(Telnetsc);
/*Rename = new IconButton(
Icons.get( Icons.INFO)){
@Override
protected void onClick() {
}
@Override
public void update() {
if( !visible && GamesInProgress.selectedClass != null){
visible = true;
}
super.update();
}
};
Rename.setSize(BTN_SIZE, BTN_SIZE);
Rename.visible = false;
add(Rename);*/
name = PixelScene.renderTextBlock(12);
add(name);
@ -295,21 +434,30 @@ public class WndStartGame extends Window {
protected void layout() {
super.layout();
avatar.x = x;
avatar.x = x-15;
avatar.y = y + (height - avatar.height() - name.height() - 4)/2f;
PixelScene.align(avatar);
name.setPos(
x + (avatar.width() - name.width())/2f,
x-10 + (avatar.width() - name.width())/2f,
avatar.y + avatar.height() + 3
);
PixelScene.align(name);
heroItem.setPos(x + width - BTN_SIZE, y);
heroLoadout.setPos(x + width - BTN_SIZE, heroItem.bottom());
heroMisc.setPos(x + width - BTN_SIZE, heroLoadout.bottom());
heroSubclass.setPos(x + width - BTN_SIZE, heroMisc.bottom());
Telnetsc.setPos(x + width - BTN_SIZE, heroSubclass.bottom());
heroItem.setPos(0 + (name.width()/60f),
name.y + name.height() + 3);
heroLoadout.setPos(25 + (name.width()/60f),
name.y + name.height() + 3);
heroMisc.setPos(50 + (name.width()/60f),
name.y + name.height() + 3);
heroSubclass.setPos(75 + (name.width()/60f),
name.y + name.height() + 3);
Telnetsc.setPos(100 + (name.width()/60f),
name.y + name.height() + 3);;
}
@Override

View File

@ -19,25 +19,27 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.ui;
package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.noosa.TextInput;
import com.watabou.utils.DeviceCompat;
public class WndTextInput extends Window {
private static final int WIDTH = 120;
private static final int W_LAND_MULTI = 200; //in the specific case of multiline in landscape
private static final int WIDTH = 130;
private static final int W_LAND_EXTRA = 200; //extra width is sometimes used in landscape
private static final int MARGIN = 2;
private static final int BUTTON_HEIGHT = 16;
private TextInput textBox;
protected TextInput textBox;
public WndTextInput(final String title, final String initialValue, final int maxLength,
final boolean multiLine, final String posTxt, final String negTxt) {
public WndTextInput(final String title, final String body, final int maxLength,
final boolean multiLine, final String posTxt, final String negTxt) {
super();
//need to offset to give space for the soft keyboard
@ -50,17 +52,32 @@ public class WndTextInput extends Window {
}
final int width;
if (PixelScene.landscape() && multiLine) {
width = W_LAND_MULTI; //more editing space for landscape users
if (PixelScene.landscape() && (multiLine || body != null)) {
width = W_LAND_EXTRA; //more space for landscape users
} else {
width = WIDTH;
}
final RenderedTextBlock txtTitle = PixelScene.renderTextBlock(title, 9);
txtTitle.maxWidth(width);
txtTitle.hardlight(Window.TITLE_COLOR);
txtTitle.setPos((width - txtTitle.width()) / 2, 2);
add(txtTitle);
float pos = 2;
if (title != null) {
final RenderedTextBlock txtTitle = PixelScene.renderTextBlock(title, 9);
txtTitle.maxWidth(width);
txtTitle.hardlight(Window.TITLE_COLOR);
txtTitle.setPos((width - txtTitle.width()) / 2, 2);
add(txtTitle);
pos = txtTitle.bottom() + 2 * MARGIN;
}
if (body != null) {
final RenderedTextBlock txtBody = PixelScene.renderTextBlock(body, 6);
txtBody.maxWidth(width);
txtBody.setPos(0, pos);
add(txtBody);
pos = txtBody.bottom() + 2 * MARGIN;
}
int textSize = (int)PixelScene.uiCamera.zoom * (multiLine ? 6 : 9);
textBox = new TextInput(Chrome.get(Chrome.Type.TOAST_WHITE), multiLine, textSize){
@ -71,11 +88,8 @@ public class WndTextInput extends Window {
hide();
}
};
if (initialValue != null) textBox.setText(initialValue);
textBox.setMaxLength(maxLength);
float pos = txtTitle.bottom() + 2 * MARGIN;
//sets different height depending on whether this is a single or multi line input.
final float inputHeight;
if (multiLine) {

View File

@ -9,5 +9,5 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro
# When configured, Gradle will run in incubating parallel mode.
# 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
org.gradle.parallel=true
android.useAndroidX=true
android.useAndroidX=true
android.enableJetifier=true