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:
90
SVSim.BattleEngine/Engine/SkillPreprocessOpenCard.cs
Normal file
90
SVSim.BattleEngine/Engine/SkillPreprocessOpenCard.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Wizard;
|
||||
using Wizard.Battle.UI;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class SkillPreprocessOpenCard : SkillPreprocessBase
|
||||
{
|
||||
private readonly BattleCardBase _ownerCard;
|
||||
|
||||
public const float WAIT_TIME = 0.5f;
|
||||
|
||||
public static readonly string HAND_SKILL_1_EFFECT = "stt_act_handskill_1";
|
||||
|
||||
public static readonly string HAND_SKILL_1_SE = "se_stt_act_handskill_1";
|
||||
|
||||
public SkillPreprocessOpenCard(BattleCardBase ownerCard)
|
||||
{
|
||||
_ownerCard = ownerCard;
|
||||
}
|
||||
|
||||
public override bool IsRight(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool PreexecutionCheck = false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override VfxBase Start(BattlePlayerPair playerPair, SkillBase skill, SkillProcessor skillProcessor, SkillOptionValue optionValue, SkillConditionCheckerOption checkerOption)
|
||||
{
|
||||
skill.SetAndAddPublishedActiveSkillCount();
|
||||
if (IsOpenCardAfterSkill(skill))
|
||||
{
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
return CreateOpenCardVfx(skill);
|
||||
}
|
||||
|
||||
private bool IsOpenCardAfterSkill(SkillBase skill)
|
||||
{
|
||||
if (skill.ApplyingTargetFilter is SkillTargetHandSelfFilter)
|
||||
{
|
||||
if (!(skill is Skill_cost_change) && !(skill is Skill_powerup) && !(skill is Skill_power_down))
|
||||
{
|
||||
return skill is Skill_power_modifier;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public VfxBase CreateOpenCardVfx(SkillBase skill)
|
||||
{
|
||||
BattleCardBase ownerCard = _ownerCard;
|
||||
if (!_ownerCard.SelfBattlePlayer.BattleMgr.IsVirtualBattle)
|
||||
{
|
||||
BattleLogManager.GetInstance().AddLogOpenCard(_ownerCard);
|
||||
}
|
||||
List<BattleCardBase> list = new List<BattleCardBase>();
|
||||
list.Add(ownerCard);
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
if (ownerCard.SelfBattlePlayer.IsPlayer)
|
||||
{
|
||||
if (!IsOpenCardAfterSkill(skill))
|
||||
{
|
||||
_ownerCard.SelfBattlePlayer.CallOnOpenCard(_ownerCard);
|
||||
}
|
||||
Transform transform = ownerCard.BattleCardView.GameObject.transform;
|
||||
sequentialVfxPlayer.Register(new LoadAndPlayEffectVfx(HAND_SKILL_1_EFFECT, HAND_SKILL_1_SE, transform, 0.5f, isFollowAll: true));
|
||||
}
|
||||
else
|
||||
{
|
||||
_ownerCard.SelfBattlePlayer.CallOnOpenCard(_ownerCard);
|
||||
if (ownerCard.BattleCardView != null)
|
||||
{
|
||||
List<int> costList = ownerCard.BattleCardView.GetUseCostList(ownerCard.Cost, useNomalCost: true);
|
||||
bool isInHand = ownerCard.IsInHand;
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
ownerCard.BattleCardView.UpdateCost(costList, isGenerateInHand: true, playEffect: true, isInHand);
|
||||
}));
|
||||
}
|
||||
sequentialVfxPlayer.Register(new OpenCardFromHandVfx(ownerCard.BattleCardView, ownerCard.IsLegend));
|
||||
sequentialVfxPlayer.Register(new PlayerEndDrawVfx(list));
|
||||
if (ownerCard == ownerCard.LastDrawOpenCard)
|
||||
{
|
||||
sequentialVfxPlayer.Register(ownerCard.SelfBattlePlayer.BattleView.HandView.ShuffleHand());
|
||||
}
|
||||
}
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user