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:
77
SVSim.BattleEngine/Engine/SkillPreprocessNecromance.cs
Normal file
77
SVSim.BattleEngine/Engine/SkillPreprocessNecromance.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Wizard;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class SkillPreprocessNecromance : SkillPreprocessBase
|
||||
{
|
||||
private readonly int _necromanceCount;
|
||||
|
||||
private readonly string _operator;
|
||||
|
||||
private string _countText = string.Empty;
|
||||
|
||||
private SkillBase _skill;
|
||||
|
||||
public bool IsApproximate => _operator == "<:=";
|
||||
|
||||
public SkillPreprocessNecromance(SkillBase skill, string countText, string op)
|
||||
{
|
||||
if (SkillOptionValue.IsVariableValue(countText))
|
||||
{
|
||||
_countText = countText;
|
||||
}
|
||||
else
|
||||
{
|
||||
_necromanceCount = int.Parse(countText);
|
||||
}
|
||||
_operator = op;
|
||||
_skill = skill;
|
||||
}
|
||||
|
||||
public override bool IsRight(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool PreexecutionCheck = false)
|
||||
{
|
||||
return playerInfoPair.ReadOnlySelf.SkillInfoCemeterys.Count() >= NecromanceCount(playerInfoPair.ReadOnlySelf.SkillInfoCemeterys.Count(), playerInfoPair, option);
|
||||
}
|
||||
|
||||
public override VfxBase Start(BattlePlayerPair playerPair, SkillBase skill, SkillProcessor skillProcessor, SkillOptionValue optionValue, SkillConditionCheckerOption checkerOption)
|
||||
{
|
||||
BattleLogManager.GetInstance().AddNecromanceIcon(skill, skill.SkillPrm.ownerCard, skill.SkillPrm.ownerCard.IsSpell);
|
||||
bool num = skill.SkillPrm.ownerCard.GetSelectTypeSkill().Any((SkillBase s) => s.IsChoiceType);
|
||||
bool flag = skill.SkillPrm.ownerCard.Skills.Any((SkillBase s) => s is Skill_transform);
|
||||
if (num && flag)
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
int num2 = NecromanceCount(playerPair.Self.CemeteryList.Count, playerPair, checkerOption);
|
||||
playerPair.Self.CemeteryConsumption(num2, skill.SkillPrm.ownerCard, skillProcessor, skill.OnWhenFusion != 0);
|
||||
if (!skill.SkillPrm.ownerCard.IsSpell && (skill.OnWhenFusion == 0 || skill.SkillPrm.ownerCard.IsPlayer || GameMgr.GetIns().IsAdminWatch))
|
||||
{
|
||||
return new NecromanceSkillActivationVfx(skill.SkillPrm.ownerCard.BattleCardView);
|
||||
}
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
|
||||
public int NecromanceCount(int cemeteryCount, BattlePlayerReadOnlyInfoPair pair = null, SkillConditionCheckerOption checkerOption = null)
|
||||
{
|
||||
if (IsApproximate)
|
||||
{
|
||||
return Math.Max(0, Math.Min(_necromanceCount, cemeteryCount));
|
||||
}
|
||||
if (_countText != string.Empty)
|
||||
{
|
||||
if (pair == null)
|
||||
{
|
||||
pair = new BattlePlayerReadOnlyInfoPair(_skill.SkillPrm.selfBattlePlayer, _skill.SkillPrm.opponentBattlePlayer);
|
||||
}
|
||||
if (checkerOption == null)
|
||||
{
|
||||
checkerOption = new SkillConditionCheckerOption();
|
||||
}
|
||||
SkillCollectionBase.SetupOptionValue(_skill.OptionValue, pair, _skill.SkillPrm.ownerCard, _skill, checkerOption);
|
||||
return _skill.OptionValue.ParseInt(_countText);
|
||||
}
|
||||
return _necromanceCount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user