法器角色轻击消耗修复

This commit is contained in:
UnKownOwO
2022-12-20 08:58:45 +08:00
parent 64c2244877
commit 61e8ed92b1
2 changed files with 13 additions and 5 deletions

View File

@@ -229,9 +229,11 @@ func (t *TickManager) onTickSecond(now int64) {
func (t *TickManager) onTick200MilliSecond(now int64) {
// 耐力消耗
for _, player := range USER_MANAGER.GetAllOnlineUserList() {
GAME_MANAGER.SustainStaminaHandler(player)
GAME_MANAGER.VehicleRestoreStaminaHandler(player)
for _, world := range WORLD_MANAGER.worldMap {
for _, player := range world.playerMap {
GAME_MANAGER.SustainStaminaHandler(player)
GAME_MANAGER.VehicleRestoreStaminaHandler(player)
}
}
}

View File

@@ -58,8 +58,14 @@ func (g *GameManager) HandleAbilityStamina(player *model.Player, entry *proto.Ab
if avatarAbility == nil {
return
}
// 重击对应的耐力消耗
g.ChargedAttackStamina(player, worldAvatar, avatarAbility)
// 距离技能开始过去的时间
pastTime := time.Now().UnixMilli() - player.StaminaInfo.LastSkillTime
// 法器角色轻击也会算触发重击消耗
// 所以通过策略判断 必须距离技能开始过去200ms才算重击
if player.StaminaInfo.LastSkillId == uint32(avatarAbility.AvatarSkillId) && pastTime > 200 {
// 重击对应的耐力消耗
g.ChargedAttackStamina(player, worldAvatar, avatarAbility)
}
default:
break
}