| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package Player.PlayerSuccess  | 
| #  | 
| # @todo:³É¾Íϵͳ  | 
| # @author xdh  | 
| # @date 2018-04-23  | 
| # @version 1.0  | 
| #  | 
| #  | 
| # ÏêϸÃèÊö: ³É¾Íϵͳ  | 
| #  | 
| #---------------------------------------------------------------------  | 
| #"""Version = 2018-04-23 11:00"""  | 
| #---------------------------------------------------------------------  | 
|   | 
| import ShareDefine  | 
| import ChConfig  | 
| import GameWorld  | 
| import ChPyNetSendPack  | 
| import NetPackCommon  | 
| import ItemCommon  | 
| import IPY_GameWorld  | 
| import PlayerControl  | 
| import ItemControler  | 
| import PlayerMagicWeapon  | 
| import PlayerFamilyRedPacket  | 
| import IpyGameDataPY  | 
| import EventShell  | 
| import PyGameData  | 
| import EventReport  | 
|   | 
| import datetime  | 
| import time  | 
| import math  | 
|   | 
|   | 
| ## »ñÈ¡³É¾Í×ÖµäÐÅÏ¢Öµ  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @return  | 
| def GetPDictValue(curPlayer, key, defaultValue=0):  | 
|     return curPlayer.NomalDictGetProperty(key, defaultValue, ChConfig.Def_PDictType_Success)  | 
|   | 
|   | 
| ## ÉèÖóɾÍ×ÖµäÐÅÏ¢Öµ  | 
| #  @param curPlayer Íæ¼ÒʵÀý  | 
| #  @return  | 
| def SetPDictValue(curPlayer, key, value):  | 
|     PlayerControl.NomalDictSetProperty(curPlayer, key, value, ChConfig.Def_PDictType_Success)  | 
|     return  | 
|   | 
| def GetSuccIsFinish(curPlayer, succID):  | 
|     #»ñÈ¡³É¾ÍÊÇ·ñÒÑÍê³É  | 
|     return GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_Success_FinishTime, succID)  | 
|   | 
| def SetSuccFinish(curPlayer, succID, finish=True):  | 
|     #ÉèÖóɾÍÊÇ·ñÍê³É  | 
|     return GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_Success_FinishTime, succID, finish)  | 
|   | 
| def GetSuccHasGot(curPlayer, succID):  | 
|     #»ñÈ¡³É¾Í½±ÀøÊÇ·ñÒÑÁìÈ¡  | 
|     return GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_Success_AwardRecord, succID)  | 
|   | 
| def SetSuccHasGot(curPlayer, succID, hasGot=True):  | 
|     #ÉèÖóɾͽ±ÀøÁìȡ״̬  | 
|     if GetSuccHasGot(curPlayer, succID) == hasGot:  | 
|         return  | 
|     GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_Success_AwardRecord, succID, hasGot)  | 
|       | 
|     if hasGot:  | 
|         #ÒÑÁìÈ¡µÄ¿ÉÉèÖÃÊÇ·ñÒÑÍê³ÉΪ0  | 
|         SetSuccFinish(curPlayer, succID, 0)  | 
|           | 
|         Sync_SuccTypeIndexAwardRecord(curPlayer, [succID], True) #ÉèÖóÉδÁìÈ¡µÄÔÚÍâ²ãͬ²½  | 
|         PlayerMagicWeapon.ActiveMagicWeapon(curPlayer, succID)  | 
|         EventShell.EventRespons_SuccessFinish(curPlayer, succID)  | 
|           | 
|     return   | 
|   | 
| def SetSuccFinishValue(curPlayer, succType, condition, value):  | 
|     #ÉèÖóɾÍÍê³É¶È  | 
|     key = ChConfig.Def_PDict_Success_CntValue % (succType, condition)  | 
|     SetPDictValue(curPlayer, key, value)  | 
|     return  | 
|   | 
| def GetSuccFinishValue(curPlayer, succType, condition):  | 
|     #»ñÈ¡Íê³É¶È  | 
|     key = ChConfig.Def_PDict_Success_CntValue % (succType, condition)  | 
|     return GetPDictValue(curPlayer, key)  | 
|   | 
|   | 
|   | 
| ## ³É¾ÍÅä±íÊý¾ÝÀà  | 
| class SuccessData():  | 
|       | 
|     def __init__(self):  | 
|         self.succID = 0  #³É¾ÍID  | 
|         self.succType = 0 # ³É¾ÍÀàÐÍ  | 
|         self.needCnt = 0 # ËùÒÔ¼ÆÊýÊýÁ¿  | 
|         self.preSuccIDList = [] # Ç°ÖóɾÍID  | 
|         self.condition = [] # ¸¨ÖúÌõ¼þ(¸ù¾ÝÀàÐÍ×Ô¶¨ÒåÅäÖÃ)  | 
|         self.awardItemDict = {} # Íê³É³É¾Í¿ÉÁìÈ¡µÄ½±ÀøÎïÆ·{itemid:itemcnt}  | 
|         self.moneyDict = {} # Íê³É³É¾Í»ñµÃµÄ½ðÇ® {moneyType:money}  | 
|         self.exp = 0 # Íê³É³É¾Í»ñµÃµÄ¾Ñé  | 
|         self.attrDict = {} # Íê³É³É¾Í»ñµÃµÄÊôÐÔ {attrid:attrvalue}  | 
|         self.hasAward = True #ÊÇ·ñÓн±Àø  | 
|         self.redPacketID = 0 # ºì°üID  | 
|         self.magicWeaponExp = {} # ·¨±¦Éý¼¶¾Ñé{id:exp}  | 
|         return  | 
|   | 
|   | 
| ## ³É¾ÍÊý¾Ý¹ÜÀíÀà  | 
| class SuccessDataMng():  | 
|   | 
|     ## ¹¹Ô캯Êý  | 
|     #  @param None  | 
|     #  @return  | 
|     def __init__(self):  | 
|         self.succTypeConditionDict = {} #{succType:[condition,..]}  | 
|         self.successDataDict = {} # {succType:{index:SuccessData(),...}, ...}  | 
|         return  | 
|   | 
|     ## ¼ÓÔØ³É¾ÍÊý¾Ý  | 
|     #  @param succType: ³É¾ÍÀàÐÍ  | 
|     #  @return  | 
|     def __LoadSuccessData(self, succType):  | 
|         if succType in self.successDataDict:  | 
|             return  | 
|         successDataList = IpyGameDataPY.GetIpyGameDataByCondition('Success', {'Type':succType}, True, False)  | 
|             | 
|         if not successDataList:  | 
|             return  | 
|           | 
|         successDataObjDict = {}  | 
|         conditionDict = {}  | 
|         for successIpyData in successDataList:  | 
|             succData = SuccessData()  | 
|             succData.succID = successIpyData.GetID()  | 
|             succData.succType = succType  | 
|             succData.needCnt = successIpyData.GetNeedCnt()  | 
|             succData.preSuccIDList = list(successIpyData.GetPreSuccess())  | 
|             succData.condition = list(successIpyData.GetCondition())  | 
|             succData.awardItemDict = successIpyData.GetAwardItem()  | 
|             succData.moneyDict = successIpyData.GetMoney()  | 
|             succData.exp = successIpyData.GetExp()  | 
|             succData.attrDict = successIpyData.GetAwardAttr()  | 
|             succData.redPacketID = successIpyData.GetRedPacketID()  | 
|             magicWeaponID = successIpyData.GetMagicWeaponID()  | 
|             magicWeaponExp = successIpyData.GetMagicWeaponExp()  | 
|             if magicWeaponID and magicWeaponExp:  | 
|                 succData.magicWeaponExp[magicWeaponID] = magicWeaponExp  | 
|             succData.hasAward = bool(succData.awardItemDict or succData.moneyDict or succData.exp or succData.attrDict or succData.redPacketID or succData.magicWeaponExp)  | 
|             successDataObjDict[succData.succID]=succData  | 
|             if tuple(succData.condition) not in conditionDict:  | 
|                 conditionDict[tuple(succData.condition)] = [succData.succID]  | 
|             else:  | 
|                 conditionDict[tuple(succData.condition)].append(succData.succID)  | 
|               | 
|         self.successDataDict[succType] = successDataObjDict  | 
|         #self.succTypeConditionDict[succType] = conditionDict  | 
|         return  | 
|       | 
|     ## ¸ù¾Ý³É¾ÍÀàÐÍ»ñÈ¡¸ÃÀàÐÍËùÓÐ³É¾Í  | 
|     #  @param succType: ³É¾ÍÀàÐÍ  | 
|     #  @return: {index:SuccessData(), ...}  | 
|     def GetSuccDataByType(self, succType):  | 
|         if succType not in self.successDataDict:  | 
|             self.__LoadSuccessData(succType)  | 
|         return self.successDataDict.get(succType, {}).values()  | 
|       | 
|     ## ¸ù¾Ý³É¾ÍÀàÐÍ»ñÈ¡¸ÃÀàÐÍËùÓÐÌõ¼þ  | 
|     #  @param succType: ³É¾ÍÀàÐÍ  | 
|     #  @return: {index:SuccessData(), ...}  | 
| #    def GetConditionDictByType(self, succType):  | 
| #        if succType not in self.succTypeConditionDict:  | 
| #            self.__LoadSuccessData(succType)  | 
| #        return self.succTypeConditionDict.get(succType, {})  | 
|   | 
|     ## ¸ù¾Ý³É¾ÍÀàÐÍË÷Òý»ñȡij¸ö³É¾ÍÊý¾Ý  | 
|     #  @param succType: ³É¾ÍÀàÐÍ  | 
|     #  @param index: ³É¾ÍË÷Òý  | 
|     #  @return: SuccessData() or None  | 
|     def GetSuccessData(self, succID):  | 
|         succIpyData = IpyGameDataPY.GetIpyGameDataNotLog('Success', succID)  | 
|         if not succIpyData:  | 
|             return  | 
|         succType = succIpyData.GetType()  | 
|         if succType not in self.successDataDict:  | 
|             self.__LoadSuccessData(succType)  | 
|         return self.successDataDict.get(succType, {}).get(succID)  | 
|          | 
|       | 
|       | 
|   | 
| g_succDataMng = SuccessDataMng()  | 
|   | 
|   | 
| ## »ñÈ¡³É¾ÍÊý¾Ý¹ÜÀíÆ÷  | 
| #  @param None  | 
| #  @return  | 
| def GetSuccDataMng():  | 
|     return g_succDataMng  | 
|   | 
| ## ³É¾ÍOnLogin  | 
| #  @param curPlayer  | 
| #  @return  | 
| def SuccOnLogin(curPlayer):  | 
|     # Í¬²½³É¾ÍÐÅÏ¢  | 
|     Sync_SuccessInfo(curPlayer)  | 
|     # Í¬²½³É¾ÍÁì½±¼Ç¼  | 
|     Sync_SuccTypeIndexAwardRecord(curPlayer)  | 
|     | 
|       | 
|     # ¼ì²éÀÏÍæ¼Ò  | 
|     #__CheckOldPlayerSuccess(curPlayer)  | 
|       | 
|     # ¼ì²é´ï³ÉÓë·ñ(ÓÐЩ¿ÉÄܸĹýÉÏÏÞ£¬È»ºóÍæ¼Ò¿ÉÒÔÍê³É£¬ÉÏÏßͳһ×öÒ»´Î¼ì²é)  | 
|     for succType in ShareDefine.SuccessTypeList:  | 
|         succInfoList = GetSuccDataMng().GetSuccDataByType(succType)  | 
|         if not succInfoList:  | 
|             continue  | 
|         __DoCheckSuccessFinish(curPlayer, succType, succInfoList)  | 
|     return  | 
|   | 
| ## ¼ì²éÀÏÍæ¼Ò³É¾Í¼¤»îÇé¿ö  | 
| #  @param None  | 
| #  @return  | 
| def __CheckOldPlayerSuccess(curPlayer):  | 
|     ''' ³É¾Í°æ±¾¸üÐÂÀÏÍæ¼Ò¼ì²é  | 
|         ÕýʽÉÏÏߺ󣬳ɾ͵ÄÐ޸ĻòÕßÔö¼Ó£¬Ò»°ãÊÇÔö¼Óгɾͣ¬ÔòÐèÒª¶ÔÀÏÍæ¼Ò³É¾Í°æ±¾½øÐÐУÕý£¬¼ì²é³É¾ÍÍê³ÉÇé¿ö  | 
|         ³É¾Í°æ±¾ºÅµÝÔö  | 
|     '''  | 
|     Versions = 2 #°æ±¾ºÅ,ÍùÉÏÔö¼Ó  | 
|       | 
|     # ÉÏÏßÐèÒª¼ì²éÀÏÍæ¼Ò³É¾ÍÍê³ÉÇé¿öÀàÐÍ{³É¾ÍÀàÐÍ:ά»¤°æ±¾ºÅ, ...}  | 
|     NeedCheckSuccTypeDict = {  | 
|                              }  | 
|       | 
|     curCheckVersion = GetPDictValue(curPlayer, ChConfig.Def_PDict_Success_CheckVersion)  | 
|     GameWorld.DebugLog("¸üÐÂÀÏÍæ¼ÒÉÏÏß¼ì²é³É¾ÍcurCheckVersion=%s" % (curCheckVersion))  | 
|     for succType, version in NeedCheckSuccTypeDict.items():  | 
|           | 
|         if curCheckVersion >= version:  | 
|             continue  | 
|           | 
| #        condition = 0  | 
| #        if succType == ShareDefine.SuccType_MainTaskNode: #Ö÷ÏßÈÎÎñ½áµã  | 
| #            succInfoDict = GetSuccDataMng().GetSuccDataByType(ShareDefine.SuccType_MainTaskNode)  | 
| #            condition = QuestCommon.GetCurMainTaskState(curPlayer, succInfoDict)  | 
| #            addCnt = 1 if condition >= 0 else 0  | 
| #              | 
| #        else:  | 
| #            continue  | 
| #          | 
| #        DoAddSuccessProgress(curPlayer, succType, addCnt, condition)  | 
|           | 
|     SetPDictValue(curPlayer, ChConfig.Def_PDict_Success_CheckVersion, Versions)  | 
|     GameWorld.DebugLog("¸üÐÂÀÏÍæ¼ÒÉÏÏß¼ì²é³É¾ÍupdCheckVersions=%s" % (Versions))  | 
|     return  | 
|   | 
| ## ³É¾ÍOnWeek  | 
| #  @param curPlayer  | 
| #  @return  | 
| def OnWeek(curPlayer):  | 
|     resetList = []  | 
|     weekResetSuccTypeList = IpyGameDataPY.GetFuncEvalCfg('WeekResetSuccType')  | 
|     for succType in weekResetSuccTypeList:  | 
|         succInfoList = GetSuccDataMng().GetSuccDataByType(succType)  | 
|         if not succInfoList:  | 
|             continue  | 
|         for succDataObj in succInfoList:  | 
|             succID = succDataObj.succID  | 
|             condition = succDataObj.condition  | 
|             if not GetSuccFinishValue(curPlayer, succType, condition):  | 
|                 continue  | 
|             SetSuccFinishValue(curPlayer, succType, condition, 0)  | 
|             SetSuccFinish(curPlayer, succID, False)  | 
|             SetSuccHasGot(curPlayer, succID, False)  | 
|             resetList.append(succID)  | 
|             GameWorld.DebugLog("    OnWeek ÖØÖóɾÍÀàÐÍ: succID=%s" % (succID))  | 
|     if resetList:  | 
|         Sync_SuccTypeIndexAwardRecord(curPlayer, resetList, True)  | 
|         Sync_SuccessInfo(curPlayer, resetList, True)  | 
|     return  | 
|   | 
| ## ³É¾ÍOnDay  | 
| #  @param curPlayer  | 
| #  @return  | 
| def SuccOnDay(curPlayer):  | 
|     resetList = []  | 
|     # ÖØÖÃÁ¬ÐøÀàÐͶϵôµÄÊý¾Ý  | 
|     serverDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)  | 
|     GameWorld.DebugLog("Á¬ÐøÀàÐͳɾ͹ýÌì...serverDay=%s" % serverDay)  | 
|     for succType in ShareDefine.ContinueSuccessTypeList:  | 
|           | 
|         succInfoList = GetSuccDataMng().GetSuccDataByType(succType)  | 
|           | 
|         if not succInfoList:  | 
|             continue  | 
|          | 
|         for succDataObj in succInfoList:  | 
|             succID = succDataObj.succID  | 
|             condition = succDataObj.condition  | 
|             #GameWorld.DebugLog("    succID=%s" % (succID))  | 
|               | 
|             finishTime = GetSuccIsFinish(curPlayer, succID)  | 
|               | 
|             # ÒÑÍê³ÉµÄ²»ÔÙ¼ì²é  | 
|             if finishTime > 0 or GetSuccHasGot(curPlayer, succID):  | 
|                 GameWorld.DebugLog("        ÒÑÍê³ÉµÄ²»ÔÙ¼ì²é")  | 
|                 continue  | 
|               | 
|             if __DoCheckResetContinue(curPlayer, serverDay, succID):  | 
|                 SetSuccFinishValue(curPlayer, succType, condition, 0)  | 
|                 resetList.append(succID)  | 
|                   | 
|     if resetList:  | 
|         Sync_SuccessInfo(curPlayer, resetList, True)  | 
|     return  | 
|   | 
| ## ¼ì²é³É¾ÍÁ¬ÐøÌìÇé¿ö  | 
| #  @param curPlayer  | 
| #  @return True-Á¬ÐøÒÑÖÐ¶Ï  | 
| def __DoCheckResetContinue(curPlayer, serverDay, succID):  | 
|     lastDayKey = ChConfig.Def_PDict_Success_LastDay % (succID)  | 
|     lastDay = GetPDictValue(curPlayer, lastDayKey)  | 
|       | 
|     # ¼Ç¼ʱ¼ä´Ó¿ª·þÌìÊý¸Ä³É time.time()  | 
|     if lastDay <= 1000:  | 
|         #GameWorld.DebugLog("        lastDay <= 0")  | 
|         return  | 
|       | 
|     tick = int(time.time())  | 
|     serverDay = GameWorld.ChangeTimeNumToDatetime(tick, ChConfig.TYPE_Time_Format_Day)  | 
|     lastDay = GameWorld.ChangeTimeNumToDatetime(lastDay, ChConfig.TYPE_Time_Format_Day)  | 
|     # ×òÌìÓиüеIJ»´¦Àí£¬Ö¤Ã÷»¹ÊÇÁ¬Ðø×´Ì¬  | 
|     if lastDay == serverDay - datetime.timedelta(1):  | 
|         GameWorld.DebugLog("        ×òÌìÓиüеIJ»´¦Àí£¬Ö¤Ã÷»¹ÊÇÁ¬Ðø×´Ì¬")  | 
|         return  | 
|       | 
|       | 
|     SetPDictValue(curPlayer, lastDayKey, 0)  | 
|     GameWorld.DebugLog("    ÖØÖóɾÍÁ¬ÐøÀàÐÍ: succID=%s" % (succID))  | 
|     return True  | 
|   | 
| def ResetSuccessByType(curPlayer, succType):  | 
|     #ÖØÖÃijÀàÐͳɾͽø¶È£¨ÒÑÍê³ÉµÄ²»ÖØÖã©  | 
|     succInfoList = GetSuccDataMng().GetSuccDataByType(succType)  | 
|     if not succInfoList:  | 
|         return  | 
|     #ÏÈÖØÖôÎÊýÔÙÖØÐ¼ÆÊý  | 
|     for succDataObj in succInfoList:  | 
|         succID = succDataObj.succID  | 
|         condition = succDataObj.condition  | 
|         #GameWorld.DebugLog("    succID=%s" % (succID))  | 
|         finishTime = GetSuccIsFinish(curPlayer, succID)  | 
|         # ÒÑÍê³ÉµÄ²»ÔÙ¼ì²é  | 
|         if finishTime > 0 or GetSuccHasGot(curPlayer, succID):  | 
|             continue  | 
|         SetSuccFinishValue(curPlayer, succType, condition, 0)  | 
|     return  | 
|   | 
| def DoEquipSuccessLogic(curPlayer):  | 
|     #Íæ¼Òµ±Ç°¿É×°±¸µÄ×°±¸ÀàÐÍ  | 
|     ResetSuccessByType(curPlayer, ShareDefine.SuccType_EquipColorItem)  | 
|     ResetSuccessByType(curPlayer, ShareDefine.SuccType_EquipArmor)  | 
|     ResetSuccessByType(curPlayer, ShareDefine.SuccType_EquipWeapon)  | 
|       | 
|     packType = IPY_GameWorld.rptEquip  | 
|       | 
|     playerEquip = curPlayer.GetItemManager().GetPack(packType)  | 
|     for equipIndex in xrange(playerEquip.GetCount()):  | 
|         if equipIndex not in ShareDefine.RoleEquipType :  | 
|             continue  | 
|          | 
|         curEquip = playerEquip.GetAt(equipIndex)  | 
|         if curEquip.IsEmpty():  | 
|             continue  | 
|         itemColor = curEquip.GetUserAttr(ShareDefine.Def_IudetItemColor)  | 
|         if not itemColor:  | 
|             itemColor = curEquip.GetItemColor()  | 
|           | 
|         itemQuality = curEquip.GetItemQuality()  | 
|         classLV = ItemCommon.GetItemClassLV(curEquip)  | 
|         if equipIndex not in [ShareDefine.retWing,ShareDefine.retGuard,ShareDefine.retHorse]:  | 
|             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipColorItem, 1, [classLV, itemColor])  | 
|         if equipIndex in ChConfig.BaseEquipPlace_Weapon:  | 
|             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipWeapon, 1, [itemColor, itemQuality, classLV])  | 
|         elif equipIndex in ChConfig.BaseEquipPlace_Armor:  | 
|             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipArmor, 1, [itemColor, itemQuality, classLV])  | 
|           | 
|         elif equipIndex == ShareDefine.retWing:  | 
|             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipWing, 1, [classLV, itemColor])  | 
|     return  | 
|   | 
|   | 
| ## ¸üгɾÍÍê³É½ø¶ÈÂß¼(Íⲿ¹¦Äܵ÷Óã¬Ö»ÊÊÓÃÓÚ²»ÖØÖõijɾÍÀàÐÍ)  | 
| #  @param curPlayer  | 
| #  @param successType: ³É¾ÍÀàÐÍ  | 
| #  @param newCnt: Ð½ø¶ÈÖµ  | 
| #  @return  | 
| def UptateSuccessProgress(curPlayer, successType, newCnt, condition=[]):  | 
|     if successType not in ShareDefine.SuccessTypeList:  | 
|         return  | 
|     succInfoList = GetSuccDataMng().GetSuccDataByType(successType)  | 
|     if not succInfoList:  | 
|         return  | 
|     curCnt = -1  | 
|     for succData in succInfoList:  | 
|         if not __CheckCanAddSuccess(curPlayer, succData, condition):  | 
|             continue  | 
|         curCnt = GetSuccFinishValue(curPlayer, successType, succData.condition)  | 
|         break  | 
|     | 
|     if curCnt == -1:  | 
|         return  | 
|     if newCnt > curCnt: #ÕâÀïÐèÒªÁ¢¼´¸üУ¡£¡  | 
|         DoAddSuccessProgress(curPlayer, successType, newCnt - curCnt, condition, False)  | 
|     return  | 
|   | 
| def __CheckCanAddSuccess(curPlayer, succDataObj, condition):  | 
|     successType = succDataObj.succType  | 
|     succID = succDataObj.succID  | 
|     cond = succDataObj.condition  | 
|       | 
|     isUnDownCheck = successType in ShareDefine.UnDownCheckSuccessTypeList  | 
|     isContain = successType in ShareDefine.ContainSuccessTypeList  | 
|     # ÒÑÍê³ÉµÄ²»ÔÙ¼ì²é  | 
|     if GetSuccIsFinish(curPlayer, succID) or GetSuccHasGot(curPlayer, succID):  | 
|         return  | 
|     #ǰÖóɾÍÅÐ¶Ï  | 
|     preSuccIDList = succDataObj.preSuccIDList  | 
|     for preSuccID in preSuccIDList:  | 
|         if not GetSuccIsFinish(curPlayer, preSuccID) and not GetSuccHasGot(curPlayer, preSuccID):  | 
|             return  | 
|       | 
|     # Óи¨ÖúÌõ¼þµÄ, ÐèÅжÏÊÇ·ñÏòϼì²é  | 
|     if len(cond) > 0:  | 
|         if isContain:  | 
|             if condition[0] not in cond:  | 
|                 return  | 
|         elif successType in ShareDefine.MultipleSuccessTypeList:  | 
|             if not (condition[0]/cond[0] and condition[0]%cond[0] == 0):  | 
|                 #±ØÐëÊÇÌõ¼þµÄ±¶Êý  | 
|                 return  | 
|         else:  | 
|             if len(cond) != len(condition):  | 
|                 return  | 
|             # ²»Ïòϼì²éÔö¼Ó½ø¶ÈµÄ, ½öÅäÖÃÖµµÈÓÚ¸ÃÖµµÄ¿ÉÔö¼Ó½ø¶È  | 
|             if isUnDownCheck and cond != condition:  | 
|                 return  | 
|             # ¿ÉÏòÏÂÔö¼Ó½ø¶ÈµÄ, ½öÅäÖÃÖµ <= ¸ÃÖµµÄ¿ÉÔö¼Ó½ø¶È  | 
|             if not isUnDownCheck:  | 
|                 isbreak = False  | 
|                 for i, num in enumerate(cond):  | 
|                     if num > condition[i]:  | 
|                         isbreak = True  | 
|                         break  | 
|                 if isbreak:  | 
|                     return  | 
|     return True  | 
|   | 
|   | 
| # ½«¹¥»÷ÀàµÄ³É¾ÍÒ»´ÎÖ´ÐУ¬¼õÉÙÔËÐÐÁ¿  | 
| def FinishDelayAddSuccessProgress(curPlayer, tick, isFinish=True):  | 
|   | 
|     if not isFinish:  | 
|         # ¶þ´ÎÑÓ³Ù´¦Àí  | 
|         if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_Success) \  | 
|            < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_Success]:  | 
|             return  | 
|           | 
|         curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_Success, tick)   | 
|       | 
|     playerID = curPlayer.GetID()  | 
|     if playerID not in PyGameData.g_delaySuccessDict:  | 
|         return  | 
|       | 
|     successDict = PyGameData.g_delaySuccessDict.pop(playerID)  | 
|     for sucessInfo, cnt in successDict.items():  | 
|   | 
|         DoAddSuccessProgress(curPlayer, sucessInfo[0], cnt, list(sucessInfo[1]), False)  | 
|   | 
|     return  | 
|   | 
|   | 
| ## Ôö¼Ó³É¾ÍÍê³É½ø¶ÈÂß¼(Íⲿ¹¦Äܵ÷ÓÃ)  | 
| #  @param curPlayer  | 
| #  @param successType: ³É¾ÍÀàÐÍ  | 
| #  @param addCnt: Ôö¼Ó½ø¶ÈÖµ  | 
| #  @param condition: À©Õ¹Ìõ¼þ  | 
| #  @return  | 
| def DoAddSuccessProgress(curPlayer, successType, addCnt, condition=[], delayCalc=True):  | 
|     #GameWorld.DebugLog("DoAddSuccessProgress type=%s,addCnt=%s,condition=%s"   | 
|     #                   % (successType, addCnt, condition), curPlayer.GetPlayerID())  | 
|   | 
|     playerID = curPlayer.GetID()  | 
|     if delayCalc and successType not in ShareDefine.NeedResetSuccessTypeList:  | 
|         if playerID not in PyGameData.g_delaySuccessDict:  | 
|             PyGameData.g_delaySuccessDict[playerID] = {}  | 
|               | 
|         # ×îÖÕ´¦Àí¼õÉÙ¼ÆËãÁ¿  | 
|         successTuple = (successType, tuple(condition))  | 
|         if successTuple not in PyGameData.g_delaySuccessDict[playerID]:  | 
|             PyGameData.g_delaySuccessDict[playerID][successTuple] = addCnt  | 
|         else:  | 
|             PyGameData.g_delaySuccessDict[playerID][successTuple] = PyGameData.g_delaySuccessDict[playerID][successTuple] + addCnt  | 
|           | 
|         return  | 
|   | 
|   | 
|     if condition and type(condition) != type([]):  | 
|         GameWorld.ErrLog('DoAddSuccessProgress type=%s, condition=%s ´íÎó£¡'%(type, condition))  | 
|         return  | 
|     if successType not in ShareDefine.SuccessTypeList:  | 
|         return  | 
|       | 
|     succInfoList = GetSuccDataMng().GetSuccDataByType(successType)  | 
|     if not succInfoList:  | 
|         GameWorld.DebugLog("    ÕÒ²»µ½³É¾ÍÊý¾ÝsuccessType=%s" % successType)  | 
|         return  | 
|       | 
|     maxCnt = 0 # ±¾´Î¿ÉÒÔ¸üе½µÄ×î´óÖµ  | 
|     updConditionList = [] # Ðè¸üнø¶ÈÖµµÄkey±àºÅÁÐ±í  | 
|     updIDList = []  | 
|     updsuccDataList = []  | 
|     tick = int(time.time())  | 
|     for succDataObj in succInfoList:  | 
|         succID = succDataObj.succID  | 
|         needCnt = succDataObj.needCnt  | 
|           | 
|         if not __CheckCanAddSuccess(curPlayer, succDataObj, condition):  | 
|             continue  | 
|         updIDList.append(succID)  | 
|         updsuccDataList.append(succDataObj)  | 
|         curCondition = succDataObj.condition  | 
|         if curCondition not in updConditionList:  | 
|             updConditionList.append(curCondition)  | 
|               | 
|         if maxCnt < needCnt:  | 
|             maxCnt = needCnt  | 
|               | 
|         # Á¬ÐøÀàÐ͵Ä, ¸üÐÂÁ¬ÐøÊ±µÄ¿ª·þÌìÊý  | 
|         if successType in ShareDefine.ContinueSuccessTypeList:  | 
|             lastDayKey = ChConfig.Def_PDict_Success_LastDay % (succID)  | 
|             SetPDictValue(curPlayer, lastDayKey, tick)  | 
|               | 
|           | 
|                   | 
|     #GameWorld.DebugLog("    updConditionList=%s,maxCnt=%s" % (str(updConditionList), maxCnt))  | 
|       | 
|     # Ã»ÓÐÕÒµ½¸üÐÂÄ¿±ê²»´¦Àí  | 
|     if not updConditionList or maxCnt <= 0:  | 
|         return  | 
|       | 
|     # ÏȸüгɾͼǼֵºóÔÙÅжÏÍê³ÉÓë·ñ  | 
|     for condition in updConditionList:  | 
|         curCnt = GetSuccFinishValue(curPlayer, successType, condition)  | 
|         updCnt = min(maxCnt, curCnt + addCnt)  | 
|         SetSuccFinishValue(curPlayer, successType, condition, updCnt)  | 
| #        GameWorld.DebugLog("    successType=%s,condition=%s,curCnt=%s,addCnt=%s,updCnt=%s"   | 
| #                           % (successType,condition, curCnt, addCnt, updCnt))  | 
|           | 
|       | 
|     # Í¬²½¸üÐÂÐÅÏ¢  | 
|     Sync_SuccessInfo(curPlayer, updIDList, False)  | 
|       | 
|     # ¸üÐÂÖµºó¼ì²é³É¾ÍÍê³ÉÇé¿ö  | 
|     __DoCheckSuccessFinish(curPlayer, successType, updsuccDataList)  | 
|     return  | 
|   | 
|   | 
| ## ¼ì²é³É¾ÍÍê³ÉÇé¿ö  | 
| #  @param curPlayer  | 
| #  @param successType: ³É¾ÍÀàÐÍ  | 
| #  @param succInfoDict: ¸ÃÀàÐÍËùÓгɾÍÐÅÏ¢×Öµä  | 
| #  @param isPub: ½ø¶ÈÖµÊÇ·ñ¹«¹²  | 
| #  @param updNumList: Óиüнø¶ÈµÄ±àºÅÁÐ±í  | 
| #  @return  | 
| def __DoCheckSuccessFinish(curPlayer, successType, succInfoList):  | 
|       | 
|     isNeedSys = successType in [ShareDefine.SuccType_ElderBattlefieldKill, ShareDefine.SuccType_ElderBattlefieldConKill]  | 
|     curTime = GameWorld.ChangeTimeStrToNum(GameWorld.GetCurrentDataTimeStr())  | 
|     playerName = curPlayer.GetName()  | 
|   | 
|     for succDataObj in succInfoList:  | 
|         succID = succDataObj.succID  | 
|         needCnt = succDataObj.needCnt  | 
|    | 
|         finishTime = GetSuccIsFinish(curPlayer, succID)  | 
|           | 
|         # ÒÑÍê³ÉµÄ²»ÔÙ¼ì²é  | 
|         if finishTime > 0 or GetSuccHasGot(curPlayer, succID):  | 
|             continue  | 
|           | 
|         curCnt = GetSuccFinishValue(curPlayer, successType, succDataObj.condition)  | 
|           | 
|         # Íê³É³É¾Í  | 
|         if curCnt >= needCnt:  | 
|             # ÉèÖÃÍê³Éʱ¼ä  | 
|             SetSuccFinish(curPlayer, succID)  | 
|             # Ã»Óн±ÀøµÄÖ±½ÓÉèÖÃÒÑÁìÈ¡  | 
|             if not succDataObj.hasAward:  | 
|                 SetSuccHasGot(curPlayer, succID)  | 
|                   | 
|             # Í¨Öª¿Í»§¶ËÍê³É³É¾Í  | 
|             Notify_FinishSuccess(curPlayer, succID, curTime)  | 
|               | 
|             if isNeedSys:  | 
|                 PlayerControl.WorldNotify(0, 'AncientBattlefield_1', [playerName, succID])  | 
|               | 
|             for mwID in succDataObj.magicWeaponExp.keys():  | 
|                 EventReport.WriteEvent_MWSuccess(curPlayer, mwID, succID, ChConfig.CME_Log_Start)  | 
|             GameWorld.DebugLog("    Íê³É³É¾ÍsuccID=%s, type=%s,time=%s"   | 
|                                % (succID, successType, curTime))  | 
|               | 
|               | 
|       | 
|     return  | 
|   | 
|   | 
| ## ¼ÆËã³É¾ÍÊôÐÔ  | 
| #  @param curPlayer Íæ¼Ò  | 
| #  @param allAttrList ÊôÐÔÁÐ±í  | 
| #  @return None  | 
| def CalcSuccessAttr(curPlayer):  | 
|     allAttrList = [{} for _ in range(4)]  | 
|     attrDict = {}  | 
|     ipyDataMgr = IpyGameDataPY.IPY_Data()  | 
|     for i in xrange(ipyDataMgr.GetSuccessCount()):  | 
|         ipyData = ipyDataMgr.GetSuccessByIndex(i)  | 
|         succID = ipyData.GetID()  | 
|         attrAwardDict = ipyData.GetAwardAttr()  | 
|         if not attrAwardDict:  | 
|             continue  | 
|         if not GetSuccHasGot(curPlayer, succID):  | 
|             continue  | 
|         for attrID, attrValue in attrAwardDict.items():  | 
|             attrDict[attrID] = attrDict.get(attrID, 0) + attrValue  | 
|               | 
|     GameWorld.DebugLog("    ³É¾ÍÔö¼ÓÊôÐÔ attrDict=%s" % (attrDict))          | 
|     for attrID, attrValue in attrDict.items():  | 
|         PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)  | 
|           | 
|     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Success, allAttrList)  | 
|     return  | 
|   | 
| ## Ë¢Ð³ɾÍÊôÐÔ  | 
| def RefreshSuccessAttr(curPlayer):  | 
|     CalcSuccessAttr(curPlayer)  | 
|     # ²»Á¢¼´Ë¢Ð  | 
|     PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()  | 
|     return  | 
|   | 
| ## Í¬²½³É¾ÍÐÅÏ¢  | 
| #  @param curPlayer:   | 
| #  @param syncDict: Ö¸¶¨Í¬²½×Öµä  | 
| #  @param isSendZero: ÊÇ·ñͬ²½¿ÕÊý¾Ý(ÈçÁ¬ÐøÀàÐͽø¶ÈÖµ±»Çå¿Õʱ or GMÃüÁî²âÊÔ), Êý¾Ý±È½Ï¶à£¬¿ÕÊý¾ÝĬÈϾͲ»Í¬²½ÁË  | 
| #  @return  | 
| def Sync_SuccessInfo(curPlayer, succIdList=[], isSendZero=False):  | 
|     succInfoListPack = ChPyNetSendPack.tagMCSuccessInfoList()  | 
|     succInfoListPack.Clear()  | 
|     succInfoListPack.SuccessInfoList = []  | 
|     if succIdList:  | 
|         syncIdList = succIdList  | 
|     else:  | 
|         syncIdList = []  | 
|         ipyDataMgr = IpyGameDataPY.IPY_Data()  | 
|         for i in xrange(ipyDataMgr.GetSuccessCount()):  | 
|             ipyData = ipyDataMgr.GetSuccessByIndex(i)  | 
|             succID = ipyData.GetID()  | 
|             syncIdList.append(succID)  | 
|               | 
|     syncTypeDict = {}  | 
|     for succID in syncIdList:  | 
|         succData = GetSuccDataMng().GetSuccessData(succID)  | 
|         if not succData:  | 
|             continue  | 
|         succType = succData.succType  | 
|         condition = succData.condition  | 
|   | 
|         CntValue = GetSuccFinishValue(curPlayer, succType, condition)  | 
|         isfinish = GetSuccIsFinish(curPlayer, succID)  | 
|         # ²»·¢ËÍΪ0µÄÊý¾Ý  | 
|         if not isSendZero and CntValue <= 0 and not isfinish:  | 
|             continue  | 
|         # ÒÑÁìÈ¡µÄ²»·¢   | 
|         if GetSuccHasGot(curPlayer, succID):  | 
|             continue  | 
|               | 
|         if succType not in syncTypeDict:  | 
|             syncTypeDict[succType] = [[condition, CntValue]]  | 
|         elif [condition, CntValue] not in syncTypeDict[succType]:  | 
|             syncTypeDict[succType].append([condition, CntValue])  | 
|           | 
|     if not syncTypeDict:  | 
|         return  | 
|       | 
|     for sType, conditionList in syncTypeDict.items():  | 
|         for condition, cntValue in conditionList:  | 
|             succInfo = ChPyNetSendPack.tagMCSuccessInfo()  | 
|             succInfo.Clear()  | 
|             succInfo.SuccType = sType  | 
|             succInfo.Condition = str(condition) if condition else '[0]'  | 
|             succInfo.Len = len(succInfo.Condition)  | 
|             succInfo.CntValue = cntValue  | 
|             succInfoListPack.SuccessInfoList.append(succInfo)  | 
|           | 
|     succInfoListPack.count = len(succInfoListPack.SuccessInfoList)  | 
|     NetPackCommon.SendFakePack(curPlayer, succInfoListPack)  | 
|     return  | 
|   | 
|   | 
| ## Í¨ÖªÍê³É³É¾Í  | 
| #  @param None  | 
| #  @return  | 
| def Notify_FinishSuccess(curPlayer, succID, finishTime):  | 
|     succFinishPack = ChPyNetSendPack.tagMCSuccessFinish()  | 
|     succFinishPack.Clear()  | 
|     succFinishPack.SuccID = succID  | 
|     #succFinishPack.FinishTime = finishTime      | 
|     NetPackCommon.SendFakePack(curPlayer, succFinishPack)  | 
|     return  | 
|   | 
|   | 
| def GetCanGetAwardSuccByType(curPlayer, successTypeList):  | 
|     ##¸ù¾ÝÀàÐÍ»ñÈ¡¿ÉÁìÈ¡µÄ³É¾Í  | 
|     succList = []  | 
|     for successType in successTypeList:  | 
|         succInfoList = GetSuccDataMng().GetSuccDataByType(successType)  | 
|         for succDataObj in succInfoList:  | 
|             succID = succDataObj.succID  | 
|             if GetSuccIsFinish(curPlayer, succID) and not GetSuccHasGot(curPlayer, succID):  | 
|                 succList.append(succID)  | 
|     return succList  | 
|   | 
| def GiveSuccAward(curPlayer, succIDList, isGiveItem=True):  | 
|     #¸ø³É¾Í½±Àø  | 
|     awardDict = {}  | 
|     for succID in succIDList:  | 
|         awardItemDict = __DoGetSuccTypeIndexAward(curPlayer, succID, isGiveItem)  | 
|         if not awardItemDict:  | 
|             continue  | 
|         for itemID,itemCnt in awardItemDict.items():  | 
|             awardDict[itemID] = awardDict.get(itemID, 0)+itemCnt  | 
|     return awardDict  | 
|   | 
| #// A5 42 ÁìÈ¡³É¾Í½±Àø #tagMCGetSuccessAward  | 
| #  | 
| #struct    tagMCGetSuccessAward  | 
| #{  | 
| #    tagHead        Head;  | 
| #    DWORD        SuccID;    //³É¾ÍID  | 
| #};  | 
| ## ÁìÈ¡³É¾Í½±Àø  | 
| #  @param None  | 
| #  @return  | 
| def OnGetSuccessAward(index, clientData, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     succID = clientData.SuccID  | 
|     __DoGetSuccTypeIndexAward(curPlayer, succID)  | 
|     return  | 
|   | 
| ## Áìȡij¸ö³É¾Í½±Àø  | 
| #  @param None  | 
| #  @return  | 
| def __DoGetSuccTypeIndexAward(curPlayer, succID, isGiveItem=True):  | 
|     GameWorld.DebugLog("ÁìÈ¡³É¾Í½±ÀøsuccID=%s" % (succID))  | 
|      | 
|     succData = GetSuccDataMng().GetSuccessData(succID)  | 
|     if not succData:  | 
|         GameWorld.DebugLog("    ³É¾ÍÊý¾Ý²»´æÔÚ£¡succID=%s" % (succID))  | 
|         return  | 
|       | 
|     finishTime = GetSuccIsFinish(curPlayer, succID)  | 
|     if finishTime <= 0:  | 
|         GameWorld.DebugLog("    ¸Ã³É¾ÍδÍê³É£¡")  | 
|         return  | 
|       | 
|     if GetSuccHasGot(curPlayer, succID):  | 
|         GameWorld.DebugLog("    ¸Ã³É¾Í½±ÀøÒѾÁìÈ¡¹ý£¡")  | 
|         return  | 
|       | 
|     if not succData.hasAward:  | 
|         GameWorld.DebugLog("    ¸Ã³É¾ÍûÓÐÅäÖý±Àø£¡")  | 
|         return  | 
|       | 
|     itemDict = succData.awardItemDict  | 
| #    if awardItemDict and '[' in str(awardItemDict):  | 
| #        #ÐÞÐгɾͽ±Àø¸ù¾Ý¾³½çµÈ¼¶±ä  | 
| #        curRealmLV = curPlayer.GetOfficialRank()  | 
| #        sortLVList=sorted(awardItemDict.keys())  | 
| #        findLV = sortLVList[0]  | 
| #        for realmlv in sortLVList:  | 
| #            if curRealmLV <= int(realmlv):  | 
| #                findLV = realmlv  | 
| #                break  | 
| #        itemDict = dict(awardItemDict[findLV])  | 
| #    else:  | 
| #        itemDict = awardItemDict  | 
|           | 
|               | 
|           | 
|           | 
|     # ¼ì²é±³°ü  | 
|     if isGiveItem:  | 
|         packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem)  | 
|         needSpace = len(itemDict)  | 
|         if needSpace > packSpace:  | 
|             PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")  | 
|             return  | 
|   | 
|     # ¸üÐÂÁì½±¼Ç¼  | 
|     SetSuccHasGot(curPlayer, succID)  | 
|       | 
|     # ¸øÎïÆ·  | 
|     if isGiveItem:  | 
|         for itemID, itemCnt in itemDict.items():  | 
|             isPutIn = ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 1,  | 
|                                                    [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True)  | 
|          | 
|     #¸øÇ®  | 
|     for moneyType, value in succData.moneyDict.items():  | 
|         PlayerControl.GiveMoney(curPlayer, moneyType, value)  | 
|           | 
|     #¸ø¾Ñé  | 
|     if succData.exp:  | 
|         PlayerControl.PlayerControl(curPlayer).AddExp(succData.exp)  | 
|     #ÊôÐÔ  | 
|     if succData.attrDict:  | 
|         RefreshSuccessAttr(curPlayer)  | 
|     #·¢ºì°ü  | 
|     if succData.redPacketID:  | 
|         PlayerFamilyRedPacket.CreatRedPacketByID(curPlayer, succData.redPacketID, PlayerFamilyRedPacket.State_NoGot, succID)  | 
|     #·¨±¦¾Ñé  | 
|     if succData.magicWeaponExp:  | 
|         for mwID, addExp in succData.magicWeaponExp.items():  | 
|             PlayerMagicWeapon.AddMagicWeaponUpExp(curPlayer, mwID, addExp)  | 
|             EventReport.WriteEvent_MWSuccess(curPlayer, mwID, succID, ChConfig.CME_Log_End, 1)  | 
|     GameWorld.DebugLog("    OK! awardItemDict=%s moneyDict=%s" % (itemDict, succData.moneyDict))  | 
|     return itemDict  | 
|   | 
|   | 
|   | 
| ## Í¨Öª³É¾Í¶ÔÓ¦½±ÀøÁì½±¼Ç¼  | 
| #  @param None  | 
| #  @return  | 
| def Sync_SuccTypeIndexAwardRecord(curPlayer, succIDList=[], isSyncZero=False):  | 
|     if succIDList:  | 
|         recordIndexList = []  | 
|         for succID in succIDList:  | 
|             recordIndexList.append(succID / 31)  | 
|     else:  | 
|         ipyDataMgr = IpyGameDataPY.IPY_Data()  | 
|         succCnt = ipyDataMgr.GetSuccessCount()  | 
|         if not succCnt:  | 
|             return  | 
|         maxSuccid = ipyDataMgr.GetSuccessByIndex(succCnt-1).GetID()  | 
|         recordIndexList = range(maxSuccid / 31+1)  | 
|               | 
|     succFARPack = ChPyNetSendPack.tagMCSuccessFinishAwardRecordList()  | 
|     succFARPack.Clear()  | 
|     succFARPack.RecordList = []  | 
|     for i in recordIndexList:  | 
|         awardRecord=curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Success_AwardRecord%i)  | 
|         if not isSyncZero and not awardRecord:  | 
|             continue  | 
|         recordInfo = ChPyNetSendPack.tagMCSuccessFinishAwardRecord()  | 
|         recordInfo.RecordIndex = i  | 
|         recordInfo.Record = awardRecord  | 
|         succFARPack.RecordList.append(recordInfo)  | 
|      | 
|     succFARPack.RecordCnt = len(succFARPack.RecordList)  | 
|     NetPackCommon.SendFakePack(curPlayer, succFARPack)  | 
|     return  | 
|   | 
|   | 
| def AddEnterFBSuccess(curPlayer, mapID, addCount):  | 
|     #½øÈ븱±¾³É¾ÍÏà¹Ø  | 
|       | 
|     if mapID == ChConfig.Def_FBMapID_BZZD:  | 
|         #ÏɽçÃØ¾³  | 
|         DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_BZZD, addCount)  | 
|     elif mapID == ChConfig.Def_FBMapID_IceLode:  | 
|         #±ù¾§¿óÂö  | 
|         DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_IceLode, addCount)  | 
|     return |