配置表访问接口化,简化常量访问

This commit is contained in:
flswld
2023-02-09 19:20:47 +08:00
parent 867448b80d
commit ae4c505e48
74 changed files with 2313 additions and 3189 deletions

View File

@@ -139,12 +139,12 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
currHp := float32(0)
fightProp := target.GetFightProp()
if fightProp != nil {
currHp = fightProp[uint32(constant.FightPropertyConst.FIGHT_PROP_CUR_HP)]
currHp = fightProp[uint32(constant.FIGHT_PROP_CUR_HP)]
currHp -= damage
if currHp < 0 {
currHp = 0
}
fightProp[uint32(constant.FightPropertyConst.FIGHT_PROP_CUR_HP)] = currHp
fightProp[uint32(constant.FIGHT_PROP_CUR_HP)] = currHp
}
entityFightPropUpdateNotify := &proto.EntityFightPropUpdateNotify{
FightPropMap: fightProp,
@@ -152,7 +152,7 @@ func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg p
}
g.SendToWorldA(world, cmd.EntityFightPropUpdateNotify, player.ClientSeq, entityFightPropUpdateNotify)
if currHp == 0 && target.GetAvatarEntity() == nil {
scene.SetEntityLifeState(target, constant.LifeStateConst.LIFE_DEAD, proto.PlayerDieType_PLAYER_DIE_GM)
scene.SetEntityLifeState(target, constant.LIFE_STATE_DEAD, proto.PlayerDieType_PLAYER_DIE_GM)
}
combatData, err := pb.Marshal(hitInfo)
if err != nil {