新纪元

This commit is contained in:
xinian
2026-04-04 06:27:15 +08:00
committed by cnb
parent 3a9932e307
commit 0ac84a9509
11 changed files with 153 additions and 69 deletions

View File

@@ -49,6 +49,31 @@ func (e *EffectNode) GetInput() *input.Input {
return e.Input
}
func (e *EffectNode) SourceInput() *input.Input {
if e.Ctx().Source != nil {
return e.Ctx().Source
}
return e.Input
}
func (e *EffectNode) CarrierInput() *input.Input {
if e.Ctx().Carrier != nil {
return e.Ctx().Carrier
}
return e.Ctx().Our
}
func (e *EffectNode) TargetInput() *input.Input {
if e.Ctx().Target != nil {
return e.Ctx().Target
}
return e.Ctx().Opp
}
func (e *EffectNode) OpponentInput() *input.Input {
return e.Ctx().Opp
}
func (e *EffectNode) Ctx() *input.Ctx {
return &e.EffectContextHolder.Ctx
@@ -140,8 +165,12 @@ func (e *EffectNode) PropBefer(in *input.Input, prop int8, level int8) bool {
}
func (e *EffectNode) ISNaturalEnemy() bool {
t, _ := element.Calculator.GetOffensiveMultiplier(e.Ctx().Opp.CurPet[0].Type, e.Ctx().Our.CurPet[0].Type)
source := e.SourceInput()
opp := e.OpponentInput()
if source == nil || opp == nil || source.CurPet[0] == nil || opp.CurPet[0] == nil {
return false
}
t, _ := element.Calculator.GetOffensiveMultiplier(opp.CurPet[0].Type, source.CurPet[0].Type)
if t <= 1 {
return false