示例#1
0
文件: Life.cs 项目: 741645596/batgame
    public virtual void Dead()
    {
        if (m_isDead)
        {
            return;
        }
        //Debug.Log(this + " dead" + "," + SceneID);
        //炮弹兵死亡
        if (m_Core.m_type == LifeMType.SOLDIER)
        {
            CmCarbon.AddDiePlayerSoldier(m_Core, GetMapPos());
            //Debug.Log("add mana" + m_SceneID + gameObject);
            CmCarbon.AddGodSkillMana(!m_Core.m_IsPlayer, ConfigM.GetSoldierDeadMana());
            if (m_Core.m_IsPlayer == false)
            {
                GodSkillWnd gsw = WndManager.FindDialog <GodSkillWnd>();
                if (gsw != null)
                {
                    gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                }
            }
        }
        //建筑物死亡
        if (m_Core.m_type == LifeMType.BUILD)
        {
            CmCarbon.AddDieBuild(m_Core);
            BattleEnvironmentM.ShowSmoke();
            //Debug.Log("add mana" + m_SceneID + gameObject);
            if (BattleEnvironmentM.GetBattleEnvironmentMode() == BattleEnvironmentMode.CombatPVE)
            {
                int mana = (m_Attr as BuildAttribute).DeadMana;
                CmCarbon.AddGodSkillMana(!m_Core.m_IsPlayer, mana);
            }
            else
            {
                CmCarbon.AddGodSkillMana(!m_Core.m_IsPlayer, ConfigM.GetBuildDeadMana());
            }

            if (m_Core.m_IsPlayer == false)
            {
                GodSkillWnd gsw = WndManager.FindDialog <GodSkillWnd>();
                if (gsw != null)
                {
                    gsw.SetCurMana(CmCarbon.GetGodSkillMana(true));
                }
            }
        }
        m_isDead = true;
        BeforeDead();
        //SkillEffects._instance.LoadEffect("effect/prefab/", "1052061",transform.position,1f);
        LifeMCamp   Camp     = (m_Core.m_Camp == LifeMCamp.ATTACK) ? LifeMCamp.DEFENSE :LifeMCamp.ATTACK;
        List <Life> RoleList = new List <Life>();

        CM.SearchLifeMListInBoat(ref RoleList, LifeMType.SOLDIER | LifeMType.SUMMONPET, Camp);
        AIPathConditions.AIPathEvent(new AIEventData(AIEvent.EVENT_TD), RoleList);
        MapM.EmptyRoleStations(m_SceneID, m_Core.m_type);
        CM.ExitCombat(m_Core, m_SceneID);


        DeadEffect();

        if (this is Building1300)
        {
        }
        else
        {
            Destroy();
        }
    }