Exemplo n.º 1
0
 void Update()
 {
     if (m_eCountDownType == eCountDownType.eCDT_None)
     {
         return;
     }
     m_fCountDown -= Time.deltaTime;
     if (m_fCountDown < 0.0f && m_eCountDownType == eCountDownType.eCDT_pvpReady)
     {
         m_fCountDown     = ms_pkTime;
         m_eCountDownType = eCountDownType.eCDT_pvp;
         sdUICharacter.Instance.ShowCountDownTime2(false);
         sdUICharacter.Instance.ShowCountDownTime(true, eCountDownType.eCDT_pvp);
     }
     if (m_eCountDownType == eCountDownType.eCDT_pvp && m_fCountDown < 0.0f)
     {
         m_eCountDownType = eCountDownType.eCDT_None;
         PKStop();
         sdPVPMsg.Send_CSID_PVP_RETULT_REQ(1, 1);
     }
     if (m_Fightui == null)
     {
         //初始化血条aaa
         GameObject ui = GameObject.Find("FightUi");
         if (ui != null && m_pvpRival != null)
         {
             int iMonsterHPType = 0;
             int iHpBarNum      = 1;
             int iMaxHp         = m_pvpRival.GetMaxHP();
             sdUICharacter.Instance.SetMonsterMaxHp(iMonsterHPType, iMaxHp, iHpBarNum);
             m_Fightui = ui.GetComponent <sdFightUi>();
             m_Fightui.ShowMonsterHp();
             m_Fightui.SetBossName(m_pvpRival.Name);
         }
     }
     else
     {
         //血条更新
         if (m_pvpRival != null)
         {
             Hashtable uiValueDesc = new Hashtable();
             uiValueDesc["value"] = m_pvpRival.GetCurrentHP();
             uiValueDesc["des"]   = "";
             sdUICharacter.Instance.SetProperty("MonsterHp", uiValueDesc);
             if (m_pvpRival.GetCurrentHP() <= 0)
             {
                 m_Fightui.HideMonsterHp();
             }
         }
     }
 }
Exemplo n.º 2
0
    // 主角被杀死回调aa
    public void KillMe(sdActorInterface actor)
    {
        // 清除主角宠物aa
        sdActorInterface kActivePet = sdGameLevel.instance.mainChar.Retainer;

        if (kActivePet != null)
        {
            kActivePet.AddHP(int.MinValue);
        }

        // 清除计时aa
        m_eCountDownType = eCountDownType.eCDT_None;

        //
        PKStop();

        // 通知服务器aa
        sdPVPMsg.Send_CSID_PVP_RETULT_REQ(1, 0);
    }
Exemplo n.º 3
0
    // PVP角色被杀死回调aa
    public void KillPVPRival(sdActorInterface actor)
    {
        // 禁用所有PVP宠物aa
        mActivePet = null;
        foreach (DictionaryEntry kEntry in mPetList)
        {
            Hashtable kProperty = kEntry.Value as Hashtable;
            if (kProperty == null)
            {
                continue;
            }

            kProperty["Enable"] = false;
        }

        sdActorInterface activePet = m_pvpRival.Retainer;

        if (activePet != null)
        {
            activePet.AddHP(int.MinValue);
        }

        // 清除计时aa
        m_eCountDownType = eCountDownType.eCDT_None;

        //
        PKStop();

        //
        if (m_Fightui != null)
        {
            m_Fightui.HideMonsterHp();
        }

        // 通知服务器aa
        sdPVPMsg.Send_CSID_PVP_RETULT_REQ(0, 0);
    }