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

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

@@ -26,35 +26,35 @@ func (s *StaminaInfo) SetStaminaCost(state proto.MotionState) {
// 消耗耐力
case proto.MotionState_MOTION_DASH:
// 快速跑步
s.CostStamina = constant.StaminaCostConst.DASH
s.CostStamina = constant.STAMINA_COST_DASH
case proto.MotionState_MOTION_FLY, proto.MotionState_MOTION_FLY_FAST, proto.MotionState_MOTION_FLY_SLOW:
// 滑翔
s.CostStamina = constant.StaminaCostConst.FLY
s.CostStamina = constant.STAMINA_COST_FLY
case proto.MotionState_MOTION_SWIM_DASH:
// 快速游泳
s.CostStamina = constant.StaminaCostConst.SWIM_DASH
s.CostStamina = constant.STAMINA_COST_SWIM_DASH
case proto.MotionState_MOTION_SKIFF_DASH:
// 浪船加速
s.CostStamina = constant.StaminaCostConst.SKIFF_DASH
s.CostStamina = constant.STAMINA_COST_SKIFF_DASH
// 恢复耐力
case proto.MotionState_MOTION_DANGER_RUN, proto.MotionState_MOTION_RUN:
// 正常跑步
s.CostStamina = constant.StaminaCostConst.RUN
s.CostStamina = constant.STAMINA_COST_RUN
case proto.MotionState_MOTION_DANGER_STANDBY_MOVE, proto.MotionState_MOTION_DANGER_STANDBY, proto.MotionState_MOTION_LADDER_TO_STANDBY, proto.MotionState_MOTION_STANDBY_MOVE, proto.MotionState_MOTION_STANDBY:
// 站立
s.CostStamina = constant.StaminaCostConst.STANDBY
s.CostStamina = constant.STAMINA_COST_STANDBY
case proto.MotionState_MOTION_DANGER_WALK, proto.MotionState_MOTION_WALK:
// 走路
s.CostStamina = constant.StaminaCostConst.WALK
s.CostStamina = constant.STAMINA_COST_WALK
case proto.MotionState_MOTION_SKIFF_BOARDING, proto.MotionState_MOTION_SKIFF_NORMAL:
// 浪船正常移动或停下
s.CostStamina = constant.StaminaCostConst.SKIFF_NORMAL
s.CostStamina = constant.STAMINA_COST_SKIFF_NORMAL
case proto.MotionState_MOTION_POWERED_FLY:
// 滑翔加速 (风圈等)
s.CostStamina = constant.StaminaCostConst.POWERED_FLY
s.CostStamina = constant.STAMINA_COST_POWERED_FLY
case proto.MotionState_MOTION_SKIFF_POWERED_DASH:
// 浪船加速 (风圈等)
s.CostStamina = constant.StaminaCostConst.POWERED_SKIFF
s.CostStamina = constant.STAMINA_COST_POWERED_SKIFF
// 缓慢动作将在客户端发送消息后消耗
case proto.MotionState_MOTION_CLIMB, proto.MotionState_MOTION_SWIM_MOVE:
// 缓慢攀爬 或 缓慢游泳