commit fb8d6515c4cbb3b74a6060bb4013060d377683e5 Author: sillysagiri Date: Mon Oct 14 20:34:14 2024 +0700 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4433ab2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "java.project.referencedLibraries": [ + "lib/**/*.jar", + ] +} \ No newline at end of file diff --git a/assets/ask.png b/assets/ask.png new file mode 100644 index 0000000..faba2ae Binary files /dev/null and b/assets/ask.png differ diff --git a/assets/b1.png b/assets/b1.png new file mode 100644 index 0000000..30c6b92 Binary files /dev/null and b/assets/b1.png differ diff --git a/assets/bF_0.png b/assets/bF_0.png new file mode 100644 index 0000000..b1a2dbd Binary files /dev/null and b/assets/bF_0.png differ diff --git a/assets/bF_1.png b/assets/bF_1.png new file mode 100644 index 0000000..c421469 Binary files /dev/null and b/assets/bF_1.png differ diff --git a/assets/bF_2.png b/assets/bF_2.png new file mode 100644 index 0000000..7df6331 Binary files /dev/null and b/assets/bF_2.png differ diff --git a/assets/bF_3.png b/assets/bF_3.png new file mode 100644 index 0000000..6da3c16 Binary files /dev/null and b/assets/bF_3.png differ diff --git a/assets/bF_4.png b/assets/bF_4.png new file mode 100644 index 0000000..fd2a160 Binary files /dev/null and b/assets/bF_4.png differ diff --git a/assets/bH.png b/assets/bH.png new file mode 100644 index 0000000..edb9d08 Binary files /dev/null and b/assets/bH.png differ diff --git a/assets/c_0.png b/assets/c_0.png new file mode 100644 index 0000000..4d2f6db Binary files /dev/null and b/assets/c_0.png differ diff --git a/assets/c_1.png b/assets/c_1.png new file mode 100644 index 0000000..09f2106 Binary files /dev/null and b/assets/c_1.png differ diff --git a/assets/cancel.png b/assets/cancel.png new file mode 100644 index 0000000..5ea02e2 Binary files /dev/null and b/assets/cancel.png differ diff --git a/assets/d0.dat b/assets/d0.dat new file mode 100644 index 0000000..68dc39c Binary files /dev/null and b/assets/d0.dat differ diff --git a/assets/d1.dat b/assets/d1.dat new file mode 100644 index 0000000..0e12ea5 Binary files /dev/null and b/assets/d1.dat differ diff --git a/assets/d2.dat b/assets/d2.dat new file mode 100644 index 0000000..b01fa7a Binary files /dev/null and b/assets/d2.dat differ diff --git a/assets/dT_1.png b/assets/dT_1.png new file mode 100644 index 0000000..77b7f8c Binary files /dev/null and b/assets/dT_1.png differ diff --git a/assets/dT_2.png b/assets/dT_2.png new file mode 100644 index 0000000..970d05b Binary files /dev/null and b/assets/dT_2.png differ diff --git a/assets/dT_3.png b/assets/dT_3.png new file mode 100644 index 0000000..a8352c1 Binary files /dev/null and b/assets/dT_3.png differ diff --git a/assets/ez.png b/assets/ez.png new file mode 100644 index 0000000..9fefc1d Binary files /dev/null and b/assets/ez.png differ diff --git a/assets/fC.dat b/assets/fC.dat new file mode 100644 index 0000000..0d34401 Binary files /dev/null and b/assets/fC.dat differ diff --git a/assets/fL0.png b/assets/fL0.png new file mode 100644 index 0000000..9b7cf1f Binary files /dev/null and b/assets/fL0.png differ diff --git a/assets/fL1.png b/assets/fL1.png new file mode 100644 index 0000000..2721d05 Binary files /dev/null and b/assets/fL1.png differ diff --git a/assets/fL2.png b/assets/fL2.png new file mode 100644 index 0000000..329e2e9 Binary files /dev/null and b/assets/fL2.png differ diff --git a/assets/f_0.png b/assets/f_0.png new file mode 100644 index 0000000..0970d15 Binary files /dev/null and b/assets/f_0.png differ diff --git a/assets/f_1.png b/assets/f_1.png new file mode 100644 index 0000000..b269df1 Binary files /dev/null and b/assets/f_1.png differ diff --git a/assets/f_2.png b/assets/f_2.png new file mode 100644 index 0000000..83b7551 Binary files /dev/null and b/assets/f_2.png differ diff --git a/assets/f_3.png b/assets/f_3.png new file mode 100644 index 0000000..50ee064 Binary files /dev/null and b/assets/f_3.png differ diff --git a/assets/f_5.png b/assets/f_5.png new file mode 100644 index 0000000..ca762e7 Binary files /dev/null and b/assets/f_5.png differ diff --git a/assets/f_6.png b/assets/f_6.png new file mode 100644 index 0000000..50e8f10 Binary files /dev/null and b/assets/f_6.png differ diff --git a/assets/f_7.png b/assets/f_7.png new file mode 100644 index 0000000..8345662 Binary files /dev/null and b/assets/f_7.png differ diff --git a/assets/fa1.png b/assets/fa1.png new file mode 100644 index 0000000..150b334 Binary files /dev/null and b/assets/fa1.png differ diff --git a/assets/fa2.png b/assets/fa2.png new file mode 100644 index 0000000..09f5ef4 Binary files /dev/null and b/assets/fa2.png differ diff --git a/assets/fa3.png b/assets/fa3.png new file mode 100644 index 0000000..03d9089 Binary files /dev/null and b/assets/fa3.png differ diff --git a/assets/g.dat b/assets/g.dat new file mode 100644 index 0000000..7e25015 Binary files /dev/null and b/assets/g.dat differ diff --git a/assets/gameOver.png b/assets/gameOver.png new file mode 100644 index 0000000..0e4c933 Binary files /dev/null and b/assets/gameOver.png differ diff --git a/assets/i_0.png b/assets/i_0.png new file mode 100644 index 0000000..71a3f0a Binary files /dev/null and b/assets/i_0.png differ diff --git a/assets/i_1.png b/assets/i_1.png new file mode 100644 index 0000000..4a431df Binary files /dev/null and b/assets/i_1.png differ diff --git a/assets/i_2.png b/assets/i_2.png new file mode 100644 index 0000000..60d2e9d Binary files /dev/null and b/assets/i_2.png differ diff --git a/assets/logo/menet.png b/assets/logo/menet.png new file mode 100644 index 0000000..859aa28 Binary files /dev/null and b/assets/logo/menet.png differ diff --git a/assets/m0.dat b/assets/m0.dat new file mode 100644 index 0000000..969a558 Binary files /dev/null and b/assets/m0.dat differ diff --git a/assets/m1.dat b/assets/m1.dat new file mode 100644 index 0000000..2e45072 Binary files /dev/null and b/assets/m1.dat differ diff --git a/assets/m2.dat b/assets/m2.dat new file mode 100644 index 0000000..515f2b5 Binary files /dev/null and b/assets/m2.dat differ diff --git a/assets/m3.dat b/assets/m3.dat new file mode 100644 index 0000000..066aa58 Binary files /dev/null and b/assets/m3.dat differ diff --git a/assets/m4.dat b/assets/m4.dat new file mode 100644 index 0000000..0aeee6e Binary files /dev/null and b/assets/m4.dat differ diff --git a/assets/m5.dat b/assets/m5.dat new file mode 100644 index 0000000..5128bf6 Binary files /dev/null and b/assets/m5.dat differ diff --git a/assets/m6.dat b/assets/m6.dat new file mode 100644 index 0000000..8f56e93 Binary files /dev/null and b/assets/m6.dat differ diff --git a/assets/mC.dat b/assets/mC.dat new file mode 100644 index 0000000..960fb1c Binary files /dev/null and b/assets/mC.dat differ diff --git a/assets/mF.dat b/assets/mF.dat new file mode 100644 index 0000000..723dcdb Binary files /dev/null and b/assets/mF.dat differ diff --git a/assets/m_2.png b/assets/m_2.png new file mode 100644 index 0000000..8a5830a Binary files /dev/null and b/assets/m_2.png differ diff --git a/assets/mon.dat b/assets/mon.dat new file mode 100644 index 0000000..8158153 Binary files /dev/null and b/assets/mon.dat differ diff --git a/assets/monWin.png b/assets/monWin.png new file mode 100644 index 0000000..867b88b Binary files /dev/null and b/assets/monWin.png differ diff --git a/assets/out.png b/assets/out.png new file mode 100644 index 0000000..9f72565 Binary files /dev/null and b/assets/out.png differ diff --git a/assets/pEZ.png b/assets/pEZ.png new file mode 100644 index 0000000..87dd11e Binary files /dev/null and b/assets/pEZ.png differ diff --git a/assets/root.png b/assets/root.png new file mode 100644 index 0000000..c52775b Binary files /dev/null and b/assets/root.png differ diff --git a/assets/s/1.mmf b/assets/s/1.mmf new file mode 100644 index 0000000..99d26f3 Binary files /dev/null and b/assets/s/1.mmf differ diff --git a/assets/s/10.mmf b/assets/s/10.mmf new file mode 100644 index 0000000..81c5e25 Binary files /dev/null and b/assets/s/10.mmf differ diff --git a/assets/s/11.mmf b/assets/s/11.mmf new file mode 100644 index 0000000..7f831e9 Binary files /dev/null and b/assets/s/11.mmf differ diff --git a/assets/s/12.mmf b/assets/s/12.mmf new file mode 100644 index 0000000..7be8ae3 Binary files /dev/null and b/assets/s/12.mmf differ diff --git a/assets/s/13.mmf b/assets/s/13.mmf new file mode 100644 index 0000000..8eb14fa Binary files /dev/null and b/assets/s/13.mmf differ diff --git a/assets/s/14.mmf b/assets/s/14.mmf new file mode 100644 index 0000000..4ded340 Binary files /dev/null and b/assets/s/14.mmf differ diff --git a/assets/s/15.mmf b/assets/s/15.mmf new file mode 100644 index 0000000..4b9807d Binary files /dev/null and b/assets/s/15.mmf differ diff --git a/assets/s/16.mmf b/assets/s/16.mmf new file mode 100644 index 0000000..36c4bcb Binary files /dev/null and b/assets/s/16.mmf differ diff --git a/assets/s/2.mmf b/assets/s/2.mmf new file mode 100644 index 0000000..d3ac155 Binary files /dev/null and b/assets/s/2.mmf differ diff --git a/assets/s/3.mmf b/assets/s/3.mmf new file mode 100644 index 0000000..2506144 Binary files /dev/null and b/assets/s/3.mmf differ diff --git a/assets/s/4.mmf b/assets/s/4.mmf new file mode 100644 index 0000000..c96dbf6 Binary files /dev/null and b/assets/s/4.mmf differ diff --git a/assets/s/5.mmf b/assets/s/5.mmf new file mode 100644 index 0000000..c85bffb Binary files /dev/null and b/assets/s/5.mmf differ diff --git a/assets/s/6.mmf b/assets/s/6.mmf new file mode 100644 index 0000000..17721df Binary files /dev/null and b/assets/s/6.mmf differ diff --git a/assets/s/7.mmf b/assets/s/7.mmf new file mode 100644 index 0000000..5afa047 Binary files /dev/null and b/assets/s/7.mmf differ diff --git a/assets/s/8.mmf b/assets/s/8.mmf new file mode 100644 index 0000000..3d9c0fc Binary files /dev/null and b/assets/s/8.mmf differ diff --git a/assets/s/9.mmf b/assets/s/9.mmf new file mode 100644 index 0000000..cb984ac Binary files /dev/null and b/assets/s/9.mmf differ diff --git a/assets/sN.png b/assets/sN.png new file mode 100644 index 0000000..ef2620f Binary files /dev/null and b/assets/sN.png differ diff --git a/assets/s_1.png b/assets/s_1.png new file mode 100644 index 0000000..3bdd4cc Binary files /dev/null and b/assets/s_1.png differ diff --git a/assets/s_2.png b/assets/s_2.png new file mode 100644 index 0000000..73adc89 Binary files /dev/null and b/assets/s_2.png differ diff --git a/assets/s_3.png b/assets/s_3.png new file mode 100644 index 0000000..93aa272 Binary files /dev/null and b/assets/s_3.png differ diff --git a/assets/s_7.png b/assets/s_7.png new file mode 100644 index 0000000..9799edd Binary files /dev/null and b/assets/s_7.png differ diff --git a/assets/shop.png b/assets/shop.png new file mode 100644 index 0000000..7fb1187 Binary files /dev/null and b/assets/shop.png differ diff --git a/assets/skip.png b/assets/skip.png new file mode 100644 index 0000000..42bb4be Binary files /dev/null and b/assets/skip.png differ diff --git a/assets/t1.txt b/assets/t1.txt new file mode 100644 index 0000000..f128ecf Binary files /dev/null and b/assets/t1.txt differ diff --git a/assets/t2.txt b/assets/t2.txt new file mode 100644 index 0000000..05d2ec4 Binary files /dev/null and b/assets/t2.txt differ diff --git a/assets/t3.txt b/assets/t3.txt new file mode 100644 index 0000000..7fb3e84 Binary files /dev/null and b/assets/t3.txt differ diff --git a/assets/t4.txt b/assets/t4.txt new file mode 100644 index 0000000..0f2e9f3 Binary files /dev/null and b/assets/t4.txt differ diff --git a/assets/t5.txt b/assets/t5.txt new file mode 100644 index 0000000..1d93da8 Binary files /dev/null and b/assets/t5.txt differ diff --git a/assets/t6.txt b/assets/t6.txt new file mode 100644 index 0000000..495512c Binary files /dev/null and b/assets/t6.txt differ diff --git a/assets/t7.txt b/assets/t7.txt new file mode 100644 index 0000000..c737526 Binary files /dev/null and b/assets/t7.txt differ diff --git a/assets/t8.txt b/assets/t8.txt new file mode 100644 index 0000000..1d4a1f2 Binary files /dev/null and b/assets/t8.txt differ diff --git a/assets/t9.txt b/assets/t9.txt new file mode 100644 index 0000000..48121aa Binary files /dev/null and b/assets/t9.txt differ diff --git a/assets/t_0.png b/assets/t_0.png new file mode 100644 index 0000000..49d1311 Binary files /dev/null and b/assets/t_0.png differ diff --git a/assets/t_1.png b/assets/t_1.png new file mode 100644 index 0000000..bd5a216 Binary files /dev/null and b/assets/t_1.png differ diff --git a/assets/t_2.png b/assets/t_2.png new file mode 100644 index 0000000..34b9586 Binary files /dev/null and b/assets/t_2.png differ diff --git a/assets/t_3.png b/assets/t_3.png new file mode 100644 index 0000000..3c25141 Binary files /dev/null and b/assets/t_3.png differ diff --git a/assets/t_4.png b/assets/t_4.png new file mode 100644 index 0000000..2940cb2 Binary files /dev/null and b/assets/t_4.png differ diff --git a/assets/w.dat b/assets/w.dat new file mode 100644 index 0000000..2d21ba2 Binary files /dev/null and b/assets/w.dat differ diff --git a/assets/win.png b/assets/win.png new file mode 100644 index 0000000..71cafae Binary files /dev/null and b/assets/win.png differ diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..50219f1 --- /dev/null +++ b/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e # Exit immediately if any command fails + +MAIN_CLASS="dothack/DotHack.java" +PROJECT_NAME="dh_musicfix" +SOURCE_PATH="src" +PATH_LIBRARIES="lib" +PATH_PROGUARD="/home/sillysagiri/Documents/dothack/proguard.jar" +CLASS_VERSION="1.4" + +### + +rm -rf "build" +mkdir -p "build/class" + +### + +CLASSPATH=$(find "$PATH_LIBRARIES" -type f | tr '\n' ':' | sed 's/:$//') + +# compile class +javac -source $CLASS_VERSION -target $CLASS_VERSION -cp $CLASSPATH -encoding "utf-8" -d "build/class" -sourcepath $SOURCE_PATH -Xlint:-options -g "${SOURCE_PATH}/${MAIN_CLASS}" + +# pack .jar +jar cvfm "build/${PROJECT_NAME}_not_preverified.jar" "${SOURCE_PATH}/META-INF/MANIFEST.MF" -C "build/class" . -C "assets" . + +# preverify +java -jar $PATH_PROGUARD -microedition -injars "build/${PROJECT_NAME}_not_preverified.jar" -outjars "build/${PROJECT_NAME}.jar" -libraryjars $CLASSPATH -dontshrink -dontoptimize -dontobfuscate -target $CLASS_VERSION + +# release build +# java -jar $PATH_PROGUARD -microedition -injars "build/${PROJECT_NAME}_not_preverified.jar" -outjars "build/${PROJECT_NAME}_release.jar" -libraryjars $CLASSPATH -target $CLASS_VERSION -keep "class * extends javax.microedition.midlet.MIDlet" -optimizationpasses 4 -repackageclasses "" -allowaccessmodification \ No newline at end of file diff --git a/lib/cldcapi11.jar b/lib/cldcapi11.jar new file mode 100644 index 0000000..9b50d19 Binary files /dev/null and b/lib/cldcapi11.jar differ diff --git a/lib/jsr75.jar b/lib/jsr75.jar new file mode 100644 index 0000000..4ced7fb Binary files /dev/null and b/lib/jsr75.jar differ diff --git a/lib/midpapi20.jar b/lib/midpapi20.jar new file mode 100644 index 0000000..946788b Binary files /dev/null and b/lib/midpapi20.jar differ diff --git a/lib/mmapi.jar b/lib/mmapi.jar new file mode 100644 index 0000000..e2639c8 Binary files /dev/null and b/lib/mmapi.jar differ diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..18dc043 --- /dev/null +++ b/readme.txt @@ -0,0 +1,17 @@ +.hack//vol1 is a j2me game originally from old korean game... +the original game runs on the mighty cldc 1.0/midp 1.0 and boasts a stunning resolution of 128x128 pixels + +you can get the game here on archive.net +https://archive.org/details/dh1_ezi + +there is also people who translate this to english here +https://archive.org/download/dh1_ezi_en + +however, due to some native apis used in the original game. the game doesnt work on most emulator. +ive been on a mission to swap out those stubborn native apis for their midp equivalents + +i took on the heroic quest of porting this masterpiece to a more contemporary version of j2me: cldc 1.1/midp 2.0... +plus, i also tried added support for larger screens, like 240x320... + +- building +ugh... just peek at the build.sh file for now. i promise ill whip up a more detailed guide soon...after i finish this epic battle with caffeine! \ No newline at end of file diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..72f2c88 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-Description: MeNet21 +MIDlet-Version: 1.0.0 +Created-By: 1.3.0_02(Sun Microsystems Inc.) +MIDlet-Vendor: MeNet21 +MicroEdition-Profile: MIDP-1.0 +MIDlet-1: 닷핵,/logo/menet.png,dothack.DotHack +MIDlet-Name: 닷핵 +MIDlet-Info-URL: http://java.sun.com/j2me/ diff --git a/src/dothack/DotHack.java b/src/dothack/DotHack.java new file mode 100644 index 0000000..50a3424 --- /dev/null +++ b/src/dothack/DotHack.java @@ -0,0 +1,24 @@ +package dothack; +import javax.microedition.lcdui.Display; +import javax.microedition.midlet.MIDlet; + +public class DotHack extends MIDlet implements Runnable { + public DotHackC game; + private Display _display; + + public void startApp() { + Global.app = this; + game = new DotHackC(this); + + _display = Display.getDisplay(this); + _display.setCurrent(game); + } + + public void pauseApp() {} + + public void destroyApp(boolean paramBoolean) {} + + public void run() { + + } +} \ No newline at end of file diff --git a/src/dothack/DotHackC.java b/src/dothack/DotHackC.java new file mode 100644 index 0000000..acfc3ca --- /dev/null +++ b/src/dothack/DotHackC.java @@ -0,0 +1,4489 @@ +package dothack; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Random; +import javax.microedition.io.Connector; +import javax.microedition.io.StreamConnection; +import javax.microedition.lcdui.Canvas; +import javax.microedition.lcdui.Graphics; +import javax.microedition.lcdui.Image; +import javax.microedition.media.Manager; +import javax.microedition.media.Player; +import javax.microedition.rms.RecordStore; +// import mmpp.media.Vibration; +// import mmpp.microedition.lcdui.GraphicsX; +// import mmpp.phone.Phone; + +import sillysagiri.Scene; +import sillysagiri.scene.Intro; + +public class DotHackC extends Canvas { + DotHack midlet; + Thread thread; + private Random ran; + private Player mpl; + private String[] str; + private long startTime; + private boolean soundS; + private boolean oneSoundS; + private boolean vibrationS; + private boolean timeON; + private boolean bool_preload; + private boolean onePaintS; + private byte volumLevel; + private byte state_main; + private byte pdS; + private byte aS; + private byte aS2; + private byte counter100; + private byte counter; + private byte useK; + private byte selectX; + private byte selectY; + private byte selectX3; + private byte selectY3; + private int selectX2; + private int selectY2; + private Image bG; + private Graphics bgG; + // private GraphicsX gx; + private Image img_knife; + private Image img_whiteNum; + private Image img_redNum; + private Image imgS_1; + private Image imgS_2; + private Image imgS_3; + private Image imgS_4; + private Image imgS_5; + private Image imgS_6; + private Image[] img_1; + private Image[] img_floor; + private Image[] img_char; + private byte[][] mapAB; + private byte[][] mapB; + private boolean movePage; + private byte dLoadType; + private boolean upDown; + private int GP; + private byte[] myItem; + private byte[] myWP; + private byte[] myLV; + private int[] myHP; + private int[] mySP; + private int myEX; + private boolean[] myAttack; + private byte useSkill; + private boolean myPoison; + private boolean myCurse; + private byte cuFloor; + private byte lastFloor; + private byte cuDBX; + private byte cuDBY; + private byte cuDBP; + private byte chSee; + private byte chStep; + private boolean chMove; + private byte[][] monMapXY; + private byte monType; + private int[] monHP; + private byte monLevel; + private int monAT; + private int tDamage; + private boolean monCh; + + private Scene _scene_current = null; + + public void gameStartVarInit() { + this.dLoadType = 10; + this.lastFloor = 2; + this.upDown = true; + gatePosition(); + this.chSee = 0; + this.chStep = 0; + this.myPoison = false; + this.myCurse = false; + this.GP = 1000; + this.myItem = new byte[9]; + this.myItem[8] = 1; + this.myWP = new byte[3]; + this.myLV = new byte[3]; + this.myHP = new int[3]; + this.mySP = new int[3]; + this.monMapXY = new byte[2][2]; + this.monMapXY[0][0] = -1; + this.monMapXY[1][0] = -1; + this.myLV[0] = 1; + this.myWP[0] = 1; + this.myHP[0] = Global.HPD[0]; + this.mySP[0] = Global.SPD[0]; + this.myLV[1] = 1; + this.myWP[1] = 1; + this.myHP[1] = Global.HPD[1]; + this.mySP[1] = Global.SPD[1]; + this.myLV[2] = 1; + this.myWP[2] = 1; + this.myHP[2] = Global.HPD[2]; + this.mySP[2] = Global.SPD[2]; + } + + public DotHackC(DotHack app) { + setFullScreenMode(true); + + 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; + + try { + Set_Scene(new Intro()); + } catch (IOException e) { + e.printStackTrace(); + } + thread = new Thread(this); + this.thread.start(); + } + + public void run() { + while (true) { + if (_scene_current != null) _scene_current.Update(); + repaint(); + serviceRepaints(); + try { + Thread.sleep(80L); + } catch (Exception exception) {} + } + } + + public Scene Get_Scene() { return _scene_current; } + public void Set_Scene(Scene scene) + { + if (_scene_current != null) + { + _scene_current.Destroy(); + _scene_current = null; + System.gc(); + } + _scene_current = scene; + } + + public void soundPlay(int id) { + try { + if (soundS) { + InputStream in = this.getClass().getResourceAsStream("/s/" + id + ".wav"); + mpl = Manager.createPlayer(in, "audio/x-wav"); + mpl.realize(); + // VolumeUpdate(); + mpl.prefetch(); + mpl.start(); + } + } catch (Exception exception) {} + } + + public void showNotify() { + if (this.state_main >= 20) { + this.pdS = this.state_main; + this.state_main = 0; + } + } + + public void loadString(String paramString, int paramInt) { + DataInputStream dataInputStream = new DataInputStream(getClass().getResourceAsStream("/" + paramString + ".txt")); + this.str = new String[paramInt]; + try { + for (byte b = 0; b < paramInt; b++) + this.str[b] = dataInputStream.readUTF(); + dataInputStream.close(); + dataInputStream = null; + } catch (Exception exception) { + if (dataInputStream != null) + try { + dataInputStream.close(); + dataInputStream = null; + } catch (Exception exception1) {} + } + } + + public void loadTypeImg(int paramInt) { + loadMap("/m" + (paramInt - 10) + ".dat"); + if (paramInt == 10) { + loadImage(41, "/d0.dat", 24); + this.img_1 = new Image[2]; + try { + this.img_1[0] = Image.createImage("/root.png"); + this.img_1[1] = Image.createImage("/shop.png"); + } catch (Exception exception) {} + } else if (paramInt == 11) { + this.img_1 = null; + loadImage(41, "/d0.dat", 24); + } else if (paramInt == 12 || paramInt == 14 || paramInt == 16) { + loadImage(41, "/d1.dat", 16); + } else if (paramInt == 13 || paramInt == 15) { + loadImage(41, "/d2.dat", 23); + } + if (paramInt != 10) + loadImage(10, "/g.dat", 10); + this.movePage = true; + this.chMove = false; + 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) + // paramGraphics.translate(0, 5); + + this.counter100 = (byte)(this.counter100 + 1); + if (this.counter100 >= 100) + this.counter100 = 0; + + try { + + if (this.state_main == 0) { + if (getHeight() == 143) { + g.setColor(0, 0, 0); + g.fillRect(0, -5, 120, 5); + g.fillRect(0, 133, 120, 5); + } + this.state_main = this.pdS; + } + + else if (this.state_main == 9) { + if (this.bool_preload) { + g.setColor(0, 0, 0); + if (getHeight() == 143) { + g.fillRect(0, -5, 120, 5); + g.fillRect(0, 133, 120, 5); + } + this.imgS_1 = Image.createImage("/t_1.png"); + this.img_knife = Image.createImage("/sN.png"); + this.bool_preload = false; + } + + g.setColor(73, 0, 0); + g.fillRect(0, 0, 120, 133); + if (this.aS == 0) { + g.setClip(-114 + this.counter100 * 20, 53, 108, 14); + g.drawImage(this.imgS_1, -114 + this.counter100 * 20, 53, 20); + g.setClip(126 - this.counter100 * 20, 67, 108, 13); + g.drawImage(this.imgS_1, 126 - this.counter100 * 20, 53, 20); + if (this.counter100 == 6) + this.aS = 1; + } else if (this.aS == 1) { + g.drawImage(this.imgS_1, 6, 53, 20); + } + if (this.counter100 == 8) { + this.state_main = 10; + this.counter100 = -1; + this.bool_preload = true; + this.imgS_1 = null; + } + } + + else if (this.state_main == 10) { + if (this.bool_preload) { + // this.mpl.setMediaLocation("/s/7.mmf"); + // this.mpl.setVolumeLevel(this.volumLevel + ""); + // this.mpl.start(); + bgPaint(this.state_main); + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + if (this.counter100 % 3 < 2) + g.drawImage(Image.createImage("/pEZ.png"), 33, 107, 20); + } else if (this.state_main == 11) { + if (this.bool_preload) { + this.imgS_1 = Image.createImage("/pEZ.png"); + bgPaint(this.state_main); + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + if (this.counter100 % 3 < 2) + g.drawImage(this.imgS_1, 33, 123, 20); + } else if (this.state_main == 20) { + if (this.bool_preload) { + this.imgS_1 = null; + loadImage(10, "/mF.dat", 7); + this.imgS_1 = Image.createImage("/i_0.png"); + bgPaint(this.state_main); + this.selectX = 0; + this.bool_preload = false; + } + if (this.oneSoundS) { + soundPlay(13); + this.oneSoundS = false; + } + g.drawImage(this.bG, 0, 0, 20); + if (this.selectX == 0) { + g.drawImage(this.img_1[6], 29, 46, 20); + } else { + g.drawImage(this.img_1[this.selectX - 1], 29, 46, 20); + } + g.drawImage(this.img_1[this.selectX], 29, 63, 20); + if (this.selectX == 6) { + g.drawImage(this.img_1[0], 29, 79, 20); + } else { + g.drawImage(this.img_1[this.selectX + 1], 29, 79, 20); + } + byte b = 0; + if (this.counter100 % 10 < 3) + b = 2; + imgCutPaint(7, 11, 0, 97 - b, 63, this.imgS_1, g); + imgCutPaint(7, 11, 1, 16 + b, 63, this.imgS_1, g); + } else if (this.state_main == 21) { + if (this.bool_preload) { + loadString("t4", 35); + bgPaint(this.state_main); + this.bool_preload = false; + this.imgS_1 = Image.createImage("/bH.png"); + this.imgS_2 = Image.createImage("/i_2.png"); + this.aS = 0; + this.aS2 = 0; + } + g.drawImage(this.bG, 0, 0, 20); + g.setColor(182, 255, 0); + if (this.aS == 0) { + g.drawString(this.str[0], 13, 18, 20); + g.drawImage(this.imgS_1, 40, 37, 20); + g.setColor(0, 0, 0); + g.drawString(this.str[4], 36, 35, 24); + g.drawString(this.str[4], 36, 117, 24); + g.drawString(this.str[6], 86, 35, 20); + g.drawString(this.str[1], 86, 50, 20); + g.drawString(this.str[5], 86, 117, 20); + g.drawLine(35, 41, 38, 41); + g.drawLine(81, 41, 84, 41); + g.drawLine(81, 55, 84, 55); + g.drawLine(35, 123, 38, 123); + g.drawLine(81, 123, 84, 123); + } else if (this.aS == 1) { + g.drawString(this.str[1], 25, 18, 20); + g.setColor(0, 0, 0); + g.drawString(this.str[7], 5, 37, 20); + g.drawString(this.str[8], 8, 52, 20); + g.drawString(this.str[9], 5, 67, 20); + g.drawString(this.str[10], 8, 82, 20); + } else if (this.aS == 2) { + g.drawString(this.str[2], 49, 18, 20); + if (this.aS2 == 0) { + g.setColor(255, 0, 0); + g.drawString(this.str[11], 5, 37, 20); + g.setColor(0, 0, 255); + g.drawString(this.str[14], 5, 82, 20); + g.setColor(0, 0, 0); + g.drawString(this.str[12], 8, 52, 20); + g.drawString(this.str[13], 8, 67, 20); + g.drawString(this.str[15], 8, 97, 20); + g.drawString(this.str[16], 8, 112, 20); + } else if (this.aS2 == 1) { + g.setColor(0, 0, 0); + g.drawString(this.str[17], 5, 37, 20); + g.drawString(this.str[18], 8, 52, 20); + g.drawString(this.str[19], 5, 67, 20); + g.drawString(this.str[20], 5, 82, 20); + g.drawString(this.str[21], 5, 97, 20); + g.drawString(this.str[22], 8, 112, 20); + } else if (this.aS2 == 2) { + g.setColor(0, 0, 0); + g.drawString(this.str[23], 5, 37, 20); + g.drawString(this.str[24], 8, 52, 20); + } + if (this.aS2 == 0 || this.aS2 == 1) + imgCutPaint(7, 5, 1, 112, 126, this.imgS_2, g); + if (this.aS2 == 1 || this.aS2 == 2) + imgCutPaint(7, 5, 0, 112, 35, this.imgS_2, g); + } else if (this.aS == 3) { + g.drawString(this.str[3], 85, 18, 20); + if (this.aS2 == 0) { + g.setColor(0, 0, 255); + g.drawString(this.str[25], 5, 37, 20); + g.drawString(this.str[11], 5, 67, 20); + g.setColor(0, 0, 0); + g.drawString(this.str[26], 8, 52, 20); + g.drawString(this.str[27], 8, 82, 20); + g.drawString(this.str[28], 8, 97, 20); + imgCutPaint(7, 5, 1, 112, 126, this.imgS_2, g); + } else if (this.aS2 == 1) { + g.setColor(0, 0, 255); + g.drawString(this.str[29], 5, 37, 20); + g.setColor(255, 0, 0); + g.drawString(this.str[32], 5, 82, 20); + g.setColor(0, 0, 0); + g.drawString(this.str[30], 8, 52, 20); + g.drawString(this.str[31], 8, 67, 20); + g.drawString(this.str[33], 8, 97, 20); + g.drawString(this.str[34], 8, 112, 20); + imgCutPaint(7, 5, 0, 112, 35, this.imgS_2, g); + } + } + } else if (this.state_main == 22) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.aS = 1; + this.bool_preload = false; + loadString("t8", 5); + } + g.drawImage(this.bG, 0, 0, 20); + if (this.aS == 1) { + g.setColor(255, 255, 255); + g.drawString(this.str[0], 25, 45, 20); + g.drawString(this.str[1], 25, 58, 20); + g.drawString(this.str[2], 25, 71, 20); + g.drawString(this.str[3], 22, 86, 20); + } else if (this.aS == 2) { + g.setColor(255, 255, 255); + g.drawString(this.str[4], 43, 64, 20); + this.aS = 3; + } else { + if (this.aS == 3) { + g.setColor(255, 255, 255); + g.drawString(this.str[4], 43, 64, 20); + this.str = null; + StreamConnection streamConnection = null; + DataInputStream dataInputStream = null; + DataOutputStream dataOutputStream = null; + // String str = Phone.getProperty("MIN"); + String str = "000000"; + try { + streamConnection = (StreamConnection)Connector.open(Global.ETC[20], 3, true); + dataInputStream = streamConnection.openDataInputStream(); + dataOutputStream = streamConnection.openDataOutputStream(); + dataOutputStream.writeUTF(str); + dataOutputStream.writeInt(this.myEX); + dataOutputStream.flush(); + dataOutputStream.close(); + if (this.str == null) + this.str = new String[6]; + for (byte b = 0; b < 5; b++) + this.str[b] = dataInputStream.readInt() + ""; + this.str[5] = dataInputStream.readInt() + ""; + dataInputStream.close(); + streamConnection.close(); + this.aS = 4; + } catch (Exception exception1) { + this.aS = 5; + } finally { + Exception exception1 = null; + } + } else { + if (this.aS == 4) { + for (byte b = 0; b < 5; b++) { + g.setColor(255, 255, 255); + g.drawString((b + 1) + "위", 25, 42 + b * 13, 20); + g.drawString(this.str[b] + " EX", 95, 42 + b * 13, 24); + g.setColor(0, 0, 0); + g.drawLine(21, 54 + b * 13, 98, 54 + b * 13); + } + g.setColor(0, 0, 0); + g.drawString(this.str[5] + "위 " + this.myEX + " EX", 95, 108, 24); + } else if (this.aS == 5) { + g.setColor(255, 255, 255); + g.drawString(Global.ETC[7], 25, 58, 20); + g.drawString(Global.ETC[8], 25, 71, 20); + } + return; + } + return; + } + } else if (this.state_main == 23) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.selectX = 0; + this.selectY = 0; + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + g.setColor(182, 255, 0); + if (this.volumLevel >= 1) + g.fillRect(62, 60, 4, 4); + if (this.volumLevel >= 2) + g.fillRect(70, 57, 4, 7); + if (this.volumLevel >= 3) + g.fillRect(78, 54, 4, 10); + if (this.volumLevel >= 4) + g.fillRect(86, 51, 4, 13); + if (this.vibrationS) { + g.drawString("ON", 70, 85, 20); + } else { + g.drawString("OFF", 68, 85, 20); + } + g.drawImage(this.img_knife, 1, 64 + this.selectX * 34, 20); + byte b = 0; + if (this.counter100 % 10 < 3) + b = 2; + imgCutPaint(7, 11, 0, 4 - b, 52 + this.selectX * 34, this.imgS_1, g); + imgCutPaint(7, 11, 1, 109 + b, 52 + this.selectX * 34, this.imgS_1, g); + if (this.onePaintS) { + soundPlay(13); + this.onePaintS = false; + } + } else if (this.state_main == 24) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + } else if (this.state_main == 30) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.bool_preload = false; + loadTypeImg(10); + createD(10); + this.cuFloor = 0; + this.cuDBP = 5; + bgPaint(41); + this.img_1 = null; + this.img_floor = null; + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 120, 120, 13); + this.bgG.drawImage(Image.createImage("/win.png"), 46, 84, 20); + this.bgG.drawImage(Image.createImage("/ez.png"), 54, 123, 20); + this.bgG.drawImage(Image.createImage("/skip.png"), 85, 119, 20); + this.selectX2 = 0; + this.img_1 = new Image[2]; + this.img_1[0] = Image.createImage("/bF_0.png"); + this.img_1[1] = Image.createImage("/bF_3.png"); + loadString("t5", 54); + // this.mpl.setPlayBackLoop(true); + soundPlay(3); + g.setColor(0, 0, 0); + } + g.drawImage(this.bG, 0, 0, 20); + boolean bool = false; + if (this.selectX2 == 0 || this.selectX2 == 4 || (this.selectX2 > 7 && this.selectX2 < 13) || this.selectX2 == 40 || this.selectX2 == 52) { + bool = false; + } else if (this.selectX2 == 2 || this.selectX2 == 6 || (this.selectX2 > 13 && this.selectX2 < 39) || (this.selectX2 > 41 && this.selectX2 < 51)) { + bool = true; + } + // g.drawImage(this.img_1[bool], 0, 73, 20); + g.drawImage(this.img_1[1], 0, 73, 20); + g.drawString(this.str[this.selectX2], 48, 90, 20); + g.drawString(this.str[this.selectX2 + 1], 48, 104, 20); + if (this.selectX2 == 52) { + this.img_1 = null; + this.str = null; + this.bool_preload = true; + this.state_main = 31; + this.selectX2 = 0; + } + } else if (this.state_main == 31) { + if (this.bool_preload) { + loadString("t6", 30); + this.bool_preload = false; + this.aS = 0; + this.selectX2 = 0; + this.counter100 = 0; + } + if (this.aS == 0) { + g.setColor(0, 0, 0); + g.fillRect(0, 60 - this.counter100 * 10, 120, this.counter100 * 20); + if (this.counter100 == 6) + this.aS = 1; + } else if (this.aS == 1) { + g.setColor(0, 0, 0); + g.fillRect(0, 0, 120, 120); + g.setColor(255, 255, 255); + for (byte b = 0; b < 5; b++) + g.drawString(this.str[b + this.selectX2 * 5], 5, 25 + b * 14, 20); + } else if (this.aS == 2) { + this.state_main = 32; + this.str = null; + this.bool_preload = true; + } + } else if (this.state_main == 32) { + if (this.bool_preload) { + this.bool_preload = false; + this.selectX2 = 0; + this.img_1 = new Image[3]; + this.img_1[0] = Image.createImage("/bF_0.png"); + this.img_1[1] = Image.createImage("/bF_1.png"); + this.img_1[2] = Image.createImage("/bF_2.png"); + loadString("t9", 12); + } + g.drawImage(this.bG, 0, 0, 20); + byte b = 0; + if (this.selectX2 > -1 && this.selectX2 < 5) { + b = 1; + } else if (this.selectX2 == 6 || this.selectX2 == 10) { + b = 0; + } else if (this.selectX2 == 8) { + b = 2; + } + g.drawImage(this.img_1[b], 0, 73, 20); + g.drawString(this.str[this.selectX2], 48, 90, 20); + g.drawString(this.str[this.selectX2 + 1], 48, 104, 20); + if (this.selectX2 == 10) { + this.img_1 = null; + this.str = null; + this.aS = 0; + this.bool_preload = true; + gameStartVarInit(); + this.state_main = 40; + this.mpl.stop(); + // this.mpl.setPlayBackLoop(false); + } + } else if (this.state_main == 40) { + if (this.bool_preload) { + this.aS2 = 0; + this.chMove = false; + this.bool_preload = false; + this.counter = 0; + this.counter100 = 1; + this.img_whiteNum = Image.createImage("/f_3.png"); + this.img_redNum = Image.createImage("/f_5.png"); + loadImage(42, "/mC.dat", 12); + } + if (this.dLoadType != 0) { + loadTypeImg(this.dLoadType); + this.cuFloor = (byte)(this.dLoadType - 10); + createD(this.cuFloor); + gatePosition(); + if (this.dLoadType == 10) { + this.myCurse = false; + this.myPoison = false; + for (byte b = 0; b < 3; b++) { + if (this.myHP[b] != 0) { + this.myHP[b] = Global.HPD[b] + Global.HPG[b] * (this.myLV[b] - 1); + this.mySP[b] = Global.SPD[b] + Global.SPG[b] * (this.myLV[b] - 1); + } + } + } else if (this.dLoadType == 11) { + if (this.upDown) { + this.aS = 41; + this.counter100 = 0; + } else { + this.aS = 0; + } + } + this.dLoadType = 0; + } + if (this.aS == 0) { + if (this.useK > -5 && this.useK < 0) { + byte b = 0; + if (this.cuFloor == 0 || this.cuFloor == 1) { + b = 13; + } else if (this.cuFloor == 2 || this.cuFloor == 4 || this.cuFloor == 6) { + b = 2; + } else if (this.cuFloor == 3 || this.cuFloor == 5) { + b = 13; + } + if (this.useK == -2) { + if (this.mapB[this.cuDBY + 1][this.cuDBX] > -2 && this.mapB[this.cuDBY + 1][this.cuDBX] <= b) { + if (this.cuDBY % 8 == 7) { + this.movePage = true; + this.cuDBP = (byte)(this.cuDBP + 5); + } + this.chMove = true; + this.cuDBY = (byte)(this.cuDBY + 1); + this.counter100 = 1; + } + } else if (this.useK == -1) { + if (this.mapB[this.cuDBY - 1][this.cuDBX] > -2 && this.mapB[this.cuDBY - 1][this.cuDBX] <= b) { + if (this.cuDBY % 8 == 0) { + this.movePage = true; + this.cuDBP = (byte)(this.cuDBP - 5); + } + this.chMove = true; + this.cuDBY = (byte)(this.cuDBY - 1); + this.counter100 = 1; + } + } else if (this.useK == -3) { + if (this.mapB[this.cuDBY][this.cuDBX - 1] > -2 && this.mapB[this.cuDBY][this.cuDBX - 1] <= b) { + if (this.cuDBX % 8 == 0) { + this.movePage = true; + this.cuDBP = (byte)(this.cuDBP - 1); + } + this.chMove = true; + this.cuDBX = (byte)(this.cuDBX - 1); + this.counter100 = 1; + } + } else if (this.useK == -4 && this.mapB[this.cuDBY][this.cuDBX + 1] > -2 && this.mapB[this.cuDBY][this.cuDBX + 1] <= b) { + if (this.cuDBX % 8 == 7) { + this.movePage = true; + this.cuDBP = (byte)(this.cuDBP + 1); + } + this.chMove = true; + this.cuDBX = (byte)(this.cuDBX + 1); + this.counter100 = 1; + } + this.useK = 0; + } + if (this.movePage) { + this.monMapXY[0][0] = -1; + this.monMapXY[1][0] = -1; + bgPaint(41); + this.movePage = false; + } + } + g.drawImage(this.bG, 0, 0, 20); + if (this.aS == 0) { + monPointPaint(g); + chPaint(g); + } else if (this.aS == 30) { + if (this.onePaintS) { + this.aS2 = (byte)((this.ran.nextInt() >>> 1) % 99); + if (this.aS2 >= 0 && this.aS2 < 20) { + this.myPoison = true; + this.startTime = System.currentTimeMillis(); + } else if (this.aS2 >= 20 && this.aS2 < 40) { + this.myCurse = true; + this.startTime = System.currentTimeMillis(); + } else if (this.aS2 >= 40 && this.aS2 < 70) { + this.GP += 10; + } else if (this.aS2 >= 70 && this.aS2 < 90) { + this.GP += 20; + } else if (this.aS2 >= 90 && this.aS2 < 99 && this.myItem[this.aS2 - 90] < 99) { + this.myItem[this.aS2 - 90] = (byte)(this.myItem[this.aS2 - 90] + 1); + } + this.onePaintS = false; + if (this.aS2 >= 0 && this.aS2 < 40) { + soundPlay(12); + } else { + soundPlay(8); + } + } + if (this.counter100 == 1) { + g.drawImage(this.img_1[2], this.cuDBX % 8 * 15, this.cuDBY % 8 * 15, 20); + } else if (this.counter100 == 2) { + g.drawImage(this.img_1[3], this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 - 8, 20); + } else if (this.counter100 == 3) { + g.drawImage(this.img_1[2], this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 - 16, 20); + this.aS = 0; + this.aS2 = 0; + } + monPointPaint(g); + chPaint(g); + if (this.aS2 >= 40 && this.aS2 < 70) { + imgCutPaint(5, 7, 11, this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 + 25 - this.counter100 * 3, this.img_whiteNum, g); + numImgPaint("10", this.cuDBX % 8 * 15 + 5, this.cuDBY % 8 * 15 + 25 - this.counter100 * 3, g, this.img_whiteNum); + } else if (this.aS2 >= 70 && this.aS2 < 90) { + imgCutPaint(5, 7, 11, this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 + 25 - this.counter100 * 3, this.img_whiteNum, g); + numImgPaint("20", this.cuDBX % 8 * 15 + 5, this.cuDBY % 8 * 15 + 25 - this.counter100 * 3, g, this.img_whiteNum); + } else if (this.aS2 >= 90 && this.aS2 < 99) { + g.drawImage(this.img_1[6], this.cuDBX % 8 * 15 + 5, this.cuDBY % 8 * 15 + 25 - this.counter100 * 3, 20); + } + } else if (this.aS == 35) { + if (this.onePaintS) { + this.imgS_1 = Image.createImage("/s_1.png"); + this.imgS_2 = Image.createImage("/b1.png"); + loadString("t3", 12); + this.selectX = 0; + this.aS2 = 0; + this.onePaintS = false; + } + g.setColor(0, 0, 0); + g.fillRect(20, 8, 80, 106); + g.drawImage(this.imgS_1, 21, 9, 20); + g.setColor(0, 36, 85); + for (byte b1 = 0; b1 < 6; b1++) + g.fillRect(21, 25 + b1 * 13, 78, 12); + for (byte b2 = 0; b2 < 6; b2++) { + if (this.lastFloor > b2) { + g.setColor(255, 255, 255); + } else { + g.setColor(255, 0, 0); + } + if (b2 == 0) { + g.drawString(this.str[b2 * 2 + 1], 35, 25 + b2 * 13, 20); + } else { + g.drawString(this.str[b2 * 2 + 1], 29, 25 + b2 * 13, 20); + } + } + g.setColor(255, 182, 0); + g.drawLine(21, 103, 98, 103); + g.setColor(146, 73, 0); + g.drawLine(21, 112, 98, 112); + g.setColor(182, 109, 0); + g.fillRect(21, 104, 78, 8); + g.drawImage(this.img_knife, 7, 30 + this.selectX * 13, 20); + if (this.oneSoundS) { + soundPlay(16); + this.oneSoundS = false; + } + if (this.aS2 == 1) { + if (this.lastFloor > this.selectX) { + this.aS2 = 3; + } else { + this.aS2 = 2; + } + } else if (this.aS2 == 2) { + infoWinPaint(1, Global.ETC[21], "", 9, 49, 30, 60, this.imgS_2, g); + } else if (this.aS2 == 3) { + soundPlay(10); + this.imgS_1 = null; + this.aS = 40; + this.counter100 = 0; + } + } else if (this.aS == 40) { + if (this.counter100 < 7) { + g.setClip(53, 45 + this.counter100 * 3, 14, 21); + g.drawImage(this.img_char[0], 53, 45, 20); + } else { + g.drawImage(this.imgS_2, 9, 43, 20); + g.setColor(0, 0, 0); + if (this.selectX == 0) { + g.drawString(this.str[this.selectX * 2], 16, 47, 20); + } else { + g.drawString(this.str[this.selectX * 2], 42, 47, 20); + } + g.drawString(this.str[this.selectX * 2 + 1], 29, 62, 20); + this.dLoadType = (byte)(11 + this.selectX); + this.upDown = true; + this.imgS_2 = null; + this.str = null; + } + } else if (this.aS == 41) { + if (this.counter100 == 0) + bgPaint(41); + if (this.counter100 < 7) { + g.setClip(30, 74 - this.counter100 * 3, 14, 21); + g.drawImage(this.img_char[9], 30, 54, 20); + if (this.counter100 == 6) + this.aS = 0; + } + } else if (this.aS == 50) { + if (this.onePaintS) { + this.imgS_1 = Image.createImage("/s_1.png"); + this.oneSoundS = false; + this.onePaintS = false; + } + g.setColor(0, 0, 0); + g.fillRect(20, 14, 80, 93); + g.drawImage(this.imgS_1, 21, 15, 20); + g.setColor(0, 36, 85); + for (byte b = 0; b < 5; b++) + g.fillRect(21, 31 + b * 13, 78, 12); + g.setColor(255, 255, 255); + g.drawString(Global.Main[0], 27, 31, 20); + g.drawString(Global.Main[1], 27, 44, 20); + g.drawString(Global.Main[2] + this.volumLevel + ")", 27, 57, 20); + g.drawString(Global.Main[3], 27, 70, 20); + g.drawString(Global.Main[4], 27, 83, 20); + g.setColor(255, 182, 0); + g.drawLine(21, 96, 98, 96); + g.setColor(146, 73, 0); + g.drawLine(21, 105, 98, 105); + g.setColor(182, 109, 0); + g.fillRect(21, 97, 78, 8); + if (this.oneSoundS) { + this.counter = (byte)(this.counter + 1); + g.setColor(0, 36, 85); + g.fillRect(21, 44, 78, 12); + g.setColor(255, 0, 0); + g.fillRect(30, 48, 15 * this.counter, 4); + if (this.counter == 4) { + RecordStore recordStore = RecordStore.openRecordStore("saveData", true); + byte[] arrayOfByte = (this.myHP[0] + "/" + this.myHP[1] + "/" + this.myHP[2] + "/" + this.mySP[0] + "/" + this.mySP[1] + "/" + this.mySP[2] + "/" + this.myWP[0] + "/" + this.myWP[1] + "/" + this.myWP[2] + "/" + this.myItem[0] + "/" + this.myItem[1] + "/" + this.myItem[2] + "/" + this.myItem[3] + "/" + this.myItem[4] + "/" + this.myItem[5] + "/" + this.myItem[6] + "/" + this.myItem[7] + "/" + this.myItem[8] + "/" + this.myEX + "/" + this.cuFloor + "/" + this.lastFloor + "/" + this.cuDBX + "/" + this.cuDBY + "/" + this.cuDBP + "/" + this.GP).getBytes(); + if (recordStore.getNumRecords() == 0) { + recordStore.addRecord(arrayOfByte, 0, arrayOfByte.length); + } else { + recordStore.setRecord(recordStore.getNextRecordID() - 1, arrayOfByte, 0, arrayOfByte.length); + } + recordStore.closeRecordStore(); + recordStore = null; + this.oneSoundS = false; + } + } + g.drawImage(this.img_knife, 7, 36 + this.selectX * 13, 20); + } else if (this.aS == 51) { + if (this.onePaintS) { + this.imgS_1 = Image.createImage("/b1.png"); + this.onePaintS = false; + } + monPointPaint(g); + chPaint(g); + infoWinPaint(1, Global.ETC[6], "", 9, 41, 37, 52, this.imgS_1, g); + } + if ((this.myPoison || this.myCurse) && (System.currentTimeMillis() - this.startTime) / 1000L > 2L) { + this.timeON = true; + this.startTime = System.currentTimeMillis(); + } + if (this.myPoison && this.timeON) { + for (byte b = 0; b < 3; b++) { + this.myHP[b] = this.myHP[b] - 1; + if (this.myHP[b] == 0) { + this.myHP[b] = 1; + } else if (this.myHP[b] == -1) { + this.myHP[b] = 0; + } + } + if (this.myHP[0] < 2 && this.myHP[1] < 2 && this.myHP[2] < 2) + this.myPoison = false; + } + if (this.myCurse && this.timeON) { + for (byte b = 0; b < 3; b++) { + this.mySP[b] = this.mySP[b] - 1; + if (this.mySP[b] == 0) { + this.mySP[b] = 1; + } else if (this.mySP[b] == -1) { + this.mySP[b] = 0; + } + } + if (this.mySP[0] < 2 && this.mySP[1] < 2 && this.mySP[2] < 2) + this.myCurse = false; + } + this.timeON = false; + } else if (this.state_main == 41) { + if (this.bool_preload) { + bgPaint(45); + this.imgS_3 = Image.createImage("/pEZ.png"); + this.img_1 = null; + this.img_floor = null; + this.img_char = null; + this.mapB = null; + loadImage(42, "/fC.dat", 13); + loadImage(41, "/w.dat", 30); + this.monHP = new int[3]; + if (this.mapAB[this.cuDBY][this.cuDBX] == 8) { + this.monType = (byte)((this.ran.nextInt() >>> 1) % 6); + this.monLevel = (byte)((this.ran.nextInt() >>> 1) % 3 + 1 + (this.cuFloor - 1) * 3); + for (byte b1 = 0; b1 < 3; b1++) + this.monHP[b1] = Global.monHPD[this.monType] + (this.monLevel - 1) * 5; + this.monAT = Global.monATD[this.monType] + 3 * (this.monLevel - 1); + } else { + this.monType = (byte)(this.cuFloor + 4); + this.monLevel = (byte)((this.cuFloor - 1) * 10); + this.monHP[0] = Global.monHPD[this.monType]; + this.monHP[2] = Global.monHPD[this.monType]; + this.monHP[1] = 0; + this.monAT = Global.monATD[this.monType]; + } + byte b = 0; + if (this.monType >= 0 && this.monType < 6) { + this.selectX = (byte)(this.monType * 2); + this.selectY = (byte)(this.selectX + 1); + b = 2; + } else if (this.monType == 6) { + this.selectX = 12; + this.selectY = 14; + b = 3; + } else if (this.monType >= 7 && this.monType < 10) { + this.selectX = (byte)(15 + (this.monType - 7) * 4); + this.selectY = (byte)(this.selectX + 3); + b = 4; + } else if (this.monType == 10) { + this.selectX = 27; + this.selectY = 29; + b = 3; + } + loadImage(44, "/mon.dat", b); + loadString("t7", 12); + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + g.setColor(255, 255, 255); + g.drawString(this.str[this.monType], 46, 46, 20); + numImgPaint(this.monLevel + "", 64, 60, g, this.img_redNum); + numImgPaint(this.monHP[0] + "", 64, 70, g, this.img_redNum); + if (this.counter100 % 3 < 2) + g.drawImage(this.imgS_3, 32, 98, 20); + if (this.counter100 % 6 < 3) { + this.selectX = 0; + } else { + this.selectX = 1; + } + if (this.monType < 7) { + g.drawImage(this.img_1[this.selectX], 21, 76, 36); + } else { + g.drawImage(this.img_1[this.selectX], 18, 76, 36); + } + } else if (this.state_main == 42) { + if (this.bool_preload) { + bgPaint(46); + this.aS2 = 0; + this.selectX = 0; + this.selectY = 0; + this.selectX2 = 0; + this.selectY2 = 0; + this.selectX3 = 0; + this.selectY3 = 0; + this.aS = 1; + this.bool_preload = false; + this.upDown = false; + this.monCh = false; + this.myAttack = new boolean[3]; + this.imgS_1 = Image.createImage("/fa1.png"); + this.imgS_2 = Image.createImage("/f_1.png"); + this.imgS_3 = Image.createImage("/s_1.png"); + this.imgS_4 = Image.createImage("/i_0.png"); + this.imgS_5 = Image.createImage("/fa2.png"); + this.imgS_6 = Image.createImage("/b1.png"); + } + g.drawImage(this.bG, 0, 0, 20); + int i = 0; + imgCutPaint(25, 19, this.selectX, 8, 101, this.imgS_1, g); + i = this.monHP[0] * 30 / this.monHP[2]; + g.setColor(221, 0, 0); + g.fillRect(6, 1, i, 3); + g.setColor(255, 72, 0); + g.fillRect(6, 2, i, 1); + if (this.monType < 6) { + i = this.monHP[1] * 30 / this.monHP[2]; + g.setColor(221, 0, 0); + g.fillRect(6, 5, i, 3); + g.setColor(255, 72, 0); + g.fillRect(6, 6, i, 1); + } + i = this.myHP[this.selectX] * 50 / (Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)); + g.setColor(219, 0, 0); + g.fillRect(56, 101, i, 2); + g.fillRect(56, 108, i, 2); + g.setColor(255, 0, 0); + g.fillRect(56, 103, i, 2); + g.fillRect(56, 106, i, 2); + g.setColor(255, 73, 0); + g.fillRect(56, 105, i, 1); + imgCutPaint(5, 7, 10, 79, 102, this.img_whiteNum, g); + numImgPaint(this.myHP[this.selectX] + "", 62, 102, g, this.img_whiteNum); + numImgPaint((Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 86, 102, g, this.img_whiteNum); + i = this.mySP[this.selectX] * 50 / (Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)); + g.setColor(0, 0, 255); + g.fillRect(56, 111, i, 2); + g.fillRect(56, 118, i, 2); + g.setColor(0, 73, 255); + g.fillRect(56, 113, i, 2); + g.fillRect(56, 116, i, 2); + g.setColor(0, 146, 255); + g.fillRect(56, 115, i, 1); + imgCutPaint(5, 7, 10, 79, 112, this.img_whiteNum, g); + numImgPaint(this.mySP[this.selectX] + "", 62, 112, g, this.img_whiteNum); + numImgPaint((Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 86, 112, g, this.img_whiteNum); + if (this.counter100 % 4 < 2) { + this.selectX2 = 0; + } else { + this.selectX2 = 1; + } + if (this.monCh) { + if (this.monHP[0] > 0 && (this.selectX3 != 1 || this.aS == 8)) + g.drawImage(this.img_1[2], 14 - this.selectX2, 47 + this.selectX2, 36); + } else if (this.monHP[0] > 0 && (this.selectX3 != 1 || this.aS == 8)) { + g.drawImage(this.img_1[0], 14 - this.selectX2, 47 + this.selectX2, 36); + } + if (this.monHP[1] > 0 && (this.selectX3 != 2 || this.aS == 8)) + g.drawImage(this.img_1[0], 14 + this.selectX2, 82 - this.selectX2, 36); + if (this.myHP[0] > 0) + if (this.selectX == 0) { + if (this.aS < 4) { + g.drawImage(this.img_char[0], 100 + this.selectX2, 39 - this.selectX2, 40); + } else if (this.aS > 4) { + g.drawImage(this.img_char[0], 113 + this.selectX2, 39 - this.selectX2, 40); + } + } else if (this.selectX != 0) { + g.drawImage(this.img_char[0], 113 + this.selectX2, 39 - this.selectX2, 40); + } + if (this.myHP[1] > 0) + if (this.selectX == 1) { + if (this.aS < 4) { + g.drawImage(this.img_char[5], 100 - this.selectX2, 69 + this.selectX2, 40); + } else if (this.aS > 4) { + g.drawImage(this.img_char[5], 113 - this.selectX2, 69 + this.selectX2, 40); + } + } else if (this.selectX != 1) { + g.drawImage(this.img_char[5], 113 - this.selectX2, 69 + this.selectX2, 40); + } + if (this.myHP[2] > 0) + if (this.selectX == 2) { + if (this.aS < 4) { + g.drawImage(this.img_char[9], 100 + this.selectX2, 99 - this.selectX2, 40); + } else if (this.aS > 4) { + g.drawImage(this.img_char[9], 113 + this.selectX2, 99 - this.selectX2, 40); + } + } else if (this.selectX != 2) { + g.drawImage(this.img_char[9], 113 + this.selectX2, 99 - this.selectX2, 40); + } + if (this.aS == 2) { + if (this.aS2 == 0) { + g.setColor(0, 0, 0); + g.fillRect(20, 6, 80, 17); + } else { + g.setColor(0, 0, 0); + g.fillRect(20, 6, 80, 94); + } + g.drawImage(this.imgS_3, 21, 7, 20); + imgCutPaint(7, 11, 0, 25, 9, this.imgS_4, g); + imgCutPaint(7, 11, 1, 88, 9, this.imgS_4, g); + if (this.aS2 != 0) { + g.setColor(109, 36, 0); + g.fillRect(21, 24, 78, 64); + g.setColor(73, 0, 0); + for (byte b = 0; b < 6; b++) + g.drawLine(21, 23 + b * 13, 98, 23 + b * 13); + g.drawLine(85, 24, 85, 87); + g.setColor(255, 182, 0); + g.drawLine(21, 89, 98, 89); + g.setColor(146, 73, 0); + g.drawLine(21, 98, 98, 98); + g.setColor(182, 109, 0); + g.fillRect(21, 90, 78, 8); + } + if (this.aS2 == 0) { + g.setColor(255, 255, 255); + g.drawString(Global.ETC[18], 36, 9, 20); + } else if (this.aS2 == 1) { + g.setColor(255, 255, 255); + g.drawString(Global.ETC[19], 36, 9, 20); + if (this.selectX == 0) { + if (this.selectY < 5) { + for (byte b = 0; b < 5; b++) { + g.drawString(Global.skill_1[b], 23, 24 + b * 13, 20); + if (Global.skill_1SP[b] / 10 != 0) + imgCutPaint(5, 7, Global.skill_1SP[b] / 10, 87, 27 + b * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, Global.skill_1SP[b] % 10, 93, 27 + b * 13, this.img_whiteNum, g); + } + } else { + g.drawString(Global.skill_1[5], 23, 24, 20); + if (Global.skill_1SP[5] / 10 != 0) + imgCutPaint(5, 7, Global.skill_1SP[5] / 10, 87, 27, this.img_whiteNum, g); + g.setColor(109, 36, 0); + g.drawLine(85, 37, 85, 48); + g.setColor(255, 255, 255); + imgCutPaint(5, 7, Global.skill_1SP[5] % 10, 93, 27, this.img_whiteNum, g); + g.drawString(Global.skill_1[6], 23, 37, 20); + } + } else if (this.selectX == 1) { + if (this.selectY < 5) { + for (byte b = 0; b < 5; b++) { + g.drawString(Global.skill_2[b], 23, 24 + b * 13, 20); + if (Global.skill_1SP[b] / 10 != 0) + imgCutPaint(5, 7, Global.skill_1SP[b] / 10, 87, 27 + b * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, Global.skill_1SP[b] % 10, 93, 27 + b * 13, this.img_whiteNum, g); + } + } else { + g.drawString(Global.skill_2[5], 23, 24, 20); + if (Global.skill_1SP[5] / 10 != 0) + imgCutPaint(5, 7, Global.skill_1SP[5] / 10, 87, 27, this.img_whiteNum, g); + imgCutPaint(5, 7, Global.skill_1SP[5] % 10, 93, 27, this.img_whiteNum, g); + } + } else if (this.selectX == 2) { + if (this.selectY < 5) { + for (byte b = 0; b < 5; b++) { + g.drawString(Global.skill_3[b], 23, 24 + b * 13, 20); + if (Global.skill_3SP[b] / 10 != 0) + imgCutPaint(5, 7, Global.skill_3SP[b] / 10, 87, 27 + b * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, Global.skill_3SP[b] % 10, 93, 27 + b * 13, this.img_whiteNum, g); + } + } else { + for (byte b = 0; b < 4; b++) { + g.drawString(Global.skill_3[b + 5], 23, 24 + b * 13, 20); + if (Global.skill_3SP[b + 5] / 10 != 0) + imgCutPaint(5, 7, Global.skill_3SP[b + 5] / 10, 87, 27 + b * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, Global.skill_3SP[b + 5] % 10, 93, 27 + b * 13, this.img_whiteNum, g); + } + } + } + if (this.selectY < 5) { + g.drawImage(this.img_knife, 4, 29 + this.selectY * 13, 20); + } else { + g.drawImage(this.img_knife, 4, 29 + (this.selectY - 5) * 13, 20); + } + } else if (this.aS2 == 2) { + g.setColor(255, 255, 255); + g.drawString(Global.ETC[9], 36, 9, 20); + if (this.selectY < 5) { + for (byte b = 0; b < 5; b++) { + g.drawString(Global.itemName[b], 23, 24 + b * 13, 20); + if (this.myItem[b] / 10 != 0) + imgCutPaint(5, 7, this.myItem[b] / 10, 87, 27 + b * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, this.myItem[b] % 10, 93, 27 + b * 13, this.img_whiteNum, g); + } + } else { + for (byte b = 5; b < 9; b++) { + g.drawString(Global.itemName[b], 23, 24 + (b - 5) * 13, 20); + if (this.myItem[b] / 10 != 0) + imgCutPaint(5, 7, this.myItem[b] / 10, 87, 27 + (b - 5) * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, this.myItem[b] % 10, 93, 27 + (b - 5) * 13, this.img_whiteNum, g); + } + } + if (this.selectY < 5) { + g.drawImage(this.img_knife, 4, 29 + this.selectY * 13, 20); + } else { + g.drawImage(this.img_knife, 4, 29 + (this.selectY - 5) * 13, 20); + } + } + } else if (this.aS == 3) { + g.drawImage(this.imgS_2, 35, 30 + this.selectY2 * 37, 20); + } else if (this.aS == 4) { + if (this.counter == -1 && (this.selectX != 0 || this.useSkill != 6)) { + if (this.useSkill > -1) + if (this.selectX == 0) { + this.mySP[0] = this.mySP[0] - Global.skill_1SP[this.useSkill]; + } else if (this.selectX == 1) { + this.mySP[1] = this.mySP[1] - Global.skill_1SP[this.useSkill]; + } else if (this.selectX == 2) { + this.mySP[2] = this.mySP[2] - Global.skill_3SP[this.useSkill]; + } + this.tDamage = Global.ATD[this.selectX] + Global.ATG[this.selectX] * (this.myLV[this.selectX] - 1); + if (this.selectX == 0) { + this.tDamage += 2 + (this.myWP[this.selectX] - 1) * 2; + } else if (this.selectX == 1) { + this.tDamage += 3 + (this.myWP[this.selectX] - 1) * 2; + } else if (this.selectX == 2) { + this.tDamage += 1 + (this.myWP[this.selectX] - 1) * 2; + } + this.tDamage += (byte)((this.ran.nextInt() >>> 1) % 3); + if (this.upDown) + this.tDamage += (Global.ATD[this.selectX] + Global.ATG[this.selectX] * (this.myLV[this.selectX] - 1) + this.myWP[this.selectX]) / 2; + } + this.counter = (byte)(this.counter + 1); + if (this.selectX == 0) { + if (this.useSkill == -1) { + g.drawImage(this.img_char[Global.sA_M0[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[0], 37, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + this.aS = 5; + this.counter = -1; + } + } else if (this.useSkill == 0) { + g.drawImage(this.img_char[Global.sA_M1[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[2], 34, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 1) { + g.drawImage(this.img_char[Global.sA_M2[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[1], 38, 29 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 2) { + g.drawImage(this.img_char[Global.sA_M3[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[0], 37, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[2], 34, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 3) { + g.drawImage(this.img_char[Global.sA_M4[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[1], 38, 29 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[0], 37, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 5) { + this.aS = 5; + } + } else if (this.useSkill == 4) { + g.drawImage(this.img_char[Global.sA_M5[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[2], 34, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[0], 37, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 5) { + this.aS = 5; + } + } else if (this.useSkill == 5) { + g.drawImage(this.img_char[Global.sA_M6[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[2], 34, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + g.drawImage(this.img_floor[1], 38, 29 + this.selectY2 * 35, 20); + } else if (this.counter == 5) { + g.drawImage(this.img_floor[2], 34, 30 + this.selectY2 * 35, 20); + } else if (this.counter == 6) { + this.aS = 5; + } + } else if (this.useSkill == 6) { + if (this.counter == 4 || this.counter == 5) { + g.drawImage(this.img_char[4], 66, 47 + this.selectY2 * 35, 40); + } else { + g.drawImage(this.img_char[4], 63, 47 + this.selectY2 * 35, 40); + } + if (this.counter == 1) { + g.drawImage(this.img_floor[3], 41, 25 + this.selectY2 * 35, 20); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[4], 38, 18 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[4], 38, 18 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[5], 30, 26 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + g.drawImage(this.img_floor[4], 38, 18 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[5], 26, 26 + this.selectY2 * 35, 20); + } else if (this.counter == 5) { + g.drawImage(this.img_floor[5], 26, 26 + this.selectY2 * 35, 20); + } else if (this.counter == 6) { + g.drawImage(this.img_floor[6], 18, 43, 36); + } else if (this.counter == 7) { + g.drawImage(this.img_floor[7], 16, 46, 36); + this.monHP[0] = 30 + (this.monType - 6) * 20; + this.monAT = (30 + (this.monType - 6) * 20) / 10; + this.monCh = true; + if (this.monType == 10) { + this.aS = 30; + this.selectX3 = 1; + this.onePaintS = true; + this.myAttack[0] = true; + } else { + this.aS = 5; + } + } + } + if (this.counter == 1) + if (this.useSkill == 6) { + soundPlay(5); + } else { + soundPlay(2); + } + if (this.counter > 1 && this.useSkill != 6) + if (this.counter % 2 == 0) { + g.drawImage(this.img_floor[28], 16, 42 + this.selectY2 * 35, 36); + } else { + g.drawImage(this.img_floor[29], 12, 42 + this.selectY2 * 35, 36); + } + if (this.aS == 5 && this.useSkill != 6 && this.useSkill != -1) { + this.tDamage += 5 + this.useSkill * 8; + this.counter = -1; + } + } else if (this.selectX == 1) { + if (this.useSkill == -1) { + g.drawImage(this.img_char[Global.sB_M0[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[8], 35, 16 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + this.counter = -1; + } + } else if (this.useSkill == 0) { + g.drawImage(this.img_char[Global.sB_M1[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[9], 35, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 1) { + g.drawImage(this.img_char[Global.sB_M2[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[10], 39, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 2) { + g.drawImage(this.img_char[Global.sB_M3[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[11], 40, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[8], 35, 16 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 3) { + g.drawImage(this.img_char[Global.sB_M4[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[9], 35, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[11], 40, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 4) { + g.drawImage(this.img_char[Global.sB_M5[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[10], 39, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[11], 40, 17 + this.selectY2 * 35, 20); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 5) { + g.drawImage(this.img_char[Global.sB_M6[this.counter]], 63, 47 + this.selectY2 * 35, 40); + if (this.counter == 2) { + g.drawImage(this.img_floor[10], 39, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[12], 18, 29 + this.selectY2 * 35, 36); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[11], 40, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[13], 11, 39 + this.selectY2 * 35, 36); + } else if (this.counter == 4) { + g.drawImage(this.img_floor[8], 35, 16 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[12], 18, 29 + this.selectY2 * 35, 36); + } else if (this.counter == 5) { + g.drawImage(this.img_floor[13], 11, 39 + this.selectY2 * 35, 36); + this.aS = 5; + } + } + if (this.counter == 1) + if (this.useSkill == 5) { + soundPlay(14); + } else { + soundPlay(2); + } + if (this.counter > 1 && this.useSkill != 5) + if (this.counter % 2 == 0) { + g.drawImage(this.img_floor[28], 16, 42 + this.selectY2 * 35, 36); + } else { + g.drawImage(this.img_floor[29], 12, 42 + this.selectY2 * 35, 36); + } + if (this.aS == 5 && this.useSkill != -1) { + this.tDamage += 5 + this.useSkill * 8; + this.counter = -1; + } + } else if (this.selectX == 2) { + if (this.useSkill == -1) { + g.drawImage(this.img_char[Global.sC_M0[this.counter]], 53, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[14], 39, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[28], 16, 42 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[29], 12, 42 + this.selectY2 * 35, 36); + } else if (this.counter == 3) { + this.aS = 5; + this.counter = -1; + } + } else if (this.useSkill == 0) { + g.drawImage(this.img_char[Global.sC_M1[this.counter]], 83, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[15], 56, 28 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[17], 22, 38 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[17], 15, 45 + this.selectY2 * 35, 36); + } else if (this.counter == 3) { + this.aS = 5; + } + } else if (this.useSkill == 1) { + g.drawImage(this.img_char[Global.sC_M2[this.counter]], 83, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[16], 52, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[18], 13, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[19], 17, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 3) { + this.aS = 5; + } + } else if (this.useSkill == 2) { + g.drawImage(this.img_char[Global.sC_M3[this.counter]], 83, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[15], 56, 28 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[20], 14, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[20], 14, 47 + this.selectY2 * 35, 36); + g.drawImage(this.img_floor[21], 16, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 3) { + this.aS = 5; + } + } else if (this.useSkill == 3) { + g.drawImage(this.img_char[Global.sC_M4[this.counter]], 83, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[14], 59, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[22], 21, 33 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[16], 52, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[22], 10, 44 + this.selectY2 * 35, 36); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 4) { + g.drawImage(this.img_char[Global.sC_M5[this.counter]], 83, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[15], 56, 28 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[23], 13, 26 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[16], 52, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[23], 13, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 4) { + this.aS = 5; + } + } else if (this.useSkill == 5) { + g.drawImage(this.img_char[Global.sC_M6[this.counter]], 83, 47 + this.selectY2 * 35, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[15], 56, 28 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[24], 13, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[14], 59, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[25], 17, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[16], 52, 17 + this.selectY2 * 35, 20); + g.drawImage(this.img_floor[24], 17, 47 + this.selectY2 * 35, 36); + } else if (this.counter == 5) { + this.aS = 5; + } + } else if (this.useSkill == 6 || this.useSkill == 8) { + g.drawImage(this.img_char[Global.sC_M0[this.counter]], 113, 99, 40); + if (this.counter == 1) { + g.drawImage(this.img_floor[14], 88, 68, 20); + if (this.myHP[0] > 0) + g.drawImage(this.img_floor[26], 95, 20, 36); + if (this.myHP[1] > 0) + g.drawImage(this.img_floor[26], 95, 50, 36); + } else if (this.counter == 2) { + if (this.myHP[0] > 0) + g.drawImage(this.img_floor[27], 93, 30, 36); + if (this.myHP[1] > 0) + g.drawImage(this.img_floor[27], 93, 60, 36); + } else if (this.counter == 3) { + if (this.myHP[0] > 0) + g.drawImage(this.img_floor[26], 95, 30, 36); + if (this.myHP[1] > 0) + g.drawImage(this.img_floor[26], 95, 60, 36); + if (this.useSkill == 6) { + this.upDown = true; + this.aS = 5; + this.counter = 2; + this.tDamage = 0; + if (this.monHP[0] > 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + } else if (this.useSkill == 8) { + if (this.myHP[0] > 0) { + this.myHP[0] = this.myHP[0] + (Global.HPD[0] + Global.HPG[0] * (this.myLV[0] - 1)) / 2; + if (this.myHP[0] > Global.HPD[0] + Global.HPG[0] * (this.myLV[0] - 1)) + this.myHP[0] = Global.HPD[0] + Global.HPG[0] * (this.myLV[0] - 1); + } + if (this.myHP[1] > 0) { + this.myHP[1] = this.myHP[1] + (Global.HPD[1] + Global.HPG[1] * (this.myLV[1] - 1)) / 2; + if (this.myHP[1] > Global.HPD[1] + Global.HPG[1] * (this.myLV[1] - 1)) + this.myHP[1] = Global.HPD[1] + Global.HPG[1] * (this.myLV[1] - 1); + } + this.aS = 5; + this.counter = 2; + this.tDamage = 0; + if (this.monHP[0] > 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + } + } + } else if (this.useSkill == 7) { + if (this.myHP[0] > 0 || this.myHP[1] > 0) { + this.aS = 6; + if (this.myHP[0] > 0) { + this.aS2 = 0; + } else { + this.aS2 = 1; + } + } else { + this.aS = 9; + } + } + if (this.counter == 1) + if (this.useSkill == -1) { + soundPlay(2); + } else { + soundPlay(14); + } + if (this.aS == 5 && this.useSkill > -1 && this.useSkill < 6) { + this.tDamage += 10 + this.useSkill * 8; + this.counter = -1; + } + } + } else if (this.aS == 5) { + this.counter = (byte)(this.counter + 1); + if (this.counter == 0) + soundPlay(9); + if (this.counter < 3) { + imgCutPaint(5, 7, 12, 33, 26 - this.counter + this.selectY2 * 35, this.img_redNum, g); + numImgPaint(this.tDamage + "", 38, 26 - this.counter + this.selectY2 * 35, g, this.img_redNum); + } else { + if (this.counter == 3) { + this.monHP[this.selectY2] = this.monHP[this.selectY2] - this.tDamage; + if (this.monHP[this.selectY2] < 0) { + this.monHP[this.selectY2] = 0; + if (this.monType == 10) + this.monHP[0] = 1; + } + } + if (this.monHP[this.selectY2] == 0) { + if (this.counter == 3) { + g.drawImage(this.img_floor[26], 16, 38 + this.selectY2 * 35, 36); + } else if (this.counter == 4) { + g.drawImage(this.img_floor[27], 14, 39 + this.selectY2 * 35, 36); + } else { + g.drawImage(this.img_floor[26], 16, 38 + this.selectY2 * 35, 36); + this.aS = 1; + this.myAttack[this.selectX] = true; + 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 { + this.aS = 7; + } + } 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 { + this.aS = 7; + } + } 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 { + this.aS = 7; + } + } + if (this.monHP[0] > 0 || this.monHP[1] > 0) { + if (this.aS == 7) { + this.onePaintS = true; + this.counter = -1; + if (this.monHP[0] > 0) { + this.selectX3 = 1; + } else { + this.selectX3 = 2; + } + } + } else if (this.myHP[0] == 0) { + this.aS = 20; + this.oneSoundS = true; + this.selectX3 = 0; + this.aS2 = 0; + } else { + this.aS = 10; + this.aS2 = 0; + this.onePaintS = true; + } + } + } else { + this.aS = 1; + this.myAttack[this.selectX] = true; + 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 { + this.aS = 7; + } + } 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 { + this.aS = 7; + } + } 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 { + this.aS = 7; + } + } + if (this.monHP[0] > 0 || this.monHP[1] > 0) { + if (this.aS == 7) { + this.onePaintS = true; + this.counter = -1; + if (this.monHP[0] > 0) { + this.selectX3 = 1; + } else { + this.selectX3 = 2; + } + } + } else if (this.myHP[0] == 0) { + this.aS = 20; + this.oneSoundS = true; + this.selectX3 = 0; + this.aS2 = 0; + } else { + this.aS = 10; + this.aS2 = 0; + this.onePaintS = true; + } + } + } + } else if (this.aS == 6) { + if (this.onePaintS) { + this.counter = (byte)(this.counter + 1); + if (this.aS2 == 0) { + if (this.counter == 1) { + g.drawImage(this.img_floor[26], 95, 20, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[27], 93, 30, 36); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[26], 95, 30, 36); + this.onePaintS = false; + this.aS = 5; + this.counter = 2; + this.tDamage = 0; + if (this.monHP[0] > 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + this.myHP[0] = this.myHP[0] + (Global.HPD[0] + Global.HPG[0] * (this.myLV[0] - 1)) / 2; + if (this.myHP[0] > Global.HPD[0] + Global.HPG[0] * (this.myLV[0] - 1)) + this.myHP[0] = Global.HPD[0] + Global.HPG[0] * (this.myLV[0] - 1); + } + } else if (this.counter == 1) { + g.drawImage(this.img_floor[26], 95, 50, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[27], 93, 60, 36); + } else if (this.counter == 3) { + g.drawImage(this.img_floor[26], 95, 60, 36); + this.onePaintS = false; + this.aS = 5; + this.counter = 2; + this.tDamage = 0; + if (this.monHP[0] > 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + this.myHP[1] = this.myHP[1] + (Global.HPD[1] + Global.HPG[1] * (this.myLV[1] - 1)) / 2; + if (this.myHP[1] > Global.HPD[1] + Global.HPG[1] * (this.myLV[1] - 1)) + this.myHP[1] = Global.HPD[1] + Global.HPG[1] * (this.myLV[1] - 1); + } + } else { + g.setColor(0, 0, 0); + g.fillRect(29, 36, 62, 29); + g.setColor(182, 109, 0); + g.drawRect(30, 37, 59, 26); + g.drawRect(31, 38, 57, 24); + g.setColor(255, 182, 0); + g.drawRect(30, 37, 58, 25); + if (this.myHP[0] > 0) { + imgCutPaint(25, 19, 0, 34, 41, this.imgS_1, g); + } else { + imgCutPaint(25, 19, 0, 34, 41, this.imgS_5, g); + } + if (this.myHP[1] > 0) { + imgCutPaint(25, 19, 1, 61, 41, this.imgS_1, g); + } else { + imgCutPaint(25, 19, 1, 61, 41, this.imgS_5, g); + } + g.drawImage(this.img_knife, 28 + this.aS2 * 29, 63, 20); + } + } else if (this.aS == 7) { + if (this.onePaintS) { + this.aS2 = (byte)((this.ran.nextInt() >>> 1) % 3); + if (this.myHP[this.aS2] == 0) { + this.aS2 = 0; + if (this.myHP[0] == 0) { + this.aS2 = 1; + if (this.myHP[1] == 0) + this.aS2 = 2; + } + } + this.selectX = this.aS2; + this.onePaintS = false; + } + this.counter = (byte)(this.counter + 1); + if (this.counter == 0) { + if (this.monCh) { + g.drawImage(this.img_1[2], 75, 38 + this.aS2 * 30, 36); + } else { + g.drawImage(this.img_1[0], 75, 38 + this.aS2 * 30, 36); + } + soundPlay(1); + } else if (this.counter == 1 || this.counter == 3) { + if (this.monCh) { + if (this.monType == 6 || this.monType == 10) { + g.drawImage(this.img_1[2], 75, 38 + this.aS2 * 30, 36); + } else { + g.drawImage(this.img_1[3], 75, 38 + this.aS2 * 30, 36); + } + } else { + g.drawImage(this.img_1[1], 75, 38 + this.aS2 * 30, 36); + } + g.drawImage(this.img_floor[28], 95, 33 + this.aS2 * 30, 36); + } else if (this.counter == 2) { + if (this.monCh) { + g.drawImage(this.img_1[2], 75, 38 + this.aS2 * 30, 36); + } else { + g.drawImage(this.img_1[0], 75, 38 + this.aS2 * 30, 36); + } + g.drawImage(this.img_floor[29], 92, 33 + this.aS2 * 30, 36); + } else if (this.counter == 4) { + if (this.monCh) { + g.drawImage(this.img_1[2], 75, 38 + this.aS2 * 30, 36); + } else { + g.drawImage(this.img_1[0], 75, 38 + this.aS2 * 30, 36); + } + this.aS = 8; + this.counter = -1; + } + } else if (this.aS == 8) { + this.counter = (byte)(this.counter + 1); + if (this.counter == 0) { + this.tDamage = this.monAT; + this.tDamage += (this.ran.nextInt() >>> 1) % 3; + } + if (this.counter < 3) { + imgCutPaint(5, 7, 12, 74, 17 - this.counter + this.aS2 * 30, this.img_redNum, g); + numImgPaint(this.tDamage + "", 79, 17 - this.counter + this.aS2 * 30, g, this.img_redNum); + } else { + if (this.counter == 3) { + this.myHP[this.aS2] = this.myHP[this.aS2] - this.tDamage; + if (this.myHP[this.aS2] < 0) + this.myHP[this.aS2] = 0; + } + if (this.myHP[this.aS2] == 0) { + if (this.counter == 3) { + g.drawImage(this.img_floor[26], 95, 28 + this.aS2 * 30, 36); + } else if (this.counter == 4) { + g.drawImage(this.img_floor[27], 93, 33 + this.aS2 * 30, 36); + } else { + g.drawImage(this.img_floor[26], 95, 28 + this.aS2 * 30, 36); + if (this.myHP[0] == 0 && this.myHP[1] == 0 && this.myHP[2] == 0) { + this.aS = 20; + this.oneSoundS = true; + this.selectX3 = 0; + this.aS2 = 0; + } else if (this.selectX3 == 1 && this.monHP[1] > 0) { + this.selectX3 = 2; + this.aS = 7; + this.counter = -1; + this.onePaintS = true; + } else { + this.aS = 1; + if (this.myHP[0] == 0) { + this.selectX = 1; + if (this.myHP[1] == 0) + this.selectX = 2; + } else { + this.selectX = 0; + } + this.myAttack[0] = false; + this.myAttack[1] = false; + this.myAttack[2] = false; + this.selectX3 = 0; + this.upDown = false; + } + } + } else if (this.selectX3 == 1 && this.monHP[1] > 0) { + this.selectX3 = 2; + this.aS = 7; + this.counter = -1; + this.onePaintS = true; + } else { + this.aS = 1; + if (this.myHP[0] == 0) { + this.selectX = 1; + if (this.myHP[1] == 0) + this.selectX = 2; + } else { + this.selectX = 0; + } + this.myAttack[0] = false; + this.myAttack[1] = false; + this.myAttack[2] = false; + this.upDown = false; + this.selectX3 = 0; + } + } + } else if (this.aS == 9) { + infoWinPaint(1, Global.ETC[4], "", 9, 31, 29, 42, this.imgS_6, g); + } else if (this.aS == 10) { + if (this.onePaintS) { + this.onePaintS = false; + if (this.monType < 6) { + this.tDamage = (this.monType + 2) * 10 + (this.monLevel - 1) * 20; + this.selectY2 = this.monType + this.monLevel - 1 + 1; + } else { + if (this.monType == 6) { + this.tDamage = 1000; + } else if (this.monType == 7) { + this.tDamage = 2000; + } else if (this.monType == 8) { + this.tDamage = 4000; + } else if (this.monType == 9) { + this.tDamage = 6000; + } else if (this.monType == 10) { + this.tDamage = 8000; + } + this.lastFloor = (byte)(this.monType - 3); + if (this.monType == 10) + this.lastFloor = 6; + this.selectY2 = 15 + (this.monType - 6) * 2; + } + this.GP += this.tDamage; + this.myEX += this.selectY2; + int j = this.myEX; + byte b1 = 1; + byte b2 = 10; + while (true) { + j -= b2; + if (j >= 0) { + b1++; + j -= b2; + b2 += 20; + continue; + } + this.myLV[0] = (byte)b1; + j = this.myEX; + b1 = 1; + b2 = 10; + while (true) { + j -= b2; + if (j >= 0) { + b1++; + j -= b2; + b2 += 10; + continue; + } + this.myLV[1] = (byte)b1; + j = this.myEX; + b1 = 1; + b2 = 15; + while (true) { + j -= b2; + if (j >= 0) { + b1++; + j -= b2; + b2 += 15; + continue; + } + this.myLV[2] = (byte)b1; + this.aS2 = 1; + break; + } + break; + } + break; + } + } + g.drawImage(this.imgS_6, 9, 31, 20); + g.setColor(0, 0, 0); + g.drawString(this.tDamage + " GP획득", 88, 35, 24); + g.drawString(this.selectY2 + " EX획득", 88, 50, 24); + } else if (this.aS == 11) { + if (this.aS2 == 1) { + this.aS2 = 2; + this.counter = -1; + if (this.selectY == 0) { + this.myHP[this.selectX] = this.myHP[this.selectX] + (Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) / 2; + } else if (this.selectY == 1) { + this.myHP[this.selectX] = this.myHP[this.selectX] + Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectY == 2) { + this.mySP[this.selectX] = this.mySP[this.selectX] + (Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) / 2; + } else if (this.selectY == 3) { + this.mySP[this.selectX] = this.mySP[this.selectX] + Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectY == 4) { + this.myHP[this.selectX] = this.myHP[this.selectX] + Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + this.mySP[this.selectX] = this.mySP[this.selectX] + Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectY == 5) { + this.myPoison = false; + } else if (this.selectY == 6) { + this.myCurse = false; + } else if (this.selectY == 7) { + this.aS2 = 6; + if (this.selectX == 0) { + if (this.myHP[1] == 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + } else if (this.myHP[0] == 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + } else if (this.selectY == 8) { + this.aS2 = 5; + } + if (this.myHP[this.selectX] > Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) + this.myHP[this.selectX] = Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + if (this.mySP[this.selectX] > Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) + this.mySP[this.selectX] = Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + this.myItem[this.selectY] = (byte)(this.myItem[this.selectY] - 1); + } + if (this.aS2 == 2) { + this.counter = (byte)(this.counter + 1); + if (this.counter == 0) { + g.drawImage(this.img_floor[26], 95, 28 + this.selectX * 30, 36); + } else if (this.counter == 1) { + g.drawImage(this.img_floor[27], 93, 33 + this.selectX * 30, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[26], 95, 28 + this.selectX * 30, 36); + this.aS = 5; + this.counter = 2; + this.tDamage = 0; + if (this.monHP[0] > 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + } + } else if (this.aS2 == 3) { + infoWinPaint(1, Global.ETC[3], "", 9, 31, 29, 43, this.imgS_6, g); + } else if (this.aS2 == 4) { + infoWinPaint(1, Global.ETC[4], "", 9, 31, 29, 43, this.imgS_6, g); + } else if (this.aS2 == 5) { + infoWinPaint(1, Global.ETC[5], "", 9, 31, 22, 43, this.imgS_6, g); + } else if (this.aS2 == 6) { + g.setColor(0, 0, 0); + g.fillRect(29, 36, 62, 29); + g.setColor(182, 109, 0); + g.drawRect(30, 37, 59, 26); + g.drawRect(31, 38, 57, 24); + g.setColor(255, 182, 0); + g.drawRect(30, 37, 58, 25); + if (this.selectX == 0) { + this.chStep = 1; + this.selectY3 = 2; + } else if (this.selectX == 1) { + this.chStep = 0; + this.selectY3 = 2; + } else if (this.selectX == 2) { + this.chStep = 0; + this.selectY3 = 1; + } + if (this.myHP[this.chStep] > 0) { + imgCutPaint(25, 19, this.chStep, 34, 41, this.imgS_1, g); + } else { + imgCutPaint(25, 19, this.chStep, 34, 41, this.imgS_5, g); + } + if (this.myHP[this.selectY3] > 0) { + imgCutPaint(25, 19, this.selectY3, 61, 41, this.imgS_1, g); + } else { + imgCutPaint(25, 19, this.selectY3, 61, 41, this.imgS_5, g); + } + g.drawImage(this.img_knife, 28 + this.selectY2 * 29, 63, 20); + } else if (this.aS2 == 7) { + this.counter = (byte)(this.counter + 1); + if (this.counter == 0) { + if (this.selectY2 == 0) { + this.selectY2 = this.chStep; + } else { + this.selectY2 = this.selectY3; + } + g.drawImage(this.img_floor[26], 95, 28 + this.selectY2 * 30, 36); + this.myHP[this.selectY2] = Global.HPD[this.selectY2] + Global.HPG[this.selectY2] * (this.myLV[this.selectY2] - 1); + this.mySP[this.selectY2] = Global.SPD[this.selectY2] + Global.SPG[this.selectY2] * (this.myLV[this.selectY2] - 1); + } else if (this.counter == 1) { + g.drawImage(this.img_floor[27], 93, 33 + this.selectY2 * 30, 36); + } else if (this.counter == 2) { + g.drawImage(this.img_floor[26], 95, 28 + this.selectY2 * 30, 36); + this.aS = 5; + this.counter = 2; + this.tDamage = 0; + if (this.monHP[0] > 0) { + this.selectY2 = 0; + } else { + this.selectY2 = 1; + } + } + } + } else if (this.aS == 20) { + if (this.oneSoundS) { + this.imgS_2 = null; + this.imgS_3 = null; + this.imgS_4 = null; + this.imgS_5 = null; + this.myAttack = null; + soundPlay(11); + this.oneSoundS = false; + this.imgS_5 = Image.createImage("/gameOver.png"); + this.aS2 = 1; + } + g.drawImage(this.imgS_5, 17, 44, 20); + } else if (this.aS == 30) { + if (this.onePaintS) { + this.onePaintS = false; + this.imgS_2 = Image.createImage("/dT_1.png"); + this.imgS_3 = Image.createImage("/dT_2.png"); + this.imgS_4 = Image.createImage("/dT_3.png"); + this.counter = 0; + } + this.counter = (byte)(this.counter + 1); + if (this.counter < 3) { + g.drawImage(this.img_1[2], 14, 47, 36); + } else if (this.counter == 3) { + g.drawImage(this.img_1[2], 53, 38, 36); + g.drawImage(this.imgS_2, 64, 28, 36); + } else if (this.counter == 4) { + g.drawImage(this.img_1[2], 53, 38, 36); + g.drawImage(this.imgS_2, 64, 28, 36); + g.drawImage(this.imgS_3, 62, 35, 36); + } else if (this.counter == 5) { + g.drawImage(this.img_1[2], 53, 38, 36); + g.drawImage(this.imgS_2, 64, 28, 36); + g.drawImage(this.imgS_3, 62, 35, 36); + g.drawImage(this.imgS_4, 65, 27, 36); + } else if (this.counter == 6) { + g.drawImage(this.img_1[2], 51, 38, 36); + g.drawImage(this.imgS_3, 62, 35, 36); + g.drawImage(this.imgS_4, 67, 27, 36); + } else if (this.counter == 7) { + g.drawImage(this.img_1[2], 53, 38, 36); + g.drawImage(this.imgS_4, 69, 27, 36); + } else if (this.counter == 8) { + g.drawImage(this.img_1[2], 14, 47, 36); + g.drawImage(this.img_floor[6], 96, 34, 36); + } else if (this.counter == 9) { + g.drawImage(this.img_1[2], 14, 47, 36); + g.drawImage(this.img_floor[7], 94, 37, 36); + } else if (this.counter == 10) { + this.myHP[0] = 0; + g.drawImage(this.img_1[2], 14, 47, 36); + } else if (this.counter == 11) { + g.drawImage(this.img_1[2], 14, 47, 36); + } else if (this.counter == 12) { + g.drawImage(this.img_1[2], 14, 47, 36); + this.bool_preload = true; + this.state_main = 55; + this.imgS_2 = null; + this.imgS_3 = null; + this.imgS_4 = null; + this.img_1 = null; + this.img_floor = null; + this.img_char = null; + System.gc(); + } + } + } else if (this.state_main == 44) { + if (this.bool_preload) { + this.bool_preload = false; + this.img_1 = null; + this.img_floor = null; + this.img_char = null; + loadString("t2", 13); + this.img_1 = new Image[3]; + this.img_1[0] = Image.createImage("/bF_0.png"); + this.img_1[1] = Image.createImage("/bF_4.png"); + this.img_1[2] = Image.createImage("/win.png"); + this.aS = 0; + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 120, 120, 13); + this.bgG.drawImage(Image.createImage("/ez.png"), 54, 123, 20); + } + g.drawImage(this.bG, 0, 0, 20); + g.drawImage(this.img_1[2], 46, 84, 20); + boolean bool = false; + if (this.aS == 0 || this.aS == 6 || this.aS == 8) { + bool = false; + } else if (this.aS == 2 || this.aS == 4) { + bool = true; + } + if (this.aS < 9) { + // g.drawImage(this.img_1[bool], 0, 73, 20); + g.drawImage(this.img_1[1], 0, 73, 20); + g.drawString(this.str[this.aS], 48, 90, 20); + g.drawString(this.str[this.aS + 1], 48, 104, 20); + } else { + g.setColor(0, 0, 0); + g.fillRect(0, 0, 120, 120); + g.setColor(255, 255, 255); + g.drawString(this.str[10], 7, 45, 20); + g.drawString(this.str[11], 7, 60, 20); + g.drawString(this.str[12], 7, 75, 20); + if (this.aS == 12) { + this.bool_preload = true; + this.state_main = 41; + this.str = null; + } + } + } else if (this.state_main == 50) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.imgS_1 = Image.createImage("/b1.png"); + this.selectX = 0; + this.selectY = 0; + this.aS = 1; + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + numImgPaint(this.GP + "", 20, 20, g, this.img_whiteNum); + numImgPaint(Global.itemGP[this.selectX] + "", 45, 111, g, this.img_whiteNum); + g.setColor(255, 255, 255); + if (this.selectX < 5) { + for (byte b = 0; b < 5; b++) { + g.drawString(Global.itemName[b], 3, 44 + b * 13, 20); + if (this.myItem[b] / 10 != 0) + imgCutPaint(5, 7, this.myItem[b] / 10, 67, 47 + b * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, this.myItem[b] % 10, 73, 47 + b * 13, this.img_whiteNum, g); + } + } else { + for (byte b = 5; b < 9; b++) { + g.drawString(Global.itemName[b], 3, 44 + (b - 5) * 13, 20); + if (this.myItem[b] / 10 != 0) + imgCutPaint(5, 7, this.myItem[b] / 10, 67, 47 + (b - 5) * 13, this.img_whiteNum, g); + imgCutPaint(5, 7, this.myItem[b] % 10, 73, 47 + (b - 5) * 13, this.img_whiteNum, g); + } + } + if (this.aS == 1) { + if (this.selectX < 5) { + g.drawImage(this.img_knife, 3, 51 + this.selectX * 13, 20); + } else { + g.drawImage(this.img_knife, 3, 51 + (this.selectX - 5) * 13, 20); + } + } else if (this.aS == 2) { + g.setColor(219, 255, 170); + if (this.selectX < 5) { + g.drawRect(1, 43 + this.selectX * 13, 77, 13); + } else { + g.drawRect(1, 43 + (this.selectX - 5) * 13, 77, 13); + } + g.drawImage(this.img_knife, 64, 36 + this.selectY * 14, 20); + if (this.aS2 == 1) { + infoWinPaint(2, Global.itemName[this.selectX] + "구입", "구입가 : " + Global.itemGP[this.selectX], 9, 49, 20, 54, this.imgS_1, g); + if (this.onePaintS) { + this.GP -= Global.itemGP[this.selectX]; + this.myItem[this.selectX] = (byte)(this.myItem[this.selectX] + 1); + this.onePaintS = false; + soundPlay(4); + } + } else if (this.aS2 == 2) { + infoWinPaint(2, Global.itemName[this.selectX] + "판매", "판매가 : " + (Global.itemGP[this.selectX] / 2), 9, 49, 20, 54, this.imgS_1, g); + if (this.onePaintS) { + this.GP += Global.itemGP[this.selectX] / 2; + this.myItem[this.selectX] = (byte)(this.myItem[this.selectX] - 1); + this.onePaintS = false; + soundPlay(4); + } + } else if (this.aS2 == 3) { + infoWinPaint(1, Global.ETC[1], "", 9, 49, 34, 61, this.imgS_1, g); + if (this.oneSoundS) { + soundPlay(15); + this.oneSoundS = false; + } + } else if (this.aS2 == 4) { + infoWinPaint(1, Global.ETC[2], "", 9, 49, 34, 61, this.imgS_1, g); + if (this.oneSoundS) { + soundPlay(15); + this.oneSoundS = false; + } + } else if (this.aS2 == 5) { + infoWinPaint(1, Global.ETC[3], "", 9, 49, 30, 61, this.imgS_1, g); + if (this.oneSoundS) { + soundPlay(15); + this.oneSoundS = false; + } + } + } + } else if (this.state_main == 51) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.imgS_1 = Image.createImage("/b1.png"); + this.imgS_2 = Image.createImage("/i_0.png"); + this.imgS_3 = Image.createImage("/fa1.png"); + this.imgS_4 = Image.createImage("/f_0.png"); + this.imgS_5 = Image.createImage("/s_7.png"); + this.selectX = 0; + this.selectY = 0; + this.selectX2 = 1; + this.selectX3 = 0; + this.aS = 1; + this.aS2 = 0; + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + numImgPaint(this.GP + "", 20, 20, g, this.img_whiteNum); + if (this.selectY == 0) { + byte b = 0; + if (this.counter100 % 10 < 3) + b = 2; + imgCutPaint(7, 11, 0, 7 - b, 30, this.imgS_2, g); + imgCutPaint(7, 11, 1, 66 + b, 30, this.imgS_2, g); + g.setColor(255, 255, 255); + g.drawString(Global.chName[this.selectX], 17, 29, 20); + g.setColor(0, 0, 0); + g.fillRect(1, 44, 78, 63); + g.setColor(0, 36, 85); + g.fillRect(27, 45, 52, 9); + g.fillRect(27, 55, 52, 9); + g.fillRect(1, 65, 78, 9); + g.fillRect(1, 75, 78, 9); + g.fillRect(13, 85, 66, 10); + g.fillRect(1, 96, 78, 12); + g.setColor(255, 255, 255); + g.drawString(Global.weapon[this.selectX][this.myWP[this.selectX] - 1], 3, 96, 20); + imgCutPaint(25, 19, this.selectX, 1, 45, this.imgS_3, g); + imgCutPaint(9, 9, this.selectX, 2, 85, this.imgS_5, g); + imgCutPaint(13, 7, 1, 29, 46, this.imgS_4, g); + if (this.myLV[this.selectX] / 10 != 0) + imgCutPaint(5, 7, this.myLV[this.selectX] / 10, 45, 46, this.img_whiteNum, g); + imgCutPaint(5, 7, this.myLV[this.selectX] % 10, 50, 46, this.img_whiteNum, g); + imgCutPaint(13, 7, 2, 29, 56, this.imgS_4, g); + if ((Global.ATD[this.selectX] + Global.ATG[this.selectX] * (this.myLV[this.selectX] - 1)) / 10 != 0) + imgCutPaint(5, 7, (Global.ATD[this.selectX] + Global.ATG[this.selectX] * (this.myLV[this.selectX] - 1)) / 10, 45, 56, this.img_whiteNum, g); + imgCutPaint(5, 7, (Global.ATD[this.selectX] + Global.ATG[this.selectX] * (this.myLV[this.selectX] - 1)) % 10, 50, 56, this.img_whiteNum, g); + imgCutPaint(13, 7, 6, 3, 66, this.imgS_4, g); + numImgPaint(this.mySP[this.selectX] + "", 20, 66, g, this.img_whiteNum); + imgCutPaint(5, 7, 10, 35, 66, this.img_whiteNum, g); + numImgPaint((Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 42, 66, g, this.img_whiteNum); + imgCutPaint(13, 7, 5, 3, 76, this.imgS_4, g); + numImgPaint(this.myHP[this.selectX] + "", 20, 76, g, this.img_whiteNum); + imgCutPaint(5, 7, 10, 35, 76, this.img_whiteNum, g); + numImgPaint((Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 42, 76, g, this.img_whiteNum); + imgCutPaint(13, 7, 1, 15, 87, this.imgS_4, g); + imgCutPaint(13, 7, 2, 45, 87, this.imgS_4, g); + imgCutPaint(13, 7, 3, 59, 87, this.imgS_4, g); + if (this.myWP[this.selectX] / 10 != 0) + imgCutPaint(5, 7, this.myWP[this.selectX] / 10, 30, 87, this.img_whiteNum, g); + imgCutPaint(5, 7, this.myWP[this.selectX] % 10, 35, 87, this.img_whiteNum, g); + if (this.selectX == 0) { + this.selectX3 = (byte)(2 + (this.myWP[this.selectX] - 1) * 2); + } else if (this.selectX == 1) { + this.selectX3 = (byte)(3 + (this.myWP[this.selectX] - 1) * 2); + } else if (this.selectX == 2) { + this.selectX3 = (byte)(1 + (this.myWP[this.selectX] - 1) * 2); + } + if (this.selectX3 / 10 != 0) + imgCutPaint(5, 7, this.selectX3 / 10, 66, 87, this.img_whiteNum, g); + imgCutPaint(5, 7, this.selectX3 % 10, 71, 87, this.img_whiteNum, g); + g.drawImage(this.img_knife, 64, 36, 20); + } else if (this.selectY == 1 || this.selectY == 2) { + imgCutPaint(13, 7, 0, 27, 111, this.imgS_4, g); + g.setColor(255, 255, 255); + g.drawString(Global.ETC[15], 17, 30, 20); + for (byte b = 1; b < 6; b++) + g.drawString(Global.weapon[this.selectX][b], 3, 44 + (b - 1) * 13, 20); + } + if (this.aS == 2) { + g.drawImage(this.img_knife, 64, 36 + this.selectY * 14, 20); + } else if (this.aS == 3) { + g.drawImage(this.img_knife, 3, 51 + (this.selectX2 - 1) * 13, 20); + numImgPaint((this.selectX2 * 1000) + "", 45, 111, g, this.img_whiteNum); + if (this.aS2 == 1) { + infoWinPaint(2, Global.ETC[16], Global.ETC[17], 9, 49, 22, 54, this.imgS_1, g); + if (this.onePaintS) { + this.GP -= this.selectX2 * 1000; + this.myWP[this.selectX] = (byte)(this.selectX2 + 1); + soundPlay(4); + this.onePaintS = false; + } + } else if (this.aS2 == 2) { + infoWinPaint(1, Global.ETC[1], "", 9, 49, 34, 61, this.imgS_1, g); + if (this.oneSoundS) { + soundPlay(15); + this.oneSoundS = false; + } + } else if (this.aS2 == 3) { + infoWinPaint(1, Global.ETC[0], "", 9, 49, 34, 61, this.imgS_1, g); + if (this.oneSoundS) { + soundPlay(15); + this.oneSoundS = false; + } + } + } + } else if (this.state_main == 55) { + if (this.bool_preload) { + this.bool_preload = false; + loadString("t1", 5); + soundPlay(6); + } + g.setColor(0, 0, 0); + g.fillRect(0, 0, 120, 133); + g.setColor(255, 255, 255); + for (byte b = 0; b < 5; b++) + g.drawString(this.str[b], 9, 28 + b * 15, 20); + } else if (this.state_main == 60) { + if (this.bool_preload) { + bgPaint(this.state_main); + this.imgS_1 = Image.createImage("/fa1.png"); + this.imgS_2 = Image.createImage("/fa2.png"); + this.imgS_3 = Image.createImage("/s_7.png"); + this.imgS_4 = Image.createImage("/i_1.png"); + this.imgS_5 = Image.createImage("/b1.png"); + this.bool_preload = false; + } + g.drawImage(this.bG, 0, 0, 20); + g.setColor(255, 255, 255); + g.drawString(Global.chName[this.selectX], 37, 2, 20); + g.drawString(Global.weapon[this.selectX][this.myWP[this.selectX] - 1], 33, 37, 20); + if (this.myHP[this.selectX] > 0) { + imgCutPaint(25, 19, this.selectX, 1, 17, this.imgS_1, g); + } else { + imgCutPaint(25, 19, this.selectX, 1, 17, this.imgS_2, g); + } + imgCutPaint(9, 9, this.selectX, 29, 27, this.imgS_3, g); + numImgPaint(this.myLV[this.selectX] + "", 57, 18, g, this.img_whiteNum); + numImgPaint((Global.ATD[this.selectX] + Global.ATG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 92, 18, g, this.img_whiteNum); + numImgPaint(this.myWP[this.selectX] + "", 57, 28, g, this.img_whiteNum); + if (this.selectX == 0) { + this.selectX3 = (byte)(2 + (this.myWP[this.selectX] - 1) * 2); + } else if (this.selectX == 1) { + this.selectX3 = (byte)(3 + (this.myWP[this.selectX] - 1) * 2); + } else if (this.selectX == 2) { + this.selectX3 = (byte)(1 + (this.myWP[this.selectX] - 1) * 2); + } + numImgPaint(this.selectX3 + "", 98, 28, g, this.img_whiteNum); + numImgPaint(this.mySP[this.selectX] + "", 79, 52, g, this.img_whiteNum); + numImgPaint((Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 101, 52, g, this.img_whiteNum); + numImgPaint(this.myHP[this.selectX] + "", 19, 52, g, this.img_whiteNum); + numImgPaint((Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) + "", 41, 52, g, this.img_whiteNum); + if (this.selectX2 < 3) { + for (byte b = 0; b < 3; b++) { + g.drawString(Global.itemName[b], 19, 65 + b * 13, 20); + numImgPaint(this.myItem[b] + "", 97, 68 + b * 13, g, this.img_whiteNum); + } + } else if (this.selectX2 > 2 && this.selectX2 < 6) { + for (byte b = 3; b < 6; b++) { + g.drawString(Global.itemName[b], 19, 65 + (b - 3) * 13, 20); + numImgPaint(this.myItem[b] + "", 97, 68 + (b - 3) * 13, g, this.img_whiteNum); + } + } else { + for (byte b = 6; b < 9; b++) { + g.drawString(Global.itemName[b], 19, 65 + (b - 6) * 13, 20); + numImgPaint(this.myItem[b] + "", 97, 68 + (b - 6) * 13, g, this.img_whiteNum); + } + } + imgCutPaint(7, 12, 0, 3, 66 + this.selectX2 % 3 * 13, this.imgS_4, g); + if (this.aS2 == 1) { + this.aS2 = 2; + if (this.selectX2 == 0) { + this.myHP[this.selectX] = this.myHP[this.selectX] + (Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) / 2; + } else if (this.selectX2 == 1) { + this.myHP[this.selectX] = this.myHP[this.selectX] + Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectX2 == 2) { + this.mySP[this.selectX] = this.mySP[this.selectX] + (Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) / 2; + } else if (this.selectX2 == 3) { + this.mySP[this.selectX] = this.mySP[this.selectX] + Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectX2 == 4) { + this.myHP[this.selectX] = this.myHP[this.selectX] + Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + this.mySP[this.selectX] = this.mySP[this.selectX] + Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectX2 == 5) { + this.myPoison = false; + } else if (this.selectX2 == 6) { + this.myCurse = false; + } else if (this.selectX2 == 7) { + this.myHP[this.selectX] = this.myHP[this.selectX] + Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + this.mySP[this.selectX] = this.mySP[this.selectX] + Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + } else if (this.selectX2 == 8) { + this.aS2 = 5; + } + if (this.myHP[this.selectX] > Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1)) + this.myHP[this.selectX] = Global.HPD[this.selectX] + Global.HPG[this.selectX] * (this.myLV[this.selectX] - 1); + if (this.mySP[this.selectX] > Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1)) + this.mySP[this.selectX] = Global.SPD[this.selectX] + Global.SPG[this.selectX] * (this.myLV[this.selectX] - 1); + this.myItem[this.selectX2] = (byte)(this.myItem[this.selectX2] - 1); + } + if (this.aS2 == 2) { + infoWinPaint(1, Global.itemName[this.selectX2] + " 사용", "", 9, 42, 17, 53, this.imgS_5, g); + } else if (this.aS2 == 3) { + infoWinPaint(1, Global.ETC[3], "", 9, 42, 29, 53, this.imgS_5, g); + } else if (this.aS2 == 4) { + infoWinPaint(1, Global.ETC[4], "", 9, 42, 29, 53, this.imgS_5, g); + } else if (this.aS2 == 5) { + infoWinPaint(1, Global.ETC[5], "", 9, 31, 22, 43, this.imgS_5, g); + } + } + } catch (Exception exception) {} + } + + public void infoWinPaint(int paramInt1, String paramString1, String paramString2, int paramInt2, int paramInt3, int paramInt4, int paramInt5, Image paramImage, Graphics paramGraphics) { + paramGraphics.drawImage(paramImage, paramInt2, paramInt3, 20); + paramGraphics.setColor(255, 0, 0); + if (paramInt1 == 1) { + paramGraphics.drawString(paramString1, paramInt4, paramInt5, 20); + } else { + paramGraphics.drawString(paramString1, paramInt4, paramInt5, 20); + paramGraphics.drawString(paramString2, paramInt4, paramInt5 + 14, 20); + } + } + + public void monPointPaint(Graphics paramGraphics) { + if (this.counter < 7) + this.counter = 7; + for (byte b = 0; b < 2; b++) { + if (this.monMapXY[b][0] != -1) + paramGraphics.drawImage(this.img_1[this.counter], this.monMapXY[b][1] % 8 * 15, this.monMapXY[b][0] % 8 * 15, 20); + } + this.counter = (byte)(this.counter + 1); + if (this.counter == 10) + this.counter = 7; + } + + public void chPaint(Graphics paramGraphics) { + paramGraphics.setClip(0, 0, 120, 133); + if (this.chMove) { + int i = 0; + int j = 0; + if (this.chSee == 0) { + j = -10 / this.counter100; + } else if (this.chSee == 1) { + j = 10 / this.counter100; + } else if (this.chSee == 2) { + i = 10 / this.counter100; + } else if (this.chSee == 3) { + i = -10 / this.counter100; + } + paramGraphics.drawImage(this.img_char[this.chSee * 3 + this.counter100], this.cuDBX % 8 * 15 + i, this.cuDBY % 8 * 15 - 6 + j, 20); + if (this.myCurse) + paramGraphics.drawImage(this.img_1[5], this.cuDBX % 8 * 15 + i, this.cuDBY % 8 * 15 - 18 + j, 20); + if (this.myPoison) + paramGraphics.drawImage(this.img_1[4], this.cuDBX % 8 * 15 + i, this.cuDBY % 8 * 15 - 18 + j, 20); + if (this.counter100 >= 2) { + this.chMove = false; + if (this.mapAB[this.cuDBY][this.cuDBX] == 1) { + this.aS = 35; + this.onePaintS = true; + this.counter100 = 0; + } else if (this.mapAB[this.cuDBY][this.cuDBX] == 2) { + this.state_main = 50; + this.bool_preload = true; + } else if (this.mapAB[this.cuDBY][this.cuDBX] == 3) { + this.state_main = 51; + this.bool_preload = true; + } else if (this.mapAB[this.cuDBY][this.cuDBX] == 4) { + this.dLoadType = (byte)(11 + this.cuFloor); + this.upDown = true; + } else if (this.mapAB[this.cuDBY][this.cuDBX] == 5) { + this.dLoadType = (byte)(9 + this.cuFloor); + this.upDown = false; + } else if (this.mapAB[this.cuDBY][this.cuDBX] == 6) { + this.mapAB[this.cuDBY][this.cuDBX] = 7; + this.movePage = true; + this.aS = 30; + this.counter100 = 1; + this.onePaintS = true; + } else if (this.mapAB[this.cuDBY][this.cuDBX] == 8 || this.mapAB[this.cuDBY][this.cuDBX] == 9) { + if (this.mapAB[this.cuDBY][this.cuDBX] == 9 && this.cuFloor == 6) { + this.bool_preload = true; + this.state_main = 44; + this.counter100 = 0; + } else { + this.bool_preload = true; + this.state_main = 41; + } + soundPlay(10); + } + } + } else { + paramGraphics.drawImage(this.img_char[this.chSee * 3], this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 - 6, 20); + if (this.myCurse) + paramGraphics.drawImage(this.img_1[5], this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 - 18, 20); + if (this.myPoison) + paramGraphics.drawImage(this.img_1[4], this.cuDBX % 8 * 15, this.cuDBY % 8 * 15 - 18, 20); + } + } + + public void numImgPaint(String paramString, int paramInt1, int paramInt2, Graphics paramGraphics, Image paramImage) { + for (byte b = 0; b < paramString.length(); b++) + imgCutPaint(5, 7, Integer.parseInt(paramString.substring(b, b + 1)), paramInt1 + 6 * b, paramInt2, paramImage, paramGraphics); + } + + public void createD(int paramInt) { + this.mapAB = new byte[40][40]; + if (paramInt == 0) { + this.mapAB[3][4] = 1; + this.mapAB[3][3] = 1; + this.mapAB[10][2] = 2; + this.mapAB[10][1] = 2; + this.mapAB[10][6] = 3; + this.mapAB[10][5] = 3; + } else if (paramInt == 1) { + this.mapAB[1][35] = 4; + this.mapAB[1][34] = 4; + this.mapAB[36][36] = 6; + this.mapAB[36][12] = 6; + this.mapAB[28][3] = 6; + this.mapAB[27][36] = 6; + this.mapAB[21][37] = 6; + this.mapAB[12][36] = 6; + this.mapAB[12][20] = 6; + this.mapAB[3][27] = 6; + this.mapAB[3][20] = 6; + this.mapAB[3][3] = 6; + this.mapAB[1][27] = 8; + this.mapAB[1][33] = 8; + this.mapAB[3][1] = 8; + this.mapAB[3][38] = 8; + this.mapAB[4][10] = 8; + this.mapAB[4][17] = 8; + this.mapAB[9][6] = 8; + this.mapAB[9][13] = 8; + this.mapAB[11][37] = 8; + this.mapAB[12][3] = 8; + this.mapAB[12][22] = 8; + this.mapAB[12][25] = 8; + this.mapAB[13][26] = 8; + this.mapAB[17][37] = 8; + this.mapAB[18][1] = 8; + this.mapAB[18][14] = 8; + this.mapAB[18][30] = 8; + this.mapAB[22][6] = 8; + this.mapAB[22][21] = 8; + this.mapAB[25][26] = 8; + this.mapAB[25][36] = 8; + this.mapAB[28][1] = 8; + this.mapAB[30][12] = 8; + this.mapAB[33][18] = 8; + this.mapAB[34][34] = 8; + this.mapAB[38][10] = 8; + this.mapAB[38][26] = 8; + this.mapAB[1][3] = 8; + } else if (paramInt == 2) { + this.mapAB[12][19] = 4; + this.mapAB[12][18] = 4; + this.mapAB[24][20] = 5; + this.mapAB[24][19] = 5; + this.mapAB[2][37] = 6; + this.mapAB[10][17] = 6; + this.mapAB[13][2] = 6; + this.mapAB[13][13] = 6; + this.mapAB[13][26] = 6; + this.mapAB[13][37] = 6; + this.mapAB[14][17] = 6; + this.mapAB[18][10] = 6; + this.mapAB[18][26] = 6; + this.mapAB[21][26] = 6; + this.mapAB[21][37] = 6; + this.mapAB[26][18] = 6; + this.mapAB[26][37] = 6; + this.mapAB[30][30] = 6; + this.mapAB[30][33] = 6; + this.mapAB[33][30] = 6; + this.mapAB[33][33] = 6; + this.mapAB[37][2] = 6; + this.mapAB[37][37] = 6; + this.mapAB[2][2] = 6; + this.mapAB[1][36] = 8; + this.mapAB[3][1] = 8; + this.mapAB[3][27] = 8; + this.mapAB[4][30] = 8; + this.mapAB[4][33] = 8; + this.mapAB[5][5] = 8; + this.mapAB[5][10] = 8; + this.mapAB[9][10] = 8; + this.mapAB[11][38] = 8; + this.mapAB[12][30] = 8; + this.mapAB[12][33] = 8; + this.mapAB[14][1] = 8; + this.mapAB[14][25] = 8; + this.mapAB[19][14] = 8; + this.mapAB[19][22] = 8; + this.mapAB[19][25] = 8; + this.mapAB[20][14] = 8; + this.mapAB[20][22] = 8; + this.mapAB[20][25] = 8; + this.mapAB[20][38] = 8; + this.mapAB[21][1] = 8; + this.mapAB[21][3] = 8; + this.mapAB[25][12] = 8; + this.mapAB[25][29] = 8; + this.mapAB[26][1] = 8; + this.mapAB[29][6] = 8; + this.mapAB[29][10] = 8; + this.mapAB[30][38] = 8; + this.mapAB[33][29] = 8; + this.mapAB[33][38] = 8; + this.mapAB[35][5] = 8; + this.mapAB[37][10] = 8; + this.mapAB[37][17] = 8; + this.mapAB[37][22] = 8; + this.mapAB[37][25] = 8; + this.mapAB[37][36] = 8; + this.mapAB[38][1] = 8; + this.mapAB[38][11] = 8; + this.mapAB[1][13] = 8; + this.mapAB[3][19] = 9; + } else if (paramInt == 3) { + this.mapAB[12][14] = 4; + this.mapAB[12][13] = 4; + this.mapAB[36][38] = 5; + this.mapAB[36][37] = 5; + this.mapAB[2][37] = 6; + this.mapAB[10][14] = 6; + this.mapAB[10][18] = 6; + this.mapAB[13][29] = 6; + this.mapAB[14][14] = 6; + this.mapAB[18][13] = 6; + this.mapAB[18][26] = 6; + this.mapAB[26][18] = 6; + this.mapAB[26][21] = 6; + this.mapAB[29][2] = 6; + this.mapAB[29][37] = 6; + this.mapAB[34][2] = 6; + this.mapAB[34][5] = 6; + this.mapAB[34][34] = 6; + this.mapAB[34][37] = 6; + this.mapAB[2][10] = 6; + this.mapAB[1][20] = 8; + this.mapAB[1][25] = 8; + this.mapAB[3][20] = 8; + this.mapAB[3][33] = 8; + this.mapAB[4][33] = 8; + this.mapAB[6][9] = 8; + this.mapAB[6][30] = 8; + this.mapAB[9][25] = 8; + this.mapAB[9][35] = 8; + this.mapAB[10][4] = 8; + this.mapAB[10][36] = 8; + this.mapAB[11][9] = 8; + this.mapAB[12][6] = 8; + this.mapAB[12][11] = 8; + this.mapAB[12][21] = 8; + this.mapAB[13][22] = 8; + this.mapAB[14][30] = 8; + this.mapAB[17][14] = 8; + this.mapAB[17][17] = 8; + this.mapAB[17][25] = 8; + this.mapAB[19][34] = 8; + this.mapAB[20][27] = 8; + this.mapAB[21][3] = 8; + this.mapAB[22][38] = 8; + this.mapAB[25][22] = 8; + this.mapAB[26][28] = 8; + this.mapAB[27][3] = 8; + this.mapAB[27][10] = 8; + this.mapAB[27][35] = 8; + this.mapAB[30][17] = 8; + this.mapAB[30][25] = 8; + this.mapAB[30][38] = 8; + this.mapAB[33][1] = 8; + this.mapAB[33][29] = 8; + this.mapAB[35][11] = 8; + this.mapAB[35][21] = 8; + this.mapAB[35][33] = 8; + this.mapAB[36][12] = 8; + this.mapAB[36][21] = 8; + this.mapAB[37][6] = 8; + this.mapAB[38][25] = 8; + this.mapAB[1][14] = 8; + this.mapAB[3][3] = 9; + } else if (paramInt == 4) { + this.mapAB[8][20] = 4; + this.mapAB[8][19] = 4; + this.mapAB[0][28] = 5; + this.mapAB[0][27] = 5; + this.mapAB[2][37] = 6; + this.mapAB[10][29] = 6; + this.mapAB[13][13] = 6; + this.mapAB[14][33] = 6; + this.mapAB[18][6] = 6; + this.mapAB[18][18] = 6; + this.mapAB[18][21] = 6; + this.mapAB[21][29] = 6; + this.mapAB[22][6] = 6; + this.mapAB[22][33] = 6; + this.mapAB[26][13] = 6; + this.mapAB[26][29] = 6; + this.mapAB[30][33] = 6; + this.mapAB[34][34] = 6; + this.mapAB[34][37] = 6; + this.mapAB[36][19] = 6; + this.mapAB[37][2] = 6; + this.mapAB[2][2] = 6; + this.mapAB[1][14] = 8; + this.mapAB[2][25] = 8; + this.mapAB[3][17] = 8; + this.mapAB[3][33] = 8; + this.mapAB[4][22] = 8; + this.mapAB[4][29] = 8; + this.mapAB[4][33] = 8; + this.mapAB[6][3] = 8; + this.mapAB[6][9] = 8; + this.mapAB[10][35] = 8; + this.mapAB[11][9] = 8; + this.mapAB[11][26] = 8; + this.mapAB[12][2] = 8; + this.mapAB[12][6] = 8; + this.mapAB[12][26] = 8; + this.mapAB[14][34] = 8; + this.mapAB[17][25] = 8; + this.mapAB[18][2] = 8; + this.mapAB[18][19] = 8; + this.mapAB[18][20] = 8; + this.mapAB[20][34] = 8; + this.mapAB[21][6] = 8; + this.mapAB[21][34] = 8; + this.mapAB[22][30] = 8; + this.mapAB[25][1] = 8; + this.mapAB[25][9] = 8; + this.mapAB[25][11] = 8; + this.mapAB[25][33] = 8; + this.mapAB[26][22] = 8; + this.mapAB[26][30] = 8; + this.mapAB[28][19] = 8; + this.mapAB[29][1] = 8; + this.mapAB[29][36] = 8; + this.mapAB[30][25] = 8; + this.mapAB[33][10] = 8; + this.mapAB[33][25] = 8; + this.mapAB[34][6] = 8; + this.mapAB[35][20] = 8; + this.mapAB[36][20] = 8; + this.mapAB[38][1] = 8; + this.mapAB[38][9] = 8; + this.mapAB[38][30] = 8; + this.mapAB[38][35] = 8; + this.mapAB[38][36] = 8; + this.mapAB[1][6] = 8; + this.mapAB[19][11] = 9; + } else if (paramInt == 5) { + this.mapAB[16][10] = 4; + this.mapAB[16][9] = 4; + this.mapAB[20][38] = 5; + this.mapAB[20][37] = 5; + this.mapAB[2][26] = 6; + this.mapAB[2][37] = 6; + this.mapAB[5][37] = 6; + this.mapAB[6][10] = 6; + this.mapAB[10][2] = 6; + this.mapAB[10][13] = 6; + this.mapAB[10][29] = 6; + this.mapAB[13][13] = 6; + this.mapAB[13][18] = 6; + this.mapAB[13][21] = 6; + this.mapAB[13][26] = 6; + this.mapAB[14][33] = 6; + this.mapAB[18][13] = 6; + this.mapAB[19][12] = 6; + this.mapAB[20][11] = 6; + this.mapAB[21][10] = 6; + this.mapAB[22][6] = 6; + this.mapAB[22][33] = 6; + this.mapAB[26][10] = 6; + this.mapAB[26][12] = 6; + this.mapAB[28][10] = 6; + this.mapAB[30][14] = 6; + this.mapAB[30][17] = 6; + this.mapAB[30][33] = 6; + this.mapAB[33][14] = 6; + this.mapAB[33][17] = 6; + this.mapAB[35][21] = 6; + this.mapAB[37][2] = 6; + this.mapAB[37][19] = 6; + this.mapAB[37][21] = 6; + this.mapAB[37][26] = 6; + this.mapAB[37][37] = 6; + this.mapAB[2][21] = 6; + this.mapAB[1][38] = 8; + this.mapAB[3][12] = 8; + this.mapAB[3][17] = 8; + this.mapAB[3][30] = 8; + this.mapAB[4][17] = 8; + this.mapAB[4][30] = 8; + this.mapAB[6][33] = 8; + this.mapAB[9][30] = 8; + this.mapAB[9][35] = 8; + this.mapAB[11][9] = 8; + this.mapAB[12][14] = 8; + this.mapAB[12][19] = 8; + this.mapAB[12][21] = 8; + this.mapAB[13][35] = 8; + this.mapAB[14][1] = 8; + this.mapAB[14][6] = 8; + this.mapAB[14][25] = 8; + this.mapAB[17][27] = 8; + this.mapAB[18][28] = 8; + this.mapAB[19][14] = 8; + this.mapAB[19][17] = 8; + this.mapAB[20][14] = 8; + this.mapAB[20][17] = 8; + this.mapAB[21][3] = 8; + this.mapAB[22][3] = 8; + this.mapAB[25][5] = 8; + this.mapAB[25][19] = 8; + this.mapAB[25][20] = 8; + this.mapAB[25][33] = 8; + this.mapAB[26][4] = 8; + this.mapAB[27][35] = 8; + this.mapAB[28][12] = 8; + this.mapAB[29][27] = 8; + this.mapAB[30][26] = 8; + this.mapAB[33][6] = 8; + this.mapAB[33][13] = 8; + this.mapAB[33][25] = 8; + this.mapAB[33][33] = 8; + this.mapAB[36][20] = 8; + this.mapAB[38][1] = 8; + this.mapAB[38][9] = 8; + this.mapAB[38][22] = 8; + this.mapAB[38][30] = 8; + this.mapAB[38][38] = 8; + this.mapAB[1][12] = 8; + this.mapAB[3][3] = 9; + } else if (paramInt == 6) { + this.mapAB[36][38] = 5; + this.mapAB[36][37] = 5; + this.mapAB[2][13] = 6; + this.mapAB[2][18] = 6; + this.mapAB[2][21] = 6; + this.mapAB[2][26] = 6; + this.mapAB[2][37] = 6; + this.mapAB[5][10] = 6; + this.mapAB[5][18] = 6; + this.mapAB[5][21] = 6; + this.mapAB[6][30] = 6; + this.mapAB[6][33] = 6; + this.mapAB[9][30] = 6; + this.mapAB[9][33] = 6; + this.mapAB[10][2] = 6; + this.mapAB[10][18] = 6; + this.mapAB[11][11] = 6; + this.mapAB[12][11] = 6; + this.mapAB[13][18] = 6; + this.mapAB[13][37] = 6; + this.mapAB[18][13] = 6; + this.mapAB[18][18] = 6; + this.mapAB[18][37] = 6; + this.mapAB[19][12] = 6; + this.mapAB[20][11] = 6; + this.mapAB[21][10] = 6; + this.mapAB[21][21] = 6; + this.mapAB[21][22] = 6; + this.mapAB[21][25] = 6; + this.mapAB[21][26] = 6; + this.mapAB[22][21] = 6; + this.mapAB[22][22] = 6; + this.mapAB[22][25] = 6; + this.mapAB[22][26] = 6; + this.mapAB[25][21] = 6; + this.mapAB[25][22] = 6; + this.mapAB[25][25] = 6; + this.mapAB[25][26] = 6; + this.mapAB[26][6] = 6; + this.mapAB[26][10] = 6; + this.mapAB[26][21] = 6; + this.mapAB[26][22] = 6; + this.mapAB[26][25] = 6; + this.mapAB[26][26] = 6; + this.mapAB[30][33] = 6; + this.mapAB[34][18] = 6; + this.mapAB[34][20] = 6; + this.mapAB[34][38] = 6; + this.mapAB[35][19] = 6; + this.mapAB[36][18] = 6; + this.mapAB[36][20] = 6; + this.mapAB[37][2] = 6; + this.mapAB[37][13] = 6; + this.mapAB[37][19] = 6; + this.mapAB[37][29] = 6; + this.mapAB[2][10] = 6; + this.mapAB[1][38] = 8; + this.mapAB[3][10] = 8; + this.mapAB[3][20] = 8; + this.mapAB[3][28] = 8; + this.mapAB[4][10] = 8; + this.mapAB[4][20] = 8; + this.mapAB[4][35] = 8; + this.mapAB[9][12] = 8; + this.mapAB[11][1] = 8; + this.mapAB[11][20] = 8; + this.mapAB[11][25] = 8; + this.mapAB[11][35] = 8; + this.mapAB[12][20] = 8; + this.mapAB[12][25] = 8; + this.mapAB[13][10] = 8; + this.mapAB[14][6] = 8; + this.mapAB[14][38] = 8; + this.mapAB[17][1] = 8; + this.mapAB[17][10] = 8; + this.mapAB[17][29] = 8; + this.mapAB[18][19] = 8; + this.mapAB[18][38] = 8; + this.mapAB[19][17] = 8; + this.mapAB[19][8] = 8; + this.mapAB[21][2] = 8; + this.mapAB[22][13] = 8; + this.mapAB[22][33] = 8; + this.mapAB[25][1] = 8; + this.mapAB[27][10] = 8; + this.mapAB[27][21] = 8; + this.mapAB[27][22] = 8; + this.mapAB[27][25] = 8; + this.mapAB[27][26] = 8; + this.mapAB[29][2] = 8; + this.mapAB[29][34] = 8; + this.mapAB[30][14] = 8; + this.mapAB[33][6] = 8; + this.mapAB[33][30] = 8; + this.mapAB[35][14] = 8; + this.mapAB[37][20] = 8; + this.mapAB[38][1] = 8; + this.mapAB[38][10] = 8; + this.mapAB[38][25] = 8; + this.mapAB[1][25] = 8; + this.mapAB[3][3] = 9; + } + } + + public void gatePosition() { + this.chSee = 0; + if (this.dLoadType == 10) { + if (this.upDown) { + this.cuDBX = 3; + this.cuDBY = 12; + this.cuDBP = 5; + } else { + this.cuDBX = 3; + this.cuDBY = 4; + this.cuDBP = 0; + } + } else if (this.dLoadType == 11) { + if (this.upDown) { + this.cuDBX = 2; + this.cuDBY = 36; + this.cuDBP = 20; + this.chSee = 3; + } else { + this.cuDBX = 34; + this.cuDBY = 2; + this.cuDBP = 4; + } + } else if (this.dLoadType == 12) { + if (this.upDown) { + this.cuDBX = 19; + this.cuDBY = 25; + this.cuDBP = 17; + } else { + this.cuDBX = 18; + this.cuDBY = 13; + this.cuDBP = 7; + } + } else if (this.dLoadType == 13) { + if (this.upDown) { + this.cuDBX = 37; + this.cuDBY = 37; + this.cuDBP = 24; + } else { + this.cuDBX = 13; + this.cuDBY = 13; + this.cuDBP = 6; + } + } else if (this.dLoadType == 14) { + if (this.upDown) { + this.cuDBX = 27; + this.cuDBY = 1; + this.cuDBP = 3; + } else { + this.cuDBX = 19; + this.cuDBY = 9; + this.cuDBP = 7; + } + } else if (this.dLoadType == 15) { + if (this.upDown) { + this.cuDBX = 37; + this.cuDBY = 21; + this.cuDBP = 14; + } else { + this.cuDBX = 9; + this.cuDBY = 17; + this.cuDBP = 11; + } + } else if (this.dLoadType == 16 && this.upDown) { + this.cuDBX = 37; + this.cuDBY = 37; + this.cuDBP = 24; + } + } + + public void loadMap(String paramString) { + DataInputStream dataInputStream = null; + if (this.mapB == null) + this.mapB = new byte[40][40]; + try { + dataInputStream = new DataInputStream(getClass().getResourceAsStream(paramString)); + for (byte b = 0; b < 40; b++) + dataInputStream.read(this.mapB[b]); + dataInputStream.close(); + dataInputStream = null; + } catch (Exception exception) { + if (dataInputStream != null) + try { + dataInputStream.close(); + dataInputStream = null; + } catch (Exception exception1) {} + } + } + + public void loadImage(int paramInt1, String paramString, int paramInt2) { + DataInputStream dataInputStream = null; + try { + dataInputStream = new DataInputStream(getClass().getResourceAsStream(paramString)); + if (paramInt1 == 10) { + this.img_1 = new Image[paramInt2]; + for (byte b = 0; b < paramInt2; b++) { + int i = dataInputStream.readInt(); + byte[] arrayOfByte = new byte[i]; + dataInputStream.read(arrayOfByte); + this.img_1[b] = Image.createImage(arrayOfByte, 0, i); + arrayOfByte = null; + } + } else if (paramInt1 == 41) { + this.img_floor = new Image[paramInt2]; + for (byte b = 0; b < paramInt2; b++) { + int i = dataInputStream.readInt(); + byte[] arrayOfByte = new byte[i]; + dataInputStream.read(arrayOfByte); + this.img_floor[b] = Image.createImage(arrayOfByte, 0, i); + arrayOfByte = null; + } + } else if (paramInt1 == 42) { + this.img_char = new Image[paramInt2]; + for (byte b = 0; b < paramInt2; b++) { + int i = dataInputStream.readInt(); + byte[] arrayOfByte = new byte[i]; + dataInputStream.read(arrayOfByte); + this.img_char[b] = Image.createImage(arrayOfByte, 0, i); + arrayOfByte = null; + } + } else if (paramInt1 == 44) { + this.img_1 = new Image[paramInt2]; + byte b1 = 0; + for (byte b2 = 0; b2 < 30; b2++) { + int i = dataInputStream.readInt(); + byte[] arrayOfByte = new byte[i]; + dataInputStream.read(arrayOfByte); + if (b2 == this.selectX) { + this.img_1[b1] = Image.createImage(arrayOfByte, 0, i); + b1++; + if (this.selectX < this.selectY) + this.selectX = (byte)(this.selectX + 1); + } + arrayOfByte = null; + } + } + dataInputStream.close(); + dataInputStream = null; + } catch (Exception exception) { + if (dataInputStream != null) + try { + dataInputStream.close(); + dataInputStream = null; + } catch (Exception exception1) {} + } + } + + public void bgPaint(int paramInt) { + try { + if (paramInt == 10) { + this.bgG.setColor(146, 36, 0); + this.bgG.fillRect(0, 0, 120, 133); + this.bgG.drawImage(Image.createImage("/t_0.png"), 10, 4, 20); + this.bgG.drawImage(Image.createImage("/t_2.png"), 2, 84, 20); + this.bgG.drawImage(Image.createImage("/t_3.png"), 1, 125, 20); + this.bgG.drawImage(Image.createImage("/t_4.png"), 1, 1, 20); + } else if (paramInt == 11) { + this.bgG.setColor(255, 109, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/m_2.png"); + for (byte b = 0; b < 7; b++) + this.bgG.drawImage(image, 0, 1 + b * 20, 20); + this.bgG.drawImage(Image.createImage("/c_0.png"), 48, 50, 20); + } else if (paramInt == 20) { + this.bgG.setColor(255, 109, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/m_2.png"); + for (byte b = 0; b < 7; b++) + this.bgG.drawImage(image, 0, 1 + b * 20, 20); + image = Image.createImage("/bF_0.png"); + this.bgG.drawImage(image, 1, 1, 20); + image = Image.createImage("/bF_1.png"); + this.bgG.drawImage(image, 73, 1, 20); + image = Image.createImage("/bF_4.png"); + this.bgG.drawImage(image, 1, 85, 20); + image = Image.createImage("/bF_2.png"); + this.bgG.drawImage(image, 73, 85, 20); + // this.gx = (GraphicsX)this.bgG; + // this.gx.setAlpha(130); + // this.gx.setColor(146, 0, 0); + // this.gx.fillRect(26, 41, 68, 58); + // this.gx.setAlpha(GraphicsX.DEFAULT_ALPHA); + // this.gx = null; + } else if (paramInt == 21) { + this.bgG.setColor(255, 109, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/m_2.png"); + for (byte b = 0; b < 7; b++) + this.bgG.drawImage(image, 0, 1 + b * 20, 20); + this.bgG.setColor(109, 0, 0); + this.bgG.fillRect(1, 1, 118, 15); + this.bgG.drawImage(Image.createImage("/out.png"), 90, 2, 20); + this.bgG.drawImage(this.img_1[2], 3, 2, 20); + this.bgG.setColor(109, 0, 0); + this.bgG.fillRect(1, 17, 118, 15); + imgCutPaint(7, 11, 0, 1, 19, this.imgS_1, this.bgG); + imgCutPaint(7, 11, 1, 112, 19, this.imgS_1, this.bgG); + this.bgG.setColor(0, 0, 0); + this.bgG.drawString(this.str[0], 13, 18, 20); + this.bgG.drawString(this.str[1], 25, 18, 20); + this.bgG.drawString(this.str[2], 49, 18, 20); + this.bgG.drawString(this.str[3], 85, 18, 20); + } else if (paramInt == 22) { + this.bgG.setColor(255, 109, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/m_2.png"); + for (byte b = 0; b < 7; b++) + this.bgG.drawImage(image, 0, 1 + b * 20, 20); + this.bgG.setColor(109, 0, 0); + this.bgG.fillRect(1, 1, 118, 16); + this.bgG.drawImage(Image.createImage("/out.png"), 90, 2, 20); + this.bgG.drawImage(this.img_1[4], 3, 2, 20); + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(20, 25, 80, 97); + this.bgG.drawImage(Image.createImage("/s_1.png"), 21, 26, 20); + this.bgG.setColor(0, 36, 85); + this.bgG.fillRect(21, 42, 78, 64); + this.bgG.setColor(255, 182, 0); + this.bgG.drawLine(21, 107, 98, 107); + this.bgG.setColor(146, 73, 0); + this.bgG.drawLine(21, 120, 98, 120); + this.bgG.setColor(182, 109, 0); + this.bgG.fillRect(21, 108, 78, 12); + } else if (paramInt == 23) { + this.bgG.setColor(255, 109, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/m_2.png"); + for (byte b = 0; b < 7; b++) + this.bgG.drawImage(image, 0, 1 + b * 20, 20); + this.bgG.setColor(109, 0, 0); + this.bgG.fillRect(1, 1, 118, 16); + this.bgG.fillRect(1, 49, 118, 17); + this.bgG.fillRect(1, 83, 118, 17); + this.bgG.drawImage(Image.createImage("/out.png"), 48, 117, 20); + this.bgG.setColor(255, 255, 255); + this.bgG.drawImage(this.img_1[3], 3, 2, 20); + this.bgG.drawString("사운드:", 13, 51, 20); + this.bgG.drawString("진 동:", 13, 85, 20); + this.bgG.fillRect(62, 60, 4, 4); + this.bgG.fillRect(70, 57, 4, 7); + this.bgG.fillRect(78, 54, 4, 10); + this.bgG.fillRect(86, 51, 4, 13); + } else if (paramInt == 24) { + this.bgG.setColor(255, 109, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/m_2.png"); + for (byte b = 0; b < 7; b++) + this.bgG.drawImage(image, 0, 1 + b * 20, 20); + this.bgG.setColor(109, 0, 0); + this.bgG.fillRect(1, 1, 118, 16); + this.bgG.drawImage(this.img_1[5], 3, 2, 20); + this.bgG.drawImage(Image.createImage("/out.png"), 48, 117, 20); + this.bgG.drawImage(Image.createImage("/c_1.png"), 5, 31, 20); + this.bgG.drawImage(Image.createImage("/ask.png"), 5, 44, 20); + } else if (paramInt == 31) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + this.bgG.setColor(0, 36, 85); + this.bgG.fillRect(27, 1, 53, 19); + this.bgG.fillRect(27, 68, 53, 19); + this.bgG.fillRect(0, 21, 120, 44); + this.bgG.fillRect(0, 88, 120, 44); + imgCutPaint(25, 19, 0, 1, 68, this.imgS_1, this.bgG); + this.bgG.setColor(255, 255, 255); + this.bgG.drawString(Global.chName[0], 30, 71, 20); + } else if (paramInt == 41) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + int i = 0; + int j = 0; + if (this.cuDBP == 0) { + i = 0; + j = 0; + } else { + i = this.cuDBP % 5 * 8; + j = this.cuDBP / 5 * 8; + } + for (int k = j; k < 8 + j; k++) { + for (int m = i; m < 8 + i; m++) { + if (this.mapB[k][m] >= 0) + this.bgG.drawImage(this.img_floor[this.mapB[k][m]], (m - i) * 15, (k - j) * 15, 20); + } + } + if (this.cuFloor == 0) { + if (this.cuDBP == 0) { + this.bgG.drawImage(this.img_1[0], 31, 31, 20); + } else if (this.cuDBP == 5) { + imgCutPaint(30, 30, 0, 15, 15, this.img_1[1], this.bgG); + imgCutPaint(30, 30, 1, 75, 15, this.img_1[1], this.bgG); + } + } else { + for (int m = j; m < 8 + j; m++) { + for (int n = i; n < 8 + i; n++) { + if (this.mapAB[m][n] == 6) { + this.bgG.drawImage(this.img_1[0], (n - i) * 15, (m - j) * 15 + 3, 20); + } else if (this.mapAB[m][n] == 7) { + this.bgG.drawImage(this.img_1[1], (n - i) * 15, (m - j) * 15, 20); + } else if (this.mapAB[m][n] == 8 || this.mapAB[m][n] == 9) { + if (this.monMapXY[0][0] == -1) { + this.monMapXY[0][0] = (byte)m; + this.monMapXY[0][1] = (byte)n; + } else { + this.monMapXY[1][0] = (byte)m; + this.monMapXY[1][1] = (byte)n; + } + } + } + } + } + Image image = Image.createImage("/f_2.png"); + imgCutPaint(33, 9, 0, 4, 122, image, this.bgG); + imgCutPaint(33, 9, 1, 84, 122, image, this.bgG); + } else if (paramInt == 45) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + this.bgG.drawImage(Image.createImage("/monWin.png"), 14, 32, 20); + } else if (paramInt == 46) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + this.bgG.setColor(0, 36, 82); + this.bgG.fillRect(56, 101, 50, 9); + this.bgG.fillRect(56, 111, 50, 9); + this.bgG.setColor(0, 72, 172); + this.bgG.fillRect(6, 1, 30, 3); + this.bgG.fillRect(6, 5, 30, 3); + Image image = Image.createImage("/f_0.png"); + imgCutPaint(13, 7, 9, 41, 1, image, this.bgG); + imgCutPaint(13, 7, 7, 72, 1, image, this.bgG); + numImgPaint(this.monLevel + "", 57, 1, this.bgG, this.img_redNum); + numImgPaint(this.monHP[0] + "", 87, 1, this.bgG, this.img_redNum); + imgCutPaint(13, 7, 5, 38, 102, image, this.bgG); + imgCutPaint(13, 7, 6, 38, 112, image, this.bgG); + image = Image.createImage("/i_0.png"); + imgCutPaint(7, 11, 0, 0, 106, image, this.bgG); + imgCutPaint(7, 11, 1, 113, 106, image, this.bgG); + if (this.cuFloor == 1) { + image = Image.createImage("/fL0.png"); + } else if (this.cuFloor == 2 || this.cuFloor == 4 || this.cuFloor == 6) { + image = Image.createImage("/fL1.png"); + } else if (this.cuFloor == 3 || this.cuFloor == 5) { + image = Image.createImage("/fL2.png"); + } + for (byte b = 0; b < 6; b++) { + imgCutPaint(15, 15, 0, 0, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 1, 15, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 1, 30, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 1, 45, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 1, 60, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 1, 75, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 1, 90, 9 + b * 15, image, this.bgG); + imgCutPaint(15, 15, 2, 105, 9 + b * 15, image, this.bgG); + } + this.bgG.drawImage(Image.createImage("/ez.png"), 54, 123, 20); + this.bgG.drawImage(Image.createImage("/cancel.png"), 81, 121, 20); + } else if (paramInt == 50) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + this.bgG.drawImage(Image.createImage("/s_2.png"), 27, 2, 20); + this.bgG.drawImage(Image.createImage("/f_6.png"), 36, 4, 20); + this.bgG.drawImage(Image.createImage("/s_1.png"), 1, 28, 20); + boxPaint_1(); + this.bgG.setColor(73, 0, 0); + this.bgG.drawLine(65, 43, 65, 108); + boxPaint_2(); + this.bgG.drawImage(Image.createImage("/s_3.png"), 80, 78, 20); + Image image = Image.createImage("/f_0.png"); + imgCutPaint(13, 7, 0, 4, 20, image, this.bgG); + imgCutPaint(13, 7, 0, 27, 111, image, this.bgG); + this.bgG.setColor(255, 255, 255); + this.bgG.drawString(Global.ETC[9], 16, 29, 20); + this.bgG.drawString(Global.ETC[11], 83, 30, 20); + this.bgG.drawString(Global.ETC[12], 83, 44, 20); + this.bgG.drawString(Global.ETC[10], 83, 59, 20); + } else if (paramInt == 51) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + this.bgG.drawImage(Image.createImage("/s_2.png"), 27, 2, 20); + this.bgG.drawImage(Image.createImage("/f_7.png"), 42, 4, 20); + this.bgG.drawImage(Image.createImage("/s_1.png"), 1, 28, 20); + boxPaint_1(); + boxPaint_2(); + this.bgG.drawImage(Image.createImage("/s_3.png"), 80, 78, 20); + Image image = Image.createImage("/f_0.png"); + imgCutPaint(13, 7, 0, 4, 20, image, this.bgG); + this.bgG.setColor(255, 255, 255); + this.bgG.drawString(Global.ETC[13], 83, 30, 20); + this.bgG.drawString(Global.ETC[14], 83, 44, 20); + this.bgG.drawString(Global.ETC[10], 83, 59, 20); + } else if (paramInt == 60) { + this.bgG.setColor(0, 0, 0); + this.bgG.fillRect(0, 0, 120, 133); + Image image = Image.createImage("/s_1.png"); + this.bgG.setClip(1, 1, 69, 15); + this.bgG.drawImage(image, 1, 1, 20); + this.bgG.setClip(70, 1, 49, 15); + this.bgG.drawImage(image, 119, 1, 24); + this.bgG.setClip(0, 0, 120, 133); + this.bgG.setColor(0, 36, 85); + this.bgG.fillRect(27, 17, 92, 9); + this.bgG.fillRect(39, 27, 80, 9); + this.bgG.fillRect(1, 37, 118, 13); + this.bgG.fillRect(1, 51, 118, 9); + for (byte b = 0; b < 3; b++) { + this.bgG.fillRect(1, 65 + b * 13, 10, 12); + this.bgG.fillRect(12, 65 + b * 13, 83, 12); + this.bgG.fillRect(96, 65 + b * 13, 13, 12); + } + this.bgG.setColor(255, 182, 0); + this.bgG.drawLine(1, 61, 118, 61); + this.bgG.drawLine(110, 65, 110, 102); + this.bgG.drawLine(1, 106, 118, 106); + this.bgG.setColor(146, 73, 0); + this.bgG.drawLine(1, 62, 118, 62); + this.bgG.drawLine(118, 65, 118, 102); + this.bgG.drawLine(1, 118, 118, 118); + this.bgG.setColor(182, 109, 0); + this.bgG.fillRect(111, 65, 7, 38); + this.bgG.fillRect(1, 107, 118, 11); + image = Image.createImage("/i_0.png"); + imgCutPaint(7, 11, 0, 7, 3, image, this.bgG); + imgCutPaint(7, 11, 1, 106, 3, image, this.bgG); + image = Image.createImage("/i_2.png"); + imgCutPaint(7, 5, 0, 111, 65, image, this.bgG); + imgCutPaint(7, 5, 1, 111, 98, image, this.bgG); + image = Image.createImage("/f_0.png"); + imgCutPaint(13, 7, 1, 42, 18, image, this.bgG); + imgCutPaint(13, 7, 1, 42, 28, image, this.bgG); + imgCutPaint(13, 7, 2, 77, 18, image, this.bgG); + imgCutPaint(13, 7, 2, 77, 28, image, this.bgG); + imgCutPaint(13, 7, 3, 91, 28, image, this.bgG); + imgCutPaint(13, 7, 5, 4, 52, image, this.bgG); + imgCutPaint(13, 7, 6, 64, 52, image, this.bgG); + imgCutPaint(5, 7, 10, 36, 52, this.img_whiteNum, this.bgG); + imgCutPaint(5, 7, 10, 96, 52, this.img_whiteNum, this.bgG); + imgCutPaint(13, 7, 0, 5, 109, image, this.bgG); + numImgPaint(this.GP + "", 20, 109, this.bgG, this.img_whiteNum); + imgCutPaint(13, 7, 4, 63, 109, image, this.bgG); + numImgPaint(this.myEX + "", 78, 109, this.bgG, this.img_whiteNum); + this.bgG.drawImage(Image.createImage("/ez.png"), 54, 123, 20); + this.bgG.drawImage(Image.createImage("/cancel.png"), 81, 121, 20); + } + } catch (Exception exception) {} + } + + public void boxPaint_1() { + this.bgG.setColor(109, 36, 0); + this.bgG.fillRect(1, 44, 78, 64); + this.bgG.setColor(73, 0, 0); + for (byte b = 0; b < 6; b++) + this.bgG.drawLine(1, 43 + b * 13, 78, 43 + b * 13); + this.bgG.setColor(255, 182, 0); + this.bgG.drawLine(1, 109, 78, 109); + this.bgG.setColor(182, 109, 0); + this.bgG.fillRect(1, 110, 78, 8); + this.bgG.setColor(146, 73, 0); + this.bgG.drawLine(1, 118, 78, 118); + } + + public void boxPaint_2() { + this.bgG.setColor(182, 109, 0); + this.bgG.fillRect(80, 28, 39, 46); + this.bgG.setColor(255, 182, 0); + this.bgG.drawRect(80, 28, 37, 44); + this.bgG.setColor(109, 36, 0); + this.bgG.fillRect(82, 30, 35, 41); + this.bgG.setColor(73, 0, 0); + for (byte b = 0; b < 3; b++) + this.bgG.drawLine(82, 43 + b * 14, 116, 43 + b * 14); + } + + public void imgCutPaint(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, Image paramImage, Graphics paramGraphics) { + paramGraphics.setClip(paramInt4, paramInt5, paramInt1, paramInt2); + paramGraphics.drawImage(paramImage, paramInt4 - paramInt1 * paramInt3, paramInt5, 20); + 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; + } + } + } +} \ No newline at end of file diff --git a/src/dothack/Global.java b/src/dothack/Global.java new file mode 100644 index 0000000..399a069 --- /dev/null +++ b/src/dothack/Global.java @@ -0,0 +1,53 @@ +package dothack; +public final class Global { + public static DotHack app; + + public static final String[] Main = new String[] { "1.계속하기", "2.저장하기", "3.사운드(", "4.메뉴가기", "5.게임종료" }; + public static final String[] chName = new String[] { "카 이 트", "블랙로즈", "미스트랄" }; + public static final String[] itemName = new String[] { "치료의물약", "완치의물약", "기혼", "제왕의기혼", "노블와인", "해독혈청", "각성소다", "소생의비약", "오카리나" }; + public static final String[] ETC = new String[] { + "레벨 부족", "금액 부족", "공간 부족", "아이템 부족", "사용 불가능", "루트타운 이동", "일시정지", "연결실패", "죄송합니다.", "아 이 템", + "나가기", "구 입", "판 매", "상 태", "제 련", "무기종류", "무기 제련이", "성공했습니다.", "기본공격", "스킬사용", + "socket://220.76.242.60:9117", "이동 불가능" }; + public static final byte[] itemGP = new byte[] { 6, 15, 8, 20, 35, 3, 3, 100, 90 }; + public static final byte[] weaponLVG = new byte[] { 1, 4, 7, 10, 15, 20 }; + public static final byte[] ATD = new byte[] { 4, 5, 3 }; + public static final byte[] HPD = new byte[] { 30, 40, 20 }; + public static final byte[] SPD = new byte[] { 15, 15, 18 }; + public static final byte[] ATG = new byte[] { 3, 4, 2 }; + public static final byte[] HPG = new byte[] { 10, 12, 10 }; + public static final byte[] SPG = new byte[] { 3, 3, 4 }; + public static final int[] monATD = new int[] { + 3, 5, 7, 9, 11, 13, 55, 125, 164, 202, + 256 }; + public static final int[] monHPD = new int[] { + 20, 30, 40, 30, 40, 40, 2010, 3528, 5418, 7520, + 11820 }; + public static final String[][] weapon = new String[][] { { "초보자쌍검", "강철쌍검", "어새신", "암흑쌍검", "낭인의쌍검", "달인의쌍검" }, { "모험자의대검", "대지의검", "그린소드", "슬레이어", "백염도", "참마도" }, { "나무지팡이", "아이언로드", "마성지팡이", "어스로드", "룬룬스틱", "실버로드" } }; + public static final String[] skill_1 = new String[] { "검무", "호륜인", "몽환조무", "염무", "뇌무", "쌍사귀참", "데이터드레인" }; + public static final String[] skill_2 = new String[] { "칼라미티", "데스브링거", "단쿠", "카린", "라인스매쉬", "간드라이브" }; + public static final String[] skill_3 = new String[] { "바크돈", "메가롬", "리우조트", "라이크루즈", "아니돈", "비바크롬", "아프코브", "립스", "라립스" }; + public static final byte[] skill_1SP = new byte[] { 20, 30, 40, 50, 60, 70 }; + public static final byte[] skill_3SP = new byte[] { 20, 30, 45, 60, 75, 90, 10, 30, 50 }; + public static final byte[] sA_M0 = new byte[] { 0, 1, 1, 0 }; + public static final byte[] sA_M1 = new byte[] { 0, 3, 2, 2, 0 }; + public static final byte[] sA_M2 = new byte[] { 0, 2, 3, 3, 0 }; + public static final byte[] sA_M3 = new byte[] { 0, 1, 3, 2, 0 }; + public static final byte[] sA_M4 = new byte[] { 0, 2, 3, 1, 1, 0 }; + public static final byte[] sA_M5 = new byte[] { 0, 3, 2, 1, 1, 0 }; + public static final byte[] sA_M6 = new byte[] { 0, 3, 2, 2, 3, 2, 0 }; + public static final byte[] sB_M0 = new byte[] { 5, 6, 5, 5, 5 }; + public static final byte[] sB_M1 = new byte[] { 5, 6, 8, 8, 5 }; + public static final byte[] sB_M2 = new byte[] { 5, 6, 7, 7, 5 }; + public static final byte[] sB_M3 = new byte[] { 5, 8, 6, 5, 5 }; + public static final byte[] sB_M4 = new byte[] { 5, 6, 8, 6, 5 }; + public static final byte[] sB_M5 = new byte[] { 5, 6, 7, 6, 5 }; + public static final byte[] sB_M6 = new byte[] { 5, 6, 7, 6, 5, 5 }; + public static final byte[] sC_M0 = new byte[] { 9, 10, 10, 9 }; + public static final byte[] sC_M1 = new byte[] { 9, 12, 12, 9 }; + public static final byte[] sC_M2 = new byte[] { 9, 11, 11, 9 }; + public static final byte[] sC_M3 = new byte[] { 9, 12, 10, 9 }; + public static final byte[] sC_M4 = new byte[] { 9, 10, 11, 11, 9 }; + public static final byte[] sC_M5 = new byte[] { 9, 12, 11, 11, 9 }; + public static final byte[] sC_M6 = new byte[] { 9, 12, 10, 11, 11, 9 }; +} \ No newline at end of file diff --git a/src/sillysagiri/Easing.java b/src/sillysagiri/Easing.java new file mode 100644 index 0000000..d391db7 --- /dev/null +++ b/src/sillysagiri/Easing.java @@ -0,0 +1,84 @@ +package sillysagiri; + +public class Easing { + + public static float CubicEaseOut(float p) + { + float f = (p - 1); + return f * f * f + 1; + } + + public static float CubicEaseIn(float p) + { + return p * p * p; + } + + public static float CubicEaseInOut(float p) + { + if(p < 0.5) + { + return 4 * p * p * p; + } + else + { + float f = ((2 * p) - 2); + return 0.5f * f * f * f + 1; + } + } + + public static float CircularEaseIn(float p) + { + return (float)(1 - Math.sqrt(1 - (p * p))); + } + + // Modeled after shifted quadrant II of unit circle + public static float CircularEaseOut(float p) + { + return (float)(Math.sqrt((2 - p) * p)); + } + + // Modeled after the piecewise circular function + // y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) + // y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1] + public static float CircularEaseInOut(float p) + { + if(p < 0.5) + { + return (float)(0.5f * (1 - Math.sqrt(1 - 4 * (p * p)))); + } + else + { + return (float)(0.5f * (Math.sqrt(-((2 * p) - 3) * ((2 * p) - 1)) + 1)); + } + } + + // Modeled after the quintic y = x^5 + public static float QuinticEaseIn(float p) + { + return p * p * p * p * p; + } + + // Modeled after the quintic y = (x - 1)^5 + 1 + public static float QuinticEaseOut(float p) + { + float f = (p - 1); + return f * f * f * f * f + 1; + } + + // Modeled after the piecewise quintic + // y = (1/2)((2x)^5) ; [0, 0.5) + // y = (1/2)((2x-2)^5 + 2) ; [0.5, 1] + public static float QuinticEaseInOut(float p) + { + if(p < 0.5) + { + return 16 * p * p * p * p * p; + } + else + { + float f = ((2 * p) - 2); + return 0.5f * f * f * f * f * f + 1; + } + } + +} diff --git a/src/sillysagiri/Input.java b/src/sillysagiri/Input.java new file mode 100644 index 0000000..7cba864 --- /dev/null +++ b/src/sillysagiri/Input.java @@ -0,0 +1,115 @@ +package sillysagiri; + +import java.util.Hashtable; + +public final class Input { + public Hashtable hash_keyState = new Hashtable<>(); + + public int state_anyKey = 0; + public int state_touchState = Sagiri.TOUCH_NONE; + public int state_lastKey = 0; + + public int touchX = 0; + public int touchY = 0; + + public Input() + { + } + + public final void Update() + { + for (Integer key : hash_keyState.keySet()) + { + int value = hash_keyState.get(key); + if (value == -1) hash_keyState.remove(key); + else hash_keyState.put(key, value+1); + } + + if (state_anyKey != 0) state_anyKey++; + state_touchState = Sagiri.TOUCH_NONE; + } + + public final void HandleKeyDown(int keycode) + { + Integer value = hash_keyState.get(keycode); + + if (value != null) + hash_keyState.put(keycode, new Integer(Math.max(value, 1))); + else + hash_keyState.put(keycode, 1); + + state_anyKey = Math.max(state_anyKey, 1); + state_lastKey = keycode; + } + + public final void HandleKeyUp(int keycode) + { + hash_keyState.put(keycode, -1); + state_anyKey = -1; + state_lastKey = keycode; + } + + public final void HandleTouch(int phase, int x, int y) + { + state_touchState = phase; + touchX = x; + touchY = y; + } + + public final boolean IsKeyHeld(int keycode) + { + Integer value = hash_keyState.get(keycode); + + if (value != null) + return value.intValue() > 0; + else + return false; + } + + public final boolean IsKeyHeld(int[] keycode) + { + for (int i : keycode) + if (IsKeyHeld(keycode[i])) return true; + return false; + } + + public final boolean IsKeyDown(int keycode) + { + Integer value = hash_keyState.get(keycode); + + if (value != null) + return value.intValue() == 0; + else + return false; + } + + public final boolean IsKeyDown(int[] keycode) + { + for (int i : keycode) + if (IsKeyDown(keycode[i])) return true; + return false; + } + + public final boolean IsKeyReleased(int keycode) + { + Integer value = hash_keyState.get(keycode); + + if (value != null) + return value.intValue() == -1; + else + return false; + } + + public final boolean IsKeyReleased(int[] keycode) + { + for (int i : keycode) + if (IsKeyReleased(keycode[i])) return true; + return false; + } + + public final boolean IsKeyHeldAny() { return state_anyKey > 1; } + public final boolean IsKeyDownAny() { return state_anyKey == 1; } + public final boolean IsKeyReleasedAny() { return state_anyKey == -1; } + + public final int getKeyStatus(int keycode) { return hash_keyState.get(keycode); } +} diff --git a/src/sillysagiri/Sagiri.java b/src/sillysagiri/Sagiri.java new file mode 100644 index 0000000..29d9d23 --- /dev/null +++ b/src/sillysagiri/Sagiri.java @@ -0,0 +1,36 @@ +package sillysagiri; + +public class Sagiri +{ + public final static int TOUCH_NONE = 0; + public final static int TOUCH_BEGIN = 1; + public final static int TOUCH_END = 2; + public final static int TOUCH_DRAG = 3; + + public static Sagiri _instance = null; + + public Input input; + + public int fps = 20; + + private Scene _scene_current; + private long _time_begin; + private long _time_delta; + + public Sagiri() + { + _instance = this; + input = new Input(); + _scene_current = null; + } + + public void Update() + { + _time_begin = System.currentTimeMillis(); + + input.Update(); + if (_scene_current != null) _scene_current.Update(); + } + + public final long GetFrameTime() { return _time_delta; } +} diff --git a/src/sillysagiri/Scene.java b/src/sillysagiri/Scene.java new file mode 100644 index 0000000..3a658e6 --- /dev/null +++ b/src/sillysagiri/Scene.java @@ -0,0 +1,15 @@ +package sillysagiri; + +import javax.microedition.lcdui.Graphics; + +public abstract class Scene { + public Scene() + { + } + + // override this + public abstract void Draw(Graphics g); + public abstract void Destroy(); + public abstract void Update(); + +} diff --git a/src/sillysagiri/Utils.java b/src/sillysagiri/Utils.java new file mode 100644 index 0000000..4bcf42f --- /dev/null +++ b/src/sillysagiri/Utils.java @@ -0,0 +1,29 @@ +package sillysagiri; + +import javax.microedition.lcdui.Graphics; + +import dothack.Global; + +public final class Utils { + public static void Clear_Screen(Graphics gg, int r, int g, int b) + { + gg.setColor(r,g,b); + gg.fillRect(0, 0, Global.app.game.getWidth(), Global.app.game.getHeight()); + } + + public static void Clear_Screen(Graphics gg, int rgb) + { + gg.setColor(rgb); + gg.fillRect(0, 0, Global.app.game.getWidth(), Global.app.game.getHeight()); + } + + public static int GetScreenWidth() + { + return Global.app.game.getWidth(); + } + + public static int GetScreenHeight() + { + return Global.app.game.getHeight(); + } +} diff --git a/src/sillysagiri/scene/Intro.java b/src/sillysagiri/scene/Intro.java new file mode 100644 index 0000000..3e14d6f --- /dev/null +++ b/src/sillysagiri/scene/Intro.java @@ -0,0 +1,92 @@ +package sillysagiri.scene; +import java.io.IOException; + +import javax.microedition.lcdui.Graphics; +import javax.microedition.lcdui.Image; +import javax.microedition.lcdui.game.Sprite; + +import sillysagiri.Easing; +import sillysagiri.Scene; +import sillysagiri.Utils; + +public class Intro extends Scene { + private int counter = 0; + private int state = 0; + + private Image img_logo; + + public Intro() throws IOException + { + img_logo = Image.createImage("/t_1.png"); + } + + public void Destroy() + { + img_logo = null; + } + + public void Update() + { + // TODO: use time based counter instead + counter++; + if (counter > 100) counter = 0; + + switch (state) { + case 0: + { + if (counter > 25) + { + // img_logo = Image.createImage("/pEZ.png"); + counter = 0; + state = 1; + } + } + break; + + default: break; + } + } + + public void Draw(Graphics g) + { + Utils.Clear_Screen(g, 73, 0, 0); + switch (state) { + case 0: + { + int halfW = img_logo.getWidth()/2; + int halfH = img_logo.getHeight()/2; + float r = Easing.CubicEaseOut((float)counter/25); + int pos = (int)(((Utils.GetScreenWidth()/2)+halfW) * r) - halfW; + + g.drawRegion( + img_logo, + 0, 0, img_logo.getWidth(), halfH, Sprite.TRANS_NONE, + pos, Utils.GetScreenHeight()/2-1, + Graphics.BOTTOM | Graphics.HCENTER); + + g.drawRegion( + img_logo, + 0, halfH, img_logo.getWidth(), img_logo.getHeight()-halfH, Sprite.TRANS_NONE, + Utils.GetScreenWidth() - pos, Utils.GetScreenHeight()/2, + Graphics.TOP | Graphics.HCENTER); + + break; + } + + case 1: + { + g.drawImage( + img_logo, + Utils.GetScreenWidth()/2, + Utils.GetScreenHeight()/2, + Graphics.VCENTER | Graphics.HCENTER + ); + + break; + } + + default: return; + } + } + +}