Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.List;
- import java.util.Random;
- public class Magic extends lr {
- private int b = -1;
- private int c = -1;
- private int d = -1;
- private int e = 0;
- private boolean f = false;
- public int a = 0;
- private hc g;
- private int h;
- private int i = 0;
- public Magic(cw paramcw) {
- super(paramcw);
- a(0.25F, 0.25F);
- }
- public Magic(cw paramcw, hc paramhc)
- {
- super(paramcw);
- this.g = paramhc;
- a(0.25F, 0.25F);
- c(paramhc.av, paramhc.aw, paramhc.ax, paramhc.aB, paramhc.aC);
- this.av -= fg.b(this.aB / 180.0F * 3.141593F) * 0.16F;
- this.aw -= 0.1000000014901161D;
- this.ax -= fg.a(this.aB / 180.0F * 3.141593F) * 0.16F;
- b(this.av, this.aw, this.ax);
- this.aM = 0.0F;
- float f1 = 0.8F;
- this.ay = (-fg.a(this.aB / 180.0F * 3.141593F) * fg.b(this.aC / 180.0F * 3.141593F) * f1);
- this.aA = (fg.b(this.aB / 180.0F * 3.141593F) * fg.b(this.aC / 180.0F * 3.141593F) * f1);
- this.az = (-fg.a(this.aC / 180.0F * 3.141593F) * f1);
- a(this.ay, this.az, this.aA, 1.5F, 1.0F);
- }
- public void b(dz paramdz) {
- if ((this.f) && (this.g == paramdz) && (this.a <= 0) &&
- (paramdz.e.a(new fn(dv.j.aW, 1)))) {
- this.ar.a(this, "random.pop", 0.2F, ((this.bb.nextFloat() - this.bb.nextFloat()) * 0.7F + 1.0F) * 2.0F);
- paramdz.b(this, 1);
- I();
- }
- }
- public void e_() {
- super.e_();
- if (this.a > 0) this.a -= 1;
- if (this.f)
- {
- int j = this.ar.a(this.b, this.c, this.d);
- if (j != this.e) {
- this.f = false;
- this.ay *= this.bb.nextFloat() * 0.2F;
- this.az *= this.bb.nextFloat() * 0.2F;
- this.aA *= this.bb.nextFloat() * 0.2F;
- this.h = 0;
- this.i = 0;
- } else {
- this.h += 1;
- if (this.h == 1200) I();
- return;
- }
- } else {
- this.i += 1;
- }
- ao staticao=null;
- ao localao1 = staticao.b(this.av, this.aw, this.ax);
- ao localao2 = staticao.b(this.av + this.ay, this.aw + this.az, this.ax + this.aA);
- ns localns1 = this.ar.a(localao1, localao2);
- localao1 = staticao.b(this.av, this.aw, this.ax);
- localao2 = staticao.b(this.av + this.ay, this.aw + this.az, this.ax + this.aA);
- if (localns1 != null) {
- localao2 = staticao.b(localns1.f.a, localns1.f.b, localns1.f.c);
- }
- Object localObject = null;
- List localList = this.ar.b(this, this.aF.a(this.ay, this.az, this.aA).b(1.0D, 1.0D, 1.0D));
- double d1 = 0.0D;
- for (int k = 0; k < localList.size(); k++) {
- lr locallr = (lr)localList.get(k);
- if ((!locallr.m_()) || ((locallr == this.g) && (this.i < 25)))
- continue;
- float f3 = 0.3F;
- cn localcn = locallr.aF.b(f3, f3, f3);
- ns localns2 = localcn.a(localao1, localao2);
- if (localns2 != null) {
- double d2 = localao1.c(localns2.f);
- if ((d2 < d1) || (d1 == 0.0D)) {
- localObject = locallr;
- d1 = d2;
- }
- }
- }
- if (localObject != null) {
- localns1 = new ns((lr)localObject);
- }
- if(localns1 != null && localns1.g != null && localns1.g != g)
- {
- localns1.g.a(g, 4);
- for(int l = 0; l < 8; l++)
- ar.a("snowballpoof", av, aw, ax, 0.0D, 0.0D, 0.0D);
- I();
- }
- this.av += this.ay;
- this.aw += this.az;
- this.ax += this.aA;
- float f1 = fg.a(this.ay * this.ay + this.aA * this.aA);
- this.aB = (float)(Math.atan2(this.ay, this.aA) * 180.0D / 3.141592741012573D);
- this.aC = (float)(Math.atan2(this.az, f1) * 180.0D / 3.141592741012573D);
- while (this.aC - this.aE < -180.0F)
- this.aE -= 360.0F;
- while (this.aC - this.aE >= 180.0F) {
- this.aE += 360.0F;
- }
- while (this.aB - this.aD < -180.0F)
- this.aD -= 360.0F;
- while (this.aB - this.aD >= 180.0F) {
- this.aD += 360.0F;
- }
- this.aC = (this.aE + (this.aC - this.aE) * 0.2F);
- this.aB = (this.aD + (this.aB - this.aD) * 0.2F);
- float f2 = 1F;
- float f3 = 0F;
- if (g_()) {
- for (int m = 0; m < 4; m++) {
- float f4 = 1F;
- this.ar.a("bubble", this.av - this.ay * f4, this.aw - this.az * f4, this.ax - this.aA * f4, this.ay, this.az, this.aA);
- }
- f2 = 1F;
- }
- this.ay *= f2;
- this.az *= f2;
- this.aA *= f2;
- this.az -= f3;
- b(this.av, this.aw, this.ax);
- }
- public boolean a(double paramDouble) {
- double d1 = this.aF.b() * 4.0D;
- d1 *= 64.0D;
- return paramDouble < d1 * d1;
- }
- public void a(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) {
- float f1 = fg.a(paramDouble1 * paramDouble1 + paramDouble2 * paramDouble2 + paramDouble3 * paramDouble3);
- paramDouble1 /= f1;
- paramDouble2 /= f1;
- paramDouble3 /= f1;
- paramDouble1 += this.bb.nextGaussian() * 0.007499999832361937D * paramFloat2;
- paramDouble2 += this.bb.nextGaussian() * 0.007499999832361937D * paramFloat2;
- paramDouble3 += this.bb.nextGaussian() * 0.007499999832361937D * paramFloat2;
- paramDouble1 *= paramFloat1;
- paramDouble2 *= paramFloat1;
- paramDouble3 *= paramFloat1;
- this.ay = paramDouble1;
- this.az = paramDouble2;
- this.aA = paramDouble3;
- float f2 = fg.a(paramDouble1 * paramDouble1 + paramDouble3 * paramDouble3);
- this.aD = (this.aB = (float)(Math.atan2(paramDouble1, paramDouble3) * 180.0D / 3.141592741012573D));
- this.aE = (this.aC = (float)(Math.atan2(paramDouble2, f2) * 180.0D / 3.141592741012573D));
- this.h = 0;
- }
- public void a(in paramin) {
- paramin.a("xTile", (short)this.b);
- paramin.a("yTile", (short)this.c);
- paramin.a("zTile", (short)this.d);
- paramin.a("inTile", (byte)this.e);
- paramin.a("shake", (byte)this.a);
- paramin.a("inGround", (byte)(this.f ? 1 : 0));
- }
- public void b(in paramin) {
- this.b = paramin.d("xTile");
- this.c = paramin.d("yTile");
- this.d = paramin.d("zTile");
- this.e = (paramin.c("inTile") & 0xFF);
- this.a = (paramin.c("shake") & 0xFF);
- this.f = (paramin.c("inGround") == 1);
- }
- public float h_()
- {
- return 0.0F;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement