示例#1
0
  /** Sets the spider's glowing eyes */
  protected int setSpiderEyeBrightness(EntitySpider par1EntitySpider, int par2, float par3) {
    if (par2 != 0) {
      return -1;
    } else {
      this.loadTexture("/mob/spider_eyes.png");
      float f1 = 1.0F;
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);

      if (par1EntitySpider.isInvisible()) {
        GL11.glDepthMask(false);
      } else {
        GL11.glDepthMask(true);
      }

      char c0 = 61680;
      int j = c0 % 65536;
      int k = c0 / 65536;
      OpenGlHelper.setLightmapTextureCoords(
          OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
      return 1;
    }
  }
  protected int func_77097_a(EntitySpider p_77097_1_, int p_77097_2_, float p_77097_3_) {
    if (p_77097_2_ != 0) {
      return -1;
    } else {
      this.func_76985_a("/mob/spider_eyes.png");
      float var4 = 1.0F;
      GL11.glEnable(3042);
      GL11.glDisable(3008);
      GL11.glBlendFunc(1, 1);
      if (p_77097_1_.func_82150_aj()) {
        GL11.glDepthMask(false);
      } else {
        GL11.glDepthMask(true);
      }

      char var5 = '\uf0f0';
      int var6 = var5 % 65536;
      int var7 = var5 / 65536;
      OpenGlHelper.func_77475_a(
          OpenGlHelper.field_77476_b, (float) var6 / 1.0F, (float) var7 / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, var4);
      return 1;
    }
  }
示例#3
0
 @Override
 protected void func_110147_ax() {
   super.func_110147_ax();
   this.func_110148_a(SharedMonsterAttributes.field_111264_e)
       .func_111128_a(TFC_MobData.SpiderDamage);
   this.func_110148_a(SharedMonsterAttributes.field_111267_a)
       .func_111128_a(TFC_MobData.SpiderHealth); // MaxHealth
 }
 @Override
 protected void applyEntityAttributes() {
   super.applyEntityAttributes();
   this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(22.0D);
   this.getEntityAttribute(SharedMonsterAttributes.movementSpeed)
       .setBaseValue(ConfigManagerCore.hardMode ? 1.2F : 1.0F);
   this.getEntityAttribute(SharedMonsterAttributes.attackDamage)
       .setBaseValue(ConfigManagerCore.hardMode ? 4.0D : 2.0D);
 }
示例#5
0
 protected void scaleSpider(EntitySpider par1EntitySpider, float par2) {
   float f1 = par1EntitySpider.spiderScaleAmount();
   GL11.glScalef(f1, f1, f1);
 }
  public void onLivingUpdate() {
    if (!this.onGround && this.motionY < 0.0D) {
      this.motionY *= 0.8D;
    }

    for (int var5 = 0; var5 < 2; ++var5) {
      // "witchMagic"
      this.worldObj.spawnParticle(
          EnumParticleTypes.SPELL_WITCH,
          this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width,
          this.posY + this.rand.nextDouble() * (double) this.height,
          this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width,
          0.0D,
          0.0D,
          0.0D);
    }

    EntitySpider mob;
    if (this.getHealth() < EntityAttributes.maxHealth2 * 0.75F
        && this.getHealth() > 0.0F
        && this.spawn == 0
        && !this.worldObj.isRemote) {
      mob = new EntitySpider(this.worldObj);
      mob.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
      // mob.onSpawnWithEgg((IEntityLivingData)null);
      mob.onInitialSpawn(
          this.worldObj.getDifficultyForLocation(new BlockPos(mob)), (IEntityLivingData) null);
      this.worldObj.spawnEntityInWorld(mob);
      this.spawn = 1;
    }

    if (this.getHealth() < EntityAttributes.maxHealth2 * 0.25F
        && this.getHealth() > 0.0F
        && this.spawn == 1
        && !this.worldObj.isRemote) {
      mob = new EntitySpider(this.worldObj);
      mob.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
      // mob.onSpawnWithEgg((IEntityLivingData)null);
      mob.onInitialSpawn(
          this.worldObj.getDifficultyForLocation(new BlockPos(mob)), (IEntityLivingData) null);
      this.worldObj.spawnEntityInWorld(mob);
      this.spawn = 2;
    }

    if (!this.worldObj.isRemote) {
      if (this.getAggressive()) {
        if (this.witchAttackTimer-- <= 0) {
          this.setAggressive(false);
          ItemStack var6 = this.getHeldItem();
          this.setCurrentItemOrArmor(0, (ItemStack) null);
          if (var6 != null && var6.getItem() == Items.potionitem) {
            List var2 = Items.potionitem.getEffects(var6);
            if (var2 != null) {
              Iterator var3 = var2.iterator();

              while (var3.hasNext()) {
                PotionEffect var4 = (PotionEffect) var3.next();
                this.addPotionEffect(new PotionEffect(var4));
              }
            }
          }

          this.getEntityAttribute(SharedMonsterAttributes.movementSpeed)
              .removeModifier(field_110185_bq);
        }
      } else {
        short var7 = -1;
        if (this.rand.nextFloat() < 0.15F
            && this.isInsideOfMaterial(Material.water)
            && !this.isPotionActive(Potion.waterBreathing)) {
          var7 = 8237;
        } else if (this.rand.nextFloat() < 0.15F
            && this.isBurning()
            && !this.isPotionActive(Potion.fireResistance)) {
          var7 = 16307;
        } else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) {
          var7 = 16341;
        } else if (this.rand.nextFloat() < 0.25F
            && this.getAttackTarget() != null
            && !this.isPotionActive(Potion.moveSpeed)
            && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) {
          var7 = 16274;
        } else if (this.rand.nextFloat() < 0.25F
            && this.getAttackTarget() != null
            && !this.isPotionActive(Potion.moveSpeed)
            && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) {
          var7 = 16274;
        }

        if (var7 > -1) {
          this.setCurrentItemOrArmor(0, new ItemStack(Items.potionitem, 1, var7));
          this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration();
          this.setAggressive(true);
          IAttributeInstance iattributeinstance =
              this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
          iattributeinstance.removeModifier(field_110185_bq);
          iattributeinstance.applyModifier(field_110185_bq);
        }
      }

      if (this.rand.nextFloat() < 7.5E-4F) {
        this.worldObj.setEntityState(this, (byte) 15);
      }
    }

    super.onLivingUpdate();
  }
 protected void func_77096_a(EntitySpider p_77096_1_, float p_77096_2_) {
   float var3 = p_77096_1_.func_70840_n();
   GL11.glScalef(var3, var3, var3);
 }