Пример #1
0
    public void OnClickBattleStart()
    {
        if (m_CurrentTeam.Creatures.Count == 0)
        {
            Tooltip.Instance.ShowMessageKey("PVPTeamCountZero");
            return;
        }

        if (CheckSkill() == false)
        {
            return;
        }

        if (m_CurrentTeam.LeaderCreature == null && m_CurrentTeam.Creatures.Any(c => c.creature.TeamSkill != null))
        {
            OnLeaderSkill();
            return;
        }

        bool save = false;

        TeamData pvp_team = TeamDataManager.Instance.GetTeam(pe_Team.PVP);

        if (pvp_team == null)
        {
            TeamDataManager.Instance.AddTeam(m_CurrentTeam, true);
            save = true;
        }
        else if (pvp_team.IsEqual(m_CurrentTeam) == false)
        {
            pvp_team.Set(m_CurrentTeam);
            save = true;
        }

        C2G.PvpEnterBattle packet = new C2G.PvpEnterBattle();
        packet.enemy_account_idx = Network.PVPBattleInfo.enemy_info.account_idx;
        if (save)
        {
            packet.team_data = m_CurrentTeam.CreateSaveData();
        }
        Network.GameServer.JsonAsync <C2G.PvpEnterBattle, C2G.PvpEnterBattleAck>(packet, OnPvpEnterBattle);
    }
Пример #2
0
 void OnPvpEnterBattle(C2G.PvpEnterBattle packet, C2G.PvpEnterBattleAck ack)
 {
     DungeonMonsterManager.Clear();
     GameMain.SetBattleMode(eBattleMode.PVP);
 }