Beispiel #1
0
 void initMembers()
 {
     timer             = 0f;
     damage            = turretStats.GetStatValue(StatType.DAMAGE);
     damageInterval    = damage > 20 ? 1 / 20 : 1 / damage;
     damagePerTick     = damage > 20 ? Mathf.RoundToInt(damage / 20) : 1;
     areTargetsInRange = false;
 }
 public override void UpdateComponent()
 {
     if (timer >= turretStats.GetStatValue(StatType.ATTACKSPEED))
     {
         slowEnemies();
     }
     else
     {
         timer += Time.deltaTime;
     }
 }
 public override void UpdateComponent()
 {
     if (!isFull)
     {
         if (timer >= turretStats.GetStatValue(StatType.ATTACKSPEED))
         {
             spawn();
             timer = 0f;
         }
         else
         {
             timer += Time.deltaTime;
         }
     }
 }
Beispiel #4
0
 public override void UpdateComponent()
 {
     checkIfPlanningPhaseChanged();
     if (!onPlanningPhase)
     {
         if (timer >= turretStats.GetStatValue(StatType.ATTACKSPEED))
         {
             extract();
             timer = 0f;
         }
         else
         {
             timer += Time.deltaTime;
         }
     }
 }
    private void slowEnemies()
    {
        if (ReferenceEquals(targetDetection, null))
        {
            return;
        }

        float secondsSlowed = turretStats.GetStatValue(StatType.EFFECTDURATION);
        float slowReduction = turretStats.GetStatValue(StatType.SLOWREDUCTION);

        foreach (Transform target in targetDetection.CurrentTargets)
        {
            ISlowable enemyISlowable = target.GetComponent <ISlowable>();
            if (enemyISlowable != null)
            {
                enemyISlowable.Slow(secondsSlowed, slowReduction);
            }
        }
        timer = 0f;
    }
Beispiel #6
0
 void shootEnemies()
 {
     if (ReferenceEquals(targetDetection, null))
     {
         return;
     }
     if (timer >= turretStats.GetStatValue(StatType.ATTACKSPEED))
     {
         foreach (Transform target in targetDetection.CurrentTargets)
         {
             spawnAndInitializeProjectile(target);
         }
         callShotBehaviours();
         resetTimer();
     }
     else
     {
         timer += Time.deltaTime;
     }
 }
 void getStats()
 {
     damageReductionDuration = turretStats.GetStatValue(StatType.EFFECTDURATION);
     damageReduction         = turretStats.GetStatValue(StatType.DAMAGEREDUCTION);
 }
Beispiel #8
0
 bool isTimeToDamage()
 {
     return(timer >= turretStats.GetStatValue(StatType.ATTACKSPEED));
 }
 void getStats()
 {
     slowDuration  = turretStats.GetStatValue(StatType.EFFECTDURATION);
     slowReduction = turretStats.GetStatValue(StatType.SLOWREDUCTION);
 }
 bool isTimeToStartAnimation()
 {
     return(timer >= turretStats.GetStatValue(StatType.ATTACKSPEED));
 }