コード例 #1
0
    // 鍔犺?鎺夎?(缁ф壙鑷猻dActorInterface)aa
    //	1.璋冩暣琛€閲廰a
    //	2.鏄剧ず姘旀场aa
    //	3.婵€娲昏?鏉℃樉绀篴a
    //  4.鍑绘潃澶勭悊aa
    public override void AddHP(int iHP)
    {
        base.AddHP(iHP);

        // 鍥炶?鍐掓场aa
        if (iHP > 0)
        {
            Vector3 kBubblePos = this.transform.position;
            kBubblePos.y += 2.0f;

            Bubble.AddHp(iHP, kBubblePos, false);
        }

        // 婵€娲昏?鏉犽閲嶆柊鍙?敜aa
        if (GetCurrentHP() > 0)
        {
            if (!mHpUIActive)
            {
                ActiveHPUI();
            }

            if (!mIsSummoned)
            {
                mIsSummoned = true;
                MonsterSummoned();
            }
        }

        // 澶勭悊鎬?墿琚?潃姝籥a
        if (GetCurrentHP() <= 0)
        {
            MonsterKilled();
        }
    }
コード例 #2
0
ファイル: sdMainChar.cs プロジェクト: tsinglee2009/Dczg
    public override void    AddHP(int hp)
    {
        base.AddHP(hp);

        if (hp > 0)
        {
            Vector3 kBubblePos = this.transform.position;
            kBubblePos.y += 2.0f;

            Bubble.AddHp(hp, kBubblePos, false);
        }

        int           iCurrentHP = (int)Property["HP"];
        sdUICharacter uiChar     = sdUICharacter.Instance;

        if (uiChar != null)
        {
            Hashtable hpDesc = new Hashtable();
            hpDesc["value"] = iCurrentHP > 0 ? iCurrentHP : 0;
            hpDesc["des"]   = "";
            uiChar.SetProperty("HP", hpDesc);

            Hashtable maxHpDesc = new Hashtable();
            maxHpDesc["value"] = Property["MaxHP"];
            maxHpDesc["des"]   = "";
            uiChar.SetProperty("MaxHP", maxHpDesc);
        }
        if (iCurrentHP <= 0)
        {
            ClearNotDeathHoldBuffer();

            //pvp战场 不复活aaa
            if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.PVP)
            {
                return;
            }
            if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.PET_TRAIN)
            {
                sdPTManager.Instance.Fail();
                return;
            }
            //深渊中死亡,不请求复活,直接发送结算申请..
            sdTuiTuLogic ttLogic = sdGameLevel.instance.tuiTuLogic;
            if (ttLogic != null && sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS)
            {
                sdActGameMsg.Send_CS_LEVEL_RESULT_NTF();
            }
            //世界BOSS中死亡,弹出自己的请求复活界面..
            else if (ttLogic != null && sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_WORLD_BOSS)
            {
                if (sdActGameMgr.Instance.m_WorldBossInfo.m_Status == 2)
                {
                    //自杀宠物..
                    if (this.Retainer != null)
                    {
                        int iPetHp = this.Retainer.GetCurrentHP();
                        if (iPetHp > 0)
                        {
                            iPetHp = iPetHp * (-1);
                        }
                        this.Retainer.AddHP(iPetHp);
                    }
                    //弹出世界BOSS界面..
                    sdActGameControl.Instance.ActiveWorldBossWnd(null);
                    //请求结算..
                    sdActGameMsg.Send_CS_WB_RESULT_REQ(0);
                }
            }
            else
            {
                sdUICharacter.Instance.ShowRelive();
            }
        }
    }