protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);

            Translation = MotionObject.InterpolatedPosition;
            Rotation = MotionObject.InterpolatedRotation;
        }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            if (Renderer != null)
            {
                bars[0].Text = "AlphaObjects: " + ((Renderer.Renderer)Renderer).GetNumberOfAlphaObjects();
                bars[0].MaxValue = 1000;
                bars[0].Value = ((Renderer.Renderer)Renderer).GetNumberOfAlphaObjects();

                bars[1].Text = "OldSplatObjects: " + ((Renderer.Renderer)Renderer).GetNumberOfOldSplatObjects(); ;
                bars[1].MaxValue = 1000;
                bars[1].Value = ((Renderer.Renderer)Renderer).GetNumberOfOldSplatObjects();

                bars[2].Text = "NewSplatObjects: " + ((Renderer.Renderer)Renderer).GetNumberOfNewSplatObjects(); ;
                bars[2].MaxValue = 1000;
                bars[2].Value = ((Renderer.Renderer)Renderer).GetNumberOfNewSplatObjects();

                bars[3].Text = "SkinnedMeshObjects: " + ((Renderer.Renderer)Renderer).GetNumberOfSkinnedMeshObjects();
                bars[3].MaxValue = 1000;
                bars[3].Value = ((Renderer.Renderer)Renderer).GetNumberOfSkinnedMeshObjects();

                bars[4].Text = "XMeshes: " + ((Renderer.Renderer)Renderer).GetNumberOfXMeshes();
                bars[4].MaxValue = 1000;
                bars[4].Value = ((Renderer.Renderer)Renderer).GetNumberOfXMeshes();
            }
        }
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);
            var s = yInterpolator.Update(e.Dtime);

            Position = new Vector2(0, s);
        }
Exemplo n.º 4
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime;
     if (acc >= 0.4f)
     {
         Remove();
     }
 }
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime;
     float p = acc / duration;
     float a = (float)Common.Math.AngleFromVector3XY(dir);
     a -= (float)Math.Sin(p * Math.PI * 2) * angle;
     SetEffectsDir(Common.Math.Vector3FromAngleXY(a));
 }
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime;
     float p = (acc - fadeDur) / Duration;
     ((MetaModel)MainGraphic).Opacity = 1 - Math.Max(0, p);
     if (acc > Duration)
         Remove();
 }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);

            Translation = MotionObject.InterpolatedPosition;
            if (MotionObject is Common.Motion.Unit)
                Rotation = ((Common.Motion.Unit)MotionObject).InterpolatedRotation;
            else
                Rotation = MotionObject.Rotation;
        }
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);
            float a = alphaInterpolator.Update(e.Dtime);

            foreach (Graphics.Content.Graphic g in AllGraphics)
            {
                g.Alpha = a;
            }
        }
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     if (IsRemoved)
     {
         return;
     }
     alpha.Update(e.Dtime);
     Invalidate();
 }
Exemplo n.º 10
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime;
     if (acc >= 0.03f && base.Text.Length != fullText.Length)
     {
         base.Text = fullText.Substring(0, t++);
         acc      -= 0.03f;
     }
 }
Exemplo n.º 11
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     Position  = Common.Math.ToVector2(Game.Instance.Scene.Camera.Project(WorldPosition, Scene.Viewport));
     accTime  += e.Dtime;
     Position -= Vector2.UnitY * accTime * ScrollSpeed;
     Timeout  -= e.Dtime;
     if (Timeout <= 0)
     {
         Remove();
     }
 }
Exemplo n.º 12
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     if (IsRemoved)
     {
         return;
     }
     acc += e.Dtime;
     if (acc >= Duration)
     {
         Remove();
     }
 }
Exemplo n.º 13
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     timeAcc += e.Dtime;
     if (timeAcc > 10)
     {
         dps        = damageAcc / timeAcc;
         ragePerSec = rageAcc / timeAcc;
         timeAcc    = 0;
         damageAcc  = 0;
         Text       = "DPS: " + dps + "\nRagePS: " + ragePerSec;
     }
 }
Exemplo n.º 14
0
        void overall_Update(object sender, Graphics.UpdateEventArgs e)
        {
            if (((DropDownItem <VideoQualities>)overall.SelectedItem) == null)
            {
                return;
            }
            var videoQuality = ((DropDownItem <VideoQualities>)overall.SelectedItem).Value;

            if (PreviousOverallVideoQuality != videoQuality)
            {
                UpdateOverallSettings();
                PreviousOverallVideoQuality = videoQuality;
            }

            if (videoQuality != VideoQualities.Custom)
            {
                var aq = animation.SelectedItem as DropDownItem <Graphics.Renderer.Settings.AnimationQualities>;
                var lq = lightingQuality.SelectedItem as DropDownItem <Graphics.Renderer.Settings.LightingQualities>;
                var sq = shadowQuality.SelectedItem as DropDownItem <Graphics.Renderer.Settings.ShadowQualities>;
                var tq = terrainQuality.SelectedItem as DropDownItem <Graphics.Renderer.Settings.TerrainQualities>;

                if (aq != null && aq.Value != SettingProfiles.GetAnimationQuality(videoQuality))
                {
                    overall.SelectedItem = new DropDownItem <VideoQualities>(VideoQualities.Custom);
                }
                else if (lq != null && lq.Value != SettingProfiles.GetLightingQuality(videoQuality))
                {
                    overall.SelectedItem = new DropDownItem <VideoQualities>(VideoQualities.Custom);
                }
                else if (sq != null && sq.Value != SettingProfiles.GetShadowQuality(videoQuality))
                {
                    overall.SelectedItem = new DropDownItem <VideoQualities>(VideoQualities.Custom);
                }
                else if (tq != null && tq.Value != SettingProfiles.GetTerrainQuality(videoQuality))
                {
                    overall.SelectedItem = new DropDownItem <VideoQualities>(VideoQualities.Custom);
                }
            }

            accTime += e.Dtime;
            if (tic < accTime)
            {
                UpdateOverallSettings();
                if (((DropDownItem <VideoQualities>)overall.SelectedItem).Value == VideoQualities.Low)
                {
                    shadowQuality.SelectedItem = new DropDownItem <Graphics.Renderer.Settings.ShadowQualities>(Graphics.Renderer.Settings.ShadowQualities.NoShadows);
                }
                accTime = 0;
            }
        }
Exemplo n.º 15
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (invalidatedAnimation)
            {
                OnUpdateAnimation();
                invalidatedAnimation = false;
            }

            DamageLastFrame            = 0;
            currentScrollingCombatText = null;
            UpdateHeadOverBar();
        }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (Expires)
            {
                TimeToLive -= e.Dtime;
                if (TimeToLive <= 0)
                    Remove();
            }

            if (MotionObject is Common.Motion.Projectile)
            {
                Translation = ((Common.Motion.Projectile)MotionObject).InterpolatedPosition;
                Rotation = Quaternion.RotationAxis(Vector3.UnitZ, MotionObject.Rotation.Angle + (float)Math.PI / 2f);
            }
            else if (MotionObject is Common.Motion.Unit)
            {
                var umo = (Common.Motion.Unit)MotionObject;

                Translation = umo.InterpolatedPosition;
                //Rotation = Quaternion.RotationAxis(Vector3.UnitZ,
                //    (float)System.Math.Atan2(umo.Velocity.Y, umo.Velocity.X) + (float)System.Math.PI / 2f);
                Rotation = Quaternion.RotationAxis(Vector3.UnitZ, umo.Rotation.Angle + (float)Math.PI / 2f);

                //if (umo.Velocity.Z != 0)
                //{
                //    if (Animation != "jump1")
                //    {
                //        if (umo.Velocity.Z > 0)
                //            PlayAnimation("jump1", 1, false, 0);
                //        else
                //            PlayAnimation("jump1", 1, false, 0);
                //    }
                //}
                //else if (umo.Velocity.Length() > 0)
                //{
                //    if (Animation != "run1")
                //        PlayAnimation("run1", umo.Velocity.Length(), true, 0);
                //}
                //else
                //{
                //    if (Animation != "idle1")
                //        PlayAnimation("idle1", 1, true, 0);
                //}
            }
            else if (MotionObject != null)
                Translation = MotionObject.Position;
        }
Exemplo n.º 17
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     foreach (var v in profilers)
     {
         if (Program.Settings.DisplayProfilers == ProfilersDisplayMode.PercTotal)
         {
             v.Second.Value    = ((int)(100 * v.First.PercTotal)) * 0.01f;
             v.Second.MaxValue = 1;
             v.Second.Text     = v.First.Name + " " + (int)(100 * v.First.PercTotal) + "%";
         }
         else if (Program.Settings.DisplayProfilers == ProfilersDisplayMode.PercParent)
         {
             v.Second.Value    = ((int)(100 * v.First.PercParent)) * 0.01f;
             v.Second.MaxValue = 1;
             v.Second.Text     = v.First.Name + " " + (int)(100 * v.First.PercParent) + "%";
         }
         else
         {
             v.Second.Value    = ((int)(100 * v.First.TimePerFrame)) * 0.01f;
             v.Second.MaxValue = 40;
             v.Second.Text     = v.First.Name + " " + v.First.TimePerFrame.ToString("0.##") + " ms";
         }
         String tooltip = "";
         tooltip += v.First.TimePerFrame.ToString("0.##") + " ms\n\n";
         if (v.First.Children.Count > 0)
         {
             tooltip += "Unaccounted time: " +
                        ((int)(100 * v.First.TimeUnaccountedPerc)) + "% " +
                        v.First.TimeUnaccounted.ToString("0.##") + " ms " +
                        "\n";
         }
         if (v.First.Parent != null)
         {
             tooltip +=
                 "Parent: " + (int)(100 * v.First.PercParent) + "%\n" +
                 "Total: " + (int)(100 * v.First.PercTotal) + "%\n" +
                 "CallsPerFrame: " + v.First.CallsPerFrame + "\n" +
                 "CallsPerParent: " + v.First.CallsPerParent;
         }
         Program.Instance.Tooltip.SetToolTip(v.Second, tooltip);
     }
 }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (MotionObject != null)
                Translation = MotionObject.Position;

            if (MotionObject is Common.Motion.Unit)
            {
                var umo = (Common.Motion.Unit)MotionObject;

                Rotation = Quaternion.RotationAxis(Vector3.UnitZ,
                    (float)System.Math.Atan2(umo.Velocity.Y, umo.Velocity.X) + (float)System.Math.PI / 2f);

                //if (umo.Velocity.Z != 0)
                //{
                //    if (Animation != "jump1")
                //    {
                //        if (umo.Velocity.Z > 0)
                //            PlayAnimation("jump1", 1, false, 0);
                //        else
                //            PlayAnimation("jump1", 1, false, 0);
                //    }
                //}
                //else if (umo.Velocity.Length() > 0)
                //{
                //    if (Animation != "run1")
                //        PlayAnimation("run1", umo.Velocity.Length(), true, 0);
                //}
                //else
                //{
                //    if (Animation != "idle1")
                //        PlayAnimation("idle1", 1, true, 0);
                //}
            }
        }
Exemplo n.º 19
0
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            if (DesignMode) return;

            Translation = MotionObject.InterpolatedPosition;
            Rotation = MotionObject.InterpolatedRotation;

            timeToLive -= e.Dtime;
            if (timeToLive <= 0)
                OnTimeout();
        }
            protected override void OnUpdate(UpdateEventArgs e)
            {
                base.OnUpdate(e);
                if (isDropping)
                {
                    dropInitAcc += e.Dtime;
                    if (dropInitAcc >= 0.3f)
                    {
                        dropAcc += e.Dtime;
                        if (dropAcc > dropSettings.DropPeriod)
                        {
                            dropAcc = 0;

                            TryDoDrop();
                        }
                    }
                }
            }
Exemplo n.º 21
0
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (burningSkull == null || IsRemoved) return;

            var ea = Scene.View.Content.Peek<global::Graphics.Renderer.Renderer.EntityAnimation>(MetaEntityAnimation);
            ea.AnimationController.AdvanceTime(0, null);
            var sm = Scene.View.Content.Peek<global::Graphics.Content.SkinnedMesh>(((MetaModel)MainGraphic).SkinnedMesh);
            sm.UpdateFrameMatrices(sm.RootFrame, ((MetaModel)MainGraphic).World * WorldMatrix);
            foreach(var s in sm.MeshContainers)
                if (s.First.Name == "skull")
                {
                    burningSkull.Translation = Common.Math.Position(s.First.CombinedTransform);
                    break;
                }
        }
Exemplo n.º 22
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (fpsTextBox != null)
            {
                string fpsText = Scene.View.FPS + " fps";
                if (Program.Settings.MotionSettings.UseMultiThreadedPhysics &&
                    !Program.Settings.MotionSettings.UseDummyMotion &&
                    Game.Instance.Mechanics != null)
                {
                    physicsBusy = physicsBusy * 0.99f + ((Common.Motion.ThreadSimulationProxy)Game.Instance.Mechanics.MotionSimulation).ThreadedBusyPerc * 0.01f;
                    fpsText    += "\nPhys.: " +
                                  (int)(100 * physicsBusy) + "%";
                }
                if (Program.Settings.FixedFrameStep)
                {
                    fpsText += "\nMain:" + (int)(100 * Program.Instance.FixedFrameStepActivity) + "%";
                }
                fpsTextBox.Text = fpsText;
                String fpsTooltip = "";
                if (cpuCounter != null)
                {
                    cpuUsage    = cpuUsage * 0.99f + cpuCounter.NextValue() * 0.01f;
                    fpsTooltip += "CPU Usage: " + cpuUsage + "%\n";
                }
                if (Game.Instance.Map != null)
                {
                    fpsTooltip += "Character position: " + Game.Instance.Map.MainCharacter.Translation + "\n";
                    fpsTooltip += "Camera lookat: " +
                                  ((global::Graphics.LookatCamera)Game.Instance.Scene.Camera).Lookat + "\n";
                }
                fpsTooltip += "Text mem free: " + Scene.View.Device9.AvailableTextureMemory + "\n";
                fpsTooltip += "Entites: " + Game.Instance.Scene.Count + "\n";
                fpsTooltip += "InterfaceEntities: " + Program.Instance.InterfaceScene.Count + "\n";
                fpsTooltip += "DirectXObjects: " + ObjectTable.Objects.Count;
                //if (Program.Settings.EnableSound)
                //{
                //    fpsTooltip += "\nSound: " + Program.Instance.SoundManager.GetPerformanceString();
                //}
                Program.Instance.Tooltip.SetToolTip(fpsTextBox, fpsTooltip);
                //fpsTextBox.Tooltip = "TrianglesPerFrame: (" + renderer.TrianglesPerFrame + " + "
                //    + Program.Instance.InterfaceRenderer.TrianglesPerFrame + ") = " +
                //    (renderer.TrianglesPerFrame + Program.Instance.InterfaceRenderer.TrianglesPerFrame);
            }
            profilersResults.Visible = Program.Settings.DisplayProfilers != ProfilersDisplayMode.None;
            if (Program.Settings.DisplayInputHierarchy)
            {
                if (inputHierarchyTextBox.IsRemoved)
                {
                    AddChild(inputHierarchyTextBox);
                }
                inputHierarchyTextBox.Text = Program.Instance.InputHandler.GetInputHierarchyDescription();
            }
            else
            {
                if (!inputHierarchyTextBox.IsRemoved)
                {
                    inputHierarchyTextBox.Remove();
                }
            }

            if (Program.Settings.DisplayActiveActions && Game.Instance.Mechanics != null)
            {
                if (activeActionsTextBox.IsRemoved)
                {
                    AddChild(activeActionsTextBox);
                }
                activeActionsTextBox.Text = Game.Instance.Mechanics.ActiveScriptsToString();
            }
            else
            {
                if (!activeActionsTextBox.IsRemoved)
                {
                    activeActionsTextBox.Remove();
                }
            }

            dpsMeter.Visible = Program.Settings.DisplayDPS && Game.Instance.Map != null;

            if (silverText != null)
            {
                silverText.SilverYield = Game.Instance.SilverYield;
                silverText.Visible     = Program.Settings.SilverEnabled;
                if (Game.Instance.Map != null && Game.Instance.Map.Settings.MapType != Client.Game.Map.MapType.Normal)
                {
                    silverText.Remove();
                    silverText = null;
                }
            }
        }
Exemplo n.º 23
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     stageCompleted.Position = new Vector2(0, completedYInterpolator.Update(e.Dtime));
 }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            UpdateMouse();

            foreach (var v in new List<Entity>(updateables))
                if (!v.IsRemoved)
                    v.ProcessMessage(MessageType.Update, e);
        }
Exemplo n.º 25
0
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            ((MetaModel)MainGraphic).World = Matrix.Translation(Vector3.UnitZ * Height);

            //if (!IsInGame) return;
            //velocity += new Vector3(
            //    (float)(rand.NextDouble() * 2 - 1),
            //    (float)(rand.NextDouble() * 2 - 1),
            //    0) * e.Dtime * 0.3f;
            //if (velocity.Length() > 1)
            //    velocity = Vector3.Normalize(velocity);
            //offset += velocity * MovementSpeed * e.Dtime;
            //if (offset.Length() > MaxDistance)
            //    offset = Vector3.Normalize(offset) * MaxDistance;
            //rotation += e.Dtime;
            //Orientation = rotation / 40.0f;
            //Translation = startingPosition + offset;
        }
Exemplo n.º 26
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     if (Game.Instance != null)
     {
         if (Game.Instance.GameState != GameState.Playing)
         {
             if (piranhaSwimmingChannel != null)
             {
                 piranhaSwimmingChannel.Stop();
                 piranhaSwimmingChannel = null;
             }
         }
     }
     base.OnUpdate(e);
     if (DesignMode) return;
     UpdateHUDStats();
 }
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     Vector4 d = Vector2.Transform(Common.Math.ToVector2(Drun), Matrix.RotationZ(Zrot)) * e.Dtime * Speed;
     float pz = zfunc(Camera.Lookat.X, Camera.Lookat.Y);
     Camera.Lookat += new Vector3(d.X, d.Y, Drun.Z * e.Dtime * Speed);
     UpdateRot();
 }
Exemplo n.º 28
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     infectedOozing.Translation = Position + Vector3.UnitZ * 0.7f;
 }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            if (IsRemoved) return;

            Graphics.Renderer.Renderer.EntityAnimation ea;

            if(Scene.DesignMode)
                ea = Scene.View.Content.Peek<global::Graphics.Renderer.Renderer.EntityAnimation>(MetaEntityAnimation);
            else
                ea = Game.Instance.SceneRendererConnector.EntityAnimations[this];

            // Rotating the torso
            #if DEBUG_HARD
            if (float.IsNaN(TorsoDiffDir))
                throw new Exception("TorsoDiffDir: " + TorsoDiffDir);
            #endif
            float dir = TorsoDiffDir;
            #if DEBUG_HARD
            if (float.IsNaN(dir) || float.IsNaN(TorsoDiffDir))
                throw new Exception("dir: " + dir + ", TorsoDiffDir: " + TorsoDiffDir);
            #endif
            dir = Common.Math.Clamp(dir, -1, 1);
            dirSmooth = dirSmooth * 0.9f + dir * 0.1f;
            float lean = Common.Math.Clamp(TorsoLean*0.3f, -0.5f, 0.5f);
            #if DEBUG_HARD
            if (!float.IsNaN(lean) && !float.IsNaN(dirSmooth))
            {
            #endif
                var mat = Matrix.RotationZ(lean) * Matrix.RotationX(dirSmooth);
                ea.FrameCustomValues["joint2"] = mat;
            #if DEBUG_HARD
                var d1 = mat.Determinant();
                if (d1 == float.NaN) throw new Exception("Rotation matrix contains NaN");
                if (mat.M12 == float.NaN) throw new Exception("Rotation matrix contains NaN");
                if (mat.M22 == float.NaN) throw new Exception("Rotation matrix contains NaN");
                if (mat.M32 == float.NaN) throw new Exception("Rotation matrix contains NaN");

                var d2 = ea.FrameCustomValues["joint2"].Determinant();
                if (d2 == float.NaN) throw new Exception("Rotation matrix contains NaN");
                if (ea.FrameCustomValues["joint2"].M12 == float.NaN) throw new Exception("Rotation matrix contains NaN");
                if (ea.FrameCustomValues["joint2"].M22 == float.NaN) throw new Exception("Rotation matrix contains NaN");
                if (ea.FrameCustomValues["joint2"].M32 == float.NaN) throw new Exception("Rotation matrix contains NaN");
            }
            else
                throw new Exception("DirSmooth: " + dirSmooth + " Lean: " + lean);
            #endif
            // Attaching weapon
            if (SelectedWeapon == 0 && !isSlamming)
            {
                var hand = ea.GetFrame("sword1");
                if (hand != null)
                {
                    MeleeWeaponModel.WorldMatrix = ea.FrameTransformation[hand];
                    RangedWeaponModel.WorldMatrix = Matrix.Scaling(0.001f, 0.001f, 0.001f);
                }
                //No idea why this line was ever written
                //ea.FrameCustomValues["joint32"] = Matrix.Identity;
            }
            else if (SelectedWeapon == 1 && !isSlamming)
            {
                var hand = ea.GetFrame("rifle");
                if (hand != null)
                {
                    RangedWeaponModel.WorldMatrix = ea.FrameTransformation[hand];
                    MeleeWeaponModel.WorldMatrix = Matrix.Scaling(0.001f, 0.001f, 0.001f);
                }
                //Matrix m = ea.FrameCustomValues["joint32"];
                //var joint32 = ea.GetFrame("joint32");
                //ea.FrameTransformation[joint32] = ea.FrameTransformation[joint32] * Matrix.RotationX(-2);
                //offset += e.Dtime;
                //ea.FrameCustomValues["joint32"] = Matrix.RotationZ(0.2f);
            }
            else if(!isSlamming)
            {
                throw new NotImplementedException();
            }

            if (HitPoints < MaxHitPoints * 0.2f && !wasLowHealth && State == UnitState.Alive)
            {
                lowHealthChannel = Program.Instance.SoundManager.GetSFX(Sound.SFX.LowHealthBeat1).Play(new Sound.PlayArgs { Looping = true });
                wasLowHealth = true;
            }
            else if (HitPoints >= MaxHitPoints * 0.2f && wasLowHealth)
            {
                lowHealthChannel.Stop();
                lowHealthChannel = null;
                wasLowHealth = false;
            }

            if (RageLevel >= 4)
            {
                var back = ea.GetFrame("joint3");

                RageWings.WorldMatrix = ea.FrameTransformation[back];
                //Matrix.RotationZ(-(float)Math.PI / 4f) *
                //var ea1 = Scene.View.Content.Peek<global::Graphics.Renderer.Renderer.EntityAnimation>(MetaEntityAnimation);

                //var leftHand = ea.GetFrame("joint9");
                //var righthand = ea.GetFrame("joint32");

                //rageEffectLeftHand.WorldMatrix = Matrix.Scaling(10, 10, 10) * rageEffectLeftHand.WorldMatrix * leftHand.CombinedTransform;
            }
        }
Exemplo n.º 30
0
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            demonSmoke1.Translation = Position + Vector3.UnitZ * 2.2f;
            //demonSmoke2.Translation = Position + Vector3.UnitZ * 2.2f;
            if (killed)
            {
                accTime += e.Dtime;

                if (accTime > 0.3f && !delayed)
                {
                    ((MetaModel)MainGraphic).Texture = new TextureFromFile("Models/Units/Demonlord2.png");
                    ((MetaModel)MainGraphic).ReceivesAmbientLight = global::Graphics.Content.Priority.Never;
                    ((MetaModel)MainGraphic).ReceivesDiffuseLight = global::Graphics.Content.Priority.Never;
                    ((MetaModel)MainGraphic).ReceivesSpecular = global::Graphics.Content.Priority.Never;
                    ((MetaModel)MainGraphic).ReceivesShadows = Graphics.Content.Priority.Never;
                    ((MetaModel)MainGraphic).CastShadows = Graphics.Content.Priority.Never;
                    delayed = true;
                }
                if (accTime > 0.6f && !delayed2)
                {
                     ((MetaModel)MainGraphic).Texture = new TextureFromFile("Models/Units/Demonlord3.png");
                     delayed2 = true;
                }
                if (accTime > 1.6f && !delayed3)
                {
                    Program.Instance.SoundManager.GetSFX(SFX.DemonLordDeath1).Play(new PlayArgs { Position = Translation, Velocity = Vector3.Zero });
                    delayed3 = true;
                }
                if (accTime > 5 && !isBlown)
                {
                    Game.Instance.Scene.Add(new Effects.ExpandingDarkness() { Translation = Translation + Vector3.UnitZ });
                    ((MetaModel)MainGraphic).Texture = new TextureFromFile("Models/Units/Demonlord4.png");
                    isBlown = true;
                }
                if (accTime > 6)
                {
                    //Game.Instance.Scene.Add(new Props.ShadowDecal { Translation = Translation + Vector3.UnitZ });
                    //Game.Instance.Scene.Add(new Effects.GroundBurn { Translation = Translation - Vector3.UnitZ * 0.8f });
                    Remove();
                }
            }
        }
Exemplo n.º 31
0
        protected override void OnUpdate(UpdateEventArgs e)
        {
            float dtime;
            if (Program.Settings.FixedFrameStep)
                dtime = Program.Settings.FixedFrameStepDTime * Program.Settings.SpeedMultiplier;
            else
                dtime = ((global::Graphics.UpdateEventArgs)e).Dtime * Program.Settings.SpeedMultiplier;

            e = new UpdateEventArgs
            {
                Dtime = dtime
            };
            base.OnUpdate(e);
            if (Game.Instance.GroundProbe == null || Game.Instance.MainCharPlaneProbe == null) return;
            Vector3 world = Game.Instance.Input.State.MouseGroundPosition;

            worldCursor.Translation = world;
            worldCursor.Rotation = Quaternion.RotationAxis(Vector3.UnitZ,
                (float)Common.Math.AngleFromVector3XY(world - Game.Instance.Map.MainCharacter.Position));
            worldCursor.Visible = Program.Settings.DisplayWorldCursor;
        }
Exemplo n.º 32
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc     += e.Dtime * 40f;
     Position = new Vector2(0, -Size.Y + acc);
 }
Exemplo n.º 33
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     activeStage.Position = new Vector2(activeXPosition.Update(e.Dtime), 0);
     Size = stagesFlow.Size;
 }
Exemplo n.º 34
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
 }
Exemplo n.º 35
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     if (ChangesSettings)
     {
         settingsChangeTimer -= e.Dtime;
         if (settingsChangeTimer <= 0)
         {
             settingsChangeTimer = (float)Program.Rand.NextDouble();
             RandomizeSettings();
         }
     }
     if (Moving)
     {
         Translation += Velocity * e.Dtime;
     }
     TimeToLive -= e.Dtime;
     if (TimeToLive <= 0) Remove();
 }
 protected virtual void OnUpdate(UpdateEventArgs e)
 {
     if (Update != null) Update(this, e);
 }
Exemplo n.º 37
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     if (!IsInGame) return;
     velocity += new Vector3(
         (float)(Game.Random.NextDouble() * 2 - 1),
         (float)(Game.Random.NextDouble() * 2 - 1),
         0) * e.Dtime * 0.3f;
     if (velocity.Length() > 1)
         velocity = Vector3.Normalize(velocity);
     offset += velocity * MovementSpeed * e.Dtime;
     if (offset.Length() > MaxDistance)
         offset = Vector3.Normalize(offset) * MaxDistance;
     rotation += e.Dtime;
     ((MetaModel)MainGraphic).World = Matrix.RotationZ(rotation / 40.0f) * Matrix.Translation(offset + Vector3.UnitZ * Height);
 }
Exemplo n.º 38
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     var s = scaler.Update(e.Dtime);
     Scaling = s;
 }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);

            if (Program.Instance.Profile != null)
                profileName.Text = "Profile: " + Program.Instance.Profile.Name;

            //Wait five frames so that any "slow" initial frames are ignored (frames in which content is loaded and such)
            fadeI++;
            if (fadeI == 5) fader.State = FadeState.FadeingIn;
        }
Exemplo n.º 40
0
        protected override void OnUpdate(Graphics.UpdateEventArgs e)
        {
            base.OnUpdate(e);

            silverTextBox.Text = ((int)silverInterpolator.Update(e.Dtime)).ToString("00000");
        }
        protected override void OnUpdate(UpdateEventArgs e)
        {
            base.OnUpdate(e);
            acc += e.Dtime;
            float p = acc / Duration;
            //Scale = new Vector3(p, p, p) * 4.0f;
            //this.WorldMatrix = this.WorldMatrix;

            this.WorldMatrix = Matrix.Scaling(p * 4.0f, p * 4.0f, p * 4.0f);

            ((MetaModel)MainGraphic).Opacity = 1 - p;
            if (acc > Duration)
                Remove();
        }
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     acc += e.Dtime;
     float p = acc / Duration;
     ((MetaModel)MainGraphic).Opacity = 1 - p;
     if (acc > Duration)
         Remove();
 }
Exemplo n.º 43
0
 protected override void OnUpdate(Graphics.UpdateEventArgs e)
 {
     base.OnUpdate(e);
     textGraphic.Alpha = alphaInterpolator.Update(e.Dtime);
 }
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
 }
Exemplo n.º 45
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     burningFire.Translation = Translation;
 }
Exemplo n.º 46
0
 protected override void OnUpdate(UpdateEventArgs e)
 {
     base.OnUpdate(e);
     var s = scaler.Update(e.Dtime);
     Scale = new Vector3(s, s, 1);
 }