Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Sanity(Minecraft mc)
- {
- int X = (int)Math.floor(mc.field_71439_g.field_70165_t);
- int Y = (int)Math.floor(mc.field_71439_g.field_70163_u);
- int Z = (int)Math.floor(mc.field_71439_g.field_70161_v);
- 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);
- EntityGrunt entitygrunt = null;
- EntityBrute entitybrute = null;
- boolean foundTarget = false;
- Iterator<EntityLiving> i = entities.iterator();
- while (i.hasNext())
- {
- Entity entity = (Entity)i.next();
- if ((entity instanceof EntityGrunt))
- {
- entitygrunt = (EntityGrunt)entity;
- if ((entitygrunt != null) && (mc.field_71439_g.func_70685_l(entitygrunt))) {
- foundTarget = true;
- }
- }
- else if ((entity instanceof EntityBrute))
- {
- entitybrute = (EntityBrute)entity;
- if ((entitybrute != null) && (mc.field_71439_g.func_70685_l(entitybrute))) {
- foundTarget = true;
- }
- }
- }
- if ((foundTarget) && (!mc.field_71439_g.field_71075_bZ.field_75098_d))
- {
- if ((numTicks % 20L == 0L) && (sanity > 0)) {
- sanity -= 1;
- }
- if (!chase) {
- try
- {
- if (!this.fear)
- {
- 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"));
- mc.field_71460_t.field_147707_d.func_148026_a(mc.field_71443_c, mc.field_71440_d);
- }
- ISound terror = new AmnesiaAttackSoundEvent("amnesia:sanity.Terror", mc.field_71439_g, 0.3F, 1.0F);
- mc.func_147118_V().func_147682_a(terror);
- chase = true;
- }
- catch (IOException ioexception) {}
- }
- if (this.counter == 0)
- {
- if (entitygrunt != null)
- {
- ISound music = new AmnesiaAttackSoundEvent("amnesia:music.AttackGrunt", mc.field_71439_g, 0.8F, 1.0F);
- mc.func_147118_V().func_147682_a(music);
- wasGrunt = true;
- }
- else if (entitybrute != null)
- {
- ISound music = new AmnesiaAttackSoundEvent("amnesia:music.AttackBrute", mc.field_71439_g, 0.8F, 1.0F);
- mc.func_147118_V().func_147682_a(music);
- wasBrute = true;
- }
- this.counter = 100;
- }
- else if (this.counter != 100)
- {
- this.counter -= 1;
- }
- }
- else if (chase)
- {
- if (!this.fear) {
- mc.field_71460_t.field_147707_d = null;
- }
- this.counter = 50;
- if (wasGrunt)
- {
- if (!ExtendedPlayerPropertiesHandler.get(mc.field_71439_g).isMusicPlaying())
- {
- ISound music = new AmnesiaSearchSoundEvent("amnesia:music.SearchGrunt", mc.field_71439_g, 0.8F, 1.0F);
- mc.func_147118_V().func_147682_a(music);
- }
- wasGrunt = false;
- }
- else if (wasBrute)
- {
- if (!ExtendedPlayerPropertiesHandler.get(mc.field_71439_g).isMusicPlaying())
- {
- ISound music = new AmnesiaSearchSoundEvent("amnesia:music.SearchBrute", mc.field_71439_g, 0.8F, 1.0F);
- mc.func_147118_V().func_147682_a(music);
- }
- wasBrute = false;
- }
- chase = false;
- }
- if (!mc.field_71439_g.field_71075_bZ.field_75098_d)
- {
- if ((mc.field_71439_g.func_70013_c(1.0F) < 0.1F) && (numTicks % 40L == 0L) && (sanity > 0))
- {
- sanity -= 1;
- mc.field_71441_e.func_72980_b(X, Y, Z, "amnesia:sanity.Drain", 999.0F, 1.0F, false);
- }
- if ((mc.field_71439_g.func_70013_c(1.0F) > 0.1F) && (numTicks % 20L == 0L) && (sanity < 100) && (!chase)) {
- sanity += 1;
- }
- if (sanity < 5)
- {
- if (numTicks % 28L == 0L) {
- Amnesia.snw.sendToServer(new PotionEffectMessageHandler());
- }
- mc.field_71441_e.func_72980_b(X, Y, Z, "amnesia:sanity.Earring", 1.0F, 1.0F, false);
- }
- }
- if ((sanity < 25) && (!this.fear) && (!mc.field_71439_g.field_71075_bZ.field_75098_d))
- {
- try
- {
- 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"));
- mc.field_71460_t.field_147707_d.func_148026_a(mc.field_71443_c, mc.field_71440_d);
- this.fear = true;
- }
- catch (IOException ioexception) {}
- }
- else if ((sanity >= 25) && (this.fear == true))
- {
- this.fear = false;
- mc.field_71474_y.field_74326_T = (!mc.field_71474_y.field_74326_T);
- mc.field_71460_t.field_147707_d = null;
- }
- if ((sanity < 25) && (!mc.field_71439_g.field_71075_bZ.field_75098_d) && (!mc.field_71474_y.field_74326_T)) {
- mc.field_71474_y.field_74326_T = (!mc.field_71474_y.field_74326_T);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment