fix(fight): 修复技能命中和伤害计算逻辑错误
- 修正 `Effect7` 中敌我双方血量判断逻辑,确保技能命中率和伤害值正确计算 - 调整 `FightC` 中技能攻击流程,统一使用 `Exec` 替代 `ExecCace` 执行效果 - 移除重复的 `AddEffects` 方法,简化效果添加逻辑 - 注释暂未使用的逻辑,避免无效调用影响战斗流程 - 增加战斗超时保护机制,防止协程泄漏 - 优化玩家离线保存逻辑
This commit is contained in:
@@ -25,7 +25,7 @@ type Effect7 struct {
|
||||
}
|
||||
|
||||
func (e *Effect7) Skill_Hit_Pre() bool {
|
||||
if e.Ctx().Our.CurrentPet.Info.Hp <= e.Input.CurrentPet.Info.Hp {
|
||||
if e.Ctx().Opp.CurrentPet.Info.Hp <= e.Ctx().Our.CurrentPet.Info.Hp {
|
||||
e.Ctx().SkillEntity.Accuracy = 0
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func (e *Effect7) Damage_Floor() bool {
|
||||
}
|
||||
fmt.Println("Effect7_old", e.Ctx().DamageZone.Damage.IntPart())
|
||||
if e.Ctx().DamageZone.Type == info.DamageType.Red {
|
||||
e.Ctx().DamageZone.Damage = decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.Hp - e.Ctx().Opp.CurrentPet.Info.Hp))
|
||||
e.Ctx().DamageZone.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp - e.Ctx().Our.CurrentPet.Info.Hp))
|
||||
|
||||
}
|
||||
fmt.Println("Effect7_new", e.Ctx().DamageZone.Damage.IntPart())
|
||||
|
||||
Reference in New Issue
Block a user