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.
This commit is contained in:
72
SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAddDeck.cs
Normal file
72
SVSim.BattleEngine/Engine/Wizard/AIWhenPlayAddDeck.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class AIWhenPlayAddDeck : AIWhenPlayTagArgument
|
||||
{
|
||||
private AIPolishConvertedExpression _addCount;
|
||||
|
||||
private readonly int COUNT_ARG_INDEX = 1;
|
||||
|
||||
public AIWhenPlayAddDeck(string text)
|
||||
: base(text)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitExpressions(string text)
|
||||
{
|
||||
InitExprList(text);
|
||||
InitializeFilter();
|
||||
base.SelectType = AIScriptTokenArgType.ALL_SELECT;
|
||||
_addCount = _exprList[_exprList.Count - COUNT_ARG_INDEX];
|
||||
}
|
||||
|
||||
public override void Execute(AIVirtualCard tagOwner, AIVirtualField field, List<int> playPtn, AISituationInfo situation = null)
|
||||
{
|
||||
AddDeckAction(tagOwner, field, playPtn, situation);
|
||||
}
|
||||
|
||||
public override void ExecuteForPlayPtnEvaluation(AIVirtualCard owner, AIVirtualField field, List<int> playPtn, AISituationInfo situation)
|
||||
{
|
||||
AddDeckAction(owner, field, playPtn, situation, isPseudo: true);
|
||||
}
|
||||
|
||||
public override void PseudoExecute(AIVirtualField field, AISinglePlayptnRecord record, PlayedCardInfo playInfo, AIVirtualTargetSelectAction situation)
|
||||
{
|
||||
AddDeckAction(playInfo.Card, field, record.PlayPtn, situation, isPseudo: true);
|
||||
}
|
||||
|
||||
private void AddDeckAction(AIVirtualCard tagOwner, AIVirtualField field, List<int> playPtn, AISituationInfo situation = null, bool isPseudo = false)
|
||||
{
|
||||
List<AITokenInformation> tokenIdFromTag = GetTokenIdFromTag(tagOwner, field, playPtn, situation);
|
||||
if (tokenIdFromTag != null)
|
||||
{
|
||||
int tokenCount = (int)_addCount.EvalArg(tagOwner, playPtn, field, situation);
|
||||
for (int i = 0; i < tokenIdFromTag.Count; i++)
|
||||
{
|
||||
field.AddDeckCard(tokenIdFromTag[i].TokenId, tokenCount, tagOwner, playPtn, situation, isPseudo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<AITokenInformation> GetTokenIdFromTag(AIVirtualCard tagOwner, AIVirtualField field, List<int> playPtn, AISituationInfo situation)
|
||||
{
|
||||
List<AIVirtualCard> targetsFromField = GetTargetsFromField(tagOwner, field, playPtn, situation, isBlockDead: false);
|
||||
AITokenIdCollection bothSideTokenIdListFromFilter = AISummonTokenUtility.GetBothSideTokenIdListFromFilter(tagOwner, field, targetsFromField, base.Filters, AITokenType.Default, AIScriptTokenArgType.ALLY, AIScriptTokenArgType.ALL_SELECT, 1, playPtn, situation);
|
||||
if (bothSideTokenIdListFromFilter == null || !bothSideTokenIdListFromFilter.HasAllyToken)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return bothSideTokenIdListFromFilter.AllyTokenIdList;
|
||||
}
|
||||
|
||||
protected override List<AIVirtualCard> GetCandidateRange(AIVirtualField field)
|
||||
{
|
||||
return field.CardListSet.AllReferableCards;
|
||||
}
|
||||
|
||||
public override List<AIVirtualCard> GetTargetsFromField(AIVirtualCard owner, AIVirtualField field, List<int> playPtn, AISituationInfo situation, bool isBlockDead = true)
|
||||
{
|
||||
return GetCandidateRange(field);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user