mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
战斗属性使用角色结构数据
This commit is contained in:
@@ -709,8 +709,8 @@ func (g *GameManager) PacketSceneEntityInfoAvatar(scene *Scene, player *model.Pl
|
|||||||
Val: int64(avatar.SatiationPenalty)},
|
Val: int64(avatar.SatiationPenalty)},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
FightPropList: g.PacketFightPropMapToPbFightPropList(entity.fightProp),
|
FightPropList: g.PacketFightPropMapToPbFightPropList(avatar.FightPropMap),
|
||||||
LifeState: uint32(entity.lifeState),
|
LifeState: uint32(avatar.LifeState),
|
||||||
AnimatorParaList: make([]*proto.AnimatorParameterValueInfoPair, 0),
|
AnimatorParaList: make([]*proto.AnimatorParameterValueInfoPair, 0),
|
||||||
Entity: &proto.SceneEntityInfo_Avatar{
|
Entity: &proto.SceneEntityInfo_Avatar{
|
||||||
Avatar: g.PacketSceneAvatarInfo(scene, player, avatarId),
|
Avatar: g.PacketSceneAvatarInfo(scene, player, avatarId),
|
||||||
|
|||||||
@@ -851,18 +851,23 @@ func (s *Scene) SetEntityLifeState(entity *Entity, lifeState uint16, dieType pro
|
|||||||
|
|
||||||
func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32 {
|
func (s *Scene) CreateEntityAvatar(player *model.Player, avatarId uint32) uint32 {
|
||||||
entityId := s.world.GetNextWorldEntityId(constant.EntityIdTypeConst.AVATAR)
|
entityId := s.world.GetNextWorldEntityId(constant.EntityIdTypeConst.AVATAR)
|
||||||
|
avatar, ok := player.AvatarMap[avatarId]
|
||||||
|
if !ok {
|
||||||
|
logger.Error("avatar error, avatarId: %v", avatar)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
entity := &Entity{
|
entity := &Entity{
|
||||||
id: entityId,
|
id: entityId,
|
||||||
scene: s,
|
scene: s,
|
||||||
lifeState: constant.LifeStateConst.LIFE_ALIVE,
|
lifeState: avatar.LifeState,
|
||||||
pos: player.Pos,
|
pos: player.Pos,
|
||||||
rot: player.Rot,
|
rot: player.Rot,
|
||||||
moveState: uint16(proto.MotionState_MOTION_NONE),
|
moveState: uint16(proto.MotionState_MOTION_NONE),
|
||||||
lastMoveSceneTimeMs: 0,
|
lastMoveSceneTimeMs: 0,
|
||||||
lastMoveReliableSeq: 0,
|
lastMoveReliableSeq: 0,
|
||||||
fightProp: player.AvatarMap[avatarId].FightPropMap,
|
// fightProp: player.AvatarMap[avatarId].FightPropMap, // 使用角色结构的数据
|
||||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR),
|
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR),
|
||||||
level: 0, // 角色等级直接读取角色对象
|
// level: 0, // 使用角色结构的数据
|
||||||
avatarEntity: &AvatarEntity{
|
avatarEntity: &AvatarEntity{
|
||||||
uid: player.PlayerID,
|
uid: player.PlayerID,
|
||||||
avatarId: avatarId,
|
avatarId: avatarId,
|
||||||
|
|||||||
Reference in New Issue
Block a user