Exemplo n.º 1
0
 public EntityFireball(
     World p_i3572_1_,
     double p_i3572_2_,
     double p_i3572_4_,
     double p_i3572_6_,
     double p_i3572_8_,
     double p_i3572_10_,
     double p_i3572_12_) {
   super(p_i3572_1_);
   field_70231_e = -1;
   field_70228_f = -1;
   field_70229_g = -1;
   field_70237_h = 0;
   field_70238_i = false;
   field_70234_an = 0;
   func_70105_a(1.0F, 1.0F);
   func_70012_b(p_i3572_2_, p_i3572_4_, p_i3572_6_, field_70177_z, field_70125_A);
   func_70107_b(p_i3572_2_, p_i3572_4_, p_i3572_6_);
   double d =
       MathHelper.func_76133_a(
           p_i3572_8_ * p_i3572_8_ + p_i3572_10_ * p_i3572_10_ + p_i3572_12_ * p_i3572_12_);
   field_70232_b = (p_i3572_8_ / d) * 0.10000000000000001D;
   field_70233_c = (p_i3572_10_ / d) * 0.10000000000000001D;
   field_70230_d = (p_i3572_12_ / d) * 0.10000000000000001D;
 }
Exemplo n.º 2
0
 public EntityFireball(
     World p_i3573_1_,
     EntityLiving p_i3573_2_,
     double p_i3573_3_,
     double p_i3573_5_,
     double p_i3573_7_) {
   super(p_i3573_1_);
   field_70231_e = -1;
   field_70228_f = -1;
   field_70229_g = -1;
   field_70237_h = 0;
   field_70238_i = false;
   field_70234_an = 0;
   field_70235_a = p_i3573_2_;
   func_70105_a(1.0F, 1.0F);
   func_70012_b(
       p_i3573_2_.field_70165_t,
       p_i3573_2_.field_70163_u,
       p_i3573_2_.field_70161_v,
       p_i3573_2_.field_70177_z,
       p_i3573_2_.field_70125_A);
   func_70107_b(field_70165_t, field_70163_u, field_70161_v);
   field_70129_M = 0.0F;
   field_70159_w = field_70181_x = field_70179_y = 0.0D;
   p_i3573_3_ += field_70146_Z.nextGaussian() * 0.40000000000000002D;
   p_i3573_5_ += field_70146_Z.nextGaussian() * 0.40000000000000002D;
   p_i3573_7_ += field_70146_Z.nextGaussian() * 0.40000000000000002D;
   double d =
       MathHelper.func_76133_a(
           p_i3573_3_ * p_i3573_3_ + p_i3573_5_ * p_i3573_5_ + p_i3573_7_ * p_i3573_7_);
   field_70232_b = (p_i3573_3_ / d) * 0.10000000000000001D;
   field_70233_c = (p_i3573_5_ / d) * 0.10000000000000001D;
   field_70230_d = (p_i3573_7_ / d) * 0.10000000000000001D;
 }
Exemplo n.º 3
0
 public EntityFX(
     World p_i3154_1_,
     double p_i3154_2_,
     double p_i3154_4_,
     double p_i3154_6_,
     double p_i3154_8_,
     double p_i3154_10_,
     double p_i3154_12_) {
   super(p_i3154_1_);
   this.func_70105_a(0.2F, 0.2F);
   this.field_70129_M = this.field_70131_O / 2.0F;
   this.func_70107_b(p_i3154_2_, p_i3154_4_, p_i3154_6_);
   this.field_70552_h = this.field_70553_i = this.field_70551_j = 1.0F;
   this.field_70159_w = p_i3154_8_ + (double) ((float) (Math.random() * 2.0D - 1.0D) * 0.4F);
   this.field_70181_x = p_i3154_10_ + (double) ((float) (Math.random() * 2.0D - 1.0D) * 0.4F);
   this.field_70179_y = p_i3154_12_ + (double) ((float) (Math.random() * 2.0D - 1.0D) * 0.4F);
   float var14 = (float) (Math.random() + Math.random() + 1.0D) * 0.15F;
   float var15 =
       MathHelper.func_76133_a(
           this.field_70159_w * this.field_70159_w
               + this.field_70181_x * this.field_70181_x
               + this.field_70179_y * this.field_70179_y);
   this.field_70159_w = this.field_70159_w / (double) var15 * (double) var14 * 0.4000000059604645D;
   this.field_70181_x =
       this.field_70181_x / (double) var15 * (double) var14 * 0.4000000059604645D
           + 0.10000000149011612D;
   this.field_70179_y = this.field_70179_y / (double) var15 * (double) var14 * 0.4000000059604645D;
   this.field_70548_b = this.field_70146_Z.nextFloat() * 3.0F;
   this.field_70549_c = this.field_70146_Z.nextFloat() * 3.0F;
   this.field_70544_f = (this.field_70146_Z.nextFloat() * 0.5F + 0.5F) * 2.0F;
   this.field_70547_e = (int) (4.0F / (this.field_70146_Z.nextFloat() * 0.9F + 0.1F));
   this.field_70546_d = 0;
 }
Exemplo n.º 4
0
  public void func_70071_h_() {
    if (!field_70170_p.field_72995_K
        && (field_70235_a != null && field_70235_a.field_70128_L
            || !field_70170_p.func_72899_e(
                (int) field_70165_t, (int) field_70163_u, (int) field_70161_v))) {
      func_70106_y();
      return;
    }
    super.func_70071_h_();
    func_70015_d(1);
    if (field_70238_i) {
      int i = field_70170_p.func_72798_a(field_70231_e, field_70228_f, field_70229_g);
      if (i == field_70237_h) {
        field_70236_j++;
        if (field_70236_j == 600) {
          func_70106_y();
        }
        return;
      }
      field_70238_i = false;
      field_70159_w *= field_70146_Z.nextFloat() * 0.2F;
      field_70181_x *= field_70146_Z.nextFloat() * 0.2F;
      field_70179_y *= field_70146_Z.nextFloat() * 0.2F;
      field_70236_j = 0;
      field_70234_an = 0;
    } else {
      field_70234_an++;
    }
    Vec3 vec3 = Vec3.func_72437_a().func_72345_a(field_70165_t, field_70163_u, field_70161_v);
    Vec3 vec3_1 =
        Vec3.func_72437_a()
            .func_72345_a(
                field_70165_t + field_70159_w,
                field_70163_u + field_70181_x,
                field_70161_v + field_70179_y);
    MovingObjectPosition movingobjectposition = field_70170_p.func_72933_a(vec3, vec3_1);
    vec3 = Vec3.func_72437_a().func_72345_a(field_70165_t, field_70163_u, field_70161_v);
    vec3_1 =
        Vec3.func_72437_a()
            .func_72345_a(
                field_70165_t + field_70159_w,
                field_70163_u + field_70181_x,
                field_70161_v + field_70179_y);
    if (movingobjectposition != null) {
      vec3_1 =
          Vec3.func_72437_a()
              .func_72345_a(
                  movingobjectposition.field_72307_f.field_72450_a,
                  movingobjectposition.field_72307_f.field_72448_b,
                  movingobjectposition.field_72307_f.field_72449_c);
    }
    Entity entity = null;
    List list =
        field_70170_p.func_72839_b(
            this,
            field_70121_D
                .func_72321_a(field_70159_w, field_70181_x, field_70179_y)
                .func_72314_b(1.0D, 1.0D, 1.0D));
    double d = 0.0D;
    Iterator iterator = list.iterator();
    do {
      if (!iterator.hasNext()) {
        break;
      }
      Entity entity1 = (Entity) iterator.next();
      if (entity1.func_70067_L()
          && (!entity1.func_70028_i(field_70235_a) || field_70234_an >= 25)) {
        float f2 = 0.3F;
        AxisAlignedBB axisalignedbb = entity1.field_70121_D.func_72314_b(f2, f2, f2);
        MovingObjectPosition movingobjectposition1 = axisalignedbb.func_72327_a(vec3, vec3_1);
        if (movingobjectposition1 != null) {
          double d1 = vec3.func_72438_d(movingobjectposition1.field_72307_f);
          if (d1 < d || d == 0.0D) {
            entity = entity1;
            d = d1;
          }
        }
      }
    } while (true);
    if (entity != null) {
      movingobjectposition = new MovingObjectPosition(entity);
    }
    if (movingobjectposition != null) {
      func_70227_a(movingobjectposition);
    }
    field_70165_t += field_70159_w;
    field_70163_u += field_70181_x;
    field_70161_v += field_70179_y;
    float f =
        MathHelper.func_76133_a(field_70159_w * field_70159_w + field_70179_y * field_70179_y);
    field_70177_z =
        (float) ((Math.atan2(field_70159_w, field_70179_y) * 180D) / 3.1415927410125732D);
    for (field_70125_A = (float) ((Math.atan2(field_70181_x, f) * 180D) / 3.1415927410125732D);
        field_70125_A - field_70127_C < -180F;
        field_70127_C -= 360F) {}
    for (; field_70125_A - field_70127_C >= 180F; field_70127_C += 360F) {}
    for (; field_70177_z - field_70126_B < -180F; field_70126_B -= 360F) {}
    for (; field_70177_z - field_70126_B >= 180F; field_70126_B += 360F) {}
    field_70125_A = field_70127_C + (field_70125_A - field_70127_C) * 0.2F;
    field_70177_z = field_70126_B + (field_70177_z - field_70126_B) * 0.2F;
    float f1 = 0.95F;
    if (func_70090_H()) {
      for (int j = 0; j < 4; j++) {
        float f3 = 0.25F;
        field_70170_p.func_72869_a(
            "bubble",
            field_70165_t - field_70159_w * (double) f3,
            field_70163_u - field_70181_x * (double) f3,
            field_70161_v - field_70179_y * (double) f3,
            field_70159_w,
            field_70181_x,
            field_70179_y);
      }

      f1 = 0.8F;
    }
    field_70159_w += field_70232_b;
    field_70181_x += field_70233_c;
    field_70179_y += field_70230_d;
    field_70159_w *= f1;
    field_70181_x *= f1;
    field_70179_y *= f1;
    field_70170_p.func_72869_a(
        "smoke", field_70165_t, field_70163_u + 0.5D, field_70161_v, 0.0D, 0.0D, 0.0D);
    func_70107_b(field_70165_t, field_70163_u, field_70161_v);
  }
Exemplo n.º 5
0
  public void func_77278_a() {
    float f = field_77280_f;
    HashSet hashset = new HashSet();
    for (int i = 0; i < field_77289_h; i++) {
      for (int k = 0; k < field_77289_h; k++) {
        label0:
        for (int i1 = 0; i1 < field_77289_h; i1++) {
          if (i != 0
              && i != field_77289_h - 1
              && k != 0
              && k != field_77289_h - 1
              && i1 != 0
              && i1 != field_77289_h - 1) {
            continue;
          }
          double d = ((float) i / ((float) field_77289_h - 1.0F)) * 2.0F - 1.0F;
          double d1 = ((float) k / ((float) field_77289_h - 1.0F)) * 2.0F - 1.0F;
          double d2 = ((float) i1 / ((float) field_77289_h - 1.0F)) * 2.0F - 1.0F;
          double d3 = Math.sqrt(d * d + d1 * d1 + d2 * d2);
          d /= d3;
          d1 /= d3;
          d2 /= d3;
          float f1 = field_77280_f * (0.7F + field_77287_j.field_73012_v.nextFloat() * 0.6F);
          double d5 = field_77284_b;
          double d7 = field_77285_c;
          double d9 = field_77282_d;
          float f2 = 0.3F;
          do {
            if (f1 <= 0.0F) {
              continue label0;
            }
            int k2 = MathHelper.func_76128_c(d5);
            int l2 = MathHelper.func_76128_c(d7);
            int i3 = MathHelper.func_76128_c(d9);
            int j3 = field_77287_j.func_72798_a(k2, l2, i3);
            if (j3 > 0) {
              f1 -= (Block.field_71973_m[j3].func_71904_a(field_77283_e) + 0.3F) * f2;
            }
            if (f1 > 0.0F) {
              hashset.add(new ChunkPosition(k2, l2, i3));
            }
            d5 += d * (double) f2;
            d7 += d1 * (double) f2;
            d9 += d2 * (double) f2;
            f1 -= f2 * 0.75F;
          } while (true);
        }
      }
    }

    field_77281_g.addAll(hashset);
    field_77280_f *= 2.0F;
    int j = MathHelper.func_76128_c(field_77284_b - (double) field_77280_f - 1.0D);
    int l = MathHelper.func_76128_c(field_77284_b + (double) field_77280_f + 1.0D);
    int j1 = MathHelper.func_76128_c(field_77285_c - (double) field_77280_f - 1.0D);
    int k1 = MathHelper.func_76128_c(field_77285_c + (double) field_77280_f + 1.0D);
    int l1 = MathHelper.func_76128_c(field_77282_d - (double) field_77280_f - 1.0D);
    int i2 = MathHelper.func_76128_c(field_77282_d + (double) field_77280_f + 1.0D);
    List list =
        field_77287_j.func_72839_b(
            field_77283_e, AxisAlignedBB.func_72332_a().func_72299_a(j, j1, l1, l, k1, i2));
    Vec3 vec3 = Vec3.func_72437_a().func_72345_a(field_77284_b, field_77285_c, field_77282_d);
    for (int j2 = 0; j2 < list.size(); j2++) {
      Entity entity = (Entity) list.get(j2);
      double d4 =
          entity.func_70011_f(field_77284_b, field_77285_c, field_77282_d) / (double) field_77280_f;
      if (d4 > 1.0D) {
        continue;
      }
      double d6 = entity.field_70165_t - field_77284_b;
      double d8 = (entity.field_70163_u + (double) entity.func_70047_e()) - field_77285_c;
      double d10 = entity.field_70161_v - field_77282_d;
      double d11 = MathHelper.func_76133_a(d6 * d6 + d8 * d8 + d10 * d10);
      if (d11 == 0.0D) {
        continue;
      }
      d6 /= d11;
      d8 /= d11;
      d10 /= d11;
      double d12 = field_77287_j.func_72842_a(vec3, entity.field_70121_D);
      double d13 = (1.0D - d4) * d12;
      entity.func_70097_a(
          DamageSource.field_76378_k,
          (int) (((d13 * d13 + d13) / 2D) * 8D * (double) field_77280_f + 1.0D));
      entity.field_70159_w += d6 * d13;
      entity.field_70181_x += d8 * d13;
      entity.field_70179_y += d10 * d13;
      if (entity instanceof EntityPlayer) {
        field_77288_k.put(
            (EntityPlayer) entity, Vec3.func_72437_a().func_72345_a(d6 * d13, d8 * d13, d10 * d13));
      }
    }

    field_77280_f = f;
  }
Exemplo n.º 6
0
 public void func_77279_a(boolean p_77279_1_) {
   field_77287_j.func_72908_a(
       field_77284_b,
       field_77285_c,
       field_77282_d,
       "random.explode",
       4F,
       (1.0F
               + (field_77287_j.field_73012_v.nextFloat()
                       - field_77287_j.field_73012_v.nextFloat())
                   * 0.2F)
           * 0.7F);
   field_77287_j.func_72869_a(
       "hugeexplosion", field_77284_b, field_77285_c, field_77282_d, 0.0D, 0.0D, 0.0D);
   Iterator iterator = field_77281_g.iterator();
   do {
     if (!iterator.hasNext()) {
       break;
     }
     ChunkPosition chunkposition = (ChunkPosition) iterator.next();
     int i = chunkposition.field_76930_a;
     int k = chunkposition.field_76928_b;
     int i1 = chunkposition.field_76929_c;
     int k1 = field_77287_j.func_72798_a(i, k, i1);
     if (p_77279_1_) {
       double d = (float) i + field_77287_j.field_73012_v.nextFloat();
       double d1 = (float) k + field_77287_j.field_73012_v.nextFloat();
       double d2 = (float) i1 + field_77287_j.field_73012_v.nextFloat();
       double d3 = d - field_77284_b;
       double d4 = d1 - field_77285_c;
       double d5 = d2 - field_77282_d;
       double d6 = MathHelper.func_76133_a(d3 * d3 + d4 * d4 + d5 * d5);
       d3 /= d6;
       d4 /= d6;
       d5 /= d6;
       double d7 = 0.5D / (d6 / (double) field_77280_f + 0.10000000000000001D);
       d7 *=
           field_77287_j.field_73012_v.nextFloat() * field_77287_j.field_73012_v.nextFloat()
               + 0.3F;
       d3 *= d7;
       d4 *= d7;
       d5 *= d7;
       field_77287_j.func_72869_a(
           "explode",
           (d + field_77284_b * 1.0D) / 2D,
           (d1 + field_77285_c * 1.0D) / 2D,
           (d2 + field_77282_d * 1.0D) / 2D,
           d3,
           d4,
           d5);
       field_77287_j.func_72869_a("smoke", d, d1, d2, d3, d4, d5);
     }
     if (k1 > 0) {
       Block.field_71973_m[k1].func_71914_a(
           field_77287_j, i, k, i1, field_77287_j.func_72805_g(i, k, i1), 0.3F, 0);
       if (field_77287_j.func_72930_a(i, k, i1, 0, 0, field_77287_j.field_72995_K)) {
         field_77287_j.func_72898_h(i, k, i1, 0);
       }
       Block.field_71973_m[k1].func_71867_k(field_77287_j, i, k, i1);
     }
   } while (true);
   if (field_77286_a) {
     Iterator iterator1 = field_77281_g.iterator();
     do {
       if (!iterator1.hasNext()) {
         break;
       }
       ChunkPosition chunkposition1 = (ChunkPosition) iterator1.next();
       int j = chunkposition1.field_76930_a;
       int l = chunkposition1.field_76928_b;
       int j1 = chunkposition1.field_76929_c;
       int l1 = field_77287_j.func_72798_a(j, l, j1);
       int i2 = field_77287_j.func_72798_a(j, l - 1, j1);
       if (l1 == 0 && Block.field_71970_n[i2] && field_77290_i.nextInt(3) == 0) {
         field_77287_j.func_72859_e(j, l, j1, Block.field_72067_ar.field_71990_ca);
       }
     } while (true);
   }
 }
Exemplo n.º 7
0
  public void func_70108_f(Entity p_70108_1_) {
    if (!this.field_70170_p.field_72995_K) {
      if (p_70108_1_ != this.field_70153_n) {
        if (p_70108_1_ instanceof EntityLiving
            && !(p_70108_1_ instanceof EntityPlayer)
            && !(p_70108_1_ instanceof EntityIronGolem)
            && this.func_94087_l() == 0
            && this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y
                > 0.01D
            && this.field_70153_n == null
            && p_70108_1_.field_70154_o == null) {
          p_70108_1_.func_70078_a(this);
        }

        double var2 = p_70108_1_.field_70165_t - this.field_70165_t;
        double var4 = p_70108_1_.field_70161_v - this.field_70161_v;
        double var6 = var2 * var2 + var4 * var4;
        if (var6 >= 9.999999747378752E-5D) {
          var6 = (double) MathHelper.func_76133_a(var6);
          var2 /= var6;
          var4 /= var6;
          double var8 = 1.0D / var6;
          if (var8 > 1.0D) {
            var8 = 1.0D;
          }

          var2 *= var8;
          var4 *= var8;
          var2 *= 0.10000000149011612D;
          var4 *= 0.10000000149011612D;
          var2 *= (double) (1.0F - this.field_70144_Y);
          var4 *= (double) (1.0F - this.field_70144_Y);
          var2 *= 0.5D;
          var4 *= 0.5D;
          if (p_70108_1_ instanceof EntityMinecart) {
            double var10 = p_70108_1_.field_70165_t - this.field_70165_t;
            double var12 = p_70108_1_.field_70161_v - this.field_70161_v;
            Vec3 var14 =
                this.field_70170_p.func_82732_R().func_72345_a(var10, 0.0D, var12).func_72432_b();
            Vec3 var15 =
                this.field_70170_p
                    .func_82732_R()
                    .func_72345_a(
                        (double) MathHelper.func_76134_b(this.field_70177_z * 3.1415927F / 180.0F),
                        0.0D,
                        (double) MathHelper.func_76126_a(this.field_70177_z * 3.1415927F / 180.0F))
                    .func_72432_b();
            double var16 = Math.abs(var14.func_72430_b(var15));
            if (var16 < 0.800000011920929D) {
              return;
            }

            double var18 = p_70108_1_.field_70159_w + this.field_70159_w;
            double var20 = p_70108_1_.field_70179_y + this.field_70179_y;
            if (((EntityMinecart) p_70108_1_).func_94087_l() == 2 && this.func_94087_l() != 2) {
              this.field_70159_w *= 0.20000000298023224D;
              this.field_70179_y *= 0.20000000298023224D;
              this.func_70024_g(
                  p_70108_1_.field_70159_w - var2, 0.0D, p_70108_1_.field_70179_y - var4);
              p_70108_1_.field_70159_w *= 0.949999988079071D;
              p_70108_1_.field_70179_y *= 0.949999988079071D;
            } else if (((EntityMinecart) p_70108_1_).func_94087_l() != 2
                && this.func_94087_l() == 2) {
              p_70108_1_.field_70159_w *= 0.20000000298023224D;
              p_70108_1_.field_70179_y *= 0.20000000298023224D;
              p_70108_1_.func_70024_g(this.field_70159_w + var2, 0.0D, this.field_70179_y + var4);
              this.field_70159_w *= 0.949999988079071D;
              this.field_70179_y *= 0.949999988079071D;
            } else {
              var18 /= 2.0D;
              var20 /= 2.0D;
              this.field_70159_w *= 0.20000000298023224D;
              this.field_70179_y *= 0.20000000298023224D;
              this.func_70024_g(var18 - var2, 0.0D, var20 - var4);
              p_70108_1_.field_70159_w *= 0.20000000298023224D;
              p_70108_1_.field_70179_y *= 0.20000000298023224D;
              p_70108_1_.func_70024_g(var18 + var2, 0.0D, var20 + var4);
            }
          } else {
            this.func_70024_g(-var2, 0.0D, -var4);
            p_70108_1_.func_70024_g(var2 / 4.0D, 0.0D, var4 / 4.0D);
          }
        }
      }
    }
  }