using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Cute;
using LitJson;
using UnityEngine;
using Wizard;
using Wizard.Battle;
using Wizard.Battle.UI;
using Wizard.Battle.View;
using Wizard.Battle.View.Vfx;
using Wizard.BattleMgr;

public class NewReplayBattleMgr : NetworkReplayBattleMgr
{
	public class ParameterModifierInfo
	{
		public NetworkBattleReceiver.ReplayParameterModifierType ModifierType;

		public int ModifierValue;

		public ParameterModifierInfo(NetworkBattleReceiver.ReplayParameterModifierType modifierType, int modifierValue)
		{
			ModifierType = modifierType;
			ModifierValue = modifierValue;
		}
	}

	private class BattleLogInfo
	{
		public string IndexName;

		public int CardId;

		public bool IsSelf;

		public bool IsPlayerSideTurn;

		public int Turn;

		public Wizard.Battle.UI.LogType Type;

		public string RightValueText;

		public int CardWithCount;

		public int[] RandomArray;

		public BattleLogItemType ItemType;

		public bool IsMinus;

		public bool IsNecromance;

		public bool IsDead;

		public BattleLogItem.CardTextureOption TextureOption;

		public int MulliganChangedCount;

		public BattleLogInfo(string indexName, int cardId, bool isSelf, bool isPlayerSideTurn, int turn, Wizard.Battle.UI.LogType type, string rightValueText, int cardWithCount, int[] randomArray, BattleLogItemType itemType, bool isMinus, bool isNecromance, bool isDead, BattleLogItem.CardTextureOption textureOption, int mulliganCount)
		{
			IndexName = indexName;
			CardId = cardId;
			IsSelf = isSelf;
			IsPlayerSideTurn = isPlayerSideTurn;
			Turn = turn;
			Type = type;
			RightValueText = rightValueText;
			CardWithCount = cardWithCount;
			RandomArray = randomArray;
			ItemType = itemType;
			IsMinus = isMinus;
			IsNecromance = isNecromance;
			IsDead = isDead;
			TextureOption = textureOption;
			MulliganChangedCount = mulliganCount;
		}
	}

	public enum BattleLogItemType
	{
		Turn,
		Inner,
		SkillTiming,
		Damage,
		Heal,
		SkillTarget
	}

	public class BattleInfoData
	{
		public int Priority;

		public int Value;

		public List<int> DisplayCardIndexList = new List<int>();

		public List<int> DisplayCardIdList = new List<int>();
	}

	public class BattleLogTextureInfo
	{
		public string TexturePath { get; private set; }

		public string LogHeaderAssetPath { get; private set; }

		public UITexture HeaderUITexture { get; private set; }

		public Action<Texture> OnLoad { get; private set; }

		public BattleLogTextureInfo(string texturePath, string logHeaderAssetPath, UITexture headerUITexture, Action<Texture> onLoad)
		{
			TexturePath = texturePath;
			LogHeaderAssetPath = logHeaderAssetPath;
			HeaderUITexture = headerUITexture;
			OnLoad = onLoad;
		}
	}

	private GameObject _moveTurnDialog;

	private ReplayMoveTurnButton _moveTurnButton;

	private UILabel _moveTurnButtonLabel;

	private List<int> _turnStartIndexList;

	private JsonData _turnStartInfoList;

	private JsonData _preLoadResourceList;

	private List<BattleLogInfo> _battleLogInfoList;

	private int _lastBattleLogIndex;

	private List<NetworkBattleReceiver.CardInfo> _lastCardInfoList;

	public List<BattleInfoData> PlayerBattleInfoData = new List<BattleInfoData>();

	public List<BattleInfoData> EnemyBattleInfoData = new List<BattleInfoData>();

	private ReplaySkipAnimation _replaySkipAnimation;

	public List<GameObject> StopEffectObjectList = new List<GameObject>();

	public bool IsDuringSkillProcess;

	public Stack<VfxWithLoadingSequential> SkillVfxStack = new Stack<VfxWithLoadingSequential>();

	public const string REPLAY_FILE_DIRECTORY_NAME = "NewReplay";

	public const string REPLAY_NETWORK_FILE_NAME = "replay_network.json";

	public const string REPLAY_INFO_FILE_NAME = "replay_info.json";

	public const string REPLAY_TURN_START_INFO_FILE_NAME = "replay_turn_start.json";

	public const string REPLAY_BATTLE_LOG_INFO_FILE_NAME = "replay_battle_log.json";

	public const string REPLAY_LOAD_RESOURCES_INFO_FILE_NAME = "replay_load_resources.json";

	public const string PRE_LOAD_RESOURCES_NAME = "pre_load_resource_list";

	private const string EFFECT_FILE_NAME = "stt_act_costdown_1";

	private const string SE_FILE_NAME = "se_stt_act_costdown_1";

	public bool IsSelecting { get; set; }

	public bool IsChoiceSelecting { get; set; }

	public bool IsFusionSelecting { get; set; }

	public BattleCardBase ActCard { get; set; }

	public bool IsEvolve { get; set; }

	public bool IsRightAfterMoveTurn { get; set; }

	public bool IsMoveTurnScheduled { get; private set; }

	public static void DeleteReplayFiles()
	{
		string path = Application.persistentDataPath + "/NewReplay";
		if (Directory.Exists(path))
		{
			Directory.Delete(path, recursive: true);
		}
	}

	public static JsonData ReadJson(string fileName)
	{
		using StreamReader streamReader = new StreamReader(fileName);
		return JsonMapper.ToObject(CryptAES.decryptForNode(streamReader.ReadToEnd()));
	}

	public NewReplayBattleMgr(IBattleMgrContentsCreator contentsCreator)
		: base(contentsCreator)
	{
		_turnStartIndexList = Data.ReplayBattleInfo.TurnStartIndexList;
		string replayDataDirectoryPath = Application.persistentDataPath + "/NewReplay";
		string[] files = Directory.GetFiles((from d in Directory.GetDirectories(replayDataDirectoryPath, "*", SearchOption.TopDirectoryOnly)
			select d.Replace("\\", "/")).FirstOrDefault((string f) => f == replayDataDirectoryPath + "/" + GameMgr.GetIns().GetDataMgr().BattleId), "*", SearchOption.AllDirectories);
		string fileName = files.FirstOrDefault((string x) => x.Contains("replay_turn_start.json"));
		_turnStartInfoList = ReadJson(fileName);
		_battleLogInfoList = new List<BattleLogInfo>();
		JsonData jsonData = ReadJson(files.FirstOrDefault((string x) => x.Contains("replay_battle_log.json")));
		for (int num = 0; num < jsonData.Count; num++)
		{
			int[] array = null;
			if (jsonData[num].Keys.Contains(67.ToString()))
			{
				JsonData jsonData2 = jsonData[num][67.ToString()];
				array = new int[jsonData2.Count];
				for (int num2 = 0; num2 < jsonData2.Count; num2++)
				{
					array[num2] = Convert.ToInt32(jsonData2[num2].ToString());
				}
			}
			_battleLogInfoList.Add(new BattleLogInfo(jsonData[num][63.ToString()].ToString(), jsonData[num][0.ToString()].ToInt(), jsonData[num][2.ToString()].ToInt() == 1, jsonData[num][105.ToString()].ToInt() == 1, jsonData[num][3.ToString()].ToInt(), (Wizard.Battle.UI.LogType)jsonData[num][64.ToString()].ToInt(), jsonData[num][65.ToString()].ToString(), jsonData[num][66.ToString()].ToInt(), array, (BattleLogItemType)jsonData[num][68.ToString()].ToInt(), jsonData[num][69.ToString()].ToInt() == 1, jsonData[num][70.ToString()].ToInt() == 1, jsonData[num][71.ToString()].ToInt() == 1, (BattleLogItem.CardTextureOption)jsonData[num][100.ToString()].ToInt(), jsonData[num][106.ToString()].ToInt()));
		}
	}

	public override void StartOpening(int FirstAttack)
	{
		base.StartOpening(FirstAttack);
		_moveTurnDialog = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Replay/ReplayMoveTurnDialog"));
		_moveTurnDialog.transform.parent = BtlUIContainer.transform;
		_moveTurnDialog.transform.localScale = Vector3.one;
		ReplayMoveTurnPanel component = _moveTurnDialog.GetComponent<ReplayMoveTurnWindow>().InnerPanel.GetComponent<ReplayMoveTurnPanel>();
		UnityEngine.Object itemObject = Resources.Load("Prefab/UI/Replay/ReplayMoveTurnItem");
		for (int i = 0; i < _turnStartInfoList.Count; i++)
		{
			CreateMoveTurnItem(itemObject, component.LogGrid.transform, i + 1);
		}
		component.LogGrid.Reposition();
		component.ScrollView.ResetPosition();
		_moveTurnDialog.SetActive(value: false);
		_moveTurnButton = ((GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefab/UI/Replay/ReplayMoveTurnButton"))).GetComponent<ReplayMoveTurnButton>();
		_moveTurnButton.transform.parent = BtlUIContainer.transform;
		_moveTurnButton.transform.localScale = Vector3.one;
		UpdateMoveTurnButton(0);
		_moveTurnButton.gameObject.SetActive(value: false);
		_moveTurnButtonLabel = _moveTurnButton.GetComponentInChildren<UILabel>();
		_moveTurnButtonLabel.text = Data.SystemText.Get("Battle_0519", "1");
		_moveTurnButton.MenuButton.onClick.Add(new EventDelegate(delegate
		{
			PauseReplay();
			SetActiveMoveTurnDialog(isActive: true);
		}));
		_moveTurnButton.BackButton.onClick.Add(new EventDelegate(delegate
		{
			int num2 = (IsRightAfterMoveTurn ? (BattlePlayer.Turn + 1) : BattlePlayer.Turn);
			if (num2 > 1)
			{
				DisableMoveTurnButton();
				OperateMgr.BattleLogManager.DisableButton();
				base.BattleUIContainer.DisableMenu(isForceDisable: true);
				MoveTurn(num2 - 1);
			}
		}));
		_moveTurnButton.ForwardButton.GetComponent<WizardUIButton>().IsNewReplayForwardButton = true;
		_moveTurnButton.ForwardButton.onClick.Add(new EventDelegate(delegate
		{
			int num2 = (IsRightAfterMoveTurn ? (BattlePlayer.Turn + 1) : BattlePlayer.Turn);
			if (num2 < _turnStartInfoList.Count)
			{
				DisableMoveTurnButton();
				OperateMgr.BattleLogManager.DisableButton();
				base.BattleUIContainer.DisableMenu(isForceDisable: true);
				MoveTurn(num2 + 1);
			}
		}));
		UISprite stopReplayBtnSprite = _moveTurnButton.StopReplayButton.transform.GetChild(0).GetComponent<UISprite>();
		_moveTurnButton.StopReplayButton.onClick.Add(new EventDelegate(delegate
		{
			GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
			base.isStopReplay = !base.isStopReplay;
			if (base.isStopReplay)
			{
				stopReplayBtnSprite.spriteName = "btn_replay_play";
				UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: false);
			}
			else
			{
				stopReplayBtnSprite.spriteName = "btn_replay_pause";
				UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: true);
			}
		}));
		_moveTurnButton.ForwardReplayButton.onClick.Add(new EventDelegate(delegate
		{
			GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
			base.isForwardReplay = true;
		}));
		UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: true);
		StopReplayBtn.onClick.Add(new EventDelegate(delegate
		{
			if (base.isStopReplay)
			{
				stopReplayBtnSprite.spriteName = "btn_replay_play";
				UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: false);
			}
			else
			{
				stopReplayBtnSprite.spriteName = "btn_replay_pause";
				UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: true);
			}
		}));
		GameObject gameObject = NGUITools.AddChild(base.BattleUIContainer.gameObject, LoadPrefab("Prefab/UI/Replay/ReplaySkipAnimation"));
		_replaySkipAnimation = gameObject.GetComponent<ReplaySkipAnimation>();
		_replaySkipAnimation.SetUp();
		string replayDataDirectoryPath = Application.persistentDataPath + "/NewReplay";
		string text = Directory.GetFiles((from d in Directory.GetDirectories(replayDataDirectoryPath, "*", SearchOption.TopDirectoryOnly)
			select d.Replace("\\", "/")).FirstOrDefault((string f) => f == replayDataDirectoryPath + "/" + GameMgr.GetIns().GetDataMgr().BattleId), "*", SearchOption.AllDirectories).FirstOrDefault((string x) => x.Contains("replay_info.json"));
		if (!string.IsNullOrEmpty(text))
		{
			_preLoadResourceList = ReadJson(text);
		}
		List<string> list = new List<string>();
		for (int num = 0; num < _preLoadResourceList["pre_load_resource_list"].Count; num++)
		{
			string text2 = _preLoadResourceList["pre_load_resource_list"][num].ToString();
			list.Add(Toolbox.ResourcesManager.GetAssetTypePath(text2, ResourcesManager.AssetLoadPathType.Effect2D));
			list.Add("s/se_" + text2 + ".acb");
		}
		ImmediateVfxMgr.GetInstance().Register(new WaitLoadResourceVfx(list));
	}

	private GameObject LoadPrefab(string path)
	{
		PrefabMgr prefabMgr = GameMgr.GetIns().GetPrefabMgr();
		prefabMgr.Load(path);
		return prefabMgr.Get(path);
	}

	private void CreateMoveTurnItem(UnityEngine.Object itemObject, Transform table, int turn)
	{
		ReplayMoveTurnItem component = ((GameObject)UnityEngine.Object.Instantiate(itemObject)).GetComponent<ReplayMoveTurnItem>();
		component.transform.parent = table;
		component.transform.localScale = Vector3.one;
		component.transform.localPosition = Vector3.zero;
		component.gameObject.SetActive(value: true);
		component.Label.text = Data.SystemText.Get("Battle_0519", turn.ToString());
		component.Button.onClick.Add(new EventDelegate(delegate
		{
			SetActiveMoveTurnDialog(isActive: false);
			DisableMoveTurnButton();
			OperateMgr.BattleLogManager.DisableButton();
			base.BattleUIContainer.DisableMenu(isForceDisable: true);
			MoveTurn(turn);
		}));
	}

	public void SetActiveMoveTurnDialog(bool isActive)
	{
		_moveTurnDialog.SetActive(isActive);
		if (isActive)
		{
			_moveTurnDialog.GetComponent<ReplayMoveTurnWindow>().AdjustScrollPosition(IsRightAfterMoveTurn ? (BattlePlayer.Turn + 1) : BattlePlayer.Turn, _turnStartInfoList.Count);
		}
	}

	public void SetActiveMoveTurnButton(bool isActive)
	{
		_moveTurnButton.gameObject.SetActive(isActive);
	}

	private void EnableMoveTurnButton()
	{
		_moveTurnButton.MenuButton.isEnabled = true;
		_moveTurnButton.BackButton.isEnabled = true;
		_moveTurnButton.ForwardButton.isEnabled = true;
	}

	private void DisableMoveTurnButton()
	{
		_moveTurnButton.MenuButton.isEnabled = false;
		_moveTurnButton.BackButton.isEnabled = false;
		_moveTurnButton.ForwardButton.isEnabled = false;
	}

	private void UpdateMoveTurnButton(int turn)
	{
		_moveTurnButton.BackButton.isEnabled = turn > 1;
		_moveTurnButton.ForwardButton.isEnabled = turn < _turnStartInfoList.Count;
	}

	protected override BattlePlayer CreateBattlePlayer()
	{
		return new ReplayBattlePlayer(this, _battleCamera, _backGround, CreatePlayerInnerOptionsBuilder());
	}

	protected override BattleEnemy CreateBattleEnemy()
	{
		return new ReplayBattleEnemy(this, _battleCamera, _backGround, CreateEnemyInnerOptionsBuilder());
	}

	public override void DisposeBattleGameObj()
	{
		_replaySkipAnimation.Unload();
		base.DisposeBattleGameObj();
	}

	private void PauseReplay()
	{
		base.isStopReplay = true;
		_moveTurnButton.StopReplayButton.transform.GetChild(0).GetComponent<UISprite>().spriteName = "btn_replay_play";
		UIManager.SetObjectToGrey(_moveTurnButton.ForwardReplayButton.gameObject, b: false);
	}

	public void MoveTurn(int turn)
	{
		PauseReplay();
		IsMoveTurnScheduled = true;
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			StartMoveTurn(turn);
		}));
	}

	private void StartMoveTurn(int turn)
	{
		IsMoveTurnScheduled = false;
		int num = turn - 1;
		if (num >= _turnStartInfoList.Count || BattlePlayer.Class.IsDead || BattleEnemy.Class.IsDead)
		{
			base.isStopReplay = false;
			StopReplayBtn.transform.GetChild(0).GetComponent<UISprite>().spriteName = "btn_replay_pause";
			UIManager.SetObjectToGrey(ReplayForwardBtn.gameObject, b: true);
			return;
		}
		JsonData jsonData = _turnStartInfoList[num];
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			_replaySkipAnimation.Run();
		}));
		base.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(0.1f));
		List<BattleCardBase> inPlayCard = BattlePlayer.InPlayCards.ToList();
		inPlayCard.AddRange(BattleEnemy.InPlayCards.ToList());
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			for (int i = 0; i < inPlayCard.Count; i++)
			{
				inPlayCard[i].BattleCardView.StopVoice();
			}
			SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr();
			soundMgr.VoiceMute(isMute: true);
			soundMgr.SetRejectNewSound(isMute: true);
		}));
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			for (int i = 0; i < StopEffectObjectList.Count; i++)
			{
				if (StopEffectObjectList[i] != null)
				{
					StopEffectObjectList[i].SetActive(value: false);
				}
			}
		}));
		if (IsSelecting)
		{
			base.VfxMgr.RegisterSequentialVfx((BattlePlayer as ReplayBattlePlayer).CancelSelect(ActCard, IsEvolve, isChoiceBrave: false, isMoveTurn: true));
		}
		if (IsFusionSelecting)
		{
			base.VfxMgr.RegisterSequentialVfx((BattlePlayer as ReplayBattlePlayer).CancelFusion(ActCard, isMoveTurn: true));
		}
		if (IsChoiceSelecting)
		{
			base.VfxMgr.RegisterSequentialVfx((BattlePlayer as ReplayBattlePlayer).CancelChoice(ActCard, IsEvolve, isMoveTurn: true));
		}
		base.VfxMgr.RegisterSequentialVfx(new ThinkIconHideVfx(base.BattleResourceMgr));
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(GenerateBothField(jsonData));
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			EnableMoveTurnButton();
			UpdateMoveTurnButton(turn);
			OperateMgr.BattleLogManager.EnableButton();
			base.BattleUIContainer.EnableMenu();
		}));
		base.VfxMgr.RegisterSequentialVfx(UIManager.GetInstance().CreateNowLoadingVfx(sequentialVfxPlayer));
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			_replaySkipAnimation.End();
		}));
		base.VfxMgr.RegisterSequentialVfx(WaitVfx.Create(0.1f));
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			_replaySkipAnimation.Hide();
		}));
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr();
			if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE))
			{
				soundMgr.VoiceMute(isMute: false);
			}
			soundMgr.SetRejectNewSound(isMute: false);
		}));
		BattlePlayer.Turn = turn - 1;
		BattleEnemy.Turn = jsonData[106.ToString()].ToInt();
		BattlePlayer.IsSelfTurn = false;
		BattleEnemy.IsSelfTurn = true;
		base.isForwardReplay = false;
		IsRightAfterMoveTurn = true;
		BattlePlayer.EvolveWaitTurnCount = (BattlePlayer.IsGameFirst ? 5 : 4) - BattlePlayer.Turn;
		BattleEnemy.EvolveWaitTurnCount = (BattlePlayer.IsGameFirst ? 4 : 5) - BattleEnemy.Turn;
		TurnPanelControl.Initialize(BattlePlayer.EvolveWaitTurnCount > 0, BattleEnemy.EvolveWaitTurnCount > 0);
		ReplayController._replayDataHandler.SetOperationIndex(_turnStartIndexList[num]);
		_moveTurnButtonLabel.text = Data.SystemText.Get("Battle_0519", turn.ToString());
	}

	private VfxBase GenerateBothField(JsonData info)
	{
		List<BattleCardBase> destroyCardList = new List<BattleCardBase>();
		JsonData playerInfo = info[49.ToString()];
		JsonData enemyInfo = info[50.ToString()];
		JsonData playerBattleInfo = info[73.ToString()];
		JsonData enemyBattleInfo = info[74.ToString()];
		JsonData playerClassInfo = info[75.ToString()];
		JsonData enemyClassInfo = info[76.ToString()];
		List<NetworkBattleReceiver.MyRotationBonusInfo> myRotationBonusInfoList = new List<NetworkBattleReceiver.MyRotationBonusInfo>();
		for (int i = 0; i < info[77.ToString()].Count; i++)
		{
			myRotationBonusInfoList.Add(GetNetworkBattleReceiver().CreateMyRotationBonusInfo(info[77.ToString()][i]));
		}
		NetworkBattleReceiver.AvatarBattleDescriptionValueInfo playerAvatarBattleDescinfo = null;
		NetworkBattleReceiver.AvatarBattleDescriptionValueInfo enemyAvatarBattleDescinfo = null;
		if (Data.CurrentFormat == Format.Avatar)
		{
			playerAvatarBattleDescinfo = GetNetworkBattleReceiver().CreateAvatarBattleDescriotionValueInfo(info[78.ToString()]);
			enemyAvatarBattleDescinfo = GetNetworkBattleReceiver().CreateAvatarBattleDescriotionValueInfo(info[79.ToString()]);
		}
		List<BattleLogTextureInfo> battleLogTextureInfoList = new List<BattleLogTextureInfo>();
		VfxBase vfxBase = GenerateField(playerInfo, BattlePlayer, destroyCardList, isPlayer: true, battleLogTextureInfoList);
		VfxBase vfxBase2 = GenerateField(enemyInfo, BattleEnemy, destroyCardList, isPlayer: false, battleLogTextureInfoList);
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		List<NetworkBattleReceiver.CardInfo> list = new List<NetworkBattleReceiver.CardInfo>();
		for (int j = 0; j < playerInfo[45.ToString()].Count; j++)
		{
			NetworkBattleReceiver.CardInfo item = networkReceiver.CreateCardInfo(playerInfo[45.ToString()][j]);
			list.Add(item);
		}
		for (int k = 0; k < enemyInfo[45.ToString()].Count; k++)
		{
			NetworkBattleReceiver.CardInfo item2 = networkReceiver.CreateCardInfo(enemyInfo[45.ToString()][k]);
			list.Add(item2);
		}
		parallelVfxPlayer.Register(UpdateHandInfo(BattlePlayer.HandCardList, BattleEnemy.HandCardList, list, BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient));
		List<NetworkBattleReceiver.CardInfo> list2 = new List<NetworkBattleReceiver.CardInfo>();
		for (int l = 0; l < playerInfo[46.ToString()].Count; l++)
		{
			NetworkBattleReceiver.CardInfo item3 = networkReceiver.CreateCardInfo(playerInfo[46.ToString()][l]);
			list2.Add(item3);
		}
		for (int m = 0; m < enemyInfo[46.ToString()].Count; m++)
		{
			NetworkBattleReceiver.CardInfo item4 = networkReceiver.CreateCardInfo(enemyInfo[46.ToString()][m]);
			list2.Add(item4);
		}
		parallelVfxPlayer.Register(UpdateInplayInfo(BattlePlayer.ClassAndInPlayCardList, BattleEnemy.ClassAndInPlayCardList, list2, BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient, isSelfTurn: true, isInitialize: true));
		List<NetworkBattleReceiver.CardInfo> list3 = new List<NetworkBattleReceiver.CardInfo>();
		for (int n = 0; n < info[70.ToString()].Count; n++)
		{
			NetworkBattleReceiver.CardInfo item5 = networkReceiver.CreateCardInfo(info[70.ToString()][n]);
			list3.Add(item5);
		}
		UpdateAttachedCardInfo(BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient, list3);
		BattlePlayer.IsChoiceBraveEffectTiming = false;
		BattleEnemy.IsChoiceBraveEffectTiming = false;
		return ParallelVfxPlayer.Create(new RefreshHealthVfx(BattlePlayer, isNewReplayMoveTurn: true), new RefreshHealthVfx(BattleEnemy, isNewReplayMoveTurn: true), new DummyDeckChangeCardVfx(isPlayer: true, BattlePlayer.DeckCardList.Count), new DummyDeckChangeCardVfx(isPlayer: false, BattleEnemy.DeckCardList.Count), vfxBase, vfxBase2, parallelVfxPlayer, RecoveryInPlayAndHandCards(), UpdateEvolveSkin(), OpeningVfx.ShowBattleUIImmediatelyVfx(BattlePlayer, fixDirection: false, isNewReplay: true), OpeningVfx.ShowBattleUIImmediatelyVfx(BattleEnemy, fixDirection: false, isNewReplay: true), BattlePlayer.UsePp(0, isNewReplayMoveTurn: true), BattleEnemy.UsePp(0, isNewReplayMoveTurn: true), InstantVfx.Create(BattlePlayer.BattleView.HideCommonPanel), InstantVfx.Create(BattleEnemy.BattleView.HideCommonPanel), InstantVfx.Create(delegate
		{
			BattlePlayer.UpdateStatusPanel(BattlePlayer.HandCardList.Count, playerInfo[43.ToString()].ToInt(), BattlePlayer.DeckCardList.Count);
		}), InstantVfx.Create(delegate
		{
			BattleEnemy.UpdateStatusPanel(BattleEnemy.HandCardList.Count, enemyInfo[43.ToString()].ToInt(), BattleEnemy.DeckCardList.Count);
		}), InstantVfx.Create(delegate
		{
			GetNetworkBattleReceiver().UpdateBattleInfo(playerBattleInfo, isPlayer: true);
		}), InstantVfx.Create(delegate
		{
			GetNetworkBattleReceiver().UpdateBattleInfo(enemyBattleInfo, isPlayer: false);
		}), InstantVfx.Create(delegate
		{
			BattlePlayer.ClassInformationUIController.NewReplayUpdateInfomation(GetNetworkBattleReceiver().CreateClassInfo(playerClassInfo));
		}), InstantVfx.Create(delegate
		{
			BattleEnemy.ClassInformationUIController.NewReplayUpdateInfomation(GetNetworkBattleReceiver().CreateClassInfo(enemyClassInfo));
		}), InstantVfx.Create(delegate
		{
			UpdateMyRotationBonus(myRotationBonusInfoList);
		}), InstantVfx.Create(delegate
		{
			UpdateAvatarBattleDescValueList(playerAvatarBattleDescinfo, enemyAvatarBattleDescinfo);
		}), InstantVfx.Create(delegate
		{
			BattlePlayer.ClassInformationUIController.HideAllInfomation();
		}), InstantVfx.Create(delegate
		{
			BattleEnemy.ClassInformationUIController.HideAllInfomation();
		}), InstantVfx.Create(delegate
		{
			BattlePlayer.PlayerBattleView.AllClear();
		}), BattlePlayer.BattleView.GetSideLogControl(isSkillTargetSelect: false).ClearLastShowLogCard(), BattleEnemy.BattleView.GetSideLogControl(isSkillTargetSelect: false).ClearLastShowLogCard(), UpdateBattleLog(BattlePlayer.AllCardsWithSkillIngredient, BattleEnemy.AllCardsWithSkillIngredient, (int)info[80.ToString()], battleLogTextureInfoList), InstantVfx.Create(delegate
		{
			for (int num = 0; num < destroyCardList.Count; num++)
			{
				UnityEngine.Object.Destroy(destroyCardList[num].BattleCardView.GameObject);
			}
		}));
	}

	private VfxBase UpdateEvolveSkin()
	{
		return InstantVfx.Create(delegate
		{
			PlayerClassBattleCardView playerClassBattleCardView = BattlePlayer.Class.BattleCardView as PlayerClassBattleCardView;
			if (GameMgr.GetIns().GetDataMgr().IsEvolveSkin(isPlayer: true) && BattlePlayer.IsSkinEvolved)
			{
				playerClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle);
			}
			else
			{
				playerClassBattleCardView.ClassCharacter.ResetMotion();
			}
			EnemyClassBattleCardView enemyClassBattleCardView = BattleEnemy.Class.BattleCardView as EnemyClassBattleCardView;
			if (GameMgr.GetIns().GetDataMgr().IsEvolveSkin(isPlayer: false) && BattleEnemy.IsSkinEvolved)
			{
				enemyClassBattleCardView.ClassCharacter.PlayMotion(ClassCharaPrm.MotionType.z_idle);
			}
			else
			{
				enemyClassBattleCardView.ClassCharacter.ResetMotion();
			}
		});
	}

	private VfxBase GenerateField(JsonData info, BattlePlayerBase player, List<BattleCardBase> destroyCardList, bool isPlayer, List<BattleLogTextureInfo> battleLogTextureInfoList)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		player.PpTotal = info[38.ToString()].ToInt();
		player.Pp = info[39.ToString()].ToInt();
		player.SetCurrentEpCount(info[41.ToString()].ToInt());
		player.EpTotal = info[42.ToString()].ToInt();
		player.IsEpEvolveThisTurn = info[96.ToString()].ToInt() == 1;
		player.Class.SkillApplyInformation.SetCantActivateFanfareCount(info[97.ToString()].ToInt());
		player.SetCumulativeEvolutionCount(info[98.ToString()].ToInt());
		parallelVfxPlayer.Register(player.SetBp(info[40.ToString()].ToInt()));
		SetShortageDeckWin(player.IsPlayer, info[95.ToString()].ToInt() == 1);
		player.DeckSkillCardList.Clear();
		List<BattleCardBase> list = player.AllCardsWithSkillIngredient.ToList();
		int cardTotalNum = player.cardTotalNum;
		BattleLogManager.GetInstance().ResetFusionIngredients(isPlayer);
		OperateMgr.BattleLogManager.ClearDestroyedCardList(isPlayer);
		OperateMgr.BattleLogManager.ClearPlayedCardList(isPlayer);
		BattlePlayer.BattleView.SetNotCancelCollider(list.Where((BattleCardBase c) => !(c is ClassBattleCardBase)).ToList(), isEnable: false);
		List<BattleCardBase> list2 = new List<BattleCardBase>();
		List<BattleCardBase> list3 = new List<BattleCardBase>();
		List<BattleCardBase> list4 = new List<BattleCardBase>();
		List<BattleCardBase> list5 = GenerateUndisplayedCards(info[56.ToString()], cardTotalNum, list, null, player, parallelVfxPlayer);
		for (int num = 0; num < list5.Count && num < info[56.ToString()].Count; num++)
		{
			NetworkBattleReceiver.CardInfo cardInfo = networkReceiver.CreateCardInfo(info[56.ToString()][num]);
			UpdateFusionIngredients(list5[num], cardInfo, list5);
		}
		for (int num2 = 0; num2 < info[45.ToString()].Count; num2++)
		{
			NetworkBattleReceiver.CardInfo cardInfo2 = networkReceiver.CreateCardInfo(info[45.ToString()][num2]);
			BattleCardBase orCreateBattleCard = GetOrCreateBattleCard(cardInfo2.Index, cardTotalNum, list, player, cardInfo2.Id);
			UnitBattleCard unitCard = orCreateBattleCard as UnitBattleCard;
			if (unitCard != null)
			{
				unitCard.Evolution(cardInfo2.IsEvolution);
				if (unitCard.IsInplay)
				{
					parallelVfxPlayer.Register(InstantVfx.Create(delegate
					{
						unitCard.BattleCardView.HideAttackFinished();
					}));
				}
			}
			iTween.Stop(orCreateBattleCard.BattleCardView.CardWrapObject);
			orCreateBattleCard.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero;
			orCreateBattleCard.BattleCardView.CardWrapObject.transform.localEulerAngles = Vector3.zero;
			bool isInHand = orCreateBattleCard.IsInHand;
			bool isBuffed = orCreateBattleCard.IsUnit && (orCreateBattleCard.Atk > orCreateBattleCard.BaseAtk || orCreateBattleCard.MaxLife > orCreateBattleCard.BaseMaxLife || orCreateBattleCard.SkillApplyInformation.BuffCount > 0);
			bool isDebuffed = orCreateBattleCard.IsUnit && (orCreateBattleCard.Atk < orCreateBattleCard.BaseAtk || orCreateBattleCard.MaxLife < orCreateBattleCard.BaseMaxLife);
			orCreateBattleCard.ResetCardParameterInHand();
			orCreateBattleCard.DeathTypeInfo.Reset();
			UpdateParameterModifierAndCostView(orCreateBattleCard, cardInfo2);
			parallelVfxPlayer.Register(orCreateBattleCard.StopSpellCharge());
			orCreateBattleCard.SetSpellChargeCount(cardInfo2.SpellChargeCount);
			orCreateBattleCard.SkillApplyInformation.ForceDepriveChantCount();
			UpdateSkillDescriptionValueList(orCreateBattleCard, cardInfo2);
			UpdateUnionBurstAndSkyboundArtModifier(orCreateBattleCard, cardInfo2);
			RemoveCard(player, orCreateBattleCard, isBuffed, isDebuffed);
			list2.Add(orCreateBattleCard);
			if (!isInHand && !orCreateBattleCard.IsSpell)
			{
				orCreateBattleCard.BattleCardView.ResetCardView(orCreateBattleCard.BaseParameter);
				CardTemplate cardTemplate = orCreateBattleCard.BattleCardView.CardTemplate;
				if (orCreateBattleCard.IsUnit)
				{
					cardTemplate.FieldEvolMeshTemp.gameObject.SetActive(value: false);
					cardTemplate.AtkLabelTemp.transform.parent.gameObject.SetActive(value: false);
					cardTemplate.LifeLabelTemp.transform.parent.gameObject.SetActive(value: false);
					cardTemplate.NormalAtkLabelTemp.gameObject.SetActive(value: true);
					cardTemplate.NormalLifeLabelTemp.gameObject.SetActive(value: true);
				}
				cardTemplate.FieldNormalMeshTemp.gameObject.SetActive(value: false);
				cardTemplate.CardNormalTemp.gameObject.SetActive(value: true);
				if (orCreateBattleCard.BattleCardView.BattleCardIconAnimations != null)
				{
					orCreateBattleCard.BattleCardView.BattleCardIconAnimations.DeleteSkillIcons();
				}
				cardTemplate.SkillIconTemp.gameObject.SetActive(value: false);
				if (orCreateBattleCard.BattleCardView is FieldBattleCardView fieldBattleCardView && fieldBattleCardView.ChantCountIcon != null)
				{
					fieldBattleCardView.ChantCountIcon.SetActive(value: false);
				}
				orCreateBattleCard.SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier();
			}
			CardBasePrm.TribeInfo tribeInfo = new CardBasePrm.TribeInfo(cardInfo2.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE);
			orCreateBattleCard.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo, showEffect: false);
			if (!orCreateBattleCard.IsSpell)
			{
				parallelVfxPlayer.Register(orCreateBattleCard.BattleCardView.ShowHandCardInfo(isRecovery: true));
			}
			UpdateFusionIngredients(orCreateBattleCard, cardInfo2, list5);
			orCreateBattleCard.BattleCardView.HideCanPlayEffect();
			orCreateBattleCard.BattleCardView._inPlayFrameEffect.HideFrameEffect();
			orCreateBattleCard.ResetReplayBuffInfo();
		}
		for (int num3 = 0; num3 < info[46.ToString()].Count; num3++)
		{
			NetworkBattleReceiver.CardInfo cardInfo3 = networkReceiver.CreateCardInfo(info[46.ToString()][num3]);
			BattleCardBase orCreateBattleCard2 = GetOrCreateBattleCard(cardInfo3.Index, cardTotalNum, list, player, cardInfo3.Id);
			orCreateBattleCard2.BattleCardView._inPlayFrameEffect.HideFrameEffect();
			if (orCreateBattleCard2 is ClassBattleCardBase)
			{
				ClearAndUpdateParameterModifier(orCreateBattleCard2, cardInfo3);
				player.ClassAndInPlayCardList.Remove(orCreateBattleCard2);
				list3.Add(orCreateBattleCard2);
				continue;
			}
			UnitBattleCard unitCard2 = orCreateBattleCard2 as UnitBattleCard;
			if (unitCard2 != null)
			{
				unitCard2.Evolution(cardInfo3.IsEvolution);
				if (unitCard2.IsInplay)
				{
					parallelVfxPlayer.Register(InstantVfx.Create(delegate
					{
						unitCard2.BattleCardView.HideAttackFinished();
					}));
				}
			}
			iTween.Stop(orCreateBattleCard2.BattleCardView.CardWrapObject);
			orCreateBattleCard2.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero;
			orCreateBattleCard2.BattleCardView.CardWrapObject.transform.localEulerAngles = Vector3.zero;
			bool isInplay = orCreateBattleCard2.IsInplay;
			bool isBuffed2 = orCreateBattleCard2.IsUnit && (orCreateBattleCard2.Atk > orCreateBattleCard2.BaseAtk || orCreateBattleCard2.MaxLife > orCreateBattleCard2.BaseMaxLife || orCreateBattleCard2.SkillApplyInformation.BuffCount > 0);
			bool isDebuffed2 = orCreateBattleCard2.IsUnit && (orCreateBattleCard2.Atk < orCreateBattleCard2.BaseAtk || orCreateBattleCard2.MaxLife < orCreateBattleCard2.BaseMaxLife);
			orCreateBattleCard2.ResetCardParameter();
			orCreateBattleCard2.DeathTypeInfo.Reset();
			UpdateParameterModifierAndCostView(orCreateBattleCard2, cardInfo3);
			CardBasePrm.TribeInfo tribeInfo2 = new CardBasePrm.TribeInfo(cardInfo3.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE);
			orCreateBattleCard2.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo2, showEffect: false);
			if (cardInfo3.ChantCount != -1)
			{
				orCreateBattleCard2.SkillApplyInformation.ForceDepriveChantCount();
				orCreateBattleCard2.SkillApplyInformation.GiveChantCount(new ChantCountAddModifier(cardInfo3.ChantCount - orCreateBattleCard2.BaseParameter.ChantCount));
			}
			if (cardInfo3.WhiteRitualCount != -1)
			{
				orCreateBattleCard2.SkillApplyInformation.FourceDepriveWhiteRitualCount();
				orCreateBattleCard2.SkillApplyInformation.GiveWhiteRitualCount(cardInfo3.WhiteRitualCount);
			}
			if (cardInfo3.MaxAttackableCount != -1)
			{
				orCreateBattleCard2.SkillApplyInformation.ForceDepriveAttackCount();
				orCreateBattleCard2.attackCountinfo.Add(new BattleCardBase.SetAttackCountInfo(null, cardInfo3.MaxAttackableCount));
			}
			if (orCreateBattleCard2.IsChoiceEvolutionCard)
			{
				CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(orCreateBattleCard2.BaseParameter.BaseCardId);
				orCreateBattleCard2.UpdateChoiceEvolutionBeforeCard(cardParameterFromId.NormalCardId, cardParameterFromId.CardName);
			}
			UpdateSkillDescriptionValueList(orCreateBattleCard2, cardInfo3);
			UpdateUnionBurstAndSkyboundArtModifier(orCreateBattleCard2, cardInfo3);
			UpdateFusionIngredients(orCreateBattleCard2, cardInfo3, list5);
			RemoveCard(player, orCreateBattleCard2, isBuffed2, isDebuffed2);
			list3.Add(orCreateBattleCard2);
			if (!isInplay)
			{
				parallelVfxPlayer.Register(orCreateBattleCard2.StopSpellCharge());
				parallelVfxPlayer.Register(new ShowCardNumberLabelVfx(orCreateBattleCard2.BattleCardView, isShow: true));
			}
			orCreateBattleCard2.BattleCardView.HideCanPlayEffect();
			orCreateBattleCard2.ResetReplayBuffInfo();
		}
		for (int num4 = 0; num4 < info[52.ToString()].Count; num4++)
		{
			NetworkBattleReceiver.CardInfo cardInfo4 = networkReceiver.CreateCardInfo(info[52.ToString()][num4]);
			BattleCardBase orCreateBattleCard3 = GetOrCreateBattleCard(cardInfo4.Index, cardTotalNum, list, player, cardInfo4.Id);
			UnitBattleCard unitCard3 = orCreateBattleCard3 as UnitBattleCard;
			if (unitCard3 != null)
			{
				unitCard3.Evolution(cardInfo4.IsEvolution);
				if (unitCard3.IsInplay)
				{
					parallelVfxPlayer.Register(InstantVfx.Create(delegate
					{
						unitCard3.BattleCardView.HideAttackFinished();
					}));
				}
			}
			iTween.Stop(orCreateBattleCard3.BattleCardView.CardWrapObject);
			orCreateBattleCard3.BattleCardView.CardWrapObject.transform.localPosition = Vector3.zero;
			orCreateBattleCard3.BattleCardView.CardWrapObject.transform.localEulerAngles = Vector3.zero;
			bool isInDeck = orCreateBattleCard3.IsInDeck;
			bool isBuffed3 = orCreateBattleCard3.IsUnit && (orCreateBattleCard3.Atk > orCreateBattleCard3.BaseAtk || orCreateBattleCard3.MaxLife > orCreateBattleCard3.BaseMaxLife || orCreateBattleCard3.SkillApplyInformation.BuffCount > 0);
			bool isDebuffed3 = orCreateBattleCard3.IsUnit && (orCreateBattleCard3.Atk < orCreateBattleCard3.BaseAtk || orCreateBattleCard3.MaxLife < orCreateBattleCard3.BaseMaxLife);
			orCreateBattleCard3.DeathTypeInfo.Reset();
			UpdateParameterModifierAndCostView(orCreateBattleCard3, cardInfo4);
			orCreateBattleCard3.SetSpellChargeCount(cardInfo4.SpellChargeCount);
			orCreateBattleCard3.SkillApplyInformation.ForceDepriveChantCount();
			UpdateSkillDescriptionValueList(orCreateBattleCard3, cardInfo4);
			UpdateFusionIngredients(orCreateBattleCard3, cardInfo4, list5);
			RemoveCard(player, orCreateBattleCard3, isBuffed3, isDebuffed3);
			list4.Add(orCreateBattleCard3);
			if (orCreateBattleCard3.HasDeckSelfSkill)
			{
				player.AddDeckSkillCard(orCreateBattleCard3);
			}
			if (!isInDeck)
			{
				orCreateBattleCard3.BattleCardView.CardWrapObject.SetActive(value: true);
				orCreateBattleCard3.BattleCardView.GameObject.SetActive(value: false);
				orCreateBattleCard3.BattleCardView.Transform.SetParent(PCardPlace.transform);
				orCreateBattleCard3.BattleCardView.Transform.position = (isPlayer ? CardHolder.transform.position : ECardHolder.transform.position);
				orCreateBattleCard3.BattleCardView.Transform.localScale = Global.CARD_BATTLE_SCALE;
				orCreateBattleCard3.BattleCardView.Transform.rotation = Quaternion.Euler(0f, -90f, 90f);
				if (!orCreateBattleCard3.IsSpell)
				{
					orCreateBattleCard3.BattleCardView.ResetCardView(orCreateBattleCard3.BaseParameter);
					CardTemplate cardTemplate2 = orCreateBattleCard3.BattleCardView.CardTemplate;
					if (orCreateBattleCard3.IsUnit)
					{
						cardTemplate2.FieldEvolMeshTemp.gameObject.SetActive(value: false);
						cardTemplate2.AtkLabelTemp.transform.parent.gameObject.SetActive(value: false);
						cardTemplate2.LifeLabelTemp.transform.parent.gameObject.SetActive(value: false);
						cardTemplate2.NormalAtkLabelTemp.gameObject.SetActive(value: true);
						cardTemplate2.NormalLifeLabelTemp.gameObject.SetActive(value: true);
					}
					cardTemplate2.FieldNormalMeshTemp.gameObject.SetActive(value: false);
					cardTemplate2.CardNormalTemp.gameObject.SetActive(value: true);
				}
				parallelVfxPlayer.Register(orCreateBattleCard3.StopSpellCharge());
				if (orCreateBattleCard3.BattleCardView.BattleCardIconAnimations != null)
				{
					orCreateBattleCard3.BattleCardView.BattleCardIconAnimations.DeleteSkillIcons();
				}
				orCreateBattleCard3.BattleCardView.CardTemplate.SkillIconTemp.gameObject.SetActive(value: false);
				if (orCreateBattleCard3.BattleCardView is FieldBattleCardView fieldBattleCardView2 && fieldBattleCardView2.ChantCountIcon != null)
				{
					fieldBattleCardView2.ChantCountIcon.SetActive(value: false);
				}
				orCreateBattleCard3.SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier();
				orCreateBattleCard3.SkillApplyInformation.ClearUnionBurstAndSkyboundArtModifier();
			}
			CardBasePrm.TribeInfo tribeInfo3 = new CardBasePrm.TribeInfo(cardInfo4.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE);
			orCreateBattleCard3.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo3, showEffect: false);
			orCreateBattleCard3.BattleCardView.HideCanPlayEffect();
			orCreateBattleCard3.BattleCardView._inPlayFrameEffect.HideFrameEffect();
		}
		List<BattleCardBase> collection = GenerateUndisplayedCards(info[53.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer);
		List<BattleCardBase> collection2 = GenerateUndisplayedCards(info[54.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer);
		List<BattleCardBase> collection3 = GenerateUndisplayedCards(info[55.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer, isReservedCard: false, isBanish: true);
		List<BattleCardBase> collection4 = GenerateUndisplayedCards(info[57.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer);
		List<BattleCardBase> collection5 = GenerateUndisplayedCards(info[58.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer);
		List<BattleCardBase> collection6 = GenerateUndisplayedCards(info[59.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer, isReservedCard: true);
		List<BattleCardBase> collection7 = GenerateUndisplayedCards(info[60.ToString()], cardTotalNum, list, list5, player, parallelVfxPlayer);
		List<BattleCardBase> list6 = GenerateUndisplayedCards(info[61.ToString()], cardTotalNum, player.ChoiceBraveCardList, list5, player, parallelVfxPlayer);
		player.cardTotalNum = info[62.ToString()].ToInt();
		for (int num5 = 0; num5 < list.Count; num5++)
		{
			if (list[num5].Index >= player.cardTotalNum)
			{
				RemoveCard(player, list[num5], isBuffed: false, isDebuffed: false);
				destroyCardList.Add(list[num5]);
			}
		}
		for (int num6 = 0; num6 < player.ChoiceBraveCardList.Count; num6++)
		{
			if (!list6.Contains(player.ChoiceBraveCardList[num6]))
			{
				destroyCardList.Add(player.ChoiceBraveCardList[num6]);
			}
		}
		player.HandCardList.Clear();
		player.HandCardList.AddRange(list2);
		player.ClassAndInPlayCardList.Clear();
		player.ClassAndInPlayCardList.AddRange(list3);
		player.DeckCardList.Clear();
		player.DeckCardList.AddRange(list4);
		player.CemeteryList.Clear();
		player.CemeteryList.AddRange(collection);
		player.NecromanceZoneList.Clear();
		player.NecromanceZoneList.AddRange(collection2);
		player.BanishList.Clear();
		player.BanishList.AddRange(collection3);
		player.FusionIngredientList.Clear();
		player.FusionIngredientList.AddRange(list5);
		player.GetOnList.Clear();
		player.GetOnList.AddRange(collection4);
		player.UniteList.Clear();
		player.UniteList.AddRange(collection5);
		player.ReservedCardList.Clear();
		player.ReservedCardList.AddRange(collection6);
		player.BlackHole.Clear();
		player.BlackHole.AddRange(collection7);
		player.ChoiceBraveCardList.Clear();
		player.ChoiceBraveCardList.AddRange(list6);
		list = player.AllCardsWithSkillIngredient.ToList();
		JsonData playedCardList = info[101.ToString()];
		JsonData jsonData = info[102.ToString()];
		int i;
		for (i = 0; i < playedCardList.Count; i++)
		{
			BattleCardBase battleCardBase = list.FirstOrDefault((BattleCardBase c) => c.Index == playedCardList[i].ToInt());
			int num7 = jsonData[i].ToInt();
			if (battleCardBase.CardId != num7)
			{
				CardParameter cardParameterFromId2 = CardMaster.GetInstanceForBattle().GetCardParameterFromId(num7);
				battleCardBase = CreateBattleCard(num7, battleCardBase.IsPlayer, null, cardParameterFromId2, battleCardBase.SelfBattlePlayer, -1);
			}
			OperateMgr.BattleLogManager.AddLogDestFollower(BattleLogWindow.BattleLogType.PlayCardLog, battleCardBase, battleLogTextureInfoList);
		}
		JsonData destroyedCardList = info[103.ToString()];
		int i2;
		for (i2 = 0; i2 < destroyedCardList.Count; i2++)
		{
			OperateMgr.BattleLogManager.AddLogDestFollower(BattleLogWindow.BattleLogType.Destruction, list.FirstOrDefault((BattleCardBase c) => c.Index == destroyedCardList[i2].ToInt()), battleLogTextureInfoList);
		}
		JsonData jsonData2 = info[104.ToString()];
		for (int num8 = 0; num8 < jsonData2.Count; num8++)
		{
			NetworkBattleReceiver.CardInfo cardInfo5 = networkReceiver.CreateCardInfo(jsonData2[num8]);
			BattleCardBase battleCardBase2 = list.FirstOrDefault((BattleCardBase c) => c.Index == cardInfo5.Index);
			bool flag = battleCardBase2.CardId != cardInfo5.Id;
			if (flag)
			{
				CardParameter cardParameterFromId3 = CardMaster.GetInstanceForBattle().GetCardParameterFromId(cardInfo5.Id);
				battleCardBase2 = CreateBattleCard(cardInfo5.Id, battleCardBase2.IsPlayer, null, cardParameterFromId3, battleCardBase2.SelfBattlePlayer, cardInfo5.Index);
			}
			BattleLogManager.GetInstance().AddFusionIngredients(battleCardBase2, !flag);
			UpdateFusionCardInfo(cardInfo5, list5);
		}
		return parallelVfxPlayer;
	}

	private void UpdateFusionIngredients(BattleCardBase fusionCard, NetworkBattleReceiver.CardInfo cardInfo, List<BattleCardBase> fusionIngredientList)
	{
		fusionCard.SkillApplyInformation.FusionIngredients.Clear();
		if (cardInfo.FusionIngredientIdxList.Count <= 0)
		{
			return;
		}
		for (int i = 0; i < cardInfo.FusionIngredientIdxList.Count; i++)
		{
			BattleCardBase battleCardIdx = GetBattleCardIdx(fusionIngredientList, cardInfo.FusionIngredientIdxList[i]);
			if (battleCardIdx != null)
			{
				fusionCard.SkillApplyInformation.AddFusionIngredientCard(battleCardIdx);
			}
		}
	}

	private List<BattleCardBase> GenerateUndisplayedCards(JsonData jsonData, int defaultCardTotalNum, List<BattleCardBase> allCards, List<BattleCardBase> fusionIngredientList, BattlePlayerBase player, ParallelVfxPlayer parallelVfx, bool isReservedCard = false, bool isBanish = false)
	{
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < jsonData.Count; i++)
		{
			NetworkBattleReceiver.CardInfo cardInfo = networkReceiver.CreateCardInfo(jsonData[i]);
			int index = cardInfo.Index;
			if (index == -1)
			{
				continue;
			}
			BattleCardBase battleCardBase = GetOrCreateBattleCard(CardMaster.IsChoiceBraveCardCheck(cardInfo.Id) ? i : index, defaultCardTotalNum, allCards, player, cardInfo.Id);
			if (fusionIngredientList != null)
			{
				UpdateFusionIngredients(battleCardBase, cardInfo, fusionIngredientList);
			}
			if (index < defaultCardTotalNum)
			{
				if (battleCardBase.IsInHand)
				{
					parallelVfx.Register(battleCardBase.SkillApplyInformation.AllSkillEffectStop());
					parallelVfx.Register(battleCardBase.StopSpellCharge());
					player.BattleView.HandView.RemoveCardFromViewWithoutRearrange(battleCardBase.BattleCardView);
					battleCardBase.BattleCardView.GameObject.SetActive(value: false);
					parallelVfx.Register(battleCardBase.UnloadResource());
				}
				else if (battleCardBase.IsInplay)
				{
					parallelVfx.Register(battleCardBase.SkillApplyInformation.AllSkillEffectStop());
					player.BattleView.InPlayView.RemoveCardFromView(battleCardBase.BattleCardView);
					battleCardBase.BattleCardView.GameObject.SetActive(value: false);
					parallelVfx.Register(battleCardBase.UnloadResource());
				}
				if (isReservedCard)
				{
					battleCardBase = player.CreateCard(cardInfo.Id, index);
				}
			}
			if (isReservedCard)
			{
				UpdateSkillDescriptionValueList(battleCardBase, cardInfo);
			}
			if (isBanish)
			{
				battleCardBase.DeathTypeInfo.BanishDestroy = true;
			}
			list.Add(battleCardBase);
		}
		return list;
	}

	public void SetSkillDescriptionValueList(List<BattleCardBase> allCards, List<NetworkBattleReceiver.CardInfo> cardInfoList)
	{
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase battleCardIdx = GetBattleCardIdx(allCards, cardInfoList[i].Index);
			UpdateSkillDescriptionValueList(battleCardIdx, cardInfoList[i]);
		}
	}

	public void UpdateSkillDescriptionValueList(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		if (cardInfo.SkillDescriptionValueList != null)
		{
			card.ReplaySkillDescriptionValueList = cardInfo.SkillDescriptionValueList;
			DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent();
		}
		if (cardInfo.EvoSkillDescriptionValueList != null)
		{
			card.ReplayEvoSkillDescriptionValueList = cardInfo.EvoSkillDescriptionValueList;
			DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent();
		}
	}

	private void UpdateBuffDetailSkillDescriptionValueList(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		if (cardInfo.SkillDescriptionValueList != null)
		{
			card.ReplayBuffDetailSkillDescriptionValueList = cardInfo.SkillDescriptionValueList;
		}
		if (cardInfo.EvoSkillDescriptionValueList != null)
		{
			card.ReplayBuffDetailEvoSkillDescriptionValueList = cardInfo.EvoSkillDescriptionValueList;
		}
		if ((cardInfo.SkillDescriptionValueList != null || cardInfo.EvoSkillDescriptionValueList != null) && card.IsBuffDetail)
		{
			DetailMgr.DetailPanelControl.UpdateCardDescriptionOnEvent();
		}
	}

	public void UpdateParameterModifierAndCostView(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		int cost = card.Cost;
		ClearAndUpdateParameterModifier(card, cardInfo);
		int cost2 = (card.IsSelectedDuringSelectingBurialRiteTarget ? cost : card.Cost);
		card.BattleCardView.UpdateCost(card.BattleCardView.GetUseCostList(cost2), isGenerateInHand: true, playEffect: false, isForceUpdate: true);
	}

	public void ClearAndUpdateParameterModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		card.SkillApplyInformation.ClearParameterModifier();
		card.ClearCostModifier();
		UpdateParameterModifier(card, cardInfo);
	}

	public void UpdateExecutedFixedUseCostIndex(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		card.ExecutedFixedUseCostIndex = cardInfo.ExecutedFixedUseCostIndex;
	}

	public void UpdateUnionBurstAndSkyboundArtModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		card.SkillApplyInformation.ClearUnionBurstAndSkyboundArtModifier();
		UpdateUnionBurstModifier(card, cardInfo);
		UpdateSkyboundArtModifier(card, cardInfo);
		UpdateSuperSkyboundArtModifier(card, cardInfo);
	}

	private void UpdateParameterModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		for (int i = 0; i < cardInfo.ParameterModifierList.Count; i++)
		{
			switch (cardInfo.ParameterModifierList[i].ModifierType)
			{
			case NetworkBattleReceiver.ReplayParameterModifierType.OffenseAddModifier:
				card.SkillApplyInformation.AddOffenseModifier(new OffenseAddModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.OffenseSetModifier:
				card.SkillApplyInformation.AddOffenseModifier(new OffenseSetModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.OffenseMultiplyModifier:
				card.SkillApplyInformation.AddOffenseModifier(new OffenseMultiplyModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.LifeAddModifier:
				card.SkillApplyInformation.AddLifeModifier(new LifeAddModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.LifeSetModifier:
				card.SkillApplyInformation.AddLifeModifier(new LifeSetModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.LifeMultiplyModifier:
				card.SkillApplyInformation.AddLifeModifier(new LifeMultiplyModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.MaxLifeAddModifier:
				card.SkillApplyInformation.AddLifeModifier(new MaxLifeAddModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.MaxLifeSetModifier:
				card.SkillApplyInformation.AddLifeModifier(new MaxLifeSetModifier(cardInfo.ParameterModifierList[i].ModifierValue));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.DamageCardParameterModifier:
				card.SkillApplyInformation.AddLifeModifier(new DamageCardParameterModifier(cardInfo.ParameterModifierList[i].ModifierValue, -1, isSelfTurn: false));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.HealCardParameterModifier:
				card.SkillApplyInformation.AddLifeModifier(new HealCardParameterModifier(cardInfo.ParameterModifierList[i].ModifierValue, -1, isSelfTurn: false));
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.CostHalfRoundUpModifier:
				card.AddCostModifier(new CostHalfRoundUpModifier(isResidentModifier: false), null);
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.CostAddModifier:
				card.AddCostModifier(new CostAddModifier(cardInfo.ParameterModifierList[i].ModifierValue), null);
				break;
			case NetworkBattleReceiver.ReplayParameterModifierType.CostSetModifier:
				card.AddCostModifier(new CostSetModifier(cardInfo.ParameterModifierList[i].ModifierValue), null);
				break;
			}
		}
	}

	private void UpdateUnionBurstModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		if (card.SkillApplyInformation is SkillApplyInformation skillApplyInformation)
		{
			for (int i = 0; i < cardInfo.UnionBurstModifierValueList.Count; i++)
			{
				skillApplyInformation.UnionBurstCountModifierList.Add(new UnionBurstCountAddModifier(cardInfo.UnionBurstModifierValueList[i]));
			}
		}
	}

	private void UpdateSkyboundArtModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		if (card.SkillApplyInformation is SkillApplyInformation skillApplyInformation)
		{
			for (int i = 0; i < cardInfo.SkyboundArtModifierValueList.Count; i++)
			{
				skillApplyInformation.SkyboundArtCountModifierList.Add(new SkyboundArtCountAddModifier(cardInfo.SkyboundArtModifierValueList[i]));
			}
		}
	}

	private void UpdateSuperSkyboundArtModifier(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		if (card.SkillApplyInformation is SkillApplyInformation skillApplyInformation)
		{
			for (int i = 0; i < cardInfo.SuperSkyboundArtModifierValueList.Count; i++)
			{
				skillApplyInformation.SuperSkyboundArtCountModifierList.Add(new SuperSkyboundArtCountAddModifier(cardInfo.SuperSkyboundArtModifierValueList[i]));
			}
		}
	}

	private void RemoveCard(BattlePlayerBase player, BattleCardBase card, bool isBuffed, bool isDebuffed)
	{
		player.DeckCardList.Remove(card);
		if (player.HandCardList.Remove(card))
		{
			ImmediateVfxMgr.GetInstance().Register(card.SkillApplyInformation.AllSkillEffectStop(isEvolve: false, isReturn: false, isBuffed, isDebuffed));
			player.BattleView.HandView.RemoveCardFromViewWithoutRearrange(card.BattleCardView);
			card.BattleCardView.GameObject.SetActive(value: false);
		}
		if (player.ClassAndInPlayCardList.Remove(card))
		{
			ImmediateVfxMgr.GetInstance().Register(card.SkillApplyInformation.AllSkillEffectStop(isEvolve: false, isReturn: false, isBuffed, isDebuffed));
			player.BattleView.InPlayView.RemoveCardFromView(card.BattleCardView);
			card.BattleCardView.GameObject.SetActive(value: false);
		}
		player.CemeteryList.Remove(card);
		player.BanishList.Remove(card);
		player.FusionIngredientList.Remove(card);
		player.NecromanceZoneList.Remove(card);
		player.UniteList.Remove(card);
		player.GetOnList.Remove(card);
		player.BlackHole.Remove(card);
		player.ChoiceBraveCardList.Remove(card);
	}

	private BattleCardBase GetOrCreateBattleCard(int index, int defaultCardTotalNum, List<BattleCardBase> allCards, BattlePlayerBase player, int cardId)
	{
		int cardIndex = index;
		if (CardMaster.IsChoiceBraveCardCheck(cardId))
		{
			if (allCards.Count() > index)
			{
				return allCards[index];
			}
			cardIndex = 0;
		}
		else if (index < defaultCardTotalNum)
		{
			BattleCardBase battleCardBase = GetBattleCardIdx(allCards, index);
			if (battleCardBase.CardId != cardId && battleCardBase.CardId != 0)
			{
				RemoveCard(player, battleCardBase, isBuffed: false, isDebuffed: false);
				UnityEngine.Object.DestroyImmediate(battleCardBase.BattleCardView.GameObject);
				battleCardBase = player.CreateCard(cardId, index);
			}
			return battleCardBase;
		}
		return player.CreateCard(cardId, cardIndex);
	}

	private BattleCardBase CreateCardAndSetCardTotalNum(BattlePlayerBase player, int cardId, int index)
	{
		BattleCardBase result = player.CreateCard(cardId, index);
		if (player.cardTotalNum <= index)
		{
			player.cardTotalNum = index + 1;
		}
		return result;
	}

	public void TurnStart(BattlePlayerBase player)
	{
		player.IsSelfTurn = true;
		if (player.IsPlayer)
		{
			_moveTurnButtonLabel.text = Data.SystemText.Get("Battle_0519", player.Turn.ToString());
			UpdateMoveTurnButton(player.Turn);
		}
	}

	public VfxBase TurnEnd()
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		parallelVfxPlayer.Register(new ThinkIconHideVfx(base.BattleResourceMgr));
		for (int i = 0; i < BattlePlayer.HandCardList.Count; i++)
		{
			BattleCardBase card = BattlePlayer.HandCardList[i];
			parallelVfxPlayer.Register(InstantVfx.Create(delegate
			{
				card.BattleCardView.HideCanPlayEffect();
			}));
		}
		for (int num = 0; num < BattlePlayer.InPlayCards.Count(); num++)
		{
			BattleCardBase card2 = BattlePlayer.InPlayCards.ElementAt(num);
			parallelVfxPlayer.Register(InstantVfx.Create(delegate
			{
				card2.BattleCardView.HideAttackFinished();
			}));
		}
		BattlePlayer.IsChoiceBraveEffectTiming = false;
		BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
		BattleEnemy.IsChoiceBraveEffectTiming = false;
		BattleEnemy.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
		return parallelVfxPlayer;
	}

	public VfxBase AddPpTotal(BattleCardBase ownerCard, BattlePlayerBase player, int addPpTotalCount, int pp, bool playEffect = false)
	{
		int ppTotal = player.PpTotal;
		player.PpTotal += addPpTotalCount;
		int ppTotal2 = player.PpTotal;
		player.Pp = pp;
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		if (playEffect)
		{
			parallelVfxPlayer.Register(new PpIncreaseVfx(player, ppTotal, ppTotal2));
		}
		parallelVfxPlayer.Register(new PpChangeVfx(player));
		return parallelVfxPlayer;
	}

	public VfxBase AddPp(BattleCardBase ownerCard, BattlePlayerBase player, int addPpCount)
	{
		player.Pp += addPpCount;
		if (player.Pp < 0)
		{
			player.Pp = 0;
		}
		else if (player.Pp > 10)
		{
			player.Pp = 10;
		}
		if (player.PpTotal < player.Pp)
		{
			player.Pp = player.PpTotal;
		}
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		parallelVfxPlayer.Register(new PpChangeVfx(player));
		return parallelVfxPlayer;
	}

	public VfxBase AddBp(BattleCardBase ownerCard, BattlePlayerBase player, int addBpCount, bool isSelf)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		parallelVfxPlayer.Register(player.AddBp(addBpCount));
		if (addBpCount > 0)
		{
			parallelVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_ui_hbp_2", null, () => player.BattleView.GetBPLabelPosition(), 0f, Battle3DContainer.layer));
			if (isSelf)
			{
				parallelVfxPlayer.Register(InstantVfx.Create(delegate
				{
					GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_HBP_UP);
				}));
			}
		}
		else
		{
			parallelVfxPlayer.Register(new LoadAndPlayEffectVfx("cmn_ui_hbp_1", null, () => player.BattleView.GetBPLabelPosition(), 0f, Battle3DContainer.layer));
		}
		return parallelVfxPlayer;
	}

	public VfxBase EpModifier(BattleCardBase ownerCard, BattlePlayerBase player, int epCount, bool isAdd, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		int currentEpCount = player.CurrentEpCount;
		if (isAdd)
		{
			if (epCount < 0)
			{
				epCount *= -1;
				if (player.CurrentEpCount < epCount)
				{
					epCount = player.CurrentEpCount;
				}
				player.UseEpCount(epCount);
			}
			else
			{
				player.AddCurrentEpCount(epCount);
			}
			if (player.CurrentEpCount > player.EpTotal)
			{
				player.SetCurrentEpCount(player.EpTotal);
			}
		}
		else
		{
			player.SetCurrentEpCount(epCount);
			if (player.CurrentEpCount > player.EpTotal)
			{
				if (player.EpTotal == BattleManagerBase.FIRST_PLAYER_EP_NUM)
				{
					player.EpTotal = BattleManagerBase.SECOND_PLAYER_EP_NUM;
					player.SetCurrentEpCount(BattleManagerBase.SECOND_PLAYER_EP_NUM);
					parallelVfxPlayer.Register(player.StatusPanelControl.PlayIncreaseMaxEpAnimation(currentEpCount, player.CurrentEpCount));
				}
				else
				{
					player.SetCurrentEpCount(player.EpTotal);
				}
			}
		}
		int currentEpCount2 = player.CurrentEpCount;
		int epTotal = player.EpTotal;
		parallelVfxPlayer.Register(new EpChangeVfx(player, currentEpCount, currentEpCount2, epTotal));
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, new List<BattleCardBase> { player.Class }, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxWithLoadingSequential DrawCard(BattlePlayerBase player, List<BattleCardBase> drawList, List<NetworkBattleReceiver.CardInfo> cardInfoList)
	{
		for (int i = 0; i < drawList.Count; i++)
		{
			player.DeckCardList.Remove(drawList[i]);
			if (player.HandCardList.Count >= 9)
			{
				player.CemeteryList.Add(drawList[i]);
			}
			else
			{
				player.HandCardList.Add(drawList[i]);
			}
			UpdateSkillDescriptionValueList(drawList[i], cardInfoList[i]);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(VfxWithLoading.Create(LoadCardResources(drawList)));
		return vfxWithLoadingSequential;
	}

	public VfxWithLoading TokenDrawCard(BattlePlayerBase player, BattleCardBase ownerCard, List<NetworkBattleReceiver.CardInfo> cardInfoList, List<BattleCardBase> targets, bool isOpen, bool isReserved, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		List<BattleCardBase> list = new List<BattleCardBase>();
		int i;
		for (i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase battleCardBase = null;
			if (isReserved)
			{
				battleCardBase = player.ReservedCardList.FirstOrDefault((BattleCardBase c) => c.Index == cardInfoList[i].Index);
				player.ReservedCardList.Remove(battleCardBase);
			}
			if (battleCardBase == null)
			{
				battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index);
			}
			UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
			battleCardBase.SetOnDraw(draw: true);
			if (player.HandCardList.Count >= 9)
			{
				player.CemeteryList.Add(battleCardBase);
			}
			else
			{
				player.HandCardList.Add(battleCardBase);
			}
			list.Add(battleCardBase);
		}
		vfxWithLoadingSequential.RegisterVfxWithLoading(VfxWithLoading.Create(LoadCardResources(list)));
		if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT))
		{
			vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targets, effectInfo));
		}
		VfxWithLoading vfxWithLoading = player.CreateTokenSpawnVfx(list[0]);
		vfxWithLoadingSequential.RegisterToMainVfx(new DrawTokenVfx(list, vfxWithLoading.MainVfx, player, isOpen));
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		return vfxWithLoadingSequential;
	}

	public VfxWithLoading CreateReservedCard(BattlePlayerBase player, BattleCardBase ownerCard, List<NetworkBattleReceiver.CardInfo> cardInfoList)
	{
		List<BattleCardBase> list = new List<BattleCardBase>();
		int i;
		for (i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase battleCardBase = player.AllCardsWithSkillIngredient.FirstOrDefault((BattleCardBase c) => c.Index == cardInfoList[i].Index);
			if (battleCardBase != null)
			{
				UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
				list.Add(battleCardBase);
				continue;
			}
			battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index);
			UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
			list.Add(battleCardBase);
			player.ReservedCardList.Add(battleCardBase);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list));
		return vfxWithLoadingSequential;
	}

	public VfxWith<BattleCardBase> ReplaceReceivedCard(BattleCardBase originalCard, NetworkBattleReceiver.CardInfo cardInfo, BattlePlayerBase player, bool isFusion, bool isSideLog = false)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		if (originalCard.CardId == cardInfo.Id)
		{
			ReflectCardInfoData(originalCard, cardInfo, isSideLog);
			return new VfxWith<BattleCardBase>(vfxWithLoadingSequential, originalCard);
		}
		BattleCardBase battleCardBase = CreateBattleCardWithGameObject(player, cardInfo.Id, cardInfo.Cost, originalCard.Index);
		vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(new List<BattleCardBase> { battleCardBase }));
		ReflectCardInfoData(battleCardBase, cardInfo, isSideLog);
		battleCardBase.SkillApplyInformation.AddFusionIngredients(originalCard.SkillApplyInformation.FusionIngredients);
		CardBasePrm.TribeInfo tribeInfo = new CardBasePrm.TribeInfo(cardInfo.Tribe.Select((int t) => (CardBasePrm.TribeType)t).ToList(), CardBasePrm.TribeChangeType.CHANGE);
		battleCardBase.SkillApplyInformation.GiveChangeAffiliation(CardBasePrm.ClanType.NONE, tribeInfo, showEffect: false);
		if (originalCard.IsInHand)
		{
			player.HandCardList[player.HandCardList.IndexOf(originalCard)] = battleCardBase;
			sequentialVfxPlayer.Register(CreateReplaceDummyCardVfx(originalCard, battleCardBase, player, isFusion));
		}
		else if (originalCard.IsInDeck)
		{
			player.DeckCardList[player.DeckCardList.IndexOf(originalCard)] = battleCardBase;
		}
		else if (originalCard.IsInCemetery)
		{
			player.CemeteryList[player.CemeteryList.IndexOf(originalCard)] = battleCardBase;
		}
		vfxWithLoadingSequential.RegisterToMainVfx(sequentialVfxPlayer);
		return new VfxWith<BattleCardBase>(vfxWithLoadingSequential, battleCardBase);
	}

	public void ReflectCardInfoData(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo, bool isSideLog)
	{
		if (!isSideLog)
		{
			UpdateSkillDescriptionValueList(card, cardInfo);
		}
		card.SetSpellChargeCount(cardInfo.SpellChargeCount);
		card.SkillApplyInformation.ClearParameterModifier();
		UpdateParameterModifier(card, cardInfo);
		UpdateExecutedFixedUseCostIndex(card, cardInfo);
		UpdateUnionBurstAndSkyboundArtModifier(card, cardInfo);
	}

	private BattleCardBase CreateBattleCardWithGameObject(BattlePlayerBase battlePlayer, int id, int cost, int index)
	{
		CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(id);
		int cardIndex = SetupCardIndex(battlePlayer, index);
		GameObject cardGameObject = CreateBaseCardGameObject(cardParameterFromId, battlePlayer.IsPlayer, cardIndex);
		BattleCardBase battleCardBase = CreateBattleCard(id, battlePlayer.IsPlayer, cardGameObject, cardParameterFromId, battlePlayer, cardIndex, cost);
		SetupCardObjectMaterials(cardGameObject, battleCardBase);
		return battleCardBase;
	}

	private VfxBase CreateReplaceDummyCardVfx(BattleCardBase originalDummyCard, BattleCardBase receivedCard, BattlePlayerBase battlePlayer, bool isFusion)
	{
		IBattleCardView dummyCardView = originalDummyCard.BattleCardView;
		if (isFusion)
		{
			ReplaceDummyCard(dummyCardView, receivedCard, battlePlayer);
		}
		return InstantVfx.Create(delegate
		{
			if (!isFusion)
			{
				ReplaceDummyCard(dummyCardView, receivedCard, battlePlayer);
			}
			UnityEngine.Object.DestroyImmediate(dummyCardView.GameObject);
		});
	}

	private void ReplaceDummyCard(IBattleCardView dummyCardView, BattleCardBase receivedCard, BattlePlayerBase battlePlayer)
	{
		receivedCard.BattleCardView.GameObject.transform.parent = dummyCardView.GameObject.transform.parent;
		receivedCard.BattleCardView.GameObject.transform.localPosition = dummyCardView.GameObject.transform.localPosition;
		receivedCard.BattleCardView.GameObject.transform.localScale = dummyCardView.GameObject.transform.localScale;
		receivedCard.BattleCardView.GameObject.transform.localRotation = dummyCardView.GameObject.transform.localRotation;
		battlePlayer.BattleView.HandView.ReplaceCardInViewWithoutRearrange(dummyCardView, receivedCard.BattleCardView);
		receivedCard.BattleCardView.GameObject.SetActive(value: true);
		receivedCard.BattleCardView.GameObject.GetComponent<CardTemplate>().CardNormalTemp.gameObject.SetActive(value: true);
	}

	public BattleCardBase CreateTransformCard(BattlePlayerBase player, BattleCardBase playCard, int transformCardId, SequentialVfxPlayer sequentialVfx, bool isMutation)
	{
		BattleCardBase transformCard = player.CreateCard(transformCardId, playCard.Index);
		transformCard.ReplaySkillDescriptionValueList = playCard.ReplaySkillDescriptionValueList;
		transformCard.ReplayEvoSkillDescriptionValueList = playCard.ReplayEvoSkillDescriptionValueList;
		transformCard.ReplayBuffDetailSkillDescriptionValueList = playCard.ReplayBuffDetailSkillDescriptionValueList;
		transformCard.ReplayBuffDetailEvoSkillDescriptionValueList = playCard.ReplayBuffDetailEvoSkillDescriptionValueList;
		base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate
		{
			transformCard.BattleCardView.GameObject.SetActive(value: false);
		}));
		sequentialVfx.Register(InstantVfx.Create(delegate
		{
			Transform transform = transformCard.BattleCardView.Transform;
			Transform transform2 = playCard.BattleCardView.Transform;
			transform.position = transform2.position;
			transform.rotation = transform2.rotation;
			transform.parent = player.BattleView.HandDeck.transform;
			transform.localScale = transform2.localScale;
			transform.SetSiblingIndex(transform2.GetSiblingIndex());
			if (!isMutation)
			{
				transformCard.BattleCardView.CardTemplate.DynamicSetupMaterials(transformCard, base.BattleResourceMgr);
				playCard.BattleCardView.GameObject.SetActive(value: false);
				transformCard.BattleCardView.GameObject.SetActive(value: true);
			}
		}));
		transformCard.SetOnDraw(draw: false);
		return transformCard;
	}

	public VfxBase SetupTransformCard(BattleCardBase playCard, BattleCardBase originalCard, bool isMutation, bool isLoadResource = false)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		if (isMutation || isLoadResource)
		{
			sequentialVfxPlayer.Register(LoadCardResources(new List<BattleCardBase> { playCard }));
		}
		base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate
		{
			originalCard.SelfBattlePlayer.BattleView.HandView.RemoveCardFromView(originalCard.BattleCardView, 0.3f);
		}));
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			playCard.SelfBattlePlayer.BattleView.PlayQueueView.RemoveCardFromView(originalCard.BattleCardView, isMutation);
			if (isMutation)
			{
				playCard.BattleCardView.CardTemplate.DynamicSetupMaterials(playCard, base.BattleResourceMgr);
			}
		}));
		if (!isMutation)
		{
			sequentialVfxPlayer.Register(OperateMgr.InitSetCard(playCard, playCard.SelfBattlePlayer.IsPlayer, isSelect: false, isRecovery: false, isChoiceSelect: true));
		}
		else
		{
			bool isChoice = playCard.Skills.Any((SkillBase s) => s is Skill_choice);
			sequentialVfxPlayer.Register(playCard.SelfBattlePlayer.BattleView.PlayQueueView.InstantAddCardToViewVfx(playCard.BattleCardView, forceCardIntoPlayQueue: false, isChoice));
			if (isMutation)
			{
				sequentialVfxPlayer.Register(InstantVfx.Create(delegate
				{
					Vector3 position = originalCard.BattleCardView.GameObject.transform.position;
					position += ActionProcessor.ACCELERATE_POSITION_OFFSET;
					Quaternion rot = originalCard.BattleCardView.GameObject.transform.rotation;
					if (!playCard.IsSpell && playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView))
					{
						Vector3 localEulerAngles = originalCard.BattleCardView.GameObject.transform.localEulerAngles;
						rot = Quaternion.Euler(localEulerAngles.x, 0f, localEulerAngles.z);
					}
					GameMgr.GetIns().GetEffectMgr().Start(playCard.IsSpell ? EffectMgr.EffectType.CMN_CARD_ACCELERATE_1 : EffectMgr.EffectType.CMN_CARD_CRYSTALLIZE_1, playCard.IsSpell ? position : originalCard.BattleCardView.GameObject.transform.position, rot, 31);
				}));
				sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.2f));
				sequentialVfxPlayer.Register(InstantVfx.Create(delegate
				{
					CardTemplate cardTemplate = originalCard.BattleCardView.CardTemplate;
					cardTemplate.SetEffectStyle(UILabel.Effect.None);
					if (originalCard is UnitBattleCard)
					{
						cardTemplate.NormalAtkLabelTemp.effectStyle = UILabel.Effect.None;
						cardTemplate.NormalLifeLabelTemp.effectStyle = UILabel.Effect.None;
					}
				}));
				sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0f));
			}
			sequentialVfxPlayer.Register(InstantVfx.Create(delegate
			{
				if (isMutation)
				{
					Transform transform = playCard.BattleCardView.Transform;
					Transform transform2 = originalCard.BattleCardView.Transform;
					if (playCard.IsSpell || playCard.SelfBattlePlayer.BattleView.PlayQueueView.IsCardInQueue(playCard.BattleCardView))
					{
						MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 31);
						playCard.BattleCardView.Transform.SetParent(CutInContainer.transform, worldPositionStays: false);
					}
					if (playCard.IsSpell)
					{
						transform.position = transform2.position;
						transform.localScale = transform2.localScale;
						originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform);
						originalCard.BattleCardView.GameObject.SetActive(value: false);
						playCard.BattleCardView.GameObject.SetActive(value: true);
						playCard.BattleCardView.ShowInHandFrameEffect(enable: true, HandCardFrameEffectType.LIGHT_BLUE);
						originalCard.BattleCardView.CardTemplate.SetEffectStyle(UILabel.Effect.None);
					}
					else
					{
						transform.position = transform2.position;
						transform.localScale = transform2.localScale;
						originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform);
						originalCard.BattleCardView.GameObject.SetActive(value: false);
						playCard.BattleCardView.GameObject.SetActive(value: true);
						originalCard.BattleCardView.Transform.SetParent(originalCard.SelfBattlePlayer.BattleView.BanishParent.transform);
					}
				}
			}));
			if (isMutation)
			{
				sequentialVfxPlayer.Register(WaitVfx.Create(playCard.IsSpell ? 0.2f : 0.3f));
				if (!playCard.IsSpell)
				{
					sequentialVfxPlayer.Register(InstantVfx.Create(delegate
					{
						originalCard.BattleCardView.GameObject.SetActive(value: false);
						MotionUtils.SetLayerAll(playCard.BattleCardView.CardWrapObject, 10);
					}));
				}
			}
		}
		return sequentialVfxPlayer;
	}

	public List<BattleCardBase> CreateChoiceTokenCards(BattleCardBase actCard, List<int> choiceCardIdList, IBattlePlayerView playerBattleView)
	{
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < choiceCardIdList.Count; i++)
		{
			BattleCardBase battleCardBase = CreateTransformCardRegisterVfx(actCard, choiceCardIdList[i], isPlayer: true);
			list.Add(battleCardBase);
			Transform transform = battleCardBase.BattleCardView.GameObject.transform;
			transform.localPosition = Vector3.zero;
			transform.localEulerAngles = Vector3.zero;
		}
		playerBattleView.RegisterPlayCard(actCard);
		return list;
	}

	public VfxBase CreatePick(BattleCardBase card, NetworkBattleReceiver.CardInfo cardInfo)
	{
		if (card is SpellBattleCard)
		{
			return new StartPlaySpellVfx(card.BattleCardView, card);
		}
		return new StartSummonCardVfx(card.BattleCardView, base.BattleResourceMgr, card, cardInfo);
	}

	public void DeckCardToField(BattlePlayerBase player, BattleCardBase targetCard)
	{
		player.ClassAndInPlayCardList.Add(targetCard);
		player.DeckCardList.Remove(targetCard);
	}

	public void HandCardToField(BattlePlayerBase player, BattleCardBase targetCard)
	{
		player.ClassAndInPlayCardList.Add(targetCard);
		player.HandCardList.Remove(targetCard);
	}

	public void HandCardToCemetery(BattlePlayerBase player, BattleCardBase targetCard)
	{
		player.HandCardList.Remove(targetCard);
		player.CemeteryList.Add(targetCard);
	}

	private VfxBase CardToCemetery(BattlePlayerBase player, BattleCardBase targetCard)
	{
		if (player.ClassAndInPlayCardList.Contains(targetCard))
		{
			player.ClassAndInPlayCardList.Remove(targetCard);
		}
		else if (player.HandCardList.Contains(targetCard))
		{
			player.HandCardList.Remove(targetCard);
		}
		player.CemeteryList.Add(targetCard);
		return SequentialVfxPlayer.Create(targetCard.UnloadResource());
	}

	private VfxBase CardToBanishZone(BattlePlayerBase player, BattleCardBase targetCard)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		if (targetCard.IsInplay)
		{
			player.ClassAndInPlayCardList.Remove(targetCard);
		}
		else if (targetCard.IsInHand)
		{
			player.HandCardList.Remove(targetCard);
		}
		else if (targetCard.IsInDeck)
		{
			player.DeckCardList.Remove(targetCard);
			sequentialVfxPlayer.Register(new DeckChangeVfx(player));
			sequentialVfxPlayer.Register(new DummyDeckRemoveCardVfx(player.IsPlayer, 1));
		}
		player.BanishList.Add(targetCard);
		sequentialVfxPlayer.Register(targetCard.UnloadResource());
		return sequentialVfxPlayer;
	}

	private VfxBase CardToVehicleZone(BattlePlayerBase player, BattleCardBase targetCard)
	{
		player.ClassAndInPlayCardList.Remove(targetCard);
		player.GetOnList.Add(targetCard);
		return SequentialVfxPlayer.Create(targetCard.UnloadResource());
	}

	private void FieldCardToHand(BattlePlayerBase player, BattleCardBase targetCard)
	{
		player.ClassAndInPlayCardList.Remove(targetCard);
		player.InHandCards.Add(targetCard);
		player.HandCardList.Add(targetCard);
	}

	private VfxBase CardToUniteZone(BattleCardBase targetCard)
	{
		targetCard.SelfBattlePlayer.ClassAndInPlayCardList.Remove(targetCard);
		targetCard.SelfBattlePlayer.BanishList.Add(targetCard);
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(targetCard.UnloadResource());
		return sequentialVfxPlayer;
	}

	private void DestroyCard(ParallelVfxPlayer parallelVfx, BattleCardBase card, NetworkBattleReceiver.DestroyType destroyType)
	{
		SetDestroyType(card, destroyType);
		if (card.IsUnit)
		{
			BattleLogManager.GetInstance().AddLogDestFollower(BattleLogWindow.BattleLogType.Destruction, card);
		}
		parallelVfx.Register(CardToCemetery(card.SelfBattlePlayer, card));
		parallelVfx.Register(DestroyCard(card));
		if (card.IsChoiceEvolutionCard)
		{
			parallelVfx.Register(InstantVfx.Create(delegate
			{
				card.UpdateBuildInfoAndSkillCollection(card.BaseParameter.BaseCardId, card.BaseParameter.IsFoil, isNotUpdateAtkLife: true);
			}));
		}
	}

	private void BanishCard(ParallelVfxPlayer parallelVfx, BattleCardBase card)
	{
		card.DeathTypeInfo.BanishDestroy = true;
		parallelVfx.Register(CreateBanish(card));
		parallelVfx.Register(CardToBanishZone(card.SelfBattlePlayer, card));
		if (card.IsChoiceEvolutionCard)
		{
			parallelVfx.Register(InstantVfx.Create(delegate
			{
				card.UpdateBuildInfoAndSkillCollection(card.BaseParameter.BaseCardId, card.BaseParameter.IsFoil, isNotUpdateAtkLife: true);
			}));
		}
	}

	public void ReplaceInHand(BattlePlayerBase player, BattleCardBase originalCard, BattleCardBase newCard)
	{
		player.HandCardList.Insert(player.HandCardList.IndexOf(originalCard), newCard);
		player.HandCardList.Remove(originalCard);
	}

	public VfxBase ReplaceInPlay(BattlePlayerBase player, BattleCardBase originalCard, BattleCardBase newCard)
	{
		player.ClassAndInPlayCardList.Insert(player.ClassAndInPlayCardList.IndexOf(originalCard), newCard);
		player.ClassAndInPlayCardList.Remove(originalCard);
		return originalCard.RemoveFromInPlay();
	}

	public VfxWithLoading SummonToken(BattlePlayerBase player, BattleCardBase ownerCard, List<NetworkBattleReceiver.CardInfo> cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo, bool isOwnerEffect, bool isIgnoreVoice, bool isRandomVoice, bool isEvoVoice)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			if (!cardInfoList[i].IsOverflow)
			{
				BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index);
				UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
				player.ClassAndInPlayCardList.Add(battleCardBase);
				sequentialVfxPlayer.Register(battleCardBase.SetUpInplay());
				summonedCardsList.AddCardToSummonedCards(battleCardBase, isOwnerEffect);
				list.Add(battleCardBase);
			}
			else
			{
				BattleCardBase battleCardBase2 = player.CreateCard(cardInfoList[i].Id, cardInfoList[i].Index);
				UpdateSkillDescriptionValueList(battleCardBase2, cardInfoList[i]);
				summonedCardsList.AddCardToOverflowCards(battleCardBase2, isOwnerEffect);
				list.Add(battleCardBase2);
			}
		}
		vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list));
		if (effectInfo != null)
		{
			VfxWithLoading vfxWithLoadingToRegister = (effectInfo.IsTargetPosition ? CreateOwnerSummonSkillEffect(ownerCard, summonedCardsList, effectInfo) : CreateSkillEffect(ownerCard, summonedCardsList, effectInfo));
			vfxWithLoadingSequential.RegisterVfxWithLoading(vfxWithLoadingToRegister);
		}
		bool isSeSysSummonLandingDuplicateCheck = Global.SeSysSummonLandingDuplicateCheckId.Contains(ownerCard.BaseParameter.BaseCardId);
		StartPickMultiCardVfx vfxToRegister = new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true, isIgnoreVoice, isRandomVoice, isGetoff: false, isEvoVoice, -1f, null, isSeSysSummonLandingDuplicateCheck);
		vfxWithLoadingSequential.RegisterToMainVfx(vfxToRegister);
		vfxWithLoadingSequential.RegisterToMainVfx(sequentialVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxWithLoading SummonCard(BattlePlayerBase player, BattleCardBase ownerCard, List<BattleCardBase> targets, bool isDeckSelf, bool isBurialRite, NetworkBattleReceiver.EffectInfo effectInfo, bool isIgnoreVoice, List<NetworkBattleReceiver.CardInfo> cardInfoList)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create();
		SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList();
		for (int i = 0; i < targets.Count; i++)
		{
			if (isBurialRite)
			{
				sequentialVfxPlayer.Register(targets[i].SkillApplyInformation.AllSkillEffectStop());
				targets.ElementAt(i).SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier();
			}
			if (targets[i].IsInHand)
			{
				HandCardToField(player, targets[i]);
				sequentialVfxPlayer.Register(Skill_summon_card.RemoveHandCardFromViewVfx(targets[i], player, isBurialRite: false));
				sequentialVfxPlayer.Register(targets[i].StopSpellCharge());
			}
			else if (targets[i].IsInDeck)
			{
				DeckCardToField(player, targets[i]);
				sequentialVfxPlayer2.Register(new DeckChangeVfx(player));
				sequentialVfxPlayer2.Register(new DummyDeckRemoveCardVfx(player.IsPlayer, 1));
			}
			summonedCardsList.AddCardToSummonedCards(targets[i], !isDeckSelf);
			sequentialVfxPlayer2.Register(targets[i].SetUpInplay());
			targets[i].BattleCardView.SetNormalLabelEnable(isEnable: true);
			if (cardInfoList != null)
			{
				UpdateSkillDescriptionValueList(targets[i], cardInfoList[i]);
			}
		}
		vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(targets));
		VfxWithLoading vfxWithLoading = VfxWithLoadingSequential.Create();
		if (effectInfo != null)
		{
			vfxWithLoading = (effectInfo.IsTargetPosition ? CreateOwnerSummonSkillEffect(ownerCard, summonedCardsList, effectInfo) : CreateSkillEffect(ownerCard, summonedCardsList, effectInfo));
		}
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true, isIgnoreVoice, isRandomVoice: false, isGetoff: false, isEvoVoice: false, -1f, cardInfoList));
		if (isDeckSelf)
		{
			BattleCardBase battleCardBase = targets.First();
			sequentialVfxPlayer.Register(new DeckSelfSummonVfx(battleCardBase, base.BattleResourceMgr));
			parallelVfxPlayer.Register(new SummonCardShakeCameraVfx(battleCardBase));
		}
		sequentialVfxPlayer.Register(vfxWithLoading.MainVfx);
		sequentialVfxPlayer.Register(parallelVfxPlayer);
		sequentialVfxPlayer.Register(sequentialVfxPlayer2);
		vfxWithLoadingSequential.RegisterToMainVfx(sequentialVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxBase AttackStart(BattlePlayerBase player, BattleCardBase attackCard, BattleCardBase targetCard)
	{
		attackCard.BattleCardView._inPlayFrameEffect.HideFrameEffect();
		AttackSelectControl attackSelectControl = player.BattleView.AttackSelectControl;
		AttackSelectControl.AttackPair attackPair = new AttackSelectControl.AttackPair(attackCard.BattleCardView, targetCard.BattleCardView);
		attackPair._attackTarget._isReady = !attackSelectControl.IsCardTranslatable(targetCard.BattleCardView);
		attackSelectControl.RegisterAttackPair(attackPair);
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(new AttackSelectControl.WaitUntilAttackPairIsReadyVfx(attackPair));
		sequentialVfxPlayer.Register(attackCard.SelfBattlePlayer.BattleView.CreateStopAttackFloatVfx(attackCard.BattleCardView));
		sequentialVfxPlayer.Register(targetCard.SelfBattlePlayer.BattleView.CreateStopAttackFloatVfx(targetCard.BattleCardView));
		return sequentialVfxPlayer;
	}

	public VfxBase Attack(BattlePlayerBase player, BattleCardBase attackCard, BattleCardBase targetCard, int dealDamage, int receiveDamage, List<BattleCardBase> destroyList, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<BattleCardBase> banishList, int drain, NetworkBattleReceiver.CardInfo attackCardInfo, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList, bool isAttackerDead, bool isTargetDead)
	{
		AttackSelectControl attackSelectControl = player.BattleView.AttackSelectControl;
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(attackSelectControl.RemoveAttackPairVfx(attackCard.BattleCardView, targetCard.BattleCardView));
		if (isAttackerDead || isTargetDead || attackCard.SelfBattlePlayer.Class.IsDead || targetCard.SelfBattlePlayer.Class.IsDead || !attackCard.IsInplay || !targetCard.IsInplay)
		{
			ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
			if (!isAttackerDead && attackCard.IsInplay)
			{
				IBattleCardView battleCardView = attackCard.BattleCardView;
				parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView));
			}
			if (!isTargetDead && targetCard.IsInplay)
			{
				IBattleCardView battleCardView2 = targetCard.BattleCardView;
				parallelVfxPlayer.Register(attackSelectControl.ResetCardAfterAttack(battleCardView2));
			}
			sequentialVfxPlayer.Register(parallelVfxPlayer);
			return sequentialVfxPlayer;
		}
		targetCard.SkillApplyInformation.DamageLife(dealDamage, base.CurrentTurn, player.IsSelfTurn);
		SequentialVfxPlayer sequentialVfxPlayer2 = SequentialVfxPlayer.Create();
		if (attackCard.SkillApplyInformation.IsSneak)
		{
			sequentialVfxPlayer2.Register(attackCard.SkillApplyInformation.FourceDepriveSneak());
		}
		sequentialVfxPlayer2.Register(attackCard.VfxCreator.CreateAttack(attackCard.BattleCardView, targetCard.BattleCardView));
		SequentialVfxPlayer sequentialVfxPlayer3 = SequentialVfxPlayer.Create(sequentialVfxPlayer2, targetCard.VfxCreator.CreateDamage(dealDamage, targetCard.Life, targetCard.MaxLife, targetCard.BaseMaxLife, isReflectedDamage: false, IsSkillDamage: false));
		if (targetCard is UnitBattleCard)
		{
			attackCard.SkillApplyInformation.DamageLife(receiveDamage, base.CurrentTurn, player.IsSelfTurn);
		}
		SequentialVfxPlayer sequentialVfxPlayer4 = SequentialVfxPlayer.Create(WaitVfx.Create(0.4f), (targetCard is UnitBattleCard) ? targetCard.VfxCreator.CreateAttack(targetCard.BattleCardView, attackCard.BattleCardView) : NullVfx.GetInstance());
		ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create((targetCard is UnitBattleCard) ? attackCard.VfxCreator.CreateDamage(receiveDamage, attackCard.Life, attackCard.MaxLife, attackCard.BaseMaxLife, isReflectedDamage: false, IsSkillDamage: false) : NullVfx.GetInstance());
		if (drain != -1)
		{
			BattleCardBase target = attackCard.SelfBattlePlayer.Class;
			SequentialVfxPlayer sequentialVfxPlayer5 = SequentialVfxPlayer.Create();
			sequentialVfxPlayer5.Register(WaitVfx.Create(0.3f));
			target.SkillApplyInformation.HealLife(drain, base.CurrentTurn, BattlePlayer.IsSelfTurn);
			sequentialVfxPlayer5.Register(target.VfxCreator.CreateHealing(drain, target.Life, target.MaxLife, target.BaseMaxLife));
			EffectBattle effectBattle = null;
			Vector3 effectPosition = target.BattleCardView.CardWrapObject.transform.position;
			sequentialVfxPlayer5.Register(new SkillBase.WaitEffectLoadVfx("btl_magic_cure_1", EffectMgr.EngineType.SHURIKEN, "se_btl_magic_cure_1", base.BattleResourceMgr, delegate(EffectBattle eb)
			{
				effectBattle = eb;
			}));
			sequentialVfxPlayer5.Register(new DelaySetupVfx(() => new SkillEffectBattleVfx(effectBattle, target.BattleCardView, base.BattleResourceMgr, () => effectPosition, () => effectPosition, 0f, 0.2f, EffectMgr.MoveType.NONE, target.SelfBattlePlayer.IsPlayer, Color.clear)));
			parallelVfxPlayer2.Register(sequentialVfxPlayer5);
		}
		sequentialVfxPlayer4.Register(parallelVfxPlayer2);
		sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(sequentialVfxPlayer3, sequentialVfxPlayer4));
		ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer4 = ParallelVfxPlayer.Create();
		int num = destroyList.IndexOf(attackCard);
		if (num > -1 || banishList.IndexOf(attackCard) > -1)
		{
			if (attackCard.Life > 0)
			{
				attackCard.FlagCardAsDestroyedByKiller();
			}
			if (num > -1)
			{
				DestroyCard(parallelVfxPlayer4, attackCard, destroyTypeList[num]);
			}
			else
			{
				BanishCard(parallelVfxPlayer4, attackCard);
			}
			if (!destroyList.Contains(targetCard))
			{
				attackCard.BattleCardView.playVoiceOnDeath = true;
				attackCard.BattleCardView.VoiceInfo.SetDestroyCardId(targetCard.BaseParameter.BaseCardId);
			}
			parallelVfxPlayer3.Register(player.BattleView.CreateStopAttackFloatVfx(attackCard.BattleCardView));
		}
		else
		{
			parallelVfxPlayer3.Register(attackSelectControl.ResetCardAfterAttack(attackCard.BattleCardView));
		}
		int num2 = destroyList.IndexOf(targetCard);
		if (num2 > -1 || banishList.IndexOf(targetCard) > -1)
		{
			if (targetCard.Life > 0)
			{
				targetCard.FlagCardAsDestroyedByKiller();
			}
			if (num2 > -1)
			{
				DestroyCard(parallelVfxPlayer4, targetCard, destroyTypeList[num2]);
			}
			else
			{
				BanishCard(parallelVfxPlayer4, targetCard);
			}
			targetCard.BattleCardView.playVoiceOnDeath = true;
			targetCard.BattleCardView.VoiceInfo.SetDestroyCardId(attackCard.BaseParameter.BaseCardId);
			parallelVfxPlayer3.Register(targetCard.SelfBattlePlayer.BattleView.CreateStopAttackFloatVfx(attackCard.BattleCardView));
		}
		else
		{
			parallelVfxPlayer3.Register(attackSelectControl.ResetCardAfterAttack(targetCard.BattleCardView));
		}
		sequentialVfxPlayer.Register(CreateSkillSideLog(sideLogSkillInfoList));
		sequentialVfxPlayer.Register(SequentialVfxPlayer.Create(parallelVfxPlayer3, parallelVfxPlayer4));
		attackCard.AttackableOnReplay = attackCardInfo.Attackable;
		attackCard.IsCantAttackClassOnReplay = attackCardInfo.IsCantAttackClass;
		attackCard.AttackableCount = attackCardInfo.AttackableCount;
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			attackCard.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect();
		}));
		bool num3 = attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl.IsShow && attackCard.SelfBattlePlayer.BattleMgr.DetailMgr.DetailPanelControl._card == attackCard;
		bool flag = attackCard.SelfBattlePlayer.IsSelfTurn && attackCard.IsPlayer && attackCard.IsInplay && attackCard.AttackableCount <= 0;
		if (num3 && flag)
		{
			sequentialVfxPlayer.Register(attackCard.BattleCardView.ShowAttackFinished());
		}
		return sequentialVfxPlayer;
	}

	public VfxBase SkillEvolve(BattleCardBase ownerCard, List<BattleCardBase> allCards, List<NetworkBattleReceiver.CardInfo> cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo, int evolveMeWhenAttackIndex)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create();
		float num = 0f;
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			NetworkBattleReceiver.CardInfo cardInfo = cardInfoList[i];
			BattleCardBase targetCard = GetBattleCardIdx(allCards, cardInfoList[i].Index);
			VfxWith<Func<GameObject>> vfxWith = SkillEvolveVfx.LoadCardEvolveResources(targetCard, base.BattleResourceMgr);
			SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(WaitVfx.Create(num));
			VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCard.AsIEnumerable(), effectInfo);
			parallelVfxPlayer.Register(vfxWithLoading.LoadingVfx);
			sequentialVfxPlayer.Register(vfxWithLoading.MainVfx);
			sequentialVfxPlayer.Register(targetCard.SkillApplyInformation.AllSkillEffectStop(isEvolve: true));
			parallelVfxPlayer3.Register(InstantVfx.Create(delegate
			{
				targetCard.BattleCardView._inPlayFrameEffect.HideFrameEffect();
			}));
			(targetCard as UnitBattleCard).Evolution();
			bool evolveMeWhenAttack = targetCard.Index == evolveMeWhenAttackIndex;
			sequentialVfxPlayer.Register(new SkillEvolveVfx(targetCard, base.BattleResourceMgr, vfxWith.Value, ownerCard, evolveMeWhenAttack));
			sequentialVfxPlayer.Register(targetCard.SkillApplyInformation.UpdateAllSkillEffectInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true));
			sequentialVfxPlayer.Register(targetCard.SkillApplyInformation.AllSkillEffectRestart());
			targetCard.AttackableOnReplay = cardInfo.Attackable;
			targetCard.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass;
			sequentialVfxPlayer.Register(InstantVfx.Create(delegate
			{
				targetCard.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect();
			}));
			parallelVfxPlayer2.Register(sequentialVfxPlayer);
			parallelVfxPlayer.Register(vfxWith.Vfx);
			num += 0.05f;
		}
		VfxBase vfxToRegister = UIManager.GetInstance().CreateNowLoadingVfx(parallelVfxPlayer);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer3, parallelVfxPlayer2);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxToRegister);
		return vfxWithLoadingSequential;
	}

	public VfxBase ChoiceEvolve(BattleCardBase card, int choiceEvolutionId)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		UnitBattleCardView unitBattleCardView = card.BattleCardView as UnitBattleCardView;
		parallelVfxPlayer.Register(base.BattleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: false)));
		parallelVfxPlayer.Register(base.BattleResourceMgr.DecrementEffectBattleRefCount(card.BaseParameter.AtkEffectParameter.GetEffectPath(isEvolve: true)));
		card.UpdateBuildInfoAndSkillCollection(choiceEvolutionId, isFoil: false);
		card.BattleCardView.InitializeVoiceInfo(card.CardId);
		for (int i = 0; i < card.NormalSkills.Count(); i++)
		{
			card.NormalSkills.ElementAt(i).SetInductionVoiceIndex();
		}
		for (int j = 0; j < card.EvolutionSkills.Count(); j++)
		{
			card.EvolutionSkills.ElementAt(j).SetInductionVoiceIndex();
		}
		parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: false));
		parallelVfxPlayer.Register(unitBattleCardView.LoadAttackEffect(card.BaseParameter.AtkEffectParameter, isEvolve: true));
		return parallelVfxPlayer;
	}

	public VfxBase CostChange(BattleCardBase ownerCard, List<BattleCardBase> targetCards, List<int> addCostList, List<int> setCostList, List<bool> isCostUpList, bool isHalf, bool isSpellCharge, bool isOpenCard, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		List<ICardCostModifier> list = new List<ICardCostModifier>();
		if (isHalf)
		{
			list.Add(new CostHalfRoundUpModifier(isResidentModifier: false));
		}
		else if (addCostList.Count > 0)
		{
			for (int i = 0; i < addCostList.Count; i++)
			{
				list.Add(new CostAddModifier(addCostList[i]));
			}
		}
		else if (setCostList.Count > 0)
		{
			for (int j = 0; j < setCostList.Count; j++)
			{
				list.Add(new CostSetModifier(setCostList[j]));
			}
		}
		for (int k = 0; k < targetCards.Count; k++)
		{
			BattleCardBase battleCardBase = targetCards[k];
			ICardCostModifier modifier = ((list.Count > k) ? list[k] : list.LastOrDefault());
			battleCardBase.AddCostModifier(modifier, null);
		}
		CostChangeVfx costChangeVfx = new CostChangeVfx(targetCards.ToList(), isSpellCharge, isCostUpList, isStop: false);
		if (effectInfo != null && effectInfo.EffectMoveType == EffectMgr.MoveType.DIRECT_HAND)
		{
			if (ownerCard.IsPlayer)
			{
				targetCards = new List<BattleCardBase> { ownerCard.OpponentBattlePlayer.Class };
			}
			else
			{
				targetCards.Clear();
			}
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo));
		vfxWithLoadingSequential.RegisterToLoadingVfx(costChangeVfx.LoadingVfx);
		vfxWithLoadingSequential.RegisterToMainVfx(costChangeVfx.MainVfx);
		if (isOpenCard)
		{
			vfxWithLoadingSequential.RegisterToMainVfx((BattlePlayer as ReplayBattlePlayer).OpenCard(targetCards[0]));
		}
		return vfxWithLoadingSequential;
	}

	public VfxBase RemoveCostChange(List<BattleCardBase> targetCards, List<int> removeCostChangeIndexList, bool isSpellCharge, bool isAdd)
	{
		List<ICardCostModifier> list = new List<ICardCostModifier>();
		List<BattleCardBase> list2 = new List<BattleCardBase>();
		for (int i = 0; i < targetCards.Count; i++)
		{
			if (removeCostChangeIndexList[i] >= 0 && targetCards[i] != null && removeCostChangeIndexList[i] < targetCards[i].CostModifierList.Count)
			{
				list.Add(targetCards[i].CostModifierList[removeCostChangeIndexList[i]]);
				list2.Add(targetCards[i]);
			}
		}
		for (int j = 0; j < list.Count; j++)
		{
			list2[j].CostModifierList.Remove(list[j]);
		}
		return new CostChangeVfx(list2, isSpellCharge, new List<bool>(), isStop: true).MainVfx;
	}

	public VfxBase PowerUp(BattleCardBase ownerCard, List<BattleCardBase> targetCards, int offense, int life, int multiplyAttack, int multiplyLife, int maxLife, List<BattleCardBase> destroyList, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<BattleCardBase> banishList, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		List<BattleCardBase> targetCards2 = targetCards.Where((BattleCardBase c) => (c.IsPlayer || !c.IsInHand) && !c.IsInCemetery).ToList();
		ICardOffenseModifier offenseModifier = ((offense != 0) ? new OffenseAddModifier(offense) : ((multiplyAttack == -1) ? ((ICardOffenseModifier)new OffenseAddModifier(0)) : ((ICardOffenseModifier)new OffenseMultiplyModifier(multiplyAttack))));
		ICardLifeModifier lifeModifier = ((life != 0) ? new LifeAddModifier(life) : ((multiplyLife != -1) ? ((ICardLifeModifier)new LifeMultiplyModifier(multiplyLife)) : ((ICardLifeModifier)((maxLife == -1) ? new LifeAddModifier(0) : new MaxLifeAddModifier(maxLife)))));
		for (int num = 0; num < targetCards.Count; num++)
		{
			parallelVfxPlayer.Register(targetCards[num].SkillApplyInformation.GiveCombatValueModifier(offenseModifier, lifeModifier, new SkillProcessor()));
		}
		List<BattleCardBase> list = new List<BattleCardBase>();
		if (life < 0)
		{
			for (int num2 = 0; num2 < targetCards.Count; num2++)
			{
				int num3 = destroyList.IndexOf(targetCards[num2]);
				if (num3 > -1)
				{
					DestroyCard(parallelVfxPlayer, targetCards[num2], destroyTypeList[num3]);
					list.Add(targetCards[num2]);
				}
				if (banishList.IndexOf(targetCards[num2]) > -1)
				{
					BanishCard(parallelVfxPlayer, targetCards[num2]);
				}
			}
		}
		if (playVoiceOnDeathCard != null)
		{
			playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true;
			playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards2, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxBase GainPowerDown(BattleCardBase ownerCard, List<BattleCardBase> targetCards, int offense, int life, int maxLife, List<BattleCardBase> destroyList, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<BattleCardBase> banishList, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList)
	{
		OffenseAddModifier offenseAddModifier = null;
		LifeAddModifier lifeAddModifier = null;
		if (offense < 0)
		{
			offenseAddModifier = new OffenseAddModifier(offense);
		}
		if (life < 0)
		{
			lifeAddModifier = new LifeAddModifier(life);
		}
		if (maxLife < 0)
		{
			lifeAddModifier = new MaxLifeAddModifier(maxLife);
		}
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < targetCards.Count; i++)
		{
			if (offenseAddModifier != null && lifeAddModifier != null)
			{
				parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseAddModifier, lifeAddModifier, new SkillProcessor()));
			}
			if (offenseAddModifier != null && lifeAddModifier == null)
			{
				parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseAddModifier, null, new SkillProcessor()));
			}
			if (lifeAddModifier != null)
			{
				if (offenseAddModifier == null)
				{
					parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(null, lifeAddModifier, new SkillProcessor()));
				}
				int num = destroyList.IndexOf(targetCards[i]);
				if (num > -1)
				{
					DestroyCard(parallelVfxPlayer, targetCards[i], destroyTypeList[num]);
					list.Add(targetCards[i]);
				}
				if (banishList.IndexOf(targetCards[i]) > -1)
				{
					BanishCard(parallelVfxPlayer, targetCards[i]);
				}
			}
		}
		if (playVoiceOnDeathCard != null)
		{
			playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true;
			playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxBase SetPowerDown(BattleCardBase ownerCard, List<BattleCardBase> targetCards, int offense, int life, int maxLife, List<BattleCardBase> destroyList, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<BattleCardBase> banishList, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList)
	{
		OffenseSetModifier offenseSetModifier = null;
		LifeSetModifier lifeSetModifier = null;
		if (offense != Skill_power_down.SETPRM_NONE)
		{
			offenseSetModifier = new OffenseSetModifier(offense);
		}
		if (life != Skill_power_down.SETPRM_NONE)
		{
			lifeSetModifier = new LifeSetModifier(life);
		}
		else if (maxLife != Skill_power_down.SETPRM_NONE)
		{
			lifeSetModifier = new MaxLifeSetModifier(maxLife);
		}
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			if (offenseSetModifier != null && lifeSetModifier != null)
			{
				parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseSetModifier, lifeSetModifier, new SkillProcessor()));
			}
			if (offenseSetModifier != null && lifeSetModifier == null)
			{
				parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(offenseSetModifier, null, new SkillProcessor()));
			}
			if (lifeSetModifier != null)
			{
				if (offenseSetModifier == null)
				{
					parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.GiveCombatValueModifier(null, lifeSetModifier, new SkillProcessor()));
				}
				int num = destroyList.IndexOf(targetCards[i]);
				if (num > -1)
				{
					DestroyCard(parallelVfxPlayer, targetCards[i], destroyTypeList[num]);
				}
				if (banishList.IndexOf(targetCards[i]) > -1)
				{
					BanishCard(parallelVfxPlayer, targetCards[i]);
				}
			}
		}
		if (playVoiceOnDeathCard != null)
		{
			playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true;
			playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxBase DepriveBuff(List<BattleCardBase> targetCards, List<int> depriveOffenseBuffList, List<int> depriveLifeBuffList)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		List<Skill_powerup.PowerUpModifierContainer> list = new List<Skill_powerup.PowerUpModifierContainer>();
		for (int i = 0; i < targetCards.Count; i++)
		{
			list.Add(new Skill_powerup.PowerUpModifierContainer(targetCards[i], (depriveOffenseBuffList[i] >= 0) ? targetCards[i].SkillApplyInformation.OffenseModifierList[depriveOffenseBuffList[i]] : null, (depriveLifeBuffList[i] >= 0) ? targetCards[i].SkillApplyInformation.LifeModifierList[depriveLifeBuffList[i]] : null, null));
		}
		for (int j = 0; j < list.Count; j++)
		{
			parallelVfxPlayer.Register(list[j].TargetCard.SkillApplyInformation.DepriveCombatValueModifire(list[j].OffenseModifier, list[j].LifeModifier));
		}
		return parallelVfxPlayer;
	}

	public VfxBase SpellCharge(BattleCardBase ownerCard, List<BattleCardBase> targetCards, List<int> addList, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			BattleCardBase battleCardBase = targetCards[i];
			if (battleCardBase.IsPlayer && !battleCardBase.IsInDeck)
			{
				parallelVfxPlayer.Register(battleCardBase.GetSpellChargeLoopEffect(addList[i]));
			}
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		VfxWithLoadingSequential vfxWithLoadingSequential2 = ownerCard.SelfBattlePlayer.AddSpellChargeCountVfx(targetCards, addList);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoadingSequential2.LoadingVfx);
		vfxWithLoadingSequential.RegisterToMainVfx(vfxWithLoadingSequential2.MainVfx);
		return vfxWithLoadingSequential;
	}

	public VfxBase Damage(BattleCardBase ownerCard, List<BattleCardBase> targetCards, List<int> damageList, List<BattleCardBase> destroyList, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<BattleCardBase> banishList, NetworkBattleReceiver.EffectInfo effectInfo, List<bool> isReflectionDamage, BattleCardBase playVoiceOnDeathCard, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList, List<BattleCardBase> effectTargetCards)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < targetCards.Count; i++)
		{
			targetCards[i].SkillApplyInformation.DamageLife(damageList[i], base.CurrentTurn, BattlePlayer.IsSelfTurn);
			parallelVfxPlayer.Register(targetCards[i].VfxCreator.CreateDamage(damageList[i], targetCards[i].Life, targetCards[i].MaxLife, targetCards[i].BaseMaxLife, isReflectionDamage[i], IsSkillDamage: true));
		}
		for (int j = 0; j < targetCards.Count; j++)
		{
			int num = destroyList.IndexOf(targetCards[j]);
			if (num > -1 && (!(targetCards[j] is ClassBattleCardBase) || !list.Contains(targetCards[j])))
			{
				DestroyCard(parallelVfxPlayer2, targetCards[j], destroyTypeList[num]);
				list.Add(targetCards[j]);
			}
			if (banishList.IndexOf(targetCards[j]) > -1)
			{
				BanishCard(parallelVfxPlayer2, targetCards[j]);
			}
		}
		if (playVoiceOnDeathCard != null)
		{
			playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true;
			playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1);
		}
		List<BattleCardBase> targetCards2 = (isReflectionDamage.Contains(item: true) ? effectTargetCards : targetCards);
		VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCards2, effectInfo);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(vfxWithLoading.MainVfx, parallelVfxPlayer, CreateSkillSideLog(sideLogSkillInfoList), parallelVfxPlayer2);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		if (ownerCard.SkillApplyInformation.IsSneak)
		{
			vfxWithLoadingSequential.RegisterToMainVfx(ownerCard.SkillApplyInformation.FourceDepriveSneak());
		}
		return vfxWithLoadingSequential;
	}

	public VfxBase Heal(BattleCardBase ownerCard, List<BattleCardBase> targetCards, List<int> healAmountList, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			targetCards[i].SkillApplyInformation.HealLife(healAmountList[i], base.CurrentTurn, BattlePlayer.IsSelfTurn);
			parallelVfxPlayer2.Register(targetCards[i].VfxCreator.CreateHealing(healAmountList[i], targetCards[i].Life, targetCards[i].MaxLife, targetCards[i].BaseMaxLife));
			if (targetCards[i] is ClassBattleCardBase)
			{
				parallelVfxPlayer.Register(targetCards[i].SelfBattlePlayer.BattleView.HandView.HandUnfocus());
			}
		}
		VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCards, effectInfo);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer, vfxWithLoading.MainVfx, parallelVfxPlayer2);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		return vfxWithLoadingSequential;
	}

	public VfxBase Discard(List<BattleCardBase> targetCards)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			targetCards[i].BattleCardView.HideCanPlayEffect();
			parallelVfxPlayer.Register(CardToCemetery(targetCards[i].SelfBattlePlayer, targetCards[i]));
			parallelVfxPlayer.Register(targetCards[i].VfxCreator.CreateDestroyHand(targetCards[i].DeathTypeInfo, targetCards[i].SelfBattlePlayer));
			parallelVfxPlayer.Register(HideDetailPanel(targetCards[i]));
		}
		return parallelVfxPlayer;
	}

	private VfxBase DestroyCard(BattleCardBase card)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(card.RemoveFromInPlay());
		sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectStop());
		sequentialVfxPlayer.Register(card.VfxCreator.CreateDestroy(card.DeathTypeInfo, card.SelfBattlePlayer));
		sequentialVfxPlayer.Register(HideDetailPanel(card));
		return sequentialVfxPlayer;
	}

	public VfxBase DestroyOrBanish(BattleCardBase ownerCard, List<BattleCardBase> destroyCards, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<BattleCardBase> banishCards, List<BattleCardBase> indestructibleCards, NetworkBattleReceiver.EffectInfo effectInfo, BattleCardBase playVoiceOnDeathCard, bool isBurialRite, bool isOpen, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < destroyCards.Count; i++)
		{
			if (isBurialRite)
			{
				parallelVfxPlayer.Register(destroyCards[i].SkillApplyInformation.AllSkillEffectStop());
				BattleCardBase destroyCard = destroyCards[i];
				parallelVfxPlayer.Register(InstantVfx.Create(delegate
				{
					destroyCard.IsSelectedDuringSelectingBurialRiteTarget = false;
				}));
			}
			destroyCards[i].FlagCardAsDestroyedBySkill();
			DestroyCard(parallelVfxPlayer, destroyCards[i], destroyTypeList[i]);
			list.Add(destroyCards[i]);
		}
		if (playVoiceOnDeathCard != null)
		{
			playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true;
			playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1);
		}
		for (int num = 0; num < banishCards.Count; num++)
		{
			BattleCardBase banishCard = banishCards[num];
			if (isOpen && banishCard.IsInDeck)
			{
				if (banishCard.BattleCardView != null)
				{
					List<int> costList = banishCard.BattleCardView.GetUseCostList(banishCard.Cost);
					parallelVfxPlayer.Register(InstantVfx.Create(delegate
					{
						banishCard.BattleCardView.UpdateCost(costList, isGenerateInHand: false, playEffect: false, isForceUpdate: true);
						banishCard.BattleCardView.UpdateOffence(banishCard.Atk);
						banishCard.BattleCardView.UpdateLife(banishCard.Life);
					}));
				}
				parallelVfxPlayer.Register(new BanishDeckCardVfx(banishCard.BattleCardView));
			}
			banishCard.FlagCardAsDestroyedBySkill();
			BanishCard(parallelVfxPlayer, banishCard);
			list.Add(banishCard);
		}
		list.AddRange(indestructibleCards);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, list, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(CreateSkillSideLog(sideLogSkillInfoList));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	private void SetDestroyType(BattleCardBase target, NetworkBattleReceiver.DestroyType destroyType)
	{
		switch (destroyType)
		{
		case NetworkBattleReceiver.DestroyType.BurialRite:
			target.DeathTypeInfo.BurialRite = true;
			break;
		case NetworkBattleReceiver.DestroyType.WhiteRitual:
			target.DeathTypeInfo.MysteriesDestroy = true;
			break;
		case NetworkBattleReceiver.DestroyType.ChantCount:
			target.DeathTypeInfo.WhenDestroy = true;
			target.DeathTypeInfo.ChantDestroy = true;
			break;
		case NetworkBattleReceiver.DestroyType.WhenDestroy:
			target.DeathTypeInfo.WhenDestroy = true;
			break;
		case NetworkBattleReceiver.DestroyType.Killer:
			target.DeathTypeInfo.DestroyedByKiller = true;
			break;
		case NetworkBattleReceiver.DestroyType.WhenDestroyAndKiller:
			target.DeathTypeInfo.WhenDestroy = true;
			target.DeathTypeInfo.DestroyedByKiller = true;
			break;
		}
	}

	private VfxBase CreateBanish(BattleCardBase card)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(HideDetailPanel(card));
		if (card.IsInplay)
		{
			sequentialVfxPlayer.Register(card.RemoveFromInPlay());
			sequentialVfxPlayer.Register(card.SkillApplyInformation.AllSkillEffectStop());
			sequentialVfxPlayer.Register(card.VfxCreator.CreateBanish(card.DeathTypeInfo, card.SelfBattlePlayer));
		}
		else if (card.IsInHand)
		{
			sequentialVfxPlayer.Register(card.VfxCreator.CreateBanishHand(card.DeathTypeInfo, card.SelfBattlePlayer));
		}
		return sequentialVfxPlayer;
	}

	public VfxBase Return(List<BattleCardBase> targetCards, List<BattleCardBase> banishCards, List<BattleCardBase> destroyCards, List<NetworkBattleReceiver.DestroyType> destroyTypeList, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList, BattleCardBase playVoiceOnDeathCard)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < targetCards.Count; i++)
		{
			BattleCardBase battleCardBase = targetCards[i];
			if (battleCardBase.IsChoiceEvolutionCard)
			{
				battleCardBase.ResetChoiceEvolutionCardBuildInfo();
			}
			battleCardBase.SetSpellChargeCount(0);
			battleCardBase.SkillApplyInformation.ForceDepriveChantCount();
			SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
			sequentialVfxPlayer.Register(InstantVfx.Create(battleCardBase.BattleCardView._inPlayFrameEffect.HideFrameEffect));
			battleCardBase.BattleCardView.InitHandParameter();
			battleCardBase.UpdateCostViewStrategy(isForceUpdate: true);
			sequentialVfxPlayer.Register(battleCardBase.SkillApplyInformation.AllSkillEffectStop(isEvolve: false, isReturn: true));
			sequentialVfxPlayer.Register(HideDetailPanel(battleCardBase));
			sequentialVfxPlayer.Register(battleCardBase.RemoveFromInPlay());
			battleCardBase.InitializeParameterOnWhenReturn();
			if (banishCards.Contains(targetCards[i]))
			{
				targetCards[i].DeathTypeInfo.BanishDestroy = true;
				targetCards[i].SkillApplyInformation.GiveRemoveByBanish();
				sequentialVfxPlayer.Register(CardToBanishZone(battleCardBase.SelfBattlePlayer, battleCardBase));
			}
			else if (battleCardBase.SelfBattlePlayer.HandCardList.Count >= 9)
			{
				sequentialVfxPlayer.Register(CardToCemetery(battleCardBase.SelfBattlePlayer, battleCardBase));
			}
			else
			{
				FieldCardToHand(battleCardBase.SelfBattlePlayer, battleCardBase);
				list.Add(battleCardBase);
			}
			parallelVfxPlayer.Register(sequentialVfxPlayer);
		}
		for (int j = 0; j < destroyCards.Count; j++)
		{
			destroyCards[j].FlagCardAsDestroyedBySkill();
			DestroyCard(parallelVfxPlayer, destroyCards[j], destroyTypeList[j]);
		}
		if (playVoiceOnDeathCard != null)
		{
			playVoiceOnDeathCard.BattleCardView.playVoiceOnDeath = true;
			playVoiceOnDeathCard.BattleCardView.VoiceInfo.SetDestroyCardId(-1);
		}
		return VfxWithLoading.Create(LoadCardResources(list), SequentialVfxPlayer.Create(CreateSkillSideLog(sideLogSkillInfoList), parallelVfxPlayer, new ReturnCardVfx(targetCards.Where((BattleCardBase c) => c.IsPlayer).ToList(), targetCards.Where((BattleCardBase c) => !c.IsPlayer).ToList(), base.BattleResourceMgr)));
	}

	public VfxBase Fusion(BattleCardBase card, List<BattleCardBase> ingredientCards, BattlePlayerBase player, NetworkBattleReceiver.CardInfo cardInfo, bool isFusionMetamorphose, int fusionMetamorphoseCardId, List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(player.BattleView.CreateBeforeFusionVfx(card, ingredientCards));
		SkillProcessor skillProcessor = new SkillProcessor();
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		foreach (BattleCardBase ingredientCard in ingredientCards)
		{
			parallelVfxPlayer.Register(player.UseFusionIngredientManagement(ingredientCard, card, skillProcessor, isRandom: false, isFusionMetamorphose));
		}
		sequentialVfxPlayer.Register(parallelVfxPlayer);
		BattleLogManager.GetInstance().AddFusionIngredients(card, isCreateClone: true);
		BattleCardBase originalCard = card;
		if (isFusionMetamorphose)
		{
			sequentialVfxPlayer.Register(CreateSkillSideLog(sideLogSkillInfoList));
			VfxWith<BattleCardBase> vfxWith = FusionMetamorphose(card, fusionMetamorphoseCardId);
			sequentialVfxPlayer.Register(vfxWith.Vfx);
			card = vfxWith.Value;
		}
		sequentialVfxPlayer.Register(player.BattleView.ReturnActCardAfterFusion(card.BattleCardView, isFusionMetamorphose));
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			ShowSideLog(originalCard, player, isEvol: false, 3f, isSkillTargetSelect: true, cardInfo);
		}));
		return sequentialVfxPlayer;
	}

	public VfxBase ChantCountChange(BattleCardBase ownerCard, List<BattleCardBase> targetCards, int changeCount, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo));
		int i;
		for (i = 0; i < targetCards.Count; i++)
		{
			targetCards[i].OnRemoveFromInPlayAfterOneTime += (bool flg, SkillProcessor skillProcessor) => new RemoveChantCountVfx(targetCards[i].BattleCardView);
			targetCards[i].SkillApplyInformation.GiveChantCount(new ChantCountAddModifier(changeCount));
			vfxWithLoadingSequential.RegisterVfxWithLoading(new ChangeChantCountVfx(targetCards[i], targetCards[i].ChantCount, base.BattleResourceMgr));
		}
		return vfxWithLoadingSequential;
	}

	public VfxBase ChangeWhiteRitualStack(BattleCardBase target, int changeCount, bool isDestroy, NetworkBattleReceiver.CardInfo cardInfo)
	{
		target.SkillApplyInformation.GiveWhiteRitualCount(changeCount);
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create(isDestroy ? target.BattleCardView.UpdateStackWhiteRitualIconNumber() : new ChangeWhiteRitualCountVfx(target, changeCount));
		if (target.HasStackWhiteRitualAndOtherIconSkill() && target.BattleCardView.BattleCardIconAnimations.GetIconListCount() < 2)
		{
			sequentialVfxPlayer.Register(target.BattleCardView.BattleCardIconAnimations.UpdateSkillIconInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true, changeCount != 0));
		}
		return sequentialVfxPlayer;
	}

	public VfxBase Necromance(BattleCardBase card, bool isFusion)
	{
		if (!card.IsSpell && (!isFusion || card.IsPlayer))
		{
			return new NecromanceSkillActivationVfx(card.BattleCardView);
		}
		return NullVfx.GetInstance();
	}

	public VfxBase UpdateDeck(BattlePlayerBase player, BattleCardBase ownerCard, List<NetworkBattleReceiver.CardInfo> cardInfoList, bool isChange, bool isOpen, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		List<BattleCardBase> list = new List<BattleCardBase>();
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		ParallelVfxPlayer skillOrDestroyVfx = ParallelVfxPlayer.Create();
		if (isChange)
		{
			player.BlackHole.AddRange(player.DeckCardList);
			player.DeckCardList.Clear();
		}
		List<BattleCardBase> list2 = new List<BattleCardBase>();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index);
			player.DeckCardList.Add(battleCardBase);
			list.Add(battleCardBase);
			UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
			if (battleCardBase.HasDeckSelfSkill)
			{
				player.AddDeckSkillCard(battleCardBase);
			}
			list2.Add(battleCardBase);
		}
		if (!isChange)
		{
			vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list2));
		}
		if (!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SHOW_BATTLE_EFFECT))
		{
			vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, list, effectInfo));
		}
		if (!isChange)
		{
			VfxWithLoading vfxWithLoading = player.CreateTokenSpawnVfx(list[0]);
			vfxWithLoadingSequential.RegisterToMainVfx(new AddTokenDeckVfx(list, vfxWithLoading.MainVfx, player, skillOrDestroyVfx, isOpen));
			vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		}
		vfxWithLoadingSequential.RegisterToMainVfx(new DummyDeckChangeCardVfx(player.IsPlayer, player.DeckCardList.Count));
		vfxWithLoadingSequential.RegisterToMainVfx(new DeckChangeVfx(player));
		return vfxWithLoadingSequential;
	}

	public void IndexChange(BattlePlayerBase player, BattleCardBase addTarget, BattleCardBase changeTarget)
	{
		int index = addTarget.Index;
		addTarget.SetIndex(changeTarget.Index);
		changeTarget.SetIndex(index);
		player.DeckCardList.Sort((BattleCardBase a, BattleCardBase b) => a.Index - b.Index);
	}

	public VfxBase Metamorphose(BattleCardBase ownerCard, List<BattleCardBase> targets, List<int> idList, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer4 = ParallelVfxPlayer.Create();
		float num = 0f;
		bool flag = false;
		List<CanNotTouchCardVfx> canNotTouchCardVfxList = new List<CanNotTouchCardVfx>();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < targets.Count; i++)
		{
			BattleCardBase originalCard = targets[i];
			int cardId = idList[i];
			BattleCardBase metamorphosedCard = originalCard.SelfBattlePlayer.CreateCard(cardId, originalCard.Index);
			metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false);
			metamorphosedCard.TransformInfo = new BattleCardBase.TransformInformation(BattleCardBase.TransformType.Metamorphose, originalCard);
			parallelVfxPlayer.Register(InstantVfx.Create(delegate
			{
				metamorphosedCard.BattleCardView.GameObject.SetActive(value: true);
				metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false);
				metamorphosedCard.BattleCardView.Collider.enabled = false;
				metamorphosedCard.SetOnDraw(draw: false);
			}));
			list.Add(metamorphosedCard);
			parallelVfxPlayer3.Register(HideDetailPanel(originalCard));
			if (originalCard.IsInHand)
			{
				SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
				if (originalCard.IsPlayer)
				{
					CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx();
					base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx);
					canNotTouchCardVfxList.Add(canNotTouchCardVfx);
				}
				ReplaceInHand(originalCard.SelfBattlePlayer, originalCard, metamorphosedCard);
				InstantVfx instantVfx = InstantVfx.Create(delegate
				{
					originalCard.SelfBattlePlayer.BattleView.HandView.ReplaceCardInView(originalCard.BattleCardView, metamorphosedCard.BattleCardView);
				});
				if (originalCard.IsPlayer)
				{
					originalCard.BattleCardView.HideCanPlayEffect();
					VfxBase vfxBase = Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard);
					ParallelVfxPlayer parallelVfxPlayer5 = ParallelVfxPlayer.Create(instantVfx, metamorphosedCard.BattleCardView.ShowHandCardInfo(), InstantVfx.Create(delegate
					{
						metamorphosedCard.BattleCardView.Transform.position = originalCard.BattleCardView.Transform.position;
						metamorphosedCard.BattleCardView.Transform.rotation = originalCard.BattleCardView.Transform.rotation;
						metamorphosedCard.BattleCardView.Transform.localScale = originalCard.BattleCardView.Transform.localScale;
						Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard);
					}));
					GameObject effectGameObject = null;
					WaitLoadEffectAndSetSeVfx loadingVfx = new WaitLoadEffectAndSetSeVfx(effectInfo.EffectPath, effectInfo.SePath, delegate(GameObject e)
					{
						effectGameObject = e;
					});
					PlayEffectAndSeVfx mainVfx = new PlayEffectAndSeVfx(() => effectGameObject, metamorphosedCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true);
					VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, mainVfx);
					parallelVfxPlayer2.Register(vfxWithLoading.LoadingVfx);
					SequentialVfxPlayer morphVfx = SequentialVfxPlayer.Create(vfxBase, vfxWithLoading.MainVfx, parallelVfxPlayer5);
					sequentialVfxPlayer.Register(Skill_metamorphose.AttachMetamorphoseCardToOriginalCardVfx(originalCard, metamorphosedCard));
					sequentialVfxPlayer.Register(WaitVfx.Create(num));
					num += 0.1f;
					sequentialVfxPlayer.Register(new MetamorphoseHandCardVfx(metamorphosedCard, morphVfx));
				}
				else
				{
					sequentialVfxPlayer.Register(SequentialVfxPlayer.Create(Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard), new MetamorphoseHandCardVfx(metamorphosedCard, NullVfx.GetInstance()), InstantVfx.Create(delegate
					{
						Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard);
					}), instantVfx));
				}
				sequentialVfxPlayer.Register(Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard));
				if (originalCard.IsPlayer)
				{
					sequentialVfxPlayer.Register(InstantVfx.Create(delegate
					{
						if (canNotTouchCardVfxList.Count > 0)
						{
							canNotTouchCardVfxList.First().End();
							canNotTouchCardVfxList.RemoveAt(0);
						}
					}));
				}
				parallelVfxPlayer4.Register(sequentialVfxPlayer);
			}
			else if (originalCard.IsInplay)
			{
				ParallelVfxPlayer parallelVfxPlayer6 = ParallelVfxPlayer.Create();
				parallelVfxPlayer6.Register(Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard));
				parallelVfxPlayer6.Register(originalCard.SkillApplyInformation.AllSkillEffectStop());
				parallelVfxPlayer6.Register(ReplaceInPlay(metamorphosedCard.SelfBattlePlayer, originalCard, metamorphosedCard));
				parallelVfxPlayer6.Register(metamorphosedCard.SetUpInplay());
				metamorphosedCard.BattleCardView.GameObject.transform.rotation = Quaternion.identity;
				VfxWithLoading vfxWithLoading2 = CreateSkillEffect(ownerCard, new BattleCardBase[1] { metamorphosedCard }, effectInfo);
				parallelVfxPlayer2.Register(vfxWithLoading2.LoadingVfx);
				parallelVfxPlayer6.Register(SequentialVfxPlayer.Create(new MetamorphoseInPlayCardVfx(originalCard, metamorphosedCard, vfxWithLoading2.MainVfx), Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard), metamorphosedCard.BattleCardView.InitializeBattleCardIcon(metamorphosedCard, metamorphosedCard.Skills)));
				originalCard.FlagCardAsDestroyedBySkill();
				parallelVfxPlayer6.Register(originalCard.RemoveFromInPlay());
				parallelVfxPlayer4.Register(parallelVfxPlayer6);
			}
			if (i == 0)
			{
				flag = !metamorphosedCard.IsPlayer && metamorphosedCard.IsInHand;
			}
		}
		parallelVfxPlayer2.Register(LoadCardResources(list));
		VfxBase vfxToRegister = parallelVfxPlayer2;
		if (!flag)
		{
			vfxToRegister = UIManager.GetInstance().CreateNowLoadingVfx(parallelVfxPlayer2);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer, parallelVfxPlayer3, parallelVfxPlayer4);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxToRegister);
		return vfxWithLoadingSequential;
	}

	public VfxWith<BattleCardBase> FusionMetamorphose(BattleCardBase originalCard, int metamorphoseCardId)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer2 = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer3 = ParallelVfxPlayer.Create();
		ParallelVfxPlayer parallelVfxPlayer4 = ParallelVfxPlayer.Create();
		float num = 0f;
		List<CanNotTouchCardVfx> canNotTouchCardVfxList = new List<CanNotTouchCardVfx>();
		BattleCardBase metamorphosedCard = originalCard.SelfBattlePlayer.CreateCard(metamorphoseCardId, originalCard.Index);
		metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false);
		metamorphosedCard.TransformInfo = new BattleCardBase.TransformInformation(BattleCardBase.TransformType.Metamorphose, originalCard);
		parallelVfxPlayer.Register(InstantVfx.Create(delegate
		{
			metamorphosedCard.BattleCardView.GameObject.SetActive(value: true);
			metamorphosedCard.BattleCardView.CardWrapObject.SetActive(value: false);
			metamorphosedCard.BattleCardView.Collider.enabled = false;
			metamorphosedCard.SetOnDraw(draw: false);
		}));
		parallelVfxPlayer2.Register(LoadCardResources(new List<BattleCardBase> { metamorphosedCard }));
		parallelVfxPlayer3.Register(HideDetailPanel(originalCard));
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		if (originalCard.IsPlayer)
		{
			CanNotTouchCardVfx canNotTouchCardVfx = new CanNotTouchCardVfx();
			base.VfxMgr.RegisterImmediateVfx(canNotTouchCardVfx);
			canNotTouchCardVfxList.Add(canNotTouchCardVfx);
		}
		ReplaceInHand(originalCard.SelfBattlePlayer, originalCard, metamorphosedCard);
		InstantVfx instantVfx = InstantVfx.Create(delegate
		{
			originalCard.SelfBattlePlayer.BattleView.HandView.ReplaceCardInView(originalCard.BattleCardView, metamorphosedCard.BattleCardView);
			MotionUtils.SetLayerAll(metamorphosedCard.BattleCardView.GameObject, 31);
		});
		originalCard.BattleCardView.HideCanPlayEffect();
		VfxBase vfxBase = Skill_metamorphose.SetupMetamorphosedCardTransformVfx(originalCard, metamorphosedCard);
		ParallelVfxPlayer parallelVfxPlayer5 = ParallelVfxPlayer.Create(instantVfx, InstantVfx.Create(delegate
		{
			metamorphosedCard.BattleCardView.Transform.position = originalCard.BattleCardView.Transform.position;
			metamorphosedCard.BattleCardView.Transform.rotation = originalCard.BattleCardView.Transform.rotation;
			metamorphosedCard.BattleCardView.Transform.localScale = originalCard.BattleCardView.Transform.localScale;
			Skill_metamorphose.SwapMetamorphosedCardMesh(originalCard, metamorphosedCard);
		}));
		GameObject effectGameObject = null;
		WaitLoadEffectAndSetSeVfx loadingVfx = new WaitLoadEffectAndSetSeVfx("cmn_card_fusionmetamorphose_2", "se_cmn_card_fusionmetamorphose_2", delegate(GameObject e)
		{
			effectGameObject = e;
		});
		PlayEffectAndSeVfx playEffectAndSeVfx = new PlayEffectAndSeVfx(() => effectGameObject, metamorphosedCard.BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true);
		VfxWithLoading vfxWithLoading = VfxWithLoading.Create(loadingVfx, playEffectAndSeVfx);
		parallelVfxPlayer2.Register(vfxWithLoading.LoadingVfx);
		SequentialVfxPlayer morphVfx = SequentialVfxPlayer.Create(vfxBase, vfxWithLoading.MainVfx, InstantVfx.Create(delegate
		{
			MotionUtils.SetLayerAll(playEffectAndSeVfx.GetLoadedGameObject(), 31);
		}), WaitVfx.Create(0.5f), parallelVfxPlayer5);
		sequentialVfxPlayer.Register(Skill_metamorphose.AttachMetamorphoseCardToOriginalCardVfx(originalCard, metamorphosedCard));
		sequentialVfxPlayer.Register(WaitVfx.Create(num));
		num += 0.1f;
		sequentialVfxPlayer.Register(new MetamorphoseHandCardVfx(metamorphosedCard, morphVfx));
		sequentialVfxPlayer.Register(Skill_metamorphose.EnableMetamorphosedCardColliderVfx(metamorphosedCard));
		if (originalCard.IsPlayer)
		{
			sequentialVfxPlayer.Register(InstantVfx.Create(delegate
			{
				if (canNotTouchCardVfxList.Count > 0)
				{
					canNotTouchCardVfxList.First().End();
					canNotTouchCardVfxList.RemoveAt(0);
				}
			}));
		}
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			originalCard.SelfBattlePlayer.BattleView.PlayQueueView.ReplaceCard(metamorphosedCard.BattleCardView, originalCard.BattleCardView);
		}));
		parallelVfxPlayer4.Register(sequentialVfxPlayer);
		VfxBase vfxBase2 = parallelVfxPlayer2;
		vfxBase2 = UIManager.GetInstance().CreateNowLoadingVfx(parallelVfxPlayer2);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(parallelVfxPlayer, parallelVfxPlayer3, parallelVfxPlayer4);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxBase2);
		return new VfxWith<BattleCardBase>(vfxWithLoadingSequential, metamorphosedCard);
	}

	public VfxBase Geton(BattleCardBase card, List<BattleCardBase> targets, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targets.Count; i++)
		{
			targets[i].DeathTypeInfo.LeaveByGetOn = true;
			targets[i].FlagCardAsDestroyedBySkill();
			SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
			sequentialVfxPlayer.Register(targets[i].SkillApplyInformation.AllSkillEffectStop());
			sequentialVfxPlayer.Register(CardToVehicleZone(card.SelfBattlePlayer, targets[i]));
			sequentialVfxPlayer.Register(HideDetailPanel(card));
			sequentialVfxPlayer.Register(targets[i].VfxCreator.CreateGeton(card.BattleCardView.Transform, card.BattleCardView, card.DeathTypeInfo, card.SelfBattlePlayer));
			parallelVfxPlayer.Register(sequentialVfxPlayer);
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(card, targets, effectInfo));
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxBase Getoff(BattlePlayerBase player, BattleCardBase ownerCard, List<NetworkBattleReceiver.CardInfo> cardInfoList, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			if (!cardInfoList[i].IsOverflow)
			{
				BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, cardInfoList[i].Id, cardInfoList[i].Index);
				UpdateSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
				player.ClassAndInPlayCardList.Add(battleCardBase);
				summonedCardsList.AddCardToSummonedCards(battleCardBase);
				list.Add(battleCardBase);
			}
			else
			{
				BattleCardBase battleCardBase2 = player.CreateCard(cardInfoList[i].Id, cardInfoList[i].Index);
				UpdateSkillDescriptionValueList(battleCardBase2, cardInfoList[i]);
				summonedCardsList.AddCardToOverflowCards(battleCardBase2);
				list.Add(battleCardBase2);
			}
		}
		vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(list));
		if (effectInfo != null)
		{
			VfxWithLoading vfxWithLoadingToRegister = (effectInfo.IsTargetPosition ? CreateOwnerSummonSkillEffect(ownerCard, summonedCardsList, effectInfo) : CreateSkillEffect(ownerCard, summonedCardsList, effectInfo));
			vfxWithLoadingSequential.RegisterVfxWithLoading(vfxWithLoadingToRegister);
		}
		vfxWithLoadingSequential.RegisterToMainVfx(new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true, isIgnoreVoice: false, isRandomVoice: false, isGetoff: true));
		return vfxWithLoadingSequential;
	}

	public VfxBase Unite(BattlePlayerBase player, BattleCardBase card, List<BattleCardBase> targetCards, int uniteCardId, int uniteCardIndex, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			targetCards[i].DeathTypeInfo.BanishDestroy = true;
			targetCards[i].FlagCardAsDestroyedBySkill();
			SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
			sequentialVfxPlayer.Register(CreateBanish(targetCards[i]));
			sequentialVfxPlayer.Register(CardToUniteZone(targetCards[i]));
			parallelVfxPlayer.Register(sequentialVfxPlayer);
		}
		SkillBaseSummon.SummonedCardsList summonedCardsList = new SkillBaseSummon.SummonedCardsList();
		BattleCardBase battleCardBase = CreateCardAndSetCardTotalNum(player, uniteCardId, uniteCardIndex);
		player.ClassAndInPlayCardList.Add(battleCardBase);
		summonedCardsList.AddCardToSummonedCards(battleCardBase);
		VfxWithLoading vfxWithLoading = CreateSkillEffect(card, targetCards, effectInfo);
		StartPickMultiCardVfx startPickMultiCardVfx = new StartPickMultiCardVfx(summonedCardsList, base.BattleResourceMgr, player.IsPlayer, isToken: true);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(vfxWithLoading.MainVfx, parallelVfxPlayer, startPickMultiCardVfx);
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		vfxWithLoadingSequential.RegisterToLoadingVfx(LoadCardResources(new List<BattleCardBase> { battleCardBase }));
		return vfxWithLoadingSequential;
	}

	public VfxBase ShowSkillEffect(BattleCardBase card, List<BattleCardBase> targets, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(card, targets, effectInfo));
		return vfxWithLoadingSequential;
	}

	private VfxWithLoading CreateSkillEffect(BattleCardBase ownerCard, IEnumerable<BattleCardBase> targetCards, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		if (effectInfo == null || effectInfo.EffectPath == string.Empty)
		{
			return NullVfxWithLoading.GetInstance();
		}
		Func<Vector3> func = () => (!ownerCard.IsSpell && !effectInfo.IsWhenFusioned) ? ownerCard.BattleCardView.CardWrapObject.transform.position : ownerCard.SelfBattlePlayer.Class.BattleCardView.GameObject.transform.position;
		switch (effectInfo.EffectTargetType)
		{
		case EffectMgr.TargetType.NONE:
			return NullVfxWithLoading.GetInstance();
		case EffectMgr.TargetType.NONE_WAIT:
			return VfxWithLoading.Create(WaitVfx.Create(effectInfo.EffectTime));
		case EffectMgr.TargetType.SINGLE:
			if (effectInfo.IsFollowInHand)
			{
				return SkillBase.CreateSingleFollowInHandVfx(targetCards, effectInfo.EffectPath, effectInfo.SePath);
			}
			return SkillBase.CreateSingleVfx(base.BattleResourceMgr, func, targetCards, ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime);
		case EffectMgr.TargetType.AREA_SELF:
			return SkillBase.CreateAreaVfx(base.BattleResourceMgr, func, ownerCard.SelfBattlePlayer.GetFieldCenterPosition(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime);
		case EffectMgr.TargetType.AREA_OPPONENT:
			return SkillBase.CreateAreaVfx(base.BattleResourceMgr, func, ownerCard.OpponentBattlePlayer.GetFieldCenterPosition(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime);
		case EffectMgr.TargetType.AREA_ALL:
			return SkillBase.CreateAreaVfx(base.BattleResourceMgr, func, Vector3.zero, ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime);
		case EffectMgr.TargetType.SINGLE_ONLY_OPPONENT:
			return SkillBase.CreateSingleVfx(base.BattleResourceMgr, func, targetCards.Where((BattleCardBase s) => s.IsPlayer != ownerCard.IsPlayer).ToList(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime);
		default:
			return NullVfxWithLoading.GetInstance();
		}
	}

	public VfxWithLoading CreateOwnerSummonSkillEffect(BattleCardBase ownerCard, SkillBaseSummon.SummonedCardsList summonedCardsList, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		for (int i = 0; i < summonedCardsList.cardEffectPairList.Count(); i++)
		{
			SkillBaseSummon.SummonedCardsList.CardEffectPair cardEffectPair = summonedCardsList.cardEffectPairList.ElementAt(i);
			BattleCardBase target = cardEffectPair.card;
			VfxWithLoading vfxWithLoading = SkillBase.CreateSingleVfx(base.BattleResourceMgr, () => target.BattleCardView.CardWrapObject.transform.position, target.AsIEnumerable(), ownerCard.IsPlayer, ownerCard.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime);
			cardEffectPair.summonEffect = vfxWithLoading.MainVfx;
			vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		}
		return vfxWithLoadingSequential;
	}

	public VfxBase CreateWhenPlayEffect(SkillCollectionBase.WhenPlayEffectType whenPlayEffectType, IBattleCardView battleCardView, bool isInvoked)
	{
		return whenPlayEffectType switch
		{
			SkillCollectionBase.WhenPlayEffectType.Berserk => new BerserkSkillActivationVfx(battleCardView), 
			SkillCollectionBase.WhenPlayEffectType.Awake => new AwakeSkillActivationVfx(battleCardView), 
			SkillCollectionBase.WhenPlayEffectType.WhenPlay => new WhenPlaySkillActivationVfx(battleCardView), 
			SkillCollectionBase.WhenPlayEffectType.WhenDestroy => new LoadAndPlayEffectVfx("cmn_card_destroy_3", "se_cmn_card_destroy_3", battleCardView.Transform, 0f), 
			_ => NullVfxWithLoading.GetInstance(), 
		};
	}

	public VfxBase ShowSkillInductionEffect(BattleCardBase card, string skillVoice, bool isIgnoreVoice, NetworkBattleReceiver.CardInfo cardInfo)
	{
		IBattleCardView battleCardView = card.BattleCardView;
		string text = battleCardView.VoiceInfo.VoiceId;
		VfxBase vfxBase = NullVfx.GetInstance();
		if (!ReadOnlyVoiceInfo.IsInvalidFileName(skillVoice) && !isIgnoreVoice)
		{
			if (string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(skillVoice) && skillVoice != "NONE".ToLower())
			{
				text = skillVoice.Split(new string[1] { "_" }, StringSplitOptions.None)[0];
			}
			vfxBase = VfxWithLoading.Create(new WaitLoadVoiceResourceVfx(battleCardView, text), new PlayCRISoundVfx(battleCardView, skillVoice));
		}
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create(vfxBase);
		if (cardInfo != null)
		{
			parallelVfxPlayer.Register(card.BattleCardView.BattleCardIconAnimations.UpdateSkillIconInReplay(cardInfo.InplaySkillEffectList, cardInfo.InductionNumber, isInitialize: true));
		}
		parallelVfxPlayer.Register(new ReactiveSkillActivationVfx(card));
		return parallelVfxPlayer;
	}

	public VfxBase ShowIndependentEffect(List<BattleCardBase> cards)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		for (int i = 0; i < cards.Count; i++)
		{
			sequentialVfxPlayer.Register(new OneShotHeavenlyAegisPlayVfx(cards[i].BattleCardView));
		}
		return sequentialVfxPlayer;
	}

	public VfxBase ShowChangeAffiliation(BattleCardBase card, List<BattleCardBase> targets, CardBasePrm.ClanType clan, CardBasePrm.TribeInfo tribe, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(card, targets.Where((BattleCardBase s) => s.IsPlayer || s.IsInplay), effectInfo));
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int num = 0; num < targets.Count; num++)
		{
			targets[num].SkillApplyInformation.GiveChangeAffiliation(clan, tribe, showEffect: true);
			parallelVfxPlayer.Register(new ChangeAffiliationVfx(targets[num], clan));
		}
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		return vfxWithLoadingSequential;
	}

	public VfxBase ShowChangeUnionBurstAndSkyboundArtEffect(List<BattleCardBase> targets)
	{
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		for (int i = 0; i < targets.Count; i++)
		{
			GameObject effectGameObject = null;
			vfxWithLoadingSequential.RegisterToLoadingVfx(new WaitLoadEffectAndSetSeVfx("stt_act_costdown_1", "se_stt_act_costdown_1", delegate(GameObject e)
			{
				effectGameObject = e;
			}));
			vfxWithLoadingSequential.RegisterToMainVfx(new PlayEffectAndSeVfx(() => effectGameObject, targets[i].BattleCardView.Transform, isFollow: false, isFollowPosition: false, isFollowAll: true));
		}
		return vfxWithLoadingSequential;
	}

	public VfxBase ShowRepeatSkillEffect(bool isSelf)
	{
		return new RepeatSkillEffectVfx(isSelf ? BattlePlayer.Class.BattleCardView : BattleEnemy.Class.BattleCardView, "when_destroy", isSelf);
	}

	public VfxBase GiveCantActivateFanfare(BattleCardBase ownerCard, List<BattleCardBase> targetCards, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			parallelVfxPlayer.Register(targetCards.ElementAt(i).SkillApplyInformation.GiveCantActivateFanfare("all"));
		}
		VfxWithLoading vfxWithLoading = CreateSkillEffect(ownerCard, targetCards, effectInfo);
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create(vfxWithLoading.MainVfx, parallelVfxPlayer, BattlePlayer.UpdateHandCardsCost(), BattleEnemy.UpdateHandCardsCost());
		vfxWithLoadingSequential.RegisterToLoadingVfx(vfxWithLoading.LoadingVfx);
		return vfxWithLoadingSequential;
	}

	public VfxBase DepriveCantActivateFanfare(BattleCardBase ownerCard, List<BattleCardBase> targetCards)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			parallelVfxPlayer.Register(targetCards.ElementAt(i).SkillApplyInformation.DepriveCantActivateFanfare("all"));
		}
		parallelVfxPlayer.Register(ownerCard.SelfBattlePlayer.UpdateHandCardsCost());
		parallelVfxPlayer.Register(ownerCard.OpponentBattlePlayer.UpdateHandCardsCost());
		return VfxWithLoading.Create(parallelVfxPlayer);
	}

	public VfxBase LoseSkill(BattleCardBase ownerCard, List<BattleCardBase> targetCards, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < targetCards.Count; i++)
		{
			parallelVfxPlayer.Register(targetCards[i].SkillApplyInformation.AllSkillEffectStop());
			targetCards.ElementAt(i).SkillApplyInformation.InitializeInformationWithoutLifeOffenseModifier();
		}
		VfxWithLoadingSequential vfxWithLoadingSequential = VfxWithLoadingSequential.Create();
		vfxWithLoadingSequential.RegisterToMainVfx(parallelVfxPlayer);
		vfxWithLoadingSequential.RegisterVfxWithLoading(CreateSkillEffect(ownerCard, targetCards, effectInfo));
		return vfxWithLoadingSequential;
	}

	public VfxBase ShowHandEffect()
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		parallelVfxPlayer.Register(UpdateHandEffect(BattlePlayer.HandCardList, _lastCardInfoList));
		parallelVfxPlayer.Register(InstantVfx.Create(delegate
		{
			BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
		}));
		return parallelVfxPlayer;
	}

	public VfxBase UpdateHandInfo(List<BattleCardBase> playerCards, List<BattleCardBase> enemyCards, List<NetworkBattleReceiver.CardInfo> cardInfoList, List<BattleCardBase> playerAllCards, List<BattleCardBase> enemyAllCards, bool isImmediate = false)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			bool isSelf = cardInfoList[i].IsSelf;
			BattleCardBase battleCardIdx = GetBattleCardIdx(isSelf ? playerCards : enemyCards, cardInfoList[i].Index);
			if (battleCardIdx != null)
			{
				UpdateSkillDescriptionValueList(battleCardIdx, cardInfoList[i]);
				UpdateUnionBurstAndSkyboundArtModifier(battleCardIdx, cardInfoList[i]);
				if (isSelf && !cardInfoList[i].IsSameBuff)
				{
					UpdateBuffInfo(battleCardIdx, cardInfoList[i], playerAllCards, enemyAllCards);
				}
			}
		}
		if (isImmediate)
		{
			base.VfxMgr.RegisterImmediateVfx(UpdateHandEffect(playerCards, cardInfoList.Where((NetworkBattleReceiver.CardInfo c) => c.IsSelf).ToList()));
		}
		parallelVfxPlayer.Register(UpdateHandEffect(playerCards, cardInfoList.Where((NetworkBattleReceiver.CardInfo c) => c.IsSelf).ToList()));
		return parallelVfxPlayer;
	}

	public VfxBase UpdateHandEffect(List<BattleCardBase> playerCards, List<NetworkBattleReceiver.CardInfo> cardInfoList, bool forceHide = false)
	{
		_lastCardInfoList = cardInfoList;
		if (cardInfoList == null)
		{
			return NullVfx.GetInstance();
		}
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase card = GetBattleCardIdx(playerCards, cardInfoList[i].Index);
			if (card == null)
			{
				continue;
			}
			HandCardFrameEffectType handCardFrameEffectType = cardInfoList[i].HandCardFrameEffectType;
			bool isActive = cardInfoList[i].IsHandEffectActive;
			parallelVfxPlayer.Register(InstantVfx.Create(delegate
			{
				if (isActive && !forceHide)
				{
					(card.BattleCardView as BattleCardView).HandFrameEffect.Show(card.BattleCardView.CardTemplate.FrameEffectHandCard, handCardFrameEffectType);
				}
				else
				{
					card.BattleCardView.HideCanPlayEffect();
				}
			}));
		}
		return parallelVfxPlayer;
	}

	public VfxBase UpdateChoiceBraveButtonEffet(bool canChoiceBrave, bool isImmediate)
	{
		if (BattlePlayer is ReplayBattlePlayer replayBattlePlayer)
		{
			replayBattlePlayer.CanChoiceBraveOnRecord = canChoiceBrave;
		}
		InstantVfx instantVfx = InstantVfx.Create(delegate
		{
			BattlePlayer.BattleView.UpdateChoiceBraveButtonPulsateEffectAndSprite();
		});
		if (isImmediate)
		{
			base.VfxMgr.RegisterImmediateVfx(instantVfx);
		}
		return instantVfx;
	}

	public VfxBase UpdateAttackableEffect(List<BattleCardBase> playerCards, List<BattleCardBase> enemyCards, List<NetworkBattleReceiver.CardInfo> cardInfoList, bool isSelfTurn, bool useRecordAttackEffect = false)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase card = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index);
			if (card is ClassBattleCardBase)
			{
				continue;
			}
			NetworkBattleReceiver.CardInfo cardInfo = cardInfoList[i];
			card.AttackableOnReplay = cardInfo.Attackable;
			card.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass;
			card.AttackableCount = cardInfo.AttackableCount;
			parallelVfxPlayer.Register(InstantVfx.Create(delegate
			{
				if (useRecordAttackEffect)
				{
					card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(() => cardInfo.IsCantAttackClass, cardInfo.IsSelf == isSelfTurn);
				}
				else
				{
					card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(null, cardInfo.IsSelf == isSelfTurn);
				}
			}));
		}
		return parallelVfxPlayer;
	}

	public VfxBase UpdateInplayInfo(List<BattleCardBase> playerCards, List<BattleCardBase> enemyCards, List<NetworkBattleReceiver.CardInfo> cardInfoList, List<BattleCardBase> playerAllCards, List<BattleCardBase> enemyAllCards, bool isSelfTurn, bool isInitialize, bool onlyEffect = false, bool onlyAttackEffect = false, bool updateAttackEffect = true, bool useRecordAttackEffect = false)
	{
		ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase card = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index);
			if (card == null)
			{
				continue;
			}
			if (!(card is ClassBattleCardBase) && updateAttackEffect)
			{
				NetworkBattleReceiver.CardInfo cardInfo = cardInfoList[i];
				card.AttackableOnReplay = cardInfo.Attackable;
				card.IsCantAttackClassOnReplay = cardInfo.IsCantAttackClass;
				card.AttackableCount = cardInfo.AttackableCount;
				parallelVfxPlayer.Register(InstantVfx.Create(delegate
				{
					if (cardInfo.ForceHideAttackEffect)
					{
						card.BattleCardView._inPlayFrameEffect.HideFrameEffect();
					}
					else if (useRecordAttackEffect)
					{
						card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(() => cardInfo.IsCantAttackClass, cardInfo.IsSelf == isSelfTurn);
					}
					else
					{
						card.BattleCardView._inPlayFrameEffect.UpdateCanAttackEffect(null, cardInfo.IsSelf == isSelfTurn);
					}
				}));
			}
			parallelVfxPlayer.Register(card.SkillApplyInformation.UpdateAllSkillEffectInReplay(cardInfoList[i].InplaySkillEffectList, cardInfoList[i].InductionNumber, isInitialize, onlyAttackEffect));
			if (!onlyEffect)
			{
				UpdateSkillDescriptionValueList(card, cardInfoList[i]);
				if (!cardInfoList[i].IsSameBuff)
				{
					UpdateBuffInfo(card, cardInfoList[i], playerAllCards, enemyAllCards);
				}
			}
		}
		return parallelVfxPlayer;
	}

	public VfxBase UpdateDeckOrReservedInfo(List<BattleCardBase> playerCards, List<BattleCardBase> enemyCards, List<NetworkBattleReceiver.CardInfo> cardInfoList)
	{
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase battleCardIdx = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index);
			UpdateSkillDescriptionValueList(battleCardIdx, cardInfoList[i]);
		}
		return NullVfx.GetInstance();
	}

	public void UpdateBuffInfo(BattleCardBase updateCard, NetworkBattleReceiver.CardInfo cardInfo, List<BattleCardBase> playerAllCards, List<BattleCardBase> enemyAllCards)
	{
		List<BuffInfo> list = CreateBuffInfoList(cardInfo, playerAllCards, enemyAllCards);
		List<BattleCardBase> list2 = new List<BattleCardBase>();
		for (int i = 0; i < cardInfo.NoConsumeEpBuffInfoNameList.Count; i++)
		{
			List<BattleCardBase> source = ((cardInfo.NoConsumeEpBuffInfoNameList[i].Substring(0, 1) == "p") ? playerAllCards : enemyAllCards);
			BattleCardBase battleCardIdx = GetBattleCardIdx(source.ToList(), int.Parse(cardInfo.NoConsumeEpBuffInfoNameList[i].Substring(1)));
			list2.Add(battleCardIdx);
		}
		updateCard.ReplayBuffInfoList = list;
		updateCard.ReplayNoConsumeEpBuffInfoNameList = list2;
		updateCard.ReplayBuffInfoLabelList = cardInfo.BuffInfoLabelList;
		IDetailPanelControl detailPanelControl = DetailMgr.DetailPanelControl;
		if (detailPanelControl.IsShow && detailPanelControl._card != null && detailPanelControl._card.IsClass && updateCard.IsClass && detailPanelControl._card.IsPlayer == updateCard.IsPlayer)
		{
			List<BattlePlayerBase.MyRotationBonusCondition> bonusConditionList = updateCard.SelfBattlePlayer.BonusConditionList;
			detailPanelControl.UpdateBuffInfo(updateCard, bonusConditionList);
		}
		else
		{
			if (!detailPanelControl.IsShow || detailPanelControl._card != updateCard || !list.Any((BuffInfo b) => b.IsCopied))
			{
				return;
			}
			detailPanelControl.UpdateLogItemBuffInfo(updateCard);
			if (DetailMgr.SubDetailPanelControl.IsShow)
			{
				BuffInfo buffInfo = list.FirstOrDefault((BuffInfo b) => b.IsCopied && DetailMgr.SubDetailPanelControl._card == b.PreviousOwner);
				if (buffInfo != null)
				{
					DetailMgr.SubDetailPanelControl.SetBuff(buffInfo);
					detailPanelControl.UpdateCardDescriptionOnEvent();
				}
			}
		}
	}

	public void UpdateAttachedCardInfo(List<BattleCardBase> playerCards, List<BattleCardBase> enemyCards, List<NetworkBattleReceiver.CardInfo> cardInfoList)
	{
		for (int i = 0; i < cardInfoList.Count; i++)
		{
			BattleCardBase battleCardBase = GetBattleCardIdx(cardInfoList[i].IsSelf ? playerCards : enemyCards, cardInfoList[i].Index);
			for (int j = 0; j < cardInfoList[i].MetamorphoseCount; j++)
			{
				if (battleCardBase.TransformInfo.OriginalCard == null)
				{
					break;
				}
				battleCardBase = battleCardBase.TransformInfo.OriginalCard;
			}
			if (battleCardBase.BaseParameter.BaseCardId != cardInfoList[i].Id && battleCardBase.ReplayBuffInfoCard != null && battleCardBase.ReplayBuffInfoCard.BaseParameter.BaseCardId == cardInfoList[i].Id)
			{
				battleCardBase = battleCardBase.ReplayBuffInfoCard;
			}
			UpdateBuffDetailSkillDescriptionValueList(battleCardBase, cardInfoList[i]);
		}
	}

	public void UpdateFusionCardInfo(NetworkBattleReceiver.CardInfo cardInfo, List<BattleCardBase> fusionIngredientList = null)
	{
		bool isSelf = cardInfo.IsSelf;
		BattleCardBase battleCardIdx = GetBattleCardIdx(isSelf ? BattleLogManager.GetInstance().PlayerFusionCard : BattleLogManager.GetInstance().EnemyFusionCard, cardInfo.Index);
		if (battleCardIdx != null)
		{
			UpdateSkillDescriptionValueList(battleCardIdx, cardInfo);
			if (fusionIngredientList != null)
			{
				UpdateFusionIngredients(battleCardIdx, cardInfo, fusionIngredientList);
			}
		}
	}

	public void UpdateStatusPanel(NetworkBattleReceiver.StatusPanelInfo playerPanelInfo, NetworkBattleReceiver.StatusPanelInfo enemyPanelInfo)
	{
		UpdatePlayerStatusPanel(BattlePlayer, playerPanelInfo);
		UpdatePlayerStatusPanel(BattleEnemy, enemyPanelInfo);
	}

	private void UpdatePlayerStatusPanel(BattlePlayerBase player, NetworkBattleReceiver.StatusPanelInfo panelInfo)
	{
		if (panelInfo.IsDrew)
		{
			base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate
			{
				player.UpdateStatusPanel(panelInfo.HandCount, panelInfo.CemetaryCount, panelInfo.DeckCount);
			}));
			return;
		}
		base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate
		{
			player.StatusPanelControl.SetHandCount(panelInfo.HandCount);
			player.StatusPanelControl.SetGrave(panelInfo.CemetaryCount);
		}));
		base.VfxMgr.RegisterSequentialVfx(InstantVfx.Create(delegate
		{
			player.StatusPanelControl.SetDeck(panelInfo.DeckCount);
		}));
	}

	private List<BuffInfo> CreateBuffInfoList(NetworkBattleReceiver.CardInfo cardInfo, List<BattleCardBase> playerAllCards, List<BattleCardBase> enemyAllCards)
	{
		List<BuffInfo> list = new List<BuffInfo>();
		for (int i = 0; i < cardInfo.BuffInfoList.Count; i++)
		{
			NetworkBattleReceiver.ReplayBuffInfo replayBuffInfo = cardInfo.BuffInfoList[i];
			bool num = replayBuffInfo.BuffType == NetworkBattleReceiver.ReplayBuffType.Copied;
			NetworkBattleReceiver.BuffCardInfo ownerCardInfo = replayBuffInfo.OwnerCardInfo;
			BattleCardBase buffOwnerCard = GetBuffOwnerCard(ownerCardInfo, playerAllCards, enemyAllCards);
			NetworkBattleReceiver.BuffCardInfo previousOwnerCardInfo = replayBuffInfo.PreviousOwnerCardInfo;
			BuffInfo buffInfo;
			if (previousOwnerCardInfo != null)
			{
				BattleCardBase buffOwnerCard2 = GetBuffOwnerCard(previousOwnerCardInfo, playerAllCards, enemyAllCards);
				buffInfo = new BuffInfo(ownerCardInfo.CardId, replayBuffInfo.CardIdFrom, null, buffOwnerCard, replayBuffInfo.IsPlayer, replayBuffInfo.DivergenceIdList);
				buffInfo.SetPreviousOwner(buffOwnerCard2);
			}
			else
			{
				buffInfo = new BuffInfo(ownerCardInfo.CardId, replayBuffInfo.CardIdFrom, null, buffOwnerCard, replayBuffInfo.IsPlayer, replayBuffInfo.DivergenceIdList);
			}
			if (num)
			{
				buffInfo.IsCopiedEvolutionSkill = replayBuffInfo.IsEvolutionSkill;
			}
			else
			{
				buffInfo.IsEvolutionSkill = replayBuffInfo.IsEvolutionSkill;
			}
			switch (replayBuffInfo.BuffType)
			{
			case NetworkBattleReceiver.ReplayBuffType.Copied:
				buffInfo.IsCopied = true;
				buffInfo.CopiedSkillDescriptionValueList = replayBuffInfo.CopiedSkillDescriptionValueList;
				buffInfo.CopiedEvoSkillDescriptionValueList = replayBuffInfo.CopiedEvoSkillDescriptionValueList;
				break;
			case NetworkBattleReceiver.ReplayBuffType.SaveBurialRite:
				buffInfo.IsSaveBurialRiteSkill = true;
				buffInfo.TargetCard = buffOwnerCard;
				break;
			case NetworkBattleReceiver.ReplayBuffType.Geton:
				buffInfo.IsGetonSkill = true;
				buffInfo.TargetCard = buffOwnerCard;
				break;
			case NetworkBattleReceiver.ReplayBuffType.IsReserveTokenDrawSkill:
				buffInfo.IsReserveTokenDrawSkill = true;
				buffInfo.TargetCard = buffOwnerCard;
				break;
			case NetworkBattleReceiver.ReplayBuffType.IsHiddenClassLogSkill:
				buffInfo.IsHiddenClassLogSkill = true;
				break;
			}
			list.Add(buffInfo);
		}
		return list;
	}

	public BattleCardBase GetBuffOwnerCard(NetworkBattleReceiver.BuffCardInfo buffCardInfo, List<BattleCardBase> playerAllCards, List<BattleCardBase> enemyAllCards)
	{
		List<BattleCardBase> source = ((buffCardInfo.CardName.Substring(0, 1) == "p") ? playerAllCards : enemyAllCards);
		BattleCardBase battleCardBase = GetBattleCardIdx(source.ToList(), int.Parse(buffCardInfo.CardName.Substring(1)));
		for (int i = 0; i < buffCardInfo.MetamorphoseCount; i++)
		{
			if (battleCardBase.TransformInfo.OriginalCard == null)
			{
				break;
			}
			battleCardBase = battleCardBase.TransformInfo.OriginalCard;
		}
		if (battleCardBase.ReplayBuffInfoCard != null && battleCardBase.ReplayBuffInfoCard.CardId == buffCardInfo.CardId)
		{
			battleCardBase = battleCardBase.ReplayBuffInfoCard;
		}
		if (buffCardInfo.CardId != 0 && battleCardBase.BaseParameter.NormalCardId != buffCardInfo.CardId && battleCardBase.BaseParameter.BaseCardId != buffCardInfo.CardId)
		{
			CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(buffCardInfo.CardId);
			BattleCardBase battleCardBase2 = (battleCardBase.ReplayBuffInfoCard = CreateBattleCard(buffCardInfo.CardId, battleCardBase.IsPlayer, null, cardParameterFromId, battleCardBase.SelfBattlePlayer, -1));
			battleCardBase = battleCardBase2;
		}
		return battleCardBase;
	}

	public VfxBase UpdateBattleLog(List<BattleCardBase> playerCards, List<BattleCardBase> enemyCards, int battleLogIndex, List<BattleLogTextureInfo> battleLogTextureInfoList)
	{
		if (_battleLogInfoList.Count == 0)
		{
			return NullVfx.GetInstance();
		}
		if (battleLogIndex < _lastBattleLogIndex)
		{
			OperateMgr.BattleLogManager.RemoveAllBattleLogSet();
			_lastBattleLogIndex = 0;
		}
		for (int i = _lastBattleLogIndex; i < battleLogIndex; i++)
		{
			BattleLogInfo battleLogInfo = _battleLogInfoList[i];
			bool flag = battleLogInfo.IndexName.Substring(0, 1) == "p";
			BattleCardBase card = (CardMaster.IsChoiceBraveCardCheck(battleLogInfo.CardId) ? GetBattlePlayer(flag).ChoiceBraveCardList.First((BattleCardBase c) => c.CardId == battleLogInfo.CardId) : GetBattleCardIdx(flag ? playerCards : enemyCards, int.Parse(battleLogInfo.IndexName.Substring(1))));
			if (card.CardId != battleLogInfo.CardId)
			{
				CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(battleLogInfo.CardId);
				card = CreateBattleCard(battleLogInfo.CardId, card.IsPlayer, null, cardParameterFromId, card.SelfBattlePlayer, -1);
			}
			BattleLogItem battleLogItem = null;
			switch (battleLogInfo.ItemType)
			{
			case BattleLogItemType.Inner:
				battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item)
				{
					item.SetInnerInReplay(battleLogInfo.Type, battleLogInfo.RightValueText, battleLogInfo.IsNecromance, battleLogInfo.MulliganChangedCount);
				}, battleLogInfo.TextureOption, battleLogTextureInfoList);
				break;
			case BattleLogItemType.Turn:
				battleLogItem = OperateMgr.BattleLogManager.AddLogTurn(battleLogInfo.IsSelf, battleLogInfo.Turn);
				break;
			case BattleLogItemType.SkillTiming:
				battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item)
				{
					item.SetInnerOnSkillTimingInReplay(battleLogInfo.Type, battleLogInfo.IsNecromance);
				}, battleLogInfo.TextureOption, battleLogTextureInfoList);
				break;
			case BattleLogItemType.Damage:
				battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item)
				{
					item.SetInnerOnDamageInReplay(battleLogInfo.Type, card, battleLogInfo.RightValueText, battleLogInfo.IsDead);
				}, battleLogInfo.TextureOption, battleLogTextureInfoList);
				break;
			case BattleLogItemType.Heal:
				battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item)
				{
					item.SetInnerOnHealInReplay(battleLogInfo.Type, battleLogInfo.RightValueText);
				}, battleLogInfo.TextureOption, battleLogTextureInfoList);
				break;
			case BattleLogItemType.SkillTarget:
			{
				string logText = null;
				if (battleLogInfo.CardWithCount != -1)
				{
					logText = BattleLogUtility.GetCardWithCountText(card, battleLogInfo.CardWithCount);
				}
				else if (battleLogInfo.RandomArray != null)
				{
					logText = BattleLogUtility.BuildTextRandomArray(battleLogInfo.RandomArray);
				}
				battleLogItem = OperateMgr.BattleLogManager.AddLogCommonOneAndSetInner(card, delegate(BattleLogItem item)
				{
					item.SetInnerOnSkillTargetInReplay(battleLogInfo.Type, battleLogInfo.IsMinus, logText, battleLogInfo.RightValueText, battleLogInfo.IsDead);
				}, battleLogInfo.TextureOption, battleLogTextureInfoList);
				break;
			}
			}
			if (battleLogItem != null)
			{
				battleLogItem.SetupOnReplay(battleLogInfo.IsPlayerSideTurn, battleLogInfo.Turn);
			}
		}
		_lastBattleLogIndex = battleLogIndex;
		OperateMgr.BattleLogManager.ParentLogItemToGrid();
		List<string> list = new List<string>();
		Action action = delegate
		{
		};
		for (int num = 0; num < battleLogTextureInfoList.Count; num++)
		{
			BattleLogTextureInfo info = battleLogTextureInfoList[num];
			if (!list.Contains(info.TexturePath))
			{
				list.Add(info.TexturePath);
			}
			action = (Action)Delegate.Combine(action, (Action)delegate
			{
				Texture texture = Toolbox.ResourcesManager.LoadObject<Texture>(info.LogHeaderAssetPath);
				info.HeaderUITexture.mainTexture = texture;
				info.OnLoad.Call(texture);
			});
		}
		BattlePlayer.DeckSkillCardList.RemoveAll((BattleCardBase c) => !c.IsInDeck);
		return SequentialVfxPlayer.Create(new WaitLoadResourceVfx(list, action));
	}

	public void UpdateClassInfoUi(NetworkBattleReceiver.ClassInfoUiInfo playerClassInfo, NetworkBattleReceiver.ClassInfoUiInfo enemyClassInfo)
	{
		if (playerClassInfo != null)
		{
			base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate
			{
				BattlePlayer.ClassInformationUIController.NewReplayUpdateInfomation(playerClassInfo);
			}));
		}
		if (enemyClassInfo != null)
		{
			base.VfxMgr.RegisterImmediateVfx(InstantVfx.Create(delegate
			{
				BattleEnemy.ClassInformationUIController.NewReplayUpdateInfomation(enemyClassInfo);
			}));
		}
	}

	public void UpdateMyRotationBonus(List<NetworkBattleReceiver.MyRotationBonusInfo> bonusInfoList)
	{
		int i;
		for (i = 0; i < bonusInfoList.Count; i++)
		{
			(bonusInfoList[i].IsSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy)).BonusConditionList.FirstOrDefault((BattlePlayerBase.MyRotationBonusCondition b) => b.MyRotationBonus.AbilityId == bonusInfoList[i].AbilityId).SetConditionInReplay(bonusInfoList[i]);
		}
	}

	public void UpdateAvatarBattleDescValueList(NetworkBattleReceiver.AvatarBattleDescriptionValueInfo playerValueList, NetworkBattleReceiver.AvatarBattleDescriptionValueInfo enemyValueList)
	{
		if (playerValueList != null)
		{
			BattlePlayer.AvatarBattlePassiveSkillDescInfo.ReplaySkillDescriptionValueList = playerValueList.PassiveSkillDescriotionValueList;
			for (int i = 0; i < BattlePlayer.ChoiceBraveSkillDescInfoList.Count; i++)
			{
				BattlePlayer.ChoiceBraveSkillDescInfoList[i].ReplaySkillDescriptionValueList = playerValueList.ChoiceBraveDescriotionValueListList[i];
			}
		}
		if (enemyValueList != null)
		{
			BattleEnemy.AvatarBattlePassiveSkillDescInfo.ReplaySkillDescriptionValueList = enemyValueList.PassiveSkillDescriotionValueList;
			for (int j = 0; j < BattleEnemy.ChoiceBraveSkillDescInfoList.Count; j++)
			{
				BattleEnemy.ChoiceBraveSkillDescInfoList[j].ReplaySkillDescriptionValueList = enemyValueList.ChoiceBraveDescriotionValueListList[j];
			}
		}
	}

	public void ShowSideLog(BattleCardBase card, BattlePlayerBase player, bool isEvol, float time, bool isSkillTargetSelect, NetworkBattleReceiver.CardInfo cardInfo)
	{
		base.VfxMgr.RegisterImmediateVfx(CreateSideLog(card, player, isEvol, time, isSkillTargetSelect, cardInfo));
	}

	public VfxBase CreateSkillSideLog(List<NetworkBattleReceiver.SideLogSkillInfo> sideLogSkillInfoList)
	{
		if (sideLogSkillInfoList == null)
		{
			return NullVfx.GetInstance();
		}
		ParallelVfxPlayer sideLogVfx = ParallelVfxPlayer.Create();
		List<BattleCardBase> list = new List<BattleCardBase>();
		for (int i = 0; i < sideLogSkillInfoList.Count; i++)
		{
			NetworkBattleReceiver.SideLogSkillInfo skillSideLogInfo = sideLogSkillInfoList[i];
			bool isSelf = skillSideLogInfo.IsSelf;
			BattleCardBase battleCardBase = (CardMaster.IsChoiceBraveCardCheck(skillSideLogInfo.CardId) ? GetBattlePlayer(isSelf).ChoiceBraveCardList.First((BattleCardBase c) => c.CardId == skillSideLogInfo.CardId) : GetBattleCardIdx(isSelf ? BattlePlayer.AllCardsWithSkillIngredient.ToList() : BattleEnemy.AllCardsWithSkillIngredient.ToList(), skillSideLogInfo.Index));
			if (battleCardBase == null)
			{
				battleCardBase = list.FirstOrDefault((BattleCardBase c) => c.CardId == skillSideLogInfo.CardId && c.IsPlayer == skillSideLogInfo.IsSelf && c.Index == skillSideLogInfo.Index);
				if (battleCardBase == null)
				{
					CardParameter cardParameterFromId = CardMaster.GetInstanceForBattle().GetCardParameterFromId(skillSideLogInfo.CardId);
					BattlePlayerBase battlePlayer = (skillSideLogInfo.IsSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy));
					battleCardBase = CreateBattleCard(skillSideLogInfo.CardId, skillSideLogInfo.IsSelf, null, cardParameterFromId, battlePlayer, skillSideLogInfo.Index);
					list.Add(battleCardBase);
				}
			}
			if (skillSideLogInfo.CardId != battleCardBase.CardId && battleCardBase.TransformInfo.OriginalCard != null && battleCardBase.TransformInfo.OriginalCard.CardId == skillSideLogInfo.CardId)
			{
				battleCardBase = battleCardBase.TransformInfo.OriginalCard;
			}
			if (skillSideLogInfo.IsPrivate)
			{
				VfxWith<BattleCardBase> vfxWith = ReplaceReceivedCard(battleCardBase, skillSideLogInfo.CardInfo, isSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy), isFusion: false, isSideLog: true);
				battleCardBase = vfxWith.Value;
				base.VfxMgr.RegisterSequentialVfx(vfxWith.Vfx);
			}
			sideLogVfx.Register(CreateSideLog(battleCardBase, isSelf ? ((BattlePlayerBase)BattlePlayer) : ((BattlePlayerBase)BattleEnemy), isEvolSelect: false, 3f, isSkillTargetSelect: false, skillSideLogInfo.CardInfo, skillSideLogInfo));
		}
		return InstantVfx.Create(delegate
		{
			ImmediateVfxMgr.GetInstance().Register(sideLogVfx);
		});
	}

	public VfxBase CreateSideLog(BattleCardBase card, BattlePlayerBase player, bool isEvolSelect, float time, bool isSkillTargetSelect, NetworkBattleReceiver.CardInfo cardInfo, NetworkBattleReceiver.SideLogSkillInfo sideLogSkillInfo = null)
	{
		List<int> sideLogDescriptionValueList = null;
		List<int> sideLogDescriptionValueList2 = null;
		if (cardInfo != null)
		{
			sideLogDescriptionValueList = cardInfo.SkillDescriptionValueList;
			sideLogDescriptionValueList2 = cardInfo.EvoSkillDescriptionValueList;
			UpdateUnionBurstAndSkyboundArtModifier(card, cardInfo);
		}
		BattlePlayerBase.SideLogInfo sideLogInfo = new BattlePlayerBase.SideLogInfo(null);
		string text;
		if (sideLogSkillInfo?.IsEvolve ?? isEvolSelect)
		{
			text = card.EvoSkillDescription(sideLogInfo, isSkipOption: false, null, "", null, sideLogDescriptionValueList2);
			if (card is UnitBattleCard && text == Data.SystemText.Get("Battle_0496"))
			{
				text = card.SkillDescription(sideLogInfo, isSkipOption: false, null, "", null, sideLogDescriptionValueList);
			}
		}
		else
		{
			text = card.SkillDescription(sideLogInfo, isSkipOption: false, null, "", null, sideLogDescriptionValueList);
		}
		return new ShowSideLogVfx(card, null, player.BattleView.GetSideLogControl(isSkillTargetSelect), text, time, isEvolSelect, null, sideLogSkillInfo);
	}

	private VfxBase HideDetailPanel(BattleCardBase card)
	{
		if (DetailMgr.DetailPanelControl._card == card)
		{
			return InstantVfx.Create(DetailMgr.DetailPanelControl.Hide);
		}
		return NullVfx.GetInstance();
	}

	public VfxBase AttachShortageDeckWin(BattleCardBase card, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		return VfxWithLoadingSequential.Create(SkillBase.CreateSingleVfx(base.BattleResourceMgr, () => Vector3.zero, new List<BattleCardBase> { card.SelfBattlePlayer.Class }, card.IsPlayer, card.BattleCardView, effectInfo.EffectPath, effectInfo.EngineType, effectInfo.SePath, effectInfo.EffectMoveType, effectInfo.EffectTargetType, effectInfo.EffectTime), new SetShortageDeckWinVfx(card.SelfBattlePlayer.IsPlayer));
	}

	private void SetShortageDeckWin(bool isPlayer, bool isShortageDeckWin)
	{
		GameObject gameObject = (isPlayer ? CardHolder : ECardHolder);
		if (gameObject.transform.childCount != 0)
		{
			GameObject gameObject2 = gameObject.transform.GetChild(GetMaxDeckCount(isPlayer)).gameObject;
			string path = (isShortageDeckWin ? "sleeve_deckout_win" : "sleeve_deckout");
			gameObject2.GetComponent<MeshRenderer>().material.mainTexture = Toolbox.ResourcesManager.LoadObject(Toolbox.ResourcesManager.GetAssetTypePath(path, ResourcesManager.AssetLoadPathType.BattleTexture, isfetch: true)) as Texture;
		}
	}

	public VfxBase ShortageDeckWin(BattlePlayerBase player)
	{
		return new DeckOutWinVfx(player);
	}

	public VfxBase ShortageDeckLose(bool isPlayer)
	{
		if (isPlayer)
		{
			return new PlayerDeckOutVfx(BattlePlayer, this);
		}
		return new EnemyDeckOutVfx(BattleEnemy, this);
	}

	public VfxBase SpecialWin(BattleCardBase card, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		int num = card.Skills.FindIndex<Skill_special_win>();
		if (num != -1 && card.IsSpell && card.Skills.FirstOrDefault() is Skill_spell_charge)
		{
			num--;
		}
		string voice = card.BattleCardView.VoiceInfo.GetSkillVoice(card.IsEvolution, num).Voice;
		return CreateSpecialBattleFinishEffect(card, new List<BattleCardBase> { card.OpponentBattlePlayer.Class }, effectInfo, voice);
	}

	public VfxBase SpecialLose(BattleCardBase card, NetworkBattleReceiver.EffectInfo effectInfo)
	{
		string voice = card.BattleCardView.VoiceInfo.GetSkillVoice(card.IsEvolution, card.Skills.FindIndex<Skill_special_lose>()).Voice;
		return CreateSpecialBattleFinishEffect(card, new List<BattleCardBase> { card.SelfBattlePlayer.Class }, effectInfo, voice);
	}

	private VfxBase CreateSpecialBattleFinishEffect(BattleCardBase card, List<BattleCardBase> effectTarget, NetworkBattleReceiver.EffectInfo effectInfo, string inductionSkillVoice)
	{
		SequentialVfxPlayer.Create();
		VfxWithLoading vfxWithLoading = CreateSkillEffect(card, effectTarget, effectInfo);
		VfxBase vfxBase = SequentialVfxPlayer.Create(WaitVfx.Create(effectInfo.EffectTime), InstantVfx.Create(delegate
		{
			Skill_special_win.ShakeScreen();
		}));
		VfxBase vfxBase2 = NullVfx.GetInstance();
		if (!ReadOnlyVoiceInfo.IsInvalidFileName(inductionSkillVoice))
		{
			string text = card.BattleCardView.VoiceInfo.VoiceId;
			if (string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(inductionSkillVoice) && inductionSkillVoice != "NONE".ToLower())
			{
				text = inductionSkillVoice.Split(new string[1] { "_" }, StringSplitOptions.None)[0];
			}
			vfxBase2 = VfxWithLoading.Create(new WaitLoadVoiceResourceVfx(card.BattleCardView, text), new PlayCRISoundVfx(card.BattleCardView, inductionSkillVoice));
		}
		ParallelVfxPlayer mainVfx = ParallelVfxPlayer.Create(vfxWithLoading.MainVfx, vfxBase2, vfxBase);
		return VfxWithLoading.Create(vfxWithLoading.LoadingVfx, mainVfx);
	}

	public VfxBase BattleFinish(bool isWin, bool isPlayerDead, bool isEnemyDead, FINISH_TYPE type, NetworkBattleReceiver.RESULT_CODE resultCode)
	{
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		DisableMoveTurnButton();
		_moveTurnButton.ForwardReplayButton.isEnabled = false;
		_moveTurnButton.StopReplayButton.isEnabled = false;
		bool flag = BattlePlayer.Class.IsDead || BattleEnemy.Class.IsDead;
		if (!(type == FINISH_TYPE.RETIRE && flag))
		{
			if (BattlePlayer.Class.IsDead && BattleEnemy.Class.IsDead)
			{
				ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
				BattlePlayer.Class.FlagCardAsDestroyedByKiller();
				BattleEnemy.Class.FlagCardAsDestroyedByKiller();
				parallelVfxPlayer.Register(DeadClass(PlayerDead: true, type));
				parallelVfxPlayer.Register(DeadClass(PlayerDead: false, type));
				sequentialVfxPlayer.Register(parallelVfxPlayer);
			}
			else if (isPlayerDead && isEnemyDead)
			{
				BattlePlayer.Class.FlagCardAsDestroyedByKiller();
				BattleEnemy.Class.FlagCardAsDestroyedByKiller();
				if (resultCode == NetworkBattleReceiver.RESULT_CODE.DisconnectWin)
				{
					sequentialVfxPlayer.Register(DeadClass(PlayerDead: true, type));
					sequentialVfxPlayer.Register(DeadClass(PlayerDead: false, type));
				}
				else if (resultCode == NetworkBattleReceiver.RESULT_CODE.DisconnectLose)
				{
					sequentialVfxPlayer.Register(DeadClass(PlayerDead: false, type));
					sequentialVfxPlayer.Register(DeadClass(PlayerDead: true, type));
				}
			}
			else
			{
				GetBattlePlayer(!isWin).Class.FlagCardAsDestroyedByKiller();
				sequentialVfxPlayer.Register(DeadClass(!isWin, type));
			}
		}
		sequentialVfxPlayer.Register(ParallelVfxPlayer.Create(BattlePlayer.BattleView.AttackSelectControl.ResetCardAfterAttackOnReplay(), BattleEnemy.BattleView.AttackSelectControl.ResetCardAfterAttackOnReplay()));
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			SettingSpecialResultTypeText(isWin, resultCode);
			InitiateGameEndSequence(isWin);
		}));
		base.VfxMgr.RegisterImmediateVfx(new CanNotTouchCardVfx());
		for (int num = 0; num < BattlePlayer.HandCardList.Count; num++)
		{
			BattlePlayer.HandCardList[num].BattleCardView.HideCanPlayEffect();
		}
		BattlePlayer.BattleView.HideChoiceBraveButtonPulsateEffect();
		return sequentialVfxPlayer;
	}

	private void SettingSpecialResultTypeText(bool isWin, NetworkBattleReceiver.RESULT_CODE resultCode)
	{
		string text = string.Empty;
		if (isWin)
		{
			switch (resultCode)
			{
			case NetworkBattleReceiver.RESULT_CODE.RetireWin:
				text = Data.SystemText.Get("Battle_0418");
				break;
			case NetworkBattleReceiver.RESULT_CODE.NotFinish:
			case NetworkBattleReceiver.RESULT_CODE.DisconnectWin:
			case NetworkBattleReceiver.RESULT_CODE.FirstcardWin:
			case NetworkBattleReceiver.RESULT_CODE.TurnendWin:
			case NetworkBattleReceiver.RESULT_CODE.TurnstartWin:
				text = Data.SystemText.Get("Battle_0420");
				break;
			}
		}
		else if (resultCode == NetworkBattleReceiver.RESULT_CODE.DisconnectLose || resultCode == NetworkBattleReceiver.RESULT_CODE.FirstcardLose || resultCode == NetworkBattleReceiver.RESULT_CODE.TurnendLose || resultCode == NetworkBattleReceiver.RESULT_CODE.TurnstartLose || resultCode == NetworkBattleReceiver.RESULT_CODE.NotFinish)
		{
			text = Data.SystemText.Get("Battle_0421");
		}
		if (text.IsNotNullOrEmpty())
		{
			BattleResultControl.SetSpecialResultTypeText(text);
		}
	}
}
