コード例 #1
0
 public static int GetMultiple(ref COMDT_REWARD_MULTIPLE_DETAIL multipleDetail, CUseable usb)
 {
     for (int i = 0; i < (int)multipleDetail.bNum; i++)
     {
         COMDT_REWARD_MULTIPLE_INFO cOMDT_REWARD_MULTIPLE_INFO = multipleDetail.astMultiple[i];
         if (cOMDT_REWARD_MULTIPLE_INFO.wRewardType == (ushort)usb.MapRewardType)
         {
             int   multipleValue = CUseable.GetMultipleValue(cOMDT_REWARD_MULTIPLE_INFO.stNewMultipleInfo, 1);
             float num           = (float)multipleValue / 10000f;
             int   result        = 0;
             if (multipleValue != 0)
             {
                 if (num > 0f)
                 {
                     result = (int)(num + 0.9999f);
                 }
                 else if (num < 0f)
                 {
                     result = (int)(num - 0.9999f);
                 }
             }
             if (cOMDT_REWARD_MULTIPLE_INFO.wRewardType != 1)
             {
                 return(result);
             }
             if ((uint)((CItem)usb).m_itemData.bClass == cOMDT_REWARD_MULTIPLE_INFO.dwRewardTypeParam)
             {
                 return(result);
             }
         }
     }
     return(0);
 }
コード例 #2
0
        private void ShowRewards(SCPKG_DRAWWEAL_RSP rspPkg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            Activity activity = Singleton <ActivitySys> .GetInstance().GetActivity((COM_WEAL_TYPE)rspPkg.bWealType, rspPkg.dwWealID);

            if (activity != null)
            {
                if (rspPkg.iResult == 0)
                {
                    activity.SetPhaseMarked(rspPkg.dwPeriodID);
                    if (rspPkg.stReward.bNum > 0)
                    {
                        ListView <CUseable> useableListFromReward = CUseableManager.GetUseableListFromReward(rspPkg.stReward);
                        for (int i = 0; i < useableListFromReward.Count; i++)
                        {
                            useableListFromReward[i].m_stackMulti = CUseable.GetMultipleValue(rspPkg.stMultipleInfo, 1) / 10000;
                        }
                        this._rewardListQueue.Add(new ActivitySys.RewardList(useableListFromReward, rspPkg.iExtraCode));
                        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Common_NewHeroOrSkinFormClose, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Mall_Get_AWARD_CLOSE_FORM, new CUIEventManager.OnUIEventHandler(this.ShowNextReward));

                        this.ShowNextReward(null);
                    }
                }
                else
                {
                    string text = "[";
                    if (rspPkg.iResult == 8 || rspPkg.iResult == 9)
                    {
                        text += Singleton <CTextManager> .GetInstance().GetText("payError");
                    }
                    else
                    {
                        text += rspPkg.iResult;
                    }
                    text += "]";
                    Singleton <CUIManager> .GetInstance().OpenMessageBox(Singleton <CTextManager> .GetInstance().GetText("drawRewardFailed") + text, false);
                }
            }
        }
コード例 #3
0
 public static uint GetQqVipExtraCoin(uint totalCoin, ref COMDT_REWARD_MULTIPLE_DETAIL multipleDetail, ushort rewardType)
 {
     for (int i = 0; i < (int)multipleDetail.bNum; i++)
     {
         COMDT_REWARD_MULTIPLE_INFO cOMDT_REWARD_MULTIPLE_INFO = multipleDetail.astMultiple[i];
         if (cOMDT_REWARD_MULTIPLE_INFO.wRewardType == rewardType)
         {
             int   multipleValue  = CUseable.GetMultipleValue(cOMDT_REWARD_MULTIPLE_INFO.stNewMultipleInfo, 1);
             int   multipleValue2 = CUseable.GetMultipleValue(cOMDT_REWARD_MULTIPLE_INFO.stNewMultipleInfo, 2);
             float num            = (float)multipleValue2 / 10000f;
             float num2           = totalCoin / ((float)multipleValue / 10000f + num) * num;
             if (num2 > 0f)
             {
                 return((uint)(num2 + 0.9999f));
             }
             if (num2 < 0f)
             {
                 return((uint)(num2 - 0.9999f));
             }
         }
     }
     return(0u);
 }