Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.37 KB | None | 0 0
  1. import java.util.List;
  2. import java.util.Random;
  3.  
  4. public class Magic extends lr {
  5. private int b = -1;
  6. private int c = -1;
  7. private int d = -1;
  8. private int e = 0;
  9. private boolean f = false;
  10. public int a = 0;
  11. private hc g;
  12. private int h;
  13. private int i = 0;
  14.  
  15. public Magic(cw paramcw) {
  16. super(paramcw);
  17. a(0.25F, 0.25F);
  18. }
  19.  
  20. public Magic(cw paramcw, hc paramhc)
  21. {
  22. super(paramcw);
  23. this.g = paramhc;
  24.  
  25. a(0.25F, 0.25F);
  26. c(paramhc.av, paramhc.aw, paramhc.ax, paramhc.aB, paramhc.aC);
  27.  
  28. this.av -= fg.b(this.aB / 180.0F * 3.141593F) * 0.16F;
  29. this.aw -= 0.1000000014901161D;
  30. this.ax -= fg.a(this.aB / 180.0F * 3.141593F) * 0.16F;
  31. b(this.av, this.aw, this.ax);
  32. this.aM = 0.0F;
  33.  
  34. float f1 = 0.8F;
  35. this.ay = (-fg.a(this.aB / 180.0F * 3.141593F) * fg.b(this.aC / 180.0F * 3.141593F) * f1);
  36. this.aA = (fg.b(this.aB / 180.0F * 3.141593F) * fg.b(this.aC / 180.0F * 3.141593F) * f1);
  37. this.az = (-fg.a(this.aC / 180.0F * 3.141593F) * f1);
  38.  
  39. a(this.ay, this.az, this.aA, 1.5F, 1.0F);
  40. }
  41.  
  42.  
  43. public void b(dz paramdz) {
  44.  
  45. if ((this.f) && (this.g == paramdz) && (this.a <= 0) &&
  46. (paramdz.e.a(new fn(dv.j.aW, 1)))) {
  47. this.ar.a(this, "random.pop", 0.2F, ((this.bb.nextFloat() - this.bb.nextFloat()) * 0.7F + 1.0F) * 2.0F);
  48. paramdz.b(this, 1);
  49. I();
  50. }
  51. }
  52.  
  53.  
  54. public void e_() {
  55. super.e_();
  56.  
  57. if (this.a > 0) this.a -= 1;
  58.  
  59. if (this.f)
  60. {
  61. int j = this.ar.a(this.b, this.c, this.d);
  62. if (j != this.e) {
  63. this.f = false;
  64.  
  65. this.ay *= this.bb.nextFloat() * 0.2F;
  66. this.az *= this.bb.nextFloat() * 0.2F;
  67. this.aA *= this.bb.nextFloat() * 0.2F;
  68. this.h = 0;
  69. this.i = 0;
  70. } else {
  71. this.h += 1;
  72. if (this.h == 1200) I();
  73. return;
  74. }
  75. } else {
  76. this.i += 1;
  77. }
  78. ao staticao=null;
  79. ao localao1 = staticao.b(this.av, this.aw, this.ax);
  80. ao localao2 = staticao.b(this.av + this.ay, this.aw + this.az, this.ax + this.aA);
  81. ns localns1 = this.ar.a(localao1, localao2);
  82.  
  83. localao1 = staticao.b(this.av, this.aw, this.ax);
  84. localao2 = staticao.b(this.av + this.ay, this.aw + this.az, this.ax + this.aA);
  85. if (localns1 != null) {
  86. localao2 = staticao.b(localns1.f.a, localns1.f.b, localns1.f.c);
  87. }
  88. Object localObject = null;
  89. List localList = this.ar.b(this, this.aF.a(this.ay, this.az, this.aA).b(1.0D, 1.0D, 1.0D));
  90. double d1 = 0.0D;
  91. for (int k = 0; k < localList.size(); k++) {
  92. lr locallr = (lr)localList.get(k);
  93. if ((!locallr.m_()) || ((locallr == this.g) && (this.i < 25)))
  94. continue;
  95. float f3 = 0.3F;
  96. cn localcn = locallr.aF.b(f3, f3, f3);
  97. ns localns2 = localcn.a(localao1, localao2);
  98. if (localns2 != null) {
  99. double d2 = localao1.c(localns2.f);
  100. if ((d2 < d1) || (d1 == 0.0D)) {
  101. localObject = locallr;
  102. d1 = d2;
  103. }
  104. }
  105. }
  106.  
  107. if (localObject != null) {
  108.  
  109. localns1 = new ns((lr)localObject);
  110. }
  111.  
  112. if(localns1 != null && localns1.g != null && localns1.g != g)
  113. {
  114. localns1.g.a(g, 4);
  115. for(int l = 0; l < 8; l++)
  116. ar.a("snowballpoof", av, aw, ax, 0.0D, 0.0D, 0.0D);
  117.  
  118. I();
  119. }
  120.  
  121.  
  122. this.av += this.ay;
  123. this.aw += this.az;
  124. this.ax += this.aA;
  125.  
  126. float f1 = fg.a(this.ay * this.ay + this.aA * this.aA);
  127. this.aB = (float)(Math.atan2(this.ay, this.aA) * 180.0D / 3.141592741012573D);
  128. this.aC = (float)(Math.atan2(this.az, f1) * 180.0D / 3.141592741012573D);
  129.  
  130. while (this.aC - this.aE < -180.0F)
  131. this.aE -= 360.0F;
  132. while (this.aC - this.aE >= 180.0F) {
  133. this.aE += 360.0F;
  134. }
  135. while (this.aB - this.aD < -180.0F)
  136. this.aD -= 360.0F;
  137. while (this.aB - this.aD >= 180.0F) {
  138. this.aD += 360.0F;
  139. }
  140. this.aC = (this.aE + (this.aC - this.aE) * 0.2F);
  141. this.aB = (this.aD + (this.aB - this.aD) * 0.2F);
  142.  
  143. float f2 = 1F;
  144. float f3 = 0F;
  145.  
  146. if (g_()) {
  147. for (int m = 0; m < 4; m++) {
  148. float f4 = 1F;
  149. 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);
  150. }
  151. f2 = 1F;
  152. }
  153.  
  154. this.ay *= f2;
  155. this.az *= f2;
  156. this.aA *= f2;
  157. this.az -= f3;
  158.  
  159. b(this.av, this.aw, this.ax);
  160. }
  161.  
  162.  
  163. public boolean a(double paramDouble) {
  164. double d1 = this.aF.b() * 4.0D;
  165. d1 *= 64.0D;
  166. return paramDouble < d1 * d1;
  167. }
  168.  
  169.  
  170. public void a(double paramDouble1, double paramDouble2, double paramDouble3, float paramFloat1, float paramFloat2) {
  171. float f1 = fg.a(paramDouble1 * paramDouble1 + paramDouble2 * paramDouble2 + paramDouble3 * paramDouble3);
  172.  
  173. paramDouble1 /= f1;
  174. paramDouble2 /= f1;
  175. paramDouble3 /= f1;
  176.  
  177. paramDouble1 += this.bb.nextGaussian() * 0.007499999832361937D * paramFloat2;
  178. paramDouble2 += this.bb.nextGaussian() * 0.007499999832361937D * paramFloat2;
  179. paramDouble3 += this.bb.nextGaussian() * 0.007499999832361937D * paramFloat2;
  180.  
  181. paramDouble1 *= paramFloat1;
  182. paramDouble2 *= paramFloat1;
  183. paramDouble3 *= paramFloat1;
  184.  
  185. this.ay = paramDouble1;
  186. this.az = paramDouble2;
  187. this.aA = paramDouble3;
  188.  
  189. float f2 = fg.a(paramDouble1 * paramDouble1 + paramDouble3 * paramDouble3);
  190.  
  191. this.aD = (this.aB = (float)(Math.atan2(paramDouble1, paramDouble3) * 180.0D / 3.141592741012573D));
  192. this.aE = (this.aC = (float)(Math.atan2(paramDouble2, f2) * 180.0D / 3.141592741012573D));
  193. this.h = 0;
  194. }
  195.  
  196.  
  197.  
  198. public void a(in paramin) {
  199. paramin.a("xTile", (short)this.b);
  200. paramin.a("yTile", (short)this.c);
  201. paramin.a("zTile", (short)this.d);
  202. paramin.a("inTile", (byte)this.e);
  203. paramin.a("shake", (byte)this.a);
  204. paramin.a("inGround", (byte)(this.f ? 1 : 0));
  205. }
  206.  
  207. public void b(in paramin) {
  208. this.b = paramin.d("xTile");
  209. this.c = paramin.d("yTile");
  210. this.d = paramin.d("zTile");
  211. this.e = (paramin.c("inTile") & 0xFF);
  212. this.a = (paramin.c("shake") & 0xFF);
  213. this.f = (paramin.c("inGround") == 1);
  214. }
  215.  
  216.  
  217. public float h_()
  218. {
  219. return 0.0F;
  220. }
  221.  
  222.  
  223.  
  224.  
  225. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement