Example #1
0
        /// <summary>
        /// Checks if a tornado is colliding with the mine
        /// </summary>
        public void UpdateTornadoCollider()
        {
            foreach (Weather w in LevelScene.WeatherHandler.WeatherList)
            {
                if (w is Tornado && w.Intersects(this))
                {
                    if (Target == null)
                    {
                        SpecialEffectBuilder.RaonLauncherProjectile2DormantTornado(Position);
                    }
                    else
                    {
                        SpecialEffectBuilder.RaonLauncherProjectile2ActiveTornado(Position);
                    }

                    Die();
                }
            }
        }
Example #2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (InputHandler.IsBeingPressed(Keys.F1))
            {
                //CurrentTurnOwner.LoseTurn();
                MobileList[0].GrantTurn();
                MobileList[0].LayerDepth = 0.6f;
                MobileList.ForEach((x) => x.Movement.RemainingStepsThisTurn = 100000);
            }

            if (InputHandler.IsBeingPressed(Keys.F4))
            {
                MatchMetadata.WindForce        = r.Next(0, 35);
                MatchMetadata.WindAngleDegrees = r.Next(0, 360);
                HUD.WindCompass.ChangeWind(MatchMetadata.WindAngleDegrees, MatchMetadata.WindForce);
            }

            if (InputHandler.IsBeingPressed(Keys.F5))
            {
                WeatherHandler.Add(WeatherType.Mirror, new Vector2(-500, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Mirror, new Vector2(-300, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F6))
            {
                WeatherHandler.Add(WeatherType.Weakness, new Vector2(-400, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Weakness, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F7))
            {
                WeatherHandler.Add(WeatherType.Force, new Vector2(-300, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Force, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F8))
            {
                WeatherHandler.Add(WeatherType.Tornado, new Vector2(400, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F9))
            {
                WeatherHandler.Add(WeatherType.Electricity, new Vector2(-100, -Topography.MapHeight / 2));
                WeatherHandler.Add(WeatherType.Electricity, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F10))
            {
                WeatherHandler.Add(WeatherType.Random, WeatherType.Weakness, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F11))
            {
                Color green  = new Color(57, 255, 20, 255 / 4);
                Color blue   = new Color(27, 3, 163, 255 / 4);
                Color red    = new Color(255, 7, 58, 255 / 4);
                Color white  = new Color(255, 255, 255, 255 / 4);
                Color yellow = new Color(204, 255, 0, 255 / 4);

                Vector2 position = Vector2.Zero;

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(green, blue, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(blue, yellow, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(yellow, red, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }

                for (int i = 0; i < 10; i++)
                {
                    SpecialEffectBuilder.ThorShot(position, Color.Lerp(red, white, i / 9f), 6, 0);
                    position += Vector2.UnitX * 15;
                }
            }

            if (InputHandler.IsBeingPressed(Keys.F12))
            {
                MineList[0].GrantTurn();
            }

            if (InputHandler.IsBeingPressed(Keys.F2))
            {
                WeatherHandler.Add(WeatherType.Thor, WeatherType.Weakness, new Vector2(0, -Topography.MapHeight / 2));
            }

            if (InputHandler.IsBeingPressed(Keys.F3))
            {
                SpecialEffectBuilder.RaonLauncherProjectile2ActiveTornado(MobileList[0].Position);
            }

            if (InputHandler.IsBeingPressed(Keys.D1))
            {
                SpecialEffectBuilder.RaonLauncherProjectile2DormantTornado(MobileList[0].Position);
            }

            if (InputHandler.IsBeingPressed(Keys.D2))
            {
                MobileList[3].Die();
            }

            if (InputHandler.IsBeingPressed(Keys.D3))
            {
                MobileList[0].ChangeFlipbookState(ActorFlipbookState.BeingDamaged2, true);
            }


            if (InputHandler.IsBeingPressed(Keys.D4))
            {
                new PopupSelectItem()
                {
                    ShouldRender = true
                };
            }

            if (InputHandler.IsBeingPressed(Keys.D5))
            {
                HUD.OnReceiveMessageAsyncCallback(new PlayerMessage()
                {
                    Player     = MobileList[0].Owner,
                    PlayerTeam = PlayerTeam.Red,
                    Text       = "Abiruindjo abirual"
                }, 0);

                HUD.OnReceiveMessageAsyncCallback(new CustomMessage()
                {
                    FontTextType    = FontTextType.Consolas10,
                    TextBorderColor = Color.Red.PackedValue,
                    TextColor       = Color.Blue.PackedValue,
                    Text            = "Abiruindjo abirual"
                }, 1);
            }

            if (InputHandler.IsBeingPressed(Keys.D6))
            {
                PopupHandler.Add(new PopupSelectItem()
                {
                    ShouldRender = true
                });
            }

            if (InputHandler.IsBeingPressed(Keys.D7))
            {
                SceneHandler.Instance.RequestSceneChange(SceneType.DebugScene, TransitionEffectType.RotatingRectangles);
            }

            if (InputHandler.IsBeingPressed(Keys.D8))
            {
                //SpecialEffectBuilder.HitEffect(new Vector2(100, 100), 4, MathHelper.TwoPi * (float)Parameter.Random.NextDouble());
                for (int i = 0; i < 8; i++)
                {
                    MobileList[0].Owner.Attribute[i] = 1;
                }
            }

            if (InputHandler.IsBeingPressed(Keys.D9))
            {
                //MobileList[0].ReceiveDamage(10);
                for (int i = 0; i < 8; i++)
                {
                    if (Parameter.Random.NextDouble() < 0.1)
                    {
                        MobileList[0].Owner.Attribute[i] =
                            Math.Sign(MobileList[0].Owner.Attribute[i]) *
                            (Math.Abs(MobileList[0].Owner.Attribute[i]) + 1) * -1;
                    }
                }

                //HUD.StatusBarDictionary.ForEach((x) => x.UpdateAttributeList());
            }

            if (InputHandler.IsBeingReleased(Keys.D0))
            {
                //tb = new TextBalloon(MobileList[0], "123123123 123123123 1231231234814812749817498174 71829741984712984721941928471924721984");
            }

            tb?.Update(gameTime);
        }