Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/AIChangePpTotalBuff.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

61 lines
2.2 KiB
C#

using System.Collections.Generic;
namespace Wizard;
public class AIChangePpTotalBuff : AIWhenChangeInplayTagArgument
{
private const int LIFE_OFFSET = 1;
private const int ATTACK_OFFSET = 2;
public AIPolishConvertedExpression Attack { get; private set; }
public AIPolishConvertedExpression Life { get; private set; }
protected override int SELECT_TYPE_OFFSET => 3;
public AIChangePpTotalBuff(string text, bool isImmediate)
: base(text, isImmediate)
{
}
protected override void InitExpressions(string text)
{
base.InitExpressions(text);
Attack = _exprList[_exprList.Count - 2];
Life = _exprList[_exprList.Count - 1];
}
private void BuffTargets(List<AIVirtualCard> targets, AIBuffExecutingInfo_old buffInfo, AIVirtualCard tagOwner, AIVirtualField field, List<int> playPtn, AISituationInfo situation = null)
{
if (targets != null && targets.Count > 0)
{
if (base.SelectType == AIScriptTokenArgType.ALL_SELECT)
{
AIBuffSimulationUtility.BuffAll_old(targets, field, buffInfo, isTemp: false, playPtn, situation);
}
else
{
AIConsoleUtility.LogError($"AIChangePpTotalBuff.BuffTargets(): SelectType is Ileagl [type:{base.SelectType}]");
}
}
}
protected override void ChangeInplayTagStartProcess(List<AIVirtualCard> targets, AIVirtualField field, AIVirtualCard tagOwner, List<int> playPtn, AISituationInfo situation)
{
AIBuffExecutingInfo_old buffExecutingInfo_old = AIBuffSimulationUtility.GetBuffExecutingInfo_old(tagOwner, field, situation, playPtn, Attack, Life);
BuffTargets(targets, buffExecutingInfo_old, tagOwner, field, playPtn, situation);
}
protected override void ChangeInplayTagStopProcess(List<AIVirtualCard> targets, AIVirtualField field, AIVirtualCard tagOwner, List<int> playPtn, AISituationInfo situation)
{
AIBuffExecutingInfo_old buffExecutingInfo_old = AIBuffSimulationUtility.GetBuffExecutingInfo_old(tagOwner, field, situation, playPtn, Attack, Life);
if (!buffExecutingInfo_old.IsMultiplyAttack && !buffExecutingInfo_old.IsMultiplyLife)
{
buffExecutingInfo_old.AttackValue *= -1;
buffExecutingInfo_old.LifeValue *= -1;
BuffTargets(targets, buffExecutingInfo_old, tagOwner, field, playPtn, situation);
}
}
}