예제 #1
0
    void OnEndWorldBossHandler(C2G.EndWorldBoss packet, C2G.EndWorldBossAck ack)
    {
        if (packet.end_type == pe_EndBattle.Exit)
        {
            GameMain.SetBattleMode(eBattleMode.None);
            return;
        }

        MapStageDifficulty stage_info = Network.BattleStageInfo;

        _battle_end_param       = new EventParamWorldBossBattleEnd();
        _battle_end_param.rank  = ack.info.rank;
        _battle_end_param.score = packet.score;
        if (WorldBossInfo.Info != null)
        {
            _battle_end_param.rank_up  = ack.info.rank - WorldBossInfo.Info.rank;
            _battle_end_param.score_up = ack.info.score - WorldBossInfo.Info.score;
        }
        else
        {
            _battle_end_param.is_first = true;
        }

        WorldBossInfo.Info = ack.info;

        Network.PlayerInfo.UseEnergy(stage_info.Energy);

        MapClearDataManager.Instance.SetClearRate(stage_info, 3);
    }
예제 #2
0
    public override void SetBattleEnd()
    {
        base.SetBattleEnd();

        C2G.EndWorldBoss _packet = new C2G.EndWorldBoss();
        _packet.end_type = battleEndType;
        _packet.map_id   = Network.BattleStageInfo.MapInfo.ID;
        _packet.score    = m_BossHP.Creature.Stat.DealHP;

        //List<int> skill_indice = new List<int>();
        for (int i = 0; i < m_TeamData.Creatures.Count; ++i)
        {
            Creature       creature = m_TeamData.Creatures[i].creature;
            BattleCreature bc       = characters.Find(c => c.Idx == creature.Idx) as BattleCreature;
            if (bc == null)
            {
                bc = dead_characters.Find(c => c.Idx == creature.Idx) as BattleCreature;
            }
            m_TeamData.Creatures[i].auto_skill_index = bc.AutoSkillIndex;
        }
        if (m_TeamData.IsEqual(m_TeamDataBackup) == false)
        {
            _packet.team_data = m_TeamData.CreateSaveData();
        }

        Network.GameServer.JsonAsync <C2G.EndWorldBoss, C2G.EndWorldBossAck>(_packet, OnEndWorldBossHandler);
    }