Beispiel #1
0
        public void Update(float deltaTime)
        {
            UpdateProjSpecific(deltaTime);

            if (LinearVelocity.X > 500.0f)
            {
                //DebugConsole.ThrowError("CHARACTER EXPLODED");
                body.ResetDynamics();
                body.SetTransform(character.SimPosition, 0.0f);
            }

            if (inWater)
            {
                body.ApplyWaterForces();
            }

            if (isSevered)
            {
                severedFadeOutTimer += deltaTime;
                if (severedFadeOutTimer > SeveredFadeOutTime)
                {
                    body.Enabled = false;
                }
            }

            if (character.IsDead)
            {
                return;
            }

            SoundTimer -= deltaTime;
        }
Beispiel #2
0
        public void Update(float deltaTime)
        {
            UpdateProjSpecific(deltaTime);

            if (inWater)
            {
                body.ApplyWaterForces();
            }

            if (isSevered)
            {
                severedFadeOutTimer += deltaTime;
                if (severedFadeOutTimer >= SeveredFadeOutTime)
                {
                    body.Enabled = false;
                }
                else if (character.CurrentHull == null && Hull.FindHull(WorldPosition) != null)
                {
                    severedFadeOutTimer = SeveredFadeOutTime;
                }
            }

            if (attack != null)
            {
                attack.UpdateCoolDown(deltaTime);
            }
        }
Beispiel #3
0
        public void Update(float deltaTime)
        {
            if (LightSource != null)
            {
                LightSource.ParentSub = body.Submarine;
            }

            if (!character.IsDead)
            {
                damage = Math.Max(0.0f, damage - deltaTime * 0.1f);
            }

            if (burnt > 0.0f)
            {
                Burnt -= deltaTime;
            }

            if (LinearVelocity.X > 500.0f)
            {
                //DebugConsole.ThrowError("CHARACTER EXPLODED");
                body.ResetDynamics();
                body.SetTransform(character.SimPosition, 0.0f);
            }

            if (inWater)
            {
                body.ApplyWaterForces();
            }

            if (character.IsDead)
            {
                return;
            }

            soundTimer -= deltaTime;

            //if (MathUtils.RandomFloat(0.0f, 1000.0f) < Bleeding)
            //{
            //    Game1.particleManager.CreateParticle(
            //        !inWater ? "blood" : "waterblood",
            //        SimPosition, Vector2.Zero);
            //}
        }
Beispiel #4
0
        public void Update(float deltaTime)
        {
            UpdateProjSpecific(deltaTime);

            if (inWater)
            {
                body.ApplyWaterForces();
            }

            if (isSevered)
            {
                severedFadeOutTimer += deltaTime;
                if (severedFadeOutTimer > SeveredFadeOutTime)
                {
                    body.Enabled = false;
                }
            }

            if (attack != null)
            {
                attack.UpdateCoolDown(deltaTime);
            }
        }