Exemplo n.º 1
0
    public static BigInteger Get_Price(int num)
    {
        Dictionary <string, object> data = BackEndDataManager.instance.totem_csv_data[num];

        Totem_info info_ = BackEndDataManager.instance.Totem_Data.totem_info.Find(x => x.int_num.Equals(num));

        BigInteger price = BigInteger.Parse(data["price_val"].ToString(), System.Globalization.NumberStyles.Float);

        float percnet = (float)data["price_percent"] * 100;

        BigInteger total = info_ == null ? price : Calculate.Price(price, (int)percnet, info_.int_lv - 1, (int)totem_Lv);

        return(total);
    }
Exemplo n.º 2
0
    public void Check_Btn()
    {
        Totem_info info_ = BackEndDataManager.instance.Totem_Data.totem_info.Find(x => x.int_num.Equals((int)data["num"]));

        btn_totem_Upgrade.gameObject.SetActive(info_ != null);
        btn_totem_Buy.gameObject.SetActive(info_ == null);

        float percnet = (float)data["price_percent"] * 100;

        BigInteger total = Totem_.Get_Price((int)data["num"]);

        btn_totem_Upgrade.interactable = BackEndDataManager.instance.Get_Item((Item_Type)data["price_type"]) >= total;

        btn_totem_Buy.interactable = BackEndDataManager.instance.Get_Item(Item_Type.dia) >= 500;
    }
Exemplo n.º 3
0
    public void Totem_Buy()
    {
        if (BackEndDataManager.instance.Get_Item(Item_Type.dia) >= 500)
        {
            BackEndDataManager.instance.Set_Item(Item_Type.dia, 500, Calculate_Type.mius);

            Totem_info totem_Info = new Totem_info
            {
                int_num = (int)data["num"],
                int_lv  = 1
            };

            BackEndDataManager.instance.Totem_Data.totem_info.Add(totem_Info);
            BackEndDataManager.instance.Save_Totem_Data();

            Check_Btn();
            Set_Item();
        }
    }
Exemplo n.º 4
0
    public static float Get_Reward(int num)
    {
        Dictionary <string, object> data = BackEndDataManager.instance.totem_csv_data[num];

        Totem_info info_ = BackEndDataManager.instance.Totem_Data.totem_info.Find(x => x.int_num.Equals(num));

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

        int _type = Ability_.Get_Ability_Type(ability_type);

        float val = (float)data["base_ability"] * (_type.Equals(0) ? 100 : 1);

        float add = (float)data["ability_add"] * (_type.Equals(0) ? 100 : 1);

        decimal add_result = (decimal)add * (info_ == null ? 0 : info_.int_lv - 1);

        float resultValue = val + (float)add_result;

        return(resultValue);
    }
Exemplo n.º 5
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();
        }
    }
Exemplo n.º 6
0
    public void Set_Item()
    {
        Totem_info info_ = BackEndDataManager.instance.Totem_Data.totem_info.Find(x => x.int_num.Equals((int)data["num"]));

        int    ability_type = (int)data["ability_type"];
        int    _type        = Ability_.Get_Ability_Type(ability_type);
        float  val          = (float)data["base_ability"] * (_type.Equals(0) ? 100 : 1);
        float  add          = Totem_.Get_Add_Reward((int)data["num"]);
        string sign         = Ability_.Ability_Type_Sign(ability_type);

        txt_totem_Lv.text = string.Format("{0}.{1}", "Lv", info_ == null ? 0 : info_.int_lv);

        txt_totem_sub.text = Ability_.Get_Ability_Nmae(ability_type);

        txt_totem_val.text = string.Format("{0}{1}", Totem_.Get_Reward((int)data["num"]), sign);

        txt_totem_add_reward.text = string.Format("+{0} ({1})",
                                                  string.Format("{0}{1}", add, sign), (int)Totem_.totem_Lv);

        txt_totem_price_val.text = UiManager.instance.GetGoldString(Totem_.Get_Price((int)data["num"]));

        Check_Btn();
    }