internal int GetMissionsExpReward(int missionId, int userLevel) { int result = 0; MissionConfig mc = MissionConfigProvider.Instance.GetDataById(missionId); if (null != mc) { Data_SceneDropOut dropOutConfig = SceneConfigProvider.Instance.GetSceneDropOutById(mc.DropId); if (null != dropOutConfig) { if (mc.MissionType == (int)MissionType.DAILY && dropOutConfig.m_Exp > 0) { if (userLevel < 21) { // 21级以下 result = 120; } else if (userLevel < 24) { // 24级以下 result = userLevel * 15; } else { result = (int)((0.0097 * Math.Pow(userLevel, 4) - 1.6977 * Math.Pow(userLevel, 3) + 106.88 * Math.Pow(userLevel, 2) - 2523.5 * userLevel + 19699) * 1); } } else { result = dropOutConfig.m_Exp; } } } return(result); }
private void InitVictoryPanel(int sceneId, int maxHit, int beHittTimes, int diedTimes, int time, int exp, int gold, bool isFirstComplete) { try { if (texAward != null) { NGUITools.SetActive(texAward.gameObject, false); } m_IsFirstComplete = isFirstComplete; m_SceneId = sceneId; if (lblAwardExp != null) { lblAwardExp.text = "+" + exp.ToString(); } if (lblAwardMoney != null) { lblAwardMoney.text = "+" + gold.ToString(); } values[0] = maxHit; values[1] = beHittTimes; values[2] = diedTimes; values[3] = time; RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (role_info != null) { m_PlayerCurrentLevel = role_info.Level; m_PlayerExp = role_info.Exp; Data_SceneDropOut dropCfg = null; Data_SceneConfig sceneCfg = SceneConfigProvider.Instance.GetSceneConfigById(sceneId); if (sceneCfg != null) { if (sceneCfg.m_SubType == (int)SceneSubTypeEnum.TYPE_ELITE) { subType = SceneSubTypeEnum.TYPE_ELITE; } if (sceneCfg.m_SubType == (int)SceneSubTypeEnum.TYPE_STORY) { subType = SceneSubTypeEnum.TYPE_STORY; } dropCfg = SceneConfigProvider.Instance.GetSceneDropOutById(sceneCfg.m_DropId); } if (dropCfg != null) { m_DropExp = dropCfg.m_Exp; } } UIManager.Instance.ShowWindowByName("VictoryPanel"); } catch (Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void SetAwardItem() { try { RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (role_info != null) { if (role_info.SceneInfo != null && role_info.SceneInfo.ContainsKey(m_SceneId)) { int level = role_info.SceneInfo[m_SceneId];//星级 Data_SceneConfig sceneCfg = SceneConfigProvider.Instance.GetSceneConfigById(m_SceneId); if (sceneCfg == null) { return; } int dropId = sceneCfg.GetCompletedRewardId(level); Data_SceneDropOut dropCfg = SceneConfigProvider.Instance.GetSceneDropOutById(dropId); if (dropCfg != null) { List <int> rewardItemList = dropCfg.GetRewardItemByHeroId(role_info.HeroId); if (null != rewardItemList && rewardItemList.Count > 0) { int itemId = rewardItemList[0]; DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Victory, texAward, itemId, dropCfg.m_ItemCountList[0]); } } } } if (goMasterAward != null) { NGUITools.SetActive(goMasterAward, true); } } catch (System.Exception ex) { ArkCrossEngine.LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
public void InitSceneIntroduce(int sceneId, int grade, SubSceneType subType) { try { NGUITools.SetActive(wipePanel, false); NGUITools.SetActive(wipeBtn0.gameObject, false); NGUITools.SetActive(wipeBtn1.gameObject, false); if (subType == SubSceneType.Common) { m_SubSceneType = SubSceneType.Common; for (int i = 0; i < starArr.Length; ++i) { if (starArr[i] != null) { NGUITools.SetActive(starArr[i].gameObject, false); } } RoleInfo role = LobbyClient.Instance.CurrentRole; if (role.SceneInfo.ContainsKey(sceneId)) { NGUITools.SetActive(wipePanel, true); NGUITools.SetActive(wipeBtn0.gameObject, true); NGUITools.SetActive(wipeBtn1.gameObject, true); } } else { m_SubSceneType = SubSceneType.Master; for (int i = 0; i < starArr.Length; ++i) { if (starArr[i] != null) { NGUITools.SetActive(starArr[i].gameObject, true); } if (i < grade) { if (starArr[i] != null) { starArr[i].spriteName = c_BrightStar; } } else { if (starArr[i] != null) { starArr[i].spriteName = c_AshStar; } } } if (grade >= maxStarNum) { NGUITools.SetActive(wipePanel, true); NGUITools.SetActive(wipeBtn0.gameObject, true); NGUITools.SetActive(wipeBtn1.gameObject, true); } } if (uiSceneAward != null) { uiSceneAward.ShowAwardInfo(sceneId, subType, grade); } m_SceneId = sceneId; Data_SceneConfig sceneCfg = SceneConfigProvider.Instance.GetSceneConfigById(m_SceneId); RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (sceneCfg != null) { SetName(sceneCfg.m_SceneName); SetRecommendFight(sceneCfg.m_RecommendFighting); SetCostStatima(sceneCfg.m_CostStamina); if (lblSceneIndex != null) { lblSceneIndex.text = (1 + sceneCfg.m_Order).ToString(); } string des = sceneCfg.m_SceneDescription.Replace("[\\n]", "\n"); if (lblIntroduce1 != null) { lblIntroduce1.text = des; } if (role_info != null) { SetFightingScore((int)role_info.FightingScore); } if (lblCurStamina != null) { lblCurStamina.text = role_info.CurStamina.ToString(); } //设置掉落数据 Data_SceneDropOut dropCfg = SceneConfigProvider.Instance.GetSceneDropOutById(sceneCfg.m_DropId); if (dropCfg != null) { DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Scene_Award, lblAwardExp, DFMItemIconUtils.Instance.m_Exp, dropCfg.m_Exp); DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Scene_Award, lblAwardCoin, DFMItemIconUtils.Instance.m_Money, dropCfg.m_GoldSum); SetAwardItem(dropCfg.GetRewardItemByHeroId(role_info.HeroId), dropCfg.m_ItemCountList); } } InitWipeNum(); InitBtnName(); } catch (Exception ex) { LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
//显示奖励信息 public void ShowAwardInfo(int sceneId, SubSceneType subType, int grade) { Data_SceneConfig sceneCfg = SceneConfigProvider.Instance.GetSceneConfigById(sceneId); if (subType == SubSceneType.Common) { //普通副本 NGUITools.SetActive(goCommonAward, true); NGUITools.SetActive(goMasterAward, false); if (goFinished != null) { if (grade > 0) { NGUITools.SetActive(goFinished, true); } else { NGUITools.SetActive(goFinished, false); } } int dropId = -1; if (sceneCfg == null) { return; } if (sceneCfg.m_CompletedRewards != null && sceneCfg.m_CompletedRewards.Count > 0) { dropId = sceneCfg.m_CompletedRewards[0]; } Data_SceneDropOut dropCfg = SceneConfigProvider.Instance.GetSceneDropOutById(dropId); if (dropCfg != null) { List <int> rewardItemIdList = dropCfg.GetRewardItemByHeroId(LobbyClient.Instance.CurrentRole.HeroId); if (null != rewardItemIdList && rewardItemIdList.Count > 0) { int itemId = rewardItemIdList[0]; if (commonAwardSlot != null) { commonAwardSlot.SetId(itemId); } DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Scene_First, goCommonAward, itemId); } } } else { //精英副本 NGUITools.SetActive(goCommonAward, false); NGUITools.SetActive(goMasterAward, true); if (sceneCfg == null || sceneCfg.m_CompletedRewards == null) { return; } for (int i = 0; i < sceneCfg.m_CompletedRewards.Count; ++i) { int dropId = sceneCfg.m_CompletedRewards[i]; Data_SceneDropOut dropCfg = SceneConfigProvider.Instance.GetSceneDropOutById(dropId); if (dropCfg != null) { List <int> rewardItemIdList = dropCfg.GetRewardItemByHeroId(LobbyClient.Instance.CurrentRole.HeroId); if (null != rewardItemIdList && rewardItemIdList.Count > 0) { int itemId = rewardItemIdList[0]; if (i < masterAwardSlotArr.Length && masterAwardSlotArr[i] != null) { masterAwardSlotArr[i].SetId(itemId); } DFMItemIconUtils.Instance.SetItemInfo(ItemIconType.Scene_Star, texItemArr[i], itemId); } } } for (int i = 0; i < spArrowArr.Length; ++i) { if (i + 1 < grade) { if (spArrowArr[i] != null) { spArrowArr[i].spriteName = c_BrightArrow; } } else { if (spArrowArr[i] != null) { spArrowArr[i].spriteName = c_AshArrow; } } } //指示标志 if (grade < 3 && grade >= 0 && lblStarNum != null) { NGUITools.SetActive(goGuide, true); lblStarNum.text = (grade + 1).ToString(); if (grade < m_GuidePosArr.Length) { goGuide.transform.localPosition = m_GuidePosArr[grade]; } } else { NGUITools.SetActive(goGuide, false); } for (int i = 0; i < spFinishedArr.Length; ++i) { if (i < grade) { if (spFinishedArr[i] != null) { NGUITools.SetActive(spFinishedArr[i].gameObject, true); } } else { if (spFinishedArr[i] != null) { NGUITools.SetActive(spFinishedArr[i].gameObject, false); } } } //推荐战力 if (lblRecommendFighting != null) { lblRecommendFighting.text = sceneCfg.m_RecommendFighting.ToString(); } SetAwardCondition(grade, sceneCfg); } }