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.Sagiri;
import sillysagiri.Scene;
import sillysagiri.scene.Intro;

public class DotHackC extends Canvas {
  DotHack midlet;
  Sagiri sagiri;
  
  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);
    midlet = app;
    sagiri = app.sagiri;

    bG = Image.createImage(120, 133);
    bgG = bG.getGraphics();
    mpl = null;
    ran = new Random();
    soundS = true;
    volumLevel = 3;
    state_main = 9;
    bool_preload = true;
    counter100 = -1;
    
    try {
      sagiri.Set_Scene(new Intro());
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }

  public void paint(Graphics g)
  {
    sagiri.Update(g);
  }

  protected void keyPressed(int keycode)
  {
    sagiri.input.HandleKeyDown(keycode);
  }

  protected void keyReleased(int keycode)
  {
    sagiri.input.HandleKeyUp(keycode);
  }

  protected void pointerPressed(int x, int y)
  {
    sagiri.input.HandleTouch(Sagiri.TOUCH_BEGIN, x, y);
  }

  protected void pointerReleased(int x, int y)
  {
    sagiri.input.HandleTouch(Sagiri.TOUCH_END, x, y);
  }

  protected void pointerDragged(int x, int y)
  {
    sagiri.input.HandleTouch(Sagiri.TOUCH_DRAG, x, y);
  }

  public void soundPlay(int id) {
    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 paint2(Graphics 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;
  //     } 
  //   } 
  // }
}