예제 #1
0
    void Shackles()
    {
        cols = Physics.OverlapSphere(character.transform.position, 8f);
        int _mp = Skill_Register.GetSkill("MagicSkill4").mp_use;

        if (Property_Controller.Instance.Get_CurrentMP() >= _mp &&
            TargetExist() &&
            cd[3] <= 0)
        {
            used_skill = true;
            Property_Controller.Instance.Change_CurrentMP(-_mp);
            cd[3] = Skill_Register.GetSkill("MagicSkill4").cd;
            Property_Controller.Instance.Change_CurrentMP(-_mp);
            DestroyForTime_CSP destroy = shackle_particle.GetComponent <DestroyForTime_CSP>();
            animator.SetTrigger("shackle_trigger");
            float timer = Skill_Register.GetSkill("MagicSkill4").skill_level * 0.5f + 2f;
            destroy.timer = timer;
            for (int i = 0; i < cols.Length; i++)
            {
                if (cols[i] != null && cols[i].tag == "monster")
                {
                    Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                    monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("MagicSkill4"));
                    Instantiate(shackle_particle, cols[i].transform.position, cols[i].transform.rotation);
                    monster.stop = true;
                }
            }
            Collider[] temp_cols = cols;

            StartCoroutine(UnShackles(temp_cols, timer));
        }
    }
예제 #2
0
    public void Bomb()
    {
        int _mp = Skill_Register.GetSkill("MagicSkill1").mp_use;

        if (Property_Controller.Instance.Get_CurrentMP() >= _mp &&
            cd[0] <= 0)
        {
            used_skill = true;
            cd[0]      = Skill_Register.GetSkill("MagicSkill1").cd;
            Property_Controller.Instance.Change_CurrentMP(-_mp);
            //mp-=20;
            animator.SetTrigger("bomb_trigger");
            cols = Physics.OverlapSphere(character.transform.position, 5f);
            for (int i = 0; i < cols.Length; i++)
            {
                if (cols[i] != null && cols[i].tag == "monster")
                {
                    Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                    monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("MagicSkill1"));
                }
            }
            Instantiate(bomb_particle, character.transform.position, character.transform.rotation);
            character.transform.position -= character.transform.forward * 8f;
        }
    }
예제 #3
0
 void UltimateDamage()
 {
     for (int i = 0; i < cols.Length; i++)
     {
         if (cols[i] != null && cols[i].tag == "monster")
         {
             Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
             monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("SwordSkill3"));
         }
     }
 }
예제 #4
0
    IEnumerator StrikeDone2(Collider[] _cols)
    {
        yield return(new WaitForSeconds(1.2f));

        for (int i = 0; i < cols.Length; i++)
        {
            if (_cols[i] != null && cols[i].tag == "monster")
            {
                Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                monster.stop = false;
            }
        }
    }
예제 #5
0
    IEnumerator UnShackles(Collider[] _cols, float timer)
    {
        yield return(new WaitForSeconds(timer));

        //Debug.Log("!!!");
        for (int i = 0; i < cols.Length; i++)
        {
            if (_cols[i] != null && cols[i].tag == "monster")
            {
                Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                monster.stop = false;
            }
        }
    }
예제 #6
0
 void CallLightning()
 {
     for (int i = 0; i < cols.Length; i++)
     {
         if (cols[i] != null && cols[i].tag == "monster")
         {
             if (UnityEngine.Random.Range(0, 100) > 30)
             {
                 Instantiate(lightning_particle, cols[i].transform.position, cols[i].transform.rotation);
                 Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                 monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("MagicSkill2"));
             }
         }
     }
 }
예제 #7
0
 void StrikeDone()
 {
     for (int i = 0; i < cols.Length; i++)
     {
         if (cols[i].tag == "monster")
         {
             Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
             monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("SwordSkill2"));
             Instantiate(slash_particle, cols[i].transform.position, cols[i].transform.rotation);
             Instantiate(strike_sound, character.transform.position, character.transform.rotation);
         }
     }
     character.transform.Find("Swordman_Body001").SendMessage("show");
     character.transform.Find("Swordman_Sword").SendMessage("show");
 }
예제 #8
0
 void Rotate_Around()
 {
     cols = Physics.OverlapSphere(transform.position, 1f);
     for (int i = 0; i < cols.Length; i++)
     {
         if (cols[i] != null && cols[i].tag == "monster")
         {
             Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
             monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("MagicSkill3"));
         }
     }
     transform.RotateAround(character.transform.position, Vector3.up, 20);
     transform.LookAt(character.transform.position);
     transform.position  = character.transform.position;
     transform.position -= transform.forward * 3f;
     transform.position  = new Vector3(transform.position.x, 0, transform.position.z);
     //if (Vector3.Dot(transform.forward, character.transform.GetChild(0).forward) < 0)
     //{
     Instantiate(particle, transform.position, transform.rotation);
     //}
 }
예제 #9
0
 void FlameMode()
 {
     if (Property_Controller.Instance.Get_CurrentMP() < 1)
     {
         flame_mode = false;
     }
     if (flame_mode && Property_Controller.Instance.Get_CurrentMP() >= 1)
     {
         Property_Controller.Instance.Change_CurrentMP(-1);
         cols = Physics.OverlapSphere(character.transform.position, 5f);
         Property_Controller.Instance.Change_AD(-ad_add);
         ad_add = (int)(Property_Controller.Instance.Get_AD() * 0.3);
         Property_Controller.Instance.Change_AD(ad_add);
         for (int i = 0; i < cols.Length; i++)
         {
             if (cols[i] != null && cols[i].tag == "monster")
             {
                 Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                 monster.Monster_Manage_Change_Hp(-Skill_Damage.Instance.GetDamage("SwordSkill4"));
             }
         }
     }
 }
예제 #10
0
    public void Strike()
    {
        int _mp = Skill_Register.GetSkill("SwordSkill2").mp_use;

        cols = Physics.OverlapSphere(character.transform.position + character.transform.forward * 3, 3f);
        if (Property_Controller.Instance.Get_CurrentMP() >= _mp &&
            TargetExist() &&
            cd[1] <= 0)
        {
            used_skill = true;
            cd[1]      = Skill_Register.GetSkill("SwordSkill2").cd;
            Property_Controller.Instance.Change_CurrentMP(-_mp);
            int i;
            character.transform.Find("Swordman_Body001").SendMessage("hide");
            character.transform.Find("Swordman_Sword").SendMessage("hide");
            animator.SetTrigger("strike_trigger");
            //GameObject child = character.transform.FindChild("Swordman_Body001")as GameObject;
            //GetComponentsInChildren<renderer>
            //if(child.renderer)
            //	child.renderer.material.color = new Color(renderer.material.color.r,renderer.material.color.g,renderer.material.color.b,0);
            for (i = 0; i < cols.Length; i++)
            {
                Debug.Log(cols[i].name);
                if (cols[i] != null && cols[i].tag == "monster")
                {
                    Instantiate(fen_shen, cols[i].transform.position - cols[i].transform.forward, cols[i].transform.rotation);
                    Monster_Manage monster = cols[i].GetComponent <Monster_Manage>();
                    monster.stop = true;
                    //Instantiate (slash_particle, cols[i].transform.position, cols[i].transform.rotation);
                    //Instantiate (slash_particle, cols[i].transform.position, cols[i].transform.rotation);
                }
            }
            Invoke("StrikeDone", 1.2f);
            Collider[] temp_cols = cols;
            StartCoroutine(StrikeDone2(temp_cols));
        }
    }