Exemplo n.º 1
0
    protected void OnPickup(PhotonPlayer m_actor, int m_view)
    {
        PhotonView view = PhotonView.Find(m_view);

        if (view != null)
        {
            bl_CTFPlayerLogic logic = view.GetComponent <bl_CTFPlayerLogic>();
            if (CanBePickedUpBy(logic) == true)
            {
                OnPickup(logic);
                if (PhotonNetwork.player == m_actor)
                {
                    bool t_send = false;//Prevent call two or more events
                    if (!t_send)
                    {
                        t_send = true;
                        Team oponentTeam;
                        if ((string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey] == Team.Delta.ToString())
                        {
                            oponentTeam = Team.Recon;
                        }
                        else
                        {
                            oponentTeam = Team.Delta;
                        }
                        bl_EventHandler.KillEvent(PhotonNetwork.player.name, "", "Obtained at the " + oponentTeam.ToString() + " flag", (string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey], 777, 15);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
 public override void OnPickup(bl_CTFPlayerLogic logic)
 {
     if (logic.m_PlayerTeam == Team)
     {
         if (IsHome() == false)
             ReturnFlag();
     }
     else
         m_CarryingPlayer = logic;
 }
Exemplo n.º 3
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.tag == "Player")
     {
         bl_CTFPlayerLogic logic = collider.gameObject.GetComponent <bl_CTFPlayerLogic>();
         if (CanBePickedUpBy(logic) == true)
         {
             PickupObject(logic);
         }
     }
 }
Exemplo n.º 4
0
    void OnCapture(PhotonPlayer m_actor)
    {
        m_CarryingPlayer   = null;
        transform.position = m_HomePosition;

        //Only the player who captures the flag, updates the properties
        if (PhotonNetwork.player == m_actor)
        {
            bl_EventHandler.KillEvent(PhotonNetwork.player.NickName, "", bl_GameTexts.CaptureTheFlag, (string)PhotonNetwork.player.GetPlayerTeam().ToString(), 777, 15);
            IncreaseScore();
        }
    }
Exemplo n.º 5
0
    void OnCapture(PhotonPlayer m_actor)
    {
        m_CarryingPlayer   = null;
        transform.position = m_HomePosition;

        //Only the player who captures the flag, updates the properties
        if (PhotonNetwork.player == m_actor)
        {
            bl_EventHandler.KillEvent(PhotonNetwork.player.name, "", "Has capture Flag", (string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey], 777, 15);
            IncreaseScore();
        }
    }
Exemplo n.º 6
0
    public override bool CanBePickedUpBy(bl_CTFPlayerLogic logic)
    {
        //If the flag is at its home position, only the enemy team can grab it
        if (IsHome() == true)
            return logic.m_PlayerTeam != Team;

        //If another player is already carrying the flag, no one else can grab it
        if (m_CarryingPlayer != null)
            return false;

        return true;
    }
Exemplo n.º 7
0
 public override void OnPickup(bl_CTFPlayerLogic logic)
 {
     if (logic.m_PlayerTeam == Team)
     {
         if (IsHome() == false)
         {
             ReturnFlag();
         }
     }
     else
     {
         m_CarryingPlayer = logic;
     }
 }
Exemplo n.º 8
0
    public override bool CanBePickedUpBy(bl_CTFPlayerLogic logic)
    {
        //If the flag is at its home position, only the enemy team can grab it
        if (IsHome() == true)
        {
            return(logic.m_PlayerTeam != Team);
        }

        //If another player is already carrying the flag, no one else can grab it
        if (m_CarryingPlayer != null)
        {
            return(false);
        }

        return(true);
    }
Exemplo n.º 9
0
 void OnDrop(Vector3 position)
 {
     m_CarryingPlayer   = null;
     transform.position = position;
     m_ReturnTimer      = ReturnTime;
 }
Exemplo n.º 10
0
 void OnDrop(Vector3 position)
 {
     m_CarryingPlayer = null;
     transform.position = position;
     m_ReturnTimer = ReturnTime;
 }
Exemplo n.º 11
0
 public abstract void OnPickup(bl_CTFPlayerLogic logic);
Exemplo n.º 12
0
 public abstract void OnPickup(bl_CTFPlayerLogic logic);
Exemplo n.º 13
0
 public abstract bool CanBePickedUpBy(bl_CTFPlayerLogic logic);
Exemplo n.º 14
0
 void PickupObject(bl_CTFPlayerLogic logic)
 {
     PhotonView.RPC("OnPickup", PhotonTargets.AllBuffered, PhotonNetwork.player, logic.photonView.viewID);
 }
Exemplo n.º 15
0
 void PickupObject(bl_CTFPlayerLogic logic)
 {
     PhotonView.RPC("OnPickup", PhotonTargets.AllBuffered, PhotonNetwork.player,logic.photonView.viewID );
 }
Exemplo n.º 16
0
    void OnCapture(PhotonPlayer m_actor)
    {
        m_CarryingPlayer = null;
        transform.position = m_HomePosition;

        //Only the player who captures the flag, updates the properties
        if (PhotonNetwork.player == m_actor)
        {
            bl_EventHandler.KillEvent(PhotonNetwork.player.name, "", "Has capture Flag", (string)PhotonNetwork.player.customProperties[PropiertiesKeys.TeamKey], 777, 15);
            IncreaseScore();
        }
    }
Exemplo n.º 17
0
 public abstract bool CanBePickedUpBy(bl_CTFPlayerLogic logic);