using System.Linq;

public class NetworkWatchBattleSetupCardEvent : NetworkBattleSetupCardEvent
{
	public NetworkWatchBattleSetupCardEvent(BattleManagerBase manager, RegisterActionManager registerCardList, NetworkBattleData data)
		: base(manager, registerCardList, data)
	{
	}

	protected override void SkillEventSetting(BattleCardBase card, SkillBase skill)
	{
		if (skill is Skill_none && !skill.PreprocessList.Any((SkillPreprocessBase p) => p is SkillPreprocessBurialRite))
		{
			return;
		}
		NetworkExecutionInfoCreator networkExecutionInfoCreator = skill._executionInfoCreator as NetworkExecutionInfoCreator;
		bool flag = RegisterValidate.IsValidateCard(skill);
		NetworkBattleReceiver.ReceiveData receiveData = base.networkBattleData.GetReceiveData();
		if (!GameMgr.GetIns().IsAdmin)
		{
			SettingConditionValidateCard(skill, card, networkExecutionInfoCreator);
		}
		if (!IsSettingUnapprovedCard(skill) || IsNotSettingUnapproved(skill))
		{
			return;
		}
		if (RegisterFilter.IsFilterCard(skill))
		{
			if (!card.IsPlayer && RegisterFilter.IsHandAllSelect(skill) && !GameMgr.GetIns().IsAdmin)
			{
				networkExecutionInfoCreator.SetHandAllSelect();
			}
			else if (RegisterFilter.IsDeckAllSelect(skill))
			{
				networkExecutionInfoCreator.SetUseUListOnlySelfTurn();
				if (!card.IsPlayer && !GameMgr.GetIns().IsAdmin)
				{
					networkExecutionInfoCreator.SetDeckAllSelect();
				}
			}
			if (RegisterFilter.IsFilterCardUnapproved(skill))
			{
				networkExecutionInfoCreator.SetUnapproved();
				if (RegisterFilter.IsSkillUpdateDeckCard(skill))
				{
					networkExecutionInfoCreator.SetUseUListOnlySelfTurn();
				}
			}
			return;
		}
		if ((!GameMgr.GetIns().IsAdmin || (GameMgr.GetIns().IsAdminWatch && skill.ApplyingTargetFilter is SkillTargetDeckSelfFilter)) && flag && !(skill.ApplyingTargetFilter is SkillTargetDiscardThisTurnCardListFilter))
		{
			if (!NetworkBattleGenericTool.IsBurialRite(skill))
			{
				if (!RegisterValidate.IsOpenMyHandSkill(skill) && !RegisterValidate.IsSendOpenMyCardsSkill(skill))
				{
					networkExecutionInfoCreator.SetUnapproved();
				}
			}
			else if (!card.IsPlayer)
			{
				networkExecutionInfoCreator.SetNotCheckBuriaRiteCondition(value: true);
			}
		}
		if (!GameMgr.GetIns().IsAdmin && !card.IsPlayer && receiveData != null)
		{
			_networkBattleSetupValidateEvent.OpponentPlayerIncludedValidateSkillToNotPlay(skill);
		}
		SettingUnapprovedRegisterLotEvent(skill, networkExecutionInfoCreator);
		bool flag2 = (GameMgr.GetIns().IsAdmin || card.IsPlayer) && RegisterSkillConditionCheck.IsGameAddDeckCardsNumInvestigationSkill(skill);
		SettingReplaceSkillOption(skill, card, networkExecutionInfoCreator, !RegisterSkillConditionCheck.DoesSkillUsePrivateCount(skill, notHandCheck: true) && !flag2);
		if (!card.IsPlayer && !GameMgr.GetIns().IsAdmin)
		{
			SettingBurialRiteSkillPlayOrNotPlay(skill, networkExecutionInfoCreator);
			CheckApplySelectFilter(skill, networkExecutionInfoCreator);
		}
	}

	protected override bool IsSendUnapprovedList(SkillBase skill)
	{
		return false;
	}

	protected override bool IsCheckValidateCard()
	{
		return false;
	}

	protected override bool IsCheckSkillConditionCard(BattleCardBase card)
	{
		return true;
	}

	protected override bool CheckSkillCondition(SkillBase skill)
	{
		if (skill.SkillPrm.ownerCard.IsPlayer)
		{
			return RegisterSkillConditionCheck.IsSkillConditionCheck(skill, isNotHandCheck: true);
		}
		if (!RegisterSkillConditionCheck.IsSkillConditionCheck(skill, GameMgr.GetIns().IsAdmin))
		{
			if (!GameMgr.GetIns().IsAdmin)
			{
				return RegisterSkillConditionCheck.IsSelectedCardSkillConditionCheck(skill);
			}
			return false;
		}
		return true;
	}

	public override bool IsSettingUnapprovedCard(SkillBase skill)
	{
		return true;
	}

	protected override bool IsSetNotCheckSelectSkillCard()
	{
		return true;
	}
}
