Ejemplo n.º 1
0
 public void TryChangeAttackMethod()
 {
     if (!attacking)
     {
         if (timeChangeAttack == 0)
         {
             if (DoRangedAttack)
             {
                 timeChangeAttack = Time.time + MAX_TIME_RANGED_ATTACK;
             }
             else
             {
                 timeChangeAttack = Time.time + MAX_TIME_CHANGE_ATTACK;
             }
         }
         if (Time.time > timeChangeAttack)
         {
             DoRangedAttack = !DoRangedAttack;
             if (DoRangedAttack)
             {
                 _iaFollowActor.ForceRandomMove(false);
             }
             else
             {
                 _iaFollowActor.ForceRandomMove(true);
             }
             timeChangeAttack = 0;
         }
     }
 }
Ejemplo n.º 2
0
    public override void Attack()
    {
        if (!Alive || IsKnockOut || Stunned)
        {
            return;
        }
        base.Attack();
        comboHit++;

        switch (comboHit)
        {
        case 1:
            CurrentDamage        = DamageNormal;
            CurrentDamage.Combo  = 1;
            CurrentDamage.SfxHit = SfxHit1;

            break;

        case 2:
            CurrentDamage.Combo  = 2;
            CurrentDamage.SfxHit = SfxHit1;
            break;
        }
        if (comboHit == hitDurations.Length)
        {
            CurrentDamage = DamageStrong;
            _iaFollowActor.ForceRandomMove(true);
            CurrentDamage.Combo  = 3;
            CurrentDamage.SfxHit = SfxHit1;
        }

        if (comboHit > hitDurations.Length)
        {
            comboHit = 1;
        }

        timeNextAttack = Time.time + hitDurations[comboHit - 1];
        timeNextHit    = timeNextAttack;
    }