private bool CheckStamina()
        {
            GameWebAPI.WD_Req_DngStart lastDngReq = DataMng.Instance().GetResultUtilData().GetLastDngReq();
            GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM worldDungeonMaster = ClassSingleton <QuestData> .Instance.GetWorldDungeonMaster(lastDngReq.dungeonId);

            int num = int.Parse(worldDungeonMaster.needStamina);

            GameWebAPI.RespDataCP_Campaign respDataCP_Campaign   = DataMng.Instance().RespDataCP_Campaign;
            GameWebAPI.RespDataCP_Campaign.CampaignInfo campaign = respDataCP_Campaign.GetCampaign(GameWebAPI.RespDataCP_Campaign.CampaignType.QuestStmDown, worldDungeonMaster.worldStageId);
            if (campaign != null)
            {
                float num2 = (float)num;
                num = Mathf.CeilToInt(num2 * float.Parse(campaign.rate));
            }
            return(num <= DataMng.Instance().RespDataUS_PlayerInfo.playerInfo.stamina);
        }
예제 #2
0
    private DataMng.ExperienceInfo GetExpInfo()
    {
        float num = 1f;

        GameWebAPI.RespDataCP_Campaign respDataCP_Campaign = DataMng.Instance().RespDataCP_Campaign;
        if (respDataCP_Campaign != null && !DataMng.Instance().CampaignForceHide)
        {
            GameWebAPI.RespDataCP_Campaign.CampaignInfo campaign = respDataCP_Campaign.GetCampaign(GameWebAPI.RespDataCP_Campaign.CampaignType.MeatExpUp, false);
            if (campaign != null)
            {
                num = campaign.rate.ToFloat();
            }
        }
        float num2 = (float)DataMng.Instance().GetExpFromMeat(this.execMeatNum) * num;
        int   exp  = int.Parse(CMD_MealExecution.DataChg.userMonster.ex) + (int)num2;

        return(DataMng.Instance().GetExperienceInfo(exp));
    }
예제 #3
0
 private void Update()
 {
     if (FarmRoot.Instance != null && this.enabledCamera != FarmRoot.Instance.Camera.enabled)
     {
         this.enabledCamera = FarmRoot.Instance.Camera.enabled;
         if (this.enabledCamera)
         {
             GameWebAPI.RespDataCP_Campaign respDataCP_Campaign = DataMng.Instance().RespDataCP_Campaign;
             if (respDataCP_Campaign != null)
             {
                 this.campaignInfo = respDataCP_Campaign.GetCampaign(GameWebAPI.RespDataCP_Campaign.CampaignType.MeatHrvUp, false);
             }
             else
             {
                 this.campaignInfo = null;
             }
         }
     }
     this.SetCampaignPlate((!(FarmRoot.Instance.SettingObject.farmObject == this) || FarmRoot.Instance.SettingObject.settingMode != FarmObjectSetting.SettingMode.BUILD) && !base.IsConstruction() && this.campaignInfo != null);
 }
    public override void ShowGUI()
    {
        base.ShowGUI();
        switch (this.WorldDungeonData.status)
        {
        case 1:
            this.ngSPR_NEW.gameObject.SetActive(false);
            break;

        case 2:
            this.ngSPR_NEW.MakePixelPerfect();
            break;

        case 3:
            this.ngSPR_NEW.gameObject.SetActive(false);
            break;

        case 4:
            this.SetClearIcon();
            break;
        }
        if (this.ngTXT_STAGE != null)
        {
            if (ClassSingleton <QuestData> .Instance.ExistSortieLimit(this.WorldDungeonData.dungeon.worldDungeonId))
            {
                this.ngTXT_STAGE.text = StringMaster.GetString("QuestLimited");
            }
            else if (CMD_QuestTOP.instance.IsSpecialDungeon())
            {
                this.ngTXT_STAGE.text = StringMaster.GetString("QuestSpecial");
            }
            else
            {
                this.ngTXT_STAGE.text = string.Format(StringMaster.GetString("QuestStage"), this.StageNum.ToInt32());
            }
        }
        if (this.ngTXT_STAGE_NAME != null)
        {
            this.ngTXT_STAGE_NAME.text = this.WorldDungeonData.worldDungeonM.name;
        }
        if (!this.IsEventStage)
        {
            string worldStageId = this.WorldDungeonData.worldDungeonM.worldStageId;
            GameWebAPI.RespDataCP_Campaign respDataCP_Campaign = DataMng.Instance().RespDataCP_Campaign;
            this.campaignInfo = respDataCP_Campaign.GetCampaign(GameWebAPI.RespDataCP_Campaign.CampaignType.QuestStmDown, worldStageId);
            if (this.ngTXT_STAMINA != null)
            {
                int num = int.Parse(this.WorldDungeonData.worldDungeonM.needStamina);
                if (this.campaignInfo != null)
                {
                    float num2 = (float)num;
                    num = Mathf.CeilToInt(num2 * float.Parse(this.campaignInfo.rate));
                }
                this.ngTXT_STAMINA.text = string.Format(StringMaster.GetString("QuestStaminaCost"), num);
            }
            if (null != this.backgroundBord && null != this.backgroundLine)
            {
                if (this.WorldDungeonData.worldDungeonM.IsMultiOnly())
                {
                    this.colorMultiStage.a            = this.backgroundBord.color.a;
                    this.backgroundBord.color         = this.colorMultiStage;
                    this.colorMultiStage.a            = this.backgroundLine.color.a;
                    this.backgroundLine.color         = this.colorMultiStage;
                    this.colorMultiStageNameOutline.a = this.ngTXT_STAGE_NAME.effectColor.a;
                    this.ngTXT_STAGE_NAME.effectColor = this.colorMultiStageNameOutline;
                    this.ngTXT_STAMINA.effectColor    = this.colorMultiStageNameOutline;
                }
                else if (this.WorldDungeonData.worldDungeonM.IsSoloOnly())
                {
                    this.colorSoloStage.a             = this.backgroundBord.color.a;
                    this.backgroundBord.color         = this.colorSoloStage;
                    this.colorSoloStage.a             = this.backgroundLine.color.a;
                    this.backgroundLine.color         = this.colorSoloStage;
                    this.colorSoloStageNameOutline.a  = this.ngTXT_STAGE_NAME.effectColor.a;
                    this.ngTXT_STAGE_NAME.effectColor = this.colorSoloStageNameOutline;
                    this.ngTXT_STAMINA.effectColor    = this.colorSoloStageNameOutline;
                }
                else
                {
                    this.colorNormalStage.a               = this.backgroundBord.color.a;
                    this.backgroundBord.color             = this.colorNormalStage;
                    this.colorNormalStage.a               = this.backgroundLine.color.a;
                    this.backgroundLine.color             = this.colorNormalStage;
                    this.colorSoloMultiStageNameOutline.a = this.ngTXT_STAGE_NAME.effectColor.a;
                    this.ngTXT_STAGE_NAME.effectColor     = this.colorSoloMultiStageNameOutline;
                    this.ngTXT_STAMINA.effectColor        = this.colorSoloMultiStageNameOutline;
                }
            }
            this.campagin.AreaId = worldStageId;
            string text = this.campagin.GetText(DataMng.Instance().RespDataCP_Campaign, DataMng.Instance().CampaignForceHide);
            this.SetExtraEffectDescription(worldStageId, text);
        }
        else
        {
            this.SetEventStageParts();
        }
        if (null != CMD_QuestTOP.instance)
        {
            QuestData.WorldStageData worldStageData = CMD_QuestTOP.instance.GetWorldStageData();
            if ("8" == worldStageData.worldStageM.worldAreaId)
            {
                this.ngTXT_TICKET_LEFT.gameObject.SetActive(true);
                if (!string.IsNullOrEmpty(this.WorldDungeonData.dungeon.dungeonTicketNum))
                {
                    this.ngTXT_TICKET_LEFT.text = string.Format(StringMaster.GetString("TicketQuestLeftNum"), int.Parse(this.WorldDungeonData.dungeon.dungeonTicketNum));
                }
                else
                {
                    this.ngTXT_TICKET_LEFT.text = string.Format(StringMaster.GetString("TicketQuestLeftNum"), 0);
                }
            }
            else
            {
                this.RefreshShowPlayLimit();
            }
        }
        this.ShowNoContinue();
        this.ShowLockStatus();
    }
예제 #5
0
    public void CheckCampaign(Action <int> finish, GameWebAPI.RespDataCP_Campaign.CampaignType[] campaign_type)
    {
        GameWebAPI.RespDataCP_Campaign respDataCP_Campaign = DataMng.Instance().RespDataCP_Campaign;
        bool isExistedData = false;

        GameWebAPI.RespDataCP_Campaign.CampaignInfo currentInfo = null;
        GameWebAPI.RespDataCP_Campaign.CampaignType currentType = GameWebAPI.RespDataCP_Campaign.CampaignType.Invalid;
        for (int i = 0; i < campaign_type.Length; i++)
        {
            GameWebAPI.RespDataCP_Campaign.CampaignInfo campaign = respDataCP_Campaign.GetCampaign(campaign_type[i], true);
            if (campaign != null)
            {
                isExistedData = true;
                currentInfo   = campaign;
                currentType   = campaign_type[i];
                break;
            }
        }
        bool isExistNewData = false;

        GameWebAPI.RespDataCP_Campaign.CampaignInfo newInfo = null;
        GameWebAPI.RequestCP_Campaign request = new GameWebAPI.RequestCP_Campaign
        {
            SetSendData = delegate(GameWebAPI.CP_Req_Campaign param)
            {
                param.campaignId = (int)currentType;
            },
            OnReceived = delegate(GameWebAPI.RespDataCP_Campaign response)
            {
                if (currentType != GameWebAPI.RespDataCP_Campaign.CampaignType.Invalid)
                {
                    GameWebAPI.RespDataCP_Campaign.CampaignInfo campaign2 = response.GetCampaign(currentType, false);
                    if (campaign2 != null)
                    {
                        isExistNewData = true;
                        newInfo        = campaign2;
                    }
                }
                else
                {
                    for (int j = 0; j < campaign_type.Length; j++)
                    {
                        GameWebAPI.RespDataCP_Campaign.CampaignInfo campaign3 = response.GetCampaign(campaign_type[j], false);
                        if (campaign3 != null)
                        {
                            isExistNewData = true;
                            newInfo        = campaign3;
                            break;
                        }
                    }
                }
            }
        };
        base.StartCoroutine(request.RunOneTime(delegate()
        {
            if (isExistedData && isExistNewData && currentInfo != null && newInfo != null && !currentInfo.IsEqualInfo(newInfo))
            {
                isExistedData = false;
            }
            if (isExistedData && !isExistNewData)
            {
                if (finish != null)
                {
                    finish(1);
                }
            }
            else if (!isExistedData && isExistNewData)
            {
                if (finish != null)
                {
                    finish(2);
                }
            }
            else if (finish != null)
            {
                finish(0);
            }
        }, delegate(Exception nop)
        {
            if (finish != null)
            {
                finish(-1);
            }
        }, null));
    }