예제 #1
0
 private void OnSaveAIMonsterListProtol(KProtoBuf buf)
 {
     S2C_PLOT_MONSTER_LIST msg = buf as S2C_PLOT_MONSTER_LIST;
     //foreach (ulong uid in msg.monster_uids)
     //{
     //LeyouDebug.LogErrorFormat("AIBOSS: ", "S2C_PLOT_MONSTER_LIST npc_id = {0}, monsterUid = {1}", msg.npc_id, msg.monster_uids.Count);
     //}
     GetMSAIBossProxy().SaveAICallMonsterInfo(msg);
 }
예제 #2
0
    /// <summary>
    /// 保存AI召唤的所有怪物信息
    /// </summary>
    public void SaveAICallMonsterInfo(S2C_PLOT_MONSTER_LIST msg)
    {
        if (m_AICallMonsterDic.ContainsKey(msg.npc_id))
        {
            m_AICallMonsterDic[msg.npc_id].m_MonsterList = msg.monster_uids;
        }
        else
        {
            MonsterList ml = new MonsterList();
            ml.m_MonsterList = msg.monster_uids;
            m_AICallMonsterDic.Add(msg.npc_id, ml);
        }
        int count = msg.monster_uids.Count;

        for (int i = 0; i < count; ++i)
        {
            uint             uid  = (uint)msg.monster_uids[i];
            SpacecraftEntity ship = m_GameplayProxy.GetEntityById <SpacecraftEntity>(uid);
            if (ship != null && ship.GetHeroType() == Assets.Scripts.Define.KHeroType.htEliteMonster2)
            {
                m_HasCallBossSuccess = true;
            }
        }
    }