10019 【砍树】回合战斗(增加对象开始行动通知B421)
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 21 回合战斗对象开始行动 #tagMCTurnFightObjAction
|
| | |
|
| | | class tagMCTurnFightObjAction(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("TurnNum", c_ubyte), # 当前轮次
|
| | | ("ObjID", c_int), |
| | | ("ObjType", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x21
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x21
|
| | | self.TurnNum = 0
|
| | | self.ObjID = 0
|
| | | self.ObjType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCTurnFightObjAction)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B4 21 回合战斗对象开始行动 //tagMCTurnFightObjAction:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | TurnNum:%d,
|
| | | ObjID:%d,
|
| | | ObjType:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.TurnNum,
|
| | | self.ObjID,
|
| | | self.ObjType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCTurnFightObjAction=tagMCTurnFightObjAction()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjAction.Cmd,m_NAtagMCTurnFightObjAction.SubCmd))] = m_NAtagMCTurnFightObjAction
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 20 回合制战斗状态 #tagMCTurnFightState
|
| | |
|
| | | class tagMCTurnFightState(Structure):
|
| | |
| | | |
| | | GameWorld.DebugLog(" 行动: turnNum=%s,actNum=%s,faction=%s,objType=%s,objID=%s,tagObjType=%s,tagObjID=%s" |
| | | % (turnNum, actNum, faction, objType, objID, tagObjType, tagObjID)) |
| | | SyncTurnFightObjAction(curPlayer, turnNum, objType, objID) |
| | | |
| | | DoAttack(gameObj, tagGameObj, tick) |
| | | |
| | | playerDead = GameObj.GetHP(curPlayer) <= 0 |
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack) |
| | | return |
| | | |
| | | def SyncTurnFightObjAction(curPlayer, turnNum, objType, objID): |
| | | clientPack = ChPyNetSendPack.tagMCTurnFightObjAction() |
| | | clientPack.Clear() |
| | | clientPack.TurnNum = turnNum |
| | | clientPack.ObjID = objID |
| | | clientPack.ObjType = objType |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack) |
| | | return |
| | | |
| | | |
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 21 回合战斗对象开始行动 #tagMCTurnFightObjAction
|
| | |
|
| | | class tagMCTurnFightObjAction(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("TurnNum", c_ubyte), # 当前轮次
|
| | | ("ObjID", c_int), |
| | | ("ObjType", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x21
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x21
|
| | | self.TurnNum = 0
|
| | | self.ObjID = 0
|
| | | self.ObjType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCTurnFightObjAction)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B4 21 回合战斗对象开始行动 //tagMCTurnFightObjAction:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | TurnNum:%d,
|
| | | ObjID:%d,
|
| | | ObjType:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.TurnNum,
|
| | | self.ObjID,
|
| | | self.ObjType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCTurnFightObjAction=tagMCTurnFightObjAction()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCTurnFightObjAction.Cmd,m_NAtagMCTurnFightObjAction.SubCmd))] = m_NAtagMCTurnFightObjAction
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 20 回合制战斗状态 #tagMCTurnFightState
|
| | |
|
| | | class tagMCTurnFightState(Structure):
|