public override void OnActivate(int pinID) { if (pinID != 0) { return; } GameManager instance = MonoSingleton <GameManager> .Instance; QuestParam selectedQuest = this.SelectedQuest; if (selectedQuest == null) { DebugUtility.LogError("QuestNotFound \"" + GlobalVars.SelectedQuestID + "\" "); } else { int num = selectedQuest.RequiredApWithPlayerLv(instance.Player.Lv, true); if (GlobalVars.RaidNum > 0) { num *= GlobalVars.RaidNum; } if (num <= instance.Player.Stamina) { this.ActivateOutputLinks(100); } else { this.ActivateOutputLinks(103); } } }
private void Setup(int idx) { if (this.mIsActivatePinAfterSelectedFloor) { this.mIsActivatePinAfterSelectedFloor = false; FlowNode_GameObject.ActivateOutputLinks((Component)this, 10); } GameManager instance = MonoSingleton <GameManager> .Instance; MultiTowerFloorParam mtFloorParam = instance.GetMTFloorParam(GlobalVars.SelectedMultiTowerID, idx); if (mtFloorParam == null || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestInfo, (UnityEngine.Object)null)) { return; } int mtChallengeFloor = instance.GetMTChallengeFloor(); int mtClearedMaxFloor = instance.GetMTClearedMaxFloor(); int num1 = int.MaxValue; if (!this.IsMultiTowerTop) { num1 = this.GetCanCharengeFloor(); } this.SetButtonIntractable(((int)mtFloorParam.floor <= mtClearedMaxFloor || (int)mtFloorParam.floor == mtChallengeFloor) && (int)mtFloorParam.floor <= num1); MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(this.QuestInfo, (MultiTowerFloorParam)null); if (dataOfClass != null && (int)mtFloorParam.floor == (int)dataOfClass.floor) { return; } DebugUtility.Log("設定" + mtFloorParam.name); QuestParam questParam = mtFloorParam.GetQuestParam(); DataSource.Bind <MultiTowerFloorParam>(this.QuestInfo, mtFloorParam); DataSource.Bind <QuestParam>(this.QuestInfo, questParam); GameParameter.UpdateAll(this.QuestInfo); MultiTowerQuestInfo component = (MultiTowerQuestInfo)this.QuestInfo.GetComponent <MultiTowerQuestInfo>(); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { component.Refresh(); } GlobalVars.SelectedMultiTowerID = mtFloorParam.tower_id; GlobalVars.SelectedQuestID = questParam.iname; GlobalVars.SelectedMultiTowerFloor = (int)mtFloorParam.floor; int num2 = questParam.RequiredApWithPlayerLv(instance.Player.Lv, true); if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestAP, (UnityEngine.Object)null)) { this.QuestAP.set_text(num2.ToString()); } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ChangeQuestAP, (UnityEngine.Object)null)) { return; } this.ChangeQuestAP.set_text(num2.ToString()); }
public override void OnActivate(int pinID) { switch (pinID) { case 100: MyPhoton.MyPlayer myPlayer1 = PunMonoSingleton <MyPhoton> .Instance.GetMyPlayer(); JSON_MyPhotonPlayerParam photonPlayerParam1 = myPlayer1 != null?JSON_MyPhotonPlayerParam.Parse(myPlayer1.json) : (JSON_MyPhotonPlayerParam)null; if (photonPlayerParam1 != null && photonPlayerParam1.state != 0 && photonPlayerParam1.state != 4) { this.ActivateOutputLinks(1); break; } this.ActivateOutputLinks(2); break; case 101: List <MyPhoton.MyPlayer> roomPlayerList1 = PunMonoSingleton <MyPhoton> .Instance.GetRoomPlayerList(); if (roomPlayerList1 != null) { using (List <MyPhoton.MyPlayer> .Enumerator enumerator = roomPlayerList1.GetEnumerator()) { while (enumerator.MoveNext()) { MyPhoton.MyPlayer current = enumerator.Current; JSON_MyPhotonPlayerParam photonPlayerParam2 = current != null?JSON_MyPhotonPlayerParam.Parse(current.json) : (JSON_MyPhotonPlayerParam)null; if (photonPlayerParam2 == null || photonPlayerParam2.state == 0 || photonPlayerParam2.state == 4) { this.ActivateOutputLinks(2); return; } } } } this.ActivateOutputLinks(1); break; case 102: MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance; List <MyPhoton.MyPlayer> roomPlayerList2 = instance.GetRoomPlayerList(); MyPhoton.MyPlayer myPlayer2 = instance.GetMyPlayer(); if (roomPlayerList2 != null && myPlayer2 != null) { using (List <MyPhoton.MyPlayer> .Enumerator enumerator = roomPlayerList2.GetEnumerator()) { while (enumerator.MoveNext()) { MyPhoton.MyPlayer current = enumerator.Current; if (current.playerID != myPlayer2.playerID) { JSON_MyPhotonPlayerParam photonPlayerParam2 = current != null?JSON_MyPhotonPlayerParam.Parse(current.json) : (JSON_MyPhotonPlayerParam)null; if (photonPlayerParam2 == null || photonPlayerParam2.state == 0 || photonPlayerParam2.state == 4) { this.ActivateOutputLinks(2); return; } } } } } this.ActivateOutputLinks(1); break; case 200: MyPhoton.MyRoom currentRoom = PunMonoSingleton <MyPhoton> .Instance.GetCurrentRoom(); if (currentRoom == null || currentRoom.playerCount < currentRoom.maxPlayers) { this.ActivateOutputLinks(2); break; } this.ActivateOutputLinks(1); break; case 300: if (string.IsNullOrEmpty(GlobalVars.SelectedQuestID)) { this.ActivateOutputLinks(2); } QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID); PlayerData player = MonoSingleton <GameManager> .Instance.Player; if (quest != null && player != null) { if (player.Stamina >= quest.RequiredApWithPlayerLv(player.Lv, true)) { this.ActivateOutputLinks(1); break; } MonoSingleton <GameManager> .Instance.StartBuyStaminaSequence(true); this.ActivateOutputLinks(2); break; } this.ActivateOutputLinks(2); break; } }
private bool Test() { PlayerData player = MonoSingleton <GameManager> .Instance.Player; switch (this.Condition) { case FlowNode_Condition.Conditions.QUEST_HASENOUGHSTAMINA: QuestParam quest1 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID); if (quest1 != null) { return(MonoSingleton <GameManager> .Instance.Player.Stamina >= quest1.RequiredApWithPlayerLv(player.Lv, true)); } break; case FlowNode_Condition.Conditions.FRIEND_ISFRIEND: SupportData supportData1; if ((supportData1 = this.GetSupportData()) != null) { return(supportData1.IsFriend()); } return(false); case FlowNode_Condition.Conditions.PARTY_LEADERSKILLAVAIL: PartyData dataOfClass1; if ((dataOfClass1 = DataSource.FindDataOfClass <PartyData>(((Component)this).get_gameObject(), (PartyData)null)) != null) { return(this.GetLeaderSkill(dataOfClass1) != null); } break; case FlowNode_Condition.Conditions.FRIEND_LEADERSKILLAVAIL: SupportData supportData2; if ((supportData2 = this.GetSupportData()) != null) { return(supportData2.LeaderSkill != null); } break; case FlowNode_Condition.Conditions.PARTY_LEADEREXIST: for (int index = 0; index < player.Partys.Count; ++index) { if (player.Partys[index].GetUnitUniqueID(player.Partys[index].LeaderIndex) == 0L) { return(false); } } return(true); case FlowNode_Condition.Conditions.TARGET_COMMANDVALID: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.UIParam_TargetValid); } break; case FlowNode_Condition.Conditions.QUEST_DROPSKAKERA: QuestParam dataOfClass2; if ((dataOfClass2 = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null)) != null && !UnityEngine.Object.op_Equality((UnityEngine.Object)QuestDropParam.Instance, (UnityEngine.Object)null)) { return(QuestDropParam.Instance.GetHardDropPiece(dataOfClass2.iname, GlobalVars.GetDropTableGeneratedDateTime()) != null); } break; case FlowNode_Condition.Conditions.QUEST_FIRSTTURN: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.UnitStartCount <= 1); } break; case FlowNode_Condition.Conditions.QUEST_NEEDFRIENDREQUEST: SupportData support = (SupportData)GlobalVars.SelectedSupport; if (support == null || support.IsFriend()) { return(false); } FriendData friendData = player.Friends.Find((Predicate <FriendData>)(f => f.FUID == support.FUID)); if (friendData == null) { return(true); } return(friendData.State == FriendStates.Friend || friendData.State != FriendStates.Follow ? false : false); case FlowNode_Condition.Conditions.PLAYER_LEVELCHANGED: return((bool)GlobalVars.PlayerLevelChanged); case FlowNode_Condition.Conditions.NEWGAME: return(GameUtility.Config_NewGame.Value); case FlowNode_Condition.Conditions.BTLIDSET: return((long)GlobalVars.BtlID != 0L); case FlowNode_Condition.Conditions.QUEST_ISMULTIPLAY: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsPlayingMultiQuest); } break; case FlowNode_Condition.Conditions.QUEST_ISARENA: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsPlayingArenaQuest); } break; case FlowNode_Condition.Conditions.ARENA_RANKUP: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsArenaRankupInfo()); } break; case FlowNode_Condition.Conditions.QUEST_HASREWARD: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(!SceneBattle.Instance.Battle.GetQuestRecord().IsZero); } break; case FlowNode_Condition.Conditions.TERMSOFUSE_AGREED: return(MonoSingleton <GameManager> .Instance.IsAgreeTermsOfUse()); case FlowNode_Condition.Conditions.FRIEND_VALID: return(this.GetSupportData() != null); case FlowNode_Condition.Conditions.QUEST_ENDSILENT: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.CurrentQuest.Silent); } break; case FlowNode_Condition.Conditions.IS_NOT_ENOUGH_SUPPORT_COST: SupportData supportData3 = this.GetSupportData(); if (supportData3 != null) { int gold = player.Gold; if (supportData3.GetCost() > gold) { return(true); } break; } break; case FlowNode_Condition.Conditions.MULTI_PLAY_IS_UNLOCKED: return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiPlay)); case FlowNode_Condition.Conditions.QUEST_IS_ENABLE_AUTOBATTLE: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { QuestParam quest2 = SceneBattle.Instance.Battle.GetQuest(); if (quest2 != null) { return(quest2.CheckAllowedAutoBattle()); } return(false); } break; case FlowNode_Condition.Conditions.QUEST_IS_AUTOBATTLE: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.Battle.IsAutoBattle); } break; case FlowNode_Condition.Conditions.DEBUGBUILD: return(GameUtility.IsDebugBuild); case FlowNode_Condition.Conditions.IS_BEGINNER: return(MonoSingleton <GameManager> .Instance.Player.IsBeginner()); case FlowNode_Condition.Conditions.IS_END_TUTORIAL: return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L); case FlowNode_Condition.Conditions.IS_GET_UNIT: return(MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null).iname) != null); case FlowNode_Condition.Conditions.VERSUS_UNLOCK: return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiVS)); case FlowNode_Condition.Conditions.QUEST_IS_SHOW_REVIEW: if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID)) { QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID); if (quest2 != null) { return(quest2.ShowReviewPopup); } break; } break; case FlowNode_Condition.Conditions.QUEST_IS_FIRST_CLEAR: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsFirstWin); } break; case FlowNode_Condition.Conditions.QUEST_IS_GPS: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null) && SceneBattle.Instance.CurrentQuest != null && SceneBattle.Instance.CurrentQuest.type == QuestTypes.Gps) { return(true); } break; case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_HEAD: if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)) { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null && area.IsGpsQuest()) { return(area.children.Count > 0); } break; } break; case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST: if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)) { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null) { return(area.IsGpsQuest()); } break; } break; case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST_VALID: if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter)) { ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter); if (area != null) { return(area.HasGpsQuest()); } break; } break; case FlowNode_Condition.Conditions.VALID_GPSGIFT: return(MonoSingleton <GameManager> .Instance.Player.ValidGpsGift); case FlowNode_Condition.Conditions.SCENE_CHANGING: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)HomeWindow.Current, (UnityEngine.Object)null)) { return(HomeWindow.Current.IsSceneChanging); } return(false); case FlowNode_Condition.Conditions.QUEST_IS_PLAY_LAST_DEMO: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsPlayLastDemo); } break; case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.Battle.IsRankingQuest); } break; case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_NEWSCORE: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsRankingQuestNewScore); } break; case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_JOIN_REWARD: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsRankingQuestJoinReward); } break; case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_RESULT_VALIDRANK: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.ValidateRankingQuestRank); } break; case FlowNode_Condition.Conditions.DIFFERENT_VERSION: string version = MyApplicationPlugin.get_version(); string strB = PlayerPrefsUtility.GetString(PlayerPrefsUtility.AWAKE_VERSION, string.Empty); PlayerPrefsUtility.SetString(PlayerPrefsUtility.AWAKE_VERSION, version, true); return(string.Compare(version, strB) != 0); case FlowNode_Condition.Conditions.SELECTQUEST_IS_MULTIGPS: if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID)) { QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID); if (quest2 != null) { return(quest2.IsMultiAreaQuest); } break; } break; case FlowNode_Condition.Conditions.LINEQUEST_IS_MULTIGPS: if (!string.IsNullOrEmpty(FlowNode_OnUrlSchemeLaunch.LINEParam_Pending.iname)) { QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(FlowNode_OnUrlSchemeLaunch.LINEParam_Pending.iname); if (quest2 != null) { return(quest2.IsMultiAreaQuest); } break; } break; case FlowNode_Condition.Conditions.GPSQUEST_IS_VALID: return(MonoSingleton <GameManager> .Instance.IsValidAreaQuest()); case FlowNode_Condition.Conditions.MULTI_GPSQUEST_IS_VALID: return(MonoSingleton <GameManager> .Instance.IsValidMultiAreaQuest()); case FlowNode_Condition.Conditions.QUEST_IS_ORDEAL: if (UnityEngine.Object.op_Implicit((UnityEngine.Object)SceneBattle.Instance)) { return(SceneBattle.Instance.IsOrdealQuest); } break; case FlowNode_Condition.Conditions.QUEST_IS_GET_UNIT: if (UnityEngine.Object.op_Implicit((UnityEngine.Object)SceneBattle.Instance)) { return(SceneBattle.Instance.IsGetFirstClearItem); } break; case FlowNode_Condition.Conditions.VALID_FIRST_CHARGE_CAMPAIGN: if ((byte)MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus != (byte)1) { return((byte)MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus == (byte)2); } return(true); case FlowNode_Condition.Conditions.GUERRILLASHOP_IS_STARTED: return(MonoSingleton <GameManager> .Instance.Player.IsGuerrillaShopStarted); case FlowNode_Condition.Conditions.QUEST_END_CARD_IS_SENDMAIL: if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null)) { return(SceneBattle.Instance.IsCardSendMail); } break; case FlowNode_Condition.Conditions.TOWER_QUEST_HAVE_MISSION: QuestParam quest3 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID); if (quest3 != null && quest3.HasMission()) { return(true); } break; case FlowNode_Condition.Conditions.SHOW_BEGINNER_TOP_NOTIFY: if (player.IsBeginner() && PlayerPrefsUtility.GetInt(PlayerPrefsUtility.BEGINNER_TOP_HAS_VISITED, 0) == 0) { return(true); } break; } return(false); }