Update 0.6-Beta9-Test1

Preliminary commits for synchronizing MagicLing to the latest version of SHPD 1.2.3
Although it's still a lot of work...
This commit is contained in:
LingASDJ 2022-06-06 12:30:07 +08:00
parent 305e618968
commit f081265d3e
108 changed files with 942 additions and 966 deletions

View File

@ -21,6 +21,8 @@
package com.watabou.noosa;
import static com.badlogic.gdx.scenes.scene2d.actions.Actions.layout;
import com.watabou.gltextures.SmartTexture;
import com.watabou.gltextures.TextureCache;
import com.watabou.glwrap.Quad;
@ -191,4 +193,15 @@ public class Image extends Visual {
if (buffer != null)
buffer.delete();
}
public Image setPos(float x, float y ) {
this.x = x;
this.y = y;
layout();
return this;
}
protected void layout() {
}
}

View File

@ -11,28 +11,27 @@ buildscript {
allprojects {
ext {
appName = 'Shattered Pixel Dungeon'
appPackageName = 'com.shatteredpixel.shatteredpixeldungeon'
appName = 'Magic Ling Pixel Dungeon'
appPackageName = 'com.ansdomagiclingpixeldungeon.ling'
appVersionCode = 628
appVersionName = '1.2.3'
appVersionCode =13030
appVersionName = '0.6.0.0-Beta1'
appJavaCompatibility = JavaVersion.VERSION_1_8
appAndroidCompileSDK = 31
appAndroidCompileSDK = 30
appAndroidMinSDK = 14
appAndroidTargetSDK = 31
appAndroidTargetSDK = 30
gdxControllersVersion = '2.2.1'
gdxVersion = '1.10.0'
gdxControllersVersion = '2.2.1'
robovmVersion = '2.3.14'
}
version = appVersionName
repositories {
google()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,5 +1,10 @@
#scenes.aboutscene.=
scenes.changesscene.earlier=破碎更新动态
scenes.changesscene.later=魔绫更新动态
scenes.changesscene.shpd=破碎更新日志
scenes.changesscene.mlpd=魔绫更新日志
scenes.alchemyscene.title=炼金
scenes.alchemyscene.text=放入材料以制作新的道具!
scenes.alchemyscene.select=选择一件物品

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -110,28 +110,29 @@ public class Assets {
}
public static class Music {
public static final String THEME_1 = "music/theme_1.ogg";
public static final String THEME_2 = "music/theme_2.ogg";
public static final String THEME = "music/theme.ogg";
public static final String THEME_1 = "music/theme.ogg";
public static final String THEME_2 = "music/theme.ogg";
public static final String SEWERS_1 = "music/sewers_1.ogg";
public static final String SEWERS_2 = "music/sewers_2.ogg";
public static final String SEWERS_BOSS = "music/sewers_boss.ogg";
public static final String SEWERS_1 = "music/Level1.ogg";
public static final String SEWERS_2 = "music/Level1.ogg";
public static final String SEWERS_BOSS = "music/Boss1.ogg";
public static final String PRISON_1 = "music/prison_1.ogg";
public static final String PRISON_2 = "music/prison_2.ogg";
public static final String PRISON_BOSS = "music/prison_boss.ogg";
public static final String PRISON_1 = "music/Level2.ogg";
public static final String PRISON_2 = "music/Level2.ogg";
public static final String PRISON_BOSS = "music/Boss2.ogg";
public static final String CAVES_1 = "music/caves_1.ogg";
public static final String CAVES_2 = "music/caves_2.ogg";
public static final String CAVES_BOSS = "music/caves_boss.ogg";
public static final String CAVES_1 = "music/Level3.ogg";
public static final String CAVES_2 = "music/Level3.ogg";
public static final String CAVES_BOSS = "music/Boss3.ogg";
public static final String CITY_1 = "music/city_1.ogg";
public static final String CITY_2 = "music/city_2.ogg";
public static final String CITY_BOSS = "music/city_boss.ogg";
public static final String CITY_1 = "music/Level4.ogg";
public static final String CITY_2 = "music/Level4.ogg";
public static final String CITY_BOSS = "music/Boss4.ogg";
public static final String HALLS_1 = "music/halls_1.ogg";
public static final String HALLS_2 = "music/halls_2.ogg";
public static final String HALLS_BOSS = "music/halls_boss.ogg";
public static final String HALLS_BOSS = "music/Boss5.ogg";
}
public static class Sounds {
@ -228,7 +229,14 @@ public class Assets {
}
public static class Sprites {
public static final String ITEMS = "sprites/items.png";
//BOSS
public static final String FRAS = "sprites/boss/FireMagicGirl.png";
public static final String NECROREDEX = "sprites/boss/rednecromancer_ex.png";
//GENRAL
public static final String ITEMS = "sprites/items/items.png";
public static final String ITEM_ICONS = "sprites/item_icons.png";
public static final String WARRIOR = "sprites/warrior.png";

View File

@ -3,7 +3,7 @@
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2022 Evan Debenham
* Copyright (C) 2014-2019 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
@ -26,13 +26,14 @@ import com.watabou.noosa.Image;
public class BannerSprites {
public enum Type {
public enum Type {
PIXEL_DUNGEON,
BOSS_SLAIN,
GAME_OVER,
SELECT_YOUR_HERO,
PIXEL_DUNGEON_SIGNS
}
PIXEL_DUNGEON_SIGNS,
SWORD
};
public static Image get( Type type ) {
Image icon = new Image( Assets.Interfaces.BANNERS );
@ -50,7 +51,10 @@ public class BannerSprites {
icon.frame( icon.texture.uvRect( 0, 160, 128, 181 ) );
break;
case PIXEL_DUNGEON_SIGNS:
icon.frame( icon.texture.uvRect( 132, 0, 256, 90 ) );
icon.frame( icon.texture.uvRect( 133, 0, 255, 90 ) );
break;
case SWORD:
icon.frame( icon.texture.uvRect( 0, 181 , 160, 206 ) );
break;
}
return icon;

View File

@ -37,7 +37,7 @@ import com.watabou.noosa.audio.Sample;
public class LostBackpack extends Item {
{
image = ItemSpriteSheet.BACKPACK;
image = ItemSpriteSheet.LOSTBAG;
unique = true;
}

View File

@ -3,7 +3,8 @@
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2022 Evan Debenham
* 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
@ -36,7 +37,7 @@ import java.util.ArrayList;
public class Waterskin extends Item {
private static final int MAX_VOLUME = 20;
private static final int MAX_VOLUME = 10;
private static final String AC_DRINK = "DRINK";
@ -45,7 +46,7 @@ public class Waterskin extends Item {
private static final String TXT_STATUS = "%d/%d";
{
image = ItemSpriteSheet.WATERSKIN;
image = ItemSpriteSheet.VIAL;
defaultAction = AC_DRINK;
@ -85,7 +86,7 @@ public class Waterskin extends Item {
if (action.equals( AC_DRINK )) {
if (volume > 0) {
float missingHealthPercent = 1f - (hero.HP / (float)hero.HT);
int curShield = 0;
@ -98,7 +99,7 @@ public class Waterskin extends Item {
missingHealthPercent += missingShieldPercent;
}
}
//trimming off 0.01 drops helps with floating point errors
int dropsNeeded = (int)Math.ceil((missingHealthPercent / 0.05f) - 0.01f);
dropsNeeded = (int)GameMath.gate(1, dropsNeeded, volume);
@ -123,33 +124,14 @@ public class Waterskin extends Item {
}
}
@Override
public String info() {
String info = desc();
if (volume == 0){
info += "\n\n" + Messages.get(this, "desc_water");
} else {
info += "\n\n" + Messages.get(this, "desc_heal");
}
if (isFull()){
info += "\n\n" + Messages.get(this, "desc_full");
}
return info;
}
public void empty() {
volume = 0;
updateQuickslot();
}
public void empty() {volume = 0; updateQuickslot();}
protected int DewViewSword = 0;
@Override
public boolean isUpgradable() {
return false;
public Item upgrade() {
DewViewSword = Math.min(DewViewSword + 1, 20);
return super.upgrade();
}
@Override
public boolean isIdentified() {
return true;
@ -181,4 +163,4 @@ public class Waterskin extends Item {
return Messages.format( TXT_STATUS, volume, MAX_VOLUME );
}
}
}

View File

@ -25,6 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
@ -32,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangeInfo;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangeSelection;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_1_X_Changes;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_2_X_Changes;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_3_X_Changes;
@ -50,16 +53,16 @@ import com.watabou.noosa.ui.Component;
import java.util.ArrayList;
public class ChangesScene extends PixelScene {
public static int changesSelected = 0;
@Override
public void create() {
super.create();
Music.INSTANCE.playTracks(
new String[]{Assets.Music.THEME_1, Assets.Music.THEME_2},
new float[]{1, 1},
new String[]{Assets.Music.THEME},
new float[]{1},
false);
int w = Camera.main.width;
@ -88,26 +91,24 @@ public class ChangesScene extends PixelScene {
panel.y = title.bottom() + 5;
align( panel );
add( panel );
final ArrayList<ChangeInfo> changeInfos = new ArrayList<>();
switch (changesSelected){
case 0: default:
v1_X_Changes.addAllChanges(changeInfos);
break;
case 1:
v0_9_X_Changes.addAllChanges(changeInfos);
break;
case 2:
case 1:
v0_8_X_Changes.addAllChanges(changeInfos);
break;
case 3:
case 2:
v0_7_X_Changes.addAllChanges(changeInfos);
break;
case 4:
case 3:
v0_6_X_Changes.addAllChanges(changeInfos);
break;
case 5:
case 4:
v0_5_X_Changes.addAllChanges(changeInfos);
v0_4_X_Changes.addAllChanges(changeInfos);
v0_3_X_Changes.addAllChanges(changeInfos);
@ -136,6 +137,21 @@ public class ChangesScene extends PixelScene {
float posY = 0;
float nextPosY = 0;
boolean second = false;
if (changesSelected == 0) {
ChangeSelection selection = new ChangeSelection(Messages.get(this, "later"), Messages.get(this, "mlpd")) {
@Override
public void onClick() {
NewChangesScene.changesSelected = 0;
NewChangesScene.fromChangesScene = true;
ShatteredPixelDungeon.switchNoFade(NewChangesScene.class);
}
};
selection.icon(new ItemSprite(ItemSpriteSheet.MAGICGIRLBOOKS));
selection.hardlight(Window.TITLE_COLOR);
selection.setRect(0, posY, panel.innerWidth(), 0);
content.add(selection);
posY = nextPosY = selection.bottom();
}
for (ChangeInfo info : changeInfos){
if (info.major) {
posY = nextPosY;
@ -168,7 +184,7 @@ public class ChangesScene extends PixelScene {
panel.innerHeight() + 2);
list.scrollTo(0, 0);
StyledButton btn1_1 = new StyledButton(Chrome.Type.GREY_BUTTON_TR, "1.X"){
StyledButton btn0_9 = new StyledButton(Chrome.Type.TOAST, "1.0-0.9"){
@Override
protected void onClick() {
super.onClick();
@ -178,11 +194,11 @@ public class ChangesScene extends PixelScene {
}
}
};
if (changesSelected != 0) btn1_1.textColor( 0xBBBBBB );
btn1_1.setRect(list.left()-4f, list.bottom(), 22, changesSelected == 0 ? 19 : 15);
addToBack(btn1_1);
if (changesSelected != 0) btn0_9.textColor( 0xBBBBBB );
btn0_9.setRect(list.left()-4f, list.bottom(), 34, changesSelected == 0 ? 19 : 15);
addToBack(btn0_9);
StyledButton btn0_9 = new StyledButton(Chrome.Type.GREY_BUTTON_TR, "0.9"){
StyledButton btn0_8 = new StyledButton(Chrome.Type.TOAST, "0.8"){
@Override
protected void onClick() {
super.onClick();
@ -192,11 +208,11 @@ public class ChangesScene extends PixelScene {
}
}
};
if (changesSelected != 1) btn0_9.textColor( 0xBBBBBB );
btn0_9.setRect(btn1_1.right()+1, list.bottom(), 22, changesSelected == 1 ? 19 : 15);
addToBack(btn0_9);
if (changesSelected != 1) btn0_8.textColor( 0xBBBBBB );
btn0_8.setRect(btn0_9.right()+1, list.bottom(), 23, changesSelected == 1 ? 19 : 15);
addToBack(btn0_8);
StyledButton btn0_8 = new StyledButton(Chrome.Type.GREY_BUTTON_TR, "0.8"){
StyledButton btn0_7 = new StyledButton(Chrome.Type.TOAST, "0.7"){
@Override
protected void onClick() {
super.onClick();
@ -206,11 +222,11 @@ public class ChangesScene extends PixelScene {
}
}
};
if (changesSelected != 2) btn0_8.textColor( 0xBBBBBB );
btn0_8.setRect(btn0_9.right() + 1, list.bottom(), 22, changesSelected == 2 ? 19 : 15);
addToBack(btn0_8);
StyledButton btn0_7 = new StyledButton(Chrome.Type.GREY_BUTTON_TR, "0.7"){
if (changesSelected != 2) btn0_7.textColor( 0xBBBBBB );
btn0_7.setRect(btn0_8.right() + 1, btn0_8.top(), 23, changesSelected == 2 ? 19 : 15);
addToBack(btn0_7);
StyledButton btn0_6 = new StyledButton(Chrome.Type.TOAST, "0.6"){
@Override
protected void onClick() {
super.onClick();
@ -220,11 +236,11 @@ public class ChangesScene extends PixelScene {
}
}
};
if (changesSelected != 3) btn0_7.textColor( 0xBBBBBB );
btn0_7.setRect(btn0_8.right() + 1, btn0_8.top(), 22, changesSelected == 3 ? 19 : 15);
addToBack(btn0_7);
StyledButton btn0_6 = new StyledButton(Chrome.Type.GREY_BUTTON_TR, "0.6"){
if (changesSelected != 3) btn0_6.textColor( 0xBBBBBB );
btn0_6.setRect(btn0_7.right() + 1, btn0_8.top(), 23, changesSelected == 3 ? 19 : 15);
addToBack(btn0_6);
StyledButton btnOld = new StyledButton(Chrome.Type.TOAST,"0.5-0.1"){
@Override
protected void onClick() {
super.onClick();
@ -234,22 +250,8 @@ public class ChangesScene extends PixelScene {
}
}
};
if (changesSelected != 4) btn0_6.textColor( 0xBBBBBB );
btn0_6.setRect(btn0_7.right() + 1, btn0_8.top(), 22, changesSelected == 4 ? 19 : 15);
addToBack(btn0_6);
StyledButton btnOld = new StyledButton(Chrome.Type.GREY_BUTTON_TR,"0.5-1"){
@Override
protected void onClick() {
super.onClick();
if (changesSelected != 5) {
changesSelected = 5;
ShatteredPixelDungeon.seamlessResetScene();
}
}
};
if (changesSelected != 5) btnOld.textColor( 0xBBBBBB );
btnOld.setRect(btn0_6.right() + 1, btn0_8.top(), 26, changesSelected == 5 ? 19 : 15);
if (changesSelected != 4) btnOld.textColor( 0xBBBBBB );
btnOld.setRect(btn0_6.right() + 1, btn0_8.top(), 34, changesSelected == 4 ? 19 : 15);
addToBack(btnOld);
Archs archs = new Archs();
@ -258,10 +260,10 @@ public class ChangesScene extends PixelScene {
fadeIn();
}
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
}
}
}

View File

@ -0,0 +1,168 @@
package com.shatteredpixel.shatteredpixeldungeon.scenes;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangeInfo;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.ChangeSelection;
import com.shatteredpixel.shatteredpixeldungeon.ui.changelist.v0_1_X_Changes;
import com.watabou.noosa.Camera;
import com.watabou.noosa.NinePatch;
import com.watabou.noosa.audio.Music;
import com.watabou.noosa.ui.Component;
import java.util.ArrayList;
public class NewChangesScene extends PixelScene {
public static int changesSelected = 0;
public static boolean fromChangesScene = false;
@Override
public void create() {
super.create();
Music.INSTANCE.playTracks(
new String[]{Assets.Music.THEME},
new float[]{1},
false);
int w = Camera.main.width;
int h = Camera.main.height;
RenderedTextBlock title = PixelScene.renderTextBlock( Messages.get(ChangesScene.class, "title"), 9 );
title.hardlight(Window.TITLE_COLOR);
title.setPos(
(w - title.width()) / 2f,
(20 - title.height()) / 2f
);
align(title);
add(title);
ExitButton btnExit = new ExitButton();
btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
add( btnExit );
NinePatch panel = Chrome.get(Chrome.Type.TOAST);
int pw = 135 + panel.marginLeft() + panel.marginRight() - 2;
int ph = h - 36;
panel.size( pw, ph );
panel.x = (w - pw) / 2f;
panel.y = title.bottom() + 5;
align( panel );
add( panel );
final ArrayList<ChangeInfo> changeInfos = new ArrayList<>();
switch (changesSelected){
case 0: default:
v0_1_X_Changes.addAllChanges(changeInfos);
break;
}
ScrollPane list = new ScrollPane( new Component() ){
@Override
public void onClick(float x, float y) {
for (ChangeInfo info : changeInfos){
if (info.onClick( x, y )){
return;
}
}
}
};
add( list );
Component content = list.content();
content.clear();
float posY = 0;
float nextPosY = 0;
boolean second = false;
for (ChangeInfo info : changeInfos) {
if (info.major) {
posY = nextPosY;
second = false;
info.setRect(0, posY, panel.innerWidth(), 0);
content.add(info);
posY = nextPosY = info.bottom();
} else {
if (!second){
second = true;
info.setRect(0, posY, panel.innerWidth()/2f, 0);
content.add(info);
nextPosY = info.bottom();
} else {
second = false;
info.setRect(panel.innerWidth()/2f, posY, panel.innerWidth()/2f, 0);
content.add(info);
nextPosY = Math.max(info.bottom(), nextPosY);
posY = nextPosY;
}
}
}
if (changesSelected == 0) {
posY = nextPosY;
ChangeSelection selection = new ChangeSelection(Messages.get(ChangesScene.class, "earlier"), Messages.get(ChangesScene.class, "shpd")) {
@Override
public void onClick() {
ChangesScene.changesSelected = 0;
ShatteredPixelDungeon.switchNoFade(ChangesScene.class);
}
};
selection.icon(Icons.get(Icons.SHPX));
selection.hardlight(Window.TITLE_COLOR);
selection.setRect(0, posY, panel.innerWidth(), 0);
content.add(selection);
posY = selection.bottom();
}
content.setSize( panel.innerWidth(), (int)Math.ceil(posY) );
list.setRect(
panel.x + panel.marginLeft(),
panel.y + panel.marginTop() - 1,
panel.innerWidth() + 2,
panel.innerHeight() + 2);
list.scrollTo(0, fromChangesScene ? posY - list.height() : 0);
StyledButton btnBeta = new StyledButton(Chrome.Type.TOAST, "0.0.X"){
@Override
protected void onClick() {
super.onClick();
if (changesSelected != 0) {
changesSelected = 0;
ShatteredPixelDungeon.seamlessResetScene();
}
}
};
if (changesSelected != 0) btnBeta.textColor( 0xBBBBBB );
btnBeta.setRect(list.left()-4f, list.bottom(), panel.width(), changesSelected == 0 ? 19 : 15);
addToBack(btnBeta);
Archs archs = new Archs();
archs.setSize( Camera.main.width, Camera.main.height );
addToBack( archs );
fadeIn();
}
@Override
protected void onBackPressed() {
ShatteredPixelDungeon.switchNoFade(TitleScene.class);
}
}

View File

@ -1,24 +1,3 @@
/*
* 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.scenes;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
@ -28,14 +7,16 @@ import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
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.AvailableUpdateData;
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.FireMagicGirlSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.RedNecromancerSprite_EX;
import com.shatteredpixel.shatteredpixeldungeon.ui.Archs;
import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
@ -49,34 +30,28 @@ import com.watabou.noosa.Image;
import com.watabou.noosa.audio.Music;
import com.watabou.utils.ColorMath;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import java.util.Date;
public class TitleScene extends PixelScene {
@Override
public void create() {
super.create();
Music.INSTANCE.playTracks(
new String[]{Assets.Music.THEME_1, Assets.Music.THEME_2},
new float[]{1, 1},
false);
Music.INSTANCE.play( Assets.Music.THEME, true );
uiCamera.visible = false;
int w = Camera.main.width;
int h = Camera.main.height;
Archs archs = new Archs();
archs.setSize( w, h );
add( archs );
Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON );
add( title );
float topRegion = Math.max(title.height - 6, h*0.45f);
Image title = BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON );
float topRegion = Math.max(title.height - 6, h * 0.45f);
title.x = (w - title.width()) / 2f;
title.y = 2 + (topRegion - title.height()) / 2f;
@ -86,13 +61,93 @@ public class TitleScene extends PixelScene {
placeTorch(title.x + 22, title.y + 46);
placeTorch(title.x + title.width - 22, title.y + 46);
placeTorch2(title.x + -5, title.y + 63);
placeTorch2(title.x + title.width - 15, title.y + 63);
placeTorch3(title.x + -10, title.y + 46);
placeTorch3(title.x + title.width - 10, title.y + 46);
Image swordLeft = new Image( BannerSprites.get( BannerSprites.Type.SWORD ) ) {
private float preCurTime = 0;
private float curTime = 0;
@Override
public void update() {
super.update();
this.origin.set( this.width / 2, this.height / 2 );
float time = 0.8f;
this.x = - this.width + curTime/ time * (Camera.main.width / 2f + this.width / 2f);
this.angle = 90 - curTime/ time *225;
am = curTime*curTime*curTime/(time * time * time);
float preTime = 0.9f;
if (preCurTime < preTime) {
preCurTime += Game.elapsed;
return;
}
if (curTime < time) {
curTime += Game.elapsed;
if (curTime >= time) Camera.main.shake( GameMath.gate( 1, 2, 5), 0.3f );
}
}
};
swordLeft.center(title.center());
add( swordLeft );
Image swordRight = new Image( BannerSprites.get( BannerSprites.Type.SWORD ) ) {
private float preCurTime = 0;
private float curTime = 0;
@Override
public void update() {
super.update();
this.origin.set( this.width / 2, this.height / 2 );
float time = 0.8f;
this.x = Camera.main.width - curTime/ time * (Camera.main.width / 2f + this.width / 2f);
this.angle = 90 + curTime/ time * 225;
am = curTime*curTime*curTime/(time * time * time);
float preTime = 0.9f;
if (preCurTime < preTime) {
preCurTime += Game.elapsed;
return;
}
if (curTime < time) curTime += Game.elapsed;
}
};
swordRight.center(title.center());
add( swordRight );
add( title );
Flare flare = new Flare( 7, 128 ) {
private float time1 = 0;
private float time2 = 0;
private float time3 = 0;
@Override
public void update() {
super.update();
am = Math.max(0f, (float)Math.sin(time1 += Game.elapsed));
if (time1 >= 1.5f * Math.PI) time1 = 0;
rm = Math.max(0f, (float)Math.sin(time2 += Game.elapsed));
if (time2 >= 1.0f * Math.E) time2 = 5;
ra = Math.max(0f, (float)Math.sin(time3 += Game.elapsed));
if (time3 >= 1.0f * Math.PI) time3 = 1;
}
};
flare.color( Window.BLUE_COLOR, true ).show( title, 0 ).angularSpeed = +27;
Archs archs = new Archs();
archs.setSize( w, h );
addToBack( archs );
Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) {
private float time = 0;
@Override
public void update() {
super.update();
am = Math.max(0f, (float)Math.sin( time += Game.elapsed ));
if (time >= 1.5f*Math.PI) time = 0;
am = Math.max(0f, (float)Math.sin(time += Game.elapsed));
if (time >= 1.5f * Math.PI) time = 0;
}
@Override
public void draw() {
@ -101,66 +156,60 @@ public class TitleScene extends PixelScene {
Blending.setNormalMode();
}
};
signs.x = title.x + (title.width() - signs.width())/2f;
signs.x = title.x + (title.width() - signs.width()) / 2f;
signs.y = title.y;
add( signs );
add(signs);
final Chrome.Type GREY_TR = Chrome.Type.GREY_BUTTON_TR;
StyledButton btnPlay = new StyledButton(GREY_TR, Messages.get(this, "enter")){
@Override
protected void onClick() {
if (GamesInProgress.checkAll().size() == 0){
if (GamesInProgress.checkAll().size() == 0) {
GamesInProgress.selectedClass = null;
GamesInProgress.curSlot = 1;
ShatteredPixelDungeon.switchScene(HeroSelectScene.class);
} else {
ShatteredPixelDungeon.switchNoFade( StartScene.class );
}
ShatteredPixelDungeon.switchNoFade( StartScene.class );
}
@Override
protected boolean onLongClick() {
//making it easier to start runs quickly while debugging
if (DeviceCompat.isDebug()) {
GamesInProgress.selectedClass = null;
GamesInProgress.curSlot = 1;
ShatteredPixelDungeon.switchScene(HeroSelectScene.class);
ShatteredPixelDungeon.switchScene(StartScene.class);
return true;
}
return super.onLongClick();
}
};
btnPlay.icon(Icons.get(Icons.ENTER));
btnPlay.icon(new ItemSprite(ItemSpriteSheet.ENDDIED, null));
add(btnPlay);
StyledButton btnRankings = new StyledButton(GREY_TR,Messages.get(this, "rankings")) {
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade(RankingsScene.class);
}
};
btnRankings.icon(new ItemSprite(ItemSpriteSheet.ANKH, null));
add(btnRankings);
StyledButton btnBadges = new StyledButton(GREY_TR, Messages.get(this, "badges")) {
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade(BadgesScene.class);
}
};
btnBadges.icon(new ItemSprite(ItemSpriteSheet.DG12, null));
add(btnBadges);
StyledButton btnSupport = new SupportButton(GREY_TR, Messages.get(this, "support"));
add(btnSupport);
StyledButton btnRankings = new StyledButton(GREY_TR,Messages.get(this, "rankings")){
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade( RankingsScene.class );
}
};
btnRankings.icon(Icons.get(Icons.RANKINGS));
add(btnRankings);
StyledButton btnBadges = new StyledButton(GREY_TR, Messages.get(this, "badges")){
@Override
protected void onClick() {
ShatteredPixelDungeon.switchNoFade( BadgesScene.class );
}
};
btnBadges.icon(Icons.get(Icons.BADGES));
add(btnBadges);
StyledButton btnNews = new NewsButton(GREY_TR, Messages.get(this, "news"));
btnNews.icon(Icons.get(Icons.NEWS));
add(btnNews);
StyledButton btnChanges = new ChangesButton(GREY_TR, Messages.get(this, "changes"));
btnChanges.icon(Icons.get(Icons.CHANGES));
btnChanges.icon(new ItemSprite(ItemSpriteSheet.ICEBOOK, null));
add(btnChanges);
StyledButton btnSettings = new SettingsButton(GREY_TR, Messages.get(this, "settings"));
@ -169,57 +218,70 @@ public class TitleScene extends PixelScene {
StyledButton btnAbout = new StyledButton(GREY_TR, Messages.get(this, "about")){
@Override
protected void onClick() {
ShatteredPixelDungeon.switchScene( AboutScene.class );
ShatteredPixelDungeon.switchNoFade( AboutScene.class );
}
};
btnAbout.icon(Icons.get(Icons.SHPX));
btnAbout.icon(new ItemSprite(ItemSpriteSheet.MAGICGIRLBOOKS, null));
add(btnAbout);
StyledButton btnNews = new NewsButton(GREY_TR, Messages.get(this, "news"));
btnNews.icon(new ItemSprite(ItemSpriteSheet.YELLOWBOOKS, null));
add(btnNews);
final int BTN_HEIGHT = 20;
int GAP = (int)(h - topRegion - (landscape() ? 3 : 4)*BTN_HEIGHT)/3;
int GAP = (int)(h - topRegion - (landscape() ? 3 : 4) * BTN_HEIGHT) / 3;
GAP /= landscape() ? 3 : 5;
GAP = Math.max(GAP, 2);
if (landscape()) {
btnPlay.setRect(title.x-50, topRegion+GAP, ((title.width()+100)/2)-1, BTN_HEIGHT);
btnPlay.setRect(title.x - 50, topRegion + GAP, title.width() + 100 - 1, BTN_HEIGHT);
align(btnPlay);
btnSupport.setRect(btnPlay.right()+2, btnPlay.top(), btnPlay.width(), BTN_HEIGHT);
btnRankings.setRect(btnPlay.left(), btnPlay.bottom()+ GAP, (btnPlay.width()*.67f)-1, BTN_HEIGHT);
btnRankings.setRect(btnPlay.left(), btnPlay.bottom()+ GAP, (btnPlay.width() * 0.332f) - 1, BTN_HEIGHT);
btnBadges.setRect(btnRankings.left(), btnRankings.bottom()+GAP, btnRankings.width(), BTN_HEIGHT);
btnNews.setRect(btnRankings.right()+2, btnRankings.top(), btnRankings.width(), BTN_HEIGHT);
btnChanges.setRect(btnNews.left(), btnNews.bottom() + GAP, btnRankings.width(), BTN_HEIGHT);
btnSettings.setRect(btnNews.right()+2, btnNews.top(), btnRankings.width(), BTN_HEIGHT);
btnSupport.setRect(btnRankings.right() + 2, btnRankings.top(), btnRankings.width(), BTN_HEIGHT);
btnChanges.setRect(btnSupport.left(), btnSupport.bottom() + GAP, btnRankings.width(), BTN_HEIGHT);
btnSettings.setRect(btnSupport.right() + 2, btnSupport.top(), btnRankings.width(), BTN_HEIGHT);
btnAbout.setRect(btnSettings.left(), btnSettings.bottom() + GAP, btnRankings.width(), BTN_HEIGHT);
} else {
btnPlay.setRect(title.x, topRegion+GAP, title.width(), BTN_HEIGHT);
btnNews.setRect(btnPlay.left(), btnAbout.bottom() + GAP, btnAbout.width() + 157 - 1, BTN_HEIGHT);
align(btnNews);
}
else {
btnPlay.setRect(title.x, topRegion + GAP, title.width(), BTN_HEIGHT);
align(btnPlay);
btnSupport.setRect(btnPlay.left(), btnPlay.bottom()+ GAP, btnPlay.width(), BTN_HEIGHT);
btnRankings.setRect(btnPlay.left(), btnSupport.bottom()+ GAP, (btnPlay.width()/2)-1, BTN_HEIGHT);
btnBadges.setRect(btnRankings.right()+2, btnRankings.top(), btnRankings.width(), BTN_HEIGHT);
btnNews.setRect(btnRankings.left(), btnRankings.bottom()+ GAP, btnRankings.width(), BTN_HEIGHT);
btnChanges.setRect(btnNews.right()+2, btnNews.top(), btnNews.width(), BTN_HEIGHT);
btnSettings.setRect(btnNews.left(), btnNews.bottom()+GAP, btnRankings.width(), BTN_HEIGHT);
btnAbout.setRect(btnSettings.right()+2, btnSettings.top(), btnSettings.width(), BTN_HEIGHT);
btnRankings.setRect(btnPlay.left(), btnPlay.bottom()+ GAP, (btnPlay.width() / 2) - 1, BTN_HEIGHT);
btnBadges.setRect(btnRankings.right() + 2, btnRankings.top(), btnRankings.width(), BTN_HEIGHT);
btnSupport.setRect(btnRankings.left(), btnRankings.bottom()+ GAP, btnRankings.width(), BTN_HEIGHT);
btnChanges.setRect(btnSupport.right() + 2, btnSupport.top(), btnSupport.width(), BTN_HEIGHT);
btnSettings.setRect(btnSupport.left(), btnSupport.bottom()+GAP, btnRankings.width(), BTN_HEIGHT);
btnAbout.setRect(btnSettings.right() + 2, btnSettings.top(), btnSettings.width(), BTN_HEIGHT);
btnNews.setRect(btnPlay.left(), btnAbout.bottom() + GAP, btnAbout.width() + 68 - 1, BTN_HEIGHT);
align(btnNews);
}
BitmapText version = new BitmapText( "v" + Game.version, pixelFont);
version.measure();
version.hardlight( 0x888888 );
version.alpha( 0.4f);
version.x = w - version.width() - 4;
version.y = h - version.height() - 2;
add( version );
if (DeviceCompat.isDesktop()) {
ExitButton btnExit = new ExitButton();
btnExit.setPos( w - btnExit.width(), 0 );
add( btnExit );
}
fadeIn();
}
private void placeTorch( float x, float y ) {
Fireball fb = new Fireball();
Fireball fb2 = new Fireball();
fb2.setPos( x, y );
add( fb2 );
}
private void placeTorch2( float x, float y ) {
Image fb = (new RedNecromancerSprite_EX());
fb.setPos( x, y );
add( fb );
}
private void placeTorch3( float x, float y ) {
Image fb = (new FireMagicGirlSprite());
fb.setPos( x, y );
add( fb );
}
@ -253,7 +315,8 @@ public class TitleScene extends PixelScene {
}
if (unreadCount > 0){
textColor(ColorMath.interpolate( 0xFFFFFF, Window.SHPX_COLOR, 0.5f + (float)Math.sin(Game.timeTotal*5)/2f));
textColor(ColorMath.interpolate( 0xFFFFFF, Window.TITLE_COLOR,
0.5f + (float)Math.sin(Game.timeTotal*5)/2f));
}
}
@ -322,41 +385,31 @@ public class TitleScene extends PixelScene {
}
private static class SettingsButton extends StyledButton {
public SettingsButton( Chrome.Type type, String label ){
public SettingsButton(Chrome.Type type, String label){
super(type, label);
if (Messages.lang().status() == Languages.Status.INCOMPLETE){
icon(Icons.get(Icons.LANGS));
icon.hardlight(1.5f, 0, 0);
} else {
icon(Icons.get(Icons.PREFS));
}
icon(new ItemSprite(ItemSpriteSheet.BREDBOOK, null));
textColor(Window.Pink_COLOR);
}
@Override
public void update() {
super.update();
if (Messages.lang().status() == Languages.Status.INCOMPLETE){
textColor(ColorMath.interpolate( 0xFFFFFF, CharSprite.NEGATIVE, 0.5f + (float)Math.sin(Game.timeTotal*5)/2f));
}
}
@Override
protected void onClick() {
if (Messages.lang().status() == Languages.Status.INCOMPLETE){
WndSettings.last_index = 4;
}
ShatteredPixelDungeon.scene().add(new WndSettings());
}
}
private static class SupportButton extends StyledButton{
private static class SupportButton extends StyledButton {
public SupportButton( Chrome.Type type, String label ){
super(type, label);
icon(Icons.get(Icons.GOLD));
icon(new ItemSprite(ItemSpriteSheet.NOKING, null));
textColor(Window.TITLE_COLOR);
}
@ -365,4 +418,5 @@ public class TitleScene extends PixelScene {
ShatteredPixelDungeon.switchNoFade(SupporterScene.class);
}
}
}

View File

@ -0,0 +1,169 @@
package com.shatteredpixel.shatteredpixeldungeon.sprites;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle;
import com.watabou.noosa.Camera;
import com.watabou.noosa.MovieClip;
import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.Emitter;
public class FireMagicGirlSprite extends MobSprite {
private MovieClip.Animation charge;
private MovieClip.Animation slam;
private Emitter superchargeSparks;
public FireMagicGirlSprite() {
super();
texture( Assets.Sprites.FRAS );
updateChargeState(false);
}
public void updateChargeState( boolean enraged ){
if (superchargeSparks != null) superchargeSparks.on = enraged;
int c = 0;
TextureFilm frames = new TextureFilm( texture, 12, 16 );
idle = new MovieClip.Animation( 4, true );
idle.frames( frames, c+0, c+1 );
run = new MovieClip.Animation( 6, true );
run.frames( frames, c+0, c+1 );
attack = new MovieClip.Animation( 5, false );
attack.frames( frames, c+3, c+4 );
//unaffected by enrage state
if (charge == null) {
charge = new MovieClip.Animation(4, true);
charge.frames(frames, 0, 10);
slam = attack.clone();
zap = new MovieClip.Animation(15, false);
zap.frames(frames, 6, 7, 7, 6);
die = new MovieClip.Animation(20, false);
die.frames(frames, 3,4);
}
if (curAnim != charge) play(idle);
}
@Override
public void play( MovieClip.Animation anim ) {
if (anim == die) {
emitter().burst( SnowParticle.FACTORY, 8 );
}
super.play( anim );
}
public void zap( int cell ) {
turnTo( ch.pos , cell );
play( zap );
//MagicMissile.boltFromChar( parent,
// MagicMissile.TOXIC_VENT,
// this,
// cell,
// new Callback() {
// @Override
// public void call() {
// ((MagicGirlDead)ch).onZapComplete();
// }
// } );
//Sample.INSTANCE.play( Assets.Sounds.GAS );
}
public void charge(){
play( charge );
}
public void slam( int cell ){
turnTo( ch.pos , cell );
play( slam );
Sample.INSTANCE.play( Assets.Sounds.ROCKS );
Camera.main.shake( 3, 0.7f );
}
@Override
public void onComplete( MovieClip.Animation anim ) {
if (anim == zap || anim == slam){
idle();
}
//if (anim == slam){
// ((MagicGirlDead)ch).onSlamComplete();
//}
super.onComplete( anim );
if (anim == die) {
Sample.INSTANCE.play(Assets.Sounds.BLAST);
emitter().burst( BlastParticle.FACTORY, 100 );
killAndErase();
}
}
@Override
public void place(int cell) {
if (parent != null) parent.bringToFront(this);
super.place(cell);
}
@Override
public void link(Char ch) {
super.link(ch);
superchargeSparks = emitter();
superchargeSparks.autoKill = false;
superchargeSparks.pour(SparkParticle.STATIC, 0.05f);
superchargeSparks.on = false;
//if (ch instanceof MagicGirlDead && ((MagicGirlDead) ch).isSupercharged()){
// updateChargeState(true);
//}
}
@Override
public void update() {
super.update();
if (superchargeSparks != null){
superchargeSparks.visible = visible;
}
}
@Override
public void die() {
super.die();
if (superchargeSparks != null){
superchargeSparks.on = false;
}
}
@Override
public void kill() {
super.kill();
if (superchargeSparks != null){
superchargeSparks.killAndErase();
}
}
@Override
public int blood() {
return 0xFFFFFF88;
}
}

View File

@ -219,6 +219,7 @@ public class ItemSpriteSheet {
public static final int SPEAR = WEP_TIER2+2;
public static final int QUARTERSTAFF = WEP_TIER2+3;
public static final int DIRK = WEP_TIER2+4;
public static final int ENDDIED = WEP_TIER2+5;
static{
assignItemRect(SHORTSWORD, 13, 13);
assignItemRect(HAND_AXE, 12, 14);
@ -680,24 +681,93 @@ public class ItemSpriteSheet {
}
private static final int BAGS = xy(1, 31); //16 slots
public static final int WATERSKIN = BAGS+0;
public static final int BACKPACK = BAGS+1;
public static final int POUCH = BAGS+2;
public static final int HOLDER = BAGS+3;
public static final int BANDOLIER = BAGS+4;
public static final int HOLSTER = BAGS+5;
public static final int VIAL = BAGS+6;
public static final int VIAL = BAGS+0;
public static final int POUCH = BAGS+1;
public static final int HOLDER = BAGS+2;
public static final int BANDOLIER = BAGS+3;
public static final int HOLSTER = BAGS+4;
public static final int MagicBlueSword = BAGS+5;
public static final int BlackDog = BAGS+6;
public static final int RedBloodMoon = BAGS+7;
public static final int DG1 = BAGS+8;
public static final int DG2 = BAGS+9;
public static final int DG3 = BAGS+10;
public static final int DG4 = BAGS+11;
public static final int DG5 = BAGS+12;
public static final int DG6 = BAGS+13;
public static final int DG7 = BAGS+14;
public static final int DG8 = BAGS+15;
public static final int DG9 = BAGS+16;
public static final int DG10 = BAGS+17;
public static final int DG11 = BAGS+18;
public static final int DG12 = BAGS+19;
public static final int DG13 = BAGS+20;
public static final int DG14 = BAGS+21;
public static final int DG15 = BAGS+22;
public static final int DG16 = BAGS+23;
public static final int DG17 = BAGS+24;
public static final int DG18 = BAGS+25;
public static final int DG19 = BAGS+26;
public static final int DG20 = BAGS+27;
public static final int DG21 = BAGS+28;
public static final int DG22 = BAGS+29;
public static final int DG23 = BAGS+30;
public static final int DG24 = BAGS+31;
public static final int DG25 = BAGS+32;
public static final int DG26 = BAGS+33;
public static final int ICEBOOKS = BAGS+34;
public static final int NOBOOKS = BAGS+35;
public static final int CLINGSHILED = BAGS+36;
public static final int GRRENSHILED = BAGS+37;
/*依赖项*/
public static final int NOTAS = BAGS+38;
public static final int TONASD = BAGS+39;
/*依赖项*/
public static final int BLUEDEVIAL = BAGS+40;
public static final int PINKDEVIAL = BAGS+41;
public static final int REDDEVIAL = BAGS+42;
public static final int REDDRAGON = BAGS+43;
public static final int DRAGONKINGHALOFIRE = BAGS+44;
public static final int ICEFISHSWORD = BAGS+45;
public static final int FIREFISHSWORD = BAGS+46;
public static final int SKELETONGOLD = BAGS+47;
public static final int ICEDVS = BAGS+48;
public static final int FIREDVS = BAGS+49;
public static final int DIEDVS = BAGS+50;
public static final int ANTILIGHT = BAGS+51;
public static final int BOOKBAG = BAGS+52;
public static final int BLACKBOOK = BAGS+53;
public static final int LOSTBAG = BAGS+54;
static{
assignItemRect(WATERSKIN, 16, 14);
assignItemRect(BACKPACK, 16, 16);
assignItemRect(VIAL, 16, 16);
assignItemRect(POUCH, 14, 15);
assignItemRect(HOLDER, 16, 16);
assignItemRect(BANDOLIER, 15, 16);
assignItemRect(HOLSTER, 15, 16);
assignItemRect(VIAL, 12, 12);
assignItemRect(DRAGONKINGHALOFIRE, 12, 14);
assignItemRect(REDDRAGON, 14, 14);
}
//16 free slots
private static final int MAINBOOKINDEX = xy(1, 37); //16 slots
public static final int ICEBOOK= MAINBOOKINDEX+1;
public static final int BREDBOOK= MAINBOOKINDEX+2;
public static final int GREENBOOKS= MAINBOOKINDEX+3;
public static final int YELLOWBOOKS= MAINBOOKINDEX+4;
public static final int MOBBOOKS= MAINBOOKINDEX+5;
public static final int MAGICGIRLBOOKS= MAINBOOKINDEX+6;
public static final int NOKING= MAINBOOKINDEX+7;
public static final int FIRELIYD= MAINBOOKINDEX+8;
public static final int FBK= MAINBOOKINDEX+9;
private static final int MAINPALYBOOKS = xy(1, 40);
public static final int MONEYBOOKS= MAINPALYBOOKS+1;
public static final int PINKBOOKS= MAINPALYBOOKS+2;
public static final int DEBOOKS= MAINPALYBOOKS+3;
//16 free slots //16 free slots
//for smaller 8x8 icons that often accompany an item sprite
public static class Icons {

View File

@ -0,0 +1,123 @@
package com.shatteredpixel.shatteredpixeldungeon.sprites;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.watabou.noosa.TextureFilm;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.Emitter;
public class RedNecromancerSprite_EX extends MobSprite {
private Animation charging;
private Emitter summoningBones;
public RedNecromancerSprite_EX(){
super();
texture( Assets.Sprites.NECROREDEX );
TextureFilm film = new TextureFilm( texture, 16, 16 );
idle = new Animation( 1, true );
idle.frames( film, 0, 0, 0, 1, 0, 0, 0, 0, 1 );
run = new Animation( 8, true );
run.frames( film, 0, 0, 0, 2, 3, 4 );
zap = new Animation( 10, false );
zap.frames( film, 5, 6, 7, 8 );
charging = new Animation( 5, true );
charging.frames( film, 7, 8 );
die = new Animation( 10, false );
die.frames( film, 9, 10, 11, 12 );
attack = zap.clone();
idle();
}
//@Override
//public void link(Char ch) {
// super.link(ch);
// if (ch instanceof RedNecromancer && ((RedNecromancer) ch).summoning){
// zap(((RedNecromancer) ch).summoningPos);
// }
//}
//
//@Override
//public void update() {
// super.update();
// if (summoningBones != null && ((RedNecromancer) ch).summoningPos != -1){
// summoningBones.visible = Dungeon.level.heroFOV[((RedNecromancer) ch).summoningPos];
// }
//}
@Override
public void die() {
super.die();
if (summoningBones != null){
summoningBones.on = false;
}
}
@Override
public void kill() {
super.kill();
if (summoningBones != null){
summoningBones.killAndErase();
}
}
public void cancelSummoning(){
if (summoningBones != null){
summoningBones.on = false;
}
}
public void finishSummoning(){
if (summoningBones.visible) {
Sample.INSTANCE.play(Assets.Sounds.BONES);
summoningBones.burst(Speck.factory(Speck.RATTLE), 5);
} else {
summoningBones.on = false;
}
idle();
}
public void charge(){
play(charging);
}
//Override
//ublic void zap(int cell) {
// super.zap(cell);
// if (ch instanceof RedNecromancer && ((RedNecromancer) ch).summoning){
// if (summoningBones != null){
// summoningBones.on = false;
// }
// summoningBones = CellEmitter.get(((RedNecromancer) ch).summoningPos);
// summoningBones.pour(Speck.factory(Speck.RATTLE), 0.2f);
// summoningBones.visible = Dungeon.level.heroFOV[((RedNecromancer) ch).summoningPos];
// if (visible || summoningBones.visible ) Sample.INSTANCE.play( Assets.Sounds.CHARGEUP, 1f, 0.8f );
// }
//
//Override
//ublic void onComplete(Animation anim) {
// super.onComplete(anim);
// if (anim == zap){
// if (ch instanceof RedNecromancer){
// if (((RedNecromancer) ch).summoning){
// charge();
// } else {
// ((RedNecromancer)ch).onZapComplete();
// idle();
// }
// } else {
// idle();
// }
// }
//
}

View File

@ -49,8 +49,31 @@ public class Window extends Group implements Signal.Listener<KeyEvent> {
protected NinePatch chrome;
public static final int WHITE = 0xFFFFFF;
public static final int TITLE_COLOR = 0xFFFF44;
public static final int R_COLOR = 0xFF0000;
public static final int G_COLOR = 0x00FF00;
public static final int B_COLOR = 0x0000FF;
public static final int Pink_COLOR = 0xFF1493;
public static final int DeepPK_COLOR = 0xFF0000;
public static final int SHPX_COLOR = 0x33BB33;
public static final int TITLE_COLOR = 0x00FFFF;
public static final int MLPD_COLOR = 0x00FFFF;
public static final int BALCK_COLOR = 0x000000;
public static final int GDX_COLOR = 0xE44D3C;
public static final int SKYBULE_COLOR = 0x00FFFF;
public static final int CYELLOW = 0xFFFF00;
public static final int CPINK = 0xFF00FF;
public static final int CWHITE = 0xFFFFFF;
public static final int WATA_COLOR = 0x55AAFF;
public static final int ANSDO_COLOR = 0xFF0000;
public static final int RED_COLOR = 0xFF0000;
public static final int GREEN_COLOR = 0x00FF00;
public static final int BLUE_COLOR = 0x0000FF;
public static final int CBLACK = 0x000000;
public Window() {
this( 0, 0, Chrome.get( Chrome.Type.WINDOW ) );

View File

@ -0,0 +1,77 @@
package com.shatteredpixel.shatteredpixeldungeon.ui.changelist;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Image;
import com.watabou.noosa.ui.Component;
public class ChangeSelection extends Component {
private static final int BTN_HEIGHT = 18;
protected ColorBlock line;
private RenderedTextBlock title;
private RedButton btnSelect;
public ChangeSelection(String title, String text) {
super();
this.title = PixelScene.renderTextBlock( title, 9 );
line = new ColorBlock( 1, 1, 0xFF222222);
add(line);
add(this.title);
this.btnSelect = new RedButton(text) {
@Override
protected void onClick() {
ChangeSelection.this.onClick();
}
};
add(this.btnSelect);
}
public Image icon() {
return btnSelect.icon();
}
public void icon(Image icon) {
btnSelect.icon(icon);
}
public void onClick() {
}
public void hardlight( int color ){
title.hardlight( color );
}
@Override
protected void layout() {
float posY = this.y + 5;
title.setPos(
x + (width - title.width()) / 2f,
posY
);
PixelScene.align( title );
posY += title.height() + 2;
float posX = x;
btnSelect.setRect(posX, posY, width(), BTN_HEIGHT);
PixelScene.align(btnSelect);
posY += BTN_HEIGHT;
height = posY - this.y;
line.size(width(), 1);
line.x = x;
line.y = y+2;
}
}

5
ios/.gitignore vendored
View File

@ -1,5 +0,0 @@
#RoboVM build folders
robovm-build/
#RoboVM config (we dynamically generate it)
robovm.properties

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${appName}</string>
<key>CFBundleExecutable</key>
<string>${appExecutable}</string>
<key>CFBundleIdentifier</key>
<string>${appPackageName}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${appName}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${appShortVersionName}</string>
<key>CFBundleVersionString</key>
<string>${appVersionName}</string>
<key>CFBundleVersion</key>
<string>${appVersionCode}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIStatusBarHidden</key>
<false/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>opengles-2</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>

View File

@ -1,166 +0,0 @@
{
"images" : [
{
"filename" : "Icon-20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "Icon-29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "Icon-40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "Icon-60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "Icon-60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "Icon-20.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "Icon-20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-29.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "Icon-29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-40.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "Icon-40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-76.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "Icon-76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "Icon-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "Icon-1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,23 +0,0 @@
{
"images" : [
{
"filename" : "Banner.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Banner@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Banner@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="450" height="500"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="Banner" translatesAutoresizingMaskIntoConstraints="NO" id="hN2-E0-Tu8">
<rect key="frame" x="25" y="0" width="400" height="250"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" white="0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<extendedEdge key="edgesForExtendedLayout"/>
<nil key="simulatedTopBarMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
<resources>
<image name="Banner" width="400" height="250"/>
</resources>
</document>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More