fix(fight): 修复战斗命中判断逻辑并移除冗余命中检查 - 修复 NewSel32 中的命中判断,将 Side 字段改为 Hit 字段 - 移除 EffectAttackMiss 中的冗余命中判断逻辑 - 移除 EffectDefeatTrigger 中的重复命中检查 - 移除 EffectPhysicalAttackAddStatus 中的冗余命中判断 - 移除多个效果文件中的重复命中检查逻辑 - 修正 Effect136 中的命中处理逻辑,确保在技能命中时正确触发 - 移除其他多个效果中的重复命中检查代码 ```
54 lines
1.0 KiB
Go
54 lines
1.0 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
)
|
||
|
||
/**
|
||
* n回合,若自己先手,则m%几率让对手害怕1到3回合
|
||
*/
|
||
|
||
func init() {
|
||
t := &Effect117{
|
||
EffectNode: node.EffectNode{},
|
||
}
|
||
|
||
input.InitEffect(input.EffectType.Skill, 117, t)
|
||
|
||
}
|
||
|
||
type Effect117 struct {
|
||
node.EffectNode
|
||
}
|
||
|
||
// 默认添加回合
|
||
func (e *Effect117) SetArgs(t *input.Input, a ...int) {
|
||
|
||
e.EffectNode.SetArgs(t, a...)
|
||
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
||
|
||
}
|
||
func (e *Effect117) OnSkill() bool {
|
||
|
||
if e.Input.FightC.IsFirst(e.Input.Player) {
|
||
// 概率判定
|
||
ok, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100)
|
||
if !ok {
|
||
return true
|
||
}
|
||
// 获取状态效果
|
||
eff := input.Geteffect(input.EffectType.Status, int(info.PetStatus.Fear))
|
||
if eff == nil {
|
||
return true
|
||
}
|
||
duration := int(e.Input.FightC.GetRand().Int31n(3)) // 默认随机 1~3 回合
|
||
|
||
eff.Duration(duration)
|
||
e.Ctx().Opp.AddEffect(e.Ctx().Our, eff)
|
||
}
|
||
|
||
return true
|
||
}
|