Files
bl/logic/service/fight/effect/461.go
昔念 d16e079725 ```
fix(fight): 修复效果持续时间设置错误和命中计算参数类型问题

- 修正Effect461中Duration参数从-1改为1,解决持续时间异常问题
- 删除Effect486文件,移除废弃的效果实现
- 修正processSkillAttack中AttackTimeC参数类型,从int转为正确类型
- 在copySkill中添加Accuracy属性复制,解决技能命中丢失问题
- 修正CalculateRealValue函数stat参数类型从int改为int8
- 修正AttackTimeC和GetAccuracy函数level参数类型从int改为int8
- 优化Get
2026-03-09 19:16:17 +08:00

51 lines
1.1 KiB
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 461 - 使用后若自身体力低于1/m则从下回合开始必定致命一击
type Effect461 struct {
node.EffectNode
can bool
}
func (e *Effect461) Skill_Use() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
threshold := maxHp.Div(e.Args()[1]) // 1/m
if currentHp.Cmp(threshold) < 0 {
e.can = true
}
return true
}
func (e *Effect461) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(1) // 持续n回合
}
func (e *Effect461) ActionStart(a, b *action.SelectSkillAction) bool {
if !e.can {
return true
}
//fmt.Println(e.Ctx().SkillEntity)
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 461, &Effect461{})
}