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.
60 lines
2.4 KiB
C#
60 lines
2.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Wizard;
|
|
|
|
public class NetworkSkillPreprocessConditionCheck : SkillPreprocessConditionCheck
|
|
{
|
|
private NetworkBattleSetupCardEvent _networkBattleSetupCardEvent;
|
|
|
|
public NetworkSkillPreprocessConditionCheck(SkillBase skill, string condition)
|
|
: base(skill, condition)
|
|
{
|
|
_networkBattleSetupCardEvent = (BattleManagerBase.GetIns() as NetworkBattleManagerBase)._networkBattleSetupCardEventBase;
|
|
if (_skill != null)
|
|
{
|
|
_skill.OnSkillStart -= _networkBattleSetupCardEvent.EventPreprocessConditionCheck;
|
|
_skill.OnSkillStart += _networkBattleSetupCardEvent.EventPreprocessConditionCheck;
|
|
}
|
|
}
|
|
|
|
public override bool IsRight(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool preexecutionCheck = false)
|
|
{
|
|
if (_networkBattleSetupCardEvent.IsSettingUnapprovedCard(_skill) && RegisterSkillConditionCheck.IsPreprocessConditionCheck(_filter, _skill))
|
|
{
|
|
(_skill._executionInfoCreator as NetworkExecutionInfoCreator).SetReceiveSkillConditionCheck();
|
|
_skill.OnSkillStart -= _networkBattleSetupCardEvent.ReplacePreprocessConditionCheck;
|
|
_skill.OnSkillStart += _networkBattleSetupCardEvent.ReplacePreprocessConditionCheck;
|
|
return true;
|
|
}
|
|
BattleCardBase ownerCard = _skill.SkillPrm.ownerCard;
|
|
GameMgr ins = GameMgr.GetIns();
|
|
if (!ownerCard.IsPlayer && !ins.IsAdminWatch && RegisterFilter.IsFilterPreprocessCondition(_skill) && !GameMgr.GetIns().IsReplayBattle)
|
|
{
|
|
if (preexecutionCheck && _filter.VariableCompareFilter.Any((SkillVariableComareFilter c) => c.Text.Contains(SkillFilterCreator.ContentKeyword.last_target.ToString())))
|
|
{
|
|
List<BattleCardBase> lastTargetCardsList = ownerCard.SelfBattlePlayer.GetLastTargetCardsList(0);
|
|
if (lastTargetCardsList.Count == 0)
|
|
{
|
|
return false;
|
|
}
|
|
if (lastTargetCardsList[0].LastDrawOpenCard == null || lastTargetCardsList[0].LastDrawOpenCard != lastTargetCardsList[0])
|
|
{
|
|
return true;
|
|
}
|
|
bool isSkipPrivateCardCheck = option.IsSkipPrivateCardCheck;
|
|
option.IsSkipPrivateCardCheck = true;
|
|
bool result = base.IsRight(playerInfoPair, option, preexecutionCheck);
|
|
option.IsSkipPrivateCardCheck = isSkipPrivateCardCheck;
|
|
return result;
|
|
}
|
|
return true;
|
|
}
|
|
return base.IsRight(playerInfoPair, option, preexecutionCheck);
|
|
}
|
|
|
|
public ConditionSkillFilterCollection GetConditionSkillFilterCollection()
|
|
{
|
|
return _filter;
|
|
}
|
|
}
|