Exemplo n.º 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();
        }
    }
Exemplo n.º 2
0
 public void Damaged(MeeleAttack MA)
 {
     Health -= MA.Damage;
     if (Health <= 0)
     {
         Dead();
     }
 }
Exemplo n.º 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();
     }
 }
Exemplo n.º 4
0
        private void MeeleAttack()
        {
            inMeeleAttack           = true;
            currentAnimation        = meleeAttackAnimation;
            currentAnimation.XIndex = 0;

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

            abilityBuffer.Add(ability);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 7
0
 public override void Initialize(GameObject obj)
 {
     enemy = obj.GetComponentInChildren <MeeleAttack>();
 }
Exemplo n.º 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);
    }
Exemplo n.º 10
0
 void Update() {
     Attack = JsonLoader.attacks.MeeleAttacks[indexAttack];
 }
Exemplo n.º 11
0
 void Awake() {
     JsonLoader.LoadData();
     Attack = JsonLoader.attacks.MeeleAttacks[indexAttack];
 }