import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Toolkit;
import java.awt.image.ImageObserver;
import java.io.IOException;
import java.io.InputStream;

public class Class314 implements Interface32 {

   Image anImage3969;
   Font aFont3970;
   FontMetrics aFontMetrics3971;
   Image anImage3972;
   Image anImage3973;
   Image anImage3974;
   boolean aBool3975;
   Image anImage3976;
   Image anImage3977;
   Image anImage3978;
   Image anImage3979;
   int anInt3980;
   Image anImage3981;
   Color aColor3982;
   int anInt3983;
   boolean aBool3984;
   int anInt3985;
   int anInt3986;
   boolean aBool3987;
   int anInt3988;
   int anInt3989;
   int anInt3990;
   Image anImage3991;
   int anInt3992;
   int anInt3993;
   static int anInt3994;


   final int method5590(int var1) {
      return this.aBool3975?(759890095 * Class563.anInt7495 - var1) / 2:0;
   }

   final int method5591(int var1, byte var2) {
      return this.aBool3975?(759890095 * Class563.anInt7495 - var1) / 2:0;
   }

   public void method183() {
      Class87.method1773((byte)-25);
   }

   public void method171(boolean var1, int var2) {
      if(!this.aBool3987 && this.aFont3970 == null) {
         try {
            String[] var3 = Class34.method879(client.aString7643, ',', -1690343854);
            if(23 != var3.length) {
               this.aBool3987 = true;
            }

            this.aBool3975 = Boolean.parseBoolean(var3[0]);
            this.aBool3984 = Boolean.parseBoolean(var3[1]);
            this.anInt3985 = Class78.method1629(var3[2], -1658051113) * -1462621725;
            this.anInt3993 = Class78.method1629(var3[3], -1605752196) * -1950788563;
            this.anInt3988 = Class78.method1629(var3[4], -1693961712) * 572412693;
            this.anInt3983 = Class78.method1629(var3[5], -1864247559) * 997633495;
            this.anInt3989 = Class78.method1629(var3[6], -1003353079) * -1278058537;
            this.anInt3980 = Class78.method1629(var3[7], -2131885552) * -556779611;
            this.anInt3986 = Class78.method1629(var3[8], -907689922) * 574266163;
            this.anInt3992 = Class78.method1629(var3[9], -1211315460) * 780830565;
            String var4 = var3[10];
            int var5 = Class78.method1629(var3[11], -1499718462);
            int var6 = Class399.method6784(var3[12].substring(2), 16, 601245334);
            this.aFont3970 = new Font(var4, 0, var5);
            this.aFontMetrics3971 = Class572.aCanvas7591.getFontMetrics(this.aFont3970);
            this.aColor3982 = new Color(var6);
            MediaTracker var7 = new MediaTracker(Class572.aCanvas7591);
            this.anImage3973 = this.method5592(var3[13], (byte)64);
            var7.addImage(this.anImage3973, 0);
            this.anImage3974 = this.method5592(var3[14], (byte)64);
            var7.addImage(this.anImage3974, 1);
            this.anImage3972 = this.method5592(var3[15], (byte)64);
            var7.addImage(this.anImage3972, 2);
            this.anImage3976 = this.method5592(var3[16], (byte)64);
            var7.addImage(this.anImage3976, 3);
            this.anImage3991 = this.method5592(var3[17], (byte)64);
            var7.addImage(this.anImage3991, 4);
            this.anImage3978 = this.method5592(var3[18], (byte)64);
            var7.addImage(this.anImage3978, 5);
            this.anImage3979 = this.method5592(var3[19], (byte)64);
            var7.addImage(this.anImage3979, 6);
            this.anImage3977 = this.method5592(var3[20], (byte)64);
            var7.addImage(this.anImage3977, 7);
            this.anImage3981 = this.method5592(var3[21], (byte)64);
            var7.addImage(this.anImage3981, 8);
            var7.waitForAll();
            this.anInt3990 = Class78.method1629(var3[22], -1532222048) * 1510597689;
         } catch (Exception var34) {
            this.aBool3987 = true;
         }
      }

      if(this.aBool3987) {
         this.method5593(-2113198301);
      } else {
         Graphics var36 = Class572.aCanvas7591.getGraphics();
         if(null != var36) {
            try {
               int var37 = Class299.aClass310_3668.method5502(2090437043);
               String var38 = Class299.aClass310_3668.method5501((byte)7);
               if(null == Class117.anImage1191) {
                  Class117.anImage1191 = Class572.aCanvas7591.createImage(759890095 * Class563.anInt7495, 1404657485 * Class440.anInt5458);
               }

               Graphics var39 = Class117.anImage1191.getGraphics();
               var39.setColor(Color.BLACK);
               var39.fillRect(0, 0, 759890095 * Class563.anInt7495, 1404657485 * Class440.anInt5458);
               int var40 = this.anImage3979.getWidth((ImageObserver)null);
               int var8 = this.anImage3977.getWidth((ImageObserver)null);
               int var9 = this.anImage3981.getWidth((ImageObserver)null);
               int var10 = this.anImage3979.getHeight((ImageObserver)null);
               int var11 = this.anImage3977.getHeight((ImageObserver)null);
               int var12 = this.anImage3981.getHeight((ImageObserver)null);
               var39.drawImage(this.anImage3979, this.method5591(var40, (byte)14) + this.anInt3989 * 1490289639 - 386324475 * this.anInt3986 / 2, this.method5600(var10, 1926496194) + -902309843 * this.anInt3980, (ImageObserver)null);
               int var13 = var40 + (this.anInt3989 * 1490289639 - 386324475 * this.anInt3986 / 2);
               int var14 = 1490289639 * this.anInt3989 + this.anInt3986 * 386324475 / 2;

               int var15;
               for(var15 = var13; var15 <= var14; var15 += var9) {
                  var39.drawImage(this.anImage3981, this.method5591(var40, (byte)14) + this.anInt3989 * 1490289639 + var15, this.method5600(var12, 681310561) + -902309843 * this.anInt3980, (ImageObserver)null);
               }

               var39.drawImage(this.anImage3977, this.method5591(var8, (byte)14) + 1490289639 * this.anInt3989 + 386324475 * this.anInt3986 / 2, this.method5600(var11, 110108669) + this.anInt3980 * -902309843, (ImageObserver)null);
               var15 = this.anImage3972.getWidth((ImageObserver)null);
               int var16 = this.anImage3972.getHeight((ImageObserver)null);
               int var17 = this.anImage3976.getWidth((ImageObserver)null);
               int var18 = this.anImage3976.getHeight((ImageObserver)null);
               int var19 = this.anImage3978.getHeight((ImageObserver)null);
               int var20 = this.anImage3991.getWidth((ImageObserver)null);
               int var21 = this.anImage3991.getHeight((ImageObserver)null);
               int var22 = this.anImage3978.getWidth((ImageObserver)null);
               int var23 = this.anImage3973.getWidth((ImageObserver)null);
               int var24 = this.anImage3974.getWidth((ImageObserver)null);
               int var25 = this.method5591(-1987419075 * this.anInt3988, (byte)14) + 2032296907 * this.anInt3985;
               int var26 = this.method5600(-608332313 * this.anInt3983, -560176073) + -1411638363 * this.anInt3993;
               var39.drawImage(this.anImage3972, var25, (-608332313 * this.anInt3983 - var16) / 2 + var26, (ImageObserver)null);
               var39.drawImage(this.anImage3976, -1987419075 * this.anInt3988 + var25 - var17, var26 + (-608332313 * this.anInt3983 - var18) / 2, (ImageObserver)null);
               if(null == this.anImage3969) {
                  this.anImage3969 = Class572.aCanvas7591.createImage(this.anInt3988 * -1987419075 - var15 - var17, -608332313 * this.anInt3983);
               }

               Graphics var27 = this.anImage3969.getGraphics();

               int var28;
               for(var28 = 0; var28 < this.anInt3988 * -1987419075 - var15 - var17; var28 += var20) {
                  var27.drawImage(this.anImage3991, var28, 0, (ImageObserver)null);
               }

               for(var28 = 0; var28 < -1987419075 * this.anInt3988 - var15 - var17; var28 += var22) {
                  var27.drawImage(this.anImage3978, var28, this.anInt3983 * -608332313 - var19, (ImageObserver)null);
               }

               var28 = var37 * (this.anInt3988 * -1987419075 - var15 - var17) / 100;
               int var33;
               if(var28 > 0) {
                  Image var29 = Class572.aCanvas7591.createImage(var28, -608332313 * this.anInt3983 - var21 - var19);
                  int var30 = var29.getWidth((ImageObserver)null);
                  Graphics var31 = var29.getGraphics();
                  int var32 = 2015545865 * this.anInt3990 * Class178.method3165((byte)2) / 10 % var23;

                  for(var33 = var32 - var23; var33 < var30; var33 += var23) {
                     var31.drawImage(this.anImage3973, var33, 0, (ImageObserver)null);
                  }

                  var27.drawImage(var29, 0, var21, (ImageObserver)null);
               }

               int var43 = var28;
               var28 = this.anInt3988 * -1987419075 - var15 - var17 - var28;
               if(var28 > 0) {
                  Image var41 = Class572.aCanvas7591.createImage(var28, -608332313 * this.anInt3983 - var21 - var19);
                  int var42 = var41.getWidth((ImageObserver)null);
                  Graphics var44 = var41.getGraphics();

                  for(var33 = 0; var33 < var42; var33 += var24) {
                     var44.drawImage(this.anImage3974, var33, 0, (ImageObserver)null);
                  }

                  var27.drawImage(var41, var43, var21, (ImageObserver)null);
               }

               var39.drawImage(this.anImage3969, var15 + var25, var26, (ImageObserver)null);
               var39.setFont(this.aFont3970);
               var39.setColor(this.aColor3982);
               var39.drawString(var38, var25 + (this.anInt3988 * -1987419075 - this.aFontMetrics3971.stringWidth(var38)) / 2, var26 + -608332313 * this.anInt3983 / 2 + 4 + this.anInt3992 * -1783737747);
               var36.drawImage(Class117.anImage1191, 0, 0, (ImageObserver)null);
            } catch (Exception var35) {
               this.aBool3987 = true;
            }
         } else {
            Class572.aCanvas7591.repaint();
         }

      }
   }

   Image method5592(String var1, byte var2) throws IOException {
      try {
         InputStream var3 = Class393.anApplet4870.getClass().getClassLoader().getResourceAsStream(var1);
         byte[] var4 = new byte[4000];

         int var6;
         for(int var5 = 0; (var6 = var3.read()) != -1; var4[var5++] = (byte)var6) {
            ;
         }

         Image var7 = Toolkit.getDefaultToolkit().createImage(var4);
         return var7;
      } catch (Exception var8) {
         throw new IOException();
      }
   }

   void method5593(int var1) {
      Class246.method4387(Class299.aClass310_3668.method5502(2012538341), Class299.aClass310_3668.method5501((byte)7), client.aColorArray7820[client.anInt7636 * -1725081883], client.aColorArray7684[-1725081883 * client.anInt7636], client.aColorArray7685[client.anInt7636 * -1725081883], (short)21741);
   }

   public void method45(int var1) {
      Class87.method1773((byte)-25);
   }

   public void method170(int var1) {}

   public int method172(int var1) {
      return 100;
   }

   public void method124() {}

   public int method174(int var1) {
      return 0;
   }

   final int method5594(int var1) {
      return this.aBool3975?(759890095 * Class563.anInt7495 - var1) / 2:0;
   }

   public boolean method173(long var1) {
      return true;
   }

   public boolean method179(long var1) {
      return true;
   }

   final int method5595(int var1) {
      return this.aBool3984?(Class440.anInt5458 * 1404657485 - var1) / 2:0;
   }

   final int method5596(int var1) {
      return this.aBool3975?(759890095 * Class563.anInt7495 - var1) / 2:0;
   }

   public void method175(boolean var1) {
      if(!this.aBool3987 && this.aFont3970 == null) {
         try {
            String[] var2 = Class34.method879(client.aString7643, ',', -1351635067);
            if(23 != var2.length) {
               this.aBool3987 = true;
            }

            this.aBool3975 = Boolean.parseBoolean(var2[0]);
            this.aBool3984 = Boolean.parseBoolean(var2[1]);
            this.anInt3985 = Class78.method1629(var2[2], -1289321333) * -1462621725;
            this.anInt3993 = Class78.method1629(var2[3], -1407902715) * -1950788563;
            this.anInt3988 = Class78.method1629(var2[4], -556938883) * 572412693;
            this.anInt3983 = Class78.method1629(var2[5], -1836367986) * 997633495;
            this.anInt3989 = Class78.method1629(var2[6], -2055398244) * -1278058537;
            this.anInt3980 = Class78.method1629(var2[7], -1004654356) * -556779611;
            this.anInt3986 = Class78.method1629(var2[8], -847710044) * 574266163;
            this.anInt3992 = Class78.method1629(var2[9], -1329989163) * 780830565;
            String var3 = var2[10];
            int var4 = Class78.method1629(var2[11], -1880728953);
            int var5 = Class399.method6784(var2[12].substring(2), 16, 1174571309);
            this.aFont3970 = new Font(var3, 0, var4);
            this.aFontMetrics3971 = Class572.aCanvas7591.getFontMetrics(this.aFont3970);
            this.aColor3982 = new Color(var5);
            MediaTracker var6 = new MediaTracker(Class572.aCanvas7591);
            this.anImage3973 = this.method5592(var2[13], (byte)64);
            var6.addImage(this.anImage3973, 0);
            this.anImage3974 = this.method5592(var2[14], (byte)64);
            var6.addImage(this.anImage3974, 1);
            this.anImage3972 = this.method5592(var2[15], (byte)64);
            var6.addImage(this.anImage3972, 2);
            this.anImage3976 = this.method5592(var2[16], (byte)64);
            var6.addImage(this.anImage3976, 3);
            this.anImage3991 = this.method5592(var2[17], (byte)64);
            var6.addImage(this.anImage3991, 4);
            this.anImage3978 = this.method5592(var2[18], (byte)64);
            var6.addImage(this.anImage3978, 5);
            this.anImage3979 = this.method5592(var2[19], (byte)64);
            var6.addImage(this.anImage3979, 6);
            this.anImage3977 = this.method5592(var2[20], (byte)64);
            var6.addImage(this.anImage3977, 7);
            this.anImage3981 = this.method5592(var2[21], (byte)64);
            var6.addImage(this.anImage3981, 8);
            var6.waitForAll();
            this.anInt3990 = Class78.method1629(var2[22], -2030298805) * 1510597689;
         } catch (Exception var33) {
            this.aBool3987 = true;
         }
      }

      if(this.aBool3987) {
         this.method5593(-2131083059);
      } else {
         Graphics var35 = Class572.aCanvas7591.getGraphics();
         if(null != var35) {
            try {
               int var36 = Class299.aClass310_3668.method5502(1920686856);
               String var37 = Class299.aClass310_3668.method5501((byte)7);
               if(null == Class117.anImage1191) {
                  Class117.anImage1191 = Class572.aCanvas7591.createImage(759890095 * Class563.anInt7495, 1404657485 * Class440.anInt5458);
               }

               Graphics var38 = Class117.anImage1191.getGraphics();
               var38.setColor(Color.BLACK);
               var38.fillRect(0, 0, 759890095 * Class563.anInt7495, 1404657485 * Class440.anInt5458);
               int var39 = this.anImage3979.getWidth((ImageObserver)null);
               int var7 = this.anImage3977.getWidth((ImageObserver)null);
               int var8 = this.anImage3981.getWidth((ImageObserver)null);
               int var9 = this.anImage3979.getHeight((ImageObserver)null);
               int var10 = this.anImage3977.getHeight((ImageObserver)null);
               int var11 = this.anImage3981.getHeight((ImageObserver)null);
               var38.drawImage(this.anImage3979, this.method5591(var39, (byte)14) + this.anInt3989 * 1490289639 - 386324475 * this.anInt3986 / 2, this.method5600(var9, -942781215) + -902309843 * this.anInt3980, (ImageObserver)null);
               int var12 = var39 + (this.anInt3989 * 1490289639 - 386324475 * this.anInt3986 / 2);
               int var13 = 1490289639 * this.anInt3989 + this.anInt3986 * 386324475 / 2;

               int var14;
               for(var14 = var12; var14 <= var13; var14 += var8) {
                  var38.drawImage(this.anImage3981, this.method5591(var39, (byte)14) + this.anInt3989 * 1490289639 + var14, this.method5600(var11, 1089165651) + -902309843 * this.anInt3980, (ImageObserver)null);
               }

               var38.drawImage(this.anImage3977, this.method5591(var7, (byte)14) + 1490289639 * this.anInt3989 + 386324475 * this.anInt3986 / 2, this.method5600(var10, -724290942) + this.anInt3980 * -902309843, (ImageObserver)null);
               var14 = this.anImage3972.getWidth((ImageObserver)null);
               int var15 = this.anImage3972.getHeight((ImageObserver)null);
               int var16 = this.anImage3976.getWidth((ImageObserver)null);
               int var17 = this.anImage3976.getHeight((ImageObserver)null);
               int var18 = this.anImage3978.getHeight((ImageObserver)null);
               int var19 = this.anImage3991.getWidth((ImageObserver)null);
               int var20 = this.anImage3991.getHeight((ImageObserver)null);
               int var21 = this.anImage3978.getWidth((ImageObserver)null);
               int var22 = this.anImage3973.getWidth((ImageObserver)null);
               int var23 = this.anImage3974.getWidth((ImageObserver)null);
               int var24 = this.method5591(-1987419075 * this.anInt3988, (byte)14) + 2032296907 * this.anInt3985;
               int var25 = this.method5600(-608332313 * this.anInt3983, -955816352) + -1411638363 * this.anInt3993;
               var38.drawImage(this.anImage3972, var24, (-608332313 * this.anInt3983 - var15) / 2 + var25, (ImageObserver)null);
               var38.drawImage(this.anImage3976, -1987419075 * this.anInt3988 + var24 - var16, var25 + (-608332313 * this.anInt3983 - var17) / 2, (ImageObserver)null);
               if(null == this.anImage3969) {
                  this.anImage3969 = Class572.aCanvas7591.createImage(this.anInt3988 * -1987419075 - var14 - var16, -608332313 * this.anInt3983);
               }

               Graphics var26 = this.anImage3969.getGraphics();

               int var27;
               for(var27 = 0; var27 < this.anInt3988 * -1987419075 - var14 - var16; var27 += var19) {
                  var26.drawImage(this.anImage3991, var27, 0, (ImageObserver)null);
               }

               for(var27 = 0; var27 < -1987419075 * this.anInt3988 - var14 - var16; var27 += var21) {
                  var26.drawImage(this.anImage3978, var27, this.anInt3983 * -608332313 - var18, (ImageObserver)null);
               }

               var27 = var36 * (this.anInt3988 * -1987419075 - var14 - var16) / 100;
               int var32;
               if(var27 > 0) {
                  Image var28 = Class572.aCanvas7591.createImage(var27, -608332313 * this.anInt3983 - var20 - var18);
                  int var29 = var28.getWidth((ImageObserver)null);
                  Graphics var30 = var28.getGraphics();
                  int var31 = 2015545865 * this.anInt3990 * Class178.method3165((byte)2) / 10 % var22;

                  for(var32 = var31 - var22; var32 < var29; var32 += var22) {
                     var30.drawImage(this.anImage3973, var32, 0, (ImageObserver)null);
                  }

                  var26.drawImage(var28, 0, var20, (ImageObserver)null);
               }

               int var40 = var27;
               var27 = this.anInt3988 * -1987419075 - var14 - var16 - var27;
               if(var27 > 0) {
                  Image var43 = Class572.aCanvas7591.createImage(var27, -608332313 * this.anInt3983 - var20 - var18);
                  int var41 = var43.getWidth((ImageObserver)null);
                  Graphics var42 = var43.getGraphics();

                  for(var32 = 0; var32 < var41; var32 += var23) {
                     var42.drawImage(this.anImage3974, var32, 0, (ImageObserver)null);
                  }

                  var26.drawImage(var43, var40, var20, (ImageObserver)null);
               }

               var38.drawImage(this.anImage3969, var14 + var24, var25, (ImageObserver)null);
               var38.setFont(this.aFont3970);
               var38.setColor(this.aColor3982);
               var38.drawString(var37, var24 + (this.anInt3988 * -1987419075 - this.aFontMetrics3971.stringWidth(var37)) / 2, var25 + -608332313 * this.anInt3983 / 2 + 4 + this.anInt3992 * -1783737747);
               var35.drawImage(Class117.anImage1191, 0, 0, (ImageObserver)null);
            } catch (Exception var34) {
               this.aBool3987 = true;
            }
         } else {
            Class572.aCanvas7591.repaint();
         }

      }
   }

   Image method5597(String var1) throws IOException {
      try {
         InputStream var2 = Class393.anApplet4870.getClass().getClassLoader().getResourceAsStream(var1);
         byte[] var3 = new byte[4000];

         int var5;
         for(int var4 = 0; (var5 = var2.read()) != -1; var3[var4++] = (byte)var5) {
            ;
         }

         Image var6 = Toolkit.getDefaultToolkit().createImage(var3);
         return var6;
      } catch (Exception var7) {
         throw new IOException();
      }
   }

   Image method5598(String var1) throws IOException {
      try {
         InputStream var2 = Class393.anApplet4870.getClass().getClassLoader().getResourceAsStream(var1);
         byte[] var3 = new byte[4000];

         int var5;
         for(int var4 = 0; (var5 = var2.read()) != -1; var3[var4++] = (byte)var5) {
            ;
         }

         Image var6 = Toolkit.getDefaultToolkit().createImage(var3);
         return var6;
      } catch (Exception var7) {
         throw new IOException();
      }
   }

   public int method177() {
      return 100;
   }

   public int method176() {
      return 100;
   }

   final int method5599(int var1) {
      return this.aBool3984?(Class440.anInt5458 * 1404657485 - var1) / 2:0;
   }

   public boolean method182(long var1) {
      return true;
   }

   final int method5600(int var1, int var2) {
      return this.aBool3984?(Class440.anInt5458 * 1404657485 - var1) / 2:0;
   }

   void method5601() {
      Class246.method4387(Class299.aClass310_3668.method5502(1431699917), Class299.aClass310_3668.method5501((byte)7), client.aColorArray7820[client.anInt7636 * -1725081883], client.aColorArray7684[-1725081883 * client.anInt7636], client.aColorArray7685[client.anInt7636 * -1725081883], (short)12927);
   }

   public boolean method180(long var1) {
      return true;
   }

   public boolean method178(long var1) {
      return true;
   }

   public int method181() {
      return 0;
   }

   static final void method5602(Class508 var0, byte var1) {
      String var2 = (String)var0.anObjectArray6004[(var0.anInt6005 -= -46848683) * 639741949];
      var0.anInt6003 -= 196624946;
      int var3 = var0.anIntArray6027[var0.anInt6003 * -937710807];
      int var4 = var0.anIntArray6027[var0.anInt6003 * -937710807 + 1];
      var0.anObjectArray6004[(var0.anInt6005 += -46848683) * 639741949 - 1] = var2.substring(var3, var4);
   }

   static final void method5603(Class508 var0, byte var1) {
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = var0.aClass64_5997.aByte601;
   }

   static void method5604(int var0) {
      Class3.aClass180_62.method3189((byte)97);
      Class3.aClass180_62.aClass225_Sub23_Sub1_2180.position = 0;
      Class3.aClass180_62.aClass296_2191 = null;
      Class3.aClass180_62.aClass296_2192 = null;
      Class3.aClass180_62.aClass296_2188 = null;
      Class3.aClass180_62.anInt2185 = 0;
      client.anInt7818 = 0;
      Class443.method7429(-1722839272);
      client.anInt7769 = 0;
      client.anInt7651 = 0;
      client.anInt7933 = 0;
      client.aString7904 = null;
      Class397.anInt4901 = 0;
      Class56_Sub2.aClass173Array8155 = null;
      Class103.aClass64_1017 = null;
      Class496.aClass64_5919 = null;
      Class260.method4663(-1552823675);

      for(int var1 = 0; var1 < Class118_Sub1.aClass175_8204.aClass525Array2130.length; ++var1) {
         if(var0 == 16711680) {
            ;
         }

         Class525 var2 = new Class525();
         var2.anInt7156 = 0;
         var2.anInt7157 = 0;
         Class118_Sub1.aClass175_8204.aClass525Array2130[var1] = var2;
      }

   }
}
