Esempio n. 1
0
 void Start()
 {
     attack      = DoAttack;
     canAttack   = true;
     animHandler = GetComponent <YT_PCAnimationHandler>();
     itemCharge  = GetComponent <ItemCharge>();
     activeItem  = GetComponentInChildren <ItemDetection>();
 }
Esempio n. 2
0
    IEnumerator AttackIntervale()
    {
        yield return(new WaitForSeconds(attackIntervale));

        canAttack = true;
        Debug.Log("AttackIntervaleOver");
        yield return(attack = DoAttack);

        StopAllCoroutines();
    }
Esempio n. 3
0
    IEnumerator cacAttackCoroutine()
    {
        yield return(new WaitForSeconds(impactTime));

        canAttack = false;
        print("Hello");

        yield return(new WaitForSeconds(0.1f));

        animHandler.animator.SetBool("Attack", false);
        yield return(attack = dontAttack);

        print("Goodbye");
    }
Esempio n. 4
0
    public void HandleAttack(attackFunc attack, IHitable target, FSMbase sender, float attackPoint, bool cancelAttack = false, bool isKnockBack = false)
    {
        AttackMessage m = attack.Invoke(target, sender, attackPoint);

        if (!m.criCalculated)
        {
            m.CriCalculate(sender.status.getCurrentStat(STAT.CriticalPoint), sender.status.getCurrentStat(STAT.CriticalDamage));
        }
        m.CalcDefense(target, sender);
        target.TakeAttack(m.FinalDamage, cancelAttack);
        if (isKnockBack)
        {
            target.TakeKnockBack(m.knockBackForce, m.knockBackDir);
        }
        var mHit = target as HitableBase;

        if (effectManager != null)
        {
            if (mHit == null)
            {
                effectManager.defaultEffect(target, m.isCritical ? m.critEffectType : m.effectType);
            }
        }
    }