From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Tutorial/XTutorialCmdExecutor.cs | 1276 ++++++++++++++++++++ 1 file changed, 1276 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs (limited to 'Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs') diff --git a/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs new file mode 100644 index 00000000..ddc5a61e --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Tutorial/XTutorialCmdExecutor.cs @@ -0,0 +1,1276 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UnityEngine; +using XMainClient.Tutorial.Command; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XTutorialCmdExecutor + { + private XBaseCommand _command; + + public float _lastCmdFinishTime = 0f; + + private XCommandForceClick _forceCmd = new XCommandForceClick(); + + private XCommandCutscene _cutsceneCmd = new XCommandCutscene(); + + private XCommandExec _execCmd = new XCommandExec(); + + private XCommandForceSlide _forceSlideCmd = new XCommandForceSlide(); + + private XCommandGenericClick _genericClickCmd = new XCommandGenericClick(); + + private XCommandNewIcon _newIconCmd = new XCommandNewIcon(); + + private XCommandDirectSys _newDirectSys = new XCommandDirectSys(); + + private XCommandNoforceClick _noforceClickCmd = new XCommandNoforceClick(); + + private XCommandPureText _pureTextCmd = new XCommandPureText(); + + private XCommandMove _moveCmd = new XCommandMove(); + + private XCommandForceSkill _skillCmd = new XCommandForceSkill(); + + private XCommandPureOverlay _overlayCmd = new XCommandPureOverlay(); + + private XCommandPrefab _prefabCmd = new XCommandPrefab(); + + private XCommandNote _noteCmd = new XCommandNote(); + + private XCommandHideSkills _hideskillCmd = new XCommandHideSkills(); + + private XCommandShowSkills _showskillCmd = new XCommandShowSkills(); + + private XCommandIsShowButton _isshowbuttonCmd = new XCommandIsShowButton(); + + private XCommandClickEntity _clickEntityCmd = new XCommandClickEntity(); + + private XCommandEmpty _emptyCmd = new XCommandEmpty(); + + public void ExecuteCmd(ref XTutorialCmd Cmd) + { + this.ResetRelativeFlag(); + bool flag = this.IsSkip(Cmd); + if (flag) + { + bool flag2 = Cmd.skipParam1 != null && int.Parse(Cmd.skipParam1) != 0; + if (flag2) + { + XSingleton.singleton.SkipCurrentTutorial(false); + } + else + { + Cmd.state = XCmdState.Cmd_Finished; + XSingleton.singleton.AddLog("Skip Tutorial:" + Cmd.tag, null, null, null, null, null, XDebugColor.XDebug_None); + } + } + else + { + bool flag3 = Cmd.cmd == "forceclick"; + if (flag3) + { + this._command = this._forceCmd; + this._command.SetCommand(Cmd); + bool flag4 = this._command.Execute(); + if (flag4) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag5 = Cmd.cmd == "forceskill"; + if (flag5) + { + this._command = this._skillCmd; + this._command.SetCommand(Cmd); + bool flag6 = this._command.Execute(); + if (flag6) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag7 = Cmd.cmd == "noforceclick"; + if (flag7) + { + this._command = this._noforceClickCmd; + this._command.SetCommand(Cmd); + bool flag8 = this._command.Execute(); + if (flag8) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag9 = Cmd.cmd == "forceslide"; + if (flag9) + { + this._command = this._forceSlideCmd; + this._command.SetCommand(Cmd); + bool flag10 = this._command.Execute(); + if (flag10) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag11 = Cmd.cmd == "movetutorial"; + if (flag11) + { + this._command = this._moveCmd; + this._command.SetCommand(Cmd); + bool flag12 = this._command.Execute(); + if (flag12) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag13 = Cmd.cmd == "newsys"; + if (flag13) + { + this._command = this._newIconCmd; + this._command.SetCommand(Cmd); + bool flag14 = this._command.Execute(); + if (flag14) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag15 = Cmd.cmd == "directsys"; + if (flag15) + { + this._command = this._newDirectSys; + this._command.SetCommand(Cmd); + bool flag16 = this._command.Execute(); + if (flag16) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + XSingleton.singleton.OnCmdFinished(); + } + else + { + bool flag17 = Cmd.cmd == "clickentity"; + if (flag17) + { + this._command = this._clickEntityCmd; + this._command.SetCommand(Cmd); + bool flag18 = this._command.Execute(); + if (flag18) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag19 = Cmd.cmd == "cutscene"; + if (flag19) + { + this._command = this._cutsceneCmd; + this._command.SetCommand(Cmd); + bool flag20 = this._command.Execute(); + if (flag20) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag21 = Cmd.cmd == "exec"; + if (flag21) + { + this._command = this._execCmd; + this._command.SetCommand(Cmd); + bool flag22 = this._command.Execute(); + if (flag22) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag23 = Cmd.cmd == "puretext"; + if (flag23) + { + this._command = this._pureTextCmd; + this._command.SetCommand(Cmd); + bool flag24 = this._command.Execute(); + if (flag24) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag25 = Cmd.cmd == "overlay"; + if (flag25) + { + this._command = this._overlayCmd; + this._command.SetCommand(Cmd); + bool flag26 = this._command.Execute(); + if (flag26) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag27 = Cmd.cmd == "genericclick"; + if (flag27) + { + this._command = this._genericClickCmd; + this._command.SetCommand(Cmd); + bool flag28 = this._command.Execute(); + if (flag28) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag29 = Cmd.cmd == "showprefab"; + if (flag29) + { + this._command = this._prefabCmd; + this._command.SetCommand(Cmd); + bool flag30 = this._command.Execute(); + if (flag30) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag31 = Cmd.cmd == "notewindow"; + if (flag31) + { + this._command = this._noteCmd; + this._command.SetCommand(Cmd); + bool flag32 = this._command.Execute(); + if (flag32) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + else + { + bool flag33 = Cmd.cmd == "hideskills"; + if (flag33) + { + this._command = this._hideskillCmd; + this._command.SetCommand(Cmd); + bool flag34 = this._command.Execute(); + if (flag34) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag35 = Cmd.cmd == "showskills"; + if (flag35) + { + this._command = this._showskillCmd; + this._command.SetCommand(Cmd); + bool flag36 = this._command.Execute(); + if (flag36) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag37 = Cmd.cmd == "showbutton"; + if (flag37) + { + this._command = this._isshowbuttonCmd; + this._command.SetCommand(Cmd); + bool flag38 = this._command.Execute(); + if (flag38) + { + Cmd.state = XCmdState.Cmd_Finished; + } + } + else + { + bool flag39 = Cmd.cmd == "empty"; + if (flag39) + { + this._command = this._emptyCmd; + this._command.SetCommand(Cmd); + bool flag40 = this._command.Execute(); + if (flag40) + { + Cmd.state = XCmdState.Cmd_In_Process; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + public void UpdateCmd(ref XTutorialCmd Cmd) + { + this._command.Update(); + bool flag = this.CanCmdFinish(Cmd); + if (flag) + { + XSingleton.singleton.OnCmdFinished(); + } + } + + public void StopCmd() + { + this._command.Stop(); + } + + public void OnCmdFinish(ref XTutorialCmd Cmd) + { + this._command.OnFinish(); + Cmd.state = XCmdState.Cmd_Finished; + this._lastCmdFinishTime = Time.time; + } + + private bool ConditionSatisified(List conds, List param) + { + bool flag = true; + for (int i = 0; i < conds.Count; i++) + { + switch (conds[i]) + { + case XTutorialCmdExecuteCondition.Player_Level: + { + bool flag2 = (ulong)XSingleton.singleton.XPlayerData.Level < (ulong)((long)int.Parse(param[i])); + if (flag2) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.In_Level: + { + uint sceneID = XSingleton.singleton.SceneID; + bool flag3 = sceneID != (uint)int.Parse(param[i]); + if (flag3) + { + flag = false; + } + else + { + bool flag4 = sceneID == 1u; + if (flag4) + { + bool flag5 = !DlgBase.singleton.IsVisible(); + if (flag5) + { + flag = false; + } + } + } + break; + } + case XTutorialCmdExecuteCondition.After_Level: + { + uint lastFinishScene = XSingleton.singleton.LastFinishScene; + bool flag6 = lastFinishScene != (uint)int.Parse(param[i]); + if (flag6) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Cast_Skill: + { + bool flag7 = XSingleton.singleton.Boss == null || !XSingleton.singleton.Boss.Skill.IsCasting() || XSingleton.singleton.Boss.Skill.CurrentSkill.MainCore.ID != XSingleton.singleton.XHash(param[i]); + if (flag7) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.External_String: + { + bool flag8 = !XSingleton.singleton.QueryExternalString(param[i], false); + if (flag8) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Talk_Npc: + { + bool flag9 = !DlgBase.singleton.IsVisible(); + if (flag9) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Can_Accept_Task: + { + XTaskDocument specificDocument = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + int num = int.Parse(param[i]); + bool flag10 = false; + for (int j = 0; j < specificDocument.TaskRecord.Tasks.Count; j++) + { + XTaskInfo xtaskInfo = specificDocument.TaskRecord.Tasks[j]; + bool flag11 = xtaskInfo != null && (ulong)xtaskInfo.ID == (ulong)((long)num); + if (flag11) + { + flag10 = true; + bool flag12 = xtaskInfo.Status != TaskStatus.TaskStatus_CanTake || !DlgBase.singleton.IsVisible(); + if (flag12) + { + flag = false; + } + break; + } + } + bool flag13 = !flag10; + if (flag13) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Can_Finish_Task: + case XTutorialCmdExecuteCondition.Task_Scene_Finish: + { + XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + int num2 = int.Parse(param[i]); + bool flag14 = false; + for (int k = 0; k < specificDocument2.TaskRecord.Tasks.Count; k++) + { + XTaskInfo xtaskInfo2 = specificDocument2.TaskRecord.Tasks[k]; + bool flag15 = xtaskInfo2 != null && (ulong)xtaskInfo2.ID == (ulong)((long)num2); + if (flag15) + { + flag14 = true; + bool flag16 = xtaskInfo2.Status != TaskStatus.TaskStatus_Finish || !DlgBase.singleton.IsVisible(); + if (flag16) + { + flag = false; + } + break; + } + } + bool flag17 = !flag14; + if (flag17) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Task_Over: + { + XTaskDocument specificDocument3 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + uint taskid = uint.Parse(param[i]); + flag = specificDocument3.TaskRecord.IsTaskFinished(taskid); + break; + } + case XTutorialCmdExecuteCondition.Task_Battle: + { + XTaskDocument specificDocument4 = XDocuments.GetSpecificDocument(XTaskDocument.uuID); + uint num3 = uint.Parse(param[i]); + bool flag18 = false; + for (int l = 0; l < specificDocument4.TaskRecord.Tasks.Count; l++) + { + XTaskInfo xtaskInfo3 = specificDocument4.TaskRecord.Tasks[l]; + TaskTableNew.RowData tableData = xtaskInfo3.TableData; + uint sceneID2 = XTaskDocument.GetSceneID(ref tableData.PassScene); + uint sceneID3 = XTaskDocument.GetSceneID(ref tableData.TaskScene); + bool flag19 = xtaskInfo3 != null && (sceneID2 == num3 || sceneID3 == num3); + if (flag19) + { + flag18 = true; + bool flag20 = xtaskInfo3.Status != TaskStatus.TaskStatus_Taked || !DlgBase.singleton.IsVisible(); + if (flag20) + { + flag = false; + } + break; + } + } + bool flag21 = !flag18; + if (flag21) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Time_Delay: + { + float num4 = float.Parse(param[i]); + bool flag22 = num4 > 0f && Time.time - this._lastCmdFinishTime < num4; + if (flag22) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Sys_Notify: + { + bool flag23 = flag; + bool flag24 = !XSingleton.singleton.QueryExternalString("OpenSys" + param[i], false); + if (flag24) + { + flag = false; + } + XPlayerAttributes xplayerData = XSingleton.singleton.XPlayerData; + bool flag25 = xplayerData.IsSystemOpened(uint.Parse(param[i])); + if (flag25) + { + flag = flag23; + } + break; + } + case XTutorialCmdExecuteCondition.Meet_Enemy: + { + bool flag26 = !XSingleton.singleton.MeetEnemy; + if (flag26) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Art_Skill: + { + bool flag27 = !XSingleton.singleton.ArtSkillOver; + if (flag27) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Cutscene_Over: + { + bool isPlaying = XSingleton.singleton.IsPlaying; + if (isPlaying) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Get_Focused: + { + bool flag28 = XSingleton.singleton.Boss == null || !XSingleton.singleton.Boss.Skill.IsCasting(); + if (flag28) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.No_SuperAmor: + { + XBoss boss = XSingleton.singleton.Boss; + bool flag29 = boss == null; + if (flag29) + { + flag = false; + } + else + { + List enemyList = DlgBase.singleton.EnemyInfoHandler.EnemyList; + double num5 = 0.0; + bool flag30 = enemyList.Count > 0; + if (flag30) + { + num5 = (double)enemyList[0].m_uiSuperArmor.value; + } + bool flag31 = num5 > 0.0; + if (flag31) + { + flag = false; + } + } + break; + } + case XTutorialCmdExecuteCondition.Boss_Exist: + { + bool flag32 = !XSingleton.singleton.HasBoss; + if (flag32) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Enemy_OnGround: + { + bool flag33 = !XSingleton.singleton.HitDownOnGround; + if (flag33) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.No_Promote: + { + bool flag34 = XSingleton.singleton.Player.TypeID >= 10u; + if (flag34) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Team2: + { + XTeamDocument specificDocument5 = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + bool flag35 = !specificDocument5.bInTeam || specificDocument5.MyTeam.members.Count <= 1; + if (flag35) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Has_Target: + { + bool flag36 = !XSingleton.singleton.HasTarget; + if (flag36) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.MainUI: + { + bool flag37 = XSingleton.singleton.IsUIShowed() || XSingleton.singleton.IsHideTutorial(); + if (flag37) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Has_Item: + { + string[] array = param[i].Split(XGlobalConfig.SequenceSeparator); + int num6 = int.Parse(array[0]); + int num7 = int.Parse(array[1]); + num6 = XBagDocument.ConvertTemplate(num6); + XBagDocument specificDocument6 = XDocuments.GetSpecificDocument(XBagDocument.uuID); + int num8 = (int)specificDocument6.GetItemCount(num6); + XFashionDocument specificDocument7 = XDocuments.GetSpecificDocument(XFashionDocument.uuID); + bool flag38 = specificDocument7.OwnFashion(num6); + if (flag38) + { + num8++; + } + bool flag39 = num8 < num7; + if (flag39) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Has_Body: + { + XBagDocument specificDocument8 = XDocuments.GetSpecificDocument(XBagDocument.uuID); + XItem xitem = null; + string[] array2 = param[i].Split(XGlobalConfig.SequenceSeparator); + string a = array2[0]; + int num9 = 0; + bool flag40 = array2.Length > 1; + if (flag40) + { + num9 = int.Parse(array2[1]); + } + XJadeDocument specificDocument9 = XDocuments.GetSpecificDocument(XJadeDocument.uuID); + int num10 = 0; + bool flag41 = a == "boots"; + if (flag41) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Boots); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag42 = a == "earrings"; + if (flag42) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Earrings); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag43 = a == "gloves"; + if (flag43) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Gloves); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag44 = a == "headgear"; + if (flag44) + { + num10 = XBagDocument.BodyPosition(EquipPosition.EQUIP_START); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag45 = a == "lowerbody"; + if (flag45) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Lowerbody); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag46 = a == "mainweapon"; + if (flag46) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Mainweapon); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag47 = a == "necklace"; + if (flag47) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Necklace); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag48 = a == "rings"; + if (flag48) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Rings); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag49 = a == "secondaryweapon"; + if (flag49) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Secondaryweapon); + xitem = specificDocument8.EquipBag[num10]; + } + else + { + bool flag50 = a == "upperbody"; + if (flag50) + { + num10 = XBagDocument.BodyPosition(EquipPosition.Upperbody); + xitem = specificDocument8.EquipBag[num10]; + } + } + } + } + } + } + } + } + } + } + bool flag51 = num9 == 0; + if (flag51) + { + bool flag52 = xitem == null || xitem.itemID == 0; + if (flag52) + { + flag = false; + } + } + else + { + bool flag53 = !specificDocument9.HasRedPoint(num10); + if (flag53) + { + flag = false; + } + } + break; + } + case XTutorialCmdExecuteCondition.No_Stackui: + { + bool flag54 = XSingleton.singleton.IsUIShowed() || XSingleton.singleton.IsHideTutorial(); + if (flag54) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Activity_Open: + { + bool flag55 = !XSingleton.singleton.ActivityOpen; + if (flag55) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Dragon_Crusade_Open: + { + bool flag56 = !XSingleton.singleton.DragonCrusadeOpen; + if (flag56) + { + flag = false; + } + break; + } + case XTutorialCmdExecuteCondition.Battle_NPC_Talk_End: + { + bool flag57 = !XSingleton.singleton.BattleNPCTalkEnd; + if (flag57) + { + flag = false; + } + break; + } + } + bool flag58 = !flag; + if (flag58) + { + break; + } + } + return flag; + } + + public bool CanTutorialExecute(XTutorialMainCmd tutorial) + { + return this.ConditionSatisified(tutorial.conditions, tutorial.condParams); + } + + public bool CanCmdExecute(XTutorialCmd cmd) + { + bool flag = cmd.state == XCmdState.Cmd_In_Process || cmd.state == XCmdState.Cmd_Finished; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = this.ConditionSatisified(cmd.conditions, cmd.condParams); + bool flag3 = flag2; + if (flag3) + { + for (int i = 0; i < cmd.conditions.Count; i++) + { + XTutorialCmdExecuteCondition xtutorialCmdExecuteCondition = cmd.conditions[i]; + if (xtutorialCmdExecuteCondition != XTutorialCmdExecuteCondition.External_String) + { + if (xtutorialCmdExecuteCondition == XTutorialCmdExecuteCondition.Sys_Notify) + { + XSingleton.singleton.QueryExternalString("OpenSys" + cmd.condParams[i], true); + } + } + else + { + XSingleton.singleton.QueryExternalString(cmd.condParams[i], true); + } + } + result = true; + } + else + { + result = false; + } + } + return result; + } + + public bool CanCmdFinish(XTutorialCmd cmd) + { + bool flag = cmd.state != XCmdState.Cmd_In_Process; + bool result; + if (flag) + { + result = false; + } + else + { + bool flag2 = cmd.endcondition == XTutorialCmdFinishCondition.No_Condition; + if (flag2) + { + result = false; + } + else + { + bool flag3 = false; + switch (cmd.endcondition) + { + case XTutorialCmdFinishCondition.Time: + { + float time = Time.time; + float num = (cmd.endParam.Count > 0) ? float.Parse(cmd.endParam[0]) : 3f; + bool flag4 = time - this._command._startTime > num; + if (flag4) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.TalkingNpc: + { + bool flag5 = DlgBase.singleton.IsVisible(); + if (flag5) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.WorldMap: + { + bool flag6 = DlgBase.singleton.IsVisible(); + if (flag6) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SkillLevelup: + { + bool skillLevelup = XSingleton.singleton.SkillLevelup; + if (skillLevelup) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SkillBind: + { + bool skillBind = XSingleton.singleton.SkillBind; + if (skillBind) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.UseItem: + { + bool useItem = XSingleton.singleton.UseItem; + if (useItem) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SysOpened: + { + XPlayerAttributes xplayerData = XSingleton.singleton.XPlayerData; + bool flag7 = xplayerData.IsSystemOpened(uint.Parse(cmd.param1)); + if (flag7) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.GetReward: + { + bool getReward = XSingleton.singleton.GetReward; + if (getReward) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.Move: + { + bool moved = XSingleton.singleton.Moved; + if (moved) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.ComposeFashion: + { + bool fashionCompose = XSingleton.singleton.FashionCompose; + if (fashionCompose) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.ReinforceItem: + { + bool reinforceItem = XSingleton.singleton.ReinforceItem; + if (reinforceItem) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.EnhanceItem: + { + bool enhanceItem = XSingleton.singleton.EnhanceItem; + if (enhanceItem) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.ChangeProf: + { + bool switchProf = XSingleton.singleton.SwitchProf; + if (switchProf) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.HasTeam: + { + bool hasTeam = XSingleton.singleton.HasTeam; + if (hasTeam) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.Smelting: + { + bool smelting = XSingleton.singleton.Smelting; + if (smelting) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SelectView: + { + bool selectView = XSingleton.singleton.SelectView; + if (selectView) + { + flag3 = true; + } + break; + } + case XTutorialCmdFinishCondition.SelectSkipTutorial: + { + bool selectSkipTutorial = XSingleton.singleton.SelectSkipTutorial; + if (selectSkipTutorial) + { + flag3 = true; + } + break; + } + } + bool flag8 = flag3; + result = flag8; + } + } + return result; + } + + private bool IsSkip(XTutorialCmd cmd) + { + string skipCondition = cmd.skipCondition; + bool flag = string.IsNullOrEmpty(skipCondition); + bool result; + if (flag) + { + result = false; + } + else + { + XSkillTreeDocument specificDocument = XDocuments.GetSpecificDocument(XSkillTreeDocument.uuID); + bool flag2 = false; + string text = skipCondition; + uint num = PrivateImplementationDetails.ComputeStringHash(text); + if (num <= 2100011009u) + { + if (num <= 985216048u) + { + if (num != 153474289u) + { + if (num != 461464819u) + { + if (num == 985216048u) + { + if (text == "MenuBtnInState2") + { + flag2 = !DlgBase.singleton.MenuSwitchBtnState; + } + } + } + else if (text == "ModalDlg") + { + flag2 = !DlgBase.singleton.IsVisible(); + } + } + else if (text == "NoLearnSkill") + { + bool flag3 = cmd.skipParam2 == null || cmd.skipParam3 == null; + if (flag3) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + cmd.TutorialID, + " Error\ntag:", + cmd.tag, + " Command:LearnSkill Param Num Error" + }), null, null, null, null, null); + } + flag2 = specificDocument.isTutorialNeed(int.Parse(cmd.skipParam2), int.Parse(cmd.skipParam3)); + } + } + else if (num <= 2057789062u) + { + if (num != 1035548905u) + { + if (num == 2057789062u) + { + if (text == "LearnSkill") + { + bool flag4 = cmd.skipParam2 == null || cmd.skipParam3 == null; + if (flag4) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + cmd.TutorialID, + " Error\ntag:", + cmd.tag, + " Command:LearnSkill Param Num Error" + }), null, null, null, null, null); + } + flag2 = !specificDocument.isTutorialNeed(int.Parse(cmd.skipParam2), int.Parse(cmd.skipParam3)); + } + } + } + else if (text == "MenuBtnInState1") + { + flag2 = DlgBase.singleton.MenuSwitchBtnState; + } + } + else if (num != 2090134647u) + { + if (num == 2100011009u) + { + if (text == "HasTaskTab") + { + flag2 = DlgBase.singleton._TaskNaviHandler._TaskSwitchBtnState; + } + } + } + else if (text == "SelectSight2.5D") + { + XOptionsDocument specificDocument2 = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + flag2 = (specificDocument2.GetValue(XOptionsDefine.OD_VIEW) == XFastEnumIntEqualityComparer.ToInt(XOperationMode.X25D)); + } + } + else if (num <= 2995591070u) + { + if (num != 2352948218u) + { + if (num != 2805484350u) + { + if (num == 2995591070u) + { + if (text == "InTeamTab") + { + flag2 = !DlgBase.singleton._TaskNaviHandler.IsShowingTaskTab; + } + } + } + else if (text == "PPTLess") + { + bool flag5 = cmd.skipParam2 == null; + if (flag5) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "TutorialId:", + cmd.TutorialID, + " Error\ntag:", + cmd.tag, + " Command:PPTLess Param Num Error" + }), null, null, null, null, null); + } + flag2 = (XSingleton.singleton.XPlayerData.GetAttr(XAttributeDefine.XAttr_POWER_POINT_Total) < (double)int.Parse(cmd.skipParam2)); + } + } + else if (text == "InTaskTab") + { + flag2 = DlgBase.singleton._TaskNaviHandler.IsShowingTaskTab; + } + } + else if (num <= 3972437787u) + { + if (num != 3566417125u) + { + if (num == 3972437787u) + { + if (text == "RadioNoCanOpen") + { + XRadioDocument specificDocument3 = XDocuments.GetSpecificDocument(XRadioDocument.uuID); + XOptionsDocument specificDocument4 = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + flag2 = (specificDocument3.roomState == XRadioDocument.BigRoomState.InRoom || specificDocument4.GetValue(XOptionsDefine.OD_RADIO) == 0); + } + } + } + else if (text == "CurSkillNoLearn") + { + flag2 = !specificDocument.CheckLevelUpButton(); + } + } + else if (num != 4122175948u) + { + if (num == 4247367664u) + { + if (text == "Chapter1Star8Box") + { + flag2 = XSingleton.singleton.HasChapterBoxFetched(1, 0); + } + } + } + else if (text == "ProfessionNo1Turn") + { + flag2 = (XFastEnumIntEqualityComparer.ToInt(XSingleton.singleton.XPlayerData.Profession) < 10); + } + result = flag2; + } + return result; + } + + public void ResetRelativeFlag() + { + XSingleton.singleton.SkillLevelup = false; + XSingleton.singleton.SkillBind = false; + XSingleton.singleton.UseItem = false; + XSingleton.singleton.GetReward = false; + XSingleton.singleton.FashionCompose = false; + XSingleton.singleton.ReinforceItem = false; + XSingleton.singleton.EnhanceItem = false; + XSingleton.singleton.SwitchProf = false; + XSingleton.singleton.MeetEnemy = false; + XSingleton.singleton.HasTeam = false; + XSingleton.singleton.Smelting = false; + XSingleton.singleton.HitDownOnGround = false; + } + } +} -- cgit v1.1-26-g67d0