Esempio n. 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);
        }
Esempio n. 2
0
 public void SetAwardProperty(int id)
 {
     PlayEffectTitle();
     sign    = TaskAwardOpenForWindow.W_GameTask;
     awardid = id;
     ArkCrossEngine.MissionConfig missionconfig = ArkCrossEngine.LogicSystem.GetMissionDataById(id);
     if (missionconfig != null)
     {
         UnityEngine.Transform tf = transform.Find("Back/Type/TypeDescription");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = missionconfig.Name;
             }
         }
         tf = transform.Find("Back/Challenge/ChallengeDescription");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = missionconfig.Description;
             }
         }
     }
     ArkCrossEngine.Data_SceneDropOut dsdo = ArkCrossEngine.SceneConfigProvider.Instance.GetSceneDropOutById(missionconfig.DropId);
     if (dsdo != null)
     {
         ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
         if (ri != null && ri.GetMissionStateInfo() != null)
         {
             SetSomething(dsdo.m_GoldSum, dsdo.m_Diamond, ri.GetMissionStateInfo().GetMissionsExpReward(id, ri.Level), dsdo.GetRewardItemByHeroId(ri.HeroId), dsdo.m_ItemCountList);
         }
     }
 }
Esempio n. 3
0
 public void TweenPotationHalfOK()
 {
     try
     {
         if (!firsthalfed)
         {
             SetInfo(Clickwhich, prizeid, prizecount);
             firsthalfed = true;
             StartCoroutine(DelayForTurnedCard());
             UnityEngine.Transform tf = transform.Find(Clickwhich.ToString() + "/Light");
             if (tf != null)
             {
                 NGUITools.SetActive(tf.gameObject, true);
             }
             for (int i = 0; i < 4; ++i)
             {
                 UnityEngine.Transform tfcard = transform.Find(i.ToString());
                 if (tfcard != null)
                 {
                     UIEventListener.Get(tfcard.gameObject).onClick -= CardClick;
                 }
             }
         }
         else
         {
             if (firstsetall)
             {
                 UnityEngine.Transform tf = transform.Find("Button");
                 if (tf != null)
                 {
                     NGUITools.SetActive(tf.gameObject, true);
                 }
                 firstsetall = false;
                 ArkCrossEngine.Data_SceneConfig dsc      = ArkCrossEngine.SceneConfigProvider.Instance.GetSceneConfigById(DFMUiRoot.NowSceneID);
                 ArkCrossEngine.RoleInfo         roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
                 if (dsc != null && null != roleInfo)
                 {
                     ArkCrossEngine.Data_SceneDropOut dsdo = ArkCrossEngine.SceneConfigProvider.Instance.GetSceneDropOutById(dsc.m_DropId);
                     if (dsdo != null)
                     {
                         List <int> itemIdList = dsdo.GetRewardItemByHeroId(roleInfo.HeroId);
                         if (null != itemIdList && itemIdList.Count > 0)
                         {
                             if (dsdo.m_ItemCount == 4 && itemIdList != null && itemIdList.Count == 4)
                             {
                                 bool sign = true;
                                 for (int j = 0; j < 4; ++j)
                                 {
                                     if (j != Clickwhich)
                                     {
                                         if (itemIdList[j] == prizeid)
                                         {
                                             if (sign)
                                             {
                                                 sign = false;
                                                 SetInfo(j, itemIdList[Clickwhich], dsdo.m_ItemCountList[Clickwhich]);
                                             }
                                             else
                                             {
                                                 SetInfo(j, itemIdList[j], dsdo.m_ItemCountList[j]);
                                             }
                                         }
                                         else
                                         {
                                             SetInfo(j, itemIdList[j], dsdo.m_ItemCountList[j]);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (System.Exception)
     {
         //
     }
 }
Esempio n. 4
0
    private void SetAwardAndPosition(UnityEngine.Transform tf, int dropid, int missionId)
    {
        ArkCrossEngine.Data_SceneDropOut dsdo = ArkCrossEngine.SceneConfigProvider.Instance.GetSceneDropOutById(dropid);
        UnityEngine.Vector3 pos = new UnityEngine.Vector3(80.0f, 0.0f, 0.0f);
        if (tf != null && dsdo != null)
        {
            if (dsdo.m_GoldSum > 0)
            {
                UnityEngine.Transform tt = tf.Find("Money");
                if (tt != null)
                {
                    //NGUITools.SetActive(tt.gameObject, true);
                    pos = tt.localPosition;
                    pos = new UnityEngine.Vector3(pos.x + 55, pos.y, 0.0f);

                    tt = tt.Find("Label");
                    if (tt != null)
                    {
                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                        if (ul != null)
                        {
                            ul.text = "X" + dsdo.m_GoldSum;
                        }

                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                    }
                }
            }
            else
            {
                UnityEngine.Transform tt = tf.Find("Money");
                if (tt != null)
                {
                    NGUITools.SetActive(tt.gameObject, false);
                }
            }
            if (dsdo.m_Exp > 0)
            {
                UnityEngine.Transform tt = tf.Find("Exp");
                RoleInfo roleInfo        = LobbyClient.Instance.CurrentRole;
                if (tt != null && roleInfo != null)
                {
                    //NGUITools.SetActive(tt.gameObject, true);
                    tt.localPosition = pos;
                    pos = tt.localPosition;
                    pos = new UnityEngine.Vector3(pos.x + 55, pos.y, 0.0f);

                    tt = tt.Find("Label");
                    if (tt != null)
                    {
                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                        if (ul != null)
                        {
                            ul.text = "X" + roleInfo.GetMissionStateInfo().GetMissionsExpReward(missionId, roleInfo.Level);
                        }

                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                    }
                }
            }
            else
            {
                UnityEngine.Transform tt = tf.Find("Exp");
                if (tt != null)
                {
                    NGUITools.SetActive(tt.gameObject, false);
                }
            }
            if (dsdo.m_Diamond > 0)
            {
                UnityEngine.Transform tt = tf.Find("Diamond");
                if (tt != null)
                {
                    //NGUITools.SetActive(tt.gameObject, true);
                    tt.localPosition = pos;
                    pos = tt.localPosition;
                    pos = new UnityEngine.Vector3(pos.x + 55, pos.y, 0.0f);

                    tt = tt.Find("Label");
                    if (tt != null)
                    {
                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                        if (ul != null)
                        {
                            ul.text = "X" + dsdo.m_Diamond;
                        }

                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                    }
                }
            }
            else
            {
                UnityEngine.Transform tt = tf.Find("Diamond");
                if (tt != null)
                {
                    NGUITools.SetActive(tt.gameObject, false);
                }
            }
            RoleInfo role_info = LobbyClient.Instance.CurrentRole;
            if (null != role_info)
            {
                List <int> rewardItemIdList = dsdo.GetRewardItemByHeroId(role_info.HeroId);
                if (null != rewardItemIdList && rewardItemIdList.Count > 0)
                {
                    int count = rewardItemIdList.Count;
                    pos = new UnityEngine.Vector3(pos.x + 30, pos.y, 0f);
                    for (int i = 0; i < count; ++i)
                    {
                        ArkCrossEngine.ItemConfig ic = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(rewardItemIdList[i]);
                        if (ic != null)
                        {
                            UnityEngine.GameObject go = CrossObjectHelper.TryCastObject <UnityEngine.GameObject>(ArkCrossEngine.ResourceSystem.GetSharedResource("UI/GameTask/Item"));
                            if (go != null)
                            {
                                go = NGUITools.AddChild(tf.gameObject, go);
                                if (go != null)
                                {
                                    go.transform.localPosition = pos;
                                    pos = go.transform.localPosition;
                                    pos = new UnityEngine.Vector3(pos.x + 65, pos.y, 0.0f);
                                    UnityEngine.Texture utt = GamePokeyManager.GetTextureByPicName(ic.m_ItemTrueName);
                                    UITexture           ut  = go.GetComponent <UITexture>();
                                    if (ut != null)
                                    {
                                        if (utt != null)
                                        {
                                            ut.mainTexture = utt;
                                        }
                                    }
                                    UnityEngine.Transform tt = go.transform.Find("Frame");
                                    if (tt != null)
                                    {
                                        UISprite us = tt.gameObject.GetComponent <UISprite>();
                                        if (us != null)
                                        {
                                            us.spriteName = "EquipFrame" + ic.m_PropertyRank;
                                        }
                                    }
                                    tt = go.transform.Find("Label");
                                    if (tt != null)
                                    {
                                        UILabel ul = tt.gameObject.GetComponent <UILabel>();
                                        if (ul != null)
                                        {
                                            ul.text = "X" + dsdo.m_ItemCountList[i];
                                        }
                                        pos = new UnityEngine.Vector3(pos.x + ul.localSize.x, pos.y, 0.0f);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }