Example #1
0
  protected void c() {
    bn += 1;

    fx localfx = l.a(this, -1.0D);

    if (localfx != null) {
      double d1 = localfx.p - p;
      double d2 = localfx.q - q;
      double d3 = localfx.r - r;
      double d4 = d1 * d1 + d2 * d2 + d3 * d3;

      if (d4 > 16384.0D) {
        l();
      }

      if ((bn > 600) && (W.nextInt(800) == 0)) {
        if (d4 < 1024.0D) {
          bn = 0;
        } else {
          l();
        }
      }
    }

    bo = 0.0F;
    bp = 0.0F;

    float f = 8.0F;
    if (W.nextFloat() < 0.02F) {
      localfx = l.a(this, f);
      if (localfx != null) {
        b = localfx;
        c = (10 + W.nextInt(20));
      } else {
        bq = ((W.nextFloat() - 0.5F) * 20.0F);
      }
    }

    if (b != null) {
      b(b, 10.0F);
      if ((c-- <= 0) || (b.G) || (b.b(this) > f * f)) {
        b = null;
      }
    } else {
      if (W.nextFloat() < 0.05F) {
        bq = ((W.nextFloat() - 0.5F) * 20.0F);
      }
      v += bq;
      w = bs;
    }

    boolean bool1 = r();
    boolean bool2 = t();
    if ((bool1) || (bool2)) {
      br = (W.nextFloat() < 0.8F);
    }
  }
Example #2
0
  public void f(dx paramdx) {
    if ((aL > 0) && (paramdx != null)) {
      paramdx.b(this, aL);
    }
    aZ = true;

    if (!l.z) {
      int i = g();
      if (i > 0) {
        int j = W.nextInt(3);
        for (int k = 0; k < j; k++) {
          a(i, 1);
        }
      }
    }

    l.a(this, 3);
  }
Example #3
0
  @Override
  public void m() {
    aO = aP;
    super.m();

    if (W.nextInt(1000) < a++) {
      a = (-b());
      String str = d();
      if (str != null) {
        l.a(this, str, h(), (W.nextFloat() - W.nextFloat()) * 0.2F + 1.0F);
      }
    }

    if ((x()) && (y())) {
      a(null, 1);
    }

    if ((ae) || (l.z)) {
      Z = 0;
    }
    int i;
    if ((x()) && (a(jw.f))) {
      ad -= 1;
      if (ad == -20) {
        ad = 0;
        for (i = 0; i < 8; i++) {
          float f1 = W.nextFloat() - W.nextFloat();
          float f2 = W.nextFloat() - W.nextFloat();
          float f3 = W.nextFloat() - W.nextFloat();
          l.a("bubble", p + f1, q + f2, r + f3, s, t, u);
        }
        a(null, 2);
      }

      Z = 0;
    } else {
      ad = aa;
    }

    aX = aY;

    if (aW > 0) {
      aW -= 1;
    }
    if (aS > 0) {
      aS -= 1;
    }
    if (ac > 0) {
      ac -= 1;
    }
    if (aQ <= 0) {
      aV += 1;
      if (aV > 20) {
        L();
        l();
        for (i = 0; i < 20; i++) {
          double d1 = W.nextGaussian() * 0.02D;
          double d2 = W.nextGaussian() * 0.02D;
          double d3 = W.nextGaussian() * 0.02D;
          l.a(
              "explode",
              p + W.nextFloat() * I * 2.0F - I,
              q + W.nextFloat() * J,
              r + W.nextFloat() * I * 2.0F - I,
              d1,
              d2,
              d3);
        }
      }
    }

    aE = aD;

    aA = az;
    x = v;
    y = w;
  }
Example #4
0
  public void b_() {
    O = p;
    P = q;
    Q = r;
    super.b_();
    if (a > 0) {
      a--;
    }
    if (f) {
      int i = this.l.a(b, c, d);

      if (i != e) {
        f = false;
        s *= W.nextFloat() * 0.2F;
        t *= W.nextFloat() * 0.2F;
        u *= W.nextFloat() * 0.2F;
        al = 0;
        am = 0;
      } else {
        al++;
        if (al == 1200) {
          q();
        }
        return;
      }
    } else {
      am++;
    }
    Vec3D vec3d = Vec3D.b(p, q, r);
    Vec3D vec3d1 = Vec3D.b(p + s, q + t, r + u);
    MovingObjectPosition movingobjectposition = this.l.a(vec3d, vec3d1);

    vec3d = Vec3D.b(p, q, r);
    vec3d1 = Vec3D.b(p + s, q + t, r + u);
    if (movingobjectposition != null) {
      vec3d1 =
          Vec3D.b(movingobjectposition.f.a, movingobjectposition.f.b, movingobjectposition.f.c);
    }
    if (!this.l.z) {
      Entity entity = null;
      List list = this.l.b(((Entity) (this)), z.a(s, t, u).b(1.0D, 1.0D, 1.0D));
      double d1 = 0.0D;

      for (int l = 0; l < list.size(); l++) {
        Entity entity1 = (Entity) list.get(l);

        if (!entity1.c_() || entity1 == ak && am < 5) {
          continue;
        }
        float f4 = 0.3F;
        AxisAlignedBB axisalignedbb = entity1.z.b(f4, f4, f4);
        MovingObjectPosition movingobjectposition1 = axisalignedbb.a(vec3d, vec3d1);

        if (movingobjectposition1 == null) {
          continue;
        }
        double d2 = vec3d.a(movingobjectposition1.f);

        if (d2 < d1 || d1 == 0.0D) {
          entity = entity1;
          d1 = d2;
        }
      }

      if (entity != null) {
        movingobjectposition = new MovingObjectPosition(entity);
      }
    }
    if (movingobjectposition != null) {
      if (movingobjectposition.g != null) {
        if (!movingobjectposition.g.a(((Entity) (ak)), 0)) {;
        }
      }
      if (!this.l.z && W.nextInt(8) == 0) {
        byte byte0 = 1;

        if (W.nextInt(32) == 0) {
          byte0 = 4;
        }
        for (int k = 0; k < byte0; k++) {
          EntityChicken entitychicken = new EntityChicken(this.l);

          entitychicken.c(p, q, r, v, 0.0F);
          this.l.a(((Entity) (entitychicken)));
        }
      }
      for (int j = 0; j < 8; j++) {
        this.l.a("snowballpoof", p, q, r, 0.0D, 0.0D, 0.0D);
      }

      q();
    }
    p += s;
    q += t;
    r += u;
    float f1 = MathHelper.a(s * s + u * u);

    v = (float) ((Math.atan2(s, u) * 180D) / 3.1415927410125732D);
    for (w = (float) ((Math.atan2(t, f1) * 180D) / 3.1415927410125732D);
        w - y < -180F;
        y -= 360F) {;
    }
    for (; w - y >= 180F; y += 360F) {;
    }
    for (; v - x < -180F; x -= 360F) {;
    }
    for (; v - x >= 180F; x += 360F) {;
    }
    w = y + (w - y) * 0.2F;
    v = x + (v - x) * 0.2F;
    float f2 = 0.99F;
    float f5 = 0.03F;

    if (v()) {
      for (int i1 = 0; i1 < 4; i1++) {
        float f3 = 0.25F;

        this.l.a("bubble", p - s * (double) f3, q - t * (double) f3, r - u * (double) f3, s, t, u);
      }

      f2 = 0.8F;
    }
    s *= f2;
    t *= f2;
    u *= f2;
    t -= f5;
    a(p, q, r);
  }