| | |
| | | import PlayerFlashSale
|
| | | import PlayerWing
|
| | | import ChEquip
|
| | | import PlayerYinji
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @return None
|
| | | # @remarks 玩家自动回复XP值
|
| | | def ProcessAddXP(curPlayer, tick):
|
| | | #开放等级增加多少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)
|
| | | 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)
|
| | | #===========================================================================
|
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #回血回魔状态处理
|
| | | ProcessHPMPState(curPlayer, tick)
|
| | |
|
| | | PlayerYinji.ProcessPlayerYinji(curPlayer, tick)
|
| | | |
| | | #刷新组队状态
|
| | | #ProcessTeamState(curPlayer, tick)
|
| | |
|