コード例 #1
0
        public 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);
        }
コード例 #2
0
ファイル: GameTask.cs プロジェクト: Klanly/UnityClient
 private void SetTaskInfo(UnityEngine.GameObject go, int taskid, string schedule, bool sign = false)
 {
     ArkCrossEngine.MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(taskid);
     if (missionconfig != null && go != null)
     {
         UnityEngine.Transform tf = go.transform.Find("Name");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = missionconfig.Name + ":" + missionconfig.Description;
                 if (missionconfig.MissionType == (int)MissionType.MonthCard)
                 {
                     ul.text += StrDictionaryProvider.Instance.Format(32, schedule);
                 }
             }
         }
         tf = go.transform.Find("TaskType");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 if (missionconfig.MissionType == 1)
                 {
                     ul.text           = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(124);
                     go.transform.name = "0";
                 }
                 if (missionconfig.MissionType == 2)
                 {
                     ul.text           = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(125);
                     go.transform.name = "1";
                 }
                 if (missionconfig.MissionType == 3 || missionconfig.MissionType == 4)
                 {
                     ul.text           = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(148);
                     go.transform.name = "2";
                 }
             }
         }
         tf = go.transform.Find("Schedule");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 if (schedule != null)
                 {
                     ul.text = schedule;//ArkCrossEngine.StrDictionaryProvider.Instance.Format(126, schedule);
                 }
                 else
                 {
                     ul.text = "";
                 }
             }
         }
         tf = go.transform.Find("Award");
         if (sign)
         {
             SetAwardAndPosition(tf, missionconfig.DropId, missionconfig.Id);
         }
     }
     //     ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     //     if (ri != null && missionconfig != null) {
     //       if (ri.Level < missionconfig.LevelLimit) {
     //         if (NGUITools.GetActive(go)) {
     //           NGUITools.SetActive(go, false);
     //           UnityEngine.Transform tf = gameObject.transform.Find("Container/Scroll View/Grid");
     //           if (tf != null) {
     //             UIGrid ug = tf.gameObject.GetComponent<UIGrid>();
     //             if (ug != null) {
     //               ug.repositionNow = true;
     //             }
     //           }
     //         }
     //       } else {
     //         if (!NGUITools.GetActive(go)) {
     //           NGUITools.SetActive(go, true);
     //           UnityEngine.Transform tf = gameObject.transform.Find("Container/Scroll View/Grid");
     //           if (tf != null) {
     //             UIGrid ug = tf.gameObject.GetComponent<UIGrid>();
     //             if (ug != null) {
     //               ug.repositionNow = true;
     //             }
     //           }
     //         }
     //       }
     //     }
 }