Skip to content

Commit

Permalink
Merge pull request #12 from watabou/1.7.2
Browse files Browse the repository at this point in the history
1.7.2
  • Loading branch information
watabou committed Oct 15, 2014
2 parents 33c27cd + 9e9596e commit 3ce26c2
Show file tree
Hide file tree
Showing 163 changed files with 2,186 additions and 991 deletions.
7 changes: 3 additions & 4 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.watabou.pixeldungeon"
android:versionCode="59"
android:versionName="1.7.1c"
android:versionCode="61"
android:versionName="1.7.2a"
android:installLocation="auto">

<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.android.vending.BILLING" />

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18"/>
android:targetSdkVersion="19"/>

<uses-feature
android:glEsVersion="0x00020000"/>
Expand Down
Binary file modified assets/avatars.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/badges.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/banners.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/buffs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/items.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/large_buffs.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/pet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/status_pane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/tiles4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/warrior.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/com/watabou/pixeldungeon/Assets.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class Assets {
public static final String ROGUE = "rogue.png";
public static final String HUNTRESS = "ranger.png";
public static final String AVATARS = "avatars.png";
public static final String PET = "pet.png";

public static final String SURFACE = "surface.png";

Expand Down
8 changes: 6 additions & 2 deletions src/com/watabou/pixeldungeon/Badges.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public static enum Badge {
BOSS_SLAIN_3_SNIPER,
BOSS_SLAIN_3_WARDEN,
BOSS_SLAIN_3_ALL_SUBCLASSES(
"3rd boss slain by Gladiator, Berserker, Warlock, Battlemage, " +
"Freerunner, Assassin, Sniper & Warden", 33, true ),
"3rd boss slain by Gladiator, Berserker, Warlock, Battlemage, Freerunner, Assassin, Sniper & Warden", 33, true ),
RING_OF_HAGGLER( "Ring of Haggler obtained", 20 ),
RING_OF_THORNS( "Ring of Thorns obtained", 21 ),
STRENGTH_ATTAINED_1( "13 points of Strength attained", 40 ),
Expand Down Expand Up @@ -142,6 +141,7 @@ public static enum Badge {
GAMES_PLAYED_3( "500 games played", 62, true ),
GAMES_PLAYED_4( "2000 games played", 63, true ),
HAPPY_END( "Happy end", 38 ),
CHAMPION( "Challenge won", 39, true ),
SUPPORTER( "Thanks for your support!", 31, true );

public boolean meta;
Expand Down Expand Up @@ -842,6 +842,10 @@ public static void validateHappyEnd() {
displayBadge( Badge.HAPPY_END );
}

public static void validateChampion() {
displayBadge( Badge.CHAMPION );
}

private static void displayBadge( Badge badge ) {

if (badge == null) {
Expand Down
42 changes: 42 additions & 0 deletions src/com/watabou/pixeldungeon/Challenges.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2014 Oleg Dolya
*
* 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.watabou.pixeldungeon;

public class Challenges {

public static final int NO_FOOD = 1;
public static final int NO_ARMOR = 2;
public static final int NO_HEALING = 4;
public static final int NO_HERBALISM = 8;
public static final int SWARM_INTELLIGENCE = 16;
public static final int DARKNESS = 32;

public static final String[] NAMES = {
"No food",
"No armors",
"No healing potions",
"No dew, no seeds",
"Swarm intelligence",
"Darkness"
};

public static final int[] MASKS = {
NO_FOOD, NO_ARMOR, NO_HEALING, NO_HERBALISM, SWARM_INTELLIGENCE, DARKNESS
};

}
5 changes: 1 addition & 4 deletions src/com/watabou/pixeldungeon/Chrome.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public enum Type {
SCROLL,
TAB_SET,
TAB_SELECTED,
TAB_UNSELECTED,
SURFACE
TAB_UNSELECTED
};

public static NinePatch get( Type type ) {
Expand All @@ -57,8 +56,6 @@ public static NinePatch get( Type type ) {
return new NinePatch( Assets.CHROME, 64, 22, 10, 14, 4, 7, 4, 6 );
case TAB_UNSELECTED:
return new NinePatch( Assets.CHROME, 74, 22, 10, 14, 4, 7, 4, 6 );
case SURFACE:
return new NinePatch( Assets.CHROME, 86, 0, 22, 22, 5 );
default:
return null;
}
Expand Down
31 changes: 21 additions & 10 deletions src/com/watabou/pixeldungeon/Dungeon.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ public class Dungeon {
public static boolean dewVial; // true if the dew vial can be spawned
public static int transmutation; // depth number for a well of transmutation


public static int challenges;

public static Hero hero;
public static Level level;

// Eitherî Item or Class<? extends Item>
// Either Item or Class<? extends Item>
public static Object quickslot;

public static int depth;
Expand All @@ -135,6 +136,8 @@ public class Dungeon {

public static void init() {

challenges = PixelDungeon.challenges();

Actor.clear();

PathFinder.setMapSize( Level.WIDTH, Level.HEIGHT );
Expand Down Expand Up @@ -173,6 +176,10 @@ public static void init() {
StartScene.curClass.initHero( hero );
}

public static boolean isChallenged( int mask ) {
return (challenges & mask) != 0;
}

public static Level newLevel() {

Dungeon.level = null;
Expand Down Expand Up @@ -356,6 +363,7 @@ public static boolean asNeeded() {
private static final String RN_DEPTH_FILE = "ranger%d.dat";

private static final String VERSION = "version";
private static final String CHALLENGES = "challenges";
private static final String HERO = "hero";
private static final String GOLD = "gold";
private static final String DEPTH = "depth";
Expand Down Expand Up @@ -401,6 +409,7 @@ public static void saveGame( String fileName ) throws IOException {
Bundle bundle = new Bundle();

bundle.put( VERSION, Game.version );
bundle.put( CHALLENGES, challenges );
bundle.put( HERO, hero );
bundle.put( GOLD, gold );
bundle.put( DEPTH, depth );
Expand Down Expand Up @@ -457,8 +466,7 @@ public static void saveLevel() throws IOException {
Bundle bundle = new Bundle();
bundle.put( LEVEL, level );

OutputStream output = Game.instance.openFileOutput(
Utils.format( depthFile( hero.heroClass ), depth ), Game.MODE_PRIVATE );
OutputStream output = Game.instance.openFileOutput( Utils.format( depthFile( hero.heroClass ), depth ), Game.MODE_PRIVATE );
Bundle.write( bundle, output );
output.close();
}
Expand All @@ -470,11 +478,7 @@ public static void saveAll() throws IOException {
saveGame( gameFile( hero.heroClass ) );
saveLevel();

GamesInProgress.set(
hero.heroClass,
depth,
hero.lvl,
hero.belongings.armor != null ? hero.belongings.armor.tier : 0 );
GamesInProgress.set( hero.heroClass, depth, hero.lvl );

} else if (WndResurrect.instance != null) {

Expand All @@ -496,6 +500,8 @@ public static void loadGame( String fileName, boolean fullLoad ) throws IOExcept

Bundle bundle = gameBundle( fileName );

Dungeon.challenges = bundle.getInt( CHALLENGES );

Dungeon.level = null;
Dungeon.depth = -1;

Expand Down Expand Up @@ -607,7 +613,7 @@ public static Bundle gameBundle( String fileName ) throws IOException {
public static void preview( GamesInProgress.Info info, Bundle bundle ) {
info.depth = bundle.getInt( DEPTH );
if (info.depth == -1) {
info.depth = bundle.getInt( "maxDepth" ); // <-- It has to be refactored!
info.depth = bundle.getInt( "maxDepth" ); // FIXME
}
Hero.preview( info, bundle.getBundle( HERO ) );
}
Expand All @@ -620,6 +626,11 @@ public static void fail( String desc ) {
}

public static void win( String desc ) {

if (challenges != 0) {
Badges.validateChampion();
}

resultDescription = desc;
Rankings.INSTANCE.submit( true );
}
Expand Down
2 changes: 1 addition & 1 deletion src/com/watabou/pixeldungeon/DungeonTilemap.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void discover( int pos, int oldValue ) {

final Image tile = tile( oldValue );
tile.point( tileToWorld( pos ) );

// For bright mode
tile.rm = tile.gm = tile.bm = rm;
tile.ra = tile.ga = tile.ba = ra;
Expand Down
4 changes: 1 addition & 3 deletions src/com/watabou/pixeldungeon/GamesInProgress.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ public static Info check( HeroClass cl ) {
}
}

public static void set( HeroClass cl, int depth, int level, int armor ) {
public static void set( HeroClass cl, int depth, int level ) {
Info info = new Info();
info.depth = depth;
info.level = level;
info.armor = armor;
state.put( cl, info );
}

Expand All @@ -70,6 +69,5 @@ public static void delete( HeroClass cl ) {
public static class Info {
public int depth;
public int level;
public int armor;
}
}

0 comments on commit 3ce26c2

Please sign in to comment.