Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/AIChoiceTransformUtility.cs
gamer147 957af3d1ec feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
2026-06-05 17:22:20 -04:00

46 lines
1.5 KiB
C#

using System.Collections.Generic;
namespace Wizard;
public static class AIChoiceTransformUtility
{
public static int GetChoiceTransformCost(AIVirtualCard card, AIVirtualField field, List<int> playPtn)
{
if (card == null || card.ChoiceTransformCostList == null || !card.IsInHand)
{
return -1;
}
List<int> playPtn2 = (card.IsAlly ? playPtn : null);
return field.AI.PlayPtnRecorder.GetCardPlaySimulationTypeCost(card, field, playPtn2, null, PlaySimulationType.ChoiceTransform);
}
public static bool IsChoiceTransform(AIVirtualField field, AIVirtualTargetSelectAction situation)
{
if (situation.ActionType != AIOperationType.PLAY)
{
return false;
}
AIVirtualCard originalCard = situation.OriginalCard;
if (originalCard.ChoiceTransformCostList == null || originalCard.ChoiceTransformCostList.Count <= 0)
{
return false;
}
List<int> emptyPlayPtn = EnemyAI.EmptyPlayPtn;
int num = (originalCard.IsAlly ? field.AllyPp : field.EnemyPp);
int num2 = -1;
for (int i = 0; i < originalCard.ChoiceTransformCostList.Count; i++)
{
AIChoiceTransformCostInformation aIChoiceTransformCostInformation = originalCard.ChoiceTransformCostList[i];
if (aIChoiceTransformCostInformation.CheckCondition(originalCard, field, emptyPlayPtn, situation))
{
int num3 = (int)aIChoiceTransformCostInformation.Cost.EvalArg(originalCard, emptyPlayPtn, field, situation);
if (num >= num3 && num3 > num2)
{
num2 = num3;
}
}
}
return num2 >= 0;
}
}