Guest User

Mod Motin Y Problem

a guest
Aug 8th, 2015
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 27.24 KB | None | 0 0
  1. protected void attackEntity(Entity par1Entity, float par2) {
  2.  
  3.     final MinecraftServer mcserver = FMLCommonHandler.instance().getMinecraftServerInstance();
  4.  
  5.     if (this.godState == 0 && XCEntityGod.evilState == 0 || this.godState == 1 && XCEntityGod.evilState == 0 || this.godState == 3 && XCEntityGod.evilState == 0 || this.godState == 4 && XCEntityGod.evilState == 0 || this.godState == 6) {
  6.  
  7.         this.fallDistance = 0.0F;
  8.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.65D);
  9.     }
  10.  
  11.     if (par2 < 50F && this.rand.nextInt(95) == 0 && (this.godState == 0 || this.godState == 6) && XCEntityGod.evilState == 0 && this.getHealth() > 1800) {
  12.  
  13.         this.godState = 1;
  14.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:mob.charge", 2.2F, 1.0F / (this.rand.nextFloat() * 0.4F + 0.8F));
  15.     }
  16.  
  17.     if (this.godState == 1 && XCEntityGod.evilState == 0) {
  18.  
  19.         final double d = par1Entity.posX - this.posX;
  20.         final double d14 = par1Entity.posZ - this.posZ;
  21.         final float f1 = MathHelper.sqrt_double(d * d + d14 * d14);
  22.         this.chargeTime++;
  23.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.2D);
  24.         final double d40 = this.rand.nextGaussian() * 0.02D;
  25.         final double d54 = this.rand.nextGaussian() * 0.02D;
  26.         final double d60 = this.rand.nextGaussian() * 0.02D;
  27.         final double d63 = 20D;
  28.  
  29.         for (int l12 = 0; l12 < 30; l12++) {
  30.  
  31.         Minecraft.getMinecraft().effectRenderer.addEffect(new XCEntityPortalCelestialFX(this.worldObj, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d40 * d63, this.posY + this.rand.nextFloat() * this.height - d54 * d63, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d60 * d63, d40, d54, d60));
  32.         }
  33.  
  34.     }
  35.  
  36.     if (this.chargeTime >= 40 && this.godState == 1 && evilState == 0) {
  37.  
  38.         final byte byte0 = 3;
  39.  
  40.         for (int l1 = 0; l1 < byte0; l1++) {
  41.  
  42.         final double d15 = par1Entity.posX - this.posX;
  43.         final double d31 = par1Entity.posZ - this.posZ;
  44.         final XCEntityDivineMissile entityarrow2_2 = new XCEntityDivineMissile(this.worldObj, this);
  45.         entityarrow2_2.posY += 2.3999999761581421D;
  46.         final double d55 = par1Entity.posY + par1Entity.getEyeHeight() - 0.40000000298023225D - entityarrow2_2.posY;
  47.         final float f8 = MathHelper.sqrt_double(d15 * d15 + d31 * d31) * 0.0F;
  48.         this.worldObj.playSoundAtEntity(this, "mob.ghast.fireball", 0.9F, 0.9F / (this.rand.nextFloat() * 0.4F + 0.8F));
  49.         this.worldObj.playSoundAtEntity(this, "random.fizz", 0.9F, 0.9F / (this.rand.nextFloat() * 0.4F + 0.8F));
  50.         this.worldObj.spawnEntityInWorld(entityarrow2_2);
  51.         entityarrow2_2.setThrowableHeading(d15, d55 + f8, d31, 0.62F, -10F);
  52.         }
  53.  
  54.         this.worldObj.playSoundAtEntity(this, "mob.ghast.fireball", 0.6F, 0.3F / (this.rand.nextFloat() * 0.4F + 0.8F));
  55.         this.godState = 0;
  56.         this.chargeTime = 0;
  57.     }
  58.  
  59.     if (par2 < 50F && this.rand.nextInt(210) == 0 && (this.godState == 0 || this.godState == 6) && evilState == 0 && this.getHealth() > 1800) {
  60.  
  61.         this.godState = 2;
  62.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:mob.fly", 1.2F, 1.0F / (this.rand.nextFloat() * 0.4F + 0.8F));
  63.     }
  64.  
  65.     if (this.godState == 2 && this.chargeTime < 30 && evilState == 0) {
  66.  
  67.         this.motionY = 0.155D;
  68.         this.chargeTime++;
  69.         final double d1 = this.rand.nextGaussian() * 0.02D;
  70.         final double d16 = this.rand.nextGaussian() * 0.02D;
  71.         final double d32 = this.rand.nextGaussian() * 0.02D;
  72.         final double d44 = 10D;
  73.  
  74.         for (int j10 = 0; j10 < 10; j10++) {
  75.  
  76.         Minecraft.getMinecraft().effectRenderer.addEffect(new XCEntityChargeFX(this.worldObj, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d1 * d44, this.posY + this.rand.nextFloat() * this.height - d16 * d44, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d32 * d44, d1, d16, d32));
  77.         }
  78.  
  79.     }
  80.  
  81.     if (this.godState == 2 && this.chargeTime >= 30 && evilState == 0) {
  82.  
  83.         this.motionX = 0.0D;
  84.         this.motionY = 0.0D;
  85.         this.motionZ = 0.0D;
  86.         this.fireRate++;
  87.     }
  88.  
  89.     if (this.godState == 2 && this.fireRate >= 6 && this.tirNumber < 5 && evilState == 0) {
  90.  
  91.         final double d2 = par1Entity.posX - this.posX;
  92.         final double d17 = par1Entity.posZ - this.posZ;
  93.         final float f2 = MathHelper.sqrt_double(d2 * d2 + d17 * d17);
  94.         final XCEntityDivineMissile entityarrow2 = new XCEntityDivineMissile(this.worldObj, this);
  95.         entityarrow2.posY += 2.3999999761581421D;
  96.         final double d45 = par1Entity.posY + par1Entity.getEyeHeight() - 0.40000000298023225D - entityarrow2.posY;
  97.         final float f6 = MathHelper.sqrt_double(d2 * d2 + d17 * d17) * 0.0F;
  98.         this.worldObj.playSoundAtEntity(this, "mob.ghast.fireball", 0.9F, 0.9F / (this.rand.nextFloat() * 0.4F + 0.8F));
  99.         this.worldObj.playSoundAtEntity(this, "random.fizz", 0.9F, 0.9F / (this.rand.nextFloat() * 0.4F + 0.8F));
  100.         this.worldObj.spawnEntityInWorld(entityarrow2);
  101.         entityarrow2.setThrowableHeading(d2, d45 + f6, d17, 0.62F, 1.0F);
  102.         this.tirNumber++;
  103.         this.fireRate = 0;
  104.     }
  105.  
  106.     if (this.godState == 2 && this.tirNumber >= 5 && evilState == 0) {
  107.  
  108.         this.motionY = -0.14999999999999999D;
  109.         this.fallDistance = 0.0F;
  110.     }
  111.  
  112.     if (this.onGround && this.godState == 2 && this.tirNumber >= 5 && evilState == 0) {
  113.  
  114.         this.tirNumber = 0;
  115.         this.godState = 0;
  116.         this.chargeTime = 0;
  117.         this.fireRate = 0;
  118.         this.fallDistance = 0.0F;
  119.     }
  120.  
  121.     if (par2 < 50F && this.rand.nextInt(190) == 1 && (this.godState == 0 || this.godState == 6) && evilState == 0 && this.getHealth() > 1800) {
  122.  
  123.         this.godState = 3;
  124.         this.worldObj.playSoundAtEntity(this, "mob.ghast.fireball", 1.3F, 0.4F / (this.rand.nextFloat() * 0.4F + 0.8F));
  125.     }
  126.  
  127.     if (this.godState == 3 && evilState == 0) {
  128.  
  129.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.01D);
  130.         final double d3 = this.rand.nextGaussian() * 0.02D;
  131.         final double d18 = this.rand.nextGaussian() * 0.02D;
  132.         final double d33 = this.rand.nextGaussian() * 0.02D;
  133.         final double d46 = 10D;
  134.  
  135.         for (int k10 = 0; k10 < 10; k10++) {
  136.  
  137.         Minecraft.getMinecraft().effectRenderer.addEffect(new XCEntityCharge2FX(this.worldObj, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d3 * d46, this.posY + this.rand.nextFloat() * this.height - d18 * d46, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d33 * d46, d3, d18, d33));
  138.         }
  139.  
  140.         this.chargeTime++;
  141.     }
  142.  
  143.     if (this.godState == 3 && this.chargeTime >= 20 && evilState == 0) {
  144.  
  145.         this.fireRate++;
  146.     }
  147.  
  148.     if (this.godState == 3 && this.chargeTime >= 20 && this.fireRate >= 4 && evilState == 0) {
  149.  
  150.         final int i = this.rand.nextInt(10) - this.rand.nextInt(10);
  151.         final int i2 = this.rand.nextInt(10) - this.rand.nextInt(10);
  152.         this.fireRate = 0;
  153.         final double d19 = par1Entity.posX - this.posX;
  154.         final double d34 = par1Entity.posZ - this.posZ;
  155.         this.worldObj.createExplosion(this, this.posX + i, this.posY + 2D, this.posZ + i2, 1.0F, this.hasAttacked);
  156.         this.tirNumber++;
  157.     }
  158.  
  159.     if (this.godState == 3 && this.tirNumber == 25 && evilState == 0) {
  160.  
  161.         this.godState = 0;
  162.         this.tirNumber = 0;
  163.         this.chargeTime = 0;
  164.         this.fireRate = 0;
  165.     }
  166.  
  167.     if (par2 < 50F && this.rand.nextInt(100) == 1 && this.godState == 0 && evilState == 0 && this.getHealth() > 1800) {
  168.  
  169.         this.godState = 4;
  170.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:mob.chargespeed", 2.2F, 1.0F / (this.rand.nextFloat() * 0.8F + 1.2F));
  171.     }
  172.  
  173.     if (this.godState == 4 && evilState == 0) {
  174.  
  175.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.4D);
  176.         this.igniteTime++;
  177.         this.chargeTime++;
  178.         final double d4 = this.rand.nextGaussian() * 0.02D;
  179.         final double d20 = this.rand.nextGaussian() * 0.02D;
  180.         final double d35 = this.rand.nextGaussian() * 0.02D;
  181.         final double d47 = 10D;
  182.  
  183.         for (int l10 = 0; l10 < 10; l10++) {
  184.  
  185.         Minecraft.getMinecraft().effectRenderer.addEffect(new XCEntityChargeFX(this.worldObj, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d4 * d47, this.posY + this.rand.nextFloat() * this.height - d20 * d47, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d35 * d47, d4, d20, d35));
  186.         }
  187.  
  188.     }
  189.  
  190.     if (this.godState == 4 && this.igniteTime >= 60 && this.chargeTime >= 60 && evilState == 0) {
  191.  
  192.         final double d5 = par1Entity.posX - this.posX;
  193.         final double d21 = par1Entity.posZ - this.posZ;
  194.         final float f3 = MathHelper.sqrt_double(d5 * d5 + d21 * d21);
  195.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:random.bow", 1.5F, 0.43F / (this.rand.nextFloat() * 0.4F + 0.8F));
  196.         this.motionX = d5 / f3 * 0.5D * 3.400000011920929D + this.motionX * 0.10000000298023223D;
  197.         this.motionZ = d21 / f3 * 0.5D * 3.400000011920929D + this.motionZ * 0.10000000298023223D;
  198.         this.motionY = 0.19000000059604644D;
  199.  
  200.         for (int i7 = 0; i7 < 20; i7++) {
  201.  
  202.         final double d48 = this.rand.nextGaussian() * 0.02D;
  203.         final double d59 = this.rand.nextGaussian() * 0.02D;
  204.         final double d62 = this.rand.nextGaussian() * 0.02D;
  205.         final double d64 = 10D;
  206.         this.worldObj.spawnParticle("explode", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d48 * d64, this.posY + this.rand.nextFloat() * this.height - d59 * d64, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d62 * d64, d48, d59, d62);
  207.         }
  208.  
  209.         this.godState = 6;
  210.         this.igniteTime = 60;
  211.     }
  212.  
  213.     if (this.godState == 6 && evilState == 0) {
  214.  
  215.         this.igniteTime = 60;
  216.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.8D);
  217.         this.speedTime++;
  218.     }
  219.  
  220.     if (this.godState == 6 && this.speedTime >= 45 && evilState == 0) {
  221.  
  222.         this.igniteTime = 0;
  223.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.65D);
  224.         this.speedTime = 0;
  225.         this.godState = 0;
  226.     }
  227.  
  228.     if (par2 < 12F && this.rand.nextInt(87) == 4 && (this.godState == 0 || this.godState == 6) && evilState == 0 && this.getHealth() > 1800 && this.onGround) {
  229.  
  230.         for (int j = 0; j < 20; j++) {
  231.  
  232.         final double d12 = this.rand.nextGaussian() * 0.02D;
  233.         final double d28 = this.rand.nextGaussian() * 0.02D;
  234.         final double d41 = this.rand.nextGaussian() * 0.02D;
  235.         final double d56 = 10D;
  236.         this.worldObj.spawnParticle("explode", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d12 * d56, this.posY + this.rand.nextFloat() * this.height - d28 * d56, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d41 * d56, d12, d28, d41);
  237.         }
  238.  
  239.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:random.bow", 1.5F, 0.43F / (this.rand.nextFloat() * 0.4F + 0.8F));
  240.         this.godState = 5;
  241.         final double d6 = par1Entity.posX - this.posX;
  242.         final double d22 = par1Entity.posZ - this.posZ;
  243.         final float f4 = MathHelper.sqrt_double(d6 * d6 + d22 * d22);
  244.         this.motionX = d6 / f4 * 0.5D * 0.40000001192092893D + this.motionX * 0.50000000298023228D;
  245.         this.motionZ = d22 / f4 * 0.5D * 0.40000001192092893D + this.motionZ * 0.50000000298023228D;
  246.         this.motionY = 1.0000000596046448D;
  247.         this.fallDistance = 0.0F;
  248.     }
  249.  
  250.     if (this.godState == 5 && evilState == 0) {
  251.  
  252.         this.chargeTime++;
  253.         this.fallDistance = 0.0F;
  254.     }
  255.  
  256.     if (this.godState == 5 && this.onGround && this.chargeTime > 5 && evilState == 0) {
  257.  
  258.         final int k = this.rand.nextInt(10) - this.rand.nextInt(10);
  259.         final int j2 = this.rand.nextInt(10) - this.rand.nextInt(10);
  260.         final int k3 = this.rand.nextInt(10) - this.rand.nextInt(10);
  261.         final int l4 = this.rand.nextInt(10) - this.rand.nextInt(10);
  262.         final int i6 = this.rand.nextInt(10) - this.rand.nextInt(10);
  263.         final int j7 = this.rand.nextInt(10) - this.rand.nextInt(10);
  264.         final int j8 = MathHelper.floor_double(this.posX);
  265.         final int j9 = MathHelper.floor_double(this.boundingBox.minY);
  266.         final int i11 = MathHelper.floor_double(this.posZ);
  267.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, j8 + k, j9, i11 + j2));
  268.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, j8 + k3, j9, i11 + l4));
  269.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, j8 + i6, j9, i11 + j7));
  270.         this.godState = 0;
  271.         this.chargeTime = 0;
  272.         this.fallDistance = 0.0F;
  273.     }
  274.  
  275.     if (this.getHealth() <= 3000 && this.actionStop == 0 && (this.godState == 0 || this.godState == 6)) {
  276.  
  277.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0D);
  278.         this.motionX = 0.0D;
  279.         this.motionZ = 0.0D;
  280.  
  281.         for (int l = 0; l < 20; l++) {
  282.  
  283.         final double d13 = this.rand.nextGaussian() * 0.02D;
  284.         final double d29 = this.rand.nextGaussian() * 0.02D;
  285.         final double d42 = this.rand.nextGaussian() * 0.02D;
  286.         final double d57 = 10D;
  287.         this.worldObj.spawnParticle("explode", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d13 * d57, this.posY + this.rand.nextFloat() * this.height - d29 * d57, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d42 * d57, d13, d29, d42);
  288.         }
  289.  
  290.         this.chargeTime++;
  291.         this.actionStop = 1;
  292.         this.godState = 9;
  293.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:mob.god.godphase", 6.5F, 1.0F / (this.rand.nextFloat() * 0.9F + 1.1F));
  294.     }
  295.  
  296.     if (this.godState == 9 && this.actionStop == 1) {
  297.  
  298.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0D);
  299.         this.motionX = 0.0D;
  300.         this.motionZ = 0.0D;
  301.         this.chargeTime++;
  302.         final double d7 = this.rand.nextGaussian() * 0.02D;
  303.         final double d23 = this.rand.nextGaussian() * 0.02D;
  304.         final double d36 = this.rand.nextGaussian() * 0.02D;
  305.         final double d49 = 10D;
  306.         this.worldObj.spawnParticle("explode", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d7 * d49, this.posY + this.rand.nextFloat() * this.height - d23 * d49, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d36 * d49, d7, d23, d36);
  307.         this.chargeTime++;
  308.     }
  309.  
  310.     if (this.godState == 9 && this.actionStop == 1 && this.chargeTime >= 80) {
  311.  
  312.         final boolean flag = true;
  313.         final XCEntityGodProtector entitysanctuairegardien = new XCEntityGodProtector(this.worldObj);
  314.         final XCEntityGodProtector entitysanctuairegardien1 = new XCEntityGodProtector(this.worldObj);
  315.         entitysanctuairegardien.setLocationAndAngles(this.posX + 3D, this.posY + 0.5D, this.posZ, this.rand.nextFloat() * 360F, 0.0F);
  316.         this.worldObj.spawnEntityInWorld(entitysanctuairegardien);
  317.         entitysanctuairegardien1.setLocationAndAngles(this.posX - 3D, this.posY + 1.5D, this.posZ, this.rand.nextFloat() * 360F, 0.0F);
  318.         this.worldObj.spawnEntityInWorld(entitysanctuairegardien1);
  319.         final double d30 = this.rand.nextGaussian() * 0.02D;
  320.         final double d43 = this.rand.nextGaussian() * 0.02D;
  321.         final double d58 = this.rand.nextGaussian() * 0.02D;
  322.         final double d61 = 10D;
  323.         this.worldObj.spawnParticle("explode", this.posX + 3D + this.rand.nextFloat() * this.width * 2.0F - this.width - d30 * d61, this.posY + this.rand.nextFloat() * this.height - d43 * d61, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d58 * d61, d30, d43, d58);
  324.         this.worldObj.spawnParticle("explode", this.posX - 3D + this.rand.nextFloat() * this.width * 2.0F - this.width - d30 * d61, this.posY + this.rand.nextFloat() * this.height - d43 * d61, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d58 * d61, d30, d43, d58);
  325.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:random.old_explode", 0.8F, 1.43F / (this.rand.nextFloat() * 0.4F + 0.8F));
  326.         this.chargeTime = 0;
  327.         this.actionStop = 2;
  328.         this.godState = 7;
  329.     }
  330.  
  331.     if (this.godState == 7 && this.chargeTime < 30) {
  332.  
  333.         this.chargeTime++;
  334.         this.motionY = 0.19500000000000001D;
  335.     }
  336.  
  337.     if (this.godState == 7 && this.chargeTime >= 30) {
  338.  
  339.         this.motionX = 0.0D;
  340.         this.motionY = 0.0D;
  341.         this.motionZ = 0.0D;
  342.         final double d8 = this.rand.nextGaussian() * 0.02D;
  343.         final double d24 = this.rand.nextGaussian() * 0.02D;
  344.         final double d37 = this.rand.nextGaussian() * 0.02D;
  345.         final double d50 = 20D;
  346.  
  347.         for (int j11 = 0; j11 < 30; j11++) {
  348.  
  349.         Minecraft.getMinecraft().effectRenderer.addEffect(new XCEntityPortalCelestialFX(this.worldObj, this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d8 * d50, this.posY + this.rand.nextFloat() * this.height - d24 * d50, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d37 * d50, d8, d24, d37));
  350.         }
  351.  
  352.         this.fireRate++;
  353.     }
  354.  
  355.     if (this.godState == 7 && this.fireRate >= 50) {
  356.  
  357.         final int i1 = this.rand.nextInt(30) - this.rand.nextInt(30);
  358.         final int k2 = this.rand.nextInt(30) - this.rand.nextInt(30);
  359.         final int l3 = this.rand.nextInt(30) - this.rand.nextInt(30);
  360.         final int i5 = this.rand.nextInt(30) - this.rand.nextInt(30);
  361.         final int j6 = this.rand.nextInt(30) - this.rand.nextInt(30);
  362.         final int k7 = this.rand.nextInt(30) - this.rand.nextInt(30);
  363.         final int k8 = MathHelper.floor_double(this.posX);
  364.         final int k9 = MathHelper.floor_double(this.boundingBox.minY);
  365.         final int k11 = MathHelper.floor_double(this.posZ);
  366.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, k8 + i1, k9 - 4, k11 + k2));
  367.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, k8 + l3, k9 - 4, k11 + i5));
  368.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, k8 + j6, k9 - 4, k11 + k7));
  369.         this.fireRate = 0;
  370.         this.tirNumber++;
  371.     }
  372.  
  373.     if (this.godState == 7 && this.tirNumber >= 5) {
  374.  
  375.         this.tirNumber = 0;
  376.         this.fireRate = 0;
  377.         this.godState = 8;
  378.         this.chargeTime = 0;
  379.     }
  380.  
  381.     if (this.godState == 8) {
  382.  
  383.         this.motionX = 0.0D;
  384.         this.motionZ = 0.0D;
  385.         this.motionY = 0.0D;
  386.         this.chargeTime++;
  387.     }
  388.  
  389.     if (this.godState == 8 && this.chargeTime >= 20) {
  390.  
  391.         this.fireRate++;
  392.     }
  393.  
  394.     if (this.godState == 8 && this.chargeTime >= 20 && this.fireRate >= 2) {
  395.  
  396.         final double d9 = par1Entity.posX - this.posX;
  397.         final double d25 = par1Entity.posZ - this.posZ;
  398.         final float f5 = MathHelper.sqrt_double(d9 * d9 + d25 * d25);
  399.         final XCEntityDivineMissile entityarrow2_1 = new XCEntityDivineMissile(this.worldObj, this);
  400.         entityarrow2_1.posY += 2.3999999761581421D;
  401.         final double d51 = par1Entity.posY + par1Entity.getEyeHeight() - 0.40000000298023225D - entityarrow2_1.posY;
  402.         final float f7 = MathHelper.sqrt_double(d9 * d9 + d25 * d25) * 0.0F;
  403.         this.worldObj.playSoundAtEntity(this, "mob.ghast.fireball", 0.9F, 0.9F / (this.rand.nextFloat() * 0.4F + 0.8F));
  404.         this.worldObj.playSoundAtEntity(this, "random.fizz", 0.9F, 0.9F / (this.rand.nextFloat() * 0.4F + 0.8F));
  405.         this.worldObj.spawnEntityInWorld(entityarrow2_1);
  406.         entityarrow2_1.setThrowableHeading(d9, d51 + f7, d25, 0.62F, 15F);
  407.         this.tirNumber++;
  408.         this.fireRate = 0;
  409.     }
  410.  
  411.     if (this.godState == 8 && this.tirNumber >= 10) {
  412.  
  413.         this.motionY = -1.14999999999999999D;
  414.         this.fallDistance = 0.0F;
  415.     }
  416.  
  417.     if (this.onGround && this.godState == 8 && this.tirNumber >= 10) {
  418.  
  419.         this.tirNumber = 0;
  420.         this.godState = 0;
  421.         this.chargeTime = 0;
  422.         this.fireRate = 0;
  423.         this.fallDistance = 0.0F;
  424.     }
  425.  
  426.     if (this.getHealth() <= 1800 && this.actionStop == 2 && this.godState == 0) {
  427.  
  428.         this.actionStop = 3;
  429.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:mob.god.godevil", 7.5F, 1.0F / (this.rand.nextFloat() * 0.9F + 1.1F));
  430.     }
  431.  
  432.     if (this.getHealth() <= 1800 && this.actionStop == 3 && this.godState == 0) {
  433.  
  434.         this.chargeTime++;
  435.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0D);
  436.         this.motionX = 0.0D;
  437.         this.motionY = 0.0D;
  438.         this.motionZ = 0.0D;
  439.         final double d10 = this.rand.nextGaussian() * 0.02D;
  440.         final double d26 = this.rand.nextGaussian() * 0.02D;
  441.         final double d38 = this.rand.nextGaussian() * 0.02D;
  442.         final double d52 = 10D;
  443.  
  444.         for (int l11 = 0; l11 < 9; l11++) {
  445.  
  446.         this.worldObj.spawnParticle("largesmoke", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d10 * d52, this.posY + this.rand.nextFloat() * this.height - d26 * d52, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d38 * d52, d10, d26, d38);
  447.         }
  448.     }
  449.  
  450.     if (this.getHealth() <= 1800 && this.actionStop == 3 && this.chargeTime >= 100) {
  451.  
  452.         final boolean flag1 = true;
  453.         final int l2 = MathHelper.floor_double(this.posX);
  454.         final int i4 = MathHelper.floor_double(this.boundingBox.minY);
  455.         final int j5 = MathHelper.floor_double(this.posZ);
  456.         this.worldObj.createExplosion(this, this.posX, this.posY + 2D, this.posZ, 1.0F, flag1);
  457.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, l2, i4 + 1, j5));
  458.         final XCEntityReaper entitygoodzombie = new XCEntityReaper(this.worldObj);
  459.         final XCEntityReaper entitygoodzombie1 = new XCEntityReaper(this.worldObj);
  460.         final XCEntityReaper entitygoodzombie2 = new XCEntityReaper(this.worldObj);
  461.         final XCEntityReaper entitygoodzombie3 = new XCEntityReaper(this.worldObj);
  462.         final XCEntityReaper entitygoodzombie4 = new XCEntityReaper(this.worldObj);
  463.         final XCEntityReaper entitygoodzombie5 = new XCEntityReaper(this.worldObj);
  464.         final XCEntityReaper entitygoodzombie6 = new XCEntityReaper(this.worldObj);
  465.         final XCEntityReaper entitygoodzombie7 = new XCEntityReaper(this.worldObj);
  466.         entitygoodzombie.setLocationAndAngles(this.posX + 4D, this.posY + 0.5D, this.posZ, this.rand.nextFloat() * 360F, 0.0F);
  467.         entitygoodzombie1.setLocationAndAngles(this.posX + 4D, this.posY + 0.5D, this.posZ + 4D, this.rand.nextFloat() * 360F, 0.0F);
  468.         entitygoodzombie2.setLocationAndAngles(this.posX + 4D, this.posY + 0.5D, this.posZ - 4D, this.rand.nextFloat() * 360F, 0.0F);
  469.         entitygoodzombie3.setLocationAndAngles(this.posX - 4D, this.posY + 0.5D, this.posZ, this.rand.nextFloat() * 360F, 0.0F);
  470.         entitygoodzombie4.setLocationAndAngles(this.posX - 4D, this.posY + 0.5D, this.posZ + 4D, this.rand.nextFloat() * 360F, 0.0F);
  471.         entitygoodzombie5.setLocationAndAngles(this.posX - 4D, this.posY + 0.5D, this.posZ - 4D, this.rand.nextFloat() * 360F, 0.0F);
  472.         entitygoodzombie6.setLocationAndAngles(this.posX, this.posY + 0.5D, this.posZ + 4D, this.rand.nextFloat() * 360F, 0.0F);
  473.         entitygoodzombie7.setLocationAndAngles(this.posX, this.posY + 0.5D, this.posZ - 4D, this.rand.nextFloat() * 360F, 0.0F);
  474.         this.worldObj.spawnEntityInWorld(entitygoodzombie);
  475.         this.worldObj.spawnEntityInWorld(entitygoodzombie1);
  476.         this.worldObj.spawnEntityInWorld(entitygoodzombie2);
  477.         this.worldObj.spawnEntityInWorld(entitygoodzombie3);
  478.         this.worldObj.spawnEntityInWorld(entitygoodzombie4);
  479.         this.worldObj.spawnEntityInWorld(entitygoodzombie5);
  480.         this.worldObj.spawnEntityInWorld(entitygoodzombie6);
  481.         this.worldObj.spawnEntityInWorld(entitygoodzombie7);
  482.         this.worldObj.playSoundAtEntity(this, "xtracraftmod:random.old_explode", 0.8F, 1.43F / (this.rand.nextFloat() * 0.4F + 0.8F));
  483.  
  484.         for (int i13 = 0; i13 < 6; i13++) {
  485.  
  486.         final double d65 = this.rand.nextGaussian() * 0.02D;
  487.         final double d66 = this.rand.nextGaussian() * 0.02D;
  488.         final double d67 = this.rand.nextGaussian() * 0.02D;
  489.         final double d68 = 10D;
  490.  
  491.         this.worldObj.spawnParticle("largesmoke", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d65 * d68, this.posY + this.rand.nextFloat() * this.height - d66 * d68, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d67 * d68, d65, d66, d67);
  492.         this.worldObj.spawnParticle("lava", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d65 * d68, this.posY + this.rand.nextFloat() * this.height - d66 * d68, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d67 * d68, d65, d66, d67);
  493.         this.worldObj.spawnParticle("smoke", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d65 * d68, this.posY + this.rand.nextFloat() * this.height - d66 * d68, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d67 * d68, d65, d66, d67);
  494.         this.worldObj.spawnParticle("explode", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d65 * d68, this.posY + this.rand.nextFloat() * this.height - d66 * d68, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d67 * d68, d65, d66, d67);
  495.         this.worldObj.spawnParticle("flame", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d65 * d68, this.posY + this.rand.nextFloat() * this.height - d66 * d68, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d67 * d68, d65, d66, d67);
  496.         }
  497.  
  498.         this.chargeTime = 0;
  499.         XCEntityGod.evilState = 1;
  500.         this.actionStop = 4;
  501.     }
  502.  
  503.     if (XCEntityGod.evilState == 1) {
  504.  
  505.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.7D);
  506.         final double d11 = this.rand.nextGaussian() * 0.02D;
  507.         final double d27 = this.rand.nextGaussian() * 0.02D;
  508.         final double d39 = this.rand.nextGaussian() * 0.02D;
  509.         final double d53 = 10D;
  510.  
  511.         for (int i = 0; i < 3; i++) {
  512.  
  513.         this.worldObj.spawnParticle("largesmoke", this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width - d11 * d53, this.posY + this.rand.nextFloat() * this.height - d27 * d53, this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width - d39 * d53, d11, d27, d39);
  514.         }
  515.     }
  516.  
  517.     if (evilState == 1 && this.rand.nextInt(40) == 0) {
  518.  
  519.         final int j1 = this.rand.nextInt(15) - this.rand.nextInt(15);
  520.         final int i3 = this.rand.nextInt(15) - this.rand.nextInt(15);
  521.         final int j4 = this.rand.nextInt(15) - this.rand.nextInt(15);
  522.         final int k5 = this.rand.nextInt(15) - this.rand.nextInt(15);
  523.         final int k6 = this.rand.nextInt(15) - this.rand.nextInt(15);
  524.         final int l7 = this.rand.nextInt(15) - this.rand.nextInt(15);
  525.         final int l8 = MathHelper.floor_double(this.posX);
  526.         final int l9 = MathHelper.floor_double(this.boundingBox.minY);
  527.         final int j12 = MathHelper.floor_double(this.posZ);
  528.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, l8 + j1, l9 - 3, j12 + i3));
  529.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, l8 + j4, l9 - 3, j12 + k5));
  530.         this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, l8 + k6, l9 - 3, j12 + l7));
  531.     }
  532.  
  533.     if (evilState == 1 && this.rand.nextInt(50) == 1) {
  534.  
  535.         final int k1 = this.rand.nextInt(15) - this.rand.nextInt(15);
  536.         final int j3 = this.rand.nextInt(15) - this.rand.nextInt(15);
  537.         final int k4 = this.rand.nextInt(15) - this.rand.nextInt(15);
  538.         final int l5 = this.rand.nextInt(15) - this.rand.nextInt(15);
  539.         final int l6 = this.rand.nextInt(15) - this.rand.nextInt(15);
  540.         final int i8 = this.rand.nextInt(15) - this.rand.nextInt(15);
  541.         final int i9 = MathHelper.floor_double(this.posX);
  542.         final int i10 = MathHelper.floor_double(this.boundingBox.minY);
  543.         final int k12 = MathHelper.floor_double(this.posZ);
  544.         this.worldObj.createExplosion(this, this.posX + k1, this.posY + 2D, this.posZ + j3, 1.0F, this.hasAttacked);
  545.         this.worldObj.createExplosion(this, this.posX + k4, this.posY + 2D, this.posZ + l5, 1.0F, this.hasAttacked);
  546.         this.worldObj.createExplosion(this, this.posX + l6, this.posY + 2D, this.posZ + i8, 1.0F, this.hasAttacked);
  547.     }
  548.  
  549.     super.attackEntity(par1Entity, par2);
  550.     }
Advertisement
Add Comment
Please, Sign In to add comment