新纪元
This commit is contained in:
@@ -46,6 +46,11 @@ func registerPhysicalAttackAddStatusEffects() {
|
||||
// 核心逻辑:受物理攻击时触发(覆盖父类方法)
|
||||
// -----------------------------------------------------------
|
||||
func (e *EffectPhysicalAttackAddStatus) Skill_Use_ex() bool {
|
||||
source := e.SourceInput()
|
||||
target := e.OpponentInput()
|
||||
if source == nil || target == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
// 2. 技能为空或非物理攻击,不触发
|
||||
skill := e.Ctx().SkillEntity
|
||||
@@ -54,19 +59,19 @@ func (e *EffectPhysicalAttackAddStatus) Skill_Use_ex() bool {
|
||||
}
|
||||
|
||||
// 3. 概率判定(Args()[1]为触发概率)
|
||||
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
success, _, _ := source.Player.Roll(int(e.Args()[1].IntPart()), 100)
|
||||
if !success {
|
||||
return true
|
||||
}
|
||||
|
||||
// 5. 获取状态效果实例并设置参数
|
||||
statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.targetStatus))
|
||||
statusEffect := source.InitEffect(input.EffectType.Status, int(e.targetStatus))
|
||||
if statusEffect == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
// 6. 给对手添加状态
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect)
|
||||
target.AddEffect(source, statusEffect)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user