private void InitNode() { m_Close.button.onClick.AddListener(TouchClose); m_Confirm.button.onClick.AddListener(EnterBranchPass); m_DelayBtn.button.onClick.AddListener(DelayEnterPass); PassBranchItem branckItem = Global.gApp.gSystemMgr.GetPassMgr().GetBranchPassItem(); if (branckItem != null) { m_confirmtxt.text.text = Global.gApp.gGameData.GetTipsInCurLanguage(branckItem.tipsId); } }
public bool CheckBranchPassEnterd(int checkPassId) { if (!m_Data.fBPPassed) { PassBranchItem[] fBFItems = Global.gApp.gGameData.PassBranchConfig.items; PassBranchItem fBFItem = fBFItems[m_Data.fBPIndex]; return(checkPassId < fBFItem.passId); } else { return(true); } }
public int GetBranckId(int passId, int reviveTimes, int duration) { if (!m_Data.fBPPassed) { int enterPassId = passId % 100000; PassBranchItem[] fBFItems = Global.gApp.gGameData.PassBranchConfig.items; PassBranchItem curfBFItem = fBFItems[m_Data.fBPIndex]; if (curfBFItem.mainPassId == enterPassId) { return(curfBFItem.passId); } } return(-1); }
private void GameWinForBranchInfo(int enterPassId) { if (enterPassId == 400003) { Global.gApp.gSystemMgr.GetMiscMgr().AddDialogue(1007); } if (!m_Data.fBPPassed) { if (enterPassId == 400004) { Player player = Global.gApp.CurScene.GetMainPlayerComp(); if (player != null) { player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_oldwoman.ToString(), 1); player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_boy.ToString(), 1); player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_doctor03.ToString(), 1); player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_human00.ToString(), 1); player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_human02.ToString(), 1); player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_human03.ToString(), 1); player.GetPlayerData().AddDropResIfNotExit(FightNpcPlayer.FightDropNPC.Npc_human04.ToString(), 1); } } // 再次解救小男孩的关卡; else if (enterPassId == 400009) { Global.gApp.gSystemMgr.GetNpcMgr().SetShowBoyNpc(true); Global.gApp.gSystemMgr.GetNpcMgr().NpcQuestChange(FilterTypeConstVal.GET_ITEM, SpecialItemIdConstVal.NPC_BOY, 1); } PassBranchItem[] fBFItems = Global.gApp.gGameData.PassBranchConfig.items; PassBranchItem curfBFItem = fBFItems[m_Data.fBPIndex]; if (curfBFItem.passId == enterPassId) { if (fBFItems.Length > m_Data.fBPIndex + 1) { m_Data.fBPIndex++; SaveData(); } else { m_Data.fBPPassed = true; SaveData(); } } } }
private void StartGame() { //InfoCLogUtil.instance.SendClickLog(ClickEnum.MAIN_START_GAME); OnClick(); int branchId = Global.gApp.gSystemMgr.GetPassMgr().GetBranchPassId(); //string[] consumeItemStr = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.GAME_CONSUME_ITEMS).contents; if (branchId > 0) { string[] consumeItemStr1 = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.GAME_CONSUME_ITEMS).contents; PassBranchItem branckItem = Global.gApp.gSystemMgr.GetPassMgr().GetBranchPassItem(); if (branckItem.isMust > 0) { //bool result0 = GameItemFactory.GetInstance().ReduceItem(consumeItemStr1, BehaviorTypeConstVal.OPT_GAME_CONSUME); //if (!result0) //{ // Global.gApp.gUiMgr.OpenPanel(Wndid.EnergyShowPanel); // return; //} int passId = Global.gApp.gSystemMgr.GetPassMgr().GetBranchPassId(); Global.gApp.gUiMgr.ClossAllPanel(); Global.gApp.gGameCtrl.ChangeToFightScene(passId); return; } else { Global.gApp.gUiMgr.OpenPanel(Wndid.ConfirmBranchPassUI); return; } } string[] consumeItem; if (!Global.gApp.gSystemMgr.GetPassMgr().GetHasPassedMaxPass()) { consumeItem = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.GAME_CONSUME_ITEMS).contents; } else { consumeItem = Global.gApp.gGameData.GeneralConfigData.Get(GeneralConfigConstVal.REPASS_ENERGY_TAKE).contents; } //bool result = GameItemFactory.GetInstance().ReduceItem(consumeItem, BehaviorTypeConstVal.OPT_GAME_CONSUME); //if (!result) //{ // //InfoCLogUtil.instance.SendClickLog(ClickEnum.GAME_NO_ENERGY); // Global.gApp.gUiMgr.OpenPanel(Wndid.EnergyShowPanel); // return; //} string inputText = InputFieldCmp.inputField.text; float selectPassId; if (float.TryParse(inputText, out selectPassId)) { //Game.PlayerDataMgr.singleton.StageHpParam = selectPassId; //PassItem newPassItem = Global.gApp.gSystemMgr.GetPassMgr().GetPassItemById(selectPassId); //if (newPassItem != null) //{ // Global.gApp.gUiMgr.ClossAllPanel(); // Global.gApp.gGameCtrl.ChangeToFightScene(newPassItem.id); // return; //} } PassItem passItem = Global.gApp.gSystemMgr.GetPassMgr().GetCurPassItem(); if (passItem != null) { Global.gApp.gSystemMgr.GetPassMgr().EnterPass(); Global.gApp.gUiMgr.ClossAllPanel(); Global.gApp.gGameCtrl.ChangeToFightScene(passItem.id); } else { Global.gApp.gMsgDispatcher.Broadcast <string>(MsgIds.ShowGameTipsByStr, "Stay tuned "); } }