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

71 lines
2.7 KiB
C#

using System.Linq;
using Wizard;
using Wizard.Battle.UI;
using Wizard.Battle.View.Vfx;
internal class Skill_repeat_skill : SkillBase
{
public Skill_repeat_skill(SkillParameter skillPrm, string option)
: base(skillPrm, option)
{
}
public override VfxWithLoading Start(CallParameter parameter)
{
VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
string option = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.repeat_type);
string targetOption = base.OptionValue.GetString(SkillFilterCreator.ContentKeyword.target, "unit");
SkillGainType gainType = SkillGainType.Null;
if (IsBattleLog)
{
string option2 = base.OptionValue.GetOption(SkillFilterCreator.ContentKeyword.repeat_type, "_OPT_NULL_");
gainType = ((option2 != null && option2 == "when_destroy") ? SkillGainType.RepeatLastWord : SkillGainType.Null);
}
foreach (BattleCardBase targetCard in parameter.targetCards)
{
if (targetCard is ClassBattleCardBase && !targetCard.SkillApplyInformation.RepeatSkillTimingList.Any((RepeatSkillInfo s) => s.Timing == option && s.Target == targetOption))
{
vfxWithLoadingSequential.RegisterToMainVfx(targetCard.SkillApplyInformation.GiveRepeatSkill(option, targetOption, this));
CardParameter baseParameter = base.SkillPrm.ownerCard.BaseParameter;
BuffInfo buffInfo = new BuffInfo(baseParameter.BaseCardId, baseParameter.NormalCardId, this);
targetCard.AddBuffInfo(buffInfo);
if (targetCard.IsClass)
{
UpdateClassBuffIfActive(targetCard);
}
BuffInfoContainer item = new BuffInfoContainer(targetCard, buffInfo, -1, "", null, 0L);
buffInfoContainer.Add(item);
}
}
vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(base.SkillPrm.resourceMgr, parameter.targetCards));
if (IsBattleLog && !base.SkillPrm.selfBattlePlayer.Class.IsDead && base.SkillPrm.ownerCard.SelfBattlePlayer.Class.SkillApplyInformation.RepeatSkillTimingList.Where((RepeatSkillInfo s) => s.Timing == option).Count() <= 1)
{
BattleLogManager.GetInstance().AddLogSkillGain(parameter.targetCards.ToList(), this, gainType);
}
return vfxWithLoadingSequential;
}
public override VfxWithLoading Stop(SkillProcessor skillProcessor)
{
base.Stop(skillProcessor);
foreach (BuffInfoContainer item in buffInfoContainer)
{
item._targetCard.RemoveBuffInfo(item._buffInfo);
if (item._targetCard.IsClass)
{
UpdateClassBuffIfActive(item._targetCard);
}
}
return NullVfxWithLoading.GetInstance();
}
public static bool CheckCardType(string cardType, BattleCardBase card)
{
if ((cardType == "unit" && card.IsUnit) || (cardType == "field" && card.IsField))
{
return true;
}
return false;
}
}