bool IsMasterMission() { Tab_MissionBase MissionBase = TableManager.GetMissionBaseByID(m_nMissionID, 0); if (MissionBase == null) { LogModule.ErrorLog("Can not find missionBase {0}", m_nMissionID); return(false); } Tab_DailyMission DailyMission = TableManager.GetDailyMissionByID(MissionBase.DalityMissionTabID, 0); if (DailyMission == null) { LogModule.ErrorLog("Can not find dailyMission {0}", MissionBase.DalityMissionTabID); return(false); } if (DailyMission.Type == 0) { return(true); } return(false); }
void YuanBaoTipBox() { int nTotalYuanBao = 0; for (int i = 0; i < DailyMissionData.MAX_DAILYMISSION_KINDS; i++) { DailyMission rMission = GameManager.gameManager.PlayerDataPool.DailyMissionData.GetDailyMissionByKind(i); if (rMission.MissionID < 0) { continue; } bool IsHaveMission = GameManager.gameManager.MissionManager.IsHaveMission(rMission.MissionID); if (IsHaveMission) { continue; } Tab_MissionBase MissionBase = TableManager.GetMissionBaseByID(rMission.MissionID, 0); if (MissionBase == null) { return; } Tab_DailyMission DailyMission = TableManager.GetDailyMissionByID(MissionBase.DalityMissionTabID, 0); if (DailyMission == null) { return; } nTotalYuanBao += DailyMission.ConsumeBangdedYuanBao; } string str = ""; str = StrDictionary.GetClientDictionaryString("#{1538}", nTotalYuanBao); MessageBoxLogic.OpenOKCancelBox(str, null, OnMessageOK, OnCancelClick); }
void SetTipText(int nMissionID, byte yQuality) { Tab_MissionBase MissionBase = TableManager.GetMissionBaseByID(nMissionID, 0); if (MissionBase == null || MissionBase.MissionType != (int)MISSIONTYPE.MISSION_DAILY) { LogModule.ErrorLog("Can not find missionBase {0}", nMissionID); return; } Tab_DailyMission DailyMission = TableManager.GetDailyMissionByID(MissionBase.DalityMissionTabID, 0); if (DailyMission == null) { LogModule.ErrorLog("Can not find DailyMission {0}", MissionBase.DalityMissionTabID); return; } Tab_MissionDictionary MisDec = TableManager.GetMissionDictionaryByID(MissionID, 0); if (MisDec == null) { LogModule.ErrorLog("Can not find missionDictionary {0}", MissionID); return; } if (m_NameText && m_QualityColorText && m_ActivenessText && m_MisDec) { m_NameText.text = DailyMission.Name; m_QualityColorText.text = GetStrColorByQuality(yQuality); m_ActivenessText.text = "+" + DailyMission.AwardActiveness; m_MisDec.text = MisDec.MissionDesc; } return; }
void SetRewards(Tab_DailyMission mission) { if (mission.AwardMoney > 0) { SetRewardItem(mRewardIndex, ItemType.ITEM_MONEY, -1, mission.AwardMoney); mRewardIndex++; } if (mission.AwardExp > 0) { SetRewardItem(mRewardIndex, ItemType.ITEM_EXP, -1, mission.AwardExp); mRewardIndex++; } if (mission.AwardReputation > 0) { SetRewardItem(mRewardIndex, ItemType.ITEM_REPUTATION, -1, mission.AwardReputation); mRewardIndex++; } if (mission.AwardItemID > 0) { SetRewardItem(mRewardIndex, ItemType.ITEM_ITEM, mission.AwardItemID, mission.AwardItemNum); mRewardIndex++; } for (; mRewardIndex < rewards.Length; mRewardIndex++) { rewards[mRewardIndex].gameObject.SetActive(false); } rewardArea.GetComponent <UIGrid>().Reposition(); }
void UpdateButtonClick() { if (Singleton <ObjManager> .Instance.MainPlayer.IsInJianYu()) { Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2216}"); return; } Tab_MissionBase MissionBase = TableManager.GetMissionBaseByID(m_nMissionID, 0); if (MissionBase == null) { LogModule.ErrorLog("Can not find missionBase {0}", m_nMissionID); return; } Tab_DailyMission DailyMission = TableManager.GetDailyMissionByID(MissionBase.DalityMissionTabID, 0); if (DailyMission == null) { LogModule.ErrorLog("Can not find dailyMission {0}", MissionBase.DalityMissionTabID); return; } bool bIsHaveMission = GameManager.gameManager.MissionManager.IsHaveMission(m_nMissionID); if (bIsHaveMission) { Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{2444}"); return; } //string str = ""; //str = StrDictionary.GetClientDictionaryString("#{1538}", DailyMission.ConsumeYuanBao); //MessageBoxLogic.OpenOKCancelBox(str, null, OnMessageOK, OnCancelClick); if (DailyMissionWindow.Instance() != null) { if (DailyMissionWindow.Instance().m_DailyMissionRefresh.GetComponent <DailyMissionRefresh>() != null) { DailyMissionWindow.Instance().m_DailyMissionRefresh.GetComponent <DailyMissionRefresh>().InitInfo(DailyMission.ConsumeNormalRefreshItem, DailyMission.ConsumeBangdedYuanBao, DailyMission.ConsumeSpecialRefreshItem, DailyMission.ConsumeYuanBao, Kind); } DailyMissionWindow.Instance().ShowRefresh(); } }
/// <summary> /// 设置数据 /// </summary> /// <param name="mission"></param> public void SetData(Tab_DailyMission mission) { mMissionId = mission.MissionID; mGoToUIId = mission.UIName; MissionManager missionManager = GameManager.gameManager.MissionManager; Tab_MissionDictionary missionDic = TableManager.GetMissionDictionaryByID(mMissionId, 0); Tab_MissionBase missionBase = TableManager.GetMissionBaseByID(mMissionId, 0); if (missionBase == null || missionBase.LogicType != (int)TableType.Table_OperationNum) { LogModule.WarningLog("DailyMission Logic Type Error, id = " + mission.Id); return; } Tab_MissionOperationNum missionOp = TableManager.GetMissionOperationNumByID(missionBase.LogicID, 0); lblMissionName.text = string.Format(missionDic.MissionName, "", ""); sprIcon.spriteName = missionDic.MissionIcon; lblDesc.text = missionDic.MissionDesc; lblActive.text = StrDictionary.GetClientDictionaryString("#{1634}", mission.AwardActiveness); int progress = missionOp.OperationCount; if (missionManager.IsHaveMission(mMissionId)) { progress = missionManager.GetMissionParam(mMissionId, 0); doneArea.SetActive(false); rewardArea.SetActive(true); btnClaim.SetActive(missionManager.GetMissionState(mMissionId) == (byte)MissionState.Mission_Completed); UIEventListener.Get(btnClaim).onClick = ClaimReward; SetRewards(mission); } else { doneArea.SetActive(true); rewardArea.SetActive(false); btnClaim.SetActive(false); } lblProgress.text = progress + "/" + missionOp.OperationCount; UpdateProgress(progress, missionOp.OperationCount); UIEventListener.Get(btnGoTo).onClick = GoToUI; }
void UpdateAwardItem(int nMissionID) { if (m_ItemGrid == null) { return; } Tab_MissionBase MissionBase = TableManager.GetMissionBaseByID(nMissionID, 0); if (MissionBase == null) { LogModule.ErrorLog("Can not find missionBase {0}", nMissionID); return; } Tab_DailyMission DailyMissionTab = TableManager.GetDailyMissionByID(MissionBase.DalityMissionTabID, 0); if (DailyMissionTab == null) { LogModule.ErrorLog("Can not find dailyMission {0}", MissionBase.DalityMissionTabID); return; } // 品质、等级系数 float fQualityFactor = 1.0f; float fLevelFactor = 1.0f; Tab_DailyMissionQuality QualityTab = TableManager.GetDailyMissionQualityByID(m_yQuality, 0); if (QualityTab == null) { LogModule.ErrorLog("Can not find dailyMissionQuality {0}", m_yQuality); } else { fQualityFactor = QualityTab.AwardFactor; int nLevelFactorIndex = Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.Level / 10; int nLevelFactorCount = QualityTab.getLevelFactorCount(); if (nLevelFactorIndex >= nLevelFactorCount || nLevelFactorIndex < 0) { nLevelFactorIndex = nLevelFactorCount - 1; } if (QualityTab.GetLevelFactorbyIndex(nLevelFactorIndex) >= 0) { fLevelFactor = QualityTab.GetLevelFactorbyIndex(nLevelFactorIndex); } } float fAwardFactor = fQualityFactor * fLevelFactor; if (fAwardFactor <= 0) { return; } int nIndex = 0; // 金钱 if (DailyMissionTab.AwardMoney > 0 && nIndex >= 0 && nIndex < MaxItemCount && m_AwardItem[nIndex] && nIndex < m_AwardItemNumLable.Length) { m_AwardItem[nIndex].SetActive(true); if (m_AwardItemNumLable[nIndex] != null) { float fRewardMoney = DailyMissionTab.AwardMoney * fAwardFactor; int nRewardMoney = (int)fRewardMoney; m_AwardItemNumLable[nIndex].text = nRewardMoney.ToString(); } } // 经验 nIndex++; if (DailyMissionTab.AwardExp > 0 && nIndex >= 0 && nIndex < MaxItemCount && m_AwardItem[nIndex] && nIndex < m_AwardItemNumLable.Length) { m_AwardItem[nIndex].SetActive(true); if (m_AwardItemNumLable[nIndex] != null) { float fRewardExp = DailyMissionTab.AwardExp * fAwardFactor; int nRewardExp = (int)fRewardExp; m_AwardItemNumLable[nIndex].text = nRewardExp.ToString(); } } // 声望 nIndex++; if (DailyMissionTab.AwardReputation > 0 && nIndex >= 0 && nIndex < MaxItemCount && m_AwardItem[nIndex] && nIndex < m_AwardItemNumLable.Length) { m_AwardItem[nIndex].SetActive(true); if (m_AwardItemNumLable[nIndex] != null) { int nRewardRepution = DailyMissionTab.AwardReputation; m_AwardItemNumLable[nIndex].text = nRewardRepution.ToString(); } } // 活跃度 nIndex++; if (DailyMissionTab.AwardActiveness > 0 && nIndex >= 0 && nIndex < MaxItemCount && m_AwardItem[nIndex] && nIndex < m_AwardItemNumLable.Length) { m_AwardItem[nIndex].SetActive(true); if (m_AwardItemNumLable[nIndex] != null) { m_AwardItemNumLable[nIndex].text = DailyMissionTab.AwardActiveness.ToString(); } } // 物品 nIndex++; if (DailyMissionTab.AwardItemNum > 0) { Tab_CommonItem Item = TableManager.GetCommonItemByID(DailyMissionTab.AwardItemID, 0); if (Item == null) { LogModule.ErrorLog("Can not find commonItem {0}", DailyMissionTab.AwardItemID); } else if (nIndex >= 0 && nIndex < MaxItemCount && m_AwardItem[nIndex] && m_ItemSprit && nIndex < m_AwardItemNumLable.Length) { m_AwardItem[nIndex].SetActive(true); m_ItemSprit.spriteName = Item.Icon; if (m_AwardItemNumLable[nIndex] != null) { m_AwardItemNumLable[nIndex].text = DailyMissionTab.AwardItemNum.ToString(); } } } m_ItemGrid.repositionNow = true; }