mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-11 14:52:26 +08:00
重击耐力消耗、持续耐力消耗完善
This commit is contained in:
@@ -47,7 +47,11 @@ func (p *Player) InitAllAvatar() {
|
||||
}
|
||||
|
||||
func (p *Player) InitAvatar(avatar *Avatar) {
|
||||
avatarDataConfig := gdc.CONF.AvatarDataMap[int32(avatar.AvatarId)]
|
||||
avatarDataConfig, ok := gdc.CONF.AvatarDataMap[int32(avatar.AvatarId)]
|
||||
if !ok {
|
||||
logger.LOG.Error("avatarDataConfig error, avatarId: %v", avatar.AvatarId)
|
||||
return
|
||||
}
|
||||
// 角色战斗属性
|
||||
avatar.FightPropMap = make(map[uint32]float32)
|
||||
avatar.FightPropMap[uint32(constant.FightPropertyConst.FIGHT_PROP_NONE)] = 0.0
|
||||
|
||||
@@ -2,12 +2,21 @@ package model
|
||||
|
||||
import (
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
)
|
||||
|
||||
type StaminaInfo struct {
|
||||
State proto.MotionState // 动作状态
|
||||
CostStamina int32 // 消耗或恢复的耐力
|
||||
RestoreDelay uint8 // 恢复延迟
|
||||
LastCasterId uint32 // 最后释放技能者的Id
|
||||
LastSkillId uint32 // 最后释放的技能Id
|
||||
LastSkillTime int64 // 最后释放技能的时间
|
||||
}
|
||||
|
||||
// SetLastSkill 记录技能以便后续使用
|
||||
func (s *StaminaInfo) SetLastSkill(casterId uint32, skillId uint32) {
|
||||
s.LastCasterId = casterId
|
||||
s.LastSkillId = skillId
|
||||
s.LastSkillTime = time.Now().UnixMilli()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user