Пример #1
0
    public void Damaged(MeeleAttack MA)
    {
        if (!NoMoreDamage)
        {
            Health -= MA.Damage;
            CountDamage++;
            if (CountDamage > 1 && !NoMoreDamage)
            {
                NoMoreDamage = true;
                Jump         = true;
                CanJump      = true;
                anim.SetTrigger("jump");
            }
            else if (MA.Damage > 5 && !NoMoreDamage)
            {
                anim.SetTrigger("Damaged");
            }

            print(MA.Damage);
        }
        if (Health <= 0)
        {
            Dead();
        }
    }
Пример #2
0
 public void Damaged(MeeleAttack MA)
 {
     Health -= MA.Damage;
     if (Health <= 0)
     {
         Dead();
     }
 }
Пример #3
0
 /// <summary>
 /// (Virtual Void) Character gets Damaged By a Meele Attack
 /// </summary>
 /// <param name="MA"></param>
 // Es el metodo donde recibira daño Donovan con un MeeleAttack
 public virtual void Damaged(MeeleAttack MA)
 {
     CurrentHealth -= MA.Damage;
     if (CurrentHealth <= 0)
     {
         Dead();
     }
 }
Пример #4
0
        private void MeeleAttack()
        {
            inMeeleAttack           = true;
            currentAnimation        = meleeAttackAnimation;
            currentAnimation.XIndex = 0;

            Ability ability = new MeeleAttack(this, Position, speed, direction);

            abilityBuffer.Add(ability);
        }
Пример #5
0
 private void initReferences()
 {
     rb2d        = GetComponent <Rigidbody2D>();
     healthCom   = new HealthComponent(this);
     state       = new Searching(rb2d, speed);
     animator    = GetComponentInChildren <Animator>();
     animCom     = new AnimationController(animator);
     meeleAttack = GetComponentInChildren <MeeleAttack>();
     rangeAttack = GetComponentInChildren <RangeAttack>();
     if (meeleAttack != null)
     {
         attackComponents.Add(meeleAttack);
     }
     if (rangeAttack != null)
     {
         attackComponents.Add(rangeAttack);
     }
 }
Пример #6
0
 protected override void Aggro()
 {
     if (Vector3.Distance(car.transform.position, transform.position) > aggroDistance * 4)
     {
         currentState = EnemyState.Idle;
         stateTimer   = 0;
     }
     else if (MeeleAttack.ObjectWithTagWithinRange(cCollider.radius * transform.lossyScale.x, transform.position + (car.transform.position - transform.position).normalized * cCollider.radius * 2 * transform.lossyScale.x, gameObject, "Player"))
     {
         if (stateTimer > 3f)
         {
             currentState = EnemyState.Attack;
             var targ = car.transform.position;
             targ.y = transform.position.y;
             Quaternion rotato = Quaternion.LookRotation(targ - transform.position);
             transform.rotation = rotato;
         }
     }
     else
     {
         PathTo(car.transform.position, acceleration);
     }
 }
Пример #7
0
 public override void Initialize(GameObject obj)
 {
     enemy = obj.GetComponentInChildren <MeeleAttack>();
 }
Пример #8
0
 public void AttackLand()
 {
     MeeleAttack.MakeMeeleAttack(attackDamage, cCollider.radius * transform.lossyScale.x, transform.position + transform.forward * cCollider.radius * 2 * transform.lossyScale.x, health, attackForce * rb.mass, "Enemy");
 }
    public void Attack()
    {
        MeeleAttack.Action(punch1.position, punch1Radius, 9, 100, false);

        MeeleAttackBGObjects.Action(punch1.position, punch1Radius, 12, 50, false);
    }
Пример #10
0
 void Update() {
     Attack = JsonLoader.attacks.MeeleAttacks[indexAttack];
 }
Пример #11
0
 void Awake() {
     JsonLoader.LoadData();
     Attack = JsonLoader.attacks.MeeleAttacks[indexAttack];
 }