Ejemplo n.º 1
0
 /// <summary>
 /// Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack.
 /// </summary>
 protected override void AttackEntity(Entity par1Entity, float par2)
 {
     if (AttackTime <= 0 && par2 < 1.2F && par1Entity.BoundingBox.MaxY > BoundingBox.MinY && par1Entity.BoundingBox.MinY < BoundingBox.MaxY)
     {
         AttackTime = 20;
         par1Entity.AttackEntityFrom(DamageSource.CauseMobDamage(this), AttackStrength);
     }
 }
Ejemplo n.º 2
0
        public override bool AttackEntityAsMob(Entity par1Entity)
        {
            int i = AttackStrength;

            if (IsPotionActive(Potion.DamageBoost))
            {
                i += 3 << GetActivePotionEffect(Potion.DamageBoost).GetAmplifier();
            }

            if (IsPotionActive(Potion.Weakness))
            {
                i -= 2 << GetActivePotionEffect(Potion.Weakness).GetAmplifier();
            }

            return(par1Entity.AttackEntityFrom(DamageSource.CauseMobDamage(this), i));
        }