| | |
| | | import GameWorld
|
| | | import SkillShell
|
| | | import ChConfig
|
| | | import PlayerHorse
|
| | | import SkillCommon
|
| | | import GameMap
|
| | | import FBLogic
|
| | |
| | | return (curPlayerAction in ChConfig.Def_Player_Can_Transfer_State)
|
| | |
|
| | | #------------------------------玩家离开服务器的逻辑------------------------------------
|
| | | #---------------------------------------------------------------------
|
| | | ##骑马下线逻辑
|
| | | # @param curPlayer 玩家实例
|
| | | # @return 返回值无意义
|
| | | # @remarks 骑马下线逻辑
|
| | | def __RidingHorsePlayerDisconnect(curPlayer):
|
| | | #在骑马
|
| | | if curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse:
|
| | | #执行下马逻辑
|
| | | PlayerHorse.PlayerRideHorseDown(curPlayer, False)
|
| | | |
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ##玩家下线/玩家切换地图公用逻辑
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|
| | |
| | |
|
| | | #玩家下线/玩家切换地图公用逻辑
|
| | | __PlayerLeaveServerLogic(curPlayer, tick, True)
|
| | | #骑马玩家下线逻辑
|
| | | __RidingHorsePlayerDisconnect(curPlayer)
|
| | | #召唤兽死亡
|
| | | KillPlayerSummonNPC(curPlayer)
|
| | | #更新从本地图离线信息
|
| | |
| | | if curPlayerAction == IPY_GameWorld.paPreparing:
|
| | | DoExitPreparing(curPlayer)
|
| | |
|
| | | #---玩家交通工具处理---
|
| | | curPlayerVehicle = curPlayer.GetPlayerVehicle()
|
| | | |
| | | #玩家骑马中, 下马
|
| | | if curPlayerVehicle == IPY_GameWorld.pvHorse:
|
| | | #执行下马逻辑
|
| | | PlayerHorse.PlayerRideHorseDown(curPlayer, False)
|
| | | |
| | | #---其他系统处理---
|
| | |
|
| | | #中断战斗对峙
|
| | |
| | | totalExpRate -= effExpRate
|
| | |
|
| | | return totalExpRate
|
| | |
|
| | | ##外观额外数据: 其他 * 100 + 坐骑外观
|
| | | def GetHorseSkinID(curPlayer): return GameWorld.GetValue(curPlayer.GetEquipShowSwitch(), 2, 2)
|
| | | def SetHorseSkinID(curPlayer, horseSkinID):
|
| | | showValue = curPlayer.GetEquipShowSwitch()
|
| | | updShowValue = GameWorld.SetValue(showValue, 2, 2, min(horseSkinID, 99))
|
| | | curPlayer.SetEquipShowSwitch(updShowValue)
|
| | | GameWorld.DebugLog("使用坐骑外观: horseSkinID=%s,showValue=%s,updShowValue=%s" % (horseSkinID, showValue, updShowValue))
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | | #---玩家扩展字段---
|
| | |
| | | def SetFightPower(curPlayer, value):
|
| | | beforeFightPower = GetFightPower(curPlayer)
|
| | | curPlayer.SetFightPower(value % ChConfig.Def_PerPointValue, value / ChConfig.Def_PerPointValue, False) # 不通知GameServer bNotifyGameServer False
|
| | | if value < beforeFightPower:
|
| | | DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | highestFightPower = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_Highest)
|
| | | highestFightPower += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_HighestEx) * ChConfig.Def_PerPointValue
|
| | | if value > highestFightPower:
|
| | | highestFightPower = value
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Highest, highestFightPower % ChConfig.Def_PerPointValue)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_HighestEx, highestFightPower / ChConfig.Def_PerPointValue)
|
| | | |
| | | GameWorld.DebugLog("总战力: %s, 历史最高战力: %s, beforeFightPower=%s" % (value, highestFightPower, beforeFightPower), curPlayer.GetPlayerID())
|
| | | #if value < beforeFightPower:
|
| | | # DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | GameWorld.DebugLog("总战力: %s, beforeFightPower=%s" % (value, beforeFightPower), curPlayer.GetPlayerID())
|
| | | #PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer)
|
| | | #if beforeFightPower != totalFightPower:
|
| | | # CrossPlayerData.OnPlayerFightPowerChange(curPlayer)
|
| | |
| | | ## 设置玩家字典值, 存库
|
| | | def NomalDictSetProperty(curPlayer, key, value, dType=0):
|
| | | if CrossPlayerData.IsNeedProcessCrossPlayer(curPlayer) and key not in \
|
| | | [ChConfig.Def_PDict_FightPower_Total, ChConfig.Def_PDict_FightPower_TotalEx, ChConfig.Def_PlayerKey_CrossRegisterMap]:
|
| | | [ChConfig.Def_PlayerKey_CrossRegisterMap]:
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | changeDict = PyGameData.g_crossPlayerDictChangeInfo.get(playerID, {})
|
| | | changeDict[(key, dType)] = value
|