c.java
来自「很好的3款手机游戏源码」· Java 代码 · 共 1,667 行 · 第 1/2 页
JAVA
1,667 行
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
import com.nokia.mid.ui.FullCanvas;
import java.io.*;
import java.util.Random;
import java.util.Vector;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.rms.RecordStore;
public class c extends FullCanvas
implements Runnable, d
{
public static boolean bd;
private static boolean a4 = false;
public static byte aB;
public static byte bV;
public static int bC;
public static int bA;
public static int bI = 0;
private static byte aA;
public static h aH;
public i au;
public static f aK;
private Font bs;
public static k bB;
private a aU;
public static j ba;
public static e bu;
public static b aw;
private static boolean a6;
private static boolean aQ;
private a bk;
public int a5;
private byte bP;
private Image bt;
public static Image a8;
private static Image aZ;
private static boolean bJ;
private static a av;
private a aW;
private static byte bF[];
public static byte bo[];
public static int aS;
public static int by;
private static int bj;
private static int bp;
public static int aM;
public static int bN;
public static boolean aL = false;
private static int az = 10;
private RecordStore bw;
public Vector br;
public int bm;
public int a2;
public int bK;
public int bl;
private String aX;
private static Random bn = new Random();
public static int bz;
public int bh;
public static boolean a7;
private int aE;
private byte aV;
private byte aD;
private byte aO;
private int as;
private int ar;
a bT;
public static int a0[] = {
0, 1, 2, 1
};
public static boolean bi = false;
public int at;
int aP;
int aN;
boolean aJ;
int am;
int al;
public static int ax;
private static a aY;
private static boolean aR;
private static int an;
private static boolean ay;
private static int a1;
public static boolean bH;
private long bG;
private long bE;
private long bD;
public GameMIDlet ak;
private Thread ap;
public static boolean bv = true;
public static a bM;
private static int bS;
public static boolean bQ;
private static int aT;
public static boolean ao;
public static boolean bO;
public static boolean aq;
public static boolean bq;
private static boolean a9;
private static int bf;
private static String bx;
private static boolean bg;
private static String bU[];
public static boolean bL;
static boolean aG;
private static int a3;
private static byte aI;
private byte bR[][] = {
{
2, 2, 2, 3, 2, 3, 1, 3, 7
}, {
1, 3, 10, 2, 10, 5, 3, 3, 7
}, {
1, 6, 10, 2, 3, 8, 3, 5, 2, 3,
5, 3, 4, 6, 8
}, {
1, 6, 0, 2, 6, 1, 3, 0, 5, 4,
1, 5, 5, 11, 4, 6, 11, 8, 7, 7,
11, 8, 2, 11
}, {
1, 8, 5, 3, 4, 7, 2, 6, 8
}, {
1, 7, 2, 2, 4, 8, 3, 2, 2
}, {
1, 6, 3, 2, 1, 1, 3, 1, 2, 4,
2, 2, 4, 2, 1, 5, 4, 1
}, {
1, 8, 6, 2, 3, 5
}, {
1, 7, 0, 2, 7, 1, 3, 22, 24
}, {
1, 5, 0, 2, 5, 1, 3, 1, 8
}, {
1, 3, 0, 2, 3, 1, 3, 1, 2
}
};
private static byte bb[] = {
1, 1, 1, 0, 1, 1, 1, 1, 0, 1,
1
};
static boolean aC = true;
long be;
long bc;
g aF;
public c(GameMIDlet gamemidlet)
{
at = 0;
aP = 160;
aN = 0;
am = 95;
al = 30;
be = 0L;
bc = 0L;
o();
aH = new h(this);
a5 = 0;
bS = 0;
bm = 0;
bK = 0;
bl = 0;
bz = 0;
bh = 0;
a7 = false;
aB = 1;
bG = 0L;
bE = 0L;
bD = 0L;
ak = gamemidlet;
ap = null;
ap = new Thread(this);
ap.start();
}
protected void showNotify()
{
bg = false;
}
protected void hideNotify()
{
bg = true;
}
public void run()
{
long();
while (bv)
while (!bg)
u();
void();
ak.notifyDestroyed();
bv = true;
}
public void c(int i1)
{
bG = System.currentTimeMillis();
repaint();
bE = System.currentTimeMillis();
bD = bE - bG;
if (bD < (long)i1)
try
{
Thread.sleep((long)i1 - bD);
}
catch (InterruptedException interruptedexception) { }
}
int void(int i1)
{
int j1;
if (i1 >= 48 && i1 <= 57 || i1 == -7 || i1 == -6 || i1 == 8 || i1 == 35 || i1 == 42)
j1 = i1;
else
j1 = getGameAction(i1);
return j1;
}
protected void keyPressed(int i1)
{
if (aC)
{
int j1 = void(i1);
if (j1 == -6)
{
null(-6);
return;
}
if (j1 == -7)
{
null(-7);
return;
}
switch (j1)
{
case 1: // '\001'
case 50: // '2'
null(1);
break;
case 6: // '\006'
case 56: // '8'
null(6);
break;
case 2: // '\002'
case 52: // '4'
null(2);
break;
case 5: // '\005'
case 54: // '6'
null(5);
break;
case 8: // '\b'
case 53: // '5'
null(8);
break;
}
}
}
public void keyReleased(int i1)
{
null(0);
}
public void j()
{
bN = 0;
aA = 0;
bC = 8;
bA = 8;
bI = 0;
aM = 3;
ba.E();
aw.int();
bB.L();
a9 = false;
k.da = false;
j.cU = false;
ao = true;
}
public void o()
{
bP = 0;
bs = Font.getFont(0, 0, 16);
a2 = bs.getHeight();
br = new Vector();
bM = new a(a("/images/softkey.png"), 14, 12);
}
void k()
{
bt = a("/images/talk1.png");
av = new a(a("/images/talkHead.png"), 24, 24);
a8 = a("/images/talk.png");
}
void s()
{
bu = new e();
au = new i();
}
void e()
{
aK = new f(this);
}
void p()
{
aU = new a(a("/images/fonts.png"), 8, 10);
bk = new a(a("/images/button.png"), 25, 15);
}
void i()
{
aw = new b(this);
}
void case()
{
aW = new a(24, 40);
aW.a(new byte[][] {
new byte[] {
0, 1, 0, 2
}, new byte[] {
3, 4, 3, 5
}, new byte[] {
6, 7, 6, 8
}, new byte[] {
9, 10, 9, 11
}
}, new byte[] {
2, 2, 2, 2
});
aW.a(a("/images/player.png"));
}
void null()
{
ba = new j(this);
}
void m()
{
bB = new k(this);
}
public void u()
{
switch (aB)
{
case 0: // '\0'
if (aR && ay)
{
an++;
ay = false;
break;
}
if (bi && !bd && !a4)
{
if (at == a0.length - 2)
at = 0;
else
at++;
c(100);
break;
}
if (bh == 0 && aL && !bd && !a4)
{
ba.r(j.cY);
break;
}
if (!bd && !a4)
l();
if (b.ah)
if((byte)4);
if (aG)
{
if (a3 > 100)
{
aG = false;
a3 = 0;
}
a3++;
}
c(30);
break;
case 3: // '\003'
bB.N();
c(60);
break;
case 5: // '\005'
if (bO)
switch (az)
{
case 6: // '\006'
bB.dY = new a(bB.dm[bB.dr][0], bB.dm[bB.dr][1]);
bB.dY.a(bB.dG[bB.dr], (byte)1);
break;
case 5: // '\005'
if (bB.dr == 6)
{
bB.dp = true;
bB.dY.a(a("/images/boss.png"));
bB.c7 = new a(a("/images/bossM.png"), 48, 156);
bB.c7.void(15, 156);
bB.c7.a(new byte[][] {
new byte[] {
0, 1, 2
}
}, new byte[] {
2
});
} else
{
bB.dp = false;
bB.dY.a(a("/images/Enemy" + bB.dr + ".png"));
}
break;
case 4: // '\004'
bB.dY.void(15, bB.dm[bB.dr][1]);
if (!bB.dU)
bB.dT = new a(a("/images/monster.png"), 57, 15);
break;
case 3: // '\003'
long(30);
break;
case 2: // '\002'
if (bI == 9 || bI == 6)
bB.dK = a("/images/fight1.png");
else
bB.dK = a("/images/fight2.png");
break;
case 1: // '\001'
if (k.da)
bB.J();
break;
case 0: // '\0'
az = 8;
bO = false;
aB = 3;
break;
}
else
switch (az)
{
case 5: // '\005'
v();
f(bI);
aK.w();
break;
case 4: // '\004'
ba.D();
break;
case 2: // '\002'
aK.x();
aW.b(76, 55);
break;
case 0: // '\0'
az = 8;
aB = 0;
bq = false;
aG = true;
break;
}
if (!bL)
az--;
c(30);
break;
case 1: // '\001'
if (h.cB == 8 && h.cC > 100)
{
aH.C();
h.cB = 0;
h.cM = false;
aH.cG = null;
h.cC = 0;
}
c(50);
break;
case 2: // '\002'
case 4: // '\004'
default:
c(30);
break;
}
}
void c(Graphics g1)
{
aK.f(g1);
char(g1);
g1.setColor(255, 255, 255);
aH.a(g1, 12, 10, e.char[bI], 255, 0xffffff, 0);
g1.setColor(0);
g1.fillRect(0, 160, 176, 48);
g1.drawImage(a8, 0, 160, 20);
av.try(g1, 14, 171, a1);
do(g1, 53, 167, false);
if (aQ)
aH.cA.try(g1, 156, 195, 1);
else
aH.cA.try(g1, 156, 196, 1);
aI++;
if (aI >= 10)
{
aQ = !aQ;
aI = 0;
}
aA = 0;
if (a1 == 0)
bM.try(g1, 80, 44, 5);
else
switch (a5)
{
default:
break;
case 1: // '\001'
if (a1 == 8)
bM.try(g1, 112, 24, 5);
else
bM.try(g1, 98, 38, 5);
break;
case 2: // '\002'
bM.try(g1, 66, 54, 5);
break;
case 3: // '\003'
bM.try(g1, 66, 38, 5);
break;
case 4: // '\004'
bM.try(g1, 98, 54, 5);
break;
}
}
void n()
{
aH.C();
h.cB = 0;
h.cM = false;
aB = 1;
bS = 0;
aZ = null;
bJ = false;
aL = false;
try();
}
public void paint(Graphics g1)
{
g1.setFont(bs);
switch (aB)
{
case 1: // '\001'
aH.m(g1);
break;
case 0: // '\0'
if (bd && !bi)
{
c(g1);
return;
}
if (a4)
{
if (bJ)
{
g1.drawImage(aZ, 0, 0, 20);
bS++;
if (bS > 80)
{
n();
return;
}
} else
{
else(g1);
}
} else
{
long(g1);
}
break;
case 2: // '\002'
case(g1);
aw.a(g1);
break;
case 3: // '\003'
bB.p(g1);
break;
case 4: // '\004'
case(g1);
aw.do(g1);
break;
case 5: // '\005'
if(g1, az, 10, true);
break;
}
if (!bd)
b(g1);
}
public void long(Graphics g1)
{
aK.f(g1);
char(g1);
case(g1);
g1.setColor(255, 255, 255);
aH.a(g1, 12, 10, e.char[bI], 255, 0xffffff, 0);
if (!bQ && !a9)
bM.try(g1, 2, 196, 0);
bM.try(g1, 162, 196, 3);
if (a9)
{
byte(g1);
bf++;
if ((bf / 10) % 2 == 0)
bM.try(g1, 2, 196, 0);
if (bf > 100 || a7)
{
a9 = false;
bf = 0;
bx = null;
}
}
if (bQ)
{
if ((aT / 10) % 2 == 0)
{
bM.try(g1, 2, 196, 0);
bM.try(g1, 83, 41, 4);
}
aT++;
if (aT > 100)
{
bQ = false;
aT = 0;
}
}
if (bi)
goto(g1);
if (aR)
if (an < 8)
{
ay = true;
aY.try(g1, 63, 54, an / 2);
long(100);
} else
{
goto();
}
}
public void case(Graphics g1)
{
g1.setClip(0, 0, 176, 208);
g1.drawImage(a8, 0, 160, 20);
av.try(g1, 14, 180, 0);
b.M.try(g1, 5, 166, 9);
a(g1, k.c6, 31, 166, 2, 1);
g1.setClip(55, 169, 110, 13);
g1.drawImage(bt, 55, 169, 20);
g1.setClip(55, 183, 110, 13);
g1.drawImage(bt, 55, 183, 20);
g1.setClip(71, 173, (85 * bB.y(0)) / 100, 5);
g1.drawImage(bt, 71, 160, 20);
g1.setClip(71, 187, (85 * bB.y(1)) / 100, 5);
g1.drawImage(bt, 71, 169, 20);
g1.setClip(0, 0, 176, 208);
g1.setColor(0x512705);
g1.fillRect(55, 199, 109, 2);
g1.setColor(0x43c449);
g1.fillRect(55, 199, (109 * bB.G()) / 100, 1);
g1.setColor(0x91ff96);
g1.fillRect(55, 200, (109 * bB.G()) / 100, 1);
}
void if(Graphics g1, int i1, int j1, boolean flag)
{
if (flag)
{
g1.setColor(0, 0, 0);
g1.fillRect(0, 0, 176, 208);
}
g1.setColor(0xe504f9);
if (bq)
g1.drawString("前往 “" + e.char[bI] + "”", 88, 60, 17);
g1.drawString("载入中....", 88, 90, 17);
g1.setColor(33535);
g1.drawRect(62, 129, 52, 5);
g1.setColor(0xff7800);
g1.drawLine(63, 132, 63 + ((j1 - i1) * 50) / j1, 132);
g1.setColor(0xffc000);
g1.drawLine(63, 131, 63 + ((j1 - i1) * 50) / j1, 131);
g1.setColor(0x7e3c01);
g1.drawRect(63, 130, ((j1 - i1) * 50) / j1, 3);
}
public void a(byte byte0)
{
aC = false;
a6 = false;
bd = false;
bU = null;
bU = e.long[byte0];
a6 = true;
bd = true;
bP = 0;
aC = true;
new();
}
private void new()
{
if (bd)
if (br.size() <= bK)
{
try();
} else
{
for (int i1 = 0; i1 < bK; i1++)
br.removeElementAt(0);
return;
}
if (bP < bU.length)
{
String s1 = bU[bP];
a1 = Integer.parseInt(s1.substring(0, 2));
a(s1.substring(2, s1.length()), 110, 2);
bP++;
} else
{
a6 = false;
bd = false;
bP = 0;
try();
}
}
public void do(Graphics g1, int i1, int j1)
{
if (i1 >= 0)
bk.try(g1, 6, 194, i1);
if (j1 >= 0)
bk.try(g1, 144, 194, j1);
}
public void a(Graphics g1, int i1, int j1, int k1, int l1, int i2)
{
String s1 = String.valueOf(Math.abs(i1));
if (s1.length() < (i1 >= 0 ? l1 : l1 - 1))
{
for (int j2 = 0; j2 < l1 - s1.length(); j2++)
{
aU.try(g1, j1, k1, 10 + 11 * i2);
j1 += 8;
}
}
for (int k2 = 0; k2 < s1.length(); k2++)
{
int l2 = s1.charAt(k2) - 48;
aU.try(g1, j1 + 8 * k2, k1, l2 + 11 * i2);
}
}
public void void()
{
b();
long(40);
bg = true;
bv = false;
}
private byte[] t()
throws IOException
{
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);
if (b.R)
dataoutputstream.writeByte(1);
else
dataoutputstream.writeByte(0);
if (b.P)
dataoutputstream.writeByte(1);
else
dataoutputstream.writeByte(0);
if (b.K)
dataoutputstream.writeByte(1);
else
dataoutputstream.writeByte(0);
dataoutputstream.writeInt(bA);
dataoutputstream.writeInt(bC);
dataoutputstream.writeInt(bI);
dataoutputstream.writeInt(bN);
dataoutputstream.writeInt(k.dl);
dataoutputstream.writeByte(k.c6);
dataoutputstream.writeByte(b.aa);
if (k.da)
dataoutputstream.writeByte(1);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?