Exemple #1
0
        public IncomingWeatherPointer(WeatherMetadata weatherMetadata)
        {
            WeatherMetadata = weatherMetadata;

            fadeAnimation = 0;

            position = Topography.FromNormalizedPositionToRelativePosition(weatherMetadata.Position);
            flipbook = new Flipbook(Vector2.Zero, new Vector2(9, -11), 19, 27, "Interface/InGame/HUD/Blue/IncomingWeather/Pointer", new AnimationInstance {
                EndingFrame = 6, TimePerFrame = 1 / 15f
            }, 0.95f, 0);

            string text;

            switch (weatherMetadata.Weather)
            {
            case WeatherType.Force:
                text = Language.WeatherForce;
                break;

            case WeatherType.Tornado:
                text = Language.WeatherTornado;
                break;

            case WeatherType.Electricity:
                text = Language.WeatherElectricity;
                break;

            case WeatherType.Weakness:
                text = Language.WeatherWeakness;
                break;

            case WeatherType.Mirror:
                text = Language.WeatherMirror;
                break;

            default:
                text = Language.WeatherRandom;
                break;
            }

            spriteText = new SpriteText(FontTextType.Consolas10, text, Color.White, Alignment.Center, layerDepth: 1);

            flipbook.Position   = new Vector2(position.X, -(GameScene.Camera.CameraOffset + Parameter.ScreenResolution / 2).Y);
            spriteText.Position = flipbook.Position + new Vector2(0, 0);

            flipbook.Color = spriteText.Color = spriteText.OutlineColor = Color.Transparent;
        }
Exemple #2
0
        public void ApplyCurrentWeatherEffect()
        {
            //Wipe any other weather if it has changed
            if (previousWeather.Weather != ActiveWeather.Weather)
            {
                LevelScene.WeatherHandler.RemoveWeather(ActiveWeather.Weather);
            }

            //Active Weathers
            if (NetworkObjectParameters.ActiveWeatherEffectList.Contains(ActiveWeather.Weather))
            {
                LevelScene.WeatherHandler.Add(ActiveWeather.Weather, ActiveWeather.ExtraWeather, Topography.FromNormalizedPositionToRelativePosition(ActiveWeather.Position));

                if (incomingWeatherPointers.Count > 0 &&
                    incomingWeatherPointers.Peek().WeatherMetadata == ActiveWeather)
                {
                    incomingWeatherPointers.Dequeue();
                }
            }

            //Unlock items (if necessary)
            if (ActiveWeather.Weather != WeatherType.Ignorance)
            {
                LevelScene.HUD.MatchStatusClosed.SetTransparency(0);
            }

            switch (ActiveWeather.Weather)
            {
            case WeatherType.Wind:
                AudioHandler.PlaySoundEffect(SoundEffectParameter.InGameWeatherWindTransition);
                break;

            case WeatherType.Protection:
                foreach (Mobile mob in LevelScene.MobileList)
                {
                    mob.Regenerate(true);
                }
                break;

            case WeatherType.Ignorance:
                LevelScene.HUD.LockItem();
                break;
            }
        }