private void EnterBattle() { C2G.EnterBattle packet = new C2G.EnterBattle(); packet.map_id = m_StageInfo.MapInfo.ID; packet.stage_id = m_StageInfo.ID; packet.difficulty = m_StageInfo.Difficulty; if (m_StageInfo.MapInfo.AvailableTags.Count > 0) { packet.creature_ids = m_TeamData.Creatures.Select(c => c.creature.Info.ID).ToList(); } if (Tutorial.Instance.Completed == true) { if (m_TeamData.IsEqual(m_TeamDataBackup) == false) { packet.team_data = m_TeamData.CreateSaveData(); } Network.GameServer.JsonAsync <C2G.EnterBattle, C2G.EnterBattleAck>(packet, OnEnterBattle); } else { C2G.TutorialState tutorial_packet = new C2G.TutorialState(); tutorial_packet.enter_battle = packet; tutorial_packet.tutorial_state = Network.PlayerInfo.tutorial_state; tutorial_packet.next_tutorial_state = (short)Tutorial.Instance.CurrentState; Network.GameServer.JsonAsync <C2G.TutorialState, C2G.TutorialStateAck>(tutorial_packet, OnTutorialEnterBattle); } }
void OnEnterBattle(C2G.EnterBattle packet, C2G.EnterBattleAck ack) { MapClearDataManager.Instance.SetTry(m_StageInfo); short energy = m_StageInfo.Energy; var energy_event = EventHottimeManager.Instance.GetInfoByID("dungeon_energy_zero"); if (energy_event != null) { energy = (short)(energy * energy_event.Percent); } Network.PlayerInfo.UseEnergy(energy); Network.BattleStageInfo = m_StageInfo; if (m_StageInfo.MapInfo.MapType == "worldboss") { GameMain.SetBattleMode(eBattleMode.BattleWorldboss); } else { GameMain.SetBattleMode(eBattleMode.Battle); } }