Ejemplo n.º 1
0
 public static void RequestTakeAchievementReward(AchievementDataEx data)
 {
     if (data == null)
     {
         return;
     }
     if (!data.IsComplete() || !data.IsShowUI() || data.Data.TakeReward)
     {
         global::Debug.LogErrorFormat("Take Achievement Reward Error.", new object[0]);
         return;
     }
     if (data.Info.ConditionType == 16)
     {
         MC2S_TakeCardDiamond ojb = new MC2S_TakeCardDiamond();
         Globals.Instance.CliSession.Send(234, ojb);
     }
     else if (data.Info.ConditionType == 17)
     {
         MC2S_TakeSuperCardDiamond ojb2 = new MC2S_TakeSuperCardDiamond();
         Globals.Instance.CliSession.Send(236, ojb2);
     }
     else
     {
         MC2S_TakeAchievementReward mC2S_TakeAchievementReward = new MC2S_TakeAchievementReward();
         mC2S_TakeAchievementReward.AchievementID = data.Data.AchievementID;
         Globals.Instance.CliSession.Send(246, mC2S_TakeAchievementReward);
     }
     LocalPlayer player = Globals.Instance.Player;
     GameUIState uiState = GameUIManager.mInstance.uiState;
     uiState.PlayerLevel = player.Data.Level;
     uiState.PlayerEnergy = player.Data.Energy;
     uiState.PlayerExp = player.Data.Exp;
     uiState.PlayerMoney = player.Data.Money;
     uiState.SetOldFurtherData(Globals.Instance.Player.TeamSystem.GetPet(0));
 }
Ejemplo n.º 2
0
 private int GetSortWeight(AchievementDataEx data)
 {
     int num = 200000000;
     if (data.Info.ConditionType == 16)
     {
         if (!Globals.Instance.Player.IsCardExpire())
         {
             num = ((!Globals.Instance.Player.IsTodayCardDiamondTaken()) ? 100000000 : 300000000);
         }
         num += 1000000;
     }
     else if (data.Info.ConditionType == 17)
     {
         if (Globals.Instance.Player.IsBuySuperCard())
         {
             num = ((!Globals.Instance.Player.IsTodaySuperCardDiamondTaken()) ? 100000000 : 300000000);
         }
         num += 1000000;
     }
     else if (data.IsComplete())
     {
         num = ((!data.Data.TakeReward) ? 100000000 : 300000000);
     }
     return num + data.Info.ID;
 }
Ejemplo n.º 3
0
 public override void Refresh(object _data)
 {
     AchievementDataEx achievementDataEx = (AchievementDataEx)_data;
     if (achievementDataEx == this.Data && this.CacheInfo == achievementDataEx.Info)
     {
         this.RefreshFinnishState();
         return;
     }
     this.Data = achievementDataEx;
     this.CacheInfo = this.Data.Info;
     this.ShowAchievementData();
 }
Ejemplo n.º 4
0
 private void ShowAchievementReward(AchievementDataEx data)
 {
     List<RewardData> list = new List<RewardData>(1);
     for (int i = 0; i < data.Info.RewardType.Count; i++)
     {
         if (data.Info.RewardType[i] != 0 && data.Info.RewardType[i] != 7)
         {
             list.Add(new RewardData
             {
                 RewardType = data.Info.RewardType[i],
                 RewardValue1 = data.Info.RewardValue1[i],
                 RewardValue2 = data.Info.RewardValue2[i]
             });
         }
     }
     if (list.Count > 0)
     {
         GUIRewardPanel.Show(list, string.Format("{0}{1}", Singleton<StringManager>.Instance.GetString("QuestFinish"), data.Info.Name), false, true, null, false);
     }
 }