Guest User

Untitled

a guest
Dec 8th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.93 KB | None | 0 0
  1. public void Sanity(Minecraft mc)
  2. {
  3. int X = (int)Math.floor(mc.field_71439_g.field_70165_t);
  4. int Y = (int)Math.floor(mc.field_71439_g.field_70163_u);
  5. int Z = (int)Math.floor(mc.field_71439_g.field_70161_v);
  6.  
  7.  
  8. List<EntityLiving> entities = mc.field_71441_e.func_94576_a(mc.field_71439_g, mc.field_71439_g.field_70121_D.func_72314_b(19.0D, 19.0D, 19.0D), EntityGrunt.field_82192_a);
  9.  
  10. EntityGrunt entitygrunt = null;
  11. EntityBrute entitybrute = null;
  12. boolean foundTarget = false;
  13. Iterator<EntityLiving> i = entities.iterator();
  14. while (i.hasNext())
  15. {
  16. Entity entity = (Entity)i.next();
  17. if ((entity instanceof EntityGrunt))
  18. {
  19. entitygrunt = (EntityGrunt)entity;
  20. if ((entitygrunt != null) && (mc.field_71439_g.func_70685_l(entitygrunt))) {
  21. foundTarget = true;
  22. }
  23. }
  24. else if ((entity instanceof EntityBrute))
  25. {
  26. entitybrute = (EntityBrute)entity;
  27. if ((entitybrute != null) && (mc.field_71439_g.func_70685_l(entitybrute))) {
  28. foundTarget = true;
  29. }
  30. }
  31. }
  32. if ((foundTarget) && (!mc.field_71439_g.field_71075_bZ.field_75098_d))
  33. {
  34. if ((numTicks % 20L == 0L) && (sanity > 0)) {
  35. sanity -= 1;
  36. }
  37. if (!chase) {
  38. try
  39. {
  40. if (!this.fear)
  41. {
  42. mc.field_71460_t.field_147707_d = new ShaderGroup(mc.func_110434_K(), mc.func_110442_L(), mc.func_147110_a(), new ResourceLocation("shaders/post/deconverge.json"));
  43. mc.field_71460_t.field_147707_d.func_148026_a(mc.field_71443_c, mc.field_71440_d);
  44. }
  45. ISound terror = new AmnesiaAttackSoundEvent("amnesia:sanity.Terror", mc.field_71439_g, 0.3F, 1.0F);
  46. mc.func_147118_V().func_147682_a(terror);
  47.  
  48. chase = true;
  49. }
  50. catch (IOException ioexception) {}
  51. }
  52. if (this.counter == 0)
  53. {
  54. if (entitygrunt != null)
  55. {
  56. ISound music = new AmnesiaAttackSoundEvent("amnesia:music.AttackGrunt", mc.field_71439_g, 0.8F, 1.0F);
  57. mc.func_147118_V().func_147682_a(music);
  58. wasGrunt = true;
  59. }
  60. else if (entitybrute != null)
  61. {
  62. ISound music = new AmnesiaAttackSoundEvent("amnesia:music.AttackBrute", mc.field_71439_g, 0.8F, 1.0F);
  63. mc.func_147118_V().func_147682_a(music);
  64. wasBrute = true;
  65. }
  66. this.counter = 100;
  67. }
  68. else if (this.counter != 100)
  69. {
  70. this.counter -= 1;
  71. }
  72. }
  73. else if (chase)
  74. {
  75. if (!this.fear) {
  76. mc.field_71460_t.field_147707_d = null;
  77. }
  78. this.counter = 50;
  79. if (wasGrunt)
  80. {
  81. if (!ExtendedPlayerPropertiesHandler.get(mc.field_71439_g).isMusicPlaying())
  82. {
  83. ISound music = new AmnesiaSearchSoundEvent("amnesia:music.SearchGrunt", mc.field_71439_g, 0.8F, 1.0F);
  84. mc.func_147118_V().func_147682_a(music);
  85. }
  86. wasGrunt = false;
  87. }
  88. else if (wasBrute)
  89. {
  90. if (!ExtendedPlayerPropertiesHandler.get(mc.field_71439_g).isMusicPlaying())
  91. {
  92. ISound music = new AmnesiaSearchSoundEvent("amnesia:music.SearchBrute", mc.field_71439_g, 0.8F, 1.0F);
  93. mc.func_147118_V().func_147682_a(music);
  94. }
  95. wasBrute = false;
  96. }
  97. chase = false;
  98. }
  99. if (!mc.field_71439_g.field_71075_bZ.field_75098_d)
  100. {
  101. if ((mc.field_71439_g.func_70013_c(1.0F) < 0.1F) && (numTicks % 40L == 0L) && (sanity > 0))
  102. {
  103. sanity -= 1;
  104. mc.field_71441_e.func_72980_b(X, Y, Z, "amnesia:sanity.Drain", 999.0F, 1.0F, false);
  105. }
  106. if ((mc.field_71439_g.func_70013_c(1.0F) > 0.1F) && (numTicks % 20L == 0L) && (sanity < 100) && (!chase)) {
  107. sanity += 1;
  108. }
  109. if (sanity < 5)
  110. {
  111. if (numTicks % 28L == 0L) {
  112. Amnesia.snw.sendToServer(new PotionEffectMessageHandler());
  113. }
  114. mc.field_71441_e.func_72980_b(X, Y, Z, "amnesia:sanity.Earring", 1.0F, 1.0F, false);
  115. }
  116. }
  117. if ((sanity < 25) && (!this.fear) && (!mc.field_71439_g.field_71075_bZ.field_75098_d))
  118. {
  119. try
  120. {
  121. mc.field_71460_t.field_147707_d = new ShaderGroup(mc.func_110434_K(), mc.func_110442_L(), mc.func_147110_a(), new ResourceLocation("shaders/post/phosphor.json"));
  122. mc.field_71460_t.field_147707_d.func_148026_a(mc.field_71443_c, mc.field_71440_d);
  123. this.fear = true;
  124. }
  125. catch (IOException ioexception) {}
  126. }
  127. else if ((sanity >= 25) && (this.fear == true))
  128. {
  129. this.fear = false;
  130. mc.field_71474_y.field_74326_T = (!mc.field_71474_y.field_74326_T);
  131. mc.field_71460_t.field_147707_d = null;
  132. }
  133. if ((sanity < 25) && (!mc.field_71439_g.field_71075_bZ.field_75098_d) && (!mc.field_71474_y.field_74326_T)) {
  134. mc.field_71474_y.field_74326_T = (!mc.field_71474_y.field_74326_T);
  135. }
  136. }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment