8870 【BT2】【后端】战力、伤害、玩家生命的数值调整为大数值(超21亿)
| | |
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("LostHP", c_int),
|
| | | ("LostHPEx", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x0E
|
| | | self.LostHP = 0
|
| | | self.LostHPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | DumpString = '''// B4 0E 玩家掉血 //tagCMRoleLostHP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | LostHP:%d
|
| | | LostHP:%d,
|
| | | LostHPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.LostHP
|
| | | self.LostHP,
|
| | | self.LostHPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("ObjID", c_int),
|
| | | ("AttackType", c_ubyte), #爆击, miss
|
| | | ("HurtHP", c_int),
|
| | | ("HurtHPEx", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.ObjID = 0
|
| | | self.AttackType = 0
|
| | | self.HurtHP = 0
|
| | | self.HurtHPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | ObjType:%d,
|
| | | ObjID:%d,
|
| | | AttackType:%d,
|
| | | HurtHP:%d
|
| | | HurtHP:%d,
|
| | | HurtHPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.ObjType,
|
| | | self.ObjID,
|
| | | self.AttackType,
|
| | | self.HurtHP
|
| | | self.HurtHP,
|
| | | self.HurtHPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Name = "" #(String Name)//size=NameLen
|
| | | PlayerLV = 0 #(WORD PlayerLV)//玩家等级
|
| | | PlayeJob = 0 #(BYTE PlayeJob)//玩家职业
|
| | | PlayeFightPower = 0 #(DWORD PlayeFightPower)//玩家战斗力
|
| | | PlayeFightPower = 0 #(DWORD PlayeFightPower)//玩家战斗力,求余亿部分
|
| | | PlayeFightPowerEx = 0 #(DWORD PlayeFightPowerEx)//玩家战斗力,整除亿部分,1代表1亿
|
| | | RequestTime = 0 #(DWORD RequestTime)//申请时间
|
| | | IsOnLine = 0 #(BYTE IsOnLine)//是否在线
|
| | | data = None
|
| | |
| | | self.PlayerLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.PlayeJob,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.PlayeFightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlayeFightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.RequestTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.IsOnLine,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
| | | self.PlayerLV = 0
|
| | | self.PlayeJob = 0
|
| | | self.PlayeFightPower = 0
|
| | | self.PlayeFightPowerEx = 0
|
| | | self.RequestTime = 0
|
| | | self.IsOnLine = 0
|
| | | return
|
| | |
| | | length += len(self.Name)
|
| | | length += 2
|
| | | length += 1
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | |
| | | data = CommFunc.WriteWORD(data, self.PlayerLV)
|
| | | data = CommFunc.WriteBYTE(data, self.PlayeJob)
|
| | | data = CommFunc.WriteDWORD(data, self.PlayeFightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.PlayeFightPowerEx)
|
| | | data = CommFunc.WriteDWORD(data, self.RequestTime)
|
| | | data = CommFunc.WriteBYTE(data, self.IsOnLine)
|
| | | return data
|
| | |
| | | PlayerLV:%d,
|
| | | PlayeJob:%d,
|
| | | PlayeFightPower:%d,
|
| | | PlayeFightPowerEx:%d,
|
| | | RequestTime:%d,
|
| | | IsOnLine:%d
|
| | | '''\
|
| | |
| | | self.PlayerLV,
|
| | | self.PlayeJob,
|
| | | self.PlayeFightPower,
|
| | | self.PlayeFightPowerEx,
|
| | | self.RequestTime,
|
| | | self.IsOnLine
|
| | | )
|
| | |
| | | PlayerName = "" #(String PlayerName)// 跨服名字
|
| | | Job = 0 #(BYTE Job)
|
| | | LV = 0 #(WORD LV)
|
| | | MaxHP = 0 #(DWORD MaxHP)// 默认满血
|
| | | MaxHP = 0 #(DWORD MaxHP)// 默认满血,求余亿部分
|
| | | MaxHPEx = 0 #(DWORD MaxHPEx)// 默认满血,整除亿部分
|
| | | MaxProDef = 0 #(DWORD MaxProDef)// 最大护盾
|
| | | data = None
|
| | |
|
| | |
| | | self.Job,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.MaxHP,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.MaxHPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.MaxProDef,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | |
| | | self.Job = 0
|
| | | self.LV = 0
|
| | | self.MaxHP = 0
|
| | | self.MaxHPEx = 0
|
| | | self.MaxProDef = 0
|
| | | return
|
| | |
|
| | |
| | | length += len(self.PlayerName)
|
| | | length += 1
|
| | | length += 2
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.Job)
|
| | | data = CommFunc.WriteWORD(data, self.LV)
|
| | | data = CommFunc.WriteDWORD(data, self.MaxHP)
|
| | | data = CommFunc.WriteDWORD(data, self.MaxHPEx)
|
| | | data = CommFunc.WriteDWORD(data, self.MaxProDef)
|
| | | return data
|
| | |
|
| | |
| | | Job:%d,
|
| | | LV:%d,
|
| | | MaxHP:%d,
|
| | | MaxHPEx:%d,
|
| | | MaxProDef:%d
|
| | | '''\
|
| | | %(
|
| | |
| | | self.Job,
|
| | | self.LV,
|
| | | self.MaxHP,
|
| | | self.MaxHPEx,
|
| | | self.MaxProDef
|
| | | )
|
| | | return DumpString
|
| | |
| | | ExAttr18 = 0 #(DWORD ExAttr18)//预留的扩展属性字段,用来存放项目特定的属性
|
| | | ExAttr19 = 0 #(DWORD ExAttr19)//预留的扩展属性字段,用来存放项目特定的属性
|
| | | ExAttr20 = 0 #(DWORD ExAttr20)//预留的扩展属性字段,用来存放项目特定的属性
|
| | | HPEx = 0 #(DWORD HPEx)//当前血量 超过E的记录
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.ExAttr18,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ExAttr19,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ExAttr20,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.HPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.ExAttr18 = 0
|
| | | self.ExAttr19 = 0
|
| | | self.ExAttr20 = 0
|
| | | self.HPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 4
|
| | | length += 4
|
| | | length += 15
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | |
| | | data = CommFunc.WriteDWORD(data, self.ExAttr18)
|
| | | data = CommFunc.WriteDWORD(data, self.ExAttr19)
|
| | | data = CommFunc.WriteDWORD(data, self.ExAttr20)
|
| | | data = CommFunc.WriteDWORD(data, self.HPEx)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | ExAttr17:%d,
|
| | | ExAttr18:%d,
|
| | | ExAttr19:%d,
|
| | | ExAttr20:%d
|
| | | ExAttr20:%d,
|
| | | HPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | |
| | | self.ExAttr17,
|
| | | self.ExAttr18,
|
| | | self.ExAttr19,
|
| | | self.ExAttr20
|
| | | self.ExAttr20,
|
| | | self.HPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | class tagMCModuleFightPowerInfo(Structure):
|
| | | Head = tagHead()
|
| | | TotalFightPower = 0 #(DWORD TotalFightPower)//总战斗力
|
| | | TotalFightPower = 0 #(DWORD TotalFightPower)//总战斗力,求余亿部分
|
| | | TotalFightPoweEx = 0 #(DWORD TotalFightPoweEx)//总战斗力,整除亿部分,1代表1亿
|
| | | MFPCnt = 0 #(BYTE MFPCnt)//模块战斗力总数
|
| | | MFPList = list() #(vector<tagMCModuleFightPower> MFPList)
|
| | | data = None
|
| | |
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.TotalFightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.TotalFightPoweEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.MFPCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.MFPCnt):
|
| | | temMFPList = tagMCModuleFightPower()
|
| | |
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xA1
|
| | | self.TotalFightPower = 0
|
| | | self.TotalFightPoweEx = 0
|
| | | self.MFPCnt = 0
|
| | | self.MFPList = list()
|
| | | return
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.MFPCnt):
|
| | |
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.TotalFightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.TotalFightPoweEx)
|
| | | data = CommFunc.WriteBYTE(data, self.MFPCnt)
|
| | | for i in range(self.MFPCnt):
|
| | | data = CommFunc.WriteString(data, self.MFPList[i].GetLength(), self.MFPList[i].GetBuffer())
|
| | |
| | | DumpString = '''
|
| | | Head:%s,
|
| | | TotalFightPower:%d,
|
| | | TotalFightPoweEx:%d,
|
| | | MFPCnt:%d,
|
| | | MFPList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.TotalFightPower,
|
| | | self.TotalFightPoweEx,
|
| | | self.MFPCnt,
|
| | | "..."
|
| | | )
|
| | |
| | | _fields_ = [
|
| | | ("RefreshType", c_ubyte),
|
| | | ("Value", c_int),
|
| | | ("ValueEx", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | def Clear(self):
|
| | | self.RefreshType = 0
|
| | | self.Value = 0
|
| | | self.ValueEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''//A7 09 周围对象刷新合并包 //tagObjInfoListRefresh:
|
| | | RefreshType:%d,
|
| | | Value:%d
|
| | | Value:%d,
|
| | | ValueEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.RefreshType,
|
| | | self.Value
|
| | | self.Value,
|
| | | self.ValueEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("ObjID", c_int),
|
| | | ("AttackType", c_ubyte), #爆击, miss
|
| | | ("HurtHP", c_int),
|
| | | ("HurtHPEx", c_int), |
| | | ("CurHP", c_int),
|
| | | ("CurHPEx", c_int),
|
| | | ]
|
| | |
| | | self.ObjID = 0
|
| | | self.AttackType = 0
|
| | | self.HurtHP = 0
|
| | | self.HurtHPEx = 0
|
| | | self.CurHP = 0
|
| | | self.CurHPEx = 0
|
| | | return
|
| | |
| | | ObjID:%d,
|
| | | AttackType:%d,
|
| | | HurtHP:%d,
|
| | | HurtHPEx:%d,
|
| | | CurHP:%d,
|
| | | CurHPEx:%d
|
| | | '''\
|
| | |
| | | self.ObjID,
|
| | | self.AttackType,
|
| | | self.HurtHP,
|
| | | self.HurtHPEx,
|
| | | self.CurHP,
|
| | | self.CurHPEx
|
| | | )
|
| | |
| | | import GameWorld
|
| | | import datetime
|
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import ChConfig
|
| | | #===============================================================================
|
| | | ##发送事件记录给EventShell
|
| | |
| | | if curPlayer:
|
| | | pid = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_PlayerFromPID)
|
| | | dataDict["pid"] = pid
|
| | | dataDict["fightPower"] = curPlayer.GetFightPower()
|
| | | dataDict["fightPower"] = PlayerControl.GetFightPower(curPlayer)
|
| | | dataDict["PlayerLV"] = curPlayer.GetLV()
|
| | | dataDict["IP"] = curPlayer.GetIP()
|
| | |
|
| | |
| | | playerLV = playerInfoDict["playerLV"] # ְҵ
|
| | | maxHP = playerInfoDict["maxHP"] # ְҵ
|
| | | maxProDef = playerInfoDict["maxProDef"] # 护盾
|
| | | fightPower = playerInfoDict["fightPower"] # 战斗力
|
| | | fightPower = min(playerInfoDict["fightPower"], ChConfig.Def_UpperLimit_DWord) # 战斗力,暂无用,限制不超过20E
|
| | | realmLV = playerInfoDict["realmLV"] # 境界
|
| | | pkScore = playerInfoDict["pkScore"] # 当前积分
|
| | | danLV = playerInfoDict["danLV"] # 当前段位
|
| | |
| | | matchPlayer.NameLen = len(matchPlayer.PlayerName)
|
| | | matchPlayer.Job = readyPlayerInfo["Job"]
|
| | | matchPlayer.LV = readyPlayerInfo["LV"]
|
| | | matchPlayer.MaxHP = readyPlayerInfo["MaxHP"]
|
| | | matchPlayer.MaxHP = readyPlayerInfo["MaxHP"] % ShareDefine.Def_PerPointValue
|
| | | matchPlayer.MaxHPEx = readyPlayerInfo["MaxHP"] / ShareDefine.Def_PerPointValue
|
| | | matchPlayer.MaxProDef = readyPlayerInfo["MaxProDef"]
|
| | | break
|
| | |
|
| | |
| | |
|
| | | playerStatePack = IPY_GameServer.IPY_GRefreshPlayerProperty()
|
| | | packValue = playerStatePack.GetValue()
|
| | | packValueEx = playerStatePack.GetValueEx()
|
| | | packType = playerStatePack.GetType()
|
| | |
|
| | | #---特殊逻辑处理---
|
| | |
| | | return
|
| | |
|
| | | if packType == IPY_GameServer.CDBPlayerRefresh_FightPower:
|
| | | curPlayer.SetFightPower(packValue)
|
| | | curPlayer.SetFightPower(packValue, packValueEx)
|
| | | return
|
| | |
|
| | | if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr2:
|
| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import PlayerDBGSEvent
|
| | | import NetPackCommon
|
| | | import DataRecordPack
|
| | | import PlayerFamily
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def __CheckFightPowerBillboard():
|
| | | ## 由于战力修改为支持超过20E,所以需要处理下战力相关榜单,原 cmpValue 值移动到 cmpValue2
|
| | | |
| | | eventKey = "FightPowerBillboardMoveValue"
|
| | | if PlayerDBGSEvent.GetDBGSTrig_ByKey(eventKey):
|
| | | return
|
| | | PlayerDBGSEvent.SetDBGSTrig_ByKey(eventKey, 1)
|
| | | GameWorld.Log("处理战力榜超过20E支持!")
|
| | | |
| | | billboardList = [ShareDefine.Def_BT_FightPower] + ShareDefine.JobFightPowerBillboardDict.values()
|
| | | for billboardType in billboardList:
|
| | | billboard = GameWorld.GetBillboard().FindBillboard(billboardType)
|
| | | if not billboard:
|
| | | continue
|
| | | GameWorld.Log(" billboardType=%s,count=%s" % (billboardType, billboard.GetCount()))
|
| | | for index in xrange(billboard.GetCount()):
|
| | | billBoardData = billboard.At(index)
|
| | | if not billBoardData:
|
| | | continue
|
| | | billBoardData.SetCmpValue2(billBoardData.GetCmpValue())
|
| | | billBoardData.SetCmpValue(0)
|
| | | |
| | | return
|
| | |
|
| | | def SortServerBillboard():
|
| | | ##排序所有排行榜
|
| | | billboardMgr = GameWorld.GetBillboard()
|
| | |
| | | #排序一次排行榜
|
| | | billBoard.Sort()
|
| | |
|
| | | __CheckFightPowerBillboard()
|
| | | return
|
| | |
|
| | | def CopyBillboard(newBillboardIndex, oldBillboardIndex):
|
| | |
| | | # 以下为榜单附加特殊处理
|
| | | if bType == ShareDefine.Def_BT_FightPower:
|
| | | playerID = bID
|
| | | fightPowerTotal = cmpValue
|
| | | fightPowerTotal = cmpValue * ChConfig.Def_PerPointValue + cmpValue2
|
| | | familyID = exInfo[0]
|
| | | playerJob = bType2
|
| | |
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if curPlayer:
|
| | | curPlayer.SetFightPower(fightPowerTotal)
|
| | | PlayerControl.SetFightPower(curPlayer, fightPowerTotal)
|
| | |
|
| | | #更新战盟成员战力
|
| | | PlayerFamily.UpdFamilyMemberFightPower(familyID, playerID, fightPowerTotal)
|
| | |
| | | job = playerJob % 10
|
| | | if job in ShareDefine.JobFightPowerBillboardDict:
|
| | | jobBType = ShareDefine.JobFightPowerBillboardDict[job]
|
| | | UpdatePlayerBillboard(bID, bName, bName2, jobBType, bType2, value1, value2, cmpValue, autoSort)
|
| | | UpdatePlayerBillboard(bID, bName, bName2, jobBType, bType2, value1, value2, cmpValue, autoSort, cmpValue2)
|
| | | gameWorld.SetDict(Def_Key_BillboardNeedSort % jobBType, 1)
|
| | | #__UpdateBillboardSortState(gameWorld, jobBType, autoSort, isUpd)
|
| | |
|
| | |
| | | def GetPrestige(curPlayer):
|
| | | return 0
|
| | |
|
| | | ##总战斗力
|
| | | def GetFightPower(curPlayer): return curPlayer.GetFightPowerEx() * ChConfig.Def_PerPointValue + curPlayer.GetFightPower()
|
| | | def SetFightPower(curPlayer, value):
|
| | | curPlayer.SetFightPower(value % ChConfig.Def_PerPointValue, value / ChConfig.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | #------------------------------------------------------------------------------
|
| | | ## 协助目标玩家ID
|
| | |
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | def __DoPlayerFBHelpBattleCheckIn(curPlayer, msgList):
|
| | | ## 玩家登记
|
| | | checkInCount, fightPower = msgList[1:]
|
| | | fightPower = min(fightPower, ChConfig.Def_UpperLimit_DWord) # 登记助战战力最高暂支持20E
|
| | | curTime = int(time.time())
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | curCache = PlayerViewCache.FindViewCache(playerID)
|
| | |
| | | def GetFamilyMixServerDay(curFamily): return curFamily.GetExtra1()
|
| | | def SetFamilyMixServerDay(curFamily, value): return curFamily.SetExtra1(value)
|
| | | ## ------------------ 成员 ----------------------
|
| | | def GetMemberFightPower(curMember): return curMember.GetExattr3()
|
| | | def SetMemberFightPower(curMember, fightPower): return curMember.SetExattr3(fightPower)
|
| | | def GetMemberFightPower(curMember): return curMember.GetExattr3() + curMember.GetExattr5() * ChConfig.Def_PerPointValue
|
| | | def SetMemberFightPower(curMember, fightPower):
|
| | | curMember.SetExattr5(fightPower / ChConfig.Def_PerPointValue)
|
| | | curMember.SetExattr3(fightPower % ChConfig.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetMemberJoinTime(curMember): return curMember.GetExattr4()
|
| | | def SetMemberJoinTime(curMember, joinTime): return curMember.SetExattr4(joinTime)
|
| | |
| | | PyDataManager.GetFamilyStoreItemManager().SyncFamilyStoreItem(jionPlayer, curFamily.GetID())
|
| | | #仙盟拍品
|
| | | AuctionHouse.Sync_FamilyAuctionItemInfo(jionPlayer, curFamily.GetID())
|
| | | SetMemberFightPower(familyMember, jionPlayer.GetFightPower())
|
| | | SetMemberFightPower(familyMember, PlayerControl.GetFightPower(jionPlayer))
|
| | | AddFamilyIDToFightPowerChangeList(curFamily.GetID())
|
| | |
|
| | | #通知仙盟盛宴题目
|
| | |
| | | requestPlayerName = curPlayer.GetName()
|
| | | playerLV = curPlayer.GetLV()
|
| | | #玩家Id, 等级,职业,战斗力
|
| | | actionDataList = [curPlayer.GetID(), playerLV, curPlayer.GetJob(), curPlayer.GetFightPower()]
|
| | | fightPower = PlayerControl.GetFightPower(curPlayer)
|
| | | actionDataList = [curPlayer.GetID(), playerLV, curPlayer.GetJob(), fightPower % ChConfig.Def_PerPointValue, fightPower / ChConfig.Def_PerPointValue]
|
| | | allFamilyActionManager = GameWorld.GetFamilyActionManager()
|
| | | familyManager = GameWorld.GetFamilyManager()
|
| | | indexList = range(familyManager.GetCount())
|
| | |
| | | def __RequestAddFamilyNote(curPlayer, actionType, actionDataList, tick):
|
| | |
|
| | | requestAddFamilyID = actionDataList[0] # 申请进入的家族
|
| | | fightPower = actionDataList[1] if len(actionDataList) > 1 else curPlayer.GetFightPower()
|
| | | fightPower = actionDataList[1] if len(actionDataList) > 1 else PlayerControl.GetFightPower(curPlayer)
|
| | | requestPlayerName = curPlayer.GetName() # 申请的玩家名字
|
| | |
|
| | | familyManager = GameWorld.GetFamilyManager()
|
| | |
| | | return
|
| | |
|
| | | #玩家Id, 等级,职业,战斗力
|
| | | actionDataList = [curPlayer.GetID(), curPlayer.GetLV(), curPlayer.GetJob(), fightPower]
|
| | | actionDataList = [curPlayer.GetID(), curPlayer.GetLV(), curPlayer.GetJob(), fightPower % ChConfig.Def_PerPointValue, fightPower / ChConfig.Def_PerPointValue]
|
| | |
|
| | | result = AddFamilyActionNote(requestPlayerName, requestAddFamilyID, actionType, actionDataList, tick, False)
|
| | | if not result:
|
| | |
| | | playerLV = familyActionData.GetValue2() # 等级
|
| | | playerJob = familyActionData.GetValue3() # ְҵ
|
| | | fightPower = familyActionData.GetValue4() # 战斗力
|
| | | |
| | | fightPower += familyActionData.GetValue5() * ChConfig.Def_PerPointValue
|
| | | tagPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if not tagPlayer:
|
| | | isOnLine = 0
|
| | | else:
|
| | | isOnLine = 1
|
| | | playerLV = tagPlayer.GetLV()
|
| | | if tagPlayer.GetFightPower() > fightPower:
|
| | | fightPower = tagPlayer.GetFightPower()
|
| | | if PlayerControl.GetFightPower(tagPlayer) > fightPower:
|
| | | fightPower = PlayerControl.GetFightPower(tagPlayer)
|
| | |
|
| | | memberInfo = ChPyNetSendPack.tagtMemberInfo()
|
| | | memberInfo.PlayerID = playerID
|
| | |
| | | memberInfo.Name = requestPlayerName
|
| | | memberInfo.PlayerLV = playerLV
|
| | | memberInfo.PlayeJob = playerJob
|
| | | memberInfo.PlayeFightPower = fightPower
|
| | | memberInfo.PlayeFightPower = fightPower % ChConfig.Def_PerPointValue
|
| | | memberInfo.PlayeFightPowerEx = fightPower / ChConfig.Def_PerPointValue
|
| | | memberInfo.RequestTime = requestTime
|
| | | memberInfo.IsOnLine = isOnLine
|
| | | packList.append(memberInfo)
|
| | |
| | | if isByLVPower:
|
| | | worldLv = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('PlayerLV', worldLv)
|
| | | myPower = ipyData.GetReFightPower() if ipyData else curPlayer.GetFightPower() |
| | | myPower = ipyData.GetReFightPower() if ipyData else PlayerControl.GetFightPower(curPlayer) |
| | | else:
|
| | | myPower = curPlayer.GetFightPower()
|
| | | myPower = PlayerControl.GetFightPower(curPlayer)
|
| | | XMZZPKPowerRange = IpyGameDataPY.GetFuncEvalCfg('XMZZPKPowerRange')
|
| | | minPower1, maxPower1 = myPower * (100 - XMZZPKPowerRange[0][0]) / 100, myPower * (100 + XMZZPKPowerRange[0][1]) / 100
|
| | | minPower2, maxPower2 = myPower * (100 - XMZZPKPowerRange[1][0]) / 100, myPower * (100 + XMZZPKPowerRange[1][1]) / 100
|
| | |
| | |
|
| | | #通知地图
|
| | | if not pkPlayerPropData:
|
| | | GameWorld.ErrLog("仙魔之争没有匹配到对手信息!fightPower=%s" % curPlayer.GetFightPower(), myPlayerID)
|
| | | GameWorld.ErrLog("仙魔之争没有匹配到对手信息!fightPower=%s" % PlayerControl.GetFightPower(curPlayer), myPlayerID)
|
| | | vsPlayerInfo = [pkPlayerID, pkPlayerPropData]
|
| | | XMZZManager.MapServer_XMZZPKInfo(curPlayer, overInfo, vsPlayerInfo)
|
| | | return True
|
| | |
| | | # @param hurtList 是g_skillHurtList
|
| | | def AddHurt(tagObj, hurtList, hurtType, hurtValue):
|
| | | tagObjType = tagObj.GetGameObjType()
|
| | | |
| | | #if tagObjType == IPY_GameWorld.gotPlayer:
|
| | | if not hasattr(tagObj, "GetHPEx"):
|
| | | # 目标是玩家则超过xx亿部分为0,玩家暂无开放接口
|
| | | hurtList.AddHurt(tagObjType, tagObj.GetID(), hurtType, hurtValue, tagObj.GetHP(), 0)
|
| | | else:
|
| | | hurtList.AddHurt(tagObjType, tagObj.GetID(), hurtType, hurtValue, tagObj.GetHP(), tagObj.GetHPEx())
|
| | | hurtList.AddHurt(tagObjType, tagObj.GetID(), hurtType, hurtValue % ShareDefine.Def_PerPointValue, |
| | | hurtValue / ShareDefine.Def_PerPointValue, tagObj.GetHP(), tagObj.GetHPEx())
|
| | | return
|
| | |
|
| | | # 伤血列表累积记录,超DWORD特殊缩减处理
|
| | | def AddHurtValue(defender, attackID, attackHurtType, value):
|
| | | defendHurtList = defender.GetPlayerHurtList()
|
| | | if not hasattr(defender, "GetMaxHPEx"):
|
| | | defendHurtList.AddHurtValue(attackID, attackHurtType, value)
|
| | | defendHurtList.AddHurtValue(attackID, attackHurtType, value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | | |
| | | #总血量有超过DWORD的情况
|
| | | value = NPCCommon.FixValueByValueEx(defender.GetMaxHPEx(), value)
|
| | | defendHurtList.AddHurtValue(attackID, attackHurtType, value)
|
| | |
|
| | | def AddTeamPlayerHurtValue(defender, teamID, playerID, value):
|
| | | # 添加队伍成员对NPC伤血累计
|
| | |
| | | return
|
| | |
|
| | | #已经死亡了,不变色
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | |
|
| | | curPlayerNameColor = curPlayer.GetPlayerNameColor()
|
| | |
| | | # @remarks 玩家角色及宠物、召唤兽之间产生的伤害都算PVP伤害;
|
| | | # 另反伤及持续掉血buff也算, 但反伤及buff仅计算玩家之间
|
| | | def OnPVPDamage(curPlayer, damageValue, tagPlayer, damageMsg):
|
| | | #GameWorld.DebugLog("%s curPlayerID(%sLVEX:%s)=%s,tagPlayerID(%sLVEX:%s)=%s,damageValue=%s" |
| | | # % (damageMsg, curPlayer.GetAccID(), curPlayer.GetLVEx(), curPlayer.GetPlayerID(), |
| | | # tagPlayer.GetAccID(), tagPlayer.GetLVEx(), tagPlayer.GetPlayerID(), damageValue))
|
| | | FBLogic.OnPVPDamage(curPlayer, damageValue, tagPlayer)
|
| | | return
|
| | |
|
| | |
| | | #GameWorld.DebugLog("按比例更新战力值信息: fightPowerMin=%s,fightPowerMax=%s,everyFightPower=%s"
|
| | | # % (fightPowerMin, fightPowerMax, everyFightPower))
|
| | |
|
| | | effFightPower = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPFightPower)
|
| | | effFightPower = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPFightPower) \
|
| | | + curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPFightPowerEx) * ChConfig.Def_PerPointValue
|
| | | effPlayerCount = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPPlayerCount)
|
| | | refreshPlayerCountTick = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPPlayerCountTick)
|
| | | if not refreshPlayerCountTick or tick - refreshPlayerCountTick >= 3000:
|
| | |
| | | effPlayerCount += 1
|
| | | if fightPowerMin:
|
| | | seePlayer = GameWorld.GetObj(seeObj.GetID(), seeObjType)
|
| | | fightPowerTotal += (0 if not seePlayer else seePlayer.GetFightPower())
|
| | | fightPowerTotal += (0 if not seePlayer else PlayerControl.GetFightPower(seePlayer))
|
| | |
|
| | | effPlayerCount = max(effPlayerCount, 1)
|
| | |
|
| | |
| | | if maxPlayerCount and effPlayerCount > maxPlayerCount:
|
| | | effPlayerCount = maxPlayerCount
|
| | |
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_TimeLostHPFightPower, effFightPower)
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_TimeLostHPFightPower, effFightPower % ChConfig.Def_PerPointValue)
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_TimeLostHPFightPowerEx, effFightPower / ChConfig.Def_PerPointValue)
|
| | | curNPC.SetDict(ChConfig.Def_NPC_Dict_TimeLostHPPlayerCount, effPlayerCount)
|
| | | #GameWorld.DebugLog("刷新影响人数: effPlayerCount=%s,effFightPower=%s" % (effPlayerCount, effFightPower))
|
| | |
|
| | |
| | | reducePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer)
|
| | |
|
| | | # 被攻击被动技能特殊减免 受到单次伤害超过生命上限10%时候,减免50%伤害,CD10秒
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_curHurtValue, hurtValue)
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_curHurtValue, hurtValue % ShareDefine.Def_PerPointValue)
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_curHurtValueEx, hurtValue / ShareDefine.Def_PerPointValue)
|
| | | reducePer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer)
|
| | | hurtValue = int(hurtValue*(max(ChConfig.Def_MaxRateValue - reducePer, 0))*1.0/ChConfig.Def_MaxRateValue)
|
| | |
|
| | |
| | | # 血盾支持多个同时存在, 反弹也会被吸收
|
| | | def CalcBloodShield(atkObj, defObj, hurtValue):
|
| | | # 伤害值用于血盾抵消
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, hurtValue)
|
| | | GameObj.SetBloodShiledHurt(defObj, hurtValue)
|
| | |
|
| | | PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_BloodShield)
|
| | |
|
| | | return defObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | return GameObj.GetBloodShiledHurt(defObj)
|
| | |
|
| | |
|
| | | # 计算攻击伤害
|
| | |
| | | suppressReMaxHP = 0 if not suppressLVIpyData else suppressLVIpyData.GetReMaxHP()
|
| | | suppressNPCFightPower = NPCCommon.GetSuppressFightPower(atkObj)
|
| | | if suppressNPCFightPower:
|
| | | suppressFightPower = max(0, suppressNPCFightPower - defObj.GetFightPower())
|
| | | suppressFightPower = max(0, suppressNPCFightPower - PlayerControl.GetFightPower(defObj))
|
| | |
|
| | | mustHit = False
|
| | | helpBattleFormatKey = ""
|
| | |
| | | aFinalHurt += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddFinalValue)
|
| | |
|
| | | aOnlyFinalHurt = PlayerControl.GetOnlyFinalHurt(atkObj) # 额外固定伤害
|
| | | aFightPower = atkObj.GetFightPower()
|
| | | aFightPower = PlayerControl.GetFightPower(atkObj)
|
| | |
|
| | |
|
| | |
|
| | |
| | | dDamagePerPVPReduce += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_DamageReducePVP)
|
| | | dFinalHurtReduce = PlayerControl.GetFinalHurtReduce(defObj) # 最终固定伤害减少
|
| | | dBeHurtPer = PlayerControl.GetBeHurtPer(defObj) # 加深受到伤害百分比
|
| | | dFightPower = defObj.GetFightPower()
|
| | | dFightPower = PlayerControl.GetFightPower(defObj)
|
| | | dFinalHurtReducePer = PlayerControl.GetFinalHurtReducePer(defObj)
|
| | | dFinalHurtReducePer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, curSkill, ChConfig.TriggerType_dFinalHurtReducePer)
|
| | |
|
| | |
| | | hurtValue = int(eval(FormulaControl.GetCompileFormula(hurtFormulaKey, hurtFormula)))
|
| | | if isDeadlyHit:
|
| | | hurtValue *= deadlyHitMultiValue
|
| | | hurtValue = min(max(hurtValue, 0), ChConfig.Def_UpperLimit_DWord)
|
| | | #hurtValue = min(max(hurtValue, 0), ChConfig.Def_UpperLimit_DWord)
|
| | |
|
| | | if hurtType == ChConfig.Def_HurtType_Normal and atkSkillPerYinji > 0:
|
| | | return hurtValue, ChConfig.Def_HurtType_Yinji
|
| | |
| | |
|
| | | if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | # 记录最后一次伤害值
|
| | | atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValue, resultHurtType.RealHurtHP)
|
| | | GameObj.SetLastHurtValue(atkObj, resultHurtType.RealHurtHP)
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | | atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtNPCObjID, defObj.GetID())
|
| | | else:
|
| | |
| | | else:
|
| | | GameObj.SetHP(atkObj, remainHP)
|
| | | #广播血量
|
| | | #atkObj.Notify_HPEx()
|
| | | #atkObj.Notify_HP()
|
| | |
|
| | | elif atkObjType == IPY_GameWorld.gotPlayer:
|
| | | GameObj.SetHP(atkObj, remainHP, False)
|
| | |
| | | attackPrestige = PlayerControl.GetPrestige(curPlayer) # 攻击者威望
|
| | | attackNotoriety = curPlayer.GetInfamyValue() # 攻击者恶名值
|
| | | attackPkValue = curPlayer.GetPKValue() # 攻击者pk值
|
| | | attackFightPower = curPlayer.GetFightPower() # 攻击者战斗力
|
| | | attackFightPower = PlayerControl.GetFightPower(curPlayer) # 攻击者战斗力
|
| | |
|
| | | defendLV = defender.GetLV() # 防守者等级
|
| | | defendPrestige = PlayerControl.GetPrestige(defender) # 防守者威望
|
| | | defendNotoriety = defender.GetInfamyValue() # 防守者恶名值
|
| | | defendPkValue = defender.GetPKValue() # 防守者pk值
|
| | | defendFightPower = defender.GetFightPower() # 防守者战斗力
|
| | | defendFightPower = PlayerControl.GetFightPower(defender) # 防守者战斗力
|
| | |
|
| | | # #今日杀人获得威望值
|
| | | # prestigeByDay = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_KillPlayerAddPrestige)
|
| | |
| | | srcID, srcType = 0, 0
|
| | | if srcObj:
|
| | | srcID, srcType = srcObj.GetID(), srcObj.GetGameObjType()
|
| | | HPEx = 0 if not hasattr(curObj, "GetHPEx") else curObj.GetHPEx()
|
| | | curObj.ChangeHPView(skillID, min(changeHP, ChConfig.Def_UpperLimit_DWord), changType, srcID, srcType, curObj.GetHP(), HPEx)
|
| | | curObj.ChangeHPView(skillID, changeHP % ShareDefine.Def_PerPointValue, changeHP / ShareDefine.Def_PerPointValue, |
| | | changType, srcID, srcType, curObj.GetHP(), curObj.GetHPEx())
|
| | | return |
| | |
| | | def AttackResult(curNormalNPC, curTagPet, skill, tick):
|
| | | curTagPlayer = PetControl.GetPetOwner(curTagPet) # 宠物主人
|
| | |
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0:
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | | #宠物死亡
|
| | | if curTagPet.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTagPet) <= 0:
|
| | | curTagPetNPCControl = NPCCommon.NPCControl(curTagPet)
|
| | | curTagPetNPCControl.SetKilled()
|
| | |
|
| | |
| | | def AttackResult(curNormalNPC, curTagPlayer, skill, tick):
|
| | |
|
| | | #玩家活着
|
| | | if curTagPlayer.GetHP() > 0:
|
| | | if GameObj.GetHP(curTagPlayer) > 0:
|
| | | #被攻击玩家进入战斗状态
|
| | | AttackCommon.OnNPCHitPlayer(curNormalNPC, curTagPlayer, tick)
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
| | | def AttackResult(curNormalNPC, curTagSummonNPC, skill, tick):
|
| | | #获取召唤兽的主人
|
| | | curTagPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curTagSummonNPC)
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0 :
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0 :
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | | def AttackResult(curNormalNPC, curTagTruck, skill, tick):
|
| | | #获取镖车主人
|
| | | curTagPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curTagTruck)
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0 :
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0 :
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | | import GameWorld
|
| | | import PetControl
|
| | | import SkillShell
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | curTagPlayer = PetControl.GetPetOwner(curTagPet) # 宠物主人
|
| | | curPlayer = PetControl.GetPetOwner(curPet) # 宠物主人
|
| | |
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0:
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | | AttackCommon.OnPlayerHitPlayer(curPlayer, curTagPlayer, tick)
|
| | |
|
| | | #宠物死亡
|
| | | if curTagPet.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTagPet) <= 0:
|
| | | curTagPetNPCControl = NPCCommon.NPCControl(curTagPet)
|
| | | curTagPetNPCControl.SetKilled()
|
| | |
|
| | |
| | | import ChEquip
|
| | | import PetControl
|
| | | import SkillShell
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @return hurtType : HurtType 伤害结构体类
|
| | | # @remarks 攻击
|
| | | def DoAttack(curPet, curTagPlayer, skill, skillValue, skillPercent, skillHurtList, tick):
|
| | | curTagPlayerHPBeforeAtk = curTagPlayer.GetHP()
|
| | | curTagPlayerHPBeforeAtk = GameObj.GetHP(curTagPlayer)
|
| | | hurtType = AttackCommon.GetHurtHP(curPet, curTagPlayer, skill, skillValue, skillPercent, tick)
|
| | | #伤血
|
| | | hurtHP = hurtType.HurtHP
|
| | |
| | | def AttackResult(curPet, curTagPlayer, skill, tick):
|
| | |
|
| | | #防守方血量
|
| | | curTagPlayerHP = curTagPlayer.GetHP()
|
| | | curTagPlayerHP = GameObj.GetHP(curTagPlayer)
|
| | | #防守方被动Buff触发
|
| | | # AttackCommon.DefenderSpringBuff(curTagPlayer, tick, BaseAttack.GetIsSuperHit())
|
| | |
|
| | |
| | | #获取防守方召唤兽的主人
|
| | | curTagPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curTagSummon)
|
| | | #攻击的是玩家的召唤兽
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0:
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | | #获取召唤兽的主人
|
| | |
| | | import SkillCommon
|
| | | import PetControl
|
| | | import SkillShell
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | def DoAttack(curPlayer, curTagPet, skill, skillValue, skillPercent, skillHurtList, tick):
|
| | |
|
| | | #攻击前血量
|
| | | curTagPetHP = curTagPet.GetHP()
|
| | | curTagPetHP = GameObj.GetHP(curTagPet)
|
| | | #攻击成功
|
| | | hurtType = AttackCommon.GetHurtHP(curPlayer, curTagPet, skill, skillValue, skillPercent, tick)
|
| | | hurtHP = hurtType.HurtHP
|
| | |
| | |
|
| | | if curTagPlayer != None:
|
| | |
|
| | | if curTagPlayer.GetHP() > 0:
|
| | | if GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | | AttackCommon.OnPlayerHitPlayer(curPlayer, curTagPlayer, tick)
|
| | |
|
| | | #宠物死亡
|
| | | if curTagPet.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTagPet) <= 0:
|
| | | curTagPetNPCControl = NPCCommon.NPCControl(curTagPet)
|
| | | curTagPetNPCControl.SetKilled()
|
| | |
|
| | |
| | | import SkillShell
|
| | | import SkillCommon
|
| | | import PassiveBuffEffMng
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @remarks 攻击
|
| | | def DoAttack(curPlayer, curTagPlayer, skill, skillValue, skillPercent, skillHurtList, tick):
|
| | |
|
| | | curTagPlayerHPBeforeAtk = curTagPlayer.GetHP()
|
| | | curTagPlayerHPBeforeAtk = GameObj.GetHP(curTagPlayer)
|
| | |
|
| | | #玩家攻击玩家
|
| | | hurtType = AttackCommon.GetHurtHP(curPlayer, curTagPlayer, skill, skillValue, skillPercent, tick)
|
| | |
| | | # @remarks 处理攻击后的结果
|
| | | def AttackResult(curPlayer, curTagPlayer, skill, tick):
|
| | | #防守方玩家血量
|
| | | curTagPlayerHP = curTagPlayer.GetHP()
|
| | | curTagPlayerHP = GameObj.GetHP(curTagPlayer)
|
| | |
|
| | | #被攻击提示,避免频繁提示
|
| | | if not curTagPlayer.GetBattleState() or not curPlayer.GetBattleState():
|
| | |
| | | #如果是玩家的召唤兽逻辑处理(NPC的召唤兽不考虑)
|
| | | if curTagPlayer != None :
|
| | |
|
| | | if curTagPlayer.GetHP() > 0:
|
| | | if GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | |
|
| | | #获取镖车主人
|
| | | curTagPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curTagTruck)
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0 :
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0 :
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | | import PlayerControl
|
| | | import PetControl
|
| | | import SkillShell
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #获取召唤兽的主人
|
| | | curPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curSummonNPC)
|
| | |
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0:
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | | AttackCommon.OnPlayerHitPlayer(curPlayer, curTagPlayer, tick)
|
| | |
|
| | | #宠物死亡
|
| | | if curTagPet.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTagPet) <= 0:
|
| | | curTagPetNPCControl = NPCCommon.NPCControl(curTagPet)
|
| | | curTagPetNPCControl.SetKilled()
|
| | |
|
| | |
| | | import ChEquip
|
| | | import SkillShell
|
| | | import ChNPC
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @remarks 攻击
|
| | | def DoAttack(curSummonNPC, curTagPlayer, skill, skillValue, skillPercent, skillHurtList, tick):
|
| | |
|
| | | curTagPlayerHPBeforeAtk = curTagPlayer.GetHP()
|
| | | curTagPlayerHPBeforeAtk = GameObj.GetHP(curTagPlayer)
|
| | |
|
| | | hurtType = AttackCommon.GetHurtHP(curSummonNPC, curTagPlayer, skill,
|
| | | skillValue, skillPercent, tick)
|
| | |
| | | # @remarks 处理攻击后的结果
|
| | | def AttackResult(curSummonNPC, curTagPlayer, skill, tick):
|
| | | #防守方血量
|
| | | curTagPlayerHP = curTagPlayer.GetHP()
|
| | | curTagPlayerHP = GameObj.GetHP(curTagPlayer)
|
| | | curTagPlayerFBHP = FBLogic.OnGetFBCurHP(curTagPlayer)
|
| | |
|
| | | #防守方被动Buff触发
|
| | |
| | | #获取防守方召唤兽的主人
|
| | | curTagPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curTagSummon)
|
| | | #攻击的是玩家的召唤兽
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0:
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0:
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | | #获取召唤兽的主人
|
| | |
| | | #获取召唤兽的主人
|
| | | curPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, curSummonNPC)
|
| | |
|
| | | if curTagPlayer != None and curTagPlayer.GetHP() > 0 :
|
| | | if curTagPlayer != None and GameObj.GetHP(curTagPlayer) > 0 :
|
| | | #进入战斗状态
|
| | | AttackCommon.SetPlayerBattleState(curTagPlayer, tick)
|
| | |
|
| | |
| | | #防守方不是玩家
|
| | | return
|
| | |
|
| | | if defender.GetHP() > 0:
|
| | | if GameObj.GetHP(defender) > 0:
|
| | | #还活着
|
| | | return
|
| | |
|
| | |
| | | curHurt = g_skillHurtList.GetHurtAt(0)
|
| | | attacker.BaseAttack(curHurt.GetObjID(), curHurt.GetObjType(),
|
| | | AttackCommon.GetBattleType(attacker, curSkill),
|
| | | curHurt.GetAttackType(), curHurt.GetHurtHP(), curHurt.GetCurHP(), curHurt.GetCurHPEx())
|
| | | curHurt.GetAttackType(), curHurt.GetHurtHP(), curHurt.GetHurtHPEx(), curHurt.GetCurHP(), curHurt.GetCurHPEx())
|
| | |
|
| | | #//返回值无意义
|
| | | return
|
| | |
| | |
|
| | | #----------扣HP点
|
| | | lostHPValue = curSkill.GetHP()
|
| | | curPlayerHP = curPlayer.GetHP()
|
| | | curPlayerHP = GameObj.GetHP(curPlayer)
|
| | |
|
| | | if curPlayerHP < lostHPValue:
|
| | | GameWorld.ErrLog('释放技能 = %s异常, HP点 = %s不足 = %s' % (
|
| | | curSkill.GetSkillTypeID(), curPlayerHP, lostHPValue))
|
| | |
|
| | | if lostHPValue > 0:
|
| | | curPlayer.SetHP(curPlayer.GetHP() - lostHPValue)
|
| | | GameObj.SetHP(curPlayer, GameObj.GetHP(curPlayer) - lostHPValue)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | #设置攻击间隔
|
| | | curNPC.SetAttackTick(tick)
|
| | | #通知伤血反弹
|
| | | #hurtHPValueSelf = curNPCBeHP - curNPC.GetHP()
|
| | | #hurtHPValueSelf = curNPCBeHP - GameObj.GetHP(curNPC)
|
| | |
|
| | | #通知客户端攻击结果
|
| | | __Sync_AttackResult(curNPC, target, curSkill)
|
| | |
| | | # #获取的主人
|
| | | # curPlayer = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer,curNPC)
|
| | | # #如果主人是玩家
|
| | | # if curPlayer != None and curPlayer.GetHP() > 0:
|
| | | # if curPlayer != None and GameObj.GetHP(curPlayer) > 0:
|
| | | # if curSkill == None or curSkill.GetSkillType() != ChConfig.Def_SkillType_Aura:
|
| | | # #进入战斗状态
|
| | | # AttackCommon.SetPlayerBattleState(curPlayer,tick)
|
| | |
| | | if curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | curPlayer = PetControl.GetPetOwner(curNPC)
|
| | |
|
| | | if curPlayer != None and curPlayer.GetHP() > 0:
|
| | | if curPlayer != None and GameObj.GetHP(curPlayer) > 0:
|
| | | if curSkill == None or curSkill.GetSkillType() not in ChConfig.Def_NoBattleState_List:
|
| | | AttackCommon.SetPlayerBattleState(curPlayer, tick)
|
| | |
|
| | |
| | | # @remarks 函数详细说明.
|
| | | def __DoPlayerBeAttacked(attacker, curPlayer, curSkill, tick):
|
| | | #玩家已经死亡
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | |
|
| | | #骑乘状态被攻击,则自动下马
|
| | |
| | | g_skillHurtList.Clear()
|
| | |
|
| | | #攻击方原有血量,用来通知反弹
|
| | | attackerHP = attacker.GetHP()
|
| | | attackerHP = GameObj.GetHP(attacker)
|
| | |
|
| | | attackObjName = GetObjAttackName(attacker)
|
| | |
|
| | |
| | | attackTimeSum = len(skillPerList)
|
| | |
|
| | | #攻击方原有血量,用来通知反弹
|
| | | attackerHP = attacker.GetHP()
|
| | | attackerHP = GameObj.GetHP(attacker)
|
| | |
|
| | | attackObjName = GetObjAttackName(attacker)
|
| | |
|
| | |
| | | # if curObj == None:
|
| | | # continue
|
| | | #
|
| | | # curObj.ChangeHPView(curSkill.GetSkillTypeID(), hurtObj.GetHurtHP(), hurtObj.GetAttackType())
|
| | | # curObj.ChangeHPView(curSkill.GetSkillTypeID(), hurtObj.GetHurtHP(), hurtObj.GetHurtHPEx(), hurtObj.GetAttackType())
|
| | | #
|
| | | # SkillCommon.NotifyNPCHP(curObj)
|
| | | #===========================================================================
|
| | |
| | | g_skillHurtList.Clear()
|
| | |
|
| | | #攻击方原有血量,用来通知反弹
|
| | | attackerHP = attacker.GetHP()
|
| | | attackerHP = GameObj.GetHP(attacker)
|
| | |
|
| | | resultList = __GetAreaAtackObj(attacker, curSkill, srcPosX, srcPosY, tick, __CheckCanAttack, skillMatrix)
|
| | |
|
| | |
| | | hurtList.ObjID = hurtObj.GetObjID()
|
| | | hurtList.AttackType = hurtObj.GetAttackType()
|
| | | hurtList.HurtHP = hurtObj.GetHurtHP()
|
| | | hurtList.HurtHPEx = hurtObj.GetHurtHPEx()
|
| | | hurtList.CurHP = hurtObj.GetCurHP()
|
| | | hurtList.CurHPEx = hurtObj.GetCurHPEx()
|
| | |
|
| | |
| | | hurtList.ObjID = hurtObj.GetObjID()
|
| | | hurtList.AttackType = hurtObj.GetAttackType()
|
| | | hurtList.HurtHP = hurtObj.GetHurtHP()
|
| | | hurtList.HurtHPEx = hurtObj.GetHurtHPEx()
|
| | | hurtList.CurHP = hurtObj.GetCurHP()
|
| | | hurtList.CurHPEx = hurtObj.GetCurHPEx()
|
| | |
|
| | |
| | | hurtList.ObjID = hurtObj.GetObjID()
|
| | | hurtList.AttackType = hurtObj.GetAttackType()
|
| | | hurtList.HurtHP = hurtObj.GetHurtHP()
|
| | | hurtList.HurtHPEx = hurtObj.GetHurtHPEx()
|
| | | hurtList.CurHP = hurtObj.GetCurHP()
|
| | | hurtList.CurHPEx = hurtObj.GetCurHPEx()
|
| | |
|
| | |
| | | TYPE_Calc_SkillReducePer7, # 受到技能伤害减少7
|
| | | ) = range(1, Def_Calc_AllAttrType_MAX)
|
| | |
|
| | | ## 支持大数值属性,超过20E
|
| | | TYPE_BIGVALUE_ATTR = [TYPE_Calc_AttrHP, TYPE_Calc_AttrMaxHP]
|
| | |
|
| | | ## NPC 专属属性
|
| | | TYPE_NPCAttr_Calc = [TYPE_Calc_AtkInterval]
|
| | |
| | | Def_NPC_Dict_TimeLostHPPlayerCountTick = 'TimeLostHPPlayerCountTick ' # 上次刷新按时间掉血人数tick
|
| | | Def_NPC_Dict_TimeLostHPPlayerCount = 'TimeLostHPPlayerCount' # 按时间掉血有效人数
|
| | | Def_NPC_Dict_TimeLostHPFightPower = 'TimeLostHPFightPower' # 按时间掉血战力
|
| | | Def_NPC_Dict_TimeLostHPFightPowerEx = 'TimeLostHPFightPowerEx' # 按时间掉血战力
|
| | |
|
| | | #玩家状态定义,不能超过31个,如超过,需扩展多个key支持
|
| | | Def_PlayerStateList = (
|
| | |
| | | Def_PlayerKey_LockHPSkillID = "LockHPSkillID" # 锁血功能的技能
|
| | | Def_PlayerKey_GodWeaponBeforeProDef = "GWBPD" # 神兵护盾被攻击前的值
|
| | | Def_PlayerKey_curHurtValue = "curHurtValue" # 计算中的临时伤害值,技能特殊用
|
| | | Def_PlayerKey_curHurtValueEx = "curHurtValueEx" # 计算中的临时伤害值,技能特殊用
|
| | | Def_PlayerKey_SomersaultTime = "Somersault" # 翻滚一定时间内无敌,表现为MISS
|
| | | Def_PlayerKey_CopyFuncAttr = "CopyFuncAttr%s" # 玩家属性刷新中的计算属性缓存,便于buff刷新计算
|
| | | Def_PlayerKey_CopyFuncAttrEx = "CopyFuncAttrEx%s" # 玩家属性刷新中的计算属性缓存,便于buff刷新计算
|
| | | Def_Player_RefreshAttrByBuff = "PlayerAttrByBuff" # 玩家属性刷新功能属性缓存,便于buff刷新计算, 间隔刷新
|
| | | Def_Player_HadRefreshAttr = "HadRefreshAttr" # 玩家在本地图是否刷新过属性
|
| | | Def_PlayerKey_ClientCustomScene = "ClientCustomScene" # 客户端自定义场景状态
|
| | |
| | | Def_PlayerKey_AttackFollowMaster = "FollowAtk" # 召唤兽跟随攻击
|
| | | Def_PlayerKey_MoreHurtValue = "MoreHurtValue" # 额外的伤害值,一般用于不走公式
|
| | | Def_PlayerKey_BloodShiledHurt = "BSHurt" # 伤害值用于血盾抵消
|
| | | Def_PlayerKey_BloodShiledHurtEx = "BSHurtEx" # 伤害值用于血盾抵消
|
| | | Def_PlayerKey_TJGPackFullAfterEat = "TJGFullEat" # 脱机挂吞噬后背包依然满的情况
|
| | | Def_PlayerKey_TJGStartTime = "TJGStartTime" # 脱机挂结算时间起点
|
| | | Def_PlayerKey_EquipTime = "EquipTime" # 时效装备
|
| | |
| | | Def_PlayerKey_SuperHitRateReduce = "SuperHitRateReduce" # 抗暴击概率
|
| | | Def_PlayerKey_IgnoreDefRateReduce = "IgnoreDefRateReduce" # 抗无视防御概率
|
| | | Def_PlayerKey_LastHurtValue = "LastHurtValue" # 最后一次伤害值
|
| | | Def_PlayerKey_LastHurtValueEx = "LastHurtValueEx" # 最后一次伤害值
|
| | | Def_PlayerKey_LastHurtNPCObjID = "LastHurtNPCObjID" # 最后攻击的NPCObjID
|
| | | Def_PlayerKey_LastAttackerObjID = "LastAttackerObjID" # 被攻击者记录的最近攻击玩家ID
|
| | | Def_PlayerKey_CommMapExpRate = "CommMapExpRate" # 常规地图经验倍率加成
|
| | |
| | |
|
| | | # 战斗力 Def_PDictType_FightPower
|
| | | Def_PDict_FightPower_Highest = "FightPower_Highest" # 历史最高总战斗力
|
| | | Def_PDict_FightPower_HighestEx = "FightPower_HighestEx" # 历史最高总战斗力
|
| | | Def_PDict_FightPower_Total = "FightPower_Total" # 总战斗力
|
| | | Def_PDict_FightPower_TotalEx = "FightPower_TotalEx" # 总战斗力
|
| | | Def_PDict_FightPower_Horse = "FightPower_Horse" # 坐骑战斗力
|
| | |
|
| | | Def_PDict_FightPower_List = [Def_PDict_FightPower_Total, Def_PDict_FightPower_Horse]
|
| | | Def_PDict_FightPower_List = [Def_PDict_FightPower_Total, Def_PDict_FightPower_TotalEx, Def_PDict_FightPower_Horse]
|
| | |
|
| | | # 每日活跃度
|
| | | Def_PDict_Activity_FinishCnt = "Activity_FinishCnt_%s" # 活跃度类型对应完成次数
|
| | |
| | | ("ObjID", c_int),
|
| | | ("AttackType", c_ubyte), #爆击, miss
|
| | | ("HurtHP", c_int),
|
| | | ("HurtHPEx", c_int), |
| | | ("CurHP", c_int),
|
| | | ("CurHPEx", c_int),
|
| | | ]
|
| | |
| | | self.ObjID = 0
|
| | | self.AttackType = 0
|
| | | self.HurtHP = 0
|
| | | self.HurtHPEx = 0
|
| | | self.CurHP = 0
|
| | | self.CurHPEx = 0
|
| | | return
|
| | |
| | | ObjID:%d,
|
| | | AttackType:%d,
|
| | | HurtHP:%d,
|
| | | HurtHPEx:%d,
|
| | | CurHP:%d,
|
| | | CurHPEx:%d
|
| | | '''\
|
| | |
| | | self.ObjID,
|
| | | self.AttackType,
|
| | | self.HurtHP,
|
| | | self.HurtHPEx,
|
| | | self.CurHP,
|
| | | self.CurHPEx
|
| | | )
|
| | |
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("LostHP", c_int),
|
| | | ("LostHPEx", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x0E
|
| | | self.LostHP = 0
|
| | | self.LostHPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | DumpString = '''// B4 0E 玩家掉血 //tagCMRoleLostHP:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | LostHP:%d
|
| | | LostHP:%d,
|
| | | LostHPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.LostHP
|
| | | self.LostHP,
|
| | | self.LostHPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("ObjID", c_int),
|
| | | ("AttackType", c_ubyte), #爆击, miss
|
| | | ("HurtHP", c_int),
|
| | | ("HurtHPEx", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.ObjID = 0
|
| | | self.AttackType = 0
|
| | | self.HurtHP = 0
|
| | | self.HurtHPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | ObjType:%d,
|
| | | ObjID:%d,
|
| | | AttackType:%d,
|
| | | HurtHP:%d
|
| | | HurtHP:%d,
|
| | | HurtHPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.ObjType,
|
| | | self.ObjID,
|
| | | self.AttackType,
|
| | | self.HurtHP
|
| | | self.HurtHP,
|
| | | self.HurtHPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | Name = "" #(String Name)//size=NameLen
|
| | | PlayerLV = 0 #(WORD PlayerLV)//玩家等级
|
| | | PlayeJob = 0 #(BYTE PlayeJob)//玩家职业
|
| | | PlayeFightPower = 0 #(DWORD PlayeFightPower)//玩家战斗力
|
| | | PlayeFightPower = 0 #(DWORD PlayeFightPower)//玩家战斗力,求余亿部分
|
| | | PlayeFightPowerEx = 0 #(DWORD PlayeFightPowerEx)//玩家战斗力,整除亿部分,1代表1亿
|
| | | RequestTime = 0 #(DWORD RequestTime)//申请时间
|
| | | IsOnLine = 0 #(BYTE IsOnLine)//是否在线
|
| | | data = None
|
| | |
| | | self.PlayerLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.PlayeJob,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.PlayeFightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PlayeFightPowerEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.RequestTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.IsOnLine,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
| | | self.PlayerLV = 0
|
| | | self.PlayeJob = 0
|
| | | self.PlayeFightPower = 0
|
| | | self.PlayeFightPowerEx = 0
|
| | | self.RequestTime = 0
|
| | | self.IsOnLine = 0
|
| | | return
|
| | |
| | | length += len(self.Name)
|
| | | length += 2
|
| | | length += 1
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | |
| | | data = CommFunc.WriteWORD(data, self.PlayerLV)
|
| | | data = CommFunc.WriteBYTE(data, self.PlayeJob)
|
| | | data = CommFunc.WriteDWORD(data, self.PlayeFightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.PlayeFightPowerEx)
|
| | | data = CommFunc.WriteDWORD(data, self.RequestTime)
|
| | | data = CommFunc.WriteBYTE(data, self.IsOnLine)
|
| | | return data
|
| | |
| | | PlayerLV:%d,
|
| | | PlayeJob:%d,
|
| | | PlayeFightPower:%d,
|
| | | PlayeFightPowerEx:%d,
|
| | | RequestTime:%d,
|
| | | IsOnLine:%d
|
| | | '''\
|
| | |
| | | self.PlayerLV,
|
| | | self.PlayeJob,
|
| | | self.PlayeFightPower,
|
| | | self.PlayeFightPowerEx,
|
| | | self.RequestTime,
|
| | | self.IsOnLine
|
| | | )
|
| | |
| | | PlayerName = "" #(String PlayerName)// 跨服名字
|
| | | Job = 0 #(BYTE Job)
|
| | | LV = 0 #(WORD LV)
|
| | | MaxHP = 0 #(DWORD MaxHP)// 默认满血
|
| | | MaxHP = 0 #(DWORD MaxHP)// 默认满血,求余亿部分
|
| | | MaxHPEx = 0 #(DWORD MaxHPEx)// 默认满血,整除亿部分
|
| | | MaxProDef = 0 #(DWORD MaxProDef)// 最大护盾
|
| | | data = None
|
| | |
|
| | |
| | | self.Job,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.MaxHP,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.MaxHPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.MaxProDef,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | |
| | | self.Job = 0
|
| | | self.LV = 0
|
| | | self.MaxHP = 0
|
| | | self.MaxHPEx = 0
|
| | | self.MaxProDef = 0
|
| | | return
|
| | |
|
| | |
| | | length += len(self.PlayerName)
|
| | | length += 1
|
| | | length += 2
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.Job)
|
| | | data = CommFunc.WriteWORD(data, self.LV)
|
| | | data = CommFunc.WriteDWORD(data, self.MaxHP)
|
| | | data = CommFunc.WriteDWORD(data, self.MaxHPEx)
|
| | | data = CommFunc.WriteDWORD(data, self.MaxProDef)
|
| | | return data
|
| | |
|
| | |
| | | Job:%d,
|
| | | LV:%d,
|
| | | MaxHP:%d,
|
| | | MaxHPEx:%d,
|
| | | MaxProDef:%d
|
| | | '''\
|
| | | %(
|
| | |
| | | self.Job,
|
| | | self.LV,
|
| | | self.MaxHP,
|
| | | self.MaxHPEx,
|
| | | self.MaxProDef
|
| | | )
|
| | | return DumpString
|
| | |
| | | ExAttr18 = 0 #(DWORD ExAttr18)//预留的扩展属性字段,用来存放项目特定的属性
|
| | | ExAttr19 = 0 #(DWORD ExAttr19)//预留的扩展属性字段,用来存放项目特定的属性
|
| | | ExAttr20 = 0 #(DWORD ExAttr20)//预留的扩展属性字段,用来存放项目特定的属性
|
| | | HPEx = 0 #(DWORD HPEx)//当前血量 超过E的记录
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.ExAttr18,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ExAttr19,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.ExAttr20,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.HPEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.ExAttr18 = 0
|
| | | self.ExAttr19 = 0
|
| | | self.ExAttr20 = 0
|
| | | self.HPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 4
|
| | | length += 4
|
| | | length += 15
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | | length += 4
|
| | |
| | | data = CommFunc.WriteDWORD(data, self.ExAttr18)
|
| | | data = CommFunc.WriteDWORD(data, self.ExAttr19)
|
| | | data = CommFunc.WriteDWORD(data, self.ExAttr20)
|
| | | data = CommFunc.WriteDWORD(data, self.HPEx)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | ExAttr17:%d,
|
| | | ExAttr18:%d,
|
| | | ExAttr19:%d,
|
| | | ExAttr20:%d
|
| | | ExAttr20:%d,
|
| | | HPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | |
| | | self.ExAttr17,
|
| | | self.ExAttr18,
|
| | | self.ExAttr19,
|
| | | self.ExAttr20
|
| | | self.ExAttr20,
|
| | | self.HPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | class tagMCModuleFightPowerInfo(Structure):
|
| | | Head = tagHead()
|
| | | TotalFightPower = 0 #(DWORD TotalFightPower)//总战斗力
|
| | | TotalFightPower = 0 #(DWORD TotalFightPower)//总战斗力,求余亿部分
|
| | | TotalFightPoweEx = 0 #(DWORD TotalFightPoweEx)//总战斗力,整除亿部分,1代表1亿
|
| | | MFPCnt = 0 #(BYTE MFPCnt)//模块战斗力总数
|
| | | MFPList = list() #(vector<tagMCModuleFightPower> MFPList)
|
| | | data = None
|
| | |
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.TotalFightPower,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.TotalFightPoweEx,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.MFPCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.MFPCnt):
|
| | | temMFPList = tagMCModuleFightPower()
|
| | |
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xA1
|
| | | self.TotalFightPower = 0
|
| | | self.TotalFightPoweEx = 0
|
| | | self.MFPCnt = 0
|
| | | self.MFPList = list()
|
| | | return
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.MFPCnt):
|
| | |
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.TotalFightPower)
|
| | | data = CommFunc.WriteDWORD(data, self.TotalFightPoweEx)
|
| | | data = CommFunc.WriteBYTE(data, self.MFPCnt)
|
| | | for i in range(self.MFPCnt):
|
| | | data = CommFunc.WriteString(data, self.MFPList[i].GetLength(), self.MFPList[i].GetBuffer())
|
| | |
| | | DumpString = '''
|
| | | Head:%s,
|
| | | TotalFightPower:%d,
|
| | | TotalFightPoweEx:%d,
|
| | | MFPCnt:%d,
|
| | | MFPList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.TotalFightPower,
|
| | | self.TotalFightPoweEx,
|
| | | self.MFPCnt,
|
| | | "..."
|
| | | )
|
| | |
| | | _fields_ = [
|
| | | ("RefreshType", c_ubyte),
|
| | | ("Value", c_int),
|
| | | ("ValueEx", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | def Clear(self):
|
| | | self.RefreshType = 0
|
| | | self.Value = 0
|
| | | self.ValueEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''//A7 09 周围对象刷新合并包 //tagObjInfoListRefresh:
|
| | | RefreshType:%d,
|
| | | Value:%d
|
| | | Value:%d,
|
| | | ValueEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.RefreshType,
|
| | | self.Value
|
| | | self.Value,
|
| | | self.ValueEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("ObjID", c_int),
|
| | | ("AttackType", c_ubyte), #爆击, miss
|
| | | ("HurtHP", c_int),
|
| | | ("HurtHPEx", c_int), |
| | | ("CurHP", c_int),
|
| | | ("CurHPEx", c_int),
|
| | | ]
|
| | |
| | | self.ObjID = 0
|
| | | self.AttackType = 0
|
| | | self.HurtHP = 0
|
| | | self.HurtHPEx = 0
|
| | | self.CurHP = 0
|
| | | self.CurHPEx = 0
|
| | | return
|
| | |
| | | ObjID:%d,
|
| | | AttackType:%d,
|
| | | HurtHP:%d,
|
| | | HurtHPEx:%d,
|
| | | CurHP:%d,
|
| | | CurHPEx:%d
|
| | | '''\
|
| | |
| | | self.ObjID,
|
| | | self.AttackType,
|
| | | self.HurtHP,
|
| | | self.HurtHPEx,
|
| | | self.CurHP,
|
| | | self.CurHPEx
|
| | | )
|
| | |
| | | if curPlayer:
|
| | | pid = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFromPID)
|
| | | dataDict["pid"] = pid
|
| | | dataDict["fightPower"] = curPlayer.GetFightPower()
|
| | | dataDict["fightPower"] = PlayerControl.GetFightPower(curPlayer)
|
| | | dataDict["PlayerLV"] = curPlayer.GetLV()
|
| | | dataDict["IP"] = curPlayer.GetIP()
|
| | | dataDict["time"] = str(datetime.datetime.today()).split(".")[0]
|
| | |
| | | def DR_PlayerMasterLVChange(curPlayer, totalMasterExp, addDataDict={}):
|
| | |
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(),
|
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), 'PlayerLVEx':curPlayer.GetLVEx(), |
| | | 'AccID':curPlayer.GetAccID(), 'PlayerLV':curPlayer.GetLV(), |
| | | 'TotalExp':curPlayer.GetTotalExp(), 'MasterLV':curPlayer.GetLV2(),
|
| | | 'TotalExpMaster':totalMasterExp}
|
| | |
|
| | |
| | | 'PlayerName':curPlayer.GetPlayerName(),
|
| | | 'AccID':curPlayer.GetAccID(),
|
| | | 'LV':curPlayer.GetLV(),
|
| | | 'LVEx':curPlayer.GetLVEx(),
|
| | | 'CreateRoleTime':curPlayer.GetCreateRoleTime(),
|
| | | 'CardStr':cardStr,
|
| | | 'CardType':cardType,
|
| | |
| | | def DR_RealmLVUp(curPlayer, realmlv):
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), "PlayerName":curPlayer.GetPlayerName(),
|
| | | 'AccID':curPlayer.GetAccID(), 'realmlv':realmlv,
|
| | | 'playerlv':curPlayer.GetLV(), 'power':curPlayer.GetFightPower()}
|
| | | 'playerlv':curPlayer.GetLV(), 'power':PlayerControl.GetFightPower(curPlayer)}
|
| | |
|
| | | #发送封包
|
| | | SendEventPack("RealmLVUp", dataDict, curPlayer)
|
| | |
| | | import NetPackCommon
|
| | | import NPCCommon
|
| | | import PlayerVip
|
| | | import GameObj
|
| | |
|
| | | import math
|
| | | import random
|
| | |
| | | NotifyOneMission(curPlayer, addMission)
|
| | |
|
| | | #---补满血满魔---
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | GameObj.SetHP(curPlayer, GameObj.GetMaxHP(curPlayer))
|
| | | curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | |
|
| | | #---给予玩家新手物品---
|
| | |
| | | import PlayerHorse
|
| | | import FBCommon
|
| | | import NPCCommon
|
| | | import GameObj
|
| | |
|
| | | import math
|
| | | import time
|
| | |
| | | def ConditionType_Get_Hp_Percent(curPlayer, curMission, curConditionNode):
|
| | | conditionValue = int(curConditionNode.GetAttribute("value"))
|
| | | conditionType = curConditionNode.GetAttribute("type")
|
| | | curPlayerHP = curPlayer.GetHP()
|
| | | conditionHP = curPlayer.GetMaxHP() * conditionValue / 100
|
| | | curPlayerHP = GameObj.GetHP(curPlayer)
|
| | | conditionHP = GameObj.GetMaxHP(curPlayer) * conditionValue / 100
|
| | |
|
| | |
|
| | | return QuestRunnerValue.GetEval(conditionType, curPlayerHP, conditionHP)
|
| | |
| | | def DoType_Set_Hp_Percent(curPlayer, curMission, curActionNode):
|
| | | value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"))
|
| | |
|
| | | maxHP = curPlayer.GetMaxHP()
|
| | | maxHP = GameObj.GetMaxHP(curPlayer)
|
| | | playerHP = maxHP * value / ShareDefine.Def_Percentage
|
| | |
|
| | | smallHP = 1
|
| | |
| | | #防范纠错 最少1点血,最多满血
|
| | | playerHP = GameWorld.ToIntArea(playerHP, smallHP, maxHP)
|
| | |
|
| | | curPlayer.SetHP(playerHP)
|
| | | GameObj.SetHP(curPlayer, playerHP)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##设置人物法量百分比
|
| | |
| | | import GameWorld
|
| | | import PlayerControl
|
| | | import QuestCommon
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | | ##获取服务器任务状态, State
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | # @return 金额
|
| | | # @remarks 获得墓地医生恢复所耗金钱
|
| | | def GetHealthLostMoney(curPlayer):
|
| | | curHP = curPlayer.GetHP()
|
| | | maxHP = curPlayer.GetMaxHP()
|
| | | curHP = GameObj.GetHP(curPlayer)
|
| | | maxHP = GameObj.GetMaxHP(curPlayer)
|
| | | curMP = curPlayer.GetMP()
|
| | | maxMP = curPlayer.GetMaxMP()
|
| | | lv = curPlayer.GetLV()
|
| | |
| | | EventReport(ShareDefine.Def_UserAction_VIPLvUP, "VIPLevel=%s"%curPlayer.GetVIPLv(), curPlayer)
|
| | |
|
| | | def WriteEvent_FightPower(curPlayer):
|
| | | EventReport(ShareDefine.Def_UserAction_FightPower, "FightPower=%s"%curPlayer.GetFightPower(), curPlayer)
|
| | | EventReport(ShareDefine.Def_UserAction_FightPower, "FightPower=%s"%PlayerControl.GetFightPower(curPlayer), curPlayer)
|
| | |
|
| | |
|
| | |
| | | """Version = 2012-04-06 12:00"""
|
| | | #---------------------------------------------------------------------
|
| | | import GameWorld
|
| | | import GameObj
|
| | | ## GM命令执行入口
|
| | | # @param curPlayer 当前玩家
|
| | | # @param list 参数列表 [tagID,ExpValue]
|
| | |
| | | GameWorld.DebugAnswer(curPlayer, "加上Buff后, 总力量 = %s,总真元 = %s, 总筋骨 = %s, 总体质 = %s"%(
|
| | | rolePetBattleStruct.STR, rolePetBattleStruct.PNE,
|
| | | rolePetBattleStruct.PHY, rolePetBattleStruct.CON))
|
| | | curHP = petObj.GetHP()
|
| | | curMaxHP = petObj.GetMaxHP()
|
| | | curHP = GameObj.GetHP(petObj)
|
| | | curMaxHP = GameObj.GetMaxHP(petObj)
|
| | |
|
| | | curMaxAtk = petObj.GetMaxAtk()
|
| | | curMAtkMax = petObj.GetMAtkMax()
|
| | |
| | | GameWorld.DebugAnswer(curPlayer, "%s内部加成:%s" % (funcName, insidePerAttrDict))
|
| | | return
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "===== 总战力: %s" % curPlayer.GetFightPower())
|
| | | GameWorld.DebugAnswer(curPlayer, "===== 总战力: %s" % PlayerControl.GetFightPower(curPlayer))
|
| | | for mfpType in ChConfig.MFPTypeAttrFuncIndexDict.keys():
|
| | | fightPower = PlayerControl.GetMFPFightPower(curPlayer, mfpType)
|
| | | mfpSkillFP = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPSkill % mfpType)
|
| | |
| | | #---------------------------------------------------------------------
|
| | | import IPY_GameWorld
|
| | | import GameWorld
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | | ##查看点选的NPC仇恨列表
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | return
|
| | |
|
| | | npcAngry = curNPC.GetNPCAngry()
|
| | | GameWorld.DebugAnswer(curPlayer, "NPCID=%s, 当前仇恨数=%s" % (curNPC.GetNPCID(), npcAngry.GetAngryCount()))
|
| | | GameWorld.DebugAnswer(curPlayer, "---NPCID=%s, 当前仇恨数=%s" % (curNPC.GetNPCID(), npcAngry.GetAngryCount()))
|
| | | for i in range(0, npcAngry.GetAngryCount()):
|
| | | curAngry = npcAngry.GetAngryValueTag(i)
|
| | | angryObjID = curAngry.GetObjID()
|
| | |
| | | continue
|
| | |
|
| | | angryObjType = curAngry.GetObjType()
|
| | | angryObjValue = curAngry.GetAngryValue()
|
| | | angryObjValue = GameObj.GetAngryValue(curAngry)
|
| | |
|
| | | angryDetel = GameWorld.GetObj(angryObjID, angryObjType)
|
| | |
|
| | |
| | | continue
|
| | |
|
| | | #GameWorld.DebugAnswer(curPlayer, 'id = %s, name = %s, angryValue = %s'%(angryObjID, angryDetel.GetName(), angryObjValue))
|
| | | GameWorld.DebugAnswer(curPlayer, 'id = %s, angryValue = %s' % (angryObjID, angryObjValue))
|
| | | GameWorld.DebugAnswer(curPlayer, '%s type=%s,id=%s,v=%s' % (i, angryObjType, angryObjID, angryObjValue))
|
| | |
|
| | | return
|
| | |
| | | import NPCHurtManager
|
| | | import NPCHurtMgr
|
| | | import PlayerTeam
|
| | | import ShareDefine
|
| | | import GameObj
|
| | |
|
| | | ##查看点选的NPC仇恨列表
|
| | |
| | | hurtType = hurtObj.GetValueType()
|
| | | hurtID = hurtObj.GetValueID()
|
| | | hurtValue = hurtObj.GetHurtValue()
|
| | | if hasattr(hurtObj, "GetHurtValueEx"):
|
| | | hurtValue += hurtObj.GetHurtValueEx() * ShareDefine.Def_PerPointValue
|
| | | if not hurtID:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s 不存在!HurtType=%s,ID=%s, V=%s" % (index, hurtType, hurtID, hurtValue))
|
| | | continue
|
| | |
| | | hurtPlayer = GameWorld.GetObj(hurtID, IPY_GameWorld.gotPlayer)
|
| | | if hurtPlayer == None:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s 玩家ID=%s,不存在, V=%s" % (index, hurtID, hurtValue))
|
| | | elif hurtPlayer.GetHP() <= 0 :
|
| | | elif GameObj.GetHP(hurtPlayer) <= 0 :
|
| | | GameWorld.DebugAnswer(curPlayer, "%s 玩家ID=%s,血量为0, V=%s" % (index, hurtID, hurtValue))
|
| | | else:
|
| | | d = GameWorld.GetDist(curNPC.GetPosX(), curNPC.GetPosY(), hurtPlayer.GetPosX(), hurtPlayer.GetPosY())
|
| | |
| | | npcID = curNPC.GetNPCID()
|
| | | isByTime = True if IpyGameDataPY.GetIpyGameDataNotLog("NPCTimeLostHP", npcID) else False
|
| | | GameObj.SetHP(curNPC, setHP, isByTime=isByTime)
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_HP()
|
| | | GameWorld.DebugAnswer(curPlayer, "SetNPCHP ID=%s(%s),HP=%s" % (curNPC.GetID(), curNPC.GetNPCID(), setHP))
|
| | | return
|
| | |
|
| | |
| | | DR_UseGMCMD(curPlayer, inputStr)
|
| | | return
|
| | |
|
| | | # curPlayer 的 Get、Set函数
|
| | | if hasattr(curPlayer, callFunName):
|
| | | callObj = getattr(curPlayer, callFunName)
|
| | | # GameObj 的 Get、Set函数
|
| | | if hasattr(GameObj, callFunName):
|
| | | callObj = getattr(GameObj, callFunName)
|
| | | argcount = callObj.func_code.co_argcount # 函数参数个数
|
| | |
|
| | | if argcount == 1 and callFunName.startswith("Get"): # 这个得到的参数个数竟然是1!!!暂时先这样写
|
| | | value = callObj()
|
| | | elif argcount == 1 and callFunName.startswith("Set"):
|
| | | if argcount == 1 and callFunName.startswith("Get"):
|
| | | value = callObj(curPlayer)
|
| | | elif argcount >= 2 and callFunName.startswith("Set"):
|
| | | if len(inputList) < 2:
|
| | | GameWorld.DebugAnswer(curPlayer, "必须设定一定参数值")
|
| | | return
|
| | |
| | | if value == None:
|
| | | GameWorld.DebugAnswer(curPlayer, "参数错误, 必须为纯数字!")
|
| | | return
|
| | | if callFunName == "SetHappyPoint":
|
| | | PlayerTJG.SetTJGTime(curPlayer, value)
|
| | | callObj(curPlayer, value)
|
| | | else:
|
| | | callObj(value)
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "不支持该命令!curPlayer.%s" % callFunName)
|
| | | GameWorld.DebugAnswer(curPlayer, "不支持该命令!GameObj.%s" % callFunName)
|
| | | return
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "%s : %s" % (callFunName, value))
|
| | |
| | | DR_UseGMCMD(curPlayer, inputStr)
|
| | | return
|
| | |
|
| | | # GameObj 的 Get、Set函数
|
| | | if hasattr(GameObj, callFunName):
|
| | | callObj = getattr(GameObj, callFunName)
|
| | | # curPlayer 的 Get、Set函数
|
| | | if hasattr(curPlayer, callFunName):
|
| | | callObj = getattr(curPlayer, callFunName)
|
| | | argcount = callObj.func_code.co_argcount # 函数参数个数
|
| | |
|
| | | if argcount == 1 and callFunName.startswith("Get"):
|
| | | value = callObj(curPlayer)
|
| | | elif argcount == 2 and callFunName.startswith("Set"):
|
| | | if argcount == 1 and callFunName.startswith("Get"): # 这个得到的参数个数竟然是1!!!暂时先这样写
|
| | | value = callObj()
|
| | | elif argcount == 1 and callFunName.startswith("Set"):
|
| | | if len(inputList) < 2:
|
| | | GameWorld.DebugAnswer(curPlayer, "必须设定一定参数值")
|
| | | return
|
| | |
| | | if value == None:
|
| | | GameWorld.DebugAnswer(curPlayer, "参数错误, 必须为纯数字!")
|
| | | return
|
| | | callObj(curPlayer, value)
|
| | | if callFunName == "SetHappyPoint":
|
| | | PlayerTJG.SetTJGTime(curPlayer, value)
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "不支持该命令!GameObj.%s" % callFunName)
|
| | | callObj(value)
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "不支持该命令!curPlayer.%s" % callFunName)
|
| | | return
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "%s : %s" % (callFunName, value))
|
| | |
| | | for i in range(0, GameWorld.GetPlayerManager().GetPlayerCount()):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(i)
|
| | | GameWorld.Log("PlayerIndex = %d, PlayerID = %d, PlayerHP = %d, PlayerPos = (%d,%d)"%(i,
|
| | | curPlayer.GetPlayerID(), curPlayer.GetHP(),
|
| | | curPlayer.GetPlayerID(), GameObj.GetHP(curPlayer),
|
| | | curPlayer.GetPosX(), curPlayer.GetPosY()))
|
| | |
|
| | | ## 输出npc信息
|
| | |
| | | import IPY_GameWorld
|
| | | import IpyGameDataPY
|
| | | import SkillCommon
|
| | | import PlayerControl
|
| | |
|
| | | # 关于血量的函数这里只包装最简单的超DWORD处理
|
| | |
|
| | | def GetMaxHP(gameObj):
|
| | | if not hasattr(gameObj, "GetMaxHPEx"):
|
| | | return gameObj.GetMaxHP()
|
| | | |
| | | else:
|
| | | return gameObj.GetMaxHPEx()*ShareDefine.Def_PerPointValue + gameObj.GetMaxHP()
|
| | |
|
| | |
|
| | | def SetMaxHP(gameObj, value):
|
| | | if not hasattr(gameObj, "SetMaxHPEx"):
|
| | | gameObj.SetMaxHP(value)
|
| | | |
| | | else:
|
| | | gameObj.SetMaxHPEx(value/ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetMaxHP(value%ShareDefine.Def_PerPointValue)
|
| | |
|
| | | gameObj.SetMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetHP(gameObj):
|
| | | if not hasattr(gameObj, "GetHPEx"):
|
| | | return gameObj.GetHP()
|
| | | |
| | | else:
|
| | | return gameObj.GetHPEx()*ShareDefine.Def_PerPointValue + gameObj.GetHP()
|
| | |
|
| | |
|
| | | def SetHP(gameObj, value, isNotify=True, isByTime=False):
|
| | | def SetHP(gameObj, value, isNotify=None, isByTime=False):
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | gameObj.SetHP(value, isNotify)
|
| | | if isNotify == None:
|
| | | isNotify = True
|
| | | gameObj.SetHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue, isNotify)
|
| | | else:
|
| | | if isNotify == None:
|
| | | isNotify = False
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | | npcID = gameObj.GetNPCID()
|
| | | if IpyGameDataPY.GetIpyGameDataNotLog("NPCTimeLostHP", npcID) and not isByTime and value not in [GetMaxHP(gameObj), 0]:
|
| | | #GameWorld.DebugLog("不能设置按时间掉血的怪物血量! id=%s,npciD=%s,value=%s,isByTime=%s" % (gameObj.GetID(), gameObj.GetNPCID(), value, isByTime))
|
| | | return
|
| | | gameObj.SetHPEx(value/ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetHP(value%ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue, isNotify)
|
| | | return
|
| | |
|
| | | def SetHPFull(gameObj):
|
| | | SetHP(gameObj, GetMaxHP(gameObj))
|
| | | return
|
| | |
|
| | | def SetBaseMaxHP(gameObj, value):
|
| | | gameObj.SetBaseMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | | |
| | | def GetAngryValue(curAngry):
|
| | | return curAngry.GetAngryValue() + curAngry.GetAngryValueEx() * ShareDefine.Def_PerPointValue
|
| | | def SetAngryValue(curAngry, value):
|
| | | curAngry.SetAngryValue(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | ## 设置buff状态(脚本自定义枚举)
|
| | | # @param pyState ״̬
|
| | |
| | | def SetPetDamPer(gameObj, value):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_AttrPetDamPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | gameObj.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PetDamPer, value, False)
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetDamPer, value)
|
| | | return
|
| | |
|
| | | def GetLastHurtValue(gameObj):
|
| | | ## 最后一击伤害值
|
| | | hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValue)
|
| | | hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValueEx)
|
| | | return hurtEx * ShareDefine.Def_PerPointValue + hurt
|
| | | def SetLastHurtValue(gameObj, value):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValue, value % ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValueEx, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetBloodShiledHurt(gameObj):
|
| | | ## 伤害值用于血盾抵消
|
| | | hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurtEx)
|
| | | return hurtEx * ShareDefine.Def_PerPointValue + hurt
|
| | | def SetBloodShiledHurt(gameObj, value):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, value % ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurtEx, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
| | | return
|
| | |
|
| | | #进入副本默认回满血
|
| | | if curPlayer.GetHP() < curPlayer.GetMaxHP():
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | if GameObj.GetHP(curPlayer) < GameObj.GetMaxHP(curPlayer):
|
| | | GameObj.SetHPFull(curPlayer)
|
| | |
|
| | | #副本管理器
|
| | | gameFBMgr = GameWorld.GetGameFB()
|
| | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGetFBCurHP"))
|
| | |
|
| | | if not callFunc:
|
| | | return curPlayer.GetHP()
|
| | | return GameObj.GetHP(curPlayer)
|
| | |
|
| | | return callFunc(curPlayer)
|
| | |
|
| | |
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | if needAlive and curPlayer.GetHP() <= 0:
|
| | | if needAlive and GameObj.GetHP(curPlayer) <= 0:
|
| | | continue
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if getCntLimit:
|
| | |
| | | if todayIsCheckIn:
|
| | | GameWorld.DebugLog("当天已登记,不需要重复登记!", curPlayer.GetPlayerID())
|
| | | return
|
| | | fightPower = curPlayer.GetFightPower()
|
| | | fightPower = PlayerControl.GetFightPower(curPlayer)
|
| | | msgInfo = str(["CheckIn", checkInCount, fightPower])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, "FBHelpBattle", msgInfo, len(msgInfo))
|
| | | return
|
| | |
| | | import SkillCommon
|
| | | import FBCommon
|
| | | import ChConfig
|
| | | import GameObj
|
| | |
|
| | |
|
| | | (
|
| | |
| | | pvpDamage = gameFB.GetPlayerGameFBDictByKey(playerID, FBPDict_PVPDamage)
|
| | | pvpDamTick = gameFB.GetPlayerGameFBDictByKey(playerID, FBPDict_PVPDamUpdTick)
|
| | | sortTick = tick - pvpDamTick
|
| | | curHP = 0 if not player else player.GetHP()
|
| | | curMaxHP = 0 if not player else player.GetMaxHP()
|
| | | curHP = 0 if not player else GameObj.GetHP(player)
|
| | | curMaxHP = 0 if not player else GameObj.GetMaxHP(player)
|
| | | playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerLeaveTick, playerID, player])
|
| | | GameWorld.Log("PK超时: pvpDamge=%s,pvpDamTick=%s,tick=%s,sortTick=%s,HP=%s/%s,playerLeaveTick=%s"
|
| | | % (pvpDamage, pvpDamTick, tick, sortTick, curHP, curMaxHP, playerLeaveTick), playerID)
|
| | |
| | | playerID = player.GetPlayerID()
|
| | | gameFB.SetPlayerGameFBDict(playerID, FBPDict_RoundNum, nextRoundNum)
|
| | |
|
| | | if player.GetPlayerAction() == IPY_GameWorld.paDie or player.GetHP() <= 0:
|
| | | if player.GetPlayerAction() == IPY_GameWorld.paDie or GameObj.GetHP(player) <= 0:
|
| | | GameWorld.DebugLog("复活玩家...", player.GetPlayerID())
|
| | | ChPlayer.PlayerRebornByType(player, ChConfig.rebornType_System, tick, isAddSuperBuff=False)
|
| | | __ResetPlayerState(gameFB, player, playerID)
|
| | |
| | | if not resetAttr:
|
| | | return
|
| | |
|
| | | if player.GetHP() != player.GetMaxHP():
|
| | | player.SetHP(player.GetMaxHP())
|
| | | if GameObj.GetHP(player) != GameObj.GetMaxHP(player):
|
| | | GameObj.SetHP(player, GameObj.GetMaxHP(player))
|
| | |
|
| | | if PlayerControl.GetProDef(player) != PlayerControl.GetMaxProDef(player):
|
| | | PlayerControl.SetProDef(player, PlayerControl.GetMaxProDef(player))
|
| | |
| | | #战力判断
|
| | | LVIpyData = PlayerControl.GetPlayerLVIpyData(curPlayer.GetLV())
|
| | | reFightPower = 0 if not LVIpyData else LVIpyData.GetIceLodeFightPower() # 当前等级参考战力
|
| | | if curPlayer.GetFightPower() < reFightPower:
|
| | | if PlayerControl.GetFightPower(curPlayer) < reFightPower:
|
| | | GameWorld.DebugLog('冰晶矿脉扫荡 战力不足 %s'%(reFightPower))
|
| | | return
|
| | | #vip判断
|
| | |
| | | import PlayerGoldGift
|
| | | import PlayerMagicWeapon
|
| | | import ChPlayer
|
| | | import GameObj
|
| | |
|
| | | #---副本配置对应key值---
|
| | | (
|
| | |
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | if playerManager.GetPlayerCount() > 0:
|
| | | curPlayer = playerManager.GetPlayerByIndex(0)
|
| | | if curPlayer.GetHP() <=0:
|
| | | if GameObj.GetHP(curPlayer) <=0:
|
| | | ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_System, tick)
|
| | | else:
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | GameObj.SetHP(curPlayer, GameObj.GetMaxHP(curPlayer))
|
| | | DoFBHelp(curPlayer, tick)
|
| | |
|
| | | FBCommon.SetFBStep(FB_Step_Fighting, tick)
|
| | |
| | | #判断战力是否满足本层要求
|
| | | helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, lineId)
|
| | | if helpIpyData:
|
| | | if curPlayer.GetFightPower() < helpIpyData.GetFightPowerMin():
|
| | | if PlayerControl.GetFightPower(curPlayer) < helpIpyData.GetFightPowerMin():
|
| | | GameWorld.DebugLog("战力不足%s,无法挑战本层!lineID=%s" % (helpIpyData.GetFightPowerMin(), lineId), curPlayer.GetPlayerID())
|
| | | return False
|
| | | return True
|
| | |
| | | nextLineID = 0 if not nextLineIpyData else (lineID + 1) # 找不到想下一层数据代表通关
|
| | | if nextLineID:
|
| | | helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, nextLineID)
|
| | | if helpIpyData and curPlayer.GetFightPower() < helpIpyData.GetFightPowerMin():
|
| | | if helpIpyData and PlayerControl.GetFightPower(curPlayer) < helpIpyData.GetFightPowerMin():
|
| | | nextLineID = 0 #战力不足,则不可挑战下一关
|
| | |
|
| | |
|
| | |
| | | #判断战力是否满足本层要求
|
| | | helpIpyData = IpyGameDataPY.GetIpyGameData("FBHelpBattle", mapID, toLineID)
|
| | | if helpIpyData:
|
| | | if curPlayer.GetFightPower() < helpIpyData.GetFightPowerMin():
|
| | | if PlayerControl.GetFightPower(curPlayer) < helpIpyData.GetFightPowerMin():
|
| | | GameWorld.DebugLog("战力不足%s,无法挑战下一层!toLineID=%s" % (helpIpyData.GetFightPowerMin(), toLineID), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
| | | import PlayerActivity
|
| | | import PlayerBillboard
|
| | | import PlayerSuccess
|
| | | import GameObj
|
| | |
|
| | |
|
| | | g_runeTypeDict = {}
|
| | |
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | GameWorld.DebugLog("复活玩家...", curPlayer.GetPlayerID())
|
| | | ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_City, tick)
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | GameObj.SetHPFull(curPlayer)
|
| | | FBCommon.ClearFBNPC()
|
| | |
|
| | | gameFB = GameWorld.GetGameFB()
|
| | |
| | | import PlayerWeekParty
|
| | | import PlayerActLogin
|
| | | import EventReport
|
| | | import PlayerBossReborn
|
| | | import GameObj
|
| | |
|
| | | import random
|
| | | import math
|
| | | import PlayerBossReborn
|
| | |
|
| | | g_runeTypeDict = {}
|
| | | FBDict_Level = 'FBDict_Level' # 副本关卡
|
| | |
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | GameWorld.DebugLog("复活玩家...", curPlayer.GetPlayerID())
|
| | | ChPlayer.PlayerRebornByType(curPlayer, ChConfig.rebornType_City, tick)
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | GameObj.SetHPFull(curPlayer)
|
| | | FBCommon.ClearFBNPC()
|
| | |
|
| | | gameFB = GameWorld.GetGameFB()
|
| | |
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_XMZZ, 1)
|
| | | msgInfo = str([1]) # 是否刚开始
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, 'XMZZStartFight', msgInfo, len(msgInfo))
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | GameObj.SetHPFull(curPlayer)
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in range(0, skillManager.GetSkillCount()):
|
| | | curSkill = skillManager.GetSkillByIndex(i)
|
| | |
| | | import PyGameData
|
| | | import NPCCommon
|
| | | import FBCommon
|
| | | import GameObj
|
| | |
|
| | | import random
|
| | | import json
|
| | |
| | | GameWorld.Log("使用交通工具时,无法拾取物品!mapItemID=%s,dropItemNPCID=%s" % (mapItemID, dropItemNPCID), playerID)
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() == 0:
|
| | | if GameObj.GetHP(curPlayer) == 0:
|
| | | #玩家已经死亡
|
| | | GameWorld.Log("玩家已死亡,无法拾取物品!mapItemID=%s,dropItemNPCID=%s" % (mapItemID, dropItemNPCID), playerID)
|
| | | return
|
| | |
| | | # @return 布尔值
|
| | | # @remarks 检查使用物品的玩家属性.
|
| | | def CheckUseItemSelf_Player(curPlayer):
|
| | | if curPlayer.GetHP() <= 0 :
|
| | | if GameObj.GetHP(curPlayer) <= 0 :
|
| | | return False
|
| | |
|
| | | # #眩晕时, 不可使用物品
|
| | |
| | | # @return True or False 返回值为是否使用成功(外层通知特效)
|
| | | # @remarks 函数详细说明.
|
| | | def UseItem(curPlayer, curRoleItem, tick):
|
| | | if curPlayer.GetHP() <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curPlayer) <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | #死亡不回血
|
| | | return
|
| | |
|
| | |
| | | # @return 布尔值
|
| | | # @remarks 一次性回血物品逻辑处理
|
| | | def __DoLogic_AddHP_Once(curPlayer, curItem, effValueA, effValueB):
|
| | | curValue = curPlayer.GetHP()
|
| | | curMaxValue = curPlayer.GetMaxHP()
|
| | | setFunc = curPlayer.SetHP
|
| | | curValue = GameObj.GetHP(curPlayer)
|
| | | curMaxValue = GameObj.GetMaxHP(curPlayer)
|
| | | setFunc = "SetHP"
|
| | | sysMsgStr = 'GeRen_chenxin_21675'
|
| | |
|
| | | return __Add_HPorMP_Once(curPlayer, curItem, curValue, curMaxValue, setFunc, effValueA, effValueB, sysMsgStr)
|
| | |
| | | #回复效果 = 玩家当前生命(魔法) + 玩家最大生命(魔法)上限 * 效果A值 + 效果B值
|
| | | addTotalValue = int(curMaxValue * addPer / ChConfig.Def_MaxRateValue + addValue)
|
| | | #回复数值
|
| | | if setFunc == "SetHP":
|
| | | GameObj.SetHP(curPlayer, min(curMaxValue, curValue + addTotalValue))
|
| | | else:
|
| | | setFunc(min(curMaxValue, curValue + addTotalValue))
|
| | | #扣除物品
|
| | | ItemCommon.DelItem(curPlayer, curItem, 1, True)
|
| | |
| | | # @return 布尔值
|
| | | # @remarks 多次回血物品逻辑处理
|
| | | def __DoLogic_AddHP_More(curPlayer, curItem, effValueA):
|
| | | curValue = curPlayer.GetHP()
|
| | | curMaxValue = curPlayer.GetMaxHP()
|
| | | curValue = GameObj.GetHP(curPlayer)
|
| | | curMaxValue = GameObj.GetMaxHP(curPlayer)
|
| | | setFunc = curPlayer.SetHP
|
| | | sysMsgStr = 'GeRen_chenxin_21675'
|
| | |
|
| | |
| | | # PlayerControl.NotifyCode(curPlayer, "Pet_liubo_381601", [curRoleItem.GetItemTypeID()])
|
| | | # return False
|
| | | #
|
| | | # curValue = fightPetObj.GetHP()
|
| | | # curMaxValue = fightPetObj.GetMaxHP()
|
| | | # curValue = GameObj.GetHP(fightPetObj)
|
| | | # curMaxValue = GameObj.GetMaxHP(fightPetObj)
|
| | | # #已经满值
|
| | | # if curValue == curMaxValue:
|
| | | # PlayerControl.NotifyCode(curPlayer, "Pet_liubo_493922")
|
| | |
| | | import PetControl
|
| | | import ChConfig
|
| | | import ItemCommon
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "Pet_liubo_381601", [useItemID])
|
| | | return False
|
| | |
|
| | | fightPetHP = fightPet.GetHP()
|
| | | fightPetMaxHP = fightPet.GetMaxHP()
|
| | | fightPetHP = GameObj.GetHP(fightPet)
|
| | | fightPetMaxHP = GameObj.GetMaxHP(fightPet)
|
| | |
|
| | | if fightPetHP == fightPetMaxHP:
|
| | | PlayerControl.NotifyCode(curPlayer, "Pet_liubo_493922")
|
| | |
| | | # SetIsNeedProcess(False) 应该及时清理仇恨,回血可以不用即时
|
| | | curNPC.GetNPCAngry().Clear()
|
| | |
|
| | | # if curNPC.GetHP() != curNPC.GetMaxHP():
|
| | | # if GameObj.GetHP(curNPC) != GameObj.GetMaxHP(curNPC):
|
| | | # if curNPC.GetIsBoss() != ChConfig.Def_NPCType_Ogre_Normal:
|
| | | # return
|
| | | #
|
| | |
| | | curPlayer = GameWorld.GetObj(hurtObjID, IPY_GameWorld.gotPlayer)
|
| | |
|
| | | #无法查找玩家,或者已经死亡
|
| | | if curPlayer == None or curPlayer.GetHP() <= 0:
|
| | | if curPlayer == None or GameObj.GetHP(curPlayer) <= 0:
|
| | | continue
|
| | |
|
| | | if srcPlayer and curPlayer.GetID() == srcPlayer.GetID():
|
| | |
| | | continue
|
| | |
|
| | | #仇恨值
|
| | | curAngryValue = curAngry.GetAngryValue()
|
| | | curAngryValue = GameObj.GetAngryValue(curAngry)
|
| | | if curAngryValue == 0:
|
| | | continue
|
| | |
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 宠物空闲状态回血
|
| | | def RestoreHP(rolePet, tick):
|
| | | curHP = rolePet.GetHP()
|
| | | maxHP = rolePet.GetMaxHP()
|
| | | curHP = GameObj.GetHP(rolePet)
|
| | | maxHP = GameObj.GetMaxHP(rolePet)
|
| | |
|
| | | if curHP == maxHP:
|
| | | #满血了
|
| | |
| | | def ProcessAI(curNPC, tick):
|
| | | #切换镖车状态(在GameServer中切换)
|
| | | #===============================================================================
|
| | | # if curNPC.GetHP() <= 0 :
|
| | | # if GameObj.GetHP(curNPC) <= 0 :
|
| | | # GameWorld.Log("正常镖车AI -> 镖车切换状态:损坏")
|
| | | # return
|
| | | #===============================================================================
|
| | |
| | | PlayerTruck.AddTruckStateBuff(curNPC, tick)
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() <= 0 :
|
| | | if GameObj.GetHP(curPlayer) <= 0 :
|
| | | return
|
| | |
|
| | | #获得玩家和镖车间的距离
|
| | |
| | | GameObj.SetHP(curNPC, GameObj.GetHP(curNPC) - 1)
|
| | |
|
| | | #广播一次血量
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_HP()
|
| | |
|
| | | #死亡
|
| | | if GameObj.GetHP(curNPC) <= 0:
|
| | |
| | | def OnDie(curNPC, hurtType, hurtID):
|
| | |
|
| | | #死亡NPC不能攻击, 这里设置NPC血量为1
|
| | | curNPC.SetHP(1)
|
| | | GameObj.SetHP(curNPC, 1)
|
| | |
|
| | | #获得技能管理器
|
| | | skillManager = curNPC.GetSkillManager()
|
| | |
| | | # 动态刷新属性的,血量按百分比继承
|
| | | aftHP = int(aftMaxHP * befHP / befMaxHP)
|
| | | GameObj.SetHP(curNPC, aftHP)
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_MaxHPEx()
|
| | | curNPC.Notify_HP()
|
| | | curNPC.Notify_MaxHP()
|
| | | #GameWorld.DebugLog(" aftHP=%s,aftMaxHP=%s" % (aftHP, aftMaxHP))
|
| | |
|
| | | # 机器人复活初始化给技能
|
| | |
| | | attrStrengthenDict = attrStrengthenInfo[NPCAttr_AttrStrengthenList] # 属性成长公式字典
|
| | | playerCntCoefficient = attrStrengthenInfo[NPCAttr_PlayerCntCoefficient] # 人数系数
|
| | | npcIDPlayerCntCoefficient = attrStrengthenInfo[NPCAttr_NPCPlayerCntCoefficient] # 特殊NPC人数系数
|
| | | baseMaxHP = npcData.GetHPEx() * ShareDefine.Def_PerPointValue + npcData.GetHP()
|
| | | baseMaxHP = GameObj.GetHP(npcData) # NPCData 没有提供Max接口,对应使用GetHP
|
| | |
|
| | | if strengthenLV:
|
| | | if not strengthenIpyData:
|
| | |
| | | # continue
|
| | | #
|
| | | # angryObjType = curAngry.GetObjType()
|
| | | # angryObjValue = curAngry.GetAngryValue()
|
| | | # angryObjValue = GameObj.GetAngryValue(curAngry)
|
| | | #
|
| | | # #删除旧的仇恨,添加新的仇恨
|
| | | # if angryObjID == tagID and angryObjType == tagType:
|
| | |
| | | summonNPC.Reborn(summonPos.GetPosX(), summonPos.GetPosY(), False)
|
| | | NPCControl(summonNPC).ResetNPC_Init(isReborn=True)
|
| | | if hp or hpEx:
|
| | | summonNPC.SetHP(hp)
|
| | | summonNPC.SetHPEx(hpEx)
|
| | | summonNPC.SetMaxHP(hp)
|
| | | summonNPC.SetMaxHPEx(hpEx)
|
| | | hpTotal = hpEx * ShareDefine.Def_PerPointValue + hp
|
| | | GameObj.SetHP(summonNPC, hpTotal)
|
| | | GameObj.SetMaxHP(summonNPC, hpTotal)
|
| | | summonNPC.NotifyAppear() # 最终统一通知NPC出现
|
| | | playerPriWoodNPCList.append(summonNPC)
|
| | |
|
| | |
| | | npcAngry = curNPC.GetNPCAngry()
|
| | | angryValue = npcAngry.FindNPCAngry(seeObjID, seeObjType)
|
| | |
|
| | | if angryValue != None and angryValue.GetAngryValue() != 0 :
|
| | | if angryValue != None and GameObj.GetAngryValue(angryValue) != 0 :
|
| | | #该对象已经在仇恨列表中,不重复添加
|
| | | return False
|
| | |
|
| | |
| | | if curPlayer and curPlayer.GetTeamID() > 0:
|
| | | addAngryTeam = GameWorld.GetTeamManager().FindTeam(curPlayer.GetTeamID())
|
| | |
|
| | | #总血量有超过DWORD的情况
|
| | | plusAngryValue = FixValueByValueEx(curNPC.GetMaxHPEx(), plusAngryValue)
|
| | | |
| | | #最小添加仇恨值为1
|
| | | plusAngryValue = max(plusAngryValue , 1)
|
| | | npcAngry = curNPC.GetNPCAngry()
|
| | |
| | | angryValue = npcAngry.FindNPCAngry(curObjID, curObjType)
|
| | |
|
| | | #未发现,添加
|
| | | if angryValue == None or angryValue.GetAngryValue() == 0:
|
| | | npcAngry.AddAngry(curObjID, curObjType, plusAngryValue)
|
| | | if angryValue == None or GameObj.GetAngryValue(angryValue) == 0:
|
| | | npcAngry.AddAngry(curObjID, curObjType, plusAngryValue % ShareDefine.Def_PerPointValue, plusAngryValue / ShareDefine.Def_PerPointValue)
|
| | |
|
| | | #如果需要,叠加
|
| | | elif canPile:
|
| | | angryValue.SetAngryValue(min(angryValue.GetAngryValue() + plusAngryValue, ChConfig.Def_UpperLimit_DWord))
|
| | | updAngryValue = GameObj.GetAngryValue(angryValue) + plusAngryValue
|
| | | GameObj.SetAngryValue(angryValue, updAngryValue)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | return None
|
| | |
|
| | | #仇恨值
|
| | | curAngryValue = curAngry.GetAngryValue()
|
| | | curAngryValue = GameObj.GetAngryValue(curAngry)
|
| | |
|
| | | if curAngryValue == 0:
|
| | | return None
|
| | |
| | | self.RefreshNPCState(isReborn=isReborn)
|
| | | #通知血量, 复活的情况不通知血量,由NPC出现包通知
|
| | | if not isReborn:
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_HP()
|
| | |
|
| | | #这里不设置为慢速处理,因为NPC有可能未满血
|
| | | #改为在空闲回血,如果满血的时候设置为慢速处理
|
| | |
| | | self.RefreshNPCSpeed(allAttrList)
|
| | | #检查血量是否变化, 暂不做血量增加上限通知,仅属性上限支持;
|
| | | #客户端自己算血量上限
|
| | | # if curNPC.GetMaxHP() != curNPCMaxHP_Before:
|
| | | # if GameObj.GetMaxHP(curNPC) != curNPCMaxHP_Before:
|
| | | # curNPC.Notify_MaxHP()
|
| | |
|
| | | return
|
| | |
| | | GameWorld.DebugLog("设置助战机器人属性: objID=%s,fightPower=%s,maxHP=%s" % (curNPC.GetID(), fightPower, maxHP))
|
| | | GameObj.SetMaxHP(curNPC, maxHP)
|
| | | GameObj.SetHP(curNPC, maxHP)
|
| | | curNPC.Notify_HPEx()
|
| | | curNPC.Notify_MaxHPEx()
|
| | | curNPC.Notify_HP()
|
| | | curNPC.Notify_MaxHP()
|
| | | return
|
| | |
|
| | | # NPC移动速度特殊处理,只处理百分比不能处理固定值
|
| | |
| | | # for index in range(curNPC.GetAngryNPCCount()):
|
| | | # angryNPC = curNPC.GetAngryNPCByIndex(index)
|
| | | # #已经死亡
|
| | | # if angryNPC.GetHP() <= 0:
|
| | | # if GameObj.GetHP(angryNPC) <= 0:
|
| | | # continue
|
| | | #
|
| | | # angryNPCList.append(angryNPC)
|
| | |
| | | #===============================================================================
|
| | | # curNPC = self.__Instance
|
| | | #
|
| | | # if curNPC.GetHP() == curNPC.GetMaxHP():
|
| | | # if GameObj.GetHP(curNPC) == GameObj.GetMaxHP(curNPC):
|
| | | # #满血了
|
| | | # return
|
| | | #
|
| | |
| | | return hurtObjTuple
|
| | |
|
| | | #支持抢怪,个人杀死,但自己死亡,不算
|
| | | if curPlayer.GetHP() <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curPlayer) <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if isLog:
|
| | | GameWorld.Log("该目标伤血玩家已死亡: npcID=%s,playerID=%s" % (npcID, maxHurtObj.GetValueID()))
|
| | | return hurtObjTuple
|
| | |
| | | GameWorld.Log(" i=%s, 无该队员!" % (i))
|
| | | continue
|
| | |
|
| | | if curTeamPlayer.GetHP() <= 0 or curTeamPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curTeamPlayer) <= 0 or curTeamPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if isLog:
|
| | | GameWorld.Log(" i=%s, 队员已死亡!memPlayerID=%s" % (i, curTeamPlayer.GetPlayerID()))
|
| | | continue
|
| | |
| | | GameWorld.DebugLog("竞争归属玩家不可见,移除归属!playerID=%s" % ownerID)
|
| | | return
|
| | |
|
| | | if owner.GetHP() <= 0 or owner.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(owner) <= 0 or owner.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | GameWorld.DebugLog("竞争归属玩家死亡,移除归属!playerID=%s" % ownerID)
|
| | | return
|
| | |
|
| | |
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 队员为空!" % i)
|
| | | continue
|
| | | if curTeamPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTeamPlayer) <= 0:
|
| | | if isDead:
|
| | | GameWorld.Log(" i=%s, 队员血量为0!, memPlayerID=%s" % (i, curTeamPlayer.GetPlayerID()))
|
| | | continue
|
| | |
| | |
|
| | | callFunc(curNPC, curPlayer, skill)
|
| | | #---------------------------------------------------------------------
|
| | | # 目标总值超过DWORD记录,需修正数值
|
| | | # 如:伤血和仇恨超过20E的情况,按高位记录取余, 最低1
|
| | | def FixValueByValueEx(valueEx, value):
|
| | | if valueEx == 0:
|
| | | return value
|
| | | |
| | | # 取高位记录的数字长度,按10N次方求余
|
| | | nlen = len(str(valueEx))
|
| | | return max(value / pow(10, nlen), 1)
|
| | |
|
| | |
|
| | | def CheckCanCollectByNPCID(curPlayer, npcID, collectNPCIpyData):
|
| | | # 根据NPCID判断是否可以采集
|
| | |
| | | import NPCCommon
|
| | | import FBCommon
|
| | | import ChConfig
|
| | | import GameObj
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | GameWorld.DebugLog("伤血玩家不可见,不计!playerID=%s" % playerID, self.npcID, self.lineID)
|
| | | return False
|
| | |
|
| | | if player.GetHP() <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(player) <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | deadTime = player.NomalDictGetProperty(ChConfig.Def_Player_Dict_DeadTime)
|
| | | if time.time() - deadTime >= IpyGameDataPY.GetFuncCfg("BossHurtValue", 1):
|
| | | GameWorld.DebugLog("伤血玩家死亡超过伤血保护时长,不计!playerID=%s" % playerID, self.npcID, self.lineID)
|
| | |
| | | if player == None:
|
| | | continue
|
| | |
|
| | | if player.GetHP() <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(player) <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | playerDisableReason[playerID] = "dead"
|
| | | continue
|
| | |
|
| | |
| | | import PlayerTeam
|
| | | import NPCCommon
|
| | | import ChConfig
|
| | | import GameObj
|
| | |
|
| | |
|
| | | class HurtValueObj():
|
| | |
| | | if player == None:
|
| | | continue
|
| | |
|
| | | if player.GetHP() <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(player) <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | playerDisableReason[playerID] = "dead"
|
| | | continue
|
| | |
|
| | |
| | | import PlayerFB
|
| | | import SkillShell
|
| | | import PlayerYinji
|
| | | import GameObj
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | | Sync_DBPlayer(curPlayer)
|
| | |
|
| | | # 死亡复活
|
| | | if curPlayer.GetHP() <=0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curPlayer) <=0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | PlayerRebornByType(curPlayer, ChConfig.rebornType_System, tick)
|
| | |
|
| | | # 强刷一次属性,刷之前重置还没同步过所有属性
|
| | |
| | | dbPlayer.RebornPosY = curPlayer.GetRebornPosY()
|
| | | dbPlayer.State = curPlayer.GetState()
|
| | | dbPlayer.HP = curPlayer.GetHP()
|
| | | dbPlayer.HPEx = curPlayer.GetHPEx()
|
| | | dbPlayer.XP = curPlayer.GetXP()
|
| | | dbPlayer.HPRestoreSetting = curPlayer.GetHPRestoreSetting()
|
| | | dbPlayer.MPRestoreSetting = curPlayer.GetMPRestoreSetting()
|
| | |
| | | curPlayer.SetFacePic(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线
|
| | | tjgTime = PlayerTJG.GetTJGTime(curPlayer)
|
| | | if tjgTime:
|
| | | curPlayer.SendGameServerRefreshState(IPY_GameWorld.CDBPlayerRefresh_HappyPoint, tjgTime)
|
| | | PlayerControl.SendGameServerRefreshState(curPlayer, IPY_GameWorld.CDBPlayerRefresh_HappyPoint, tjgTime)
|
| | |
|
| | | PlayerControl.DoGMForbidenTalkOnLogin(curPlayer)
|
| | |
|
| | |
| | | # #刷新NPC状态/buff
|
| | | # summonControl.RefreshNPCState()
|
| | | # #因当前血量先刷,最大血量后刷,有可能当前血量大于最大血量
|
| | | # curSummon.SetHP(min(curSummon.GetHP() , curSummon.GetMaxHP()))
|
| | | # GameObj.SetHPFull(curSummon)
|
| | | #===========================================================================
|
| | |
|
| | | #初始化宠物 通知客户端
|
| | |
| | | curPlayer.SetVisible(True)
|
| | |
|
| | | #如果玩家hp为0,设置玩家为死亡状态
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | curPlayer.SetPlayerAction(IPY_GameWorld.paDie)
|
| | | #curPlayer.SetDead()
|
| | |
|
| | |
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_IsReBorn, 0)
|
| | |
|
| | | if curPlayer.GetHP() <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curPlayer) <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | #如果玩家上线后死亡,回程复活
|
| | | isLogin = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_LoadMapIsLogin)
|
| | | rebornType = ChConfig.rebornType_City if isLogin else ChConfig.rebornType_System
|
| | |
| | | #无法验证目标
|
| | | #===========================================================================
|
| | | # curTag = GameWorld.GetObj(clientData.ObjID, IPY_GameWorld.gotNPC)
|
| | | # if not curTag or curTag.GetHP() ==0:
|
| | | # if not curTag or GameObj.GetHP(curTag) ==0:
|
| | | # return
|
| | | #
|
| | | # #与目标相差太远
|
| | |
| | | return False
|
| | |
|
| | | #玩家已经死亡
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return False
|
| | |
|
| | | # #眩晕时,不可移动 zhengyang 2010-6-2
|
| | |
| | | # curObj = mapObj.GetObjByIndex(i)
|
| | | # #只有一种情况特殊:死亡的NPC可以让玩家走过去
|
| | | # if curObj.GetGameObjType() == IPY_GameWorld.gotNPC and \
|
| | | # curObj.GetHP() <= 0 :
|
| | | # GameObj.GetHP(curObj) <= 0 :
|
| | | # continue
|
| | | # curPlayer.MoveFail()
|
| | | # GameWorld.Log("移动失败,目标点有玩家或者NPC")
|
| | |
| | | # #获取玩家详细信息成功
|
| | | # if canGetDetail:
|
| | | # extendDataDict = {}
|
| | | # extendDataDict['maxHP'] = tagObj.GetMaxHP()
|
| | | # extendDataDict['maxHP'] = GameObj.GetMaxHP(tagObj)
|
| | | # extendDataDict['maxMP'] = tagObj.GetMaxMP()
|
| | | # extendDataDict['hit'] = tagObj.GetHit()
|
| | | # extendDataDict['miss'] = tagObj.GetMiss()
|
| | |
| | | #功能开启判断换成
|
| | | #GameFuncComm.GetFuncCanUse(curPlayer, funcID)
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | | sendPack = IPY_GameWorld.IPY_CSit()
|
| | | setType = sendPack.GetType()
|
| | |
| | | return
|
| | | curPlayer.SetHPRestoreSetting(curValue)
|
| | | #玩家活着的时候调用
|
| | | if curPlayer.GetHP() > 0 :
|
| | | if GameObj.GetHP(curPlayer) > 0 :
|
| | | #调用自动回血
|
| | | PlayerControl.PlayerAutoRestoreHP(curPlayer, tick)
|
| | | return
|
| | |
| | | curPlayer.SetMPRestoreSetting(curValue)
|
| | |
|
| | | #玩家活着的时候调用
|
| | | if curPlayer.GetHP() > 0 :
|
| | | if GameObj.GetHP(curPlayer) > 0 :
|
| | | #调用自动回魔
|
| | | PlayerControl.PlayerAutoRestoreMP(curPlayer, tick)
|
| | |
|
| | |
| | | #游戏事件 Type = TGameEvent
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | |
|
| | | if curPlayer.GetHP() == 0:
|
| | | if GameObj.GetHP(curPlayer) == 0:
|
| | | #GameWorld.Log("玩家死亡,没有事件")
|
| | | return
|
| | |
|
| | |
| | | if tick - curPlayer.GetShowFaceTick() < ChConfig.Def_ShowEventTime:
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | |
|
| | | #表情行为, 客户端限制
|
| | |
| | | #GameWorld.Log("玩家地图读取没有成功")
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() == 0:
|
| | | if GameObj.GetHP(curPlayer) == 0:
|
| | | #玩家已经死亡
|
| | | #GameWorld.Log("玩家停止移动,玩家已经死亡")
|
| | | return
|
| | |
| | | # #找到这个召唤兽
|
| | | # summonNPC = curPlayer.FindSummonByID(summonID)
|
| | | # #无法查找到这个召唤兽
|
| | | # if summonNPC == None or summonNPC.GetHP() <= 0:
|
| | | # if summonNPC == None or GameObj.GetHP(summonNPC) <= 0:
|
| | | # GameWorld.Log('无法查找到这个召唤兽 summonID=%d'%summonID)
|
| | | # return
|
| | | #
|
| | |
| | | # #找到这个召唤兽
|
| | | # summonNPC = curPlayer.FindSummonByID(summonID)
|
| | | # #无法查找到这个召唤兽
|
| | | # if summonNPC == None or summonNPC.GetHP() <= 0:
|
| | | # if summonNPC == None or GameObj.GetHP(summonNPC) <= 0:
|
| | | # GameWorld.Log('找不到召唤兽')
|
| | | # return
|
| | | #
|
| | |
| | | # summonNPC = curPlayer.FindSummonByID(summonID)
|
| | | #
|
| | | # #无法查找到这个召唤兽
|
| | | # if summonNPC == None or summonNPC.GetHP() <= 0:
|
| | | # if summonNPC == None or GameObj.GetHP(summonNPC) <= 0:
|
| | | # return
|
| | | #
|
| | | # if ChConfig.Def_ClientControlSummonNPCID.count(summonNPC.GetFunctionType()) == 0:
|
| | |
| | | '''
|
| | |
|
| | | # 非死亡状态下,也就是哪个服务器角色死亡由哪个服务器判断
|
| | | if curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | if GameObj.GetHP(curPlayer) > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | return 0
|
| | |
|
| | | # 回城复活的才需要CD
|
| | |
| | | 本函数不验证玩家死亡状态等,因为有可能前后端复活状态不一致,如果这里拦住可能导致前端躺尸复活不了
|
| | | '''
|
| | |
|
| | | if checkHPState and curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | if checkHPState and GameObj.GetHP(curPlayer) > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | # 当血量大于0收到复活请求时,一般是前后端复活状态不一致的情况下导致的
|
| | | # 由于前端需要根据复活状态判断复活界面相关逻辑,所以这里需要做一些特殊处理,防止某些情况下前后端复活状态不一致导致的一些异常问题
|
| | | # 后端非死亡状态的情况,补同步一次复活包给前端
|
| | |
| | | playerControl.RefreshAllState()
|
| | |
|
| | | #设置血量
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP() * resetHpPercent / ChConfig.Def_MaxRateValue)
|
| | | GameObj.SetHP(curPlayer, GameObj.GetMaxHP(curPlayer) * resetHpPercent / ChConfig.Def_MaxRateValue)
|
| | | #curPlayer.SetMP(curPlayer.GetMaxMP() * resetMpPercent / ChConfig.Def_MaxRateValue)
|
| | | #护盾
|
| | | PlayerControl.SetProDef(curPlayer, PlayerControl.GetMaxProDef(curPlayer))
|
| | |
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD LostHP;
|
| | | # DWORD LostHPEx;
|
| | | #};
|
| | | def OnRoleLostHP(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | lostHP = clientData.LostHP
|
| | | curHP = curPlayer.GetHP()
|
| | | lostHP = clientData.LostHP + clientData.LostHPEx * ShareDefine.Def_PerPointValue
|
| | | curHP = GameObj.GetHP(curPlayer)
|
| | | updHP = curHP - lostHP
|
| | | if updHP <= 0:
|
| | | #玩家已经死亡
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.SetDead()
|
| | | else:
|
| | | curPlayer.SetHP(updHP)
|
| | | GameObj.SetHP(curPlayer, updHP)
|
| | |
|
| | | return
|
| | |
| | | petControl.RefreshNPCState(canSyncClient)
|
| | |
|
| | | #加一个防御措施, 如果宠物血为0, 不可召唤出来, 默认为宠物召回时候的血量
|
| | | if rolePet.GetHP() <= 0:
|
| | | PetDead_ReStoreHP(rolePet, rolePet.GetMaxHP())
|
| | | if GameObj.GetHP(rolePet) <= 0:
|
| | | PetDead_ReStoreHP(rolePet, GameObj.GetMaxHP(rolePet))
|
| | | GameWorld.ErrLog('宠物重生血量为0, PetID = %s' % (rolePet.GetRolePet().PetID))
|
| | |
|
| | | return
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 设置宠物HP
|
| | | def SetPetHP(rolePet, value, canSyncClient=True):
|
| | | rolePet.SetHP(value)
|
| | | GameObj.SetHP(rolePet, value, canSyncClient)
|
| | |
|
| | | if not canSyncClient:
|
| | | return
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 加宠物HP
|
| | | def AddPetHP(rolePet, value):
|
| | | remainValue = min(rolePet.GetHP() + value, rolePet.GetMaxHP())
|
| | | remainValue = min(GameObj.GetHP(rolePet) + value, GameObj.GetMaxHP(rolePet))
|
| | | SetPetHP(rolePet, remainValue)
|
| | | return
|
| | |
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "AvoidSink09")
|
| | | return False
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | #死亡状态无法出战宠物
|
| | | return False
|
| | |
|
| | |
| | | PlayerControl.NotifyCode(curPlayer , "Play_Attack_Null")
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | #玩家已经死亡
|
| | | #GameWorld.Log("玩家普通攻击失败,玩家已经死亡")
|
| | | return
|
| | |
| | | def UpdatePlayerFPTotalBillboard(curPlayer, isForceUpdate=False, isCheckRule=True):
|
| | | ##更新玩家总战斗力
|
| | |
|
| | | playerFightPower = curPlayer.GetFightPower()
|
| | | if not __CheckFightPowerCanUpdate(curPlayer, ChConfig.Def_PDict_FightPower_Total, playerFightPower, isForceUpdate, isCheckRule):
|
| | | playerFightPower = PlayerControl.GetFightPower(curPlayer)
|
| | | if not __CheckFightPowerCanUpdate(curPlayer, ChConfig.Def_PDict_FightPower_Total, playerFightPower, |
| | | isForceUpdate, isCheckRule, ChConfig.Def_PDict_FightPower_TotalEx):
|
| | | return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Total, playerFightPower,
|
| | | fightPower = playerFightPower % ChConfig.Def_PerPointValue
|
| | | fightPowerEx = playerFightPower / ChConfig.Def_PerPointValue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Total, fightPower,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_TotalEx, fightPowerEx,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | familyID = curPlayer.GetFamilyID()
|
| | | GameWorld.DebugLog("更新总战斗力:playerFightPower=%s" % (playerFightPower), curPlayer.GetPlayerID())
|
| | |
|
| | | UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FightPower, playerFightPower, exInfo=[familyID])
|
| | | UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FightPower, fightPowerEx, fightPower, exInfo=[familyID])
|
| | | EventReport.WriteEvent_FightPower(curPlayer)
|
| | | return
|
| | |
|
| | | def __CheckFightPowerCanUpdate(curPlayer, key, fightPower, isForceUpdate=False, isCheckRule=True):
|
| | | def __CheckFightPowerCanUpdate(curPlayer, key, fightPower, isForceUpdate=False, isCheckRule=True, key2=None):
|
| | | ''' 检查玩家可否更新战斗力
|
| | | @param curPlayer 玩家实例
|
| | | @param key 战斗力类型对应key
|
| | |
| | | return False
|
| | |
|
| | | historyFightPower = curPlayer.NomalDictGetProperty(key, 0, ChConfig.Def_PDictType_FightPower)
|
| | | if key2 != None:
|
| | | historyFightPower += curPlayer.NomalDictGetProperty(key2, 0, ChConfig.Def_PDictType_FightPower) * ChConfig.Def_PerPointValue
|
| | |
|
| | | if not __CanPlayerBillboardComm(curPlayer):
|
| | | return False
|
| | |
| | | import GY_Query_CrossRealmReg
|
| | | import PlayerCrossRealmPK
|
| | | import FunctionNPCCommon
|
| | | import IPY_PlayerDefine
|
| | | import CrossRealmPlayer
|
| | | import CrossPlayerData
|
| | | import NPCHurtManager
|
| | |
| | | # @remarks 检查玩家状态是否可以传送
|
| | | def CheckPlayerTransport(curPlayer):
|
| | | #死亡不可使用
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return False
|
| | |
|
| | | # if curPlayer.GetPKValue() > 0:
|
| | |
| | | # 从副本中切图
|
| | | if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | | #默认回满血
|
| | | if curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie and curPlayer.GetHP() < curPlayer.GetMaxHP():
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | if GameObj.GetHP(curPlayer) > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie and GameObj.GetHP(curPlayer) < GameObj.GetMaxHP(curPlayer):
|
| | | GameObj.SetHPFull(curPlayer)
|
| | |
|
| | | #2. 调用切换地图接口
|
| | | curPlayer.DoResetWorldPosAndClear()
|
| | |
| | | # #如果玩家是死亡状态,则先复活,手游策划不想复活退出
|
| | | # if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | # curPlayer.Reborn(ChConfig.rebornType_System)
|
| | | # curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | # GameObj.SetHPFull(curPlayer)
|
| | | # ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
|
| | | #===============================================================================================
|
| | |
|
| | |
| | | NotifyCode(curPlayer, "CrossMatching18")
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | NotifyCode(curPlayer, "CrossMap4")
|
| | | return
|
| | |
|
| | |
| | | if ret != ShareDefine.EntFBAskRet_OK:
|
| | | return ret
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | GameWorld.Log("玩家已经死亡, 无法进入副本!")
|
| | | return ShareDefine.EntFBAskRet_Dead
|
| | |
|
| | |
| | | # @remarks 玩家切换地图
|
| | | def PlayerResetWorldPos(curPlayer, mapID, posX, posY, takeTruck, lineID=-1, msg='', canLock=True, exData1=0):
|
| | | #更改: 死亡允许切换地图, 在副本中被怪打死, 副本时间到, 回收副本
|
| | | # if curPlayer.GetHP() <= 0 :
|
| | | # if GameObj.GetHP(curPlayer) <= 0 :
|
| | | # GameWorld.Log("死亡无法切换地图")
|
| | | # return
|
| | |
|
| | |
| | | # GameWorld.Log(" i=%s,成员不存在!" % (i))
|
| | | continue
|
| | |
|
| | | if curTeamPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTeamPlayer) <= 0:
|
| | | #if isLog:
|
| | | # GameWorld.Log(" i=%s,成员血量为0!playerID=%s" % (i, curTeamPlayer.GetPlayerID()))
|
| | | continue
|
| | |
| | | return
|
| | | if value < 0:
|
| | | value = GetPlayerCurrency(curPlayer, currencyType)
|
| | | curPlayer.SendPropertyRefresh(refreshType, value, False)
|
| | | SendPropertyRefresh(curPlayer, refreshType, value)
|
| | | return
|
| | |
|
| | | # 通知玩家所有自定义货币
|
| | |
| | | continue
|
| | |
|
| | | #此处根据需求若Value为0 可不通知客户端,具体功能制作者决定
|
| | | value = GetPlayerCurrency(curPlayer, currencyType)
|
| | | notifyStruct = ChPyNetSendPack.tagRefreshType()
|
| | | notifyStruct.RefreshType = refreshType
|
| | | notifyStruct.Value = GetPlayerCurrency(curPlayer, currencyType)
|
| | | notifyStruct.Value = value
|
| | | notifyList.append(notifyStruct)
|
| | |
|
| | | #属性组合包 通知自己
|
| | |
| | | def PlayerLvUp(self, handLvUp=False):
|
| | | curPlayer = self.__Player
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | #玩家死亡不可升级
|
| | | return
|
| | |
|
| | |
| | | #放在功能开启后面
|
| | | PlayerWorldAverageLv.UpdatePlayerWorldAverageLv(curPlayer)
|
| | | #将血设置为最大
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | GameObj.SetHPFull(curPlayer)
|
| | | if curPlayer.GetMaxMP() > 0:
|
| | | curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | |
|
| | |
| | | continue
|
| | | notifyStruct = ChPyNetSendPack.tagRefreshType()
|
| | | notifyStruct.RefreshType = attrType
|
| | | if attrType in [IPY_PlayerDefine.CDBPlayerRefresh_HP, IPY_PlayerDefine.CDBPlayerRefresh_MaxHP]:
|
| | | notifyStruct.Value = curPlayerState % ShareDefine.Def_PerPointValue
|
| | | notifyStruct.ValueEx = curPlayerState / ShareDefine.Def_PerPointValue
|
| | | else:
|
| | | notifyStruct.Value = curPlayerState
|
| | | if notifySelf:
|
| | | notifySelfList.append(notifyStruct)
|
| | |
| | | return
|
| | |
|
| | | GameWorld.DebugLog("Start RefreshPlayerAttrByBuffEx!!!")
|
| | | beforeMaxHP = curPlayer.GetMaxHP()
|
| | | beforeMaxHP = GameObj.GetMaxHP(curPlayer)
|
| | | beforeMoveSpeedValue = GetSpeedValue(curPlayer)
|
| | | #构建玩家刷新通知客户端字典, 缓存[索引, 数值]
|
| | | playerStateDict = {}
|
| | |
| | | GameWorld.DebugLog("Start RefreshPlayerAttrStateEx!!!")
|
| | |
|
| | | #beforeAtkInterval = curPlayer.GetAtkInterval()
|
| | | beforeMaxHP = curPlayer.GetMaxHP()
|
| | | beforeMaxHP = GameObj.GetMaxHP(curPlayer)
|
| | | beforeMoveSpeedValue = GetSpeedValue(curPlayer)
|
| | | beforeMaxProDef = GetMaxProDef(curPlayer)
|
| | | #[金木水火土]
|
| | |
| | | mfpSkill = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPSkill % mfpObj.mfpType)
|
| | | mfpEx = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPEx % mfpObj.mfpType)
|
| | | mfpTotal = mfpValue + mfpSkill + mfpEx
|
| | | mfpDict[mfpObj.mfpType] = mfpTotal
|
| | | mfpDict[mfpObj.mfpType] = min(mfpTotal, ChConfig.Def_UpperLimit_DWord)
|
| | |
|
| | | if mfpType == ShareDefine.Def_MFPType_Plus:
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Plus, mfpTotal)
|
| | |
| | | curPlayer = self.__Player
|
| | | if GetProDefHPPer(curPlayer) == 0:
|
| | | return
|
| | | maxHP = curPlayer.GetMaxHP()
|
| | | maxHP = GameObj.GetMaxHP(curPlayer)
|
| | | proDefPer = GetProDefHPPer(curPlayer)
|
| | |
|
| | | #获取策划配置的表格
|
| | | GodWeapon4 = IpyGameDataPY.GetFuncCfg("GodWeapon4", 2)
|
| | | maxProDef = eval(FormulaControl.GetCompileFormula("GodWeapon4", GodWeapon4))
|
| | | maxProDef = min(maxProDef, ChConfig.Def_UpperLimit_DWord)
|
| | |
|
| | | SetMaxProDef(curPlayer, int(maxProDef))
|
| | |
|
| | |
| | | '''
|
| | | curPlayer = self.__Player
|
| | | #------------------------------计算完毕--------------------------------
|
| | | afterMaxHP = curPlayer.GetMaxHP()
|
| | | afterMaxHP = GameObj.GetMaxHP(curPlayer)
|
| | | addMaxHP = max(0, afterMaxHP - beforeMaxHP)
|
| | | if beforeMaxHP > 0 and addMaxHP > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | # 最大血量增加时,同步增加等量的当前血量 (死亡状态下不刷当前血量)
|
| | | curPlayer.SetHP(min(curPlayer.GetHP() + addMaxHP, afterMaxHP))
|
| | | |
| | | GameObj.SetHP(curPlayer, min(GameObj.GetHP(curPlayer) + addMaxHP, afterMaxHP))
|
| | | #self.PrintAttr(curPlayer, "最终的")
|
| | | curPlayer.EndRefreshState() # 统一在刷属性结束逻辑中调用
|
| | | #---------------------------------------------------------------------
|
| | |
| | | mfpDataList.append(mfpData)
|
| | | totalFightPower += fightPower # 累加总战斗力
|
| | |
|
| | | if totalFightPower > ShareDefine.Def_UpperLimit_DWord:
|
| | | GameWorld.ErrLog("总战力超过数值上限!totalFightPower=%s" % totalFightPower, curPlayer.GetPlayerID())
|
| | | totalFightPower = ShareDefine.Def_UpperLimit_DWord
|
| | | |
| | | # //A3 A1 各功能模块战斗力信息 #tagMCModuleFightPowerInfo
|
| | | mfpInfo = ChPyNetSendPack.tagMCModuleFightPowerInfo()
|
| | | mfpInfo.Clear()
|
| | |
|
| | | mfpInfo.TotalFightPower = totalFightPower
|
| | | mfpInfo.TotalFightPower = totalFightPower % ChConfig.Def_PerPointValue
|
| | | mfpInfo.TotalFightPoweEx = totalFightPower / ChConfig.Def_PerPointValue
|
| | | mfpInfo.MFPCnt = len(mfpDataList)
|
| | | mfpInfo.MFPList = mfpDataList
|
| | | NetPackCommon.SendFakePack(curPlayer, mfpInfo)
|
| | | beforeFightPower = curPlayer.GetFightPower()
|
| | | curPlayer.SetFightPower(totalFightPower, False)
|
| | | beforeFightPower = GetFightPower(curPlayer)
|
| | | SetFightPower(curPlayer, totalFightPower)
|
| | | if totalFightPower < beforeFightPower:
|
| | | DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | highestFightPower = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_Highest, 0,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | highestFightPower += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_HighestEx, 0, |
| | | ChConfig.Def_PDictType_FightPower) * ChConfig.Def_PerPointValue
|
| | | if totalFightPower > highestFightPower:
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Highest, totalFightPower,
|
| | | highestFightPower = totalFightPower
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Highest, highestFightPower % ChConfig.Def_PerPointValue,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_HighestEx, highestFightPower / ChConfig.Def_PerPointValue,
|
| | | ChConfig.Def_PDictType_FightPower)
|
| | | GameWorld.DebugLog("总战力: %s, 历史最高战力: %s, beforeFightPower=%s" % (totalFightPower, highestFightPower, beforeFightPower))
|
| | | PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer)
|
| | | # 记录开服活动数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_FightPower, totalFightPower)
|
| | | # 记录开服活动数据,开服活动前X天理论上不会超过20E,暂不处理
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_FightPower, min(totalFightPower, ChConfig.Def_UpperLimit_DWord))
|
| | | if beforeFightPower != totalFightPower:
|
| | | CrossPlayerData.OnPlayerFightPowerChange(curPlayer)
|
| | | return
|
| | |
| | | #玩家未初始化成功, 不修正血量和魔法值, 因此时有可能因为某些影响主角的物品未初始化完毕(如宠物装备)
|
| | | return
|
| | |
|
| | | curPlayerHP = curPlayer.GetHP()
|
| | | curPlayerMaxHP = curPlayer.GetMaxHP()
|
| | | curPlayerHP = GameObj.GetHP(curPlayer)
|
| | | curPlayerMaxHP = GameObj.GetMaxHP(curPlayer)
|
| | | #=======================================================================
|
| | | # curPlayerMP = curPlayer.GetMP()
|
| | | # curPlayerMaxMP = curPlayer.GetMaxMP()
|
| | | #=======================================================================
|
| | |
|
| | | if curPlayerHP > curPlayerMaxHP:
|
| | | curPlayer.SetHP(curPlayerMaxHP)
|
| | | GameObj.SetHPFull(curPlayer)
|
| | |
|
| | | #=======================================================================
|
| | | # if curPlayerMP > curPlayerMaxMP:
|
| | |
| | | # self.RefreshAllState()
|
| | | #===============================================================================
|
| | |
|
| | | if curPlayer.GetHP() != 0:
|
| | | curPlayer.SetHP(0)
|
| | | if GameObj.GetHP(curPlayer) != 0:
|
| | | GameObj.SetHP(curPlayer, 0)
|
| | |
|
| | | #清空移动错误距离
|
| | | GameWorld.ClearPlayerPosCount(curPlayer)
|
| | |
| | | # 同步前端及GameServer需要自己写通知,设置函数自身不带通知参数
|
| | | #
|
| | | # 发送0418包
|
| | | # SendPropertyRefresh(int inputType, int inputValue, bool boardCast, bool includeSelf = true)
|
| | | # SendPropertyRefresh(int inputType, int inputValue, int inputValueEx, bool boardCast, bool includeSelf = true)
|
| | | # @param : boardCast-是否广播周围玩家;includeSelf-是否包含自己
|
| | | #
|
| | | # ֪ͨGsmeServer;
|
| | | # SendGameServerRefreshState(int inputType, int inputValue)
|
| | | # SendGameServerRefreshState(int inputType, int inputValue, int inputValueEx)
|
| | |
|
| | | def SendPropertyRefresh(curPlayer, inputType, value, boardCast=False):
|
| | | ''' 发送0418包
|
| | | @param boardCast: 是否广播周围玩家,一定会发给自己
|
| | | '''
|
| | | curPlayer.SendPropertyRefresh(inputType, value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue, boardCast)
|
| | | return
|
| | |
|
| | | def SendGameServerRefreshState(curPlayer, inputType, value):
|
| | | ## 同步属性到GameServer IPY_GRefreshPlayerProperty
|
| | | curPlayer.SendGameServerRefreshState(inputType, value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | # 禁言 通知gameServer
|
| | | def SetGMForbidenTalk(curPlayer, value):
|
| | |
| | |
|
| | | def __SetGMForbidenTalkValue(curPlayer, value):
|
| | | curPlayer.SetGMForbidenTalk(value)
|
| | | curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value, False)
|
| | | SendGameServerRefreshState(curPlayer, ShareDefine.CDBPlayerRefresh_ForbidenTalk, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ForbidenTalk, value)
|
| | | GameWorld.DebugLog("__SetGMForbidenTalkValue %s" % value, curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | def SetPlayerAccState(curPlayer, accState):
|
| | | curPlayer.SetAccState(accState)
|
| | | curPlayer.SetExAttr17(accState) # 同步设置该值 0309 封包登录时需要用到
|
| | | curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ExAttr17, accState)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ExAttr17, accState, False)
|
| | | SendGameServerRefreshState(curPlayer, ShareDefine.CDBPlayerRefresh_ExAttr17, accState)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ExAttr17, accState)
|
| | | GameWorld.DebugLog("SetPlayerAccState %s" % (accState), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
| | | GameWorld.Log("上线时角色为被禁言状态!", curPlayer.GetPlayerID())
|
| | | __SetGMForbidenTalkValue(curPlayer, 1)
|
| | | else:
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0)
|
| | | return
|
| | |
|
| | | ## 协助目标玩家ID
|
| | |
| | | def GetPrestige(curPlayer): return 0
|
| | | def SetPrestige(curPlayer, value): return
|
| | |
|
| | | ## 设置模块战斗力
|
| | | ##总战斗力,支持超过20E
|
| | | def GetFightPower(curPlayer): return curPlayer.GetFightPowerEx() * ChConfig.Def_PerPointValue + curPlayer.GetFightPower()
|
| | | def SetFightPower(curPlayer, value):
|
| | | curPlayer.SetFightPower(value % ChConfig.Def_PerPointValue, value / ChConfig.Def_PerPointValue, False) # 不通知GameServer bNotifyGameServer False
|
| | | return
|
| | |
|
| | | ## 设置模块战斗力,最大20E
|
| | | def SetMFPFightPower(curPlayer, mfpType, fightPower):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPFightPower % mfpType, fightPower)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPFightPower % mfpType, min(fightPower, ChConfig.Def_UpperLimit_DWord))
|
| | | return
|
| | |
|
| | | ## 获取模块战斗力
|
| | |
| | | def GetSpeedValue(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SpeedValue)
|
| | | def SetSpeedValue(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SpeedValue, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_SpeedValue, value, True) # 移动速度值暂定广播周围玩家
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SpeedValue, value, True) # 移动速度值暂定广播周围玩家
|
| | |
|
| | | ##获取玩家攻击速度,用于计算攻击间隔
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | def GetNPCHurtAddPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_NPCHurtAddPer)
|
| | | def SetNPCHurtAddPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_NPCHurtAddPer, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_NPCHurtAddPer, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_NPCHurtAddPer, value)
|
| | |
|
| | | #---职业伤害加成---
|
| | | ## 目标战士伤害加成
|
| | |
| | | def GetLuckyHitReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_LuckyHitReduce)
|
| | | def SetLuckyHitReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_LuckyHitReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_LuckyHitReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_LuckyHitReduce, value)
|
| | |
|
| | | ## 卓越一击伤害减免
|
| | | def GetGreatHitReducePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_GreatHitReducePer)
|
| | |
| | | def GetSuperHitReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SuperHitReduce)
|
| | | def SetSuperHitReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SuperHitReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_SuperHitReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SuperHitReduce, value)
|
| | | ## 无视防御伤害减免
|
| | | def GetIgnoreDefReducePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IgnoreDefReducePer)
|
| | | def SetIgnoreDefReducePer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_IgnoreDefReducePer, value)
|
| | |
| | | def GetLuckyHitRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_LuckyHitRateReduce)
|
| | | def SetLuckyHitRateReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_LuckyHitRateReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_LuckyHitRateReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_LuckyHitRateReduce, value)
|
| | | ## 抗卓越一击概率
|
| | | def GetGreatHitRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_GreatHitRateReduce)
|
| | | def SetGreatHitRateReduce(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_GreatHitRateReduce, value)
|
| | |
| | | def GetSuperHitRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SuperHitRateReduce)
|
| | | def SetSuperHitRateReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SuperHitRateReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_SuperHitRateReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SuperHitRateReduce, value)
|
| | | ## 抗无视防御概率
|
| | | def GetIgnoreDefRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IgnoreDefRateReduce)
|
| | | def SetIgnoreDefRateReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_IgnoreDefRateReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_IgnoreDefRateReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_IgnoreDefRateReduce, value)
|
| | |
|
| | | #---特殊伤害概率---
|
| | | ## 富豪一击概率
|
| | |
| | | def GetBleedDamage(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_BleedDamage)
|
| | | def SetBleedDamage(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_BleedDamage, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_BleedDamage, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BleedDamage, value)
|
| | |
|
| | | ## 最终伤害百分比
|
| | | def GetFinalHurtPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtPer)
|
| | | def SetFinalHurtPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurtPer, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FinalHurtPer, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurtPer, value)
|
| | |
|
| | | ## 最终伤害减免百分比
|
| | | def GetFinalHurtReducePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtReducePer)
|
| | | def SetFinalHurtReducePer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurtReducePer, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FinalHurtReducePer, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurtReducePer, value)
|
| | |
|
| | | ## 最终固定伤害增加
|
| | | def GetFinalHurt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurt)
|
| | | def SetFinalHurt(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurt, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FinalHurt, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurt, value)
|
| | | ## 最终固定伤害减少
|
| | | def GetFinalHurtReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtReduce)
|
| | | def SetFinalHurtReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurtReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FinalHurtReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurtReduce, value)
|
| | | ## 对指定boss伤害加成固定值
|
| | | def GetBossIDHurt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_BossIDHurt)
|
| | | def SetBossIDHurt(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_BossIDHurt, value)
|
| | |
| | | def GetOnlyFinalHurt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_OnlyFinalHurt)
|
| | | def SetOnlyFinalHurt(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_OnlyFinalHurt, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_OnlyFinalHurt, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_OnlyFinalHurt, value)
|
| | | return
|
| | |
|
| | | # PVP攻击回血
|
| | |
| | | def GetFaintRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintRate)
|
| | | def SetFaintRate(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrFaintRate, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FaintRate, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FaintRate, value)
|
| | | #---击晕抵抗----
|
| | | def GetFaintDefRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintDefRate)
|
| | | def SetFaintDefRate(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrFaintDefRate, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_FaintDefRate, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FaintDefRate, value)
|
| | |
|
| | | #---触发定身----
|
| | | def GetAtkerFreezed(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrAtkerFreezed)
|
| | |
| | | def GetComboRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrComboRate)
|
| | | def SetComboRate(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrComboRate, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ComboRate, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ComboRate, value)
|
| | | #---连击伤害----
|
| | | def GetComboDamPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrComboDamPer)
|
| | | def SetComboDamPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrComboDamPer, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ComboDamPer, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ComboDamPer, value)
|
| | |
|
| | | #---技能攻击比例减少----
|
| | | def GetSkillAtkRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SkillAtkRateReduce)
|
| | | def SetSkillAtkRateReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SkillAtkRateReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_SkillAtkRateReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SkillAtkRateReduce, value)
|
| | | #---PVP固定伤害----
|
| | | def GetDamagePVP(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrDamagePVP)
|
| | | def SetDamagePVP(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDamagePVP, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DamagePVP, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_DamagePVP, value)
|
| | | #---PVP固定伤害减少----
|
| | | def GetDamagePVPReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrDamagePVPReduce)
|
| | | def SetDamagePVPReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDamagePVPReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DamagePVPReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_DamagePVPReduce, value)
|
| | | #---伤害输出固定值计算对NPC附加----
|
| | | def GetDamagePVE(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrDamagePVE)
|
| | | def SetDamagePVE(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDamagePVE, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DamagePVE, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_DamagePVE, value)
|
| | |
|
| | | #---伤害输出计算百分比对玩家附加----
|
| | | def GetDamagePerPVP(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrDamagePerPVP)
|
| | | def SetDamagePerPVP(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDamagePerPVP, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DamagePerPVP, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_DamagePerPVP, value)
|
| | | def GetDamagePerPVPReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrDamagePerPVPReduce)
|
| | | def SetDamagePerPVPReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDamagePerPVPReduce, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DamagePerPVPReduce, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_DamagePerPVPReduce, value)
|
| | |
|
| | | #---受伤计算百分比----
|
| | | def GetHurtPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrHurtPer)
|
| | |
| | | def GetDamChanceDef(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrDamChanceDef)
|
| | | def SetDamChanceDef(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDamChanceDef, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_DamChanceDef, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_DamChanceDef, value)
|
| | |
|
| | | #---当前防护值,需存DB----
|
| | | def GetProDef(curPlayer): return curPlayer.GetExAttr4()
|
| | |
| | | def GetMaxProDef(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrMaxProDef)
|
| | | def SetMaxProDef(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrMaxProDef, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_MaxProDef, value, False) # 周围玩家需要通知
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_MaxProDef, value) # 周围玩家需要通知
|
| | | |
| | | #---生命上限换算为防护值的百分比----
|
| | | def GetProDefHPPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrProDefHPPer)
|
| | | def SetProDefHPPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrProDefHPPer, value)
|
| | | #curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ProDefHPPer, value, False)
|
| | | #SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ProDefHPPer, value)
|
| | | |
| | | #---防护值吸收伤害比率----
|
| | | def GetProDefAbsorb(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrProDefAbsorb)
|
| | | def SetProDefAbsorb(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrProDefAbsorb, value)
|
| | | #curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ProDefAbsorb, value, False)
|
| | | #SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ProDefAbsorb, value)
|
| | |
|
| | | #---宠物攻击提升值----
|
| | | def GetPetMinAtk(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrPetMinAtk)
|
| | |
| | | # def GetPetDamPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrPetDamPer)
|
| | | # def SetPetDamPer(curPlayer, value):
|
| | | # curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrPetDamPer, value)
|
| | | # curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PetDamPer, value, False)
|
| | | # SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_PetDamPer, value)
|
| | | #===============================================================================
|
| | | #---宠物技能伤害百分比提升----
|
| | | def GetPetSkillAtkRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_PetSkillAtkRate)
|
| | |
| | | def SetDropEquipPer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrDropEquipPer, value)
|
| | |
|
| | | #---功能层防御值----
|
| | | def GetFuncDef(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr % (ChConfig.TYPE_Calc_AttrDEF - 1))
|
| | | def SetFuncDef(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttr % (ChConfig.TYPE_Calc_AttrDEF - 1), value)
|
| | | def GetFuncDef(curPlayer): return EffGetSet.GetCopyFuncAttrValue(curPlayer, ChConfig.TYPE_Calc_AttrDEF)
|
| | | def SetFuncDef(curPlayer, value): EffGetSet.SetCopyFuncAttrValue(curPlayer, ChConfig.TYPE_Calc_AttrDEF, value)
|
| | |
|
| | | #普通攻击增伤:普通攻击附加的固定值伤害
|
| | | def GetNormalHurt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_NormalHurt)
|
| | |
| | | def GetLostYinjiTime(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_LostYinjiTime)
|
| | | def SetLostYinjiTime(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_LostYinjiTime, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_YinjiTime, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_YinjiTime, value)
|
| | |
|
| | | # 当前印记数
|
| | | def GetYinjiCnt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_YinjiCnt)
|
| | | def SetYinjiCnt(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_YinjiCnt, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_YinjiCnt, value, False)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_YinjiCnt, value)
|
| | |
|
| | | # 减少指定技能组CD XX%
|
| | | def GetTheFBSkillsCD(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TheFBSkillsCD)
|
| | |
| | | ## 设置玩家字典值, 存库
|
| | | def NomalDictSetProperty(curPlayer, key, value, dType=0):
|
| | | if CrossPlayerData.IsNeedProcessCrossPlayer(curPlayer) and key not in \
|
| | | [ChConfig.Def_PDict_FightPower_Total, ChConfig.Def_PlayerKey_CrossRegisterMap]:
|
| | | [ChConfig.Def_PDict_FightPower_Total, ChConfig.Def_PDict_FightPower_TotalEx, ChConfig.Def_PlayerKey_CrossRegisterMap]:
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | changeDict = PyGameData.g_crossPlayerDictChangeInfo.get(playerID, {})
|
| | | changeDict[(key, dType)] = value
|
| | |
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import GameObj
|
| | |
|
| | | ## 是否匹配中
|
| | | def SetIsCrossPKMatching(curPlayer, isMatching):
|
| | |
| | | GameWorld.DebugLog("副本中,无法进行跨服匹配!", playerID)
|
| | | return
|
| | |
|
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie or curPlayer.GetHP() == 0:
|
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie or GameObj.GetHP(curPlayer) == 0:
|
| | | #GameWorld.DebugLog("已死亡,无法进行跨服匹配!", playerID)
|
| | | return
|
| | |
|
| | |
| | | "playerName":CrossRealmPlayer.GetCrossPlayerName(curPlayer),
|
| | | "playerJob":curPlayer.GetJob(),
|
| | | "playerLV":curPlayer.GetLV(),
|
| | | "maxHP":curPlayer.GetMaxHP(),
|
| | | "maxHP":GameObj.GetMaxHP(curPlayer),
|
| | | "maxProDef":PlayerControl.GetMaxProDef(curPlayer),
|
| | | "fightPower":curPlayer.GetFightPower(),
|
| | | "fightPower":PlayerControl.GetFightPower(curPlayer),
|
| | | "realmLV":curPlayer.GetOfficialRank(),
|
| | | "pkScore":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_TotalScore), # 当前积分
|
| | | "danLV":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_DanLV), # 当前段位
|
| | |
| | | import PyGameData
|
| | | import PetControl
|
| | | import NPCCommon
|
| | | import GameObj
|
| | |
|
| | | import time
|
| | | import math
|
| | |
| | | FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
|
| | |
|
| | | #默认回满血
|
| | | if curPlayer.GetHP() < curPlayer.GetMaxHP():
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | if GameObj.GetHP(curPlayer) < GameObj.GetMaxHP(curPlayer):
|
| | | GameObj.SetHPFull(curPlayer)
|
| | |
|
| | | #通知进入状态
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 1)
|
| | |
| | | NPCCommon.ClearPriWoodPile(curPlayer)
|
| | |
|
| | | #默认回满血
|
| | | if curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie and curPlayer.GetHP() < curPlayer.GetMaxHP():
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | | if GameObj.GetHP(curPlayer) > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie and GameObj.GetHP(curPlayer) < GameObj.GetMaxHP(curPlayer):
|
| | | GameObj.SetHPFull(curPlayer)
|
| | |
|
| | | GameWorld.Log("玩家退出自定义场景!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
| | | elif fdeventID == AdventuresType2:
|
| | | curData = curPlayer.GetOfficialRank()
|
| | | elif fdeventID == AdventuresType3:
|
| | | curData = curPlayer.GetFightPower()
|
| | | curData = PlayerControl.GetFightPower(curPlayer)
|
| | | elif fdeventID == AdventuresType4:
|
| | | curData = curPlayer.GetLuckValue()
|
| | | else:
|
| | |
| | | return
|
| | |
|
| | | #请求记录申请进入家族信息
|
| | | sendMsg = cPickle.dumps([familyID, curPlayer.GetFightPower()], 2)
|
| | | sendMsg = cPickle.dumps([familyID, PlayerControl.GetFightPower(curPlayer)], 2)
|
| | | curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_AddFamilyAction,
|
| | | ShareDefine.Def_ActionType_FamilyAdd, '', sendMsg, len(sendMsg))
|
| | |
|
| | |
| | | # @param curPlayer
|
| | | # @return
|
| | | def Sync_GreatMasterFreeSkillPoint(curPlayer):
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_TalentPoint, GetGreatMasterFreeSkillPoint(curPlayer), False)
|
| | | PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_TalentPoint, GetGreatMasterFreeSkillPoint(curPlayer))
|
| | | return
|
| | |
|
| | |
|
| | |
| | | DataRecordPack.DR_UseNewGuyCard(curPlayer, newGuyCardStr, curCardType, itemID, itemCnt)
|
| | | #===========================================================================
|
| | | # playerName = curPlayer.GetPlayerName()
|
| | | # eventParam = "RoleID=%s,LV=%s,LVEx=%s,CreateRoleTime=%s,CardStr=%s,CardType=%s,ItemID=%s,ItemCount=%s" \
|
| | | # % (playerName, curPlayer.GetLV(), curPlayer.GetLVEx(), curPlayer.GetCreateRoleTime(), \
|
| | | # eventParam = "RoleID=%s,LV=%s,CreateRoleTime=%s,CardStr=%s,CardType=%s,ItemID=%s,ItemCount=%s" \
|
| | | # % (playerName, curPlayer.GetLV(), curPlayer.GetCreateRoleTime(), \
|
| | | # newGuyCardStr, curCardType, itemID, itemCnt)
|
| | | # EventReport.EventReport(5015, eventParam, curPlayer)
|
| | | #
|
| | |
| | | import CalcLineEffect
|
| | | import PlayerActivity
|
| | | import PlayerHorse
|
| | | import GameObj
|
| | |
|
| | | import random
|
| | | import math
|
| | |
| | | # rolePet.GetGrade(), rolePet.GetQualityLV()))
|
| | |
|
| | | #当前血量(不通知)
|
| | | PetControl.SetPetHP(rolePet, rolePet.GetMaxHP(), False)
|
| | | PetControl.SetPetHP(rolePet, GameObj.GetMaxHP(rolePet), False)
|
| | |
|
| | | #---通知客户端---
|
| | | #rolePet.Sync_PetInfo()
|
| | |
| | | # return
|
| | | #
|
| | | # #没血或者不可见
|
| | | # if curObj.GetHP() <= 0 or not curObj.GetVisible():
|
| | | # if GameObj.GetHP(curObj) <= 0 or not curObj.GetVisible():
|
| | | # return
|
| | | #
|
| | | # #根据攻速取技能
|
| | |
| | |
|
| | | #===========================================================================
|
| | | # #目标已经死亡
|
| | | # if curTag.GetHP() <= 0:
|
| | | # if GameObj.GetHP(curTag) <= 0:
|
| | | # #取消主角点选
|
| | | # curPlayer.SetActionObj(None)
|
| | | # #退出战斗对峙
|
| | |
| | | return
|
| | |
|
| | | #满血不处理
|
| | | if curPlayer.GetHP() == curPlayer.GetMaxHP():
|
| | | if GameObj.GetHP(curPlayer) == GameObj.GetMaxHP(curPlayer):
|
| | | return
|
| | |
|
| | | #战斗中返回
|
| | |
| | | # return False
|
| | |
|
| | | #---回复玩家血量---
|
| | | playerHP = curPlayer.GetHP()
|
| | | playerHP = GameObj.GetHP(curPlayer)
|
| | | #playerMP = curPlayer.GetMP()
|
| | | playerMaxHP = curPlayer.GetMaxHP()
|
| | | playerMaxHP = GameObj.GetMaxHP(curPlayer)
|
| | | #playerMaxMP = curPlayer.GetMaxMP()
|
| | |
|
| | | # 目前回复频率暂定5秒回复一次,回复数值是1秒的值,所以此处乘5
|
| | |
| | | #当前不是满血, 就回血
|
| | | if playerHP != playerMaxHP:
|
| | | SkillCommon.SkillAddHP(curPlayer, 0, addHPValue)
|
| | | #curPlayer.SetHP(min(playerHP + addHPValue, playerMaxHP))
|
| | | #GameObj.SetHP(curPlayer, min(playerHP + addHPValue, playerMaxHP))
|
| | |
|
| | | #当前不是满魔, 就回魔
|
| | | #if playerMP != playerMaxMP:
|
| | |
| | | pkStateTick = curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick)
|
| | | if pkStateTick and (tick - pkStateTick) >= validTime:
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_PKStateTick, 0)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PKState, 0, False)
|
| | | PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_PKState, 0)
|
| | | #GameWorld.DebugLog("退出PK状态!", curPlayer.GetPlayerID())
|
| | | curPlayer.SetDict("StartProDTick", tick) # 开始恢复时间点
|
| | |
|
| | | bossStateTick = curPlayer.GetDictByKey(ChConfig.Def_PDict_BossStateTick)
|
| | | if bossStateTick and (tick - bossStateTick) >= validTime:
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_BossStateTick, 0)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_BossState, 0, False)
|
| | | PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossState, 0)
|
| | | #GameWorld.DebugLog("退出Boss状态!", curPlayer.GetPlayerID())
|
| | |
|
| | | # 脱离PK战斗 X秒后按比例恢复
|
| | |
| | |
|
| | | def Sync_PKBossState(curPlayer):
|
| | | psState = 1 if curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) else 0
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PKState, psState, False)
|
| | | PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_PKState, psState)
|
| | |
|
| | | bossState = 1 if curPlayer.GetDictByKey(ChConfig.Def_PDict_BossStateTick) else 0
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_BossState, bossState, False)
|
| | | PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossState, bossState)
|
| | | return
|
| | |
|
| | | # 脱离PK战斗 X秒后按比例恢复
|
| | |
| | | def IsInPKState(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) > 0
|
| | | def SetPKStateTick(curPlayer, tick):
|
| | | if not curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick):
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_PKState, 1, False)
|
| | | 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):
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_BossState, 1, False)
|
| | | 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 SetTJGTime(curPlayer, tjgTime):
|
| | | tjgTime = max(tjgTime, 0)
|
| | | curPlayer.SetHappyPoint(tjgTime)
|
| | | curPlayer.SendGameServerRefreshState(IPY_GameWorld.CDBPlayerRefresh_HappyPoint, tjgTime)
|
| | | PlayerControl.SendGameServerRefreshState(curPlayer, IPY_GameWorld.CDBPlayerRefresh_HappyPoint, tjgTime)
|
| | | return
|
| | | def AddTJGTime(curPlayer, addTime):
|
| | | maxTime = IpyGameDataPY.GetFuncCfg('TJG', 3)
|
| | |
| | | aBleedDamage = PlayerControl.GetBleedDamage(curPlayer) # 流血伤害 万分率
|
| | | aFinalHurt = PlayerControl.GetFinalHurt(curPlayer) # 最终固定伤害
|
| | | aFinalHurtPer = PlayerControl.GetFinalHurtPer(curPlayer) # 最终伤害加成万分率
|
| | | aFightPower = curPlayer.GetFightPower() # 战力
|
| | | aFightPower = PlayerControl.GetFightPower(curPlayer) # 战力
|
| | | aReFightPower = lvIpyData.GetReFightPower() # 等级表对应的战力
|
| | | aNPCHurtAddPer = PlayerControl.GetNPCHurtAddPer(curPlayer) #PVE 伤害加成万分率
|
| | |
|
| | | npcExp = npcData.GetExp()
|
| | | npcMaxHP = npcData.GetHP() + npcData.GetHPEx()*ShareDefine.Def_PerPointValue
|
| | | npcMaxHP = GameObj.GetHP(npcData)
|
| | | npcCommendFightPower = NPCCommon.GetCommendFightPower(npcData)
|
| | | petSkillLV = 1
|
| | | petSkillPer = 10000
|
| | |
| | | import ReadChConfig
|
| | | import ShareDefine
|
| | | import EventReport
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | | #===============================================================================
|
| | | # 交易消息提示 curPlayer.TradeMsg
|
| | |
| | | return False
|
| | |
|
| | | #任意一方死亡,无法开启交易
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | #ApplyDealingLost07 你已经死亡,交易取消!
|
| | | PlayerControl.NotifyCode(curPlayer, "ApplyDealingLost07")
|
| | | return False
|
| | |
|
| | | if curTagPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curTagPlayer) <= 0:
|
| | | #ApplyDealingLost03 目标死亡,无法发出交易邀请!
|
| | | PlayerControl.NotifyCode(curPlayer, "ApplyDealingLost03")
|
| | | return False
|
| | |
| | | GameWorld.Log("DoPlayerEnterTruck -> 无法找到镖车" , curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | # if curPlayerTruck.GetHP() == 0:
|
| | | # if GameObj.GetHP(curPlayerTruck) == 0:
|
| | | # GameWorld.Log("镖车已死亡, 拒绝")
|
| | | # return
|
| | |
|
| | |
| | | # @return: 损坏镖车最小血量
|
| | | def GetTruckDestroyMinHP(curTruck):
|
| | | destroyMinHPRate = ReadChConfig.GetEvalChConfig("TruckDestroyMinHPRate")
|
| | | minHP = max(0, int(curTruck.GetMaxHP() * destroyMinHPRate/float(ChConfig.Def_MaxRateValue)))
|
| | | minHP = max(0, int(GameObj.GetMaxHP(curTruck) * destroyMinHPRate/float(ChConfig.Def_MaxRateValue)))
|
| | | return minHP
|
| | |
|
| | |
|
| | |
| | | import PyGameData
|
| | | import PlayerTJG
|
| | | import SkillShell
|
| | | import GameObj
|
| | |
|
| | | import time
|
| | | import json
|
| | |
| | | curPlayerPropDict["Name"] = curPlayer.GetPlayerName()
|
| | | curPlayerPropDict["FamilyID"] = curPlayer.GetFamilyID()
|
| | | curPlayerPropDict["FamilyName"] = curPlayer.GetFamilyName()
|
| | | curPlayerPropDict["FightPower"] = curPlayer.GetFightPower()
|
| | | curPlayerPropDict["FightPower"] = PlayerControl.GetFightPower(curPlayer)
|
| | | curPlayerPropDict["AppID"] = GameWorld.GetPlayerPlatform(curPlayer)
|
| | | curPlayerPropDict["EquipShowSwitch"] = curPlayer.GetEquipShowSwitch()
|
| | | curPlayerPropDict["EquipShowID"] = __GetEquipShowIDList(curPlayer)
|
| | |
| | | curPlayerPropDict["MinAtk"] = curPlayer.GetMinAtk()
|
| | | curPlayerPropDict["MaxAtk"] = curPlayer.GetMaxAtk()
|
| | | curPlayerPropDict["Def"] = curPlayer.GetDef()
|
| | | curPlayerPropDict["MaxHP"] = curPlayer.GetMaxHP()
|
| | | curPlayerPropDict["MaxHP"] = GameObj.GetMaxHP(curPlayer)
|
| | | #推送提醒
|
| | | curPlayerPropDict[ChConfig.Def_PDict_GeTuiSet] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GeTuiSet)
|
| | | curPlayerPropDict[ChConfig.Def_PDict_NoGeTuiTime] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NoGeTuiTime)
|
| | |
| | | 'Job':curPlayer.GetJob(), # ְҵ
|
| | | 'LV':curPlayer.GetLV(), #玩家等级
|
| | | 'OfficialRank':curPlayer.GetOfficialRank(), #境界
|
| | | 'FightPower':curPlayer.GetFightPower(), #战斗力
|
| | | 'FightPower':PlayerControl.GetFightPower(curPlayer), #战斗力
|
| | | 'VIPLV':curPlayer.GetVIPLv(), # vip等级
|
| | |
|
| | | 'MapID':curPlayer.GetMapID(), #当前地图id
|
| | |
| | | #---------------------------------------------------------------------
|
| | | #导入
|
| | | import GameWorld
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | | resultDisc = {
|
| | | 'Result' : '1' ,
|
| | | 'DictName' : 'GY_Query_Offline_ViewAttribute' ,
|
| | | 'Hp' : '%s'%(curFindPlayer.GetHP()) ,
|
| | | 'Hp' : '%s'%(GameObj.GetHP(curFindPlayer)) ,
|
| | | 'Mp' : '%s'%(curFindPlayer.GetMP()) ,
|
| | | 'FreePoint': '%s'%(curFindPlayer.GetFreePoint()),
|
| | | 'BaseSTR' : '%s'%(curFindPlayer.GetBaseSTR()) ,
|
| | |
| | | GameWorld.ErrLog("设置对象属性失败, Index = %s" % (effIndex))
|
| | | return
|
| | |
|
| | | if effIndex not in ChConfig.TYPE_BIGVALUE_ATTR:
|
| | | effectValue = min(effectValue, ChConfig.Def_UpperLimit_DWord)
|
| | | return ObjProperty_AttrByIndex[effIndex - 1][1](curObj, effectValue)
|
| | |
|
| | |
| | | def CopyPlayerFuncAttr(curPlayer):
|
| | | for i in xrange(len(ObjProperty_AttrByIndex)):
|
| | | # Get
|
| | | if i+1 in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | effIndex = i + 1
|
| | | if effIndex in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | continue
|
| | | value = ObjProperty_AttrByIndex[i][0](curPlayer)
|
| | | if value == 0 and curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr%i) == 0:
|
| | | if value == 0 and GetCopyFuncAttrValue(curPlayer, effIndex) == 0:
|
| | | continue
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttr%i, ObjProperty_AttrByIndex[i][0](curPlayer))
|
| | | SetCopyFuncAttrValue(curPlayer, effIndex, value)
|
| | | return
|
| | |
|
| | | # 恢复缓存功能属性的刷新结果,用于BUFF属性单独刷新
|
| | | def RestorePlayerFuncAttr(curPlayer):
|
| | | for i in xrange(len(ObjProperty_AttrByIndex)):
|
| | | if i+1 in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | effIndex = i + 1
|
| | | if effIndex in [ChConfig.TYPE_Calc_AttrHP, ChConfig.TYPE_Calc_AttrMP, ChConfig.TYPE_Calc_ProDef]:
|
| | | continue
|
| | | ObjProperty_AttrByIndex[i][1](curPlayer, |
| | | curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr%i))
|
| | | ObjProperty_AttrByIndex[i][1](curPlayer, GetCopyFuncAttrValue(curPlayer, effIndex))
|
| | | return
|
| | |
|
| | | def GetCopyFuncAttrValue(curPlayer, effIndex):
|
| | | value = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr % effIndex)
|
| | | valueEx = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttrEx % effIndex)
|
| | | return valueEx * ShareDefine.Def_PerPointValue + value
|
| | |
|
| | | def SetCopyFuncAttrValue(curPlayer, effIndex, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttr % effIndex, value % ShareDefine.Def_PerPointValue)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttrEx % effIndex, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | |
| | |
| | | # @version 1.0
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2017-10-31 14:10"""
|
| | | #"""Version = 2017-10-31 14:10"""
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import GameObj
|
| | |
|
| | | import SkillCommon
|
| | |
|
| | | def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick):
|
| | | if curObj.GetHP() <= 0:
|
| | | if GameObj.GetHP(curObj) <= 0:
|
| | | return
|
| | |
|
| | | value = curBuff.GetValue()
|
| | |
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import SkillCommon
|
| | | import GameObj
|
| | |
|
| | | def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick):
|
| | | if curObj.GetHP() <= 0:
|
| | | if GameObj.GetHP(curObj) <= 0:
|
| | | return
|
| | |
|
| | | value = curBuff.GetValue()
|
| | |
| | | if not angryValue_ID:
|
| | | continue
|
| | |
|
| | | summonNPCAngry.AddAngry(angryValue_ID, angryValue.GetObjType(), angryValue.GetAngryValue())
|
| | | summonNPCAngry.AddAngry(angryValue_ID, angryValue.GetObjType(), angryValue.GetAngryValue(), angryValue.GetAngryValueEx())
|
| | |
|
| | | summonNPC.NotifyAppear() # 最终统一通知NPC出现
|
| | | #返回值,技能释放成功
|
| | |
| | | #
|
| | | # for i in range(0, curNPC.GetSummonCount()):
|
| | | # summonNPC = curNPC.GetSummonNPCAt(i)
|
| | | # if summonNPC.GetHP() > 0:
|
| | | # if GameObj.GetHP(summonNPC) > 0:
|
| | | # continue
|
| | | #
|
| | | # summonIsFull = False
|
| | |
| | | #summonNPC.SetBaseAtkInterval(int(curPlayer.GetAtkInterval() * skillPer))
|
| | | summonNPC.SetBaseMissRate(int(curPlayer.GetMiss() * skillPer))
|
| | | summonNPC.SetBaseSuperHiteRate(int(curPlayer.GetSuperHitRate() * skillPer))
|
| | | summonNPC.SetBaseMaxHP(int(curPlayer.GetMaxHP() * skillPer))
|
| | | GameObj.SetBaseMaxHP(summonNPC, int(GameObj.GetMaxHP(curPlayer) * skillPer))
|
| | | #summonNPC.SetBaseHPRestore(int(curPlayer.GetHPRestoreSetting() * skillPer))
|
| | | #summonNPC.SetOrgSpeed(int(curPlayer.GetOrgSpeed() * skillPer))
|
| | | return
|
| | |
| | | summonNPC.SetBaseAtkInterval(summonNPC.GetAtkInterval())
|
| | | summonNPC.SetBaseMissRate(summonNPC.GetMiss())
|
| | | summonNPC.SetBaseSuperHiteRate(summonNPC.GetSuperHitRate())
|
| | | summonNPC.SetBaseMaxHP(summonNPC.GetMaxHP())
|
| | | GameObj.SetBaseMaxHP(summonNPC, GameObj.GetMaxHP(summonNPC))
|
| | | summonNPC.SetBaseHPRestore(summonNPC.GetHPRestore())
|
| | | #summonNPC.SetOrgSpeed( summonNPC.GetOrgSpeed( ))
|
| | | return
|
| | |
| | | GameObj.SetHP(curObj, remainHP)
|
| | | if not isNotify:
|
| | | #已广播的不重复
|
| | | curObj.Notify_HPEx()
|
| | | curObj.Notify_HP()
|
| | |
|
| | | #广播加血类型
|
| | | if isNotify:
|
| | |
| | | GameObj.SetHP(curObj, remainHP)
|
| | |
|
| | | if not view : # 已广播的不重复
|
| | | curObj.Notify_HPEx()
|
| | | curObj.Notify_HP()
|
| | |
|
| | | #其他对象逻辑处理
|
| | | else:
|
| | |
| | | #宠物特殊处理
|
| | | if curObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | pass
|
| | | #curObj.Sync_RefreshProp(IPY_GameWorld.PetInfoRefresh_HP, curObj.GetHP(), True)
|
| | | #curObj.Sync_RefreshProp(IPY_GameWorld.PetInfoRefresh_HP, GameObj.GetHP(curObj), True)
|
| | | else:
|
| | | curObj.Notify_HPEx()
|
| | | curObj.Notify_HP()
|
| | |
|
| | |
|
| | | ## 获得技能buff的拥有者
|
| | |
| | | elif cureType == ChConfig.Def_Cure_PHY:
|
| | | cureBaseValue = GameObj.GetMaxHP(userObj)
|
| | | elif cureType == ChConfig.Def_Cure_HurtValue:
|
| | | cureBaseValue = userObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValue)
|
| | | cureBaseValue = GameObj.GetLastHurtValue(userObj)
|
| | | elif cureType == ChConfig.Def_Cure_TagMaxHP:
|
| | | cureBaseValue = 0 if not tagObj else GameObj.GetMaxHP(tagObj)
|
| | |
|
| | |
| | | skillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(userObj, None, curSkill, ChConfig.TriggerType_AddHP)/float(ChConfig.Def_MaxRateValue)
|
| | | #公式计算治疗值
|
| | | cureHP = int((cureBaseValue * skillPer + skillValue + addExValue) * curePercent)
|
| | | cureHP = min(cureHP, ChConfig.Def_UpperLimit_DWord)
|
| | |
|
| | | #GameWorld.DebugLog("获取治疗值(%s):cureType=%s,cureBaseValue=%s,skillPer=%s,skillValue=%s"
|
| | | # % (cureHP, cureType, cureBaseValue, skillPer, skillValue))
|
| | |
| | | """Version = 2011-02-25 13:30"""
|
| | | #------------------------------------------------------------------------------
|
| | | #导入
|
| | | import GameWorld
|
| | | import BaseAttack
|
| | | import NPCCommon
|
| | | import IPY_GameWorld
|
| | | import GameObj
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | | if angryMaxTag == None:
|
| | | return
|
| | |
|
| | | angryMaxTag.SetAngryValue(1)
|
| | | GameObj.SetAngryValue(angryMaxTag, 1)
|
| | |
|
| | | #处理技能触发和攻击成功逻辑
|
| | | return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | |
| | | import ChConfig
|
| | | #import GameWorld
|
| | | import BaseAttack
|
| | | import GameObj
|
| | |
|
| | | ##链式攻击
|
| | | # @param attacker 攻击者实例
|
| | |
| | | # @return 返回值为真, 释放成功
|
| | | # @remarks 链式攻击
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | lastHurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValue) # 最后一击伤害值
|
| | | lastHurtValue = GameObj.GetLastHurtValue(attacker) # 最后一击伤害值
|
| | | #技能增强值
|
| | | skillPer = curSkill.GetEffect(0).GetEffectValue(0)
|
| | | #技能附加值
|
| | | addValue = curSkill.GetEffect(0).GetEffectValue(1)
|
| | |
|
| | | lostHP = int((lastHurtValue * skillPer / float(ChConfig.Def_MaxRateValue)) + addValue)
|
| | | lostHP = min(lostHP, ChConfig.Def_UpperLimit_DWord)
|
| | |
|
| | | if defender and tagRoundPosX == -1 and tagRoundPosY == -1:
|
| | | #起点是攻击方,还是受害方,还是点地
|
| | |
| | | import BaseAttack
|
| | | import ChConfig
|
| | | import IPY_GameWorld
|
| | | import ShareDefine
|
| | | import GameObj
|
| | |
|
| | | ##降低仇恨
|
| | | # @param attacker 攻击者实例
|
| | |
| | |
|
| | | #施法者,清空仇恨值
|
| | | if attackerID == angryID and attackerType == angryType:
|
| | | angryTag.SetAngryValue(int(angryTag.GetAngryValue()*skillPer))
|
| | | updAngryValue = int(GameObj.GetAngryValue(angryTag) * skillPer)
|
| | | GameObj.SetAngryValue(angryTag, updAngryValue)
|
| | | break
|
| | |
|
| | | #处理技能触发和攻击成功逻辑
|
| | |
| | | import SkillCommon
|
| | | import BuffSkill
|
| | | import IPY_GameWorld
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | | if attacker.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | |
| | | if (passiveEffect.GetEffectValue(2) & pow(2, zhanshaState-1)) != 0:
|
| | | return False
|
| | |
|
| | | attacker.SetHP(1)
|
| | | GameObj.SetHP(attacker, 1)
|
| | |
|
| | | # False 可用于多次触发不死的作用
|
| | | return True if passiveEffect.GetEffectValue(1) else False
|
| | |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | |
|
| | |
| | | if buffValue == 0:
|
| | | return False
|
| | |
|
| | | hurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | hurtValue = GameObj.GetBloodShiledHurt(attacker)
|
| | | if hurtValue == 0:
|
| | | return False
|
| | |
|
| | | buff.SetValue(max(buffValue - hurtValue, 0))
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, max(hurtValue - buffValue, 0))
|
| | | GameObj.SetBloodShiledHurt(attacker, max(hurtValue - buffValue, 0))
|
| | |
|
| | | if buff.GetValue() == 0:
|
| | | buff.SetRemainTime(0)
|
| | |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | |
|
| | |
| | | if buffValue == 0:
|
| | | return False
|
| | |
|
| | | hurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | hurtValue = GameObj.GetBloodShiledHurt(attacker)
|
| | | if hurtValue == 0:
|
| | | return False
|
| | |
|
| | | buff.SetValue(max(buffValue - hurtValue, 0))
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, max(hurtValue - buffValue, 0))
|
| | | GameObj.SetBloodShiledHurt(attacker, max(hurtValue - buffValue, 0))
|
| | |
|
| | | if buff.GetValue() == 0:
|
| | | buff.SetRemainTime(0)
|
| | |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | | curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
| | |
| | | if buffValue == 0:
|
| | | return False
|
| | |
|
| | | hurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | hurtValue = GameObj.GetBloodShiledHurt(attacker)
|
| | | if hurtValue == 0:
|
| | | return False
|
| | |
|
| | | buff.SetValue(max(buffValue - hurtValue, 0))
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, max(hurtValue - buffValue, 0))
|
| | | GameObj.SetBloodShiledHurt(attacker, max(hurtValue - buffValue, 0))
|
| | |
|
| | | if buff.GetValue() == 0:
|
| | | buff.SetRemainTime(0)
|
| | |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | | curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
| | |
| | | if buffValue == 0:
|
| | | return False
|
| | |
|
| | | hurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | hurtValue = GameObj.GetBloodShiledHurt(attacker)
|
| | | if hurtValue == 0:
|
| | | return False
|
| | |
|
| | | buff.SetValue(max(buffValue - hurtValue, 0))
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, max(hurtValue - buffValue, 0))
|
| | | GameObj.SetBloodShiledHurt(attacker, max(hurtValue - buffValue, 0))
|
| | |
|
| | | if buff.GetValue() == 0:
|
| | | buff.SetRemainTime(0)
|
| | |
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import GameObj
|
| | | import ShareDefine
|
| | |
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | hurtValue = attacker.GetDictByKey(ChConfig.Def_PlayerKey_curHurtValue)
|
| | | hurtValueEx = attacker.GetDictByKey(ChConfig.Def_PlayerKey_curHurtValueEx)
|
| | | hurtValue = hurtValueEx * ShareDefine.Def_PerPointValue + hurtValue
|
| | |
|
| | | if hurtValue < GameObj.GetMaxHP(attacker)*effect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue:
|
| | | return False
|
| | |
| | | # mapType = GameWorld.GetMap().GetMapFBType()
|
| | | # 野外小怪或者其他指定的怪为了更及时的打击感,由客户端计算
|
| | | for hurobj in hurtList:
|
| | | if hurobj.HurtHP == 0:
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
|
| | | hurtHP = hurobj.HurtHP + hurobj.HurtHPEx * ShareDefine.Def_PerPointValue
|
| | | if hurtHP == 0:
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurtHP, hurobj.AttackType]
|
| | | continue
|
| | | if hurobj.ObjType != IPY_GameWorld.gotNPC:
|
| | | # 非NPC
|
| | |
| | | # 重复对象
|
| | | return False
|
| | |
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurtHP, hurobj.AttackType]
|
| | |
|
| | | g_UseSkillPlayerID = curPlayer.GetID()
|
| | | return True
|
| | |
| | | PlayerControl.NotifyCode(curPlayer , "Play_Attack_Null")
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | #玩家已经死亡
|
| | | PlayerControl.NotifyCode(curPlayer, "PK_chenxin_612029")
|
| | | return False
|
| | |
| | | # #7:检查玩家的HP是否足够
|
| | | # curSkillNeedHP = curSkill.GetHP()
|
| | | #
|
| | | # if curSkillNeedHP > 0 and curPlayer.GetHP() < curSkillNeedHP:
|
| | | # if curSkillNeedHP > 0 and GameObj.GetHP(curPlayer) < curSkillNeedHP:
|
| | | # curPlayer.Notify_AttackFail(0, 0, 0, 0, IPY_GameWorld.afrHP)
|
| | | # PlayerControl.NotifyCode(curPlayer, "PK_jin_0")
|
| | | # GameWorld.DebugLog("检查玩家的HP是否足够")
|
| | |
| | | # NPC仇恨吸引,由客户端决定,适用于小怪
|
| | | # '''
|
| | | # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | # if curPlayer.GetHP() <= 0:
|
| | | # if GameObj.GetHP(curPlayer) <= 0:
|
| | | # return
|
| | | #
|
| | | # if not curPlayer.GetVisible():
|
| | |
| | | # npcAngry = npcObj.GetNPCAngry()
|
| | | # angryValue = npcAngry.FindNPCAngry(playerID, IPY_GameWorld.gotPlayer)
|
| | | #
|
| | | # if angryValue != None and angryValue.GetAngryValue() != 0 :
|
| | | # if angryValue != None and GameObj.GetAngryValue(angryValue) != 0 :
|
| | | # #该对象已经在仇恨列表中,不重复添加
|
| | | # continue
|
| | | #
|
| | |
| | | # DWORD ObjID;
|
| | | # BYTE AttackType; //爆击, miss
|
| | | # DWORD HurtHP;
|
| | | # DWORD HurtHPEx;
|
| | | # };
|
| | | #
|
| | | # struct tagCMSuperAtk
|
| | |
| | | # @return 返回值真, 检查通过
|
| | | # @remarks 检查客户端发送技能封包, 这里只简单检查一下
|
| | | def __CheckPlayerUseSkill_ClientPack(curPlayer, posX, posY, curSkill):
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | |
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | |
| | | return False
|
| | |
|
| | | target = petOwner
|
| | | if target.GetHP() <= 0:
|
| | | if GameObj.GetHP(target) <= 0:
|
| | | return False
|
| | |
|
| | | if affectTag not in [ChConfig.Def_UseSkillTag_None, ChConfig.Def_UseSkillTag_Self]:
|