Пример #1
0
 /// <summary>
 /// logic for tadashi charg attack
 /// </summary>
 private void TadashiChargeAttack()
 {
     if (EnemyAttacks_SebastianMol.ChargeAttack(m_playerTransform, ref m_attackTimer,
                                                m_attackCollider, m_hitSpeed, gameObject, m_chargeAttackSpeed))
     {
         m_generateRandomNumberOnceTadashi = false; //make this ibnto a public variable
     }
 }
Пример #2
0
 /// <summary>
 /// logic for tadashi normal attack
 /// </summary>
 private void TadashiQuickAttack()
 {
     if (EnemyAttacks_SebastianMol.MelleAttack(ref m_attackTimer, m_hasChargeAttack, m_chargAttackPosibility,
                                               QuickAttack, ChargeAttack, StunAfterAttack,
                                               m_currentEnemyType, m_hitSpeed, GetComponent <Enemy_Animation_LouieWilliamson>()))
     {
         m_generateRandomNumberOnceTadashi = false;
     }
 }
Пример #3
0
 /// <summary>
 /// logic for tadashi ranged attack that uses multiple projectiles
 /// </summary>
 private void TadashiCrazyRangeAttack()
 {
     if (m_currentProjectile)
     {
         if (EnemyAttacks_SebastianMol.RangedAttack(GetComponent <Enemy_Animation_LouieWilliamson>(), m_playerTransform, transform, m_aimer,
                                                    ref m_attackTimer, m_currentProjectile, m_shootDeley))
         {
             m_generateRandomNumberOnceTadashi = false;
             m_currentProjectile = null;
         }
     }
 }
 /// <summary>
 /// ovveride class that holds logic for what the enemy shoudl do when in the attack state
 /// </summary>
 internal override void AttackBehaviour()
 {
     if (m_currentEnemyType == m_enemyType.PETTIGER)
     {
         EnemyAttacks_SebastianMol.ChargeAttack(m_playerTransform, ref m_attackTimer,
                                                m_attackCollider, m_hitSpeed, gameObject, m_chargeAttackSpeed); //make this ibnto a public variable
     }
     else
     {
         EnemyAttacks_SebastianMol.MelleAttack(ref m_attackTimer, m_hasChargeAttack, m_chargAttackPosibility, QuickAttack,
                                               ChargeAttack, StunAfterAttack, m_currentEnemyType, m_hitSpeed, GetComponent <Enemy_Animation_LouieWilliamson>());
     }
 }
Пример #5
0
 /// <summary>
 /// logic for tadashi tripple shot attack
 /// </summary>
 private void TadashiTripleShot()
 {
     if (m_tadashiMultiShotCounter < m_tadashiMultiShotCounterMax)
     {
         m_ProjectileDisplay.sprite = null;
         m_currentProjectile        = m_tadashiNormalPorjectile;
         if (EnemyAttacks_SebastianMol.RangedAttack(GetComponent <Enemy_Animation_LouieWilliamson>(), m_playerTransform, transform, m_aimer,
                                                    ref m_attackTimer, m_currentProjectile, 0.3f))
         {
             m_tadashiMultiShotCounter++;
             m_attackTimer = 0.1f;
         }
     }
     else
     {
         m_tadashiMultiShotCounter         = 0;
         m_attackTimer                     = m_shootDeley;
         m_generateRandomNumberOnceTadashi = false;
         m_currentProjectile               = null;
     }
 }
 /// <summary>
 /// ovveride class that holds logic for what the enemy shoudl do when in the attack state
 /// </summary>
 internal override void AttackBehaviour()
 {
     EnemyAttacks_SebastianMol.RangedAttack(GetComponent <Enemy_Animation_LouieWilliamson>(), m_playerTransform, transform, m_aimer, ref m_attackTimer, m_projectile, m_shootDeley);
 }
Пример #7
0
    /// <summary>
    /// ovveride class that holds logic for what the enemy shoudl do when in the attack state
    /// </summary>
    internal override void AttackBehaviour()
    {
        if (m_currentEnemyType == m_enemyType.ALIEN || m_currentEnemyType == m_enemyType.NORMAL)
        {
            if (m_randAttackChance == m_RangedAttackRandomChance - 1)
            {
                if (EnemyAttacks_SebastianMol.RangedAttack(GetComponent <Enemy_Animation_LouieWilliamson>(), m_playerTransform, transform, m_aimer,
                                                           ref m_attackTimer, m_projectile, m_shootDeley))
                {
                    m_generateRandomNumberOnce = false;
                }
            }
            else
            {
                if (EnemyAttacks_SebastianMol.MelleAttack(ref m_attackTimer, m_hasChargeAttack, m_chargAttackPosibility,
                                                          QuickAttack, ChargeAttack, StunAfterAttack,
                                                          m_currentEnemyType, m_hitSpeed, GetComponent <Enemy_Animation_LouieWilliamson>()))
                {
                    m_generateRandomNumberOnce = false;
                }
            }
        }

        if (m_currentEnemyType == m_enemyType.TADASHI)
        {
            //health above 60
            if (m_tadashiPhase == 1)
            {
                if (m_RandChanceAttackTadashi == 0)
                {
                    TadashiChargeAttack();
                }
                else
                {
                    TadashiQuickAttack();
                    //TODO cool down
                }
            }
            else if (m_tadashiPhase == 2)//health above 30 change this later
            {
                GameObject[] allLights = GameObject.FindGameObjectsWithTag(Tags_JoaoBeijinho.m_lightTag);
                foreach (var light in allLights)
                {
                    light.SetActive(false);
                    //add effect for light goign off or on or whatever
                }

                if (m_RandChanceAttackTadashiFloat > 0.3f)
                {
                    TadashiCrazyRangeAttack();
                }
                else
                {
                    TadashiTripleShot();
                }
            }
            else if (m_tadashiPhase == 3)//health below 30
            {
                //destroy all plants on this lvl
                GameObject[] allPlants = GameObject.FindGameObjectsWithTag(Tags_JoaoBeijinho.m_plant);
                foreach (var plant in allPlants)
                {
                    plant.SetActive(false);
                    //do an effect for plants to dissapoear
                }

                if (m_tadashiLastFaseAttackRand < 0.33f)
                {
                    TadashiQuickAttack();
                }
                else if (m_tadashiLastFaseAttackRand < 0.66f)
                {
                    TadashiChargeAttack();
                }
                else if (m_tadashiLastFaseAttackRand >= 0.66f)
                {
                    TadashiCrazyRangeAttack();
                }
            }
        }
    }
Пример #8
0
    /// <summary>
    /// ovveride class that holds logic for what the enemy shoudl do when in the attack state
    /// </summary>
    internal override void AttackBehaviour()
    {
        if (m_currentEnemyType == m_enemyType.PETTIGER)
        {
            if (showPathBeforAttackTigerBoss)
            {
                if (doOnceShowPath)
                {
                    doOnceShowPath = false;
                    pathFinder     = GameObject.FindObjectOfType <Pathfinder_SebastianMol>();
                    daPath         = pathFinder.PathFind((Vector2Int)pathFinder.m_tileMap.WorldToCell(m_playerTransform.position), (Vector2Int)pathFinder.m_tileMap.WorldToCell(transform.position));
                    for (int i = 0; i < daPath.Count; i++)
                    {
                        Debug.Log(daPath[i].x + " " + daPath[i].y);
                        floortilemap.SetTileFlags(new Vector3Int(daPath[i].x, daPath[i].y, 0), TileFlags.None);
                        floortilemap.SetColor(new Vector3Int(daPath[i].x, daPath[i].y, 0), Color.red);
                    }
                }
            }

            if (EnemyAttacks_SebastianMol.ChargeAttack(m_playerTransform, ref m_attackTimer,
                                                       m_attackCollider, m_hitSpeed, gameObject, m_chargeAttackSpeed)) //make this ibnto a public variable
            {
                //here teh tatack has not yet happened
                if (showPathBeforAttackTigerBoss)
                {
                    doOnceShowPath = true;
                    for (int i = 0; i < daPath.Count; i++)
                    {
                        floortilemap.SetColor(new Vector3Int(daPath[i].x, daPath[i].y, 0), Color.white);
                    }
                }
            }
            else
            {
                //here the attack has happened
                if (showPathBeforAttackTigerBoss)
                {
                    if (doOnceShowPath)
                    {
                        doOnceShowPath = false;
                        pathFinder     = GameObject.FindObjectOfType <Pathfinder_SebastianMol>();
                        daPath         = pathFinder.PathFind((Vector2Int)pathFinder.m_tileMap.WorldToCell(m_playerTransform.position), (Vector2Int)pathFinder.m_tileMap.WorldToCell(transform.position));
                        for (int i = 0; i < daPath.Count; i++)
                        {
                            Debug.Log(daPath[i].x + " " + daPath[i].y);
                            floortilemap.SetTileFlags(new Vector3Int(daPath[i].x, daPath[i].y, 0), TileFlags.None);
                            floortilemap.SetColor(new Vector3Int(daPath[i].x, daPath[i].y, 0), Color.red);
                        }
                    }
                }
            }
        }
        else
        {
            if (EnemyAttacks_SebastianMol.MelleAttack(ref m_attackTimer, m_hasChargeAttack, m_chargAttackPosibility, QuickAttack,
                                                      ChargeAttack, StunAfterAttack, m_currentEnemyType, m_hitSpeed, GetComponent <Enemy_Animation_LouieWilliamson>()))
            {
                Debug.Log("attack");
            }
        }
    }