#!/usr/bin/python # -*- coding: GBK -*- # ##@package E:/GameSVN/U3DGame/ProjectSServer/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py # @todo: # # @author: Alee # @date 2017-10-24 ÏÂÎç09:30:31 # @version 1.0 # # @note: # #--------------------------------------------------------------------- import IPY_GameWorld import GameWorld import BaseAttack import ChConfig import SkillShell import BuffSkill import PlayerControl import SkillCommon import FBLogic import ChItem import PlayerGMOper import OperControlManager import ShareDefine import PlayerGameWallow import ReadChConfig import PlayerDienstgrad import IpyGameDataPY import GameObj import GameMap import math import time import PetControl import AICommon import PlayerSuccess import PassiveBuffEffMng import FunctionNPCCommon import FormulaControl import PlayerFlashSale import PlayerChatBox import PlayerFace import PlayerBackup import PlayerOnline #--------------------------------------------------------------------- #--------------------------------------------------------------------- ##ͨÓüì²âË¢ÐÂʱ¼äÊÇ·ñµ½ÁË # @param curPlayer Íæ¼ÒʵÀý # @param tick µ±Ç°Ê±¼ä´Á # @param tickType tickÀàÐÍ # @return ·µ»ØÊÇ·ñµ½Ê±¼äÁË£¬¼´¿É×öºóÐø²Ù×÷ # @remarks ͨÓüì²âË¢ÐÂʱ¼äÊÇ·ñµ½ÁË def CommonCheckTick(curPlayer, tick, tickType): checkInterval = ChConfig.TYPE_Player_Tick_Time[tickType] lastDealTick = curPlayer.GetTickByType(tickType) curTimePassed = tick - lastDealTick #ˢмä¸ôûÓе½ if curTimePassed < checkInterval: return False curPlayer.SetTickByType(tickType, tick) #µÚÒ»´ÎµÇ½ʱlastDealTickΪ0 µ«ÊÇ´Ëʱ²»´¦Àí Ö»Êǽ«ÉÏÒ»´Î´¦ÀíTickÉèΪµ±Ç°Tick if lastDealTick <= 0: return False return True #--------------------------------------------------------------------- ##´¦ÀíÕ½¶·ºÍ¶ÔÖűê־λ, Ö´ÐÐÍæ¼Ò¿ªÊ¼Õ½¶·Âß¼­ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks ´¦ÀíÕ½¶·ºÍ¶ÔÖűê־λ, Ö´ÐÐÍæ¼Ò¿ªÊ¼Õ½¶·Âß¼­ def ProcessFight(curPlayer, tick): #ÎÞ¹¥»÷±ê־λºÍ¶ÔÖűê¼Çλ²»´¦Àí¹¥»÷ if not PlayerControl.IsPlayerInFight(curPlayer): return __DoProcessFight(curPlayer, tick) # ÎÞÂÛ¹¥»÷³É¹¦»òʧ°Ü¶¼ÖØÖù¥»÷±ê¼Ç£¬·ÀÖ¹¹¥»÷ʧ°ÜʱûÓÐÖØÖñê¼Çµ¼ÖÂÏ´ι¥»÷ÇëÇóʱ±»À¹½Ø __ClearPlayerAttackSign(curPlayer) SkillShell.ClearClientHurtDict(curPlayer) return def __DoProcessFight(curPlayer, tick): #ÊÇ·ñ±»·À³ÁÃÔ isWallow = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_Wallow_LV) > ChConfig.Def_GameWallow_LV_First #½ûÖ¹Õ½¶··µ»Ø if curPlayer.GetGMForbidenFight() or isWallow: #Í˳ö¶ÔÖÅ PlayerControl.ExitPlayerConfronting(curPlayer) if isWallow: PlayerControl.NotifyCode(curPlayer, "AvoidSink09") return # ¿Í»§¶Ë·¢°ü¹¥»÷ useSkillData = GetUseSkillByAutoAtk(curPlayer) if not useSkillData: return skillTypeID = useSkillData.GetSkillTypeID() #=========================================================================== # #´Ë´¦Ö»´¦Àíѹ°ü¹ý¶àµÄÇé¿ö, ¿Í»§¶ËÓÅÏȲ¥·Å¶¯×÷Ϊ±íÏÖ£¬¸Ä³ÉÊÕµ½¼¼ÄܰüµÄʱ¼äÀ´·À·¶¹¥»÷¼ä¸ôCheckClientAttackTick # if SkillCommon.CheckPlayerAtkInterval(curPlayer, skillTypeID, tick): # #GameWorld.DebugLog("¹¥»÷¹ý¿ì") # return #=========================================================================== #Ö´Ðм¼ÄÜ»òÆÕ¹¥Ç°ÇåÒ»´ÎÉËѪÁбí BaseAttack.ClearSkillHurtList() if not __DoClientUseSkillEx(curPlayer, useSkillData, tick): SkillShell.AttackFailNotify(curPlayer, useSkillData) GameWorld.DebugLog("----¹¥»÷ʧ°Ü ¿ÉÄÜÊǼ¼ÄÜCD %s"%skillTypeID) # ¸ù¾Ý²ß»®ÐèÇó ÒÔ¿Í»§¶Ë¶¯×÷Ϊ±ê×¼£¬²»¿É¹¥»÷״̬Ҳ½øÈëCD BaseAttack.Sync_AttackResult(curPlayer, useSkillData) if useSkillData and useSkillData.GetSkillID() != ChConfig.Def_SkillID_Somersault: # ¸úËæÍæ¼ÒͬƵÂʹ¥»÷ PetControl.PetFight(curPlayer, tick) SummonFollowAtk(curPlayer, tick) #=========================================================================== # if not result: # #GameWorld.DebugLog("¹¥»÷ʧ°ÜÇå³ý×Ô¶¯Êͷż¼ÄÜ£¡") # curPlayer.ClearAutoAtk() #=========================================================================== #=========================================================================== # #¼ì²âÏÂÒ»´Î×Ô¶¯Êͷż¼ÄܺÍÖ÷¶¯ÊͷŵÄÓÅÏÈȨ # tmpUseSkill = curPlayer.GetUseSkill() # if not tmpUseSkill: # return # # #GameWorld.DebugLog("¼¼ÄÜÊÍ·ÅÓëÍæ¼Ò²Ù×÷Ò»Ö£¬%s"%([useSkillData.GetSkillTypeID(), tmpUseSkill.GetSkillTypeID()])) # if useSkillData.GetSkillTypeID() == tmpUseSkill.GetSkillTypeID(): # #Çå³ý¼¼ÄÜÊÍ·ÅÊý¾Ý, Íæ¼ÒÖ÷¶¯Êͷŵļ¼ÄܲÅÇå³ý£¬±ÜÃâ·þÎñ¶ËÊͷŵ¼ÖÂÇå³ýÍæ¼Ò²Ù×÷ # curPlayer.ClearUseSkillRec() #=========================================================================== return #---È¡Ïû·þÎñ¶Ë×Ô¶¯Êͷż¼ÄÜ--- # else: # #ÆÕ¹¥Îª¼¼ÄÜ£¬¹Ê²Å¿ÉÇå³ý£¬ÊͷŲ»³É¹¦Çå³ý×Ô¶¯Õ½¶· # curPlayer.SetActionObj(None) # curPlayer.ClearAutoAtk() #ÆÕ¹¥ÒѾ­µ±¼¼ÄÜ´¦Àí #=========================================================================== # #ÊÇ·ñÖ´ÐÐClient·¢°üÊÍ·ÅÆÕ¹¥±ê־λ # doAttack = curPlayer.GetUseSkillTagID() and curPlayer.GetUseSkillTagType() # # #Çå¿ÕClient·¢¼¼Äܹ¥»÷°üÊý¾Ý, ÕâÀォÇå³ýGetUseSkillTagIDºÍGetUseSkillTagType # curPlayer.ClearUseSkillRec() # # #-----Client·¢°üÊÍ·ÅÆÕ¹¥ # if doAttack and __DoAttack_Continue(curPlayer, tick): # #ÆÕͨ¹¥»÷¹¦ÄÜ, ½øÈë¶ÔÖÅ״̬ # PlayerControl.AutoEnterPlayerConfronting(curPlayer) # return #=========================================================================== #Çå¿ÕClient±ê¼ÇµÄÕ½¶·±êÖ¾( Client·¢ÆÕ¹¥,¼¼Äܰü»á°ÑÍæ¼Ò״̬ÉèÖÃΪ paAttack ) return def SummonFollowAtk(curPlayer, tick): for i in range(curPlayer.GetSummonCount()): curSummon = curPlayer.GetSummonNPCAt(i) if not curSummon: continue if not curSummon.GetDictByKey(ChConfig.Def_PlayerKey_AttackFollowMaster): continue useSkillTagID = curPlayer.GetUseSkillTagID() useSkillTagType = curPlayer.GetUseSkillTagType() curTag = GameWorld.GetObj(useSkillTagID, useSkillTagType) if not curTag or GameObj.GetHP(curTag) <= 0: # ûÓÐÖ÷Ä¿±ê¾Í´Ó³ðºÞÖÐÕÒ for i in range(curPlayer.GetAngryNPCCount()): curTag = curPlayer.GetAngryNPCByIndex(i) if not curTag or GameObj.GetHP(curTag) <= 0: continue if not curTag or GameObj.GetHP(curTag) <= 0: return tagDist = 0 #---ÓÅÏÈÊͷż¼ÄÜ--- if AICommon.DoAutoUseSkill(curSummon, curTag, tagDist, tick): return #ÆÕͨ¹¥»÷ BaseAttack.Attack(curSummon, curTag, None, tick) ##»ñµÃÊͷż¼ÄÜ»òÆÕ¹¥£¬Ã»ÓÐÔò´Ó×Ô¶¯ÊÍ·ÅÖлñÈ¡£© # @param curPlyer Íæ¼ÒʵÀý # @return ¼¼ÄÜʵÀý def GetUseSkillByAutoAtk(curPlayer): #-----Client·¢°üÊͷż¼ÄÜ useSkillData = curPlayer.GetUseSkill() if useSkillData: #GameWorld.DebugLog("Ö÷¶¯Êͷż¼ÄÜ") return useSkillData return #---È¡Ïû·þÎñ¶Ë×Ô¶¯ÊÍ·ÅÂß¼­--- #»ñÈ¡»º´æµÄ×Ô¶¯Êͷż¼ÄÜÀàÐÍ # autoSkillType = curPlayer.GetAutoAtkType() # if autoSkillType != ChConfig.Def_AutoAtkSkillType_Skill: # #ÎÞ×Ô¶¯Êͷż¼ÄÜÍ˳ö # return # # curObj = curPlayer.GetActionObj() # if curObj == None or curObj.GetID() == 0: # #GameWorld.DebugLog("GetUseSkillByAutoAtk ÎÞÄ¿±ê") # return # # #ûѪ»òÕß²»¿É¼û # if GameObj.GetHP(curObj) <= 0 or not curObj.GetVisible(): # return # # #¸ù¾Ý¹¥ËÙÈ¡¼¼ÄÜ # useSkill = SkillShell.GetSkillDataBySpeed(curPlayer, curPlayer.GetAutoSkillID()) # if not useSkill: # return # # if not useSkill.GetContinueUse(): # return # # skillAim = SkillShell.GetSkillFireAim(useSkill) # if skillAim == ChConfig.Def_UseSkillAim_Obj: # #Ö¸ÏòÐÔ # curPlayer.SetUseSkillTagType(curObj.GetGameObjType()) # curPlayer.SetUseSkillTagID(curObj.GetID()) # # elif skillAim == ChConfig.Def_UseSkillAim_Ground: # #¶ÔµØ # curPlayer.SetUseSkillPosX(curObj.GetPosX()) # curPlayer.SetUseSkillPosY(curObj.GetPosY()) # # #ÉèÖù¥»÷ÆðµãÎªÍæ¼Ò×ÔÉí×ø±ê # curPlayer.SetAttackTargetPos(curPlayer.GetPosX(), curPlayer.GetPosY()) # # return useSkill #--------------------------------------------------------------------- ##Çå³ýÕ½¶·±ê¼Ç # @param curPlayer Íæ¼ÒʵÀý # @return ·µ»ØÖµÎÞÒâÒå # @remarks def __ClearPlayerAttackSign(curPlayer): #Çå¿ÕClient±ê¼ÇµÄÕ½¶·±êÖ¾( Client·¢ÆÕ¹¥,¼¼Äܰü»á°ÑÍæ¼Ò״̬ÉèÖÃΪ paAttack ) if curPlayer.GetPlayerAction() != IPY_GameWorld.paAttack: return PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull) return # Õë¶Ôй¥»÷ģʽB4 05 def __DoClientUseSkillEx(curPlayer, skillData, tick): #ʹÓü¼Äܽá¹û useSkillResult = False SkillCommon.ClearUsingPassiveSkill(curPlayer) #---ÎÞÄ¿±êÀ༼ÄÜ--- aimType = SkillShell.GetSkillFireAim(skillData) if aimType == ChConfig.Def_UseSkillAim_None: useSkillResult = SkillShell.DoPlayerUseSkill(curPlayer, skillData, tick) #¶ÔµØÊÍ·ÅÀ༼ÄÜ elif aimType == ChConfig.Def_UseSkillAim_Ground: useSkillPosX = curPlayer.GetUseSkillPosX() useSkillPosY = curPlayer.GetUseSkillPosY() useSkillResult = SkillShell.DoPlayerUseSkillGround(curPlayer, skillData, useSkillPosX , useSkillPosY , tick) else: #---ÓÐÄ¿±êÀ༼ÄÜ--- useSkillTagID = curPlayer.GetUseSkillTagID() useSkillTagType = curPlayer.GetUseSkillTagType() if useSkillTagID == 0: #Ö÷ÒªÊÇΪÁ˹㲥¶øÒÑ£¬´Ë´¦Ã»ËãCDǰ¶Ë×Ô¼º×ßCD #curPlayer.View_UseSkillAttack(skillData.GetSkillID(), 0, 0, 0, IPY_GameWorld.IPY_HurtList()) curPlayer.View_UseSkillPos(skillData.GetSkillID(), 0, curPlayer.GetPosX(), curPlayer.GetPosY(), IPY_GameWorld.IPY_HurtList()) return True curTag = GameWorld.GetObj(useSkillTagID, useSkillTagType) #¹¥»÷Ä¿±êÎÞ·¨¹¥»÷ if not curTag: curPlayer.SetActionObj(None) PlayerControl.ExitPlayerConfronting(curPlayer) return useSkillResult #Êͷż¼ÄÜ useSkillResult = SkillShell.DoPlayerUseSkillTag(curPlayer, skillData, curTag, tick) #=========================================================================== # #Ä¿±êÒѾ­ËÀÍö # if GameObj.GetHP(curTag) <= 0: # #È¡ÏûÖ÷½ÇµãÑ¡ # curPlayer.SetActionObj(None) # #Í˳öÕ½¶·¶ÔÖÅ # PlayerControl.ExitPlayerConfronting(curPlayer) # return useSkillResult # # #¼õÒæBuff½øÈëÕ½¶·¶ÔÖÅ # if useSkillResult and skillData.GetSkillType() in ChConfig.Def_CanAttackSkill_List: # #½øÈëÕ½¶·¶ÔÖÅ # curPlayer.SetActionObj(curTag) # PlayerControl.AutoEnterPlayerConfronting(curPlayer) #=========================================================================== return useSkillResult #--------------------------------------------------------------------- ##Ö´Ðпͻ§¶Ë·¢°üµÄÊͷż¼ÄÜ # @param curPlayer Íæ¼ÒʵÀý # @param skillData ¼¼ÄÜÊý¾Ý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÊÇ·ñÊͷż¼Äܳɹ¦ # @remarks ´¦ÀíÕ½¶·ºÍ¶ÔÖűê־λ, Ö´ÐгÖÐøÊ¹Óõļ¼ÄÜ def __DoClientUseSkill(curPlayer, skillData, tick): #ʹÓü¼Äܽá¹û useSkillResult = False #---ÎÞÄ¿±êÀ༼ÄÜ--- if curPlayer.GetUseSkillTagID() == 0: useSkillPosX = curPlayer.GetUseSkillPosX() useSkillPosY = curPlayer.GetUseSkillPosY() #×ÔÎÒÊÍ·ÅÀ༼ÄÜ if useSkillPosX == 0 or useSkillPosY == 0: useSkillResult = SkillShell.DoPlayerUseSkill(curPlayer, skillData, tick) #¶ÔµØÊÍ·ÅÀ༼ÄÜ else: useSkillResult = SkillShell.DoPlayerUseSkillGround(curPlayer, skillData, useSkillPosX , useSkillPosY , tick) return useSkillResult #---ÓÐÄ¿±êÀ༼ÄÜ--- useSkillTagID = curPlayer.GetUseSkillTagID() useSkillTagType = curPlayer.GetUseSkillTagType() curTag = GameWorld.GetObj(useSkillTagID, useSkillTagType) #¹¥»÷Ä¿±êÎÞ·¨¹¥»÷ if not curTag: curPlayer.SetActionObj(None) PlayerControl.ExitPlayerConfronting(curPlayer) return useSkillResult #Êͷż¼ÄÜ useSkillResult = SkillShell.DoPlayerUseSkillTag(curPlayer, skillData, curTag, tick) #Ä¿±êÒѾ­ËÀÍö if GameObj.GetHP(curTag) <= 0: #È¡ÏûÖ÷½ÇµãÑ¡ curPlayer.SetActionObj(None) #Í˳öÕ½¶·¶ÔÖÅ PlayerControl.ExitPlayerConfronting(curPlayer) return useSkillResult #¼õÒæBuff½øÈëÕ½¶·¶ÔÖÅ if useSkillResult and skillData.GetSkillType() in ChConfig.Def_CanAttackSkill_List: #½øÈëÕ½¶·¶ÔÖÅ curPlayer.SetActionObj(curTag) PlayerControl.AutoEnterPlayerConfronting(curPlayer) return useSkillResult #--------------------------------------------------------------------- ##ÊÇ·ñÇå¿Õ¼¼ÄÜʹÓüǼ # @param curPlayer Íæ¼ÒʵÀý # @param curSkill ¼¼ÄÜʵÀý # @param curTag ¼¼ÄÜÊÍ·ÅÄ¿±ê # @return ·µ»ØÖµÕæ, Çå³ýÊͷżÇ¼ # @remarks ÊÇ·ñÇå¿Õ¼¼ÄÜʹÓüǼ def __CheckCanClearUseSkillRec(curPlayer, curSkill , curTag): #Ä¿±êÒѾ­ËÀÍö if curTag != None and GameObj.GetHP(curTag) <= 0: #È¡ÏûÖ÷½ÇµãÑ¡ curPlayer.SetActionObj(None) #Í˳öÕ½¶·¶ÔÖÅ PlayerControl.ExitPlayerConfronting(curPlayer) return True #=============================================================================== # 2010/4/27 ½£Ê¥ÏîĿȫ²¿²»¿É×Ô¶¯Êͷż¼ÄÜ, Óɿͻ§¶Ë×Ô¶¯´ò¹ÖAI¿ØÖÆ # #²»ÊÇÁ¬ÐøÊÍ·ÅÀ༼ÄÜ # if curSkill.GetContinueUse() != 1: # return True #=============================================================================== return True #--------------------------------------------------------------------- ##´¦ÀíÕ½¶·ºÍ¶ÔÖűê־λ, Ö´ÐгÖÐø¹¥»÷ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÊÇ·ñÊͷż¼Äܳɹ¦ # @remarks ´¦ÀíÕ½¶·ºÍ¶ÔÖűê־λ, Ö´ÐгÖÐø¹¥»÷ def __DoAttack_Continue(curPlayer, tick): curTag = __GetCanAttack_ObjDetel(curPlayer, tick) if not curTag: ##Î޿ɹ¥»÷Ä¿±ê, Í˳öÕ½¶·¶ÔÖÅ PlayerControl.ExitPlayerConfronting(curPlayer) return False #µÃµ½Íæ¼ÒµÄÎäÆ÷ # curWeapon = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip).GetAt(ShareDefine.retWeapon) # # if curWeapon.IsEmpty(): # return False #ÆÕ¹¥ÐÐΪ״̬, ·þÎñ¶ËÏÞÖÆ if not OperControlManager.IsObjCanDoAction(curPlayer, ChConfig.Def_Obj_ActState_ServerSkill, ChConfig.Def_Action_Attack_Bit): return False #ÉèÖù¥»÷±ê־λ PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paAttack) return BaseAttack.Attack(curPlayer, curTag, None, tick) #--------------------------------------------------------------------- ##»ñÈ¡¿ÉÒÔÆÕͨ¹¥»÷µÄ¶ÔÏóʵÀý # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ¹¥»÷¶ÔÏóʵÀý # @remarks »ñÈ¡¿ÉÒÔÆÕͨ¹¥»÷µÄ¶ÔÏóʵÀý def __GetCanAttack_ObjDetel(curPlayer, tick): #µ±Ç°¶ÔÏó curTag = __GetAttackObj(curPlayer) if not curTag: curPlayer.SetActionObj(None) return relation = BaseAttack.GetTagRelation(curPlayer, curTag, None, tick) #ÅжÏÊÇ·ñµÐ¶Ô¹ØÏµ if relation[0] != ChConfig.Type_Relation_Enemy : #AttackCommon.PlayerAttackFailSysMessanage(curPlayer, relation[1]) return return curTag #--------------------------------------------------------------------- ##»ñµÃµ±Ç°¹¥»÷µÄ¶ÔÏó # @param curPlayer Íæ¼ÒʵÀý # @return ·µ»ØÖµ, µ±Ç°¹¥»÷µÄÄ¿±ê # @remarks »ñµÃµ±Ç°¹¥»÷µÄ¶ÔÏó def __GetAttackObj(curPlayer): curObj = curPlayer.GetActionObj() if curObj == None or curObj.GetID() == 0: return #µ±Ç°¶ÔÏó curTag = GameWorld.GetObj(curObj.GetID(), curObj.GetGameObjType()) #¶ÔÏó²»´æÔÚ if not curTag or GameObj.GetHP(curTag) <= 0: return #¶ÔÏóÀ뿪ÆÁÄ»¹ýÔ¶ if not curPlayer.CanSeeOther(curTag): return return curTag #--------------------------------------------------------------------- ##´¦ÀíÍæ¼Ò³ÖÐøÐÔBuff,°üº¬³¡¾°Buff # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks ´¦ÀíÍæ¼Ò³ÖÐøÐÔBuff,°üº¬³¡¾°Buff def ProcessPlayerBuffEffect(curPlayer, tick): #---´¦Àí³¡¾°Buff--- SkillShell.ProcessMapBuff(curPlayer, tick) #Ë¢ÐÂÍæ¼Ò³ÖÐøÐÔbuff if tick - curPlayer.GetPersistBuffTick() <= ChConfig.Def_ProcessPlayerPersistBuff: return curPlayer.SetPersistBuffTick(tick) #---´¦Àí³ÖÐøÐÔBuff--- SkillShell.ProcessPersistBuff(curPlayer, tick) return #--------------------------------------------------------------------- ##´¦ÀíÍæ¼Ò½ø¶ÈÌõʼþ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # ÌØÊâ˵Ã÷ChangePlayerAction -> SetPlayerAction ÖÐ ÔÚÀ­Ìõ״̬»á֪ͨ Sync_PrepareEnd£¬Ä¬ÈϽø¶ÈÌõÀàÐÍ # Sync_PrepareEnd ֪ͨ0²ÅËã½ø¶ÈÌõ³É¹¦£¬ÆäËûΪʧ°Ü£¬×Ôµ÷ÓÃÂß¼­Ê±Çë×¢Òâ def ProcessPlayerPrepareState(curPlayer, tick): prepareState = curPlayer.GetPrepareState() #ͨ¹ý¶¯×÷»ñµÃÏàÓ¦¶¯×÷λ curActBit = OperControlManager.GetActBitByAction(ChConfig.Def_ActBit_PstState, prepareState) if curActBit != None: #À­½ø¶ÈÌõÖР״̬, ·þÎñ¶ËÏÞÖÆ if not OperControlManager.IsObjCanDoAction(curPlayer, ChConfig.Def_Obj_ActState_ServerAct, curActBit): #ÉèÖÿÕÏÐ״̬ PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull) return if tick - curPlayer.GetPlayerActionTick() < curPlayer.GetPrepareTime(): #ʱ¼ä¼ä¸ôûÓе½ if prepareState in [IPY_GameWorld.pstCollecting, IPY_GameWorld.pstMissionCollecting]: OnCollecting(curPlayer, tick) return if prepareState == IPY_GameWorld.pstDig: #ÍÚ±¦×´Ì¬ pass elif prepareState == IPY_GameWorld.pstSkill: SkillShell.SkillPrepareEnd(curPlayer, tick) return elif prepareState == IPY_GameWorld.pstCollecting: #¶áÆì³É¹¦ __DoLogic_CollectingOk(curPlayer, tick) elif prepareState == IPY_GameWorld.pstCatching: #ÕÙ»½NPC³É¹¦ ChItem.OnPrepareEnd(curPlayer, prepareState) elif prepareState == IPY_GameWorld.pstTownPortal: #Õ½¶·Öлسdzɹ¦ pass elif prepareState == IPY_GameWorld.pstMissionCollecting: pass elif prepareState == ShareDefine.Def_PstTrans: mapID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TransMapId) posX = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TransPosX) posY = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TransPosY) if not TransCostAfterPrepare(curPlayer): return PlayerControl.PlayerResetWorldPos(curPlayer, mapID, posX, posY) #PlayerControl.NotifyCode(curPlayer, "Map_Deliver_Succeed", [mapID]) #ÖØÖÃÍæ¼Ò״̬ curPlayer.SetPrepareState(0) # ³É¹¦ PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull) return def OnCollecting(curPlayer, tick): ## ²É¼¯ÖÐÂß¼­ tagObj = curPlayer.GetActionObj() if not tagObj: return if tagObj.GetGameObjType() != IPY_GameWorld.gotNPC: return curNPC = GameWorld.GetNPCManager().GetNPCByIndex(tagObj.GetIndex()) if not curNPC: return FBLogic.OnCollecting(curPlayer, tick) npcID = curNPC.GetNPCID() collectNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("CollectNPC", npcID) if collectNPCIpyData: DoCollectingLostHP(curPlayer, collectNPCIpyData, tick, False) return def DoCollectingLostHP(curPlayer, collectNPCIpyData, tick, isEnd): ## Ö´Ðвɼ¯µôѪ if not collectNPCIpyData.GetLostHPPer(): return lostSecond, lostHPPer = collectNPCIpyData.GetLostHPPer() lastTick = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CollectLostHPTick) lostTime = (tick - lastTick) / (lostSecond * 1000.0) # µôѪ´ÎÊý if isEnd: lostTime = int(round(lostTime)) # ²É¼¯ÍêµÄʱºòËÄÉáÎåÈë else: lostTime = int(lostTime) if lostTime < 1: return curPlayer.SetDict(ChConfig.Def_PlayerKey_CollectLostHPTick, tick) lostValue = int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime skillTypeID, buffOwner = 0, None SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick, skillAffect=False) GameWorld.DebugLog("²É¼¯µôѪ: npcID=%s,lostHPPer=%s,lostTime=%s,lostValue=%s" % (collectNPCIpyData.GetNPCID(), lostHPPer, lostTime, lostValue)) return ##´«Ëͽø¶ÈÌõÍê³Éºó¿Û³ýÏà¹ØÏûºÄ # @param curPlayer # @return bool def TransCostAfterPrepare(curPlayer): transType = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TransType) if transType == ChConfig.Def_Transport_Type_FixedPoint: moneyType = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TransMoneyType) money = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TransMoney) #¸¶Ç® infoDict = {ChConfig.Def_Cost_Reason_SonKey:transType} if not PlayerControl.PayMoney(curPlayer, moneyType, money, ChConfig.Def_Cost_Transport, infoDict): return False return True #--------------------------------------------------------------------- ##¶áÆì³É¹¦Âß¼­ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks ¶áÆì³É¹¦ def __DoLogic_CollectingOk(curPlayer, tick): curObj = curPlayer.GetActionObj() if not curObj or not curObj.GetID(): return #Ö»´¦ÀíNPC if curObj.GetGameObjType() != IPY_GameWorld.gotNPC: return curNPC = GameWorld.GetNPCByIndex(curObj.GetIndex()) if not curNPC: return result = FBLogic.OnCanCollect(curPlayer, curNPC, tick) if not result: return collectNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("CollectNPC", curNPC.GetNPCID()) if collectNPCIpyData: DoCollectingLostHP(curPlayer, collectNPCIpyData, tick, True) FBLogic.OnCollectOK(curPlayer, curNPC.GetNPCID(), tick) return #--------------------------------------------------------------------- ##Ë¢ÐÂÍæ¼ÒBuff # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÊÇ·ñÖØË¢Íæ¼ÒÊôÐÔ # @remarks Ë¢ÐÂÍæ¼ÒBuff def ProcessRefreshBuffState(curPlayer, tick): if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_Buff) < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_Buff]: #ûÓе½Ë¢Ð¼ä¸ô return False curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_Buff, tick) refresh = False result = BuffSkill.RefreshBuff(curPlayer, curPlayer.GetBuffState(), tick) refresh = refresh or result[0] result = BuffSkill.RefreshBuff(curPlayer, curPlayer.GetDeBuffState(), tick) refresh = refresh or result[0] result = BuffSkill.RefreshBuff(curPlayer, curPlayer.GetAura(), tick) refresh = refresh or result[0] result = BuffSkill.RefreshBuff(curPlayer, curPlayer.GetIncBuff(), tick) refresh = refresh or result[0] result = SkillCommon.CheckAuraSkill(curPlayer, tick) refresh = refresh or result PlayerControl.RefreshPKValueByRedBuff(curPlayer) # ÊôÐÔˢРreturn refresh #--------------------------------------------------------------------- ##Ë¢ÐÂÍæ¼ÒBuff # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÊÇ·ñÖØË¢Íæ¼ÒÊôÐÔ # @remarks Ë¢ÐÂÍæ¼ÒBuff def ProcessRefreshActionBuffState(curPlayer, tick): #·ÅÔÚÕâÀï¿ÉÒÔ¼°Ê±Ë¢ÐÂBUFF #ˢгÖÐøÐÔBUFF£¬³¡¾°BUFF¹ÜÀíÆ÷ºÍ×°±¸¹ÜÀíÆ÷¿ÉÄÜÒ²ÓгÖÐøBUFF BuffSkill.RefreshBuff(curPlayer, curPlayer.GetProcessBuffState(), tick) BuffSkill.RefreshBuff(curPlayer, curPlayer.GetProcessDeBuffState(), tick) # ¿ØÖÆÀàbuffÖ§³ÖÊôÐÔÅäÖà result = BuffSkill.RefreshBuff(curPlayer, curPlayer.GetActionBuffManager(), tick) # Íâ²ã¿ØÖÆË¢Ð¹æÔò return result #--------------------------------------------------------------------- ##Íæ¼ÒÚ¤Ïë # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return None def ProcessMuse(curPlayer, tick): playerMuse_Conf = ReadChConfig.GetEvalChConfig('PlayerMuse_Conf') # ²»ÔÚ¶ÔÓ¦µØÍ¼ÀÔò²»´¦Àí mapID = GameWorld.GetGameWorld().GetMapID() if mapID not in playerMuse_Conf.keys(): return curPlayerAreaType = GameMap.GetAreaTypeByMapPos(curPlayer.GetPosX(), curPlayer.GetPosY()) # µ±Ç°Íæ¼ÒËùÔÚÇøÓò # ²»ÔÚ°²È«Çø£¬²»´¦ÀíÚ¤Ïë if curPlayerAreaType != IPY_GameWorld.gatSafe: return # ʱ¼ä¼ä¸ôºÁÃë,¾­Ñ鹫ʽ intervalTick, expValueStr, lvLimit = playerMuse_Conf[mapID] # µÈ¼¶ÏÞÖÆ²»´¦Àí if curPlayer.GetLV() < lvLimit: return # Ê×´ÎtickÉèÖÃÖµ if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Muse) <= 0: curPlayer.SetDict(ChConfig.Def_PlayerKey_Muse, tick) return # ²»µ½É趨ʱ¼ä if tick - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Muse) < intervalTick: return curPlayer.SetDict(ChConfig.Def_PlayerKey_Muse, tick) #²Î¿¼¾­Ñé rExp = PlayerControl.GetPlayerReExp(curPlayer) addExpValue = int(eval(expValueStr)) playerControl = PlayerControl.PlayerControl(curPlayer) playerControl.AddExp(addExpValue, ShareDefine.Def_ViewExpType_GameEvent) return ##Íæ¼Ò×Ô¶¯ÕæÆø,»Ø¸´¾­Ñé # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return None def ProcessZhenQi(curPlayer, tick): #½ö´ò×ø×´Ì¬»Ø¸´ if curPlayer.GetPlayerAction() != IPY_GameWorld.paSit: return restoreTick, restoreValue, expValueStr = ReadChConfig.GetEvalChConfig('PlayerSit_Zhenqi') if tick - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SitForZhenQi) < restoreTick: return curPlayer.SetDict(ChConfig.Def_PlayerKey_SitForZhenQi, tick) vipLV = curPlayer.GetVIPLv() vipRate = ShareDefine.Def_MaxRateValue #È¡µÃÈËÎﵱǰ¾­Ñé curTotalExp = PlayerControl.GetPlayerTotalExp(curPlayer) # ³¬¹ý20ÒÚÖ§³Ö£¬¹¦ÄÜ´ý¶¨ if curTotalExp < ChConfig.Def_UpperLimit_DWord: #²Î¿¼¾­Ñé rExp = PlayerControl.GetPlayerReExp(curPlayer) addExpValue = int(eval(expValueStr)) vipExpValue = int(addExpValue * vipRate / float(ShareDefine.Def_MaxRateValue)) playerControl = PlayerControl.PlayerControl(curPlayer) playerControl.AddExp(addExp=addExpValue + vipExpValue, expViewType=ShareDefine.Def_ViewExpType_Sit, isSysHint=False) if vipLV == 0: canVipRate = ShareDefine.Def_MaxRateValue canVipExpValue = int(addExpValue * canVipRate / float(ShareDefine.Def_MaxRateValue)) #GeRen_chenxin_684833£º»ñµÃ¾­Ñé%sµã£¬³ÉΪVIP¾­Ñé%s PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_684833", [addExpValue, canVipExpValue]) else: #GeRen_chenxin_705350£º»ñµÃ¾­Ñé%s£¨VIP+¾­Ñé%s£© PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_705350", [addExpValue, vipExpValue]) return #--------------------------------------------------------------------- ##¸ßЧÁ·¹¦¼Ó¾­ÑéÕæÆø # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return None def ProcessEfficientSite(curPlayer, tick): return #--------------------------------------------------------------------- ##Íæ¼Ò×Ô¶¯»Ø¸´XPÖµ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return None # @remarks Íæ¼Ò×Ô¶¯»Ø¸´XPÖµ def ProcessAddXP(curPlayer, tick): return #=========================================================================== # #¿ª·ÅµÈ¼¶Ôö¼Ó¶àÉÙXPÖµ, ×î´óXPÖµ # openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP') # #»¹Ã»µ½¿ª·ÅµÈ¼¶ # if openLV > curPlayer.GetLV(): # return # lastTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_AddXPTick) # if not CommonCheckTick(curPlayer, tick, ChConfig.TYPE_Player_Tick_AddXPTick): # #Ê״εǽ£¬½«µ±Ç°µÄXPÖµ¼Ç¼µ½×ÖµäÖÐ # if lastTick <= 0: # curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curPlayer.GetXP()) # return # # #´Ó×ÖµäÖлñÈ¡µ±Ç°µÄXPÖµ # curXPValue = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_RecordXPValue) # #µ±Ç°XPÖµÒѾ­ÊÇ×î´óÖµÁË£¬²»×ö´¦Àí # if curXPValue == maxXPValue: # return # xpRestorePer = PlayerControl.GetXPRestorePer(curPlayer) # addXPValue = int(addXPValue * xpRestorePer/float(ChConfig.Def_MaxRateValue)) # nextXPValue = min(curXPValue + addXPValue, maxXPValue) # curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, nextXPValue) # #ÒѾ­´ïµ½×î´óµÄXPÖµÁË£¬Í¨Öª¿Í»§¶Ë # if nextXPValue == maxXPValue: # #ÕâÀï½øÐÐÉèÖõÄʱºò£¬½«»á֪ͨ¿Í»§¶Ë # curPlayer.SetXP(nextXPValue) #=========================================================================== #--------------------------------------------------------------------- ##Ë¢ÐÂ×é¶Ó״̬ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÊÇ·ñÖØË¢Íæ¼ÒÊôÐÔ # @remarks Ë¢ÐÂ×é¶Ó״̬ def ProcessTeamState(curPlayer, tick): #=============================================================================================== # if tick - curPlayer.GetTeamHPMPSyncTick() < ChConfig.Def_Team_GetOtherInfoInterval: # return # team = curPlayer.GetTeam() # if team == None: # return # curPlayer.SetTeamHPMPSyncTick(tick) # team.SyncMemberHPMP(curPlayer) #=============================================================================================== return #--------------------------------------------------------------------- ##Ë¢ÐÂÍæ¼ÒÔÚÏßʱ¼ä # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÎÞÒâÒå # @remarks Ë¢ÐÂÍæ¼ÒÔÚÏßʱ¼ä def ProcessPlayer_OnlineTime(curPlayer, tick): if not CommonCheckTick(curPlayer, tick, ChConfig.TYPE_Player_Tick_PlayerOnlineTime): return #´¦Àí·À³ÁÃÔÔÚÏßʱ¼ä£¬ PlayerGameWallow.DoLogic_WallowOnlineTime(curPlayer, tick) return #--------------------------------------------------------------------- ##½øÈëÍ˳öÕ½¶·×´Ì¬¼ì²é # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÒâÒå # @remarks ½øÈëÍ˳öÕ½¶·×´Ì¬¼ì²é def CheckBattleState(curPlayer, tick): if (curPlayer.GetLastTimeBattleState() != 0 and not curPlayer.IsBattleState()): #Íæ¼ÒÀ뿪ս¶·×´Ì¬ OnLeaveBattle(curPlayer, tick) return elif (curPlayer.GetLastTimeBattleState() == 0 and curPlayer.IsBattleState()): #Íæ¼Ò½øÈëÕ½¶·×´Ì¬ OnEnterBattle(curPlayer, tick) return return #--------------------------------------------------------------------- ##½øÈëÕ½¶·×´Ì¬ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÎÞÒâÒå # @remarks ½øÈëÕ½¶·×´Ì¬ def OnEnterBattle(curPlayer, tick): #XW_Fight_EnterFight Äú½øÈëµ½ÁËÕ½¶·×´Ì¬£¡ 25 - - #PlayerControl.NotifyCode(curPlayer, 'XW_Fight_EnterFight') curPlayer.SetLastTimeBattleState(1) return #--------------------------------------------------------------------- ##À뿪ս¶·×´Ì¬ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÎÞÒâÒå # @remarks À뿪ս¶·×´Ì¬ def OnLeaveBattle(curPlayer, tick): #tagLeaveBattle = ChPyNetSendPack.tagPlayerLeaveBattle() #NetPackCommon.SendFakePack(curPlayer, tagLeaveBattle) #Çå¿ÕÉËѪ¼Ç¼ curPlayer.GetPlayerHurtList().Clear() curPlayer.SetLastTimeBattleState(0) return #--------------------------------------------------------------------- ##Ë¢ÐÂÍæ¼Ò±»¹¥»÷״̬ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÎÞÒâÒå # @remarks Ë¢ÐÂÍæ¼Ò±»¹¥»÷״̬ def ProcessPlayerBattle(curPlayer, tick): #²»ÔÚÕ½¶·×´Ì¬²»Ë¢Ð if not curPlayer.IsBattleState(): return #δµ½¼ä¸ô if tick - curPlayer.GetLastBattleTick() < ChConfig.Def_PlayerLeaveBattleTick: return #ÍÑÀëÕ½¶·×´Ì¬ curPlayer.SetBattleState(False) return #--------------------------------------------------------------------- ##C++·â°ü´¥·¢, È«¾Ö¶¨Ê±Æ÷, ´¦ÀíÍæ¼Ò״̬ # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÎÞÒâÒå # @remarks C++·â°ü´¥·¢, È«¾Ö¶¨Ê±Æ÷, ´¦ÀíÍæ¼Ò״̬ def ProcessState(tick): GameWorld.GetPsycoFunc(__Func_ProcessState)(tick) return #--------------------------------------------------------------------- ##C++·â°ü´¥·¢, È«¾Ö¶¨Ê±Æ÷, ´¦ÀíÍæ¼Ò״̬ # @param tick ʱ¼ä´Á # @return ·µ»ØÖµ, ÎÞÒâÒå # @remarks C++·â°ü´¥·¢, È«¾Ö¶¨Ê±Æ÷, ´¦ÀíÍæ¼Ò״̬ def __Func_ProcessState(tick): #2009-07-01¶ÏÑÔtick >=0 ,·þÎñÆ÷tickΪDWord,³¬¹ý24ÌìÎ´ÖØÆôÓ²¼þ£¬½«µ¼ÖÂÂß¼­²»¿ÉÔ¤Öª if tick < 0 : GameWorld.Log('###·þÎñÆ÷ÔËÐÐʱ¼ä³¬¹ý24Ìì tick = %s' % (tick)) raise Exception('tick Error') #Íæ¼Ò״̬´¦Àí playerManager = GameWorld.GetPlayerManager() playerCount = playerManager.GetActivePlayerCount() for i in range(0, playerCount): curPlayer = playerManager.GetActivePlayerByIndex(i) if curPlayer.GetID() == 0: continue ProcessPlayerState(curPlayer, tick) return #--------------------------------------------------------------------- ##È«¾Ö¶¨Ê±Æ÷µ÷ÓÃ, Ë¢ÐÂÍæ¼Ò״̬ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks ×Ô¶¨Ò庯Êý, È«¾Ö¶¨Ê±Æ÷µ÷ÓÃ, Ë¢ÐÂÍæ¼Ò״̬ def ProcessPlayerState(curPlayer, tick): #Ò»¸öÍæ¼ÒµÄ״̬´¦Àí if not curPlayer.GetInitOK(): #Íæ¼Ò»¹Î´³õʼ»¯³É¹¦, ²»´¦Àí #GameWorld.Log("Íæ¼Ò»¹Î´³õʼ»¯³É¹¦, ²»´¦Àí") return #ÑÓ³Ù»ØÊÕ¾µÏñÍæ¼Ò if PlayerControl.OnDelayDeleteMirror(curPlayer, tick): return #¶¨Ê±±¸µµ PlayerBackup.CheckPlayerBackup(curPlayer) #±»GM·â״̬ÏìÓ¦ ProcessGMOperLogic(curPlayer, tick) #Ë¢ÐÂÍæ¼ÒÕ½¶·×´Ì¬ #ProcessPlayerBattle(curPlayer, tick) #Õ½¶·×´Ì¬ÅÐ¶Ï #CheckBattleState(curPlayer, tick) #Çл»Íæ¼Ò´ôÖÍ״̬ #ProcessPlayerNeedProcess(curPlayer , tick) #·ÅÔÚË¢buffǰ #ProcessPassiveSkill(curPlayer, tick) ProcessPlayerMinute(curPlayer, tick) PlayerOnline.GetOnlinePlayer(curPlayer).DoRefreshRoleAttr() #---µ½Õâ±ßÓ¦¸ÃÊôÐÔˢнáÊø£¬ÏÂÃæµÄÂß¼­ÓеÄÐèÒªÓõ½ÊôÐÔÖµ-------------------- #µ±Ç°Íæ¼ÒµÄ״̬ #curPlayerAction = curPlayer.GetPlayerAction() # curTime = time.clock() #Ë¢ÐÂÍæ¼ÒµÄ×¼±¸½ø¶ÈÌõ #if curPlayerAction == IPY_GameWorld.paPreparing : # ProcessPlayerPrepareState(curPlayer, tick) #PlayerYinji.ProcessPlayerYinji(curPlayer, tick) #Ë¢ÐÂ×é¶Ó״̬ #ProcessTeamState(curPlayer, tick) #Íæ¼ÒÔÚÏßʱ¼äˢР#ProcessPlayer_OnlineTime(curPlayer, tick) #·´Íâ¹ÒÑéÖ¤ #PlayerAutoCheckOnline.HackDefense(curPlayer, tick) #¸±±¾Ïà¹ØÊ±¼ä´¦Àí #PlayerFB.DoPlayerFBTimeProcess(curPlayer, tick) #¹Ò»úÊÕÒæ #PlayerGuaji.ProcessGuaji(curPlayer) #¶ñÒâ¹¥»÷ʱ¼ä´¦Àí #AttackCommon.ProcessMaliciousAttackPlayer(curPlayer, tick) #³É¾Í PlayerSuccess.FinishDelayAddSuccessProgress(curPlayer, tick, False) #ÏÞʱÇÀ¹º PlayerFlashSale.ProcessFlashSaleMail(curPlayer, tick) #µØÍ¼¾­Ñé #ProcessAreaExp(curPlayer, tick) #ÉñÃØÉ̵êˢРFunctionNPCCommon.CheckMysticalShopRefresh(curPlayer, tick) #»îÔ¾·ÅÖà #PlayerActivity.ProcessActivityPlace(curPlayer) #×Ô¶¨Ò峡¾° #FBLogic.OnCustomSceneProcess(curPlayer, tick) #Á¶Æ÷ #PlayerActLianqi.OnProcess(curPlayer) #ÏÉÃ˹¥³ÇÕ½ #PlayerActFamilyGCZ.OnProcess(curPlayer) #¿ç·þÊý¾Ýͬ²½£¬·Å×îºó #CrossPlayerData.ProcessCrossPlayer(curPlayer, tick) return def ProcessPlayerMinute(curPlayer, tick): #Íæ¼Òÿ·ÖÖÓ´¦Àí lastTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_Minute) if tick - lastTick < (ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_Minute]): return curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_Minute, tick) # ʱЧ³ÆºÅ PlayerDienstgrad.CheckDienstgradTimeout(curPlayer) # ʱЧͷÏñ PlayerFace.OnMinute(curPlayer) # ÁÄÌìÆøÅÝ PlayerChatBox.OnMinute(curPlayer) return # Ò»¶¨Ê±¼ä×Ô¶¯Êͷŵı»¶¯¼¼ÄÜ def ProcessPassiveSkill(curPlayer, tick): if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_ProcessPassiveSkill) < \ ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_ProcessPassiveSkill]: #ûÓе½Ë¢Ð¼ä¸ô return curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_ProcessPassiveSkill, tick) PassiveBuffEffMng.OnPassiveSkillTrigger(curPlayer, None, None, ChConfig.TriggerType_TimeCalc, tick) return #--------------------------------------------------------------------- ##Íæ¼Ò½øÈëºÍÍ˳ö´ôÖÍ״̬ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks Íæ¼Ò½øÈëºÍÍ˳ö´ôÖÍ״̬ def ProcessPlayerNeedProcess(curPlayer , tick): if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_NeedProcess) < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_NeedProcess]: #ûÓе½Ë¢Ð¼ä¸ô return curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_NeedProcess, tick) #---½øÈë´ôÖÍ״̬--- if curPlayer.GetIsNeedProcess(): curPlayerAction = curPlayer.GetPlayerAction() if curPlayerAction in ChConfig.Def_Player_PrimnessState: PlayerControl.SetIsNeedProcess(curPlayer, False) return return #---Í˳ö´ôÖÍ״̬--- if curPlayer.IsBattleState(): #Õ½¶·ÖÐ PlayerControl.SetIsNeedProcess(curPlayer, True) return # if curPlayer.GetIsConfronting(): # #Õ½¶·¶ÔÖÅÖÐ # PlayerControl.SetIsNeedProcess(curPlayer, True) # return #=============================================================================== # givenSkillTypeList = [ChConfig.Def_SkillType_LstPlsBuff, ChConfig.Def_SkillType_LstDepBuff] # ÌØ¶¨¼¼ÄÜÀàÐÍÁбí # # if SkillCommon.IsHasGivenBuff( curPlayer.GetBuffState(), givenSkillTypeList ) or \ # SkillCommon.IsHasGivenBuff( curPlayer.GetDeBuffState(), givenSkillTypeList ): # #³ÖÐøbuffÖÐ # PlayerControl.SetIsNeedProcess(curPlayer, True) # return #=============================================================================== return ##Çå¿ÕÍæ¼ÒÁ¬Ðø»÷ɱÊýÁ¿ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks Çå¿ÕÍæ¼ÒÁ¬Ðø»÷ɱÊýÁ¿ def ReFlashPlayerAttackKill(curPlayer, tick): if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_ClearKill) < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_ClearKill]: #ûÓе½Ë¢Ð¼ä¸ô return curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_ClearKill, tick) curPlayer.ClearPlayerKillListInTime() return #--------------------------------------------------------------------- ##¶¯Ì¬±ä¶¯Íæ¼ÒµÄÊÓÒ° # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks ¶¯Ì¬±ä¶¯Íæ¼ÒµÄÊÓÒ° def ChangePlayerSigh(curPlayer , tick): if FBLogic.OnPlayerSight(curPlayer, tick): #¸±±¾ÖÐÈç´¦Àí¹ý£¬ÔòÌø³ö return #09/05/06 ÊÓҰϵͳ¸ÄΪ¹Ì¶¨Öµ if curPlayer.GetSight() != ChConfig.Def_PlayerSight_Default: PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default) # curPlayer.SetSight(ChConfig.Def_PlayerSight_Default) #=============================================================================== # #ÊÓÒ°ÄڵĶÔÏ󳬳öÊýÁ¿ # if curPlayer.GetInSightObjCount() > ChConfig.Def_PlayerInSightObjCount_Default: # if curPlayer.GetSight() == ChConfig.Def_PlayerSight_Default: # curPlayer.SetSight(ChConfig.Def_PlayerSight_Optimize) # #ÊÓÒ°ÄڵĶÔÏó䳬¹ý # else: # if curPlayer.GetSight() == ChConfig.Def_PlayerSight_Optimize: # curPlayer.SetSight(ChConfig.Def_PlayerSight_Default) #=============================================================================== return #--------------------------------------------------------------------- ##´¦ÀíGMʼþ, Èç½ûÑÔ,·â´æµÈÐÅÏ¢ # @param curPlayer Íæ¼ÒʵÀý # @param tick ʱ¼ä´Á # @return ·µ»ØÖµÎÞÒâÒå # @remarks ´¦ÀíGMʼþ, Èç½ûÑÔ,·â´æµÈÐÅÏ¢ def ProcessGMOperLogic(curPlayer , tick): if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_GMOper) < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_GMOper]: #ûÓе½Ë¢Ð¼ä¸ô return curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_GMOper, tick) PlayerGMOper.DoGMOperLogic(curPlayer, tick) return def Sync_PKBossState(curPlayer): psState = 1 if curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) else 0 PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_PKState, psState) bossState = 1 if curPlayer.GetDictByKey(ChConfig.Def_PDict_BossStateTick) else 0 PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossState, bossState) return def IsInPKState(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) > 0 def SetPKStateTick(curPlayer, tick): if not curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick): PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_PKState, 1) curPlayer.SetDict(ChConfig.Def_PDict_PKStateTick, tick) #GameWorld.DebugLog("ÉèÖÃPK״̬tick!tick=%s" % tick, curPlayer.GetPlayerID()) return def IsInBossState(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PDict_BossStateTick) > 0 def SetBossStateTick(curPlayer, tick): if not curPlayer.GetDictByKey(ChConfig.Def_PDict_BossStateTick): PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossState, 1) curPlayer.SetDict(ChConfig.Def_PDict_BossStateTick, tick) #GameWorld.DebugLog("ÉèÖÃBoss״̬tick!tick=%s" % tick, curPlayer.GetPlayerID()) return def SetBossStateExit(curPlayer): ## ÉèÖÃÍ˳öboss״̬ if not IsInBossState(curPlayer): return curPlayer.SetDict(ChConfig.Def_PDict_BossStateTick, 0) PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossState, 0) return def ProcessAreaExp(curPlayer, tick): ##¸ø³¡¾°¾­Ñé if GameWorld.IsCrossServer(): return if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene): return crossMapID = PlayerControl.GetCrossMapID(curPlayer) mapID = crossMapID if crossMapID else GameWorld.GetMap().GetMapID() if not FBLogic.OnCanGetAreaExp(curPlayer, mapID): return neutralMapExpAwardDict = IpyGameDataPY.GetFuncEvalCfg('NeutralMapExpAward', 1, {}) expAwardInfo = GameWorld.GetDictValueByKey(neutralMapExpAwardDict, mapID) if not expAwardInfo: return if len(expAwardInfo) != 2: return secondCD, expFormula = expAwardInfo lastTick = curPlayer.GetDictByKey(ChConfig.Def_PDict_MapAreaExpTick) if not lastTick: curPlayer.SetDict(ChConfig.Def_PDict_MapAreaExpTick, tick) return if tick - lastTick < secondCD: return curPlayer.SetDict(ChConfig.Def_PDict_MapAreaExpTick, tick) reExp = PlayerControl.GetPlayerReExp(curPlayer) reLV = curPlayer.GetLV() worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv) addExp = eval(FormulaControl.GetCompileFormula('NeutralMapExpAward%s'%mapID, expFormula)) PlayerControl.PlayerControl(curPlayer).AddExp(addExp, ShareDefine.Def_ViewExpType_SysEx) return