Esempio n. 1
0
    void ActiveUltDef(Blessing _input)
    {
        if (pStats.stamina >= 10)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0))
            {
                pStats.stamina -= 10;
                _input.SetDuration(3);

                PlayerAudio.Ult();
                sm.SetNextState("UltDef");
            }
        }

        if (_input.GetDuration() > 0)
        {
            pStats.passiveDefMultiplyer += 100;
        }
    }
Esempio n. 2
0
    void ActiveWarCry(Blessing _input)
    {
        if (pStats.stamina >= 5)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0))
            {
                pStats.stamina -= 5;
                _input.SetDuration(10);

                PlayerAudio.Roar();
                sm.SetNextState("WarCry");
            }
        }

        if (_input.GetDuration() > 0)
        {
            pStats.passiveDmgMultiplyer += 30;
            pStats.passiveDefMultiplyer += 40;
        }
    }
Esempio n. 3
0
    void ActiveBash(Blessing _input)
    {
        if (pStats.stamina >= 2)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType()) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType()))
            {
                List <List <GameObject> > list = SpawnerManager.Instance.GetAllEntity();

                foreach (List <GameObject> i in list)
                {
                    foreach (GameObject obj in i)
                    {
                        Vector3 target = new Vector3(transform.position.x, 0, transform.position.z) - new Vector3(obj.transform.position.x, 0, obj.transform.position.z);
                        float   Angle  = Vector3.Angle(model.forward, target);

                        if (Angle < 90f && Angle > -90f)
                        {
                            if (obj.GetComponent <EnemyScript>() != null)
                            {
                                obj.GetComponent <EnemyScript>().SetKnockBack(-target.normalized);
                            }
                        }
                    }
                }

                pStats.stamina -= 2;
            }
        }
    }
Esempio n. 4
0
    void ActiveDash(Blessing _input)
    {
        if (pStats.stamina >= 1 && !sm.IsCurrentState("Dash"))
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType()) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType()))
            {
                //print("BLESSING TPYE: " + _input.GetBlessingType());
                //print("BLESSING SLOT 0: " + blessing_inven[0].GetBlessingType());
                //print("BLESSING SLOT 1: " + blessing_inven[1].GetBlessingType());

                sm.SetNextState("Dash");
                pStats.stamina -= 1;
            }
        }
    }
Esempio n. 5
0
    void ActiveSmite(Blessing _input)
    {
        if (pStats.stamina >= 5)
        {
            if (((Input.GetButtonDown("Skill_Use_Left") || SwipeControls.SwipeUp) && blessing_inven[0].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0) ||
                ((Input.GetButtonDown("Skill_Use_Right") || SwipeControls.SwipeDown) && blessing_inven[1].GetBlessingType() == _input.GetBlessingType() && _input.GetDuration() <= 0))
            {
                pStats.stamina -= 5;

                for (int i = 0; i < 3; ++i)
                {
                    GameObject obj = SpawnerManager.Instance.GetSkillEntityObjectFromPool("firebomb");
                    obj.GetComponent <SkillFireBomb>().SetParent(gameObject.GetInstanceID());

                    obj.transform.position = new Vector3(transform.position.x + (new IntRange(-2, 2).Random), 1f, transform.position.z + (new IntRange(-2, 2).Random));
                }

                sm.SetNextState("Smite");
            }
        }
    }