1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-02-18 14:33:13 +08:00
committed by cnb
parent 70db1ee68b
commit b483c30109
2 changed files with 19 additions and 8 deletions

View File

@@ -3,6 +3,8 @@ package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/gogf/gf/v2/util/grand"
)
// 32. 进攻类技能有n%几率秒杀对方;a1: n 千分比)
@@ -27,7 +29,8 @@ func (e *NewSel32) OnSkill() bool {
if !e.Ctx().SkillEntity.Hit {
return true
}
success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 1000)
success := grand.Meet(int(e.Args()[0].IntPart()), 1000) // _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 1000)
if !success {
return true
}

View File

@@ -22,15 +22,23 @@ func (e *NewSel48) DamageDivEx(t *info.DamageZone) bool {
if e.Ctx().SkillEntity == nil {
return true
}
if t.Type != info.DamageType.Red {
return true
}
// 检查攻击类型是否匹配攻击类型1=物理攻击,3=特殊攻击)
// 检查攻击类型是否匹配攻击类型1=物理攻击,2=特殊攻击)
attackCategory := int(e.Args()[0].IntPart())
if e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL && attackCategory == 1 {
// 物理攻击无效
t.Damage = alpacadecimal.Zero
} else if e.Ctx().SkillEntity.Category() == info.Category.SPECIAL && attackCategory == 3 {
// 特殊攻击无效
t.Damage = alpacadecimal.Zero
switch attackCategory {
case 1:
if e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL {
// 物理攻击无效
t.Damage = alpacadecimal.Zero
}
case 2:
if e.Ctx().SkillEntity.Category() == info.Category.SPECIAL {
// 特殊攻击无效
t.Damage = alpacadecimal.Zero
}
}
return true