Exemplo n.º 1
0
 private void PlaySkullLaughing(TypeOfDeath typeOfDeath)
 {
     if (typeOfDeath.Equals(TypeOfDeath.Bullet))
     {
         Play(SkullLaughing);
     }
 }
Exemplo n.º 2
0
 private void StopHeartBeat(TypeOfDeath _)
 {
     if (PlayingHeartbeat)
     {
         HeartBeatAudioSource.Stop();
         PlayingHeartbeat = false;
     }
 }
Exemplo n.º 3
0
    public static void PlayerDied(int bulletOwnerID, TypeOfDeath typeOfDeath)
    {
        //TODO: 9000 Implement so see kill score and etc... so send who killed who
        Packet packet = new Packet((int)ClientPackets.playerDied);

        packet.Write(bulletOwnerID);
        packet.Write((int)typeOfDeath);
        SendTCPPacket(packet);
    }
Exemplo n.º 4
0
    public static void PlayerDied(byte bulletOwnerID, TypeOfDeath typeOfDeath)
    {
        using (Packet packet = new Packet((byte)ClientPackets.playerDied))
        {
            packet.Write(bulletOwnerID);
            packet.Write((byte)typeOfDeath);

            SendTCPPacket(packet);
        }
    }
Exemplo n.º 5
0
 public void PlayDied(TypeOfDeath typeOfDeath)
 {
     if (typeOfDeath == TypeOfDeath.Bullet)
     {
         Play(DieBullet);
     }
     else if (typeOfDeath == TypeOfDeath.Fall)
     {
         Play(DieFall);
     }
 }
Exemplo n.º 6
0
 public void PlayDeath(TypeOfDeath death)
 {
     _transitionDone = false;
     _death          = death;
     if (death.Equals(TypeOfDeath.Ghost))
     {
         _audioManager.PlaySound(sound_path_ghost, 0.6f, 0.0f, 0.0f);
     }
     if (death.Equals(TypeOfDeath.Train))
     {
         _audioManager.PlaySound(sound_path_train_passes, 0.6f, 0.0f, 0.0f);
     }
     BoostHeartbeat(0.4f);
 }
Exemplo n.º 7
0
    public static void PlayerDied(Packet packet)
    {
        int         playerKilledID = packet.ReadInt();
        int         bulletOwnerID  = packet.ReadInt();
        TypeOfDeath typeOfDeath    = (TypeOfDeath)packet.ReadInt();

        KillFeedUI.Instance.AddKillFeedEntry(playerKilledID, bulletOwnerID);
        if (playerKilledID != bulletOwnerID)
        {
            ScoreboardManager.Instance.AddKill(bulletOwnerID);
        }
        ScoreboardManager.Instance.AddDeath(playerKilledID);
        GameManager.PlayerDictionary[playerKilledID].PlayerDied(typeOfDeath);
    }
Exemplo n.º 8
0
 public AmbianceManager()
 {
     _heartbeat = 1.0f;
     _currentZone = AmbianceZone.Outside;
     _nextZone = _currentZone;
     _switching = false;
     _audioManager = YnG.AudioManager;
     _currentPace = HB_pace.speed1;
     _guideSound = GuideSound.None;
     _lastTick = 0;
     _lastGuide = 0;
     _death = TypeOfDeath.None;
     _transitionDone = false;
     _muteHeart = false;
     PlayAmbianceMusic();
     PlayHeartbeat();
 }
Exemplo n.º 9
0
 public AmbianceManager()
 {
     _heartbeat      = 1.0f;
     _currentZone    = AmbianceZone.Outside;
     _nextZone       = _currentZone;
     _switching      = false;
     _audioManager   = YnG.AudioManager;
     _currentPace    = HB_pace.speed1;
     _guideSound     = GuideSound.None;
     _lastTick       = 0;
     _lastGuide      = 0;
     _death          = TypeOfDeath.None;
     _transitionDone = false;
     _muteHeart      = false;
     PlayAmbianceMusic();
     PlayHeartbeat();
 }
Exemplo n.º 10
0
 public static void PlayerDied(Packet packet)
 {
     try
     {
         byte        playerKilledID = packet.ReadByte();
         byte        bulletOwnerID  = packet.ReadByte();
         TypeOfDeath typeOfDeath    = (TypeOfDeath)packet.ReadByte();
         KillFeedUI.Instance.AddKillFeedEntry(playerKilledID, bulletOwnerID);
         if (playerKilledID != bulletOwnerID)
         {
             ScoreboardManager.Instance.AddKill(bulletOwnerID);
         }
         ScoreboardManager.Instance.AddDeath(playerKilledID);
         GameManager.PlayerDictionary[playerKilledID].PlayerDied(typeOfDeath);
     }
     catch (Exception e) {
         OutputPacketError(e);
     }
 }
Exemplo n.º 11
0
        public void Update(GameTime gameTime)
        {
            if (!_death.Equals(TypeOfDeath.None))
            {
                if (gameTime.TotalGameTime.TotalMilliseconds - _transitionTimer > 5 * 1000)
                {
                    _transitionDone = true;
                    _death          = TypeOfDeath.None;
                }

                if (gameTime.TotalGameTime.TotalMilliseconds - _lastTick > _heartbeat * 1000)
                {
                    _lastTick = gameTime.TotalGameTime.TotalMilliseconds;
                    if (!_muteHeart)
                    {
                        PlayHeartbeat();
                    }
                }
            }
            else
            {
                _transitionTimer = gameTime.TotalGameTime.TotalMilliseconds;
                if (_guideSound.Equals(GuideSound.None))
                {
                    _lastGuide = gameTime.TotalGameTime.TotalMilliseconds;
                }
                else if (gameTime.TotalGameTime.TotalMilliseconds - _lastGuide > 20 * 1000)
                {
                    _lastGuide = gameTime.TotalGameTime.TotalMilliseconds;
                    PlayGuide();
                }

                if (gameTime.TotalGameTime.TotalMilliseconds - _lastTick > _heartbeat * 1000)
                {
                    _lastTick = gameTime.TotalGameTime.TotalMilliseconds;
                    if (_heartbeat < 0.4f)
                    {
                        _heartbeat = 0.4f;
                    }
                    if (_heartbeat < 0.8f)
                    {
                        _heartbeat += 0.01f;
                    }
                    HB_pace newPace = GetPace();
                    if (_currentPace.Equals(newPace))
                    {
                        _currentPace = newPace;
                    }
                    if (!_muteHeart)
                    {
                        PlayHeartbeat();
                    }
                }
                if (_switching)
                {
                    if (!_nextZone.Equals(_currentZone))
                    {
                        if (_audioManager.MusicVolume > 0f)
                        {
                            _audioManager.MusicVolume -= 0.01f;
                        }
                        if (_audioManager.MusicVolume == 0f)
                        {
                            _currentZone = _nextZone;
                            PlayAmbianceMusic();
                        }
                    }
                    else
                    {
                        float max_volume = 0.5f;
                        if (_currentZone.Equals(AmbianceZone.Stairs) || _currentZone.Equals(AmbianceZone.Room))
                        {
                            max_volume = 0.4f;
                        }
                        if (_audioManager.MusicVolume < max_volume)
                        {
                            _audioManager.MusicVolume += 0.01f;
                        }
                        if (_audioManager.MusicVolume == max_volume)
                        {
                            _switching = false;
                        }
                    }
                }
            }
        }
Exemplo n.º 12
0
        public void Update(GameTime gameTime)
        {
            if (!_death.Equals(TypeOfDeath.None))
            {
                if (gameTime.TotalGameTime.TotalMilliseconds - _transitionTimer > 5 * 1000)
                {
                    _transitionDone = true;
                    _death = TypeOfDeath.None;
                }

                if (gameTime.TotalGameTime.TotalMilliseconds - _lastTick > _heartbeat * 1000)
                {
                    _lastTick = gameTime.TotalGameTime.TotalMilliseconds;
                    if (!_muteHeart) { PlayHeartbeat(); }
                }
            }
            else
            {
                _transitionTimer = gameTime.TotalGameTime.TotalMilliseconds;
                if (_guideSound.Equals(GuideSound.None))
                {
                    _lastGuide = gameTime.TotalGameTime.TotalMilliseconds;
                }
                else if (gameTime.TotalGameTime.TotalMilliseconds - _lastGuide > 20 * 1000)
                {
                    _lastGuide = gameTime.TotalGameTime.TotalMilliseconds;
                    PlayGuide();
                }

                if (gameTime.TotalGameTime.TotalMilliseconds - _lastTick > _heartbeat * 1000)
                {
                    _lastTick = gameTime.TotalGameTime.TotalMilliseconds;
                    if (_heartbeat < 0.4f)
                    {
                        _heartbeat = 0.4f;
                    }
                    if (_heartbeat < 0.8f)
                    {
                        _heartbeat += 0.01f;
                    }
                    HB_pace newPace = GetPace();
                    if (_currentPace.Equals(newPace))
                    {
                        _currentPace = newPace;
                    }
                    if (!_muteHeart) { PlayHeartbeat(); }

                }
                if (_switching)
                {
                    if (!_nextZone.Equals(_currentZone))
                    {
                        if (_audioManager.MusicVolume > 0f)
                        {
                            _audioManager.MusicVolume -= 0.01f;
                        }
                        if (_audioManager.MusicVolume == 0f)
                        {
                            _currentZone = _nextZone;
                            PlayAmbianceMusic();
                        }
                    }
                    else
                    {
                        float max_volume = 0.5f;
                        if (_currentZone.Equals(AmbianceZone.Stairs) || _currentZone.Equals(AmbianceZone.Room)) { max_volume = 0.4f; }
                        if (_audioManager.MusicVolume < max_volume)
                        {
                            _audioManager.MusicVolume += 0.01f;
                        }
                        if (_audioManager.MusicVolume == max_volume)
                        {
                            _switching = false;
                        }
                    }
                }
            }
        }
Exemplo n.º 13
0
 public void PlayDeath(TypeOfDeath death)
 {
     _transitionDone = false;
     _death = death;
     if (death.Equals(TypeOfDeath.Ghost))
     {
         _audioManager.PlaySound(sound_path_ghost, 0.6f, 0.0f, 0.0f);
     }
     if (death.Equals(TypeOfDeath.Train))
     {
         _audioManager.PlaySound(sound_path_train_passes, 0.6f, 0.0f, 0.0f);
     }
     BoostHeartbeat(0.4f);
 }
 private void PlayerCantMoveAndCantBeHit(TypeOfDeath typeOfDeath)
 {
     Hitbox.enabled = false;
     FreezeMotion();
 }
 public virtual void DieAnimation(TypeOfDeath typeOfDeath)
 {
     Anim.SetTrigger("Die");
 }
Exemplo n.º 16
0
 public void PlayerDied(TypeOfDeath typeOfDeath) =>
 OnPlayerDeath?.Invoke(typeOfDeath);
Exemplo n.º 17
0
 public void Disable(TypeOfDeath typeOfDeath) =>
 CanShootAndAim = false;
Exemplo n.º 18
0
 public void PlayerDied(int playerKilledDiedID, int bulletOwnerID, TypeOfDeath typeOfDeath)
 {
     ClientSend.PlayerDied(bulletOwnerID, typeOfDeath);
     PlayerDictionary[playerKilledDiedID].PlayerDied(typeOfDeath);
     KillFeedUI.Instance.AddKillFeedEntry(playerKilledDiedID, bulletOwnerID);
 }