This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user