хп

Версия Minecraft
1.7.10
как увеличить здоровье боссов



Код:
package net.nevermine.boss.smash;

import java.util.Iterator;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.nevermine.boss.EntityBoss;
import net.nevermine.common.nevermine;
import net.nevermine.event.creature.BossClear;
import net.nevermine.izer.SpecialBlockizer;
import net.nevermine.izer.equipment.Weaponizer;
import net.nevermine.skill.hunter.hunterHelper;

public class EntitySmash
  extends EntityMob
  implements EntityBoss
{
  private int musictick = 6;
  
  public EntitySmash(World par1World)
  {
    super(par1World);
    func_70105_a(0.8F, 3.3F);
  }
  
  protected String func_70639_aQ()
  {
    switch (this.field_70146_Z.nextInt(3))
    {
    case 0: 
      return "nevermine:SmashLiving1";
    case 1: 
      return "nevermine:SmashLiving2";
    case 2: 
      return "nevermine:SmashLiving3";
    }
    return "nevermine:SmashLiving";
  }
  
  public boolean func_70097_a(DamageSource par1DamageSource, float par2)
  {
    if (par1DamageSource == DamageSource.field_76368_d) {
      BossClear.clear((int)this.field_70165_t, (int)this.field_70163_u, (int)this.field_70161_v, this.field_70170_p, this);
    }
    return super.func_70097_a(par1DamageSource, par2);
  }
  
  protected void func_70628_a(boolean par1, int par2)
  {
    func_145779_a(dropStatue(), 1);
    int wep = this.field_70146_Z.nextInt(4);
    if (wep == 1) {
      func_145779_a(Weaponizer.TrollsArchergun, 1);
    } else if (wep == 2) {
      func_145779_a(Weaponizer.TrollBasherAxe, 1);
    } else if (wep == 3) {
      func_145779_a(Weaponizer.BlueBarrel, 1);
    } else {
      func_145779_a(Weaponizer.BoomCannon, 1);
    }
    int item = this.field_70146_Z.nextInt(3);
    if (item == 1) {
      func_145779_a(Items.field_151045_i, 15);
    } else if (item == 2) {
      func_145779_a(Items.field_151044_h, 50);
    } else {
      func_145779_a(Items.field_151116_aA, 10);
    }
  }
  
  private Item dropStatue()
  {
    return Item.func_150898_a(SpecialBlockizer.SmashStatue);
  }
  
  protected String func_70673_aS()
  {
    return "nevermine:SmashDeath";
  }
  
  protected String func_70621_aR()
  {
    return "nevermine:SmashHit";
  }
  
  protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
  {
    func_85030_a("nevermine:HeavyStep", 0.85F, 1.0F);
  }
  
  protected Entity func_70782_k()
  {
    EntityPlayer entityPlayer = this.field_70170_p.func_72856_b(this, 16.0D);
    return (entityPlayer != null) && (func_70685_l(entityPlayer)) ? entityPlayer : null;
  }
  
  public void func_110147_ax()
  {
    super.func_110147_ax();
    
    func_110148_a(SharedMonsterAttributes.field_111264_e).func_111128_a(15.0D);
    func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(52.0D);
    func_110148_a(SharedMonsterAttributes.field_111266_c).func_111128_a(0.9D);
    func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(500.0D);
  }
  
  protected void func_70088_a()
  {
    super.func_70088_a();
    this.field_70180_af.func_75682_a(16, new Integer(100));
  }
  
  public float func_70689_ay()
  {
    return 2.1F;
  }
  
  public void func_70612_e(float par1, float par2)
  {
    if (func_70090_H())
    {
      double d0 = this.field_70163_u;
      func_70060_a(par1, par2, 0.52F);
      func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y);
      this.field_70159_w *= 0.800000011920929D;
      this.field_70181_x *= 0.800000011920929D;
      this.field_70179_y *= 0.800000011920929D;
      this.field_70181_x -= 0.02D;
      if ((this.field_70123_F) && (func_70038_c(this.field_70159_w, this.field_70181_x + 0.6000000238418579D - this.field_70163_u + d0, this.field_70179_y))) {
        this.field_70181_x = 0.30000001192092896D;
      }
    }
    else if (func_70058_J())
    {
      double d0 = this.field_70163_u;
      func_70060_a(par1, par2, 0.02F);
      func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y);
      this.field_70159_w *= 0.5D;
      this.field_70181_x *= 0.5D;
      this.field_70179_y *= 0.5D;
      this.field_70181_x -= 0.02D;
      if ((this.field_70123_F) && (func_70038_c(this.field_70159_w, this.field_70181_x + 0.6000000238418579D - this.field_70163_u + d0, this.field_70179_y))) {
        this.field_70181_x = 0.30000001192092896D;
      }
    }
    else
    {
      float f2 = 0.91F;
      
      float f3 = 0.16277136F / (f2 * f2 * f2);
      float f4;
      float f4;
      if (this.field_70122_E) {
        f4 = func_70689_ay() * f3;
      } else {
        f4 = this.field_70747_aH;
      }
      func_70060_a(par1, par2, f4);
      f2 = 0.91F;
      if (func_70617_f_())
      {
        float f5 = 0.15F;
        if (this.field_70159_w < -f5) {
          this.field_70159_w = (-f5);
        }
        if (this.field_70159_w > f5) {
          this.field_70159_w = f5;
        }
        if (this.field_70179_y < -f5) {
          this.field_70179_y = (-f5);
        }
        if (this.field_70179_y > f5) {
          this.field_70179_y = f5;
        }
        this.field_70143_R = 0.0F;
        if (this.field_70181_x < -0.15D) {
          this.field_70181_x = -0.15D;
        }
      }
      func_70091_d(this.field_70159_w, this.field_70181_x, this.field_70179_y);
      if ((this.field_70123_F) && (func_70617_f_())) {
        this.field_70181_x = 0.2D;
      }
      if ((this.field_70170_p.field_72995_K) && ((!this.field_70170_p.func_72899_e((int)this.field_70165_t, 0, (int)this.field_70161_v)) || (!this.field_70170_p.func_72938_d((int)this.field_70165_t, (int)this.field_70161_v).field_76636_d)))
      {
        if (this.field_70163_u > 0.0D) {
          this.field_70181_x = -0.1D;
        } else {
          this.field_70181_x = 0.0D;
        }
      }
      else {
        this.field_70181_x -= 0.08D;
      }
      this.field_70181_x *= 0.9800000190734863D;
      this.field_70159_w *= f2;
      this.field_70179_y *= f2;
    }
    this.field_70722_aY = this.field_70721_aZ;
    double d0 = this.field_70165_t - this.field_70169_q;
    double d1 = this.field_70161_v - this.field_70166_s;
    float f6 = MathHelper.func_76133_a(d0 * d0 + d1 * d1) * 4.0F;
    if (f6 > 1.0F) {
      f6 = 1.0F;
    }
    this.field_70721_aZ += (f6 - this.field_70721_aZ) * 0.4F;
    this.field_70754_ba += this.field_70721_aZ;
  }
  
  public boolean func_70652_k(Entity par1Entity)
  {
    super.func_70652_k(par1Entity);
    if (this.field_70789_a != null)
    {
      float cur = func_110143_aJ();
      if ((cur > 300.0F) && (cur < 401.0F)) {
        this.field_70789_a.func_70024_g(this.field_70159_w * 5.0D, 2.0D, this.field_70179_y * 0.0D);
      }
      if (((cur > 200.0F) && (cur < 300.0F)) || (cur == 300.0F)) {
        this.field_70789_a.func_70024_g(this.field_70159_w * 5.4D, 2.5D, this.field_70179_y * 0.0D);
      }
      if (((cur > 100.0F) && (cur < 200.0F)) || (cur == 200.0F)) {
        this.field_70789_a.func_70024_g(this.field_70159_w * 5.8D, 3.0D, this.field_70179_y * 0.0D);
      }
      if (((cur > 0.0F) && (cur < 100.0F)) || (cur == 100.0F)) {
        this.field_70789_a.func_70024_g(this.field_70159_w * 5.2D, 3.5D, this.field_70179_y * 0.0D);
      }
      return true;
    }
    return false;
  }
  
  public void func_70636_d()
  {
    super.func_70636_d();
    if (this.musictick == 4)
    {
      func_85030_a("nevermine:MusicSmash", 3.0F, 1.0F);
      
      this.musictick = 380;
    }
    else
    {
      this.musictick -= 1;
    }
  }
  
  public void func_70645_a(DamageSource d)
  {
    super.func_70645_a(d);
    if ((!this.field_70170_p.field_72995_K) && 
      (d.func_76346_g() != null) && 
      ((d.func_76346_g() instanceof EntityPlayer)))
    {
      EntityPlayer p = (EntityPlayer)d.func_76346_g();
      int expDropped = 400;
      EntityPlayer e;
      for (Iterator i$ = p.field_70170_p.func_72872_a(EntityPlayer.class, p.field_70121_D.func_72314_b(50.0D, 50.0D, 50.0D)).iterator(); i$.hasNext(); e.func_145747_a(nevermine.addChatMessage(p.getDisplayName() + " defeated Smash!", new Object[0]))) {
        e = (EntityPlayer)i$.next();
      }
      boolean run = true;
      if (hunterHelper.getProperties(p).getLevel() < 30) {
        run = false;
      }
      while (run)
      {
        float req = hunterHelper.getProperties(p).getExpLeft();
        if (expDropped > req)
        {
          expDropped = (int)(expDropped - req);
          hunterHelper.getProperties(p).levelUp();
        }
        else
        {
          hunterHelper.getProperties(p).addExperience(expDropped);
          run = false;
        }
      }
    }
  }
}
 
7,099
324
1,509
Автор мода забросил разработку, вот он и пытается продолжать
 
667
7
2
Может стоит модераторам "разрешить" форматировать/редактировать плохо оформленные сообщения?
 
7,099
324
1,509
virysD написал(а):
Может стоит модераторам "разрешить" форматировать/редактировать плохо оформленные сообщения?
Этим должен заниматься тот, кому нужна помощь.
 
Сверху