Ejemplo n.º 1
0
    public void Job_Upgrade()
    {
        if (BackEndDataManager.instance.Get_Item((Item_Type)data["reward_0"]) >= Job_.Get_Price((int)data["num"]))
        {
            BackEndDataManager.instance.Set_Item((Item_Type)data["reward_0"], Job_.Get_Price((int)data["num"]), Calculate_Type.mius);

            Job_info info_ = BackEndDataManager.instance.Job_Data.job_info.Find(x => x.int_num.Equals((int)data["num"]));

            if (info_ == null)
            {
                Job_info job_ = new Job_info()
                {
                    int_lv   = (int)Job_.Job_Lv,
                    int_num  = (int)data["num"],
                    str_time = BackEndDataManager.instance.WebCheck().AddSeconds((int)data["job_time"] + 1).ToString()
                };

                BackEndDataManager.instance.Job_Data.job_info.Add(job_);
            }
            else
            {
                info_.int_lv += (int)Job_.Job_Lv;
            }

            UiManager.instance.Check_Progress_Reward(Progress_Reward_Type.job_upgrade, (int)Job_.Job_Lv);
            Game_info_.Set_Game_Info(Game_Info_Type.job_upgrade, (int)Job_.Job_Lv);
            Quest_.Check_Daily_Quest(Daily_Quest_Type.job_upgrade, (int)Job_.Job_Lv);

            BackEndDataManager.instance.Save_Job_Data();

            Set_Item();
            Check_Slider();
        }
    }
Ejemplo n.º 2
0
    public void Buy()
    {
        Debug.Log(total);

        if (BackEndDataManager.instance.Get_Item((Item_Type)skill.price_type) >= total)
        {
            UiManager.instance.Check_Progress_Reward(Progress_Reward_Type.skill_upgrade, (int)Skill_s.skill_lv);
            Game_info_.Set_Game_Info(Game_Info_Type.skill_upgrade, (int)Skill_s.skill_lv);
            Quest_.Check_Daily_Quest(Daily_Quest_Type.skill_upgrade, (int)Skill_s.skill_lv);

            Skill_info skill_Info = BackEndDataManager.instance.Skill_Data.skill_Info.Find(x => x.int_num.Equals(skill.num));

            if (skill_Info == null)
            {
                skill_Info = new Skill_info
                {
                    int_num = skill.num,
                    int_lv  = (int)Skill_s.skill_lv
                };

                BackEndDataManager.instance.Skill_Data.skill_Info.Add(skill_Info);
            }
            else
            {
                skill_Info.int_lv += (int)Skill_s.skill_lv;
            }

            BackEndDataManager.instance.Set_Item((Item_Type)skill.price_type, total, Calculate_Type.mius);

            Skill_s.Set_Skill_Val(skill_Info.int_num, skill_Info.int_lv);

            Player_stat.Set_Player_Stat((Ability_Type)skill.ability_type);
            BackEndDataManager.instance.Save_Skill_Data();
            Set_Sub_Txt();

            UiManager.instance.Check_Skill();

            switch (skill.num)
            {
            case 0:
                PlayManager.instance.Start_Skill_0();
                break;

            case 1:
                PlayManager.instance.Start_Skill_1();

                break;

            case 2:
                PlayManager.instance.Start_Skill_2();

                break;

            default:
                break;
            }
        }
    }
Ejemplo n.º 3
0
    public void Get_Quest_Reward()
    {
        if (type.Equals(Quest_Type.daily))
        {
            Quest_.Check_Daily_Quest(Daily_Quest_Type.daily_clear, 1);
            Game_info_.Set_Game_Info(Game_Info_Type.daily_quest_clear, 1);
        }

        Quest_info quest_Info = BackEndDataManager.instance.Quest_Data.quest_Info
                                .Find(x => x.int_num.Equals(num) && x.type.Equals(type));

        quest_Info.int_clear += 1;
        BigInteger big = BigInteger.Parse(data["reward_val_0"].ToString());

        UiManager.instance.Set_QuestItem((Item_Type)data["reward_0"], big);

        BackEndDataManager.instance.Set_Item((Item_Type)data["reward_0"], big, Calculate_Type.plus);

        BackEndDataManager.instance.Save_Quest_Data();
        Set_Val();
    }
Ejemplo n.º 4
0
    public void Totem_Upgrade()
    {
        if (BackEndDataManager.instance.Get_Item((Item_Type)data["price_type"]) >= Totem_.Get_Price((int)data["num"]))
        {
            Quest_.Check_Daily_Quest(Daily_Quest_Type.totem_upgrade, (int)Totem_.totem_Lv);
            Game_info_.Set_Game_Info(Game_Info_Type.totem_upgrade, (int)Totem_.totem_Lv);

            UiManager.instance.Check_Progress_Reward(Progress_Reward_Type.totem_upgrade, (int)Totem_.totem_Lv);

            BackEndDataManager.instance.Set_Item((Item_Type)data["price_type"],
                                                 Totem_.Get_Price((int)data["num"]), Calculate_Type.mius);

            Totem_info info_ = BackEndDataManager.instance.Totem_Data.totem_info.Find(x => x.int_num.Equals((int)data["num"]));

            info_.int_lv += (int)Totem_.totem_Lv;

            BackEndDataManager.instance.Save_Totem_Data();

            Check_Btn();
            Set_Item();
        }
    }
Ejemplo n.º 5
0
    public static void Get_Sweep(int val)
    {
        Game_info_.Set_Game_Info(Game_Info_Type.undergroind_clear, val);
        Game_info_.Set_Game_Info(Game_Info_Type.undergroind_join, val);

        Underground_info Db_Info = BackEndDataManager.instance.Content_Data.underground_info
                                   .Find(x => x.int_num.Equals(Underground_Lv));

        underground_Info = Db_Info;

        BackEndDataManager.instance.Set_Item(Item_Type.underground_ticket, val, Calculate_Type.mius);
        BackEndDataManager.instance.Set_Item(Get_Reward_0_Type(), Get_Reward_0() * val, Calculate_Type.plus);
        BackEndDataManager.instance.Set_Item(Get_Reward_1_Type(), Get_Reward_1() * val, Calculate_Type.plus);


        Underground_Item.Clear();

        Get_Underground_Random_Item();

        Set_Underground_Random_Item();

        UiManager.instance.Set_Underground_Reward_Txt(val);
    }
Ejemplo n.º 6
0
    public void Set_Val()
    {
        Quest_info quest_Info = BackEndDataManager.instance.Quest_Data.quest_Info
                                .Find(x => x.int_num.Equals(num) && x.type.Equals(type));

        if (quest_Info == null)
        {
            quest_Info = new Quest_info
            {
                int_num   = num,
                type      = type,
                int_clear = 0,
                int_val   = 0
            };

            BackEndDataManager.instance.Quest_Data.quest_Info.Add(quest_Info);
            BackEndDataManager.instance.Save_Quest_Data();
        }

        BigInteger count = (int)data["count"];

        switch (type)
        {
        case Quest_Type.daily:

            if (quest_Info.int_clear >= 1)
            {
                txt_quest_success.gameObject.SetActive(true);
                txt_quest_get.gameObject.SetActive(false);
                txt_quest_ing.gameObject.SetActive(false);
                btn_quest.interactable = false;
            }
            else
            {
                txt_quest_success.gameObject.SetActive(false);

                if (quest_Info.int_val >= count)
                {
                    txt_quest_get.gameObject.SetActive(true);
                    txt_quest_ing.gameObject.SetActive(false);
                    btn_quest.interactable = true;
                }
                else
                {
                    txt_quest_get.gameObject.SetActive(false);
                    txt_quest_ing.gameObject.SetActive(true);
                    btn_quest.interactable = false;
                }
            }

            txt_quest_val.text = string.Format("{0}/{1}", quest_Info.int_val, count);

            break;

        case Quest_Type.accumulate:

            game_info_type = (int)data["game_info_type"];

            txt_quest_success.gameObject.SetActive(false);

            if ((int)data["val_type"] == 0)
            {
                count = (int)data["count"] + (int)data["val_amount_0"] * quest_Info.int_clear;
            }
            else
            {
                float percent = (float)data["val_amount_0"] * 100;

                count = Calculate.Price((int)data["count"], (int)percent, quest_Info.int_clear, 1);
            }

            if (Game_info_.Get_Game_info((Game_Info_Type)game_info_type) >= count)
            {
                txt_quest_get.gameObject.SetActive(true);
                txt_quest_ing.gameObject.SetActive(false);
                btn_quest.interactable = true;
            }
            else
            {
                txt_quest_get.gameObject.SetActive(false);
                txt_quest_ing.gameObject.SetActive(true);
                btn_quest.interactable = false;
            }

            switch ((Accumulate_Quest_Type)num)
            {
            case Accumulate_Quest_Type.upgrade_stone:
            case Accumulate_Quest_Type.limit_stone:
            case Accumulate_Quest_Type.black_stone:
            case Accumulate_Quest_Type.crystal:
            case Accumulate_Quest_Type.coin:
            case Accumulate_Quest_Type.steel:
            case Accumulate_Quest_Type.player_level:
                txt_quest_val.text = string.Format("{0}/{1}", UiManager.instance.GetGoldString(Game_info_.Get_Game_info((Game_Info_Type)game_info_type)), UiManager.instance.GetGoldString(count));

                break;

            default:
                txt_quest_val.text = string.Format("{0}/{1}", Game_info_.Get_Game_info((Game_Info_Type)game_info_type), count);

                break;
            }

            break;

        default:
            break;
        }
    }
Ejemplo n.º 7
0
    IEnumerator Co_Die()
    {
        switch (PlayManager.instance.Stage_State)
        {
        case Stage_State.stage:
            PlayManager.instance.Change_State(Player_State.Run);
            Add_Stage_Data();
            UiManager.instance.Check_Progress_Reward(Progress_Reward_Type.monster, 1);
            break;

        case Stage_State.underground:
            PlayManager.instance.Change_State(Player_State.Run);

            if (monster_Type.Equals(Monster_Type.underground_Boss))
            {
                Underground_.underground_Info.int_Max_Boss += 1;
            }
            else
            {
                Underground_.underground_Info.int_Max_Monster += 1;
            }

            UiManager.instance.Set_Underground_Info();
            Underground_.Get_Underground_Random_Item();

            break;

        case Stage_State.upgrade:

            PlayManager.instance.Change_State(Player_State.Reward);
            UiManager.instance.Set_Upgrade_Reward(true);
            PlayManager.instance.End_Upgrade();
            break;

        case Stage_State.hell:

            PlayManager.instance.Change_State(Player_State.Run);

            Hell_.int_Max_Monster += 1;

            UiManager.instance.Set_Hell_Info();

            break;

        default:
            break;
        }

        monster_State = Monster_State.Die;

        anim_Monster.Play("die");

        switch (monster_Type)
        {
        case Monster_Type.Basic:

            PlayManager.instance.Set_Monster();
            Game_info_.Set_Game_Info(Game_Info_Type.monster, 1);
            Quest_.Check_Daily_Quest(Daily_Quest_Type.monster, 1);
            break;

        case Monster_Type.Boss:

            PlayManager.instance.Stop_Boss_Timer(false);
            Game_info_.Set_Game_Info(Game_Info_Type.boss, 1);
            break;

        case Monster_Type.underground_Boss:
            PlayManager.instance.Set_Monster();

            break;

        case Monster_Type.upgrade_Boss:

            break;

        case Monster_Type.hell_Boss:
            PlayManager.instance.Set_Monster();

            break;

        case Monster_Type.goblin:

            Item item = Item_s.Get_Random_Goblin_Item();

            BackEndDataManager.instance.Set_Item((Item_Type)item.item_num, item.val, Calculate_Type.plus);

            PlayManager.instance.Set_Monster();
            Game_info_.Set_Game_Info(Game_Info_Type.gold_goblin, 1);

            break;

        default:
            break;
        }


        yield return(new WaitForSeconds(1.0f));

        Destroy(gameObject);
    }