Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Commit

Permalink
ported over 0.7.1d changes, updated version info
Browse files Browse the repository at this point in the history
  • Loading branch information
00-Evan committed Jan 18, 2019
1 parent cb6840d commit 9661aac
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 9 deletions.
4 changes: 4 additions & 0 deletions PD-classes/src/com/watabou/utils/DeviceCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public static boolean usesISO_8859_1(){
return false;
}

public static boolean isDebug(){
return false; //TODO must be a way to check this in libgdx
}

public static void openURI( String URI ){
Gdx.net.openURI( URI );
}
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '0.7.1c'
version = '0.7.1d'
ext {
versionCode = 322
versionCode = 323
appName = 'shattered-pixel-dungeon'
appTitle = 'Shattered Pixel Dungeon'
appId = 'com.shatteredpixel.shatteredpixeldungeon'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.utils.Bundle;
import com.watabou.utils.DeviceCompat;

public enum HeroClass {

Expand Down Expand Up @@ -251,6 +252,9 @@ public String[] perks() {
}

public boolean isUnlocked(){
//always unlock on debug builds
if (DeviceCompat.isDebug()) return true;

switch (this){
case WARRIOR: default:
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ protected boolean getCloser( int target ) {
super.getCloser( target );
}

@Override
protected boolean canAttack( Char enemy ) {
return canTryToSummon() ?
pos == ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) :
Dungeon.level.adjacent( pos, enemy.pos );
}

private boolean canTryToSummon() {
if (Undead.count < maxArmySize()) {
Char ch = Actor.findChar( ((CityBossLevel)Dungeon.level).pedestal( nextPedestal ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void onClick(float x, float y) {
changes.hardlight( Window.TITLE_COLOR );
infos.add(changes);

changes = new ChangeInfo("v0.7.1c", false, null);
changes = new ChangeInfo("v0.7.1c & v0.7.1d", false, null);
changes.hardlight( Window.TITLE_COLOR );
infos.add(changes);

Expand All @@ -166,7 +166,8 @@ public void onClick(float x, float y) {
changes.addButton( new ChangeButton(new Image(Assets.KING, 1, 0, 14, 16), "Dwarf King",
"While I would like to make more extensive changes to Dwarf King in the future, I've made a couple smaller tweaks for now to make him harder to cheese:\n\n" +
"_-_ Dwarf King is now able to summon skeletons even if he cannot see the hero\n" +
"_-_ Dwarf King is now resistant to fire and toxic gas"));
"_-_ Dwarf King is now resistant to fire and toxic gas\n\n" +
"Note that in 0.7.1d I've fixed a bug where Dwarf King was attacking in several cases where he should have gone to try and summon. This was an unintended change to his behaviour, and now he should behave more like how he was before 0.7.1c."));

changes.addButton( new ChangeButton(new Image(Assets.SPINNER, 144, 0, 16, 16), Messages.get(this, "bugfixes"),
"Fixed (caused by 0.7.1):\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.watabou.noosa.RenderedText;
import com.watabou.noosa.SkinnedBlock;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.DeviceCompat;

import java.io.FileNotFoundException;
import java.io.IOException;
Expand Down Expand Up @@ -137,6 +138,11 @@ public void create() {
else if (loadingDepth <= 25) loadingAsset = Assets.LOADING_HALLS;
else loadingAsset = Assets.SHADOW;

//speed up transition when debugging
if (DeviceCompat.isDebug()){
fadeTime /= 2;
}

SkinnedBlock bg = new SkinnedBlock(Camera.main.width, Camera.main.height, loadingAsset ){
@Override
protected NoosaScript script() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.watabou.noosa.audio.Music;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.ui.Button;
import com.watabou.utils.DeviceCompat;

public class TitleScene extends PixelScene {

Expand Down Expand Up @@ -123,6 +124,16 @@ protected void onClick() {
ShatteredPixelDungeon.switchNoFade( StartScene.class );
}
}

@Override
protected boolean onLongClick() {
//making it easier to start runs quickly while debugging
if (DeviceCompat.isDebug()) {
TitleScene.this.add( new WndStartGame(1) );
return true;
}
return super.onLongClick();
}
};
add( btnPlay );

Expand Down
6 changes: 3 additions & 3 deletions desktop/VersionInfo.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
322
323
318
v0.7.1c
v0.7.1d
v0.7.1!
github.com/00-Evan/shattered-pixel-dungeon-gdx/releases/download/v0.7.1c/ShatteredPD.Desktop.v0.7.1c.jar
github.com/00-Evan/shattered-pixel-dungeon-gdx/releases/download/v0.7.1d/ShatteredPD.Desktop.v0.7.1d.jar
4 changes: 2 additions & 2 deletions desktop/src/com/watabou/pd/desktop/DesktopLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public class DesktopLauncher {
public static void main (String[] arg) {
String version = DesktopLauncher.class.getPackage().getSpecificationVersion();
if (version == null) {
version = "0.7.1c";
version = "0.7.1d";
}

int versionCode;
try {
versionCode = Integer.parseInt(DesktopLauncher.class.getPackage().getImplementationVersion());
} catch (NumberFormatException e) {
versionCode = 322;
versionCode = 323;
}

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
Expand Down

0 comments on commit 9661aac

Please sign in to comment.