mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 14:42:26 +08:00
战斗属性使用角色结构数据
This commit is contained in:
@@ -709,8 +709,8 @@ func (g *GameManager) PacketSceneEntityInfoAvatar(scene *Scene, player *model.Pl
|
||||
Val: int64(avatar.SatiationPenalty)},
|
||||
},
|
||||
},
|
||||
FightPropList: g.PacketFightPropMapToPbFightPropList(entity.fightProp),
|
||||
LifeState: uint32(entity.lifeState),
|
||||
FightPropList: g.PacketFightPropMapToPbFightPropList(avatar.FightPropMap),
|
||||
LifeState: uint32(avatar.LifeState),
|
||||
AnimatorParaList: make([]*proto.AnimatorParameterValueInfoPair, 0),
|
||||
Entity: &proto.SceneEntityInfo_Avatar{
|
||||
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 {
|
||||
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{
|
||||
id: entityId,
|
||||
scene: s,
|
||||
lifeState: constant.LifeStateConst.LIFE_ALIVE,
|
||||
lifeState: avatar.LifeState,
|
||||
pos: player.Pos,
|
||||
rot: player.Rot,
|
||||
moveState: uint16(proto.MotionState_MOTION_NONE),
|
||||
lastMoveSceneTimeMs: 0,
|
||||
lastMoveReliableSeq: 0,
|
||||
fightProp: player.AvatarMap[avatarId].FightPropMap,
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR),
|
||||
level: 0, // 角色等级直接读取角色对象
|
||||
// fightProp: player.AvatarMap[avatarId].FightPropMap, // 使用角色结构的数据
|
||||
entityType: uint32(proto.ProtEntityType_PROT_ENTITY_AVATAR),
|
||||
// level: 0, // 使用角色结构的数据
|
||||
avatarEntity: &AvatarEntity{
|
||||
uid: player.PlayerID,
|
||||
avatarId: avatarId,
|
||||
|
||||
Reference in New Issue
Block a user