Example #1
0
    void MatchStarted(NetworkMessage netMsg)
    {
        respawnTimer.Stop();
        //keyMenu.restart();
        timeLeft = nm.getConfiguration().timeLimit;
        NetVect3PArray a = netMsg.ReadMessage <NetVect3PArray>();

        player.GetComponent <PController>().setImmune(false);
        for (int i = 0; i < a.array.Length; i++)
        {
            if (a.array[i].id == id)
            {
                player.GetComponent <PController>().initialize();
                player.transform.position = a.array[i].vect3;
                regenerateMaterie();
            }
            else
            {
                try{
                    players[a.array[i].id].GetComponent <enemy>().setImmune(false);
                    players[a.array[i].id].GetComponent <enemy>().setCorrection(Vector3.zero);
                    players[a.array[i].id].transform.position = a.array[i].vect3;
                }
                catch {
                    Debug.Log("User disconnected in the meantime!");
                }
            }
        }
    }
            public void Respawn(int seconds)
            {                   // countdown
                RespawnSeconds = seconds;

                if (m_RespawnTimer != null && m_RespawnTimer.Running)
                {
                    m_RespawnTimer.Stop();
                    m_RespawnTimer.Eat = true;
                }

                m_RespawnTimer = new RespawnTimer(TimeSpan.FromSeconds(5), this, TimeSpan.FromSeconds(1));
                m_RespawnTimer.Start();
            }
Example #3
0
        protected virtual void OnRespawnTimerTick(object sender, EventArgs e)
        {
            RespawnFrame += 64;
            if (RespawnFrame == 896)
            {
                RespawnFrame = 0;
                RespawnTimer.Stop();

                MoveTimer.Start();

                ImmortalDelay = 4000;
                Immortal      = true;
            }
            GUIForm.Invalidate(Rect);
        }
Example #4
0
        private void PauseButtonBox_Click(object sender, EventArgs e)
        {
            TimeSpan timer2span = DateTime.Now - Timer2Runtime;
            TimeSpan timer3span = DateTime.Now - Timer3Runtime;

            Timer2SpanTime += Convert.ToInt32(timer2span.TotalMilliseconds);
            Timer3SpanTime += Convert.ToInt32(timer3span.TotalMilliseconds);

            timer2.Stop();
            timer3.Stop();
            SkillTimer1.Stop();
            SkillTimer2.Stop();
            SkillTimer3.Stop();
            SkillTimer4.Stop();
            HpTimer.Stop();
            RespawnTimer.Stop();

            RunningState           = false;
            PauseButtonBox.Enabled = false;
            Playbuttonbox.Enabled  = true;
        }