Exemplo n.º 1
0
    public void only_debug()
    {
        //power_list ThisResult_C = (power_list)Random.Range(0,4); // 0~3
        //Debug.Log("ThisResult_C:  " + ThisResult_C);

        for (int i = 0; i < power.Length; i++)
        {
            power_list b = (power_list)i;
            Debug.Log("power " + i + "    " + check_list.Load(b.ToString()));
        }
    }
Exemplo n.º 2
0
    IEnumerator check_power()
    {
        while (true)
        {
            yield return(new WaitForSeconds(0.5f));

            for (int i = 0; i < power.Length; i++)
            {//enum형식에 for 적용하려고 하는데 모르겠따.
                power_list a = (power_list)i;
                if (check_list.Load(a.ToString()) == 1)
                {
                    //Debug.Log("answer is " + a.ToString());
                    power[i].SetActive(true);
                    before_power[i].SetActive(false);
                }
                else
                {
                    power[i].SetActive(false);
                    before_power[i].SetActive(true);
                    //Debug.Log("Instpertor length:  " + power.Length);
                }
            }
        }
    }
Exemplo n.º 3
0
 public void initiaze_power()
 {
     for (int i = 0; i < 22; i++) //초기화 기능 넣기
     {
         power_list a = (power_list)i;
         if (check_list.Load(a.ToString()) == 1)
         {
             if (i == 0)
             {
                 DataController.Instance.health -= 100;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 1)
             {
                 DataController.Instance.attack -= 100;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 2)
             {
                 DataController.Instance.mana -= 100;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 3)
             {
                 DataController.Instance.special -= 100;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 4)
             {
                 DataController.Instance.health -= 300;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 5)
             {
                 DataController.Instance.attack -= 300;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 6)
             {
                 DataController.Instance.mana -= 300;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 7)
             {
                 DataController.Instance.special -= 300;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 8)
             {
                 DataController.Instance.health -= 500;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 9)
             {
                 DataController.Instance.attack -= 500;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 10)
             {
                 DataController.Instance.mana -= 500;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 11)
             {
                 DataController.Instance.special -= 500;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 12)
             {
                 DataController.Instance.health -= 1000;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 13)
             {
                 DataController.Instance.attack -= 1000;;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 14)
             {
                 DataController.Instance.mana -= 1000;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 15)
             {
                 DataController.Instance.special -= 1000;
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 16)
             {
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 17)
             {
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 18)
             {
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 19)
             {
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 20)
             {
                 check_list.Save(a.ToString(), 0);
             }
             else if (i == 21)
             {
                 check_list.Save(a.ToString(), 0);
             }
         }
     }
 }
Exemplo n.º 4
0
    public void choose_power()
    {
        select_rank();
        if (DataController.Instance.power_ticket >= 1)
        {
            if (result == 1)
            {
                int count = 0;
                while (true)
                {
                    //C_power_list asdsd = (C_power_list)1;
                    power_list ThisResult_C = (power_list)Random.Range(0, 4); // 0~3
                    bool       get          = false;

                    for (int i = 0; i < 4; i++)
                    {
                        if (ThisResult_C == (power_list)i)
                        {
                            power_list b = (power_list)i;
                            if (check_list.Load(b.ToString()) == 0) //새로운걸 얻을떄
                            {
                                if (i == 0)                         //eBonusState_50,
                                {
                                    DataController.Instance.health += 100;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "체력 스탯 +100";
                                    power_grade = "C";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 1)    //eClickGold_100,
                                {
                                    DataController.Instance.attack += 100;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "공격력 스탯 +100";
                                    power_grade = "C";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 2)    //eClickExp_300,
                                {
                                    DataController.Instance.mana += 100;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "민첩 스탯 +100";
                                    power_grade = "C";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 3)    //eDamage_1000,
                                {
                                    DataController.Instance.special += 100;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "스킬공격력 스탯 +100";
                                    power_grade = "C";
                                    show_floating_text();
                                    break;
                                }
                            }
                        }
                    }
                    count++;
                    if (get == true)
                    {
                        break;
                    }
                    if (count == 50)
                    {
                        result = result + 1; //4개 전부다 보유중이므로 다른거
                        Debug.Log("네 개 다 보유중");
                        break;
                    }
                }
            }

            if (result == 2)
            {
                int count = 0;
                while (true)
                {
                    //C_power_list asdsd = (C_power_list)1;
                    power_list ThisResult_C = (power_list)Random.Range(4, 8); // 0~3
                    bool       get          = false;

                    for (int i = 4; i < 8; i++)
                    {
                        if (ThisResult_C == (power_list)i)
                        {
                            power_list b = (power_list)i;
                            if (check_list.Load(b.ToString()) == 0) //새로운걸 얻을떄
                            {
                                if (i == 4)                         //eBonusState_50,
                                {
                                    DataController.Instance.health += 300;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "체력 스탯 +300";
                                    power_grade = "B";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 5)    //eClickGold_100,
                                {
                                    DataController.Instance.attack += 300;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "공격력 스탯 +300";
                                    power_grade = "B";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 6)    //eClickExp_300,
                                {
                                    DataController.Instance.mana += 300;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "민첩 스탯 +300";
                                    power_grade = "B";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 7)    //eDamage_1000,
                                {
                                    DataController.Instance.special += 300;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "스킬 공격력 스탯 +300";
                                    power_grade = "B";
                                    show_floating_text();
                                    break;
                                }
                            }
                        }
                    }
                    count++;
                    if (get == true)
                    {
                        break;
                    }
                    if (count == 50)
                    {
                        result = result + 1; //4개 전부다 보유중이므로 다른거
                        Debug.Log("네 개 다 보유중");
                        break;
                    }
                }
            }

            if (result == 3)
            {
                int count = 0;
                while (true)
                {
                    //C_power_list asdsd = (C_power_list)1;
                    power_list ThisResult_C = (power_list)Random.Range(8, 12); // 0~3
                    bool       get          = false;

                    for (int i = 8; i < 12; i++)
                    {
                        if (ThisResult_C == (power_list)i)
                        {
                            power_list b = (power_list)i;
                            if (check_list.Load(b.ToString()) == 0) //새로운걸 얻을떄
                            {
                                if (i == 8)                         //eBonusState_50,
                                {
                                    DataController.Instance.health += 500;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "체력 스탯 +500";
                                    power_grade = "A";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 9)    //eClickGold_100,
                                {
                                    DataController.Instance.attack += 500;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "공격력 스탯 +500";
                                    power_grade = "A";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 10)    //eClickExp_300,
                                {
                                    DataController.Instance.mana += 500;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "민첩 스탯 +500";
                                    power_grade = "A";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 11)    //eDamage_1000,
                                {
                                    DataController.Instance.special += 500;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "스킬 공격력 스탯 +500";
                                    power_grade = "A";
                                    show_floating_text();
                                    break;
                                }
                            }
                        }
                    }
                    count++;
                    if (get == true)
                    {
                        break;
                    }
                    if (count == 50)
                    {
                        result = result + 1; //4개 전부다 보유중이므로 다른거
                        Debug.Log("네 개 다 보유중");
                        break;
                    }
                }
            }

            if (result == 4)
            {
                int count = 0;
                while (true)
                {
                    //C_power_list asdsd = (C_power_list)1;
                    power_list ThisResult_C = (power_list)Random.Range(12, 22); // 0~3
                    bool       get          = false;

                    for (int i = 12; i < 22; i++)
                    {
                        if (ThisResult_C == (power_list)i)
                        {
                            power_list b = (power_list)i;
                            if (check_list.Load(b.ToString()) == 0) //새로운걸 얻을떄
                            {
                                if (i == 12)                        //eBonusState_50,
                                {
                                    DataController.Instance.health += 1000;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "체력 스탯 +1000";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 13)    //eClickGold_100,
                                {
                                    DataController.Instance.attack += 1000;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "공격력 스탯 +1000";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 14)    //eClickExp_300,
                                {
                                    DataController.Instance.mana += 1000;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "민첩 스탯 +1000";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 15)    //eDamage_1000,
                                {
                                    DataController.Instance.special += 1000;
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "스킬 공격력 스탯 +1000";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 16)    //warrior
                                {
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "전사의 권능";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 17)    //archer
                                {
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "궁수의 권능";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 18)    //wizard
                                {
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "마법사의 권능";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 19)    //goldhand
                                {
                                    DataController.Instance.MultiplyGoldPerClick(50);
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "황금의 손";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 20)    //timestop
                                {
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "시간의 권능";
                                    power_grade = "S";
                                    show_floating_text();
                                    break;
                                }
                                if (i == 21)    //timestop
                                {
                                    check_list.Save(b.ToString(), 1);
                                    get         = true;
                                    power_name  = "불멸자";
                                    power_grade = "EX";
                                    show_floating_text();
                                    break;
                                }
                            }
                        }
                    }
                    count++;
                    if (get == true)
                    {
                        break;
                    }
                    if (count == 50)
                    {
                        result = result + 1; //4개 전부다 보유중이므로 다른거
                        goToPanel.Instance.show_noticePanel();
                        goToPanel.Instance.NoticePanel.GetComponentInChildren <Text>().text = "뽑을 수 있는 권능이 없습니다.";
                        DataController.Instance.power_ticket++;
                        break;
                    }
                }
            }
            SoundManager.Instance.upgrade_button_sound();
            DataController.Instance.power_ticket--;
        }
        else
        {
            goToPanel.Instance.show_noticePanel();
            goToPanel.Instance.NoticePanel.GetComponentInChildren <Text>().text = "권능 뽑기권이 부족합니다.";
        }


        Debug.Log("result =  " + result);
        //DataController.Instance.goldPerClick = DataController.Instance.level * DataController.Instance.besu;
    }
Exemplo n.º 5
0
    public int return_power_list(int i)
    {
        power_list a = (power_list)i;

        return(check_list.Load(a.ToString()));
    }