Fixed More bug
|
@ -63,23 +63,14 @@ dependencies {
|
|||
implementation project(':core')
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:31.4.0')
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:31.4.0')
|
||||
// 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
|
||||
|
||||
//接入多DEX
|
||||
|
@ -89,6 +80,9 @@ dependencies {
|
|||
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||
|
||||
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"
|
||||
|
@ -102,6 +96,7 @@ dependencies {
|
|||
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
|
||||
|
||||
//修复小米手表与低安卓系统的WebView冲突兼容问题
|
||||
//noinspection GradleDependency
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ 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;
|
||||
|
@ -47,6 +48,8 @@ public class AndroidGame extends AndroidApplication {
|
|||
|
||||
public static AndroidApplication instance;
|
||||
|
||||
public FirebaseAnalytics mFirebaseAnalytics;
|
||||
|
||||
private static AndroidPlatformSupport support;
|
||||
|
||||
@Override
|
||||
|
@ -74,6 +77,9 @@ public class AndroidGame extends AndroidApplication {
|
|||
News.service = NewsImpl.getNewsService();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
FileUtils.setDefaultFileProperties(Files.FileType.Local, "");
|
||||
|
||||
// grab preferences directly using our instance first
|
||||
|
@ -84,11 +90,9 @@ public class AndroidGame extends AndroidApplication {
|
|||
//UCEHandler.Builder builder = new UCEHandler.Builder(this);
|
||||
//builder.build();
|
||||
|
||||
// mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
|
||||
//
|
||||
// FirebaseCrashlytics.getInstance().setUserId(SPDSettings.customSeed());
|
||||
//
|
||||
// FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
instance = this;
|
||||
|
|
13
build.gradle
|
@ -1,7 +1,7 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
|
@ -18,8 +18,8 @@ allprojects {
|
|||
appName = 'Magic Ling Pixel Dungeon'
|
||||
appPackageName = 'com.ansdomagiclingpixeldungeon.ling'
|
||||
|
||||
appVersionCode =900926
|
||||
appVersionName = '0.6.3.0-Beta5.1'
|
||||
appVersionCode =900927
|
||||
appVersionName = '0.6.3.0-Beta5.2'
|
||||
|
||||
appJavaCompatibility = JavaVersion.VERSION_11
|
||||
|
||||
|
@ -34,9 +34,8 @@ allprojects {
|
|||
version = appVersionName
|
||||
|
||||
repositories {
|
||||
maven{ url 'https://maven.aliyun.com/repository/google' }
|
||||
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
|
||||
maven { url 'https://jitpack.io' }
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
||||
}
|
|
@ -5,6 +5,26 @@ sourceCompatibility = targetCompatibility = appJavaCompatibility
|
|||
|
||||
dependencies {
|
||||
api project(':SPD-classes')
|
||||
//TODO might be nice to remove this, should decide
|
||||
implementation project(':services')
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
|
||||
implementation "org.slf4j:slf4j-simple:1.7.25"
|
||||
implementation 'io.ktor:ktor-client-core-jvm:2.3.0'
|
||||
implementation 'io.ktor:ktor-client-okhttp-jvm:2.3.0'
|
||||
implementation 'io.ktor:ktor-client-logging-jvm:2.3.0'
|
||||
implementation 'io.ktor:ktor-client-content-negotiation:2.3.0'
|
||||
implementation 'io.ktor:ktor-serialization-kotlinx-json:2.3.0'
|
||||
}
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.8.10'
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 36 KiB |
BIN
core/src/main/assets/environment/tiles_ancient.png
Normal file
After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 29 KiB |
BIN
core/src/main/assets/environment/water5.png
Normal file
After Width: | Height: | Size: 944 B |
|
@ -1,5 +1,9 @@
|
|||
#####MLPD-P3文本
|
||||
|
||||
actors.mobs.bosses.sakafishboss.name=”远古意志“\n萨卡班甲鱼
|
||||
actors.mobs.bosses.sakafishboss.desc=曾经远古时代的海洋王者,因为不可避免的末日来临时,潜入了地底的阴暗水潭进入了沉睡。想着有朝一日回到大海,然而地牢的魔力和陆上的变化,它再也不可能回到那片理想的海洋。
|
||||
|
||||
|
||||
actors.hero.hero.heartdied=死亡不是终点,而是新的开始。
|
||||
|
||||
actors.buffs.stormclouddied.name=闪电链式反应
|
||||
|
|
BIN
core/src/main/assets/music/Boss-Saka.ogg
Normal file
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 5.0 KiB |
|
@ -57,18 +57,20 @@ public class Assets {
|
|||
|
||||
public static final String TILES_SEWERS = "environment/tiles_sewers.png";
|
||||
public static final String TILES_PRISON = "environment/tiles_prison.png";
|
||||
|
||||
public static final String TILES_COLDCHEST = "environment/tiles_coldchest.png";
|
||||
public static final String TILES_CAVES = "environment/tiles_caves.png";
|
||||
public static final String TILES_CITY = "environment/tiles_city.png";
|
||||
public static final String TILES_ANCIENT = "environment/tiles_ancient.png";
|
||||
public static final String TILES_HALLS = "environment/tiles_halls.png";
|
||||
|
||||
public static final String WATER_SEWERS = "environment/water0.png";
|
||||
public static final String WATER_PRISON = "environment/water1.png";
|
||||
public static final String WATER_CAVES = "environment/water2.png";
|
||||
public static final String WATER_CITY = "environment/water3.png";
|
||||
public static final String WATER_HALLS = "environment/water4.png";
|
||||
|
||||
public static final String WATER_ANCIENT = "environment/water5.png";
|
||||
|
||||
|
||||
public static final String WEAK_FLOOR = "environment/custom_tiles/weak_floor.png";
|
||||
public static final String SEWER_BOSS = "environment/custom_tiles/sewer_boss.png";
|
||||
public static final String PRISON_QUEST = "environment/custom_tiles/prison_quests.png";
|
||||
|
|
|
@ -100,6 +100,7 @@ public class Challenges {
|
|||
if (item instanceof Armor && !(item instanceof ClothArmor || item instanceof ClassArmor)) {
|
||||
//GLog.n("这片大地吃布甲之外的护甲从不挑食,侦查到作弊行为,已移除"+item);
|
||||
GLog.n(Messages.get(Challenges.class, "no_armorx"), item);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Statistics {
|
|||
public static float chalMultiplier;
|
||||
public static int totalScore;
|
||||
|
||||
public static int[] bossScores = new int[5];
|
||||
public static int[] bossScores = new int[6];
|
||||
public static int highestAscent;
|
||||
public static boolean gameWon = false;
|
||||
public static boolean ascended = false;
|
||||
|
@ -174,7 +174,7 @@ public class Statistics {
|
|||
treasureScore = 0;
|
||||
floorsExplored = new SparseArray<>();
|
||||
exploreScore = 0;
|
||||
bossScores = new int[5];
|
||||
bossScores = new int[6];
|
||||
totalBossScore = 0;
|
||||
questScores = new int[5];
|
||||
totalQuestScore = 0;
|
||||
|
@ -371,7 +371,7 @@ public class Statistics {
|
|||
bundle.put( HIGHEST, highestAscent );
|
||||
exploreScore = bundle.getInt( EXPL_SCORE );
|
||||
if (bundle.contains( BOSS_SCORES )) bossScores = bundle.getIntArray( BOSS_SCORES );
|
||||
else bossScores = new int[5];
|
||||
else bossScores = new int[6];
|
||||
totalBossScore = bundle.getInt( TOT_BOSS );
|
||||
if (bundle.contains( QUEST_SCORES ))questScores = bundle.getIntArray( QUEST_SCORES );
|
||||
else questScores = new int[5];
|
||||
|
|
|
@ -80,8 +80,8 @@ public class Nyctophobia extends Buff implements Hero.Doom {
|
|||
return true;
|
||||
}
|
||||
if (hero.lanterfire >= 0 ) {
|
||||
hero.damageLantern(1+Dungeon.depth/5);
|
||||
spend(10f+(float) Dungeon.depth/5);
|
||||
hero.damageLantern(1+Dungeon.depth/8);
|
||||
spend(10f+(float) Dungeon.depth/8);
|
||||
} else {
|
||||
spend(STEP);
|
||||
}
|
||||
|
|
|
@ -1967,7 +1967,7 @@ public class Hero extends Char {
|
|||
//灯火值低于35死亡生成自己的邪恶面,并清空金币,将金币保存到json文件。(灵感:空洞骑士)
|
||||
for (Ankh i : belongings.getAllItems(Ankh.class)) {
|
||||
if (ankh == null || i.isBlessed()) {
|
||||
if (lanterfireactive && hero.lanterfire <= 35 && !i.isBlessed()) {
|
||||
if (lanterfireactive && hero.lanterfire <= 30 && !i.isBlessed()) {
|
||||
BlackSoul s = new BlackSoul();
|
||||
s.pos = Dungeon.hero.pos;
|
||||
s.gold = Dungeon.gold;
|
||||
|
|
|
@ -299,6 +299,7 @@ public enum HeroClass {
|
|||
MagesStaff staff;
|
||||
|
||||
staff = new MagesStaff(new WandOfMagicMissile());
|
||||
staff.upgrade();
|
||||
(hero.belongings.weapon = staff).identify().level(1);
|
||||
hero.belongings.weapon.activate(hero);
|
||||
|
||||
|
|
|
@ -53,12 +53,12 @@ public class Rat extends Mob {
|
|||
public int damageRoll() {
|
||||
return Random.NormalIntRange( 1, 4 );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int attackSkill( Char target ) {
|
||||
return 8;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int drRoll() {
|
||||
return Random.NormalIntRange(0, 1);
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.AQUAPHOBIA;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.RLPT;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.SBSG;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Conducts;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
|
@ -75,15 +69,14 @@ public class YogReal extends Boss {
|
|||
{
|
||||
initProperty();
|
||||
initBaseStatus(0, 0, 1, 0, 1200, 0, 0);
|
||||
initStatus(500);
|
||||
HP=800;
|
||||
HT=800;
|
||||
initStatus(666);
|
||||
|
||||
spriteClass = YogSprite.class;
|
||||
properties.add(Property.IMMOVABLE);
|
||||
properties.add(Property.DEMONIC);
|
||||
|
||||
//see all the map
|
||||
viewDistance = 16;
|
||||
viewDistance = 99;
|
||||
state=HUNTING;
|
||||
}
|
||||
|
||||
|
@ -148,7 +141,7 @@ public class YogReal extends Boss {
|
|||
int spawnPos = -1;
|
||||
for (int i : PathFinder.NEIGHBOURS8){
|
||||
if (Actor.findChar(pos+i) == null){
|
||||
if (spawnPos == -1 || Dungeon.level.trueDistance(Dungeon.hero.pos, spawnPos) > Dungeon.level.trueDistance(Dungeon.hero.pos, pos+i)){
|
||||
if (spawnPos == -1 || Dungeon.level.trueDistance(hero.pos, spawnPos) > Dungeon.level.trueDistance(hero.pos, pos+i)){
|
||||
spawnPos = pos + i;
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +151,7 @@ public class YogReal extends Boss {
|
|||
summon.pos = spawnPos;
|
||||
GameScene.add( summon );
|
||||
Actor.addDelayed( new Pushing( summon, pos, summon.pos ), -1 );
|
||||
summon.beckon(Dungeon.hero.pos);
|
||||
summon.beckon(hero.pos);
|
||||
success = true;
|
||||
}
|
||||
|
||||
|
@ -178,7 +171,7 @@ public class YogReal extends Boss {
|
|||
//find nearest
|
||||
for (int i : candidates){
|
||||
if (Actor.findChar(i) == null){
|
||||
if (spawnPos == -1 || Dungeon.level.trueDistance(Dungeon.hero.pos, spawnPos) > Dungeon.level.trueDistance(Dungeon.hero.pos, i)){
|
||||
if (spawnPos == -1 || Dungeon.level.trueDistance(hero.pos, spawnPos) > Dungeon.level.trueDistance(hero.pos, i)){
|
||||
spawnPos = i;
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +181,7 @@ public class YogReal extends Boss {
|
|||
summon.pos = spawnPos;
|
||||
GameScene.add( summon );
|
||||
CellEmitter.get(spawnPos).start(ElmoParticle.FACTORY, 0.05f, 20);
|
||||
summon.beckon(Dungeon.hero.pos);
|
||||
summon.beckon(hero.pos);
|
||||
success = true;
|
||||
}
|
||||
|
||||
|
@ -213,7 +206,7 @@ public class YogReal extends Boss {
|
|||
Buff.detach(this, YogScanRound.class);
|
||||
int skill = Random.chances(skillBalance);
|
||||
if (skill == 0) {
|
||||
Char enemy = (this.enemy == null ? Dungeon.hero : this.enemy);
|
||||
Char enemy = (this.enemy == null ? hero : this.enemy);
|
||||
int w = Dungeon.level.width();
|
||||
int dx = enemy.pos % w - pos % w;
|
||||
int dy = enemy.pos / w - pos / w;
|
||||
|
@ -234,7 +227,7 @@ public class YogReal extends Boss {
|
|||
beamCD = 20 + count - (phase == 5?19:0);
|
||||
skillBalance[skill] /= 2.25f;
|
||||
}
|
||||
Dungeon.hero.interrupt();
|
||||
hero.interrupt();
|
||||
if(skillBalance[0] < 0.1f){
|
||||
skillBalance[0] = skillBalance[1] = skillBalance[2] = 100f;
|
||||
}
|
||||
|
@ -245,8 +238,8 @@ public class YogReal extends Boss {
|
|||
private void actSummonFist(){
|
||||
//vfx
|
||||
Dungeon.level.viewDistance = Math.max(1, Dungeon.level.viewDistance-1);
|
||||
if (Dungeon.hero.buff(Light.class) == null){
|
||||
Dungeon.hero.viewDistance = Dungeon.level.viewDistance;
|
||||
if (hero.buff(Light.class) == null){
|
||||
hero.viewDistance = Dungeon.level.viewDistance;
|
||||
}
|
||||
Dungeon.observe();
|
||||
GLog.n(Messages.get(this, "darkness"));
|
||||
|
@ -256,7 +249,7 @@ public class YogReal extends Boss {
|
|||
int dist = Dungeon.level.distance(pos, ch.pos);
|
||||
if(dist <= 4 && dist > 0){
|
||||
Ballistica ba = HitBack.bounceBack(ch, this);
|
||||
WandOfBlastWave.throwChar(ch, ba, 10 - 2 * dist, false, false, getClass());
|
||||
WandOfBlastWave.throwChar(ch, ba, 10 - 2 * dist, true, false, YogReal.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +263,6 @@ public class YogReal extends Boss {
|
|||
candidates[n]=prev;
|
||||
}
|
||||
|
||||
|
||||
for(int i=0;i<phase-1;++i) {
|
||||
YogRealFirst fist = (YogRealFirst) Reflection.newInstance(fistSummons.remove(0));
|
||||
fist.pos = pos + candidates[i];
|
||||
|
@ -281,9 +273,9 @@ public class YogReal extends Boss {
|
|||
|
||||
}
|
||||
// 6, 9, 12 enemies on destroy.
|
||||
private static final int[] destroySummon_1 = {3, 2, 1};
|
||||
private static final int[] destroySummon_2 = {3, 3, 3};
|
||||
private static final int[] destroySummon_3 = {0, 6, 6};
|
||||
private static final int[] destroySummon_1 = {3, 2, 0};
|
||||
private static final int[] destroySummon_2 = {3, 2, 2};
|
||||
private static final int[] destroySummon_3 = {2, 4, 4};
|
||||
|
||||
private void actDestroy(){
|
||||
if(findFist() == null && phase > destroyed + 1 && phase <= 4) {
|
||||
|
@ -353,16 +345,16 @@ public class YogReal extends Boss {
|
|||
|
||||
@Override
|
||||
protected boolean act() {
|
||||
|
||||
for (Buff buff : hero.buffs()) {
|
||||
if (buff instanceof RoseShiled) {
|
||||
buff.detach();
|
||||
//GLog.b("玫瑰结界的创始人是翼绫,你怎么敢用她的技能?/kill @e[type=RoseShiled] enemy!");
|
||||
}
|
||||
if (buff instanceof HaloFireImBlue ||buff instanceof FireImbue) {
|
||||
buff.detach();
|
||||
//GLog.b("你想免疫火的伤害?在我这里,没有可能!/kill @e[type=FireImbue=All] enemy!");
|
||||
}
|
||||
}
|
||||
|
||||
//char logic
|
||||
if (fieldOfView == null || fieldOfView.length != Dungeon.level.length()){
|
||||
fieldOfView = new boolean[Dungeon.level.length()];
|
||||
|
@ -374,7 +366,7 @@ public class YogReal extends Boss {
|
|||
//mob logic
|
||||
enemy = chooseEnemy();
|
||||
|
||||
if(enemy == null) enemy = Dungeon.hero;
|
||||
if(enemy == null) enemy = hero;
|
||||
|
||||
enemySeen = enemy != null && enemy.isAlive() && fieldOfView[enemy.pos] && enemy.invisible <= 0;
|
||||
//end of char/mob logic
|
||||
|
@ -384,7 +376,7 @@ public class YogReal extends Boss {
|
|||
actDestroy();
|
||||
|
||||
if (phase == 0){
|
||||
if (Dungeon.hero.viewDistance >= Dungeon.level.distance(pos, Dungeon.hero.pos)) {
|
||||
if (hero.viewDistance >= Dungeon.level.distance(pos, hero.pos)) {
|
||||
Dungeon.observe();
|
||||
}
|
||||
if (Dungeon.level.heroFOV[pos]) {
|
||||
|
@ -410,12 +402,6 @@ public class YogReal extends Boss {
|
|||
damage = 25;
|
||||
}
|
||||
}
|
||||
if (damage >= 380){
|
||||
damage = 380 + (int)(Math.sqrt(4*(damage - 14) + 1) - 1)/2;
|
||||
hero.HT = 25;
|
||||
Buff.affect(hero, Degrade.class, 12f);
|
||||
}
|
||||
|
||||
|
||||
if(src instanceof Buff || src instanceof Blob){
|
||||
damage = Math.max(0, damage-1);
|
||||
|
@ -424,7 +410,7 @@ public class YogReal extends Boss {
|
|||
int preHP = HP;
|
||||
super.damage(damage, src);
|
||||
int postHP = HP;
|
||||
int threshold = 800-200*phase;
|
||||
int threshold = 1200-300*phase;
|
||||
if(preHP > threshold && postHP<=threshold){
|
||||
HP = threshold;
|
||||
++phase;
|
||||
|
@ -436,11 +422,11 @@ public class YogReal extends Boss {
|
|||
summonCD -= dmgTaken / 8f + 1f;
|
||||
}
|
||||
|
||||
if(HP<=200){
|
||||
if(HP<=600){
|
||||
BossHealthBar.bleed(true);
|
||||
}
|
||||
|
||||
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
||||
LockedFloor lock = hero.buff(LockedFloor.class);
|
||||
if (lock != null) lock.addTime(dmgTaken);
|
||||
|
||||
}
|
||||
|
@ -476,44 +462,16 @@ public class YogReal extends Boss {
|
|||
@Override
|
||||
public void die( Object cause ) {
|
||||
GameScene.flash(0x80FFFFFF);
|
||||
actScanning();
|
||||
actSummon();
|
||||
Statistics.bossScores[4] += 15000;
|
||||
actDestroy();
|
||||
if (Dungeon.isDLC(Conducts.Conduct.BOSSRUSH)) {
|
||||
|
||||
GetBossLoot();
|
||||
}
|
||||
for (Mob mob : (Iterable<Mob>)Dungeon.level.mobs.clone()) {
|
||||
if (mob instanceof Larva
|
||||
|| mob instanceof RipperDemon
|
||||
||mob instanceof Scorpio
|
||||
||mob instanceof Succubus) {
|
||||
if (mob.alignment == Alignment.ENEMY && mob != this) {
|
||||
mob.die( cause );
|
||||
}
|
||||
}
|
||||
|
||||
if(Dungeon.isChallenged(RLPT)){
|
||||
Badges.GOODRLPT();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(Dungeon.isChallenged(SBSG)){
|
||||
Badges.BIGX();
|
||||
}
|
||||
|
||||
if(Dungeon.isChallenged(EXSG)){
|
||||
Badges.EXSG();
|
||||
}
|
||||
|
||||
if(Dungeon.isChallenged(AQUAPHOBIA)){
|
||||
Badges.CLEARWATER();
|
||||
}
|
||||
|
||||
Dungeon.level.viewDistance = 4;
|
||||
if (Dungeon.hero.buff(Light.class) == null){
|
||||
Dungeon.hero.viewDistance = Dungeon.level.viewDistance;
|
||||
if (hero.buff(Light.class) == null){
|
||||
hero.viewDistance = Dungeon.level.viewDistance;
|
||||
}
|
||||
|
||||
for(int i=0;i<4;++i){
|
||||
|
@ -571,7 +529,7 @@ public class YogReal extends Boss {
|
|||
regularSummons.clear();
|
||||
Collections.addAll(regularSummons, b.getClassArray("REGULAR_SUMMONS"));
|
||||
if(phase>0) BossHealthBar.assignBoss(this);
|
||||
if (HP < 200) BossHealthBar.bleed(true);
|
||||
if (HP < 600) BossHealthBar.bleed(true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -619,11 +577,7 @@ public class YogReal extends Boss {
|
|||
}
|
||||
|
||||
//used so death to yog's ripper demons have their own rankings description and are more aggro
|
||||
public static class YogRealRipper extends BlackHost {
|
||||
{
|
||||
maxLvl = -999;
|
||||
viewDistance = 8;
|
||||
}
|
||||
public static class YogRealRipper extends RipperDemon {
|
||||
@Override
|
||||
public void damage(int dmg, Object src){
|
||||
if(Dungeon.level.distance(pos, YogGodHardBossLevel.CENTER)<=4){
|
||||
|
@ -641,7 +595,7 @@ public class YogReal extends Boss {
|
|||
@Override
|
||||
public void damage(int dmg, Object src){
|
||||
if(Dungeon.level.distance(pos, YogGodHardBossLevel.CENTER)<=4){
|
||||
dmg = Math.max(dmg/3, 2);
|
||||
dmg = Math.max(dmg/6, 2);
|
||||
}
|
||||
super.damage(dmg, src);
|
||||
}
|
||||
|
@ -693,7 +647,6 @@ public class YogReal extends Boss {
|
|||
@Override
|
||||
public boolean act(){
|
||||
spend(TICK);
|
||||
|
||||
if(left > 0){
|
||||
renderWarning((direction & 2) == 0, (direction & 1) != 0);
|
||||
--left;
|
||||
|
@ -774,8 +727,9 @@ public class YogReal extends Boss {
|
|||
if(ch.alignment == Alignment.ENEMY) return 0;
|
||||
ch.damage( Random.Int(50, 80), YogReal.class );
|
||||
ch.sprite.centerEmitter().burst( PurpleParticle.BURST, Random.IntRange( 5, 10 ) );
|
||||
Statistics.bossScores[5] -= 500;
|
||||
ch.sprite.flash();
|
||||
if(ch == Dungeon.hero){
|
||||
if(ch == hero){
|
||||
Sample.INSTANCE.play(Assets.Sounds.BLAST, Random.Float(1.1f, 1.5f));
|
||||
Buff.affect(ch, Degrade.class, 50f);
|
||||
if(!ch.isAlive()) Dungeon.fail(getClass());
|
||||
|
@ -857,11 +811,10 @@ public class YogReal extends Boss {
|
|||
public int onHitProc(Char ch) {
|
||||
if (ch.alignment == Alignment.ENEMY) return 0;
|
||||
ch.damage(Random.Int(40, 70), YogReal.class);
|
||||
Statistics.bossScores[3] -= 500;
|
||||
ch.sprite.centerEmitter().burst(RainbowParticle.BURST, Random.Int(20, 35));
|
||||
ch.sprite.flash();
|
||||
Buff.affect(ch, Blindness.class, 50f);
|
||||
if (ch == Dungeon.hero) {
|
||||
if (ch == hero) {
|
||||
Sample.INSTANCE.play(Assets.Sounds.BLAST, Random.Float(1.1f, 1.5f));
|
||||
if (!ch.isAlive()) Dungeon.fail(getClass());
|
||||
}
|
||||
|
@ -931,10 +884,9 @@ public class YogReal extends Boss {
|
|||
if (ch != null) {
|
||||
if (ch.alignment == Alignment.ENEMY) continue;
|
||||
ch.damage(Random.Int(30, 50), YogReal.class);
|
||||
Statistics.bossScores[3] -= 500;
|
||||
Buff.affect(ch, Blindness.class, 5f);
|
||||
ch.sprite.flash();
|
||||
if (ch == Dungeon.hero) {
|
||||
if (ch == hero) {
|
||||
Sample.INSTANCE.play(Assets.Sounds.BLAST, Random.Float(0.9f, 1.1f));
|
||||
if (!ch.isAlive()) Dungeon.fail(getClass());
|
||||
}
|
||||
|
@ -959,7 +911,7 @@ public class YogReal extends Boss {
|
|||
private void findTarget(){
|
||||
lastAim = aim;
|
||||
//I can't get char.enemy from target, it's protected!
|
||||
aim = Dungeon.hero.pos;
|
||||
aim = hero.pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -981,4 +933,4 @@ public class YogReal extends Boss {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -92,6 +92,7 @@ public class CrivusFruits extends Mob {
|
|||
@Override
|
||||
public void detach() {
|
||||
super.detach();
|
||||
//遍历楼层生物,寻找CrivusFruits执行扣血,在触手死亡时强制扣除本体CrivusFruits
|
||||
for (Mob m : Dungeon.level.mobs){
|
||||
if (m instanceof CrivusFruits){
|
||||
m.damage((int)7.5, this);
|
||||
|
|
|
@ -1,4 +1,22 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.actors.mobs.bosses;
|
||||
|
||||
public class SakaFishBoss {
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Boss;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.SakaFishBossSprites;
|
||||
|
||||
public class SakaFishBoss extends Boss {
|
||||
|
||||
{
|
||||
spriteClass = SakaFishBossSprites.class;
|
||||
initBaseStatus(19, 25, 6, 0, 700, 5, 12);
|
||||
state = SLEEPING;
|
||||
initProperty();
|
||||
initStatus(76);
|
||||
HP=700;
|
||||
defenseSkill = 10;
|
||||
HT=700;
|
||||
baseSpeed=1.5f;
|
||||
viewDistance = 30;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class LostBackpack extends Item {
|
|||
|
||||
{
|
||||
image = ItemSpriteSheet.LOSTBAG;
|
||||
|
||||
stackable = false;
|
||||
unique = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class OilLantern extends Item {
|
|||
private static final String CHARGE = "charge";
|
||||
private static final String FLASKS = "flasks";
|
||||
|
||||
private static final int MAX_CHARGE = 30;
|
||||
private static final int MAX_CHARGE = 60;
|
||||
private static final float TIME_TO_USE = 2.0f;
|
||||
|
||||
private static final String TXT_STATUS = "%d%%";
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.bosses.SakaFishBoss;
|
||||
|
||||
public class AncientMysteryCityBossLevel extends Level{
|
||||
|
||||
|
||||
@Override
|
||||
public String tilesTex() {
|
||||
return Assets.Environment.TILES_ANCIENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String waterTex() {
|
||||
return Assets.Environment.WATER_ANCIENT;
|
||||
}
|
||||
|
||||
private static int WIDTH = 27;
|
||||
private static int HEIGHT = 32;
|
||||
|
||||
private static final short W = Terrain.WALL;
|
||||
private static final short D = Terrain.WALL_DECO;
|
||||
private static final short L = Terrain.EMPTY_SP;
|
||||
private static final short R = Terrain.WATER;
|
||||
private static final short E = Terrain.STATUE;
|
||||
private static final short C = Terrain.HIGH_GRASS;
|
||||
private static final short M = Terrain.CRYSTAL_DOOR;
|
||||
private static final short G = Terrain.LOCKED_DOOR;
|
||||
|
||||
private static final short K = Terrain.WELL;
|
||||
|
||||
private static final short S = Terrain.BOOKSHELF;
|
||||
|
||||
private static final int[] WorldRoomShort = {
|
||||
L,L,L,L,L,L,L,L,L,L,L,L,W,W,W,L,L,L,L,L,L,L,L,L,L,L,L,
|
||||
L,R,R,R,R,R,R,L,R,R,R,D,E,R,E,W,R,R,R,L,R,R,R,R,R,R,L,
|
||||
L,R,L,L,L,R,R,L,R,R,W,W,R,R,R,W,D,R,R,L,R,R,L,L,L,R,L,
|
||||
L,R,L,L,R,R,L,L,R,W,W,R,R,C,R,R,W,W,R,L,L,R,R,L,L,R,L,
|
||||
L,R,L,R,R,L,L,R,D,W,E,R,C,L,C,R,E,W,D,R,L,L,R,R,L,R,L,
|
||||
L,R,R,R,L,L,R,W,W,R,R,C,L,R,L,C,R,R,W,W,R,L,L,R,R,R,L,
|
||||
L,R,R,L,L,R,R,W,R,R,C,L,R,R,R,L,C,R,R,W,R,R,L,L,R,R,L,
|
||||
L,L,L,L,R,R,W,E,R,R,R,C,L,R,L,C,R,R,R,E,W,R,R,L,L,L,L,
|
||||
L,R,R,R,R,D,W,R,R,R,R,R,C,L,C,R,R,R,R,R,W,W,R,R,R,R,L,
|
||||
L,R,R,R,R,W,W,W,D,W,D,W,W,M,W,D,W,D,W,W,W,W,R,R,R,R,L,
|
||||
L,R,R,R,W,D,E,C,R,R,R,R,R,R,R,R,R,R,R,R,E,D,W,R,R,R,L,
|
||||
L,R,R,W,W,W,K,R,R,R,R,R,R,R,R,R,R,R,R,R,R,W,W,W,R,R,L,
|
||||
L,R,W,W,W,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,W,W,W,R,L,
|
||||
L,D,W,D,E,R,R,W,R,R,R,R,R,R,R,R,R,R,R,W,R,R,E,W,D,W,L,
|
||||
L,W,W,E,R,R,W,W,W,R,R,R,R,R,R,R,R,R,W,W,W,R,R,E,W,W,L,
|
||||
L,W,D,C,R,R,R,W,R,R,R,R,R,R,R,R,R,R,R,W,R,R,R,C,W,W,L,
|
||||
L,W,W,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,D,W,L,
|
||||
L,W,D,C,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,C,W,W,L,
|
||||
L,W,W,E,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,D,W,W,L,
|
||||
L,R,W,D,E,R,R,W,R,R,R,R,R,R,R,R,R,R,R,W,R,R,D,D,W,R,L,
|
||||
L,R,R,W,W,R,W,W,W,R,R,R,R,R,R,R,R,R,W,W,W,R,W,W,R,R,L,
|
||||
L,R,R,R,W,R,R,W,R,R,R,R,R,R,R,R,R,R,R,W,R,R,W,R,R,R,L,
|
||||
L,L,L,L,W,W,R,R,R,R,R,R,R,R,R,R,R,R,R,R,K,D,W,L,L,L,L,
|
||||
L,R,R,L,L,W,E,C,R,R,R,R,R,R,R,R,R,R,R,C,E,W,L,L,R,R,L,
|
||||
L,R,R,R,L,W,W,D,R,R,R,R,R,R,R,R,R,R,R,D,W,W,L,R,R,R,L,
|
||||
L,R,L,R,L,W,W,W,W,W,W,W,W,G,W,W,W,W,W,W,W,W,L,R,L,R,L,
|
||||
L,R,R,R,L,R,R,W,L,R,R,R,E,L,E,R,R,R,R,W,R,R,L,R,R,R,L,
|
||||
L,L,R,L,L,R,W,W,W,L,R,S,S,L,S,S,R,L,W,W,W,R,L,L,R,L,L,
|
||||
L,L,L,L,R,R,W,L,L,W,R,W,E,L,E,W,R,W,L,L,W,R,R,L,L,L,L,
|
||||
L,R,R,R,R,W,W,D,W,W,D,W,W,L,W,W,W,W,W,D,W,W,R,R,R,R,L,
|
||||
L,R,R,R,W,D,W,W,D,W,W,W,W,W,W,W,D,W,W,W,W,D,W,R,R,R,L,
|
||||
L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,
|
||||
|
||||
};
|
||||
|
||||
@Override
|
||||
protected boolean build() {
|
||||
setSize(WIDTH, HEIGHT);
|
||||
map = WorldRoomShort.clone();
|
||||
entrance = WIDTH*28+13;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
protected void createMobs() {
|
||||
SakaFishBoss saka= new SakaFishBoss();
|
||||
saka.pos = (WIDTH*20+13);
|
||||
mobs.add(saka);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
protected void createItems() {
|
||||
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.AQUAPHOBIA;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.SBSG;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.Dungeon.hero;
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel.Holiday.XMAS;
|
||||
|
||||
|
@ -265,7 +265,7 @@ public abstract class RegularLevel extends Level {
|
|||
}
|
||||
|
||||
if (Dungeon.NyzshopOnLevel()) {
|
||||
Buff.affect(hero, RandomBuff.class).set( (3 + Random.Int(9)+hero.STR/6+hero.HP/30)/Random.Int(1,2)+5, 1 );
|
||||
Buff.affect(hero, RandomBuff.class).set( (4 + Random.Int(9)+hero.STR/6+hero.HP/30)/Random.Int(1,2)+5, 1 );
|
||||
initRooms.add(new NyzBombAndBooksRoom());
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ public abstract class RegularLevel extends Level {
|
|||
initRooms.add(new AutoShopRoom());
|
||||
Buff.affect(hero, AutoRandomBuff.class).set((10), 1);
|
||||
}
|
||||
} else if(Dungeon.isChallenged(SBSG)){
|
||||
} else if(Dungeon.isChallenged(EXSG)){
|
||||
if(Dungeon.AutoShopLevel()) {
|
||||
initRooms.add(new AutoShopRoom());
|
||||
Buff.affect(hero, AutoRandomBuff.class).set((10), 1);
|
||||
|
|
|
@ -33,16 +33,15 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.LostBackpack;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SpecialRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStory;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
|
@ -179,12 +178,8 @@ public class InterlevelScene extends PixelScene {
|
|||
else if (loadingDepth <= 25) loadingAsset = Assets.Interfaces.LOADING_HALLS;
|
||||
else loadingAsset = Assets.Interfaces.SHADOW;
|
||||
|
||||
//slow down transition when displaying an install prompt
|
||||
if (Updates.isInstallable()){
|
||||
fadeTime += 0.9f; //adds 1 second total
|
||||
//speed up transition when debugging
|
||||
//本地调试+桌面
|
||||
} else if (DeviceCompat.isDebug() && DeviceCompat.isDesktop()){
|
||||
//本地调试+桌面
|
||||
if (DeviceCompat.isDebug() && DeviceCompat.isDesktop()){
|
||||
fadeTime = 0.1f;
|
||||
} else {
|
||||
//打包后的环境
|
||||
|
@ -525,9 +520,8 @@ public class InterlevelScene extends PixelScene {
|
|||
}
|
||||
Dungeon.hero.resurrect();
|
||||
|
||||
//todo 灯火少于30给予一个食物。
|
||||
if(lanterfireactive && hero.lanterfire <= 35){
|
||||
level.drop(new Food(), invPos);
|
||||
if(lanterfireactive && hero.lanterfire <= 30){
|
||||
GLog.n("你的遗物被上一世暗影吞噬了,它正在本层游荡,快去寻找它吧!");
|
||||
} else {
|
||||
level.drop(new LostBackpack(), invPos);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class MLPDAboutScene extends PixelScene {
|
|||
|
||||
private static String TXT_ANSDO() { return Messages.get(MLPDAboutScene.class, "txt_ansdo") + "\n冷群怪 & 奈亚子 & Delicateloong";}
|
||||
|
||||
private static String LNK_MLPD_SOURCE() { return "https://github.com/AnsdoShip/Magic-Ling-Pixel-Dungeon-Ling";}
|
||||
private static String LNK_MLPD_SOURCE() { return "https://github.com/LingASDJ/magic-ling-pixel-dungeon";}
|
||||
private static String TXT_MLPD_SOURCE() { return Messages.get(MLPDAboutScene.class,"github");}
|
||||
|
||||
private static String LNK_QQDiscord() { return Messages.get(MLPDAboutScene.class,"joinlink");}
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.news.News;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
|
||||
|
@ -341,7 +340,6 @@ public class TitleScene extends PixelScene {
|
|||
|
||||
public ChangesButton( Chrome.Type type, String label ){
|
||||
super(type, label);
|
||||
if (SPDSettings.updates()) Updates.checkForUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,128 +0,0 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2022 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.services.updates;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Updates {
|
||||
|
||||
public static UpdateService service;
|
||||
|
||||
public static boolean supportsUpdates(){
|
||||
return service != null;
|
||||
}
|
||||
|
||||
private static Date lastCheck = null;
|
||||
private static final long CHECK_DELAY = 1000*60*60; //1 hour
|
||||
|
||||
public static boolean isUpdateable(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean supportsBetaChannel(){
|
||||
return supportsUpdates() && service.supportsBetaChannel();
|
||||
}
|
||||
|
||||
public static void checkForUpdate(){
|
||||
if (!isUpdateable()) return;
|
||||
if (lastCheck != null && (new Date().getTime() - lastCheck.getTime()) < CHECK_DELAY) return;
|
||||
|
||||
//We do this so that automatically enabled beta checking (for users who DLed a beta) persists afterward
|
||||
if (SPDSettings.betas()){
|
||||
SPDSettings.betas(true);
|
||||
}
|
||||
|
||||
service.checkForUpdate(!SPDSettings.WiFi(), SPDSettings.betas(), new UpdateService.UpdateResultCallback() {
|
||||
@Override
|
||||
public void onUpdateAvailable(AvailableUpdateData update) {
|
||||
lastCheck = new Date();
|
||||
updateData = update;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNoUpdateFound() {
|
||||
lastCheck = new Date();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed() {
|
||||
lastCheck = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void launchUpdate( AvailableUpdateData data ){
|
||||
service.initializeUpdate( data );
|
||||
}
|
||||
|
||||
private static AvailableUpdateData updateData = null;
|
||||
|
||||
public static boolean updateAvailable(){
|
||||
return updateData != null;
|
||||
}
|
||||
|
||||
public static AvailableUpdateData updateData(){
|
||||
return updateData;
|
||||
}
|
||||
|
||||
public static void clearUpdate(){
|
||||
updateData = null;
|
||||
lastCheck = null;
|
||||
}
|
||||
|
||||
public static boolean isInstallable(){
|
||||
return supportsUpdates() && service.isInstallable();
|
||||
}
|
||||
|
||||
public static void launchInstall(){
|
||||
if (supportsUpdates()){
|
||||
service.initializeInstall();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean supportsReviews() {
|
||||
return supportsUpdates() && service.supportsReviews();
|
||||
}
|
||||
|
||||
public static void launchReview(Callback callback){
|
||||
if (supportsUpdates()){
|
||||
service.initializeReview(new UpdateService.ReviewResultCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
callback.call();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback.call();
|
||||
}
|
||||
}
|
||||
|
||||
public static void openReviewURI(){
|
||||
if (supportsUpdates()){
|
||||
service.openReviewURI();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -10,10 +10,10 @@ public class SakaFishBossSprites extends MobSprite {
|
|||
|
||||
texture( Assets.Sprites.SKFS );
|
||||
|
||||
TextureFilm frames = new TextureFilm( texture, 29, 15 );
|
||||
TextureFilm frames = new TextureFilm( texture, 29, 12 );
|
||||
|
||||
idle = new Animation( 12, true );
|
||||
idle.frames( frames, 7,7,8,9,10 );
|
||||
idle = new Animation( 4, true );
|
||||
idle.frames( frames, 14,15,16,17 );
|
||||
|
||||
run = new Animation( 10, true );
|
||||
run.frames( frames, 2,3 );
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2021 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.ui;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.AvailableUpdateData;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.watabou.noosa.Game;
|
||||
|
||||
public class UpdateNotification extends StyledButton {
|
||||
|
||||
public UpdateNotification(){
|
||||
super( Chrome.Type.GREY_BUTTON_TR, Messages.get(UpdateNotification.class, "title") );
|
||||
textColor( Window.SHPX_COLOR );
|
||||
visible = false;
|
||||
Updates.checkForUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (Updates.updateAvailable()){
|
||||
bg.alpha((float) (0.7f + Math.sin(Game.timeTotal*2)*0.3f));
|
||||
text.alpha((float) (0.7f + Math.sin(Game.timeTotal*2)*0.3f));
|
||||
visible = true;
|
||||
} else {
|
||||
visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Updates.updateAvailable()){
|
||||
ShatteredPixelDungeon.scene().addToFront( new WndUpdate( Updates.updateData() ) );
|
||||
}
|
||||
}
|
||||
|
||||
public static class WndUpdate extends WndOptions {
|
||||
|
||||
private AvailableUpdateData update;
|
||||
|
||||
public WndUpdate( AvailableUpdateData update ){
|
||||
super(
|
||||
update.versionName == null ? Messages.get(WndUpdate.class,"title") : Messages.get(WndUpdate.class,"versioned_title", update.versionName),
|
||||
update.desc == null ? Messages.get(WndUpdate.class,"desc") : update.desc,
|
||||
Messages.get(WndUpdate.class,"button"));
|
||||
this.update = update;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSelect(int index) {
|
||||
if (index == 0) {
|
||||
Updates.launchUpdate(update);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.HeroSelectScene;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.RankingsScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.TitleScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
|
@ -61,18 +60,6 @@ public class WndGame extends Window {
|
|||
});
|
||||
curBtn.icon(Icons.get(Icons.PREFS));
|
||||
|
||||
//install prompt
|
||||
if (Updates.isInstallable()){
|
||||
addButton( curBtn = new RedButton( Messages.get(this, "install") ) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
Updates.launchInstall();
|
||||
}
|
||||
} );
|
||||
curBtn.textColor(Window.SHPX_COLOR);
|
||||
curBtn.icon(Icons.get(Icons.CHANGES));
|
||||
}
|
||||
|
||||
// Challenges window
|
||||
if (Dungeon.challenges > 0) {
|
||||
addButton( curBtn = new RedButton( Messages.get(this, "challenges") ) {
|
||||
|
|
|
@ -281,7 +281,7 @@ public class WndKingShop extends Window {
|
|||
RedButton btnConfirm = new RedButton(Messages.get(WndKingShop.class, "buy")){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if(Dungeon.gold >500) {
|
||||
if(Dungeon.gold >=500) {
|
||||
Dungeon.gold-=500;
|
||||
WndKingShop.this.selectReward( item );
|
||||
Buff.prolong( hero, ReloadShop.class, 1f);
|
||||
|
|