public override void Upgrade()
    {
        int num = 50;

        if (this.masterStorehouse != null)
        {
            num = int.Parse(this.masterStorehouse.limitMeatNum);
        }
        FacilityMeatFieldM facilityMeatFarmMaster = FarmDataManager.GetFacilityMeatFarmMaster(this.userFacility.level + 1);

        if (facilityMeatFarmMaster != null)
        {
            if (num < int.Parse(facilityMeatFarmMaster.maxMeatNum))
            {
                CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(delegate(int selectButton)
                {
                    if (selectButton == 0)
                    {
                        this.UpgradeMeatFarm();
                    }
                }, "CMD_Confirm", null) as CMD_Confirm;
                cmd_Confirm.Title = StringMaster.GetString("SystemConfirm");
                cmd_Confirm.Info  = StringMaster.GetString("FacilityUpgradeMeatOver");
            }
            else
            {
                this.UpgradeMeatFarm();
            }
        }
    }
Ejemplo n.º 2
0
    public static string GetFacilityEffectDetail(int facilityID, int level)
    {
        string result = string.Empty;

        switch (facilityID)
        {
        case 1:
        {
            FacilityMeatFieldM facilityMeatFarmMaster = FarmDataManager.GetFacilityMeatFarmMaster(level);
            result = facilityMeatFarmMaster.maxMeatNum;
            break;
        }

        case 2:
        {
            FacilityWarehouseM facilityStorehouseMaster = FarmDataManager.GetFacilityStorehouseMaster(level);
            result = facilityStorehouseMaster.limitMeatNum;
            break;
        }

        case 3:
        {
            FacilityRestaurantM facilityRestaurantM = FarmDataManager.GetFacilityRestaurantMaster(level);
            result = facilityRestaurantM.maxStamina;
            break;
        }

        default:
            if (facilityID == 25)
            {
                FacilityChipM facilityChipFarmMaster = FarmDataManager.GetFacilityChipFarmMaster(level);
                result = facilityChipFarmMaster.maxChipNum;
            }
            break;

        case 7:
        {
            FacilityHouseM facilityDigiHouseMaster = FarmDataManager.GetFacilityDigiHouseMaster(level);
            result = facilityDigiHouseMaster.maxMonsterNum;
            break;
        }

        case 8:
        {
            FacilityExpUpM facilityDigimonGymMaster = FarmDataManager.GetFacilityDigimonGymMaster(level);
            result = facilityDigimonGymMaster.upRate;
            break;
        }
        }
        return(result);
    }
Ejemplo n.º 3
0
    private void OnTapMeatShortCut(int idx)
    {
        if (idx == 0)
        {
            bool flag = FarmUtility.IsShortage(2.ToString(), ConstValue.MEAT_SHORTCUT_DEGISTONE_NUM.ToString());
            if (flag)
            {
                CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(new Action <int>(this.OnCloseConfirmShop), "CMD_Confirm", null) as CMD_Confirm;
                cmd_Confirm.Title      = string.Format(StringMaster.GetString("SystemShortage"), "デジストーン");
                cmd_Confirm.Info       = string.Format(StringMaster.GetString("FacilityShortcutShortage"), "デジストーン");
                cmd_Confirm.BtnTextYes = StringMaster.GetString("SystemButtonGoShop");
                cmd_Confirm.BtnTextNo  = StringMaster.GetString("SystemButtonClose");
            }
            else
            {
                UserFacility userFacility = Singleton <UserDataMng> .Instance.GetUserFacility(this.userFacilityID);

                int          cropCount      = this.GetCropCount(this.GetPassSeconds(), userFacility.level);
                UserFacility userStorehouse = Singleton <UserDataMng> .Instance.GetUserStorehouse();

                FacilityMeatFieldM facilityMeatFarmMaster = FarmDataManager.GetFacilityMeatFarmMaster(userFacility.level);
                int num = int.Parse(facilityMeatFarmMaster.maxMeatNum);
                if (cropCount >= num)
                {
                    CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
                    cmd_ModalMessage.Title   = StringMaster.GetString("MeatShortCutTitle3");
                    cmd_ModalMessage.Info    = StringMaster.GetString("MeatShortCutText3");
                    cmd_ModalMessage.BtnText = "OK";
                }
                else if (!this.IsOverMeatNum(num, userStorehouse))
                {
                    this.MeatShortCutSelect(0);
                }
                else
                {
                    CMD_Confirm cmd_Confirm2 = GUIMain.ShowCommonDialog(new Action <int>(this.MeatShortCutSelect), "CMD_Confirm", null) as CMD_Confirm;
                    cmd_Confirm2.Title = StringMaster.GetString("MeatShortCutTitle2");
                    cmd_Confirm2.Info  = StringMaster.GetString("MeatShortCutText2");
                }
            }
        }
        else if (idx == 1)
        {
        }
    }
Ejemplo n.º 4
0
    public void OnTapShortCutButton()
    {
        UserFacility userFacility = Singleton <UserDataMng> .Instance.GetUserFacility(this.userFacilityID);

        int cropCount = this.GetCropCount(this.GetPassSeconds(), userFacility.level);
        FacilityMeatFieldM facilityMeatFarmMaster = FarmDataManager.GetFacilityMeatFarmMaster(userFacility.level);
        int num = int.Parse(facilityMeatFarmMaster.maxMeatNum);

        if (cropCount >= num)
        {
            CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage;
            cmd_ModalMessage.Title   = StringMaster.GetString("MeatShortCutTitle3");
            cmd_ModalMessage.Info    = StringMaster.GetString("MeatShortCutText3");
            cmd_ModalMessage.BtnText = "OK";
        }
        else
        {
            CMD_Confirm cmd_Confirm = GUIMain.ShowCommonDialog(new Action <int>(this.OnTapMeatShortCut), "CMD_Confirm", null) as CMD_Confirm;
            cmd_Confirm.Title = StringMaster.GetString("MeatShortCutTitle1");
            cmd_Confirm.Info  = string.Format(StringMaster.GetString("MeatShortCutText1"), ConstValue.MEAT_SHORTCUT_DEGISTONE_NUM);
        }
    }