Ejemplo n.º 1
0
        private void entity_HealthChanged(object sender, EntityHealthChangeEventArgs e)
        {
            //Play "Hurt" sound only if not local player, for local player it will be handled by the playercharachter class
            if (e.Change < -2 && !IsLocalPlayer(e.ImpactedEntity.DynamicId))
            {
                _soundEngine.StartPlay3D("Hurt", 1.0f, e.ImpactedEntity.Position.AsVector3());
            }

            //Start Bleeding if needed !
            if (e.Change < 2)
            {
                //Damage received !
                _utopiaParticuleEngine.AddDynamicEntityParticules(e.HealthChangeHitLocation, e.HealthChangeHitLocationNormal, UtopiaParticuleEngine.DynamicEntityParticuleType.Blood);
            }
        }
        void _playerCharacter_HealthChanged(object sender, Shared.Entities.Events.EntityHealthChangeEventArgs e)
        {
            if (e.Change < -2)
            {
                //Only if first person mode !
                if (_cameraManager.ActiveCamera.CameraType == S33M3CoreComponents.Cameras.CameraType.FirstPerson)
                {
                    //Damage indicator in case of First Person damage received
                    UtopiaParticuleEngine.AddDynamicEntityParticules(_cameraManager.ActiveCamera.WorldPosition.Value, _entityRotations.LookAt, UtopiaParticuleEngine.DynamicEntityParticuleType.Blood);
                }

                if (e.Change < -20)
                {
                    _soundEngine.StartPlay2D("Hurt", 1.0f);
                }
                else
                {
                    _soundEngine.StartPlay2D("Hurt", 0.3f);
                }
            }
        }