From f9f1a85eff8ef523999b22833b385f6718ed50d1 Mon Sep 17 00:00:00 2001 From: sillysagiri Date: Mon, 14 Oct 2024 23:09:58 +0700 Subject: [PATCH] move thread into app --- src/dothack/DotHack.java | 4 + src/dothack/DotHackC.java | 2074 +++++++++++++++++++------------------ 2 files changed, 1054 insertions(+), 1024 deletions(-) diff --git a/src/dothack/DotHack.java b/src/dothack/DotHack.java index 95fafb7..02d5347 100644 --- a/src/dothack/DotHack.java +++ b/src/dothack/DotHack.java @@ -31,9 +31,13 @@ public class DotHack extends MIDlet implements Runnable { while (true) { try { + sagiri.time_begin = System.currentTimeMillis(); + game.repaint(); game.serviceRepaints(); Thread.sleep(1000/sagiri.fps); + + sagiri.time_delta = System.currentTimeMillis() - sagiri.time_begin; } catch (Exception e) { diff --git a/src/dothack/DotHackC.java b/src/dothack/DotHackC.java index af72e44..1c488a9 100644 --- a/src/dothack/DotHackC.java +++ b/src/dothack/DotHackC.java @@ -16,12 +16,14 @@ import javax.microedition.rms.RecordStore; // import mmpp.microedition.lcdui.GraphicsX; // import mmpp.phone.Phone; +import sillysagiri.Sagiri; import sillysagiri.Scene; import sillysagiri.scene.Intro; public class DotHackC extends Canvas { DotHack midlet; - Thread thread; + Sagiri sagiri; + private Random ran; private Player mpl; private String[] str; @@ -130,25 +132,55 @@ public class DotHackC extends Canvas { public DotHackC(DotHack app) { setFullScreenMode(true); + midlet = app; + sagiri = app.sagiri; - this.midlet = app; - this.bG = Image.createImage(120, 133); - this.bgG = this.bG.getGraphics(); - this.mpl = null; - this.ran = new Random(); - this.soundS = true; - this.volumLevel = 3; - this.state_main = 9; - this.bool_preload = true; - this.counter100 = -1; + bG = Image.createImage(120, 133); + bgG = bG.getGraphics(); + mpl = null; + ran = new Random(); + soundS = true; + volumLevel = 3; + state_main = 9; + bool_preload = true; + counter100 = -1; try { - Set_Scene(new Intro()); + sagiri.Set_Scene(new Intro()); } catch (IOException e) { + // TODO Auto-generated catch block e.printStackTrace(); } - thread = new Thread(this); - this.thread.start(); + } + + public void paint(Graphics g) + { + sagiri.Update(g); + } + + protected void keyPressed(int keycode) + { + sagiri.input.HandleKeyDown(keycode); + } + + protected void keyReleased(int keycode) + { + sagiri.input.HandleKeyUp(keycode); + } + + protected void pointerPressed(int x, int y) + { + sagiri.input.HandleTouch(Sagiri.TOUCH_BEGIN, x, y); + } + + protected void pointerReleased(int x, int y) + { + sagiri.input.HandleTouch(Sagiri.TOUCH_END, x, y); + } + + protected void pointerDragged(int x, int y) + { + sagiri.input.HandleTouch(Sagiri.TOUCH_DRAG, x, y); } public void soundPlay(int id) { @@ -212,14 +244,8 @@ public class DotHackC extends Canvas { this.aS = 0; this.useK = 0; } - - public void paint(Graphics g) { - if (_scene_current != null) _scene_current.Draw(g); - } public void paint2(Graphics g) { - if (_scene_current != null) _scene_current.Draw(g); - // probably to render bellow device built-in ui // doesnt need this anymore since midp2.0 allow to do fullscreen // if (getHeight() == 143) @@ -3459,1008 +3485,1008 @@ public class DotHackC extends Canvas { paramGraphics.setClip(0, 0, 120, 133); } - public void keyPressed(int paramInt) { - if (this.state_main == 10) { - if (paramInt == -5) { - this.state_main = 11; - this.bool_preload = true; - } - } else if (this.state_main == 11) { - if (paramInt == -5) { - this.state_main = 20; - this.bool_preload = true; - // this.mpl.stop(); - // this.mpl.setPlayBackLoop(false); - this.imgS_1 = null; - this.imgS_3 = null; - } - } else if (this.state_main == 20) { - if (paramInt == -1) { - this.selectX = (byte)(this.selectX - 1); - if (this.selectX == -1) - this.selectX = 6; - this.oneSoundS = true; - } else if (paramInt == -2) { - this.selectX = (byte)(this.selectX + 1); - if (this.selectX == 7) - this.selectX = 0; - this.oneSoundS = true; - } else if (paramInt == 49 || (paramInt == -5 && this.selectX == 0)) { - this.state_main = 30; - this.bool_preload = true; - this.img_1 = null; - this.imgS_1 = null; - } else if (paramInt == 50 || (paramInt == -5 && this.selectX == 1)) { - this.img_1 = null; - this.imgS_1 = null; - this.state_main = 100; - try { - RecordStore recordStore = RecordStore.openRecordStore("saveData", true); - if (recordStore.getNumRecords() == 0) { - this.state_main = 30; - this.bool_preload = true; - } else { - this.aS = 0; - this.bool_preload = true; - gameStartVarInit(); - String str = new String(recordStore.getRecord(recordStore.getNextRecordID() - 1)); - int i = 0; - int j = str.indexOf("/", i); - this.myHP[0] = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myHP[1] = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myHP[2] = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.mySP[0] = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.mySP[1] = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.mySP[2] = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myWP[0] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myWP[1] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myWP[2] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[0] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[1] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[2] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[3] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[4] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[5] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[6] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[7] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myItem[8] = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.myEX = Integer.parseInt(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.cuFloor = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.lastFloor = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.cuDBX = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.cuDBY = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.indexOf("/", i); - this.cuDBP = Byte.parseByte(str.substring(i, j)); - i = j + 1; - j = str.length(); - this.GP = Integer.parseInt(str.substring(i, j)); - int k = this.myEX; - byte b1 = 1; - byte b2 = 10; - while (true) { - k -= b2; - if (k >= 0) { - b1++; - k -= b2; - b2 += 20; - continue; - } - this.myLV[0] = (byte)b1; - k = this.myEX; - b1 = 1; - b2 = 10; - while (true) { - k -= b2; - if (k >= 0) { - b1++; - k -= b2; - b2 += 10; - continue; - } - this.myLV[1] = (byte)b1; - k = this.myEX; - b1 = 1; - b2 = 15; - while (true) { - k -= b2; - if (k >= 0) { - b1++; - k -= b2; - b2 += 15; - continue; - } - this.myLV[2] = (byte)b1; - loadTypeImg(this.cuFloor + 10); - createD(this.cuFloor); - this.dLoadType = 0; - if (this.mapAB[this.cuDBY][this.cuDBX] == 8 || this.mapAB[this.cuDBY][this.cuDBX] == 9) { - this.mapAB[this.cuDBY][this.cuDBX] = 0; - } else if (this.mapAB[this.cuDBY][this.cuDBX] == 6) { - this.mapAB[this.cuDBY][this.cuDBX] = 7; - } - this.state_main = 40; - recordStore.closeRecordStore(); - } - // break; - } - // break; - } - } - recordStore.closeRecordStore(); - } catch (Exception exception) {} - } else if (paramInt == 51 || (paramInt == -5 && this.selectX == 2)) { - this.state_main = 21; - this.bool_preload = true; - } else if (paramInt == 52 || (paramInt == -5 && this.selectX == 3)) { - this.state_main = 23; - this.bool_preload = true; - } else if (paramInt == 53 || (paramInt == -5 && this.selectX == 4)) { - this.state_main = 22; - this.bool_preload = true; - } else if (paramInt == 54 || (paramInt == -5 && this.selectX == 5)) { - this.state_main = 24; - this.bool_preload = true; - } else if (paramInt == 55 || (paramInt == -5 && this.selectX == 6)) { - this.midlet.destroyApp(false); - this.midlet.notifyDestroyed(); - } - } else if (this.state_main == 21) { - if (paramInt == -5) { - this.state_main = 20; - this.bool_preload = true; - this.str = null; - this.imgS_1 = null; - this.imgS_2 = null; - } - if (paramInt == -3) { - if (this.aS > 0) { - this.aS = (byte)(this.aS - 1); - } else { - this.aS = 3; - } - this.aS2 = 0; - } else if (paramInt == -4) { - if (this.aS < 3) { - this.aS = (byte)(this.aS + 1); - } else { - this.aS = 0; - } - this.aS2 = 0; - } else if (paramInt == -1 && this.aS == 2) { - if (this.aS2 > 0) { - this.aS2 = (byte)(this.aS2 - 1); - } else { - this.aS2 = 2; - } - } else if (paramInt == -2 && this.aS == 2) { - if (this.aS2 < 2) { - this.aS2 = (byte)(this.aS2 + 1); - } else { - this.aS2 = 0; - } - } else if ((paramInt == -1 || paramInt == -2) && this.aS == 3) { - if (this.aS2 == 0) { - this.aS2 = 1; - } else { - this.aS2 = 0; - } - } - } else if (this.state_main == 22) { - if (this.aS == 1) { - if (paramInt == 49) { - this.aS = 2; - } else if (paramInt == 50 || paramInt == -5) { - this.state_main = 20; - this.bool_preload = true; - } - } else if ((this.aS == 4 || this.aS == 5) && paramInt == -5) { - this.state_main = 20; - this.bool_preload = true; - } - } else if (this.state_main == 23) { - if (paramInt == -1 || paramInt == -2) { - if (this.selectX == 0) { - this.selectX = 1; - } else { - this.selectX = 0; - } - } else if (paramInt == -3) { - if (this.selectX == 0) { - this.volumLevel = (byte)(this.volumLevel - 1); - if (this.volumLevel == 0) { - this.soundS = false; - } else if (this.volumLevel < 0) { - this.volumLevel = 4; - this.soundS = true; - } - // this.mpl.setVolumeLevel(this.volumLevel + ""); - this.onePaintS = true; - } else if (this.vibrationS) { - this.vibrationS = false; - // Vibration.stop(); - } else { - this.vibrationS = true; - // Vibration.start(100, 2000); - } - } else if (paramInt == -4) { - if (this.selectX == 0) { - this.volumLevel = (byte)(this.volumLevel + 1); - if (this.volumLevel == 1) { - this.soundS = true; - } else if (this.volumLevel > 4) { - this.volumLevel = 0; - this.soundS = false; - } - // this.mpl.setVolumeLevel(this.volumLevel + ""); - this.onePaintS = true; - } else if (this.vibrationS) { - this.vibrationS = false; - // Vibration.stop(); - } else { - this.vibrationS = true; - // Vibration.start(100, 2000); - } - } else if (paramInt == -5) { - this.state_main = 20; - this.bool_preload = true; - } - } else if (this.state_main == 24) { - if (paramInt == -5) { - this.state_main = 20; - this.bool_preload = true; - } - } else if (this.state_main == 30) { - if (paramInt == -5 && this.selectX2 < 64) { - this.selectX2 += 2; - } else if (paramInt == -7 || paramInt == 35) { - this.selectX2 = 52; - } - } else if (this.state_main == 31 && this.aS == 1) { - if (paramInt == -5 && this.selectX2 < 5) { - this.selectX2++; - } else if ((paramInt == -5 && this.selectX2 == 5) || paramInt == -7 || paramInt == 35) { - this.aS = 2; - } - } else if (this.state_main == 32) { - if (paramInt == -5 && this.selectX2 < 9) { - this.selectX2 += 2; - } else if (paramInt == -7 || paramInt == 35) { - this.selectX2 = 10; - } - } else if (this.state_main == 40) { - if (this.aS == 0 && !this.chMove) { - if (paramInt == -1 || paramInt == 50) { - this.chSee = 1; - this.useK = -1; - } else if (paramInt == -2 || paramInt == 53) { - this.chSee = 0; - this.useK = -2; - } else if (paramInt == -3 || paramInt == 52) { - this.chSee = 2; - this.useK = -3; - } else if (paramInt == -4 || paramInt == 54) { - this.chSee = 3; - this.useK = -4; - } else if (paramInt == -7) { - this.state_main = 60; - this.bool_preload = true; - this.selectX = 0; - this.selectX2 = 0; - this.aS2 = 0; - } else if (paramInt == -6 || paramInt == 42) { - this.aS = 50; - this.selectX = 0; - this.onePaintS = true; - } else if (paramInt == 35) { - this.aS = 51; - this.onePaintS = true; - } - } else if (this.aS == 35) { - if (paramInt == -1) { - if (this.selectX > 0) { - this.selectX = (byte)(this.selectX - 1); - } else { - this.selectX = 5; - } - this.oneSoundS = true; - } else if (paramInt == -2) { - if (this.selectX < 5) { - this.selectX = (byte)(this.selectX + 1); - } else { - this.selectX = 0; - } - this.oneSoundS = true; - } else if (paramInt == -5) { - if (this.aS2 == 2) { - this.aS2 = 0; - } else { - this.aS2 = 1; - } - } - } else if (this.aS == 50) { - if (paramInt == -6 || paramInt == 42) { - this.aS = 0; - this.imgS_1 = null; - this.imgS_2 = null; - } else if (paramInt == -1) { - this.selectX = (byte)(this.selectX - 1); - if (this.selectX == -1) - this.selectX = 4; - } else if (paramInt == -2) { - this.selectX = (byte)(this.selectX + 1); - if (this.selectX == 5) - this.selectX = 0; - } else if ((paramInt == -5 && this.selectX == 0) || paramInt == 49) { - this.aS = 0; - this.imgS_1 = null; - } else if ((paramInt == -5 && this.selectX == 1) || paramInt == 50) { - this.selectX = 1; - this.counter = 0; - this.oneSoundS = true; - } else if ((paramInt == -5 && this.selectX == 2) || paramInt == 51) { - this.selectX = 2; - this.volumLevel = (byte)(this.volumLevel + 1); - if (this.volumLevel == 1) { - this.soundS = true; - } else if (this.volumLevel > 4) { - this.volumLevel = 0; - this.soundS = false; - } - // this.mpl.setVolumeLevel(this.volumLevel + ""); - } else if ((paramInt == -5 && this.selectX == 3) || paramInt == 52) { - this.state_main = 20; - this.bool_preload = true; - this.mapAB = null; - this.mapB = null; - this.myItem = null; - this.myWP = null; - this.myLV = null; - this.myHP = null; - this.mySP = null; - this.monMapXY = null; - this.img_whiteNum = null; - this.img_redNum = null; - this.imgS_1 = null; - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.img_1 = null; - this.img_floor = null; - this.img_char = null; - System.gc(); - } else if ((paramInt == -5 && this.selectX == 4) || paramInt == 53) { - this.midlet.destroyApp(false); - this.midlet.notifyDestroyed(); - } - } else if (this.aS == 51 && paramInt == 35) { - this.aS = 0; - this.imgS_1 = null; - } - } else if (this.state_main == 41) { - if (paramInt == -5 && !this.bool_preload) { - this.imgS_3 = null; - this.str = null; - this.bool_preload = true; - this.state_main = 42; - } - } else if (this.state_main == 42) { - if (this.aS == 1) { - if (paramInt == -3) { - if (this.selectX == 0) { - if (!this.myAttack[2] && this.myHP[2] > 0) { - this.selectX = 2; - } else if (!this.myAttack[1] && this.myHP[1] > 0) { - this.selectX = 1; - } else if (!this.myAttack[0] && this.myHP[0] > 0) { - this.selectX = 0; - } - } else if (this.selectX == 1) { - if (!this.myAttack[0] && this.myHP[0] > 0) { - this.selectX = 0; - } else if (!this.myAttack[2] && this.myHP[2] > 0) { - this.selectX = 2; - } else if (!this.myAttack[1] && this.myHP[1] > 0) { - this.selectX = 1; - } - } else if (this.selectX == 2) { - if (!this.myAttack[1] && this.myHP[1] > 0) { - this.selectX = 1; - } else if (!this.myAttack[0] && this.myHP[0] > 0) { - this.selectX = 0; - } else if (!this.myAttack[2] && this.myHP[2] > 0) { - this.selectX = 2; - } - } - } else if (paramInt == -4) { - if (this.selectX == 0) { - if (!this.myAttack[1] && this.myHP[1] > 0) { - this.selectX = 1; - } else if (!this.myAttack[2] && this.myHP[2] > 0) { - this.selectX = 2; - } else if (!this.myAttack[0] && this.myHP[0] > 0) { - this.selectX = 0; - } - } else if (this.selectX == 1) { - if (!this.myAttack[2] && this.myHP[2] > 0) { - this.selectX = 2; - } else if (!this.myAttack[0] && this.myHP[0] > 0) { - this.selectX = 0; - } else if (!this.myAttack[1] && this.myHP[1] > 0) { - this.selectX = 1; - } - } else if (this.selectX == 2) { - if (!this.myAttack[0] && this.myHP[0] > 0) { - this.selectX = 0; - } else if (!this.myAttack[1] && this.myHP[1] > 0) { - this.selectX = 1; - } else if (!this.myAttack[2] && this.myHP[2] > 0) { - this.selectX = 2; - } - } - } else if (paramInt == -5) { - this.aS = 2; - this.aS2 = 0; - } - } else if (this.aS == 2) { - if (paramInt == -3) { - if (this.aS2 > 0) { - this.aS2 = (byte)(this.aS2 - 1); - } else { - this.aS2 = 2; - } - this.selectY = 0; - } else if (paramInt == -4) { - if (this.aS2 < 2) { - this.aS2 = (byte)(this.aS2 + 1); - } else { - this.aS2 = 0; - } - this.selectY = 0; - } else if (paramInt == -7) { - this.aS = 1; - } - if (this.aS2 == 0) { - if (paramInt == -5) { - this.aS = 3; - this.selectY2 = 0; - this.useSkill = -1; - if (this.monHP[0] > 0) { - this.selectY2 = 0; - } else { - this.selectY2 = 1; - } - } - } else if (this.aS2 == 1) { - if (this.selectX == 0) { - if (paramInt == -1) { - if (this.selectY > 0) { - this.selectY = (byte)(this.selectY - 1); - } else { - this.selectY = 6; - } - } else if (paramInt == -2) { - if (this.selectY < 6) { - this.selectY = (byte)(this.selectY + 1); - } else { - this.selectY = 0; - } - } else if (paramInt == -5) { - if (this.selectY < 6) { - if (this.mySP[0] >= Global.skill_1SP[this.selectY]) { - this.useSkill = this.selectY; - this.aS = 3; - if (this.monHP[0] > 0) { - this.selectY2 = 0; - } else { - this.selectY2 = 1; - } - } else { - this.aS = 9; - } - } else if (this.mySP[0] == Global.SPD[0] + Global.SPG[0] * (this.myLV[0] - 1) && this.monHP[0] < Global.monHPD[this.monType] / 2 && this.monType > 5) { - this.useSkill = this.selectY; - this.aS = 3; - this.mySP[0] = 0; - if (this.monHP[0] > 0) { - this.selectY2 = 0; - } else { - this.selectY2 = 1; - } - } else { - this.aS = 9; - } - } - } else if (this.selectX == 1) { - if (paramInt == -1) { - if (this.selectY > 0) { - this.selectY = (byte)(this.selectY - 1); - } else { - this.selectY = 5; - } - } else if (paramInt == -2) { - if (this.selectY < 5) { - this.selectY = (byte)(this.selectY + 1); - } else { - this.selectY = 0; - } - } else if (paramInt == -5) { - if (this.mySP[1] >= Global.skill_1SP[this.selectY]) { - this.useSkill = this.selectY; - this.aS = 3; - if (this.monHP[0] > 0) { - this.selectY2 = 0; - } else { - this.selectY2 = 1; - } - } else { - this.aS = 9; - } - } - } else if (this.selectX == 2) { - if (paramInt == -1) { - if (this.selectY > 0) { - this.selectY = (byte)(this.selectY - 1); - } else { - this.selectY = 8; - } - } else if (paramInt == -2) { - if (this.selectY < 8) { - this.selectY = (byte)(this.selectY + 1); - } else { - this.selectY = 0; - } - } else if (paramInt == -5) { - if (this.mySP[2] >= Global.skill_3SP[this.selectY]) { - this.useSkill = this.selectY; - if (this.useSkill < 6) { - this.aS = 3; - if (this.monHP[0] > 0) { - this.selectY2 = 0; - } else { - this.selectY2 = 1; - } - } else { - this.aS = 4; - this.counter = -1; - } - } else { - this.aS = 9; - } - } - } - } else if (this.aS2 == 2) { - if (paramInt == -1) { - if (this.selectY > 0) { - this.selectY = (byte)(this.selectY - 1); - } else { - this.selectY = 8; - } - } else if (paramInt == -2) { - if (this.selectY < 8) { - this.selectY = (byte)(this.selectY + 1); - } else { - this.selectY = 0; - } - } else if (paramInt == -5) { - this.aS = 11; - if (this.myItem[this.selectY] > 0) { - this.aS2 = 1; - if (this.selectY == 5) { - if (!this.myPoison) - this.aS2 = 4; - } else if (this.selectY == 6) { - if (!this.myCurse) - this.aS2 = 4; - } else if (this.selectY == 7) { - if (this.myHP[0] != 0 && this.myHP[1] != 0 && this.myHP[2] != 0) - this.aS2 = 4; - } else if (this.selectY == 8 && (this.cuFloor == 0 || this.myHP[0] == 0)) { - this.aS2 = 4; - } - } else { - this.aS2 = 3; - } - } - } - } else if (this.aS == 3) { - if (paramInt == -1 || paramInt == -2) { - if (this.selectY2 == 0) { - if (this.monHP[1] > 0) - this.selectY2 = 1; - } else if (this.monHP[0] > 0) { - this.selectY2 = 0; - } - } else if (paramInt == -5) { - this.aS = 4; - this.counter = -1; - } else if (paramInt == -7) { - this.aS = 2; - } - } else if (this.aS == 6) { - if (!this.onePaintS) - if (paramInt == -3 || paramInt == -4) { - if (this.aS2 == 0) { - if (this.myHP[1] > 0) - this.aS2 = 1; - } else if (this.myHP[0] > 0) { - this.aS2 = 0; - } - } else if (paramInt == -5) { - this.onePaintS = true; - this.counter = 0; - } else if (paramInt == -7) { - this.aS = 2; - } - } else if (this.aS == 9) { - if (paramInt == -5) - this.aS = 1; - } else if (this.aS == 10) { - if (paramInt == -5 && this.aS2 == 1) { - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.imgS_6 = null; - this.myAttack = null; - this.mapAB[this.cuDBY][this.cuDBX] = 0; - loadTypeImg(this.cuFloor + 10); - this.aS = 0; - this.bool_preload = true; - this.state_main = 40; - } - } else if (this.aS == 11) { - if (this.aS2 == 3 || this.aS2 == 4) { - if (paramInt == -5) - this.aS = 1; - } else if (this.aS2 == 5) { - if (paramInt == -5) { - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.imgS_6 = null; - this.myAttack = null; - this.bool_preload = true; - this.aS = 0; - this.dLoadType = 10; - this.state_main = 40; - } - } else if (this.aS2 == 6) { - if (paramInt == -3 || paramInt == -4) { - if (this.selectY2 == 0) { - if (this.myHP[this.selectY3] == 0) - this.selectY2 = 1; - } else if (this.myHP[this.chStep] == 0) { - this.selectY2 = 0; - } - } else if (paramInt == -5) { - this.aS2 = 7; - this.counter = -1; - } - } - } else if (this.aS == 20 && paramInt == -5 && this.aS2 == 1) { - this.mapAB = null; - this.mapB = null; - this.monMapXY = null; - this.myAttack = null; - this.myItem = null; - this.myWP = null; - this.myLV = null; - this.myHP = null; - this.mySP = null; - this.state_main = 20; - this.bool_preload = true; - // this.mpl.stop(); - this.img_whiteNum = null; - this.img_redNum = null; - this.imgS_1 = null; - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.img_1 = null; - this.img_floor = null; - this.img_char = null; - System.gc(); - } - } else if (this.state_main == 44) { - if (this.aS < 11 && paramInt == -5) - this.aS = (byte)(this.aS + 2); - } else if (this.state_main == 50) { - if (this.aS == 1) { - if (paramInt == -1) { - this.selectX = (byte)(this.selectX - 1); - if (this.selectX == -1) - this.selectX = 8; - soundPlay(16); - } else if (paramInt == -2) { - this.selectX = (byte)(this.selectX + 1); - if (this.selectX == 9) - this.selectX = 0; - soundPlay(16); - } else if (paramInt == -5 || paramInt == -4) { - this.aS = 2; - this.aS2 = 0; - } - } else if (this.aS == 2) { - if (this.aS2 == 0) { - if (paramInt == -1) { - this.selectY = (byte)(this.selectY - 1); - if (this.selectY == -1) - this.selectY = 2; - soundPlay(13); - } else if (paramInt == -2) { - this.selectY = (byte)(this.selectY + 1); - if (this.selectY == 3) - this.selectY = 0; - soundPlay(13); - } else if (paramInt == -3) { - this.aS = 1; - } else if (paramInt == -5) { - if (this.selectY == 0) { - if (this.GP >= Global.itemGP[this.selectX]) { - if (this.myItem[this.selectX] == 99) { - this.oneSoundS = true; - this.aS2 = 4; - } else { - this.aS2 = 1; - this.onePaintS = true; - } - } else { - this.oneSoundS = true; - this.aS2 = 3; - } - } else if (this.selectY == 1) { - if (this.myItem[this.selectX] > 0) { - this.aS2 = 2; - this.onePaintS = true; - } else { - this.oneSoundS = true; - this.aS2 = 5; - } - } else if (this.selectY == 2) { - this.aS = 0; - this.useK = 0; - this.movePage = true; - this.chMove = false; - this.chSee = 0; - this.cuDBY = (byte)(this.cuDBY + 1); - this.imgS_1 = null; - this.state_main = 40; - } - } - } else if (paramInt == -5) { - this.aS2 = 0; - this.aS = 1; - } - } - } else if (this.state_main == 51) { - if (this.aS == 1) { - if (paramInt == -3) { - this.selectX = (byte)(this.selectX - 1); - if (this.selectX == -1) - this.selectX = 2; - } else if (paramInt == -4) { - this.selectX = (byte)(this.selectX + 1); - if (this.selectX == 3) - this.selectX = 0; - } else if (paramInt == -5) { - this.aS = 2; - } else if (paramInt == -1) { - this.selectY = 2; - this.aS = 2; - } else if (paramInt == -2) { - this.selectY = 1; - this.aS = 2; - } - } else if (this.aS == 2) { - if (paramInt == -1) { - this.selectY = (byte)(this.selectY - 1); - if (this.selectY == -1) - this.selectY = 2; - soundPlay(13); - } else if (paramInt == -2) { - this.selectY = (byte)(this.selectY + 1); - if (this.selectY == 3) - this.selectY = 0; - soundPlay(13); - } else if (paramInt == -5 || paramInt == -3) { - if (this.selectY == 0) { - this.aS = 1; - } else if (this.selectY == 1) { - this.aS = 3; - this.aS2 = 0; - this.selectX2 = 1; - } else if (this.selectY == 2 && paramInt != -3) { - this.aS = 0; - this.useK = 0; - this.movePage = true; - this.chMove = false; - this.chSee = 0; - this.cuDBY = (byte)(this.cuDBY + 1); - this.imgS_1 = null; - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.state_main = 40; - } - } - } else if (this.aS == 3) { - if (paramInt == -1) { - this.selectX2--; - if (this.selectX2 == 0) - this.selectX2 = 5; - soundPlay(16); - } else if (paramInt == -2) { - this.selectX2++; - if (this.selectX2 == 6) - this.selectX2 = 1; - soundPlay(16); - } else if (paramInt == -4) { - this.aS = 2; - } else if (paramInt == -5) { - if (this.aS2 == 0) { - if (this.GP >= this.selectX2 * 1000) { - if (this.myLV[this.selectX] >= Global.weaponLVG[this.selectX2]) { - this.aS2 = 1; - this.onePaintS = true; - } else { - this.oneSoundS = true; - this.aS2 = 3; - } - } else { - this.oneSoundS = true; - this.aS2 = 2; - } - } else { - this.aS = 2; - this.aS2 = 0; - } - } - } - } else if (this.state_main == 55) { - if (paramInt == -5) { - this.mapAB = null; - this.mapB = null; - this.myItem = null; - this.myWP = null; - this.myLV = null; - this.myHP = null; - this.mySP = null; - this.monMapXY = null; - this.myAttack = null; - this.img_whiteNum = null; - this.img_redNum = null; - this.imgS_1 = null; - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.img_1 = null; - this.img_floor = null; - this.img_char = null; - this.str = null; - System.gc(); - this.bool_preload = true; - // this.mpl.stop(); - this.state_main = 20; - } - } else if (this.state_main == 60) { - if (paramInt == -3) { - if (this.selectX == 0) { - this.selectX = 2; - } else { - this.selectX = (byte)(this.selectX - 1); - } - } else if (paramInt == -4) { - if (this.selectX == 2) { - this.selectX = 0; - } else { - this.selectX = (byte)(this.selectX + 1); - } - } else if (paramInt == -1) { - if (this.selectX2 == 0) { - this.selectX2 = 8; - } else { - this.selectX2--; - } - } else if (paramInt == -2) { - if (this.selectX2 == 8) { - this.selectX2 = 0; - } else { - this.selectX2++; - } - } else if (paramInt == -5) { - if (this.aS2 == 0) { - if (this.myItem[this.selectX2] > 0) { - this.aS2 = 1; - if (this.selectX2 == 5) { - if (!this.myPoison) - this.aS2 = 4; - } else if (this.selectX2 == 6) { - if (!this.myCurse) - this.aS2 = 4; - } else if (this.selectX2 == 7) { - if (this.myHP[this.selectX] != 0) - this.aS2 = 4; - } else if (this.selectX2 == 8 && this.cuFloor == 0) { - this.aS2 = 4; - } - } else { - this.aS2 = 3; - } - } else if (this.aS2 == 5) { - if (paramInt == -5) { - this.aS = 0; - this.imgS_1 = null; - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.dLoadType = 10; - this.upDown = false; - this.state_main = 40; - } - } else { - this.aS2 = 0; - } - } else if (paramInt == -7) { - this.aS = 0; - this.imgS_1 = null; - this.imgS_2 = null; - this.imgS_3 = null; - this.imgS_4 = null; - this.imgS_5 = null; - this.movePage = true; - this.state_main = 40; - } - } - } + // public void keyPressed(int paramInt) { + // if (this.state_main == 10) { + // if (paramInt == -5) { + // this.state_main = 11; + // this.bool_preload = true; + // } + // } else if (this.state_main == 11) { + // if (paramInt == -5) { + // this.state_main = 20; + // this.bool_preload = true; + // // this.mpl.stop(); + // // this.mpl.setPlayBackLoop(false); + // this.imgS_1 = null; + // this.imgS_3 = null; + // } + // } else if (this.state_main == 20) { + // if (paramInt == -1) { + // this.selectX = (byte)(this.selectX - 1); + // if (this.selectX == -1) + // this.selectX = 6; + // this.oneSoundS = true; + // } else if (paramInt == -2) { + // this.selectX = (byte)(this.selectX + 1); + // if (this.selectX == 7) + // this.selectX = 0; + // this.oneSoundS = true; + // } else if (paramInt == 49 || (paramInt == -5 && this.selectX == 0)) { + // this.state_main = 30; + // this.bool_preload = true; + // this.img_1 = null; + // this.imgS_1 = null; + // } else if (paramInt == 50 || (paramInt == -5 && this.selectX == 1)) { + // this.img_1 = null; + // this.imgS_1 = null; + // this.state_main = 100; + // try { + // RecordStore recordStore = RecordStore.openRecordStore("saveData", true); + // if (recordStore.getNumRecords() == 0) { + // this.state_main = 30; + // this.bool_preload = true; + // } else { + // this.aS = 0; + // this.bool_preload = true; + // gameStartVarInit(); + // String str = new String(recordStore.getRecord(recordStore.getNextRecordID() - 1)); + // int i = 0; + // int j = str.indexOf("/", i); + // this.myHP[0] = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myHP[1] = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myHP[2] = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.mySP[0] = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.mySP[1] = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.mySP[2] = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myWP[0] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myWP[1] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myWP[2] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[0] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[1] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[2] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[3] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[4] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[5] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[6] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[7] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myItem[8] = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.myEX = Integer.parseInt(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.cuFloor = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.lastFloor = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.cuDBX = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.cuDBY = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.indexOf("/", i); + // this.cuDBP = Byte.parseByte(str.substring(i, j)); + // i = j + 1; + // j = str.length(); + // this.GP = Integer.parseInt(str.substring(i, j)); + // int k = this.myEX; + // byte b1 = 1; + // byte b2 = 10; + // while (true) { + // k -= b2; + // if (k >= 0) { + // b1++; + // k -= b2; + // b2 += 20; + // continue; + // } + // this.myLV[0] = (byte)b1; + // k = this.myEX; + // b1 = 1; + // b2 = 10; + // while (true) { + // k -= b2; + // if (k >= 0) { + // b1++; + // k -= b2; + // b2 += 10; + // continue; + // } + // this.myLV[1] = (byte)b1; + // k = this.myEX; + // b1 = 1; + // b2 = 15; + // while (true) { + // k -= b2; + // if (k >= 0) { + // b1++; + // k -= b2; + // b2 += 15; + // continue; + // } + // this.myLV[2] = (byte)b1; + // loadTypeImg(this.cuFloor + 10); + // createD(this.cuFloor); + // this.dLoadType = 0; + // if (this.mapAB[this.cuDBY][this.cuDBX] == 8 || this.mapAB[this.cuDBY][this.cuDBX] == 9) { + // this.mapAB[this.cuDBY][this.cuDBX] = 0; + // } else if (this.mapAB[this.cuDBY][this.cuDBX] == 6) { + // this.mapAB[this.cuDBY][this.cuDBX] = 7; + // } + // this.state_main = 40; + // recordStore.closeRecordStore(); + // } + // // break; + // } + // // break; + // } + // } + // recordStore.closeRecordStore(); + // } catch (Exception exception) {} + // } else if (paramInt == 51 || (paramInt == -5 && this.selectX == 2)) { + // this.state_main = 21; + // this.bool_preload = true; + // } else if (paramInt == 52 || (paramInt == -5 && this.selectX == 3)) { + // this.state_main = 23; + // this.bool_preload = true; + // } else if (paramInt == 53 || (paramInt == -5 && this.selectX == 4)) { + // this.state_main = 22; + // this.bool_preload = true; + // } else if (paramInt == 54 || (paramInt == -5 && this.selectX == 5)) { + // this.state_main = 24; + // this.bool_preload = true; + // } else if (paramInt == 55 || (paramInt == -5 && this.selectX == 6)) { + // this.midlet.destroyApp(false); + // this.midlet.notifyDestroyed(); + // } + // } else if (this.state_main == 21) { + // if (paramInt == -5) { + // this.state_main = 20; + // this.bool_preload = true; + // this.str = null; + // this.imgS_1 = null; + // this.imgS_2 = null; + // } + // if (paramInt == -3) { + // if (this.aS > 0) { + // this.aS = (byte)(this.aS - 1); + // } else { + // this.aS = 3; + // } + // this.aS2 = 0; + // } else if (paramInt == -4) { + // if (this.aS < 3) { + // this.aS = (byte)(this.aS + 1); + // } else { + // this.aS = 0; + // } + // this.aS2 = 0; + // } else if (paramInt == -1 && this.aS == 2) { + // if (this.aS2 > 0) { + // this.aS2 = (byte)(this.aS2 - 1); + // } else { + // this.aS2 = 2; + // } + // } else if (paramInt == -2 && this.aS == 2) { + // if (this.aS2 < 2) { + // this.aS2 = (byte)(this.aS2 + 1); + // } else { + // this.aS2 = 0; + // } + // } else if ((paramInt == -1 || paramInt == -2) && this.aS == 3) { + // if (this.aS2 == 0) { + // this.aS2 = 1; + // } else { + // this.aS2 = 0; + // } + // } + // } else if (this.state_main == 22) { + // if (this.aS == 1) { + // if (paramInt == 49) { + // this.aS = 2; + // } else if (paramInt == 50 || paramInt == -5) { + // this.state_main = 20; + // this.bool_preload = true; + // } + // } else if ((this.aS == 4 || this.aS == 5) && paramInt == -5) { + // this.state_main = 20; + // this.bool_preload = true; + // } + // } else if (this.state_main == 23) { + // if (paramInt == -1 || paramInt == -2) { + // if (this.selectX == 0) { + // this.selectX = 1; + // } else { + // this.selectX = 0; + // } + // } else if (paramInt == -3) { + // if (this.selectX == 0) { + // this.volumLevel = (byte)(this.volumLevel - 1); + // if (this.volumLevel == 0) { + // this.soundS = false; + // } else if (this.volumLevel < 0) { + // this.volumLevel = 4; + // this.soundS = true; + // } + // // this.mpl.setVolumeLevel(this.volumLevel + ""); + // this.onePaintS = true; + // } else if (this.vibrationS) { + // this.vibrationS = false; + // // Vibration.stop(); + // } else { + // this.vibrationS = true; + // // Vibration.start(100, 2000); + // } + // } else if (paramInt == -4) { + // if (this.selectX == 0) { + // this.volumLevel = (byte)(this.volumLevel + 1); + // if (this.volumLevel == 1) { + // this.soundS = true; + // } else if (this.volumLevel > 4) { + // this.volumLevel = 0; + // this.soundS = false; + // } + // // this.mpl.setVolumeLevel(this.volumLevel + ""); + // this.onePaintS = true; + // } else if (this.vibrationS) { + // this.vibrationS = false; + // // Vibration.stop(); + // } else { + // this.vibrationS = true; + // // Vibration.start(100, 2000); + // } + // } else if (paramInt == -5) { + // this.state_main = 20; + // this.bool_preload = true; + // } + // } else if (this.state_main == 24) { + // if (paramInt == -5) { + // this.state_main = 20; + // this.bool_preload = true; + // } + // } else if (this.state_main == 30) { + // if (paramInt == -5 && this.selectX2 < 64) { + // this.selectX2 += 2; + // } else if (paramInt == -7 || paramInt == 35) { + // this.selectX2 = 52; + // } + // } else if (this.state_main == 31 && this.aS == 1) { + // if (paramInt == -5 && this.selectX2 < 5) { + // this.selectX2++; + // } else if ((paramInt == -5 && this.selectX2 == 5) || paramInt == -7 || paramInt == 35) { + // this.aS = 2; + // } + // } else if (this.state_main == 32) { + // if (paramInt == -5 && this.selectX2 < 9) { + // this.selectX2 += 2; + // } else if (paramInt == -7 || paramInt == 35) { + // this.selectX2 = 10; + // } + // } else if (this.state_main == 40) { + // if (this.aS == 0 && !this.chMove) { + // if (paramInt == -1 || paramInt == 50) { + // this.chSee = 1; + // this.useK = -1; + // } else if (paramInt == -2 || paramInt == 53) { + // this.chSee = 0; + // this.useK = -2; + // } else if (paramInt == -3 || paramInt == 52) { + // this.chSee = 2; + // this.useK = -3; + // } else if (paramInt == -4 || paramInt == 54) { + // this.chSee = 3; + // this.useK = -4; + // } else if (paramInt == -7) { + // this.state_main = 60; + // this.bool_preload = true; + // this.selectX = 0; + // this.selectX2 = 0; + // this.aS2 = 0; + // } else if (paramInt == -6 || paramInt == 42) { + // this.aS = 50; + // this.selectX = 0; + // this.onePaintS = true; + // } else if (paramInt == 35) { + // this.aS = 51; + // this.onePaintS = true; + // } + // } else if (this.aS == 35) { + // if (paramInt == -1) { + // if (this.selectX > 0) { + // this.selectX = (byte)(this.selectX - 1); + // } else { + // this.selectX = 5; + // } + // this.oneSoundS = true; + // } else if (paramInt == -2) { + // if (this.selectX < 5) { + // this.selectX = (byte)(this.selectX + 1); + // } else { + // this.selectX = 0; + // } + // this.oneSoundS = true; + // } else if (paramInt == -5) { + // if (this.aS2 == 2) { + // this.aS2 = 0; + // } else { + // this.aS2 = 1; + // } + // } + // } else if (this.aS == 50) { + // if (paramInt == -6 || paramInt == 42) { + // this.aS = 0; + // this.imgS_1 = null; + // this.imgS_2 = null; + // } else if (paramInt == -1) { + // this.selectX = (byte)(this.selectX - 1); + // if (this.selectX == -1) + // this.selectX = 4; + // } else if (paramInt == -2) { + // this.selectX = (byte)(this.selectX + 1); + // if (this.selectX == 5) + // this.selectX = 0; + // } else if ((paramInt == -5 && this.selectX == 0) || paramInt == 49) { + // this.aS = 0; + // this.imgS_1 = null; + // } else if ((paramInt == -5 && this.selectX == 1) || paramInt == 50) { + // this.selectX = 1; + // this.counter = 0; + // this.oneSoundS = true; + // } else if ((paramInt == -5 && this.selectX == 2) || paramInt == 51) { + // this.selectX = 2; + // this.volumLevel = (byte)(this.volumLevel + 1); + // if (this.volumLevel == 1) { + // this.soundS = true; + // } else if (this.volumLevel > 4) { + // this.volumLevel = 0; + // this.soundS = false; + // } + // // this.mpl.setVolumeLevel(this.volumLevel + ""); + // } else if ((paramInt == -5 && this.selectX == 3) || paramInt == 52) { + // this.state_main = 20; + // this.bool_preload = true; + // this.mapAB = null; + // this.mapB = null; + // this.myItem = null; + // this.myWP = null; + // this.myLV = null; + // this.myHP = null; + // this.mySP = null; + // this.monMapXY = null; + // this.img_whiteNum = null; + // this.img_redNum = null; + // this.imgS_1 = null; + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.img_1 = null; + // this.img_floor = null; + // this.img_char = null; + // System.gc(); + // } else if ((paramInt == -5 && this.selectX == 4) || paramInt == 53) { + // this.midlet.destroyApp(false); + // this.midlet.notifyDestroyed(); + // } + // } else if (this.aS == 51 && paramInt == 35) { + // this.aS = 0; + // this.imgS_1 = null; + // } + // } else if (this.state_main == 41) { + // if (paramInt == -5 && !this.bool_preload) { + // this.imgS_3 = null; + // this.str = null; + // this.bool_preload = true; + // this.state_main = 42; + // } + // } else if (this.state_main == 42) { + // if (this.aS == 1) { + // if (paramInt == -3) { + // if (this.selectX == 0) { + // if (!this.myAttack[2] && this.myHP[2] > 0) { + // this.selectX = 2; + // } else if (!this.myAttack[1] && this.myHP[1] > 0) { + // this.selectX = 1; + // } else if (!this.myAttack[0] && this.myHP[0] > 0) { + // this.selectX = 0; + // } + // } else if (this.selectX == 1) { + // if (!this.myAttack[0] && this.myHP[0] > 0) { + // this.selectX = 0; + // } else if (!this.myAttack[2] && this.myHP[2] > 0) { + // this.selectX = 2; + // } else if (!this.myAttack[1] && this.myHP[1] > 0) { + // this.selectX = 1; + // } + // } else if (this.selectX == 2) { + // if (!this.myAttack[1] && this.myHP[1] > 0) { + // this.selectX = 1; + // } else if (!this.myAttack[0] && this.myHP[0] > 0) { + // this.selectX = 0; + // } else if (!this.myAttack[2] && this.myHP[2] > 0) { + // this.selectX = 2; + // } + // } + // } else if (paramInt == -4) { + // if (this.selectX == 0) { + // if (!this.myAttack[1] && this.myHP[1] > 0) { + // this.selectX = 1; + // } else if (!this.myAttack[2] && this.myHP[2] > 0) { + // this.selectX = 2; + // } else if (!this.myAttack[0] && this.myHP[0] > 0) { + // this.selectX = 0; + // } + // } else if (this.selectX == 1) { + // if (!this.myAttack[2] && this.myHP[2] > 0) { + // this.selectX = 2; + // } else if (!this.myAttack[0] && this.myHP[0] > 0) { + // this.selectX = 0; + // } else if (!this.myAttack[1] && this.myHP[1] > 0) { + // this.selectX = 1; + // } + // } else if (this.selectX == 2) { + // if (!this.myAttack[0] && this.myHP[0] > 0) { + // this.selectX = 0; + // } else if (!this.myAttack[1] && this.myHP[1] > 0) { + // this.selectX = 1; + // } else if (!this.myAttack[2] && this.myHP[2] > 0) { + // this.selectX = 2; + // } + // } + // } else if (paramInt == -5) { + // this.aS = 2; + // this.aS2 = 0; + // } + // } else if (this.aS == 2) { + // if (paramInt == -3) { + // if (this.aS2 > 0) { + // this.aS2 = (byte)(this.aS2 - 1); + // } else { + // this.aS2 = 2; + // } + // this.selectY = 0; + // } else if (paramInt == -4) { + // if (this.aS2 < 2) { + // this.aS2 = (byte)(this.aS2 + 1); + // } else { + // this.aS2 = 0; + // } + // this.selectY = 0; + // } else if (paramInt == -7) { + // this.aS = 1; + // } + // if (this.aS2 == 0) { + // if (paramInt == -5) { + // this.aS = 3; + // this.selectY2 = 0; + // this.useSkill = -1; + // if (this.monHP[0] > 0) { + // this.selectY2 = 0; + // } else { + // this.selectY2 = 1; + // } + // } + // } else if (this.aS2 == 1) { + // if (this.selectX == 0) { + // if (paramInt == -1) { + // if (this.selectY > 0) { + // this.selectY = (byte)(this.selectY - 1); + // } else { + // this.selectY = 6; + // } + // } else if (paramInt == -2) { + // if (this.selectY < 6) { + // this.selectY = (byte)(this.selectY + 1); + // } else { + // this.selectY = 0; + // } + // } else if (paramInt == -5) { + // if (this.selectY < 6) { + // if (this.mySP[0] >= Global.skill_1SP[this.selectY]) { + // this.useSkill = this.selectY; + // this.aS = 3; + // if (this.monHP[0] > 0) { + // this.selectY2 = 0; + // } else { + // this.selectY2 = 1; + // } + // } else { + // this.aS = 9; + // } + // } else if (this.mySP[0] == Global.SPD[0] + Global.SPG[0] * (this.myLV[0] - 1) && this.monHP[0] < Global.monHPD[this.monType] / 2 && this.monType > 5) { + // this.useSkill = this.selectY; + // this.aS = 3; + // this.mySP[0] = 0; + // if (this.monHP[0] > 0) { + // this.selectY2 = 0; + // } else { + // this.selectY2 = 1; + // } + // } else { + // this.aS = 9; + // } + // } + // } else if (this.selectX == 1) { + // if (paramInt == -1) { + // if (this.selectY > 0) { + // this.selectY = (byte)(this.selectY - 1); + // } else { + // this.selectY = 5; + // } + // } else if (paramInt == -2) { + // if (this.selectY < 5) { + // this.selectY = (byte)(this.selectY + 1); + // } else { + // this.selectY = 0; + // } + // } else if (paramInt == -5) { + // if (this.mySP[1] >= Global.skill_1SP[this.selectY]) { + // this.useSkill = this.selectY; + // this.aS = 3; + // if (this.monHP[0] > 0) { + // this.selectY2 = 0; + // } else { + // this.selectY2 = 1; + // } + // } else { + // this.aS = 9; + // } + // } + // } else if (this.selectX == 2) { + // if (paramInt == -1) { + // if (this.selectY > 0) { + // this.selectY = (byte)(this.selectY - 1); + // } else { + // this.selectY = 8; + // } + // } else if (paramInt == -2) { + // if (this.selectY < 8) { + // this.selectY = (byte)(this.selectY + 1); + // } else { + // this.selectY = 0; + // } + // } else if (paramInt == -5) { + // if (this.mySP[2] >= Global.skill_3SP[this.selectY]) { + // this.useSkill = this.selectY; + // if (this.useSkill < 6) { + // this.aS = 3; + // if (this.monHP[0] > 0) { + // this.selectY2 = 0; + // } else { + // this.selectY2 = 1; + // } + // } else { + // this.aS = 4; + // this.counter = -1; + // } + // } else { + // this.aS = 9; + // } + // } + // } + // } else if (this.aS2 == 2) { + // if (paramInt == -1) { + // if (this.selectY > 0) { + // this.selectY = (byte)(this.selectY - 1); + // } else { + // this.selectY = 8; + // } + // } else if (paramInt == -2) { + // if (this.selectY < 8) { + // this.selectY = (byte)(this.selectY + 1); + // } else { + // this.selectY = 0; + // } + // } else if (paramInt == -5) { + // this.aS = 11; + // if (this.myItem[this.selectY] > 0) { + // this.aS2 = 1; + // if (this.selectY == 5) { + // if (!this.myPoison) + // this.aS2 = 4; + // } else if (this.selectY == 6) { + // if (!this.myCurse) + // this.aS2 = 4; + // } else if (this.selectY == 7) { + // if (this.myHP[0] != 0 && this.myHP[1] != 0 && this.myHP[2] != 0) + // this.aS2 = 4; + // } else if (this.selectY == 8 && (this.cuFloor == 0 || this.myHP[0] == 0)) { + // this.aS2 = 4; + // } + // } else { + // this.aS2 = 3; + // } + // } + // } + // } else if (this.aS == 3) { + // if (paramInt == -1 || paramInt == -2) { + // if (this.selectY2 == 0) { + // if (this.monHP[1] > 0) + // this.selectY2 = 1; + // } else if (this.monHP[0] > 0) { + // this.selectY2 = 0; + // } + // } else if (paramInt == -5) { + // this.aS = 4; + // this.counter = -1; + // } else if (paramInt == -7) { + // this.aS = 2; + // } + // } else if (this.aS == 6) { + // if (!this.onePaintS) + // if (paramInt == -3 || paramInt == -4) { + // if (this.aS2 == 0) { + // if (this.myHP[1] > 0) + // this.aS2 = 1; + // } else if (this.myHP[0] > 0) { + // this.aS2 = 0; + // } + // } else if (paramInt == -5) { + // this.onePaintS = true; + // this.counter = 0; + // } else if (paramInt == -7) { + // this.aS = 2; + // } + // } else if (this.aS == 9) { + // if (paramInt == -5) + // this.aS = 1; + // } else if (this.aS == 10) { + // if (paramInt == -5 && this.aS2 == 1) { + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.imgS_6 = null; + // this.myAttack = null; + // this.mapAB[this.cuDBY][this.cuDBX] = 0; + // loadTypeImg(this.cuFloor + 10); + // this.aS = 0; + // this.bool_preload = true; + // this.state_main = 40; + // } + // } else if (this.aS == 11) { + // if (this.aS2 == 3 || this.aS2 == 4) { + // if (paramInt == -5) + // this.aS = 1; + // } else if (this.aS2 == 5) { + // if (paramInt == -5) { + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.imgS_6 = null; + // this.myAttack = null; + // this.bool_preload = true; + // this.aS = 0; + // this.dLoadType = 10; + // this.state_main = 40; + // } + // } else if (this.aS2 == 6) { + // if (paramInt == -3 || paramInt == -4) { + // if (this.selectY2 == 0) { + // if (this.myHP[this.selectY3] == 0) + // this.selectY2 = 1; + // } else if (this.myHP[this.chStep] == 0) { + // this.selectY2 = 0; + // } + // } else if (paramInt == -5) { + // this.aS2 = 7; + // this.counter = -1; + // } + // } + // } else if (this.aS == 20 && paramInt == -5 && this.aS2 == 1) { + // this.mapAB = null; + // this.mapB = null; + // this.monMapXY = null; + // this.myAttack = null; + // this.myItem = null; + // this.myWP = null; + // this.myLV = null; + // this.myHP = null; + // this.mySP = null; + // this.state_main = 20; + // this.bool_preload = true; + // // this.mpl.stop(); + // this.img_whiteNum = null; + // this.img_redNum = null; + // this.imgS_1 = null; + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.img_1 = null; + // this.img_floor = null; + // this.img_char = null; + // System.gc(); + // } + // } else if (this.state_main == 44) { + // if (this.aS < 11 && paramInt == -5) + // this.aS = (byte)(this.aS + 2); + // } else if (this.state_main == 50) { + // if (this.aS == 1) { + // if (paramInt == -1) { + // this.selectX = (byte)(this.selectX - 1); + // if (this.selectX == -1) + // this.selectX = 8; + // soundPlay(16); + // } else if (paramInt == -2) { + // this.selectX = (byte)(this.selectX + 1); + // if (this.selectX == 9) + // this.selectX = 0; + // soundPlay(16); + // } else if (paramInt == -5 || paramInt == -4) { + // this.aS = 2; + // this.aS2 = 0; + // } + // } else if (this.aS == 2) { + // if (this.aS2 == 0) { + // if (paramInt == -1) { + // this.selectY = (byte)(this.selectY - 1); + // if (this.selectY == -1) + // this.selectY = 2; + // soundPlay(13); + // } else if (paramInt == -2) { + // this.selectY = (byte)(this.selectY + 1); + // if (this.selectY == 3) + // this.selectY = 0; + // soundPlay(13); + // } else if (paramInt == -3) { + // this.aS = 1; + // } else if (paramInt == -5) { + // if (this.selectY == 0) { + // if (this.GP >= Global.itemGP[this.selectX]) { + // if (this.myItem[this.selectX] == 99) { + // this.oneSoundS = true; + // this.aS2 = 4; + // } else { + // this.aS2 = 1; + // this.onePaintS = true; + // } + // } else { + // this.oneSoundS = true; + // this.aS2 = 3; + // } + // } else if (this.selectY == 1) { + // if (this.myItem[this.selectX] > 0) { + // this.aS2 = 2; + // this.onePaintS = true; + // } else { + // this.oneSoundS = true; + // this.aS2 = 5; + // } + // } else if (this.selectY == 2) { + // this.aS = 0; + // this.useK = 0; + // this.movePage = true; + // this.chMove = false; + // this.chSee = 0; + // this.cuDBY = (byte)(this.cuDBY + 1); + // this.imgS_1 = null; + // this.state_main = 40; + // } + // } + // } else if (paramInt == -5) { + // this.aS2 = 0; + // this.aS = 1; + // } + // } + // } else if (this.state_main == 51) { + // if (this.aS == 1) { + // if (paramInt == -3) { + // this.selectX = (byte)(this.selectX - 1); + // if (this.selectX == -1) + // this.selectX = 2; + // } else if (paramInt == -4) { + // this.selectX = (byte)(this.selectX + 1); + // if (this.selectX == 3) + // this.selectX = 0; + // } else if (paramInt == -5) { + // this.aS = 2; + // } else if (paramInt == -1) { + // this.selectY = 2; + // this.aS = 2; + // } else if (paramInt == -2) { + // this.selectY = 1; + // this.aS = 2; + // } + // } else if (this.aS == 2) { + // if (paramInt == -1) { + // this.selectY = (byte)(this.selectY - 1); + // if (this.selectY == -1) + // this.selectY = 2; + // soundPlay(13); + // } else if (paramInt == -2) { + // this.selectY = (byte)(this.selectY + 1); + // if (this.selectY == 3) + // this.selectY = 0; + // soundPlay(13); + // } else if (paramInt == -5 || paramInt == -3) { + // if (this.selectY == 0) { + // this.aS = 1; + // } else if (this.selectY == 1) { + // this.aS = 3; + // this.aS2 = 0; + // this.selectX2 = 1; + // } else if (this.selectY == 2 && paramInt != -3) { + // this.aS = 0; + // this.useK = 0; + // this.movePage = true; + // this.chMove = false; + // this.chSee = 0; + // this.cuDBY = (byte)(this.cuDBY + 1); + // this.imgS_1 = null; + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.state_main = 40; + // } + // } + // } else if (this.aS == 3) { + // if (paramInt == -1) { + // this.selectX2--; + // if (this.selectX2 == 0) + // this.selectX2 = 5; + // soundPlay(16); + // } else if (paramInt == -2) { + // this.selectX2++; + // if (this.selectX2 == 6) + // this.selectX2 = 1; + // soundPlay(16); + // } else if (paramInt == -4) { + // this.aS = 2; + // } else if (paramInt == -5) { + // if (this.aS2 == 0) { + // if (this.GP >= this.selectX2 * 1000) { + // if (this.myLV[this.selectX] >= Global.weaponLVG[this.selectX2]) { + // this.aS2 = 1; + // this.onePaintS = true; + // } else { + // this.oneSoundS = true; + // this.aS2 = 3; + // } + // } else { + // this.oneSoundS = true; + // this.aS2 = 2; + // } + // } else { + // this.aS = 2; + // this.aS2 = 0; + // } + // } + // } + // } else if (this.state_main == 55) { + // if (paramInt == -5) { + // this.mapAB = null; + // this.mapB = null; + // this.myItem = null; + // this.myWP = null; + // this.myLV = null; + // this.myHP = null; + // this.mySP = null; + // this.monMapXY = null; + // this.myAttack = null; + // this.img_whiteNum = null; + // this.img_redNum = null; + // this.imgS_1 = null; + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.img_1 = null; + // this.img_floor = null; + // this.img_char = null; + // this.str = null; + // System.gc(); + // this.bool_preload = true; + // // this.mpl.stop(); + // this.state_main = 20; + // } + // } else if (this.state_main == 60) { + // if (paramInt == -3) { + // if (this.selectX == 0) { + // this.selectX = 2; + // } else { + // this.selectX = (byte)(this.selectX - 1); + // } + // } else if (paramInt == -4) { + // if (this.selectX == 2) { + // this.selectX = 0; + // } else { + // this.selectX = (byte)(this.selectX + 1); + // } + // } else if (paramInt == -1) { + // if (this.selectX2 == 0) { + // this.selectX2 = 8; + // } else { + // this.selectX2--; + // } + // } else if (paramInt == -2) { + // if (this.selectX2 == 8) { + // this.selectX2 = 0; + // } else { + // this.selectX2++; + // } + // } else if (paramInt == -5) { + // if (this.aS2 == 0) { + // if (this.myItem[this.selectX2] > 0) { + // this.aS2 = 1; + // if (this.selectX2 == 5) { + // if (!this.myPoison) + // this.aS2 = 4; + // } else if (this.selectX2 == 6) { + // if (!this.myCurse) + // this.aS2 = 4; + // } else if (this.selectX2 == 7) { + // if (this.myHP[this.selectX] != 0) + // this.aS2 = 4; + // } else if (this.selectX2 == 8 && this.cuFloor == 0) { + // this.aS2 = 4; + // } + // } else { + // this.aS2 = 3; + // } + // } else if (this.aS2 == 5) { + // if (paramInt == -5) { + // this.aS = 0; + // this.imgS_1 = null; + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.dLoadType = 10; + // this.upDown = false; + // this.state_main = 40; + // } + // } else { + // this.aS2 = 0; + // } + // } else if (paramInt == -7) { + // this.aS = 0; + // this.imgS_1 = null; + // this.imgS_2 = null; + // this.imgS_3 = null; + // this.imgS_4 = null; + // this.imgS_5 = null; + // this.movePage = true; + // this.state_main = 40; + // } + // } + // } } \ No newline at end of file