feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
This commit is contained in:
130
SVSim.BattleEngine/Engine/Wizard/AIVirtualAttackInfo.cs
Normal file
130
SVSim.BattleEngine/Engine/Wizard/AIVirtualAttackInfo.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class AIVirtualAttackInfo : AIVirtualActionInfo
|
||||
{
|
||||
public bool IsBreakTarget;
|
||||
|
||||
public bool IsAttackSuccessed;
|
||||
|
||||
public AIVirtualCard AttackTarget { get; private set; }
|
||||
|
||||
public bool IsAttackFollower { get; private set; }
|
||||
|
||||
public AIAttackPreCheckInformation PreCheckInformation { get; private set; }
|
||||
|
||||
public bool IsUsePreCheck => PreCheckInformation != null;
|
||||
|
||||
public AIVirtualAttackInfo(AIVirtualCard sourceCard, bool isAttackFollower, AIVirtualActionInfo premise = null)
|
||||
: base(sourceCard, AIOperationType.ATTACK, null)
|
||||
{
|
||||
IsAttackFollower = isAttackFollower;
|
||||
IsBreakTarget = false;
|
||||
IsAttackSuccessed = false;
|
||||
PreCheckInformation = null;
|
||||
}
|
||||
|
||||
public AIVirtualAttackInfo(AIVirtualCard sourceCard, AIVirtualCard target)
|
||||
: base(sourceCard, AIOperationType.ATTACK, null)
|
||||
{
|
||||
SetAttackTarget(target);
|
||||
IsAttackFollower = true;
|
||||
IsBreakTarget = false;
|
||||
IsAttackSuccessed = false;
|
||||
PreCheckInformation = null;
|
||||
}
|
||||
|
||||
public void SetAttackTarget(AIVirtualCard target)
|
||||
{
|
||||
AttackTarget = target;
|
||||
}
|
||||
|
||||
public override ulong GetHash()
|
||||
{
|
||||
return base.GetHash() * 1262293 + ((AttackTarget != null) ? AttackTarget.GetHash() : 0);
|
||||
}
|
||||
|
||||
public void SetPreCheckInformation(AIAttackPreCheckInformation info)
|
||||
{
|
||||
PreCheckInformation = info;
|
||||
}
|
||||
|
||||
public void PseudoSimulateForEvalInstantAttack(AIVirtualField field, List<int> playPtn, EvalInstantAttackInformation information)
|
||||
{
|
||||
AIPreprocessSimulationUtility.SimulatePreprocess(base.Actor, this, field, AIScriptTokenArgType.WHEN_ATTACK, isPseudo: true);
|
||||
if (base.Actor.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenAttack))
|
||||
{
|
||||
base.Actor.TagCollectionContainer.AttackTags.PseudoExecuteForEvalInstantAttack(base.Actor, this, field, playPtn, information);
|
||||
}
|
||||
if (AttackTarget.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenAttack))
|
||||
{
|
||||
AttackTagCollection attackTags = AttackTarget.TagCollectionContainer.AttackTags;
|
||||
if (attackTags.HasClashTag)
|
||||
{
|
||||
attackTags.PseudoExecuteForEvalInstantAttack(AttackTarget, this, field, playPtn, information);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < field.CardListSet.BothClassAndInplayCards.Count; i++)
|
||||
{
|
||||
AIVirtualCard aIVirtualCard = field.CardListSet.BothClassAndInplayCards[i];
|
||||
if (aIVirtualCard.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenOtherAttack))
|
||||
{
|
||||
aIVirtualCard.TagCollectionContainer.OtherAttackTags.PseudoExecuteForEvalInstantAttack(aIVirtualCard, this, field, playPtn, information);
|
||||
}
|
||||
}
|
||||
AIPreprocessSimulationUtility.ResetPreprocess(this, field);
|
||||
}
|
||||
|
||||
public bool WillTargetDestroyByAttackTags(AIVirtualField field, List<int> playPtn, AIVirtualCard destroyTarget)
|
||||
{
|
||||
AIBarrierPseudoSimulationInfo simBarrier = new AIBarrierPseudoSimulationInfo(destroyTarget);
|
||||
if (base.Actor.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenAttack) && base.Actor.TagCollectionContainer.AttackTags.WillSingleTargetDestroyByAttackTags(base.Actor, this, field, playPtn, simBarrier))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (AttackTarget.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenAttack))
|
||||
{
|
||||
AttackTagCollection attackTags = AttackTarget.TagCollectionContainer.AttackTags;
|
||||
if (attackTags.HasClashTag && attackTags.WillSingleTargetDestroyByAttackTags(AttackTarget, this, field, playPtn, simBarrier))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < field.CardListSet.BothClassAndInplayCards.Count; i++)
|
||||
{
|
||||
AIVirtualCard aIVirtualCard = field.CardListSet.BothClassAndInplayCards[i];
|
||||
if (aIVirtualCard.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenOtherAttack) && aIVirtualCard.TagCollectionContainer.OtherAttackTags.CheckDestroyByAttackTags(aIVirtualCard, this, field, playPtn, simBarrier))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool WillAnyOtherAttackerDestroyed(AIVirtualField field, List<int> playPtn)
|
||||
{
|
||||
List<AIVirtualCard> list = new List<AIVirtualCard>();
|
||||
for (int i = 0; i < field.AllyInplayCards.Count; i++)
|
||||
{
|
||||
AIVirtualCard aIVirtualCard = field.AllyInplayCards[i];
|
||||
if (aIVirtualCard.IsAttackable(EnemyAI.EmptyPlayPtn))
|
||||
{
|
||||
list.Add(aIVirtualCard);
|
||||
}
|
||||
}
|
||||
if (base.Actor.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenAttack) && base.Actor.TagCollectionContainer.AttackTags.WillAnyTargetDestroyByAttackTags(base.Actor, this, field, playPtn, list))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (AttackTarget.TagCollectionContainer.HasTagCollection(TagCollectionType.WhenAttack))
|
||||
{
|
||||
AttackTagCollection attackTags = AttackTarget.TagCollectionContainer.AttackTags;
|
||||
if (attackTags.HasClashTag && attackTags.WillAnyTargetDestroyByAttackTags(AttackTarget, this, field, playPtn, list))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user