Exemplo n.º 1
0
    IEnumerator modeHelper(int newMode)
    {
        transformSound.Play();

        anim.SetTrigger("Transform");
        isAttacking   = true;
        changingmodes = true;
        yield return(new WaitForSeconds(2f));

        for (int i = 0; i < 50; i++)
        {
            GameObject g = Instantiate(vapeNache, transform.position, Random.rotation);
            g.GetComponent <Rigidbody>().velocity = Random.onUnitSphere * 3;
            Destroy(g, 1f);
        }
        currentAttack = attacks[newMode];
        currentMode.SetActive(false);
        currentMode = modes[newMode];
        currentMode.SetActive(true);
        anim          = currentMode.GetComponent <Animator>();
        isAttacking   = false;
        changingmodes = false;

        transformSound.Stop();
    }
Exemplo n.º 2
0
    //////////////////////////////////////////////////////////////////////////////
    //                              MAIN METHODS                                //
    //////////////////////////////////////////////////////////////////////////////
    void Start()
    {
        switch (playerNumber)
        {
        case 1:
            inputFunc = leftStick;
            break;

        case 2:
            inputFunc = rightStick;
            break;

        case 3:
            inputFunc = leftStick2;
            break;

        case 4:
            inputFunc = rightStick2;
            break;
        }

        currentMode = modes[0];
        anim        = currentMode.GetComponent <Animator>();
        attacks     = new attackDelegate[3];
        attacks[0]  = basicAttack;
        attacks[1]  = tankAttac;
        attacks[2]  = swardAttac;

        currentAttack = attacks[0];
        rb            = GetComponent <Rigidbody>();
        currentHealth = maxHealth;
    }
Exemplo n.º 3
0
    IEnumerator DoDynamicRam()
    {
        //Startup

        isAttacking = true;
        animator.SetTrigger("DYNAMIC_RAM");
        yield return(new WaitForSeconds(15 * (1f / 60f)));

        attackMovementDelegate += MoveForward;
        Debug.Log("Ram2");
        yield return(new WaitForSeconds((comboJSON.getStartup("DYNAMIC_RAM") - 15) * (1f / 60f)));

        //Active
        GameObject hitbox = HitboxPooler.Instance.SpawnFromPool("DYNAMIC_RAM", comboJSON.getPosition("DYNAMIC_RAM"));

        hitbox.GetComponent <PlayerHitboxController>().setDamage(comboJSON.getDamage("DYNAMIC_RAM"));

        yield return(new WaitForSeconds(comboJSON.getActive("DYNAMIC_RAM") * (1f / 60f)));


        //Endlag
        hitbox.SetActive(false);
        yield return(new WaitForSeconds(comboJSON.getEndlag("DYNAMIC_RAM") * (1f / 60f)));

        EndAttack();
    }
Exemplo n.º 4
0
 private void resetBase()
 {
     currentAttack = attacks[0];
     currentMode.SetActive(false);
     currentMode = modes[0];
     currentMode.SetActive(true);
     anim = currentMode.GetComponent <Animator>();
 }
Exemplo n.º 5
0
 private void EndAttack()
 {
     isAttacking            = false;
     canMoveWhileAttacking  = false;
     attackMovementDelegate = null;
     timeOfLastAttack       = Time.time;
     AttackQueueManager();
 }
Exemplo n.º 6
0
    /**
     *
     * @brief
     * metoda odpowiedzialna za wykonanie ataku,
     * losuje wykonanie odpowiedniej akcji
     */

    protected virtual IEnumerator Attack()
    {
        switch (Random.Range(0, 100))
        {
        case int n when(n > alternativeAttackChance):
            attacking = StandardAttack;

            break;

        default:
            attacking = AlternativeAttack;
            break;
        }
        yield return(new WaitForSeconds(0.1F));
    }
Exemplo n.º 7
0
    IEnumerator DoBombDash()
    {
        float runningTime = 40f;

        isAttacking = true;
        animator.SetTrigger("BOMB_DASH");
        IgnoreEnemyCollision(true);
        for (int i = 0; i < 3; i++)
        {
            attackMovementDelegate += MoveForward;
            yield return(new WaitForSeconds(runningTime * (1f / 60f)));

            attackMovementDelegate = null;
            velocity.y             = 5f;
            yield return(new WaitForSeconds(runningTime * (1f / 60f)));

            // drop bomb
            GameObject         bombPrefab = ObjectPooler.Instance.SpawnFromPool(Pool.BOMB, transform.position, Quaternion.identity);
            BombDashController bomb       = bombPrefab.GetComponent <BombDashController>();
        }
        IgnoreEnemyCollision(false);
        EndAttack();
    }
Exemplo n.º 8
0
 public AttackAct(attackDelegate _attackDel, int _enactTime, int _amount = 1)
 {
     attackDel = _attackDel;
     enactTime = --_enactTime;
     amount    = _amount;
 }