Beispiel #1
0
        protected override bool OnCast(Entity source)
        {
            var obj = source.GameObject;

            if (_shadowSprite == null)
            {
                _shadowSprite = new ObjContainer(obj.SpriteName)
                {
                    OutlineColour = Color.Blue,
                    OutlineWidth  = 2,
                    TextureColor  = Color.Black
                }
            }
            ;
            else
            {
                _shadowSprite.ChangeSprite(obj.SpriteName);
            }

            _shadowSprite.Position = obj.Position;
            _shadowSprite.Flip     = obj.Flip;
            _shadowSprite.Scale    = Vector2.Zero;
            _shadowSprite.Visible  = true;

            _shadowSprite.GoToFrame(obj.CurrentFrame);

            for (var i = 0; i < obj.NumChildren; i++)
            {
                var src  = obj.GetChildAt(i) as SpriteObj;
                var dst  = _shadowSprite.GetChildAt(i) as SpriteObj;
                var show = src.Visible;

                if (source is Player && (
                        i == 16 || (
                            Player.Class is Classes.Spellthief && (i == 10 || i == 11)
                            )))
                {
                    show = false;
                }

                dst.ChangeSprite(src.SpriteName);
                dst.Visible = show;
            }

            Tween.To(_shadowSprite, 0.4f, Linear.EaseNone, "ScaleX", obj.ScaleX.ToString(), "ScaleY", obj.ScaleY.ToString());

            Effects.InverseEmitEffect.Display(_shadowSprite.Position);

            return(true);
        }
Beispiel #2
0
 public override void OnEnter()
 {
     m_bossDoorOpening = false;
     if (Game.PlayerStats.ReadLastDiary && LinkedRoom.LinkedRoom != null)
     {
         LinkedRoom = LinkedRoom.LinkedRoom;
     }
     Game.PlayerStats.LoadStartingRoom = false;
     if (Game.PlayerStats.DiaryEntry < 1)
     {
         m_speechBubble.Visible = true;
     }
     else
     {
         m_speechBubble.Visible = false;
     }
     if (InputManager.GamePadIsConnected(PlayerIndex.One))
     {
         m_mapIcon.SetButton(Game.GlobalInput.ButtonList[9]);
         m_mapIcon.Scale = new Vector2(1f, 1f);
     }
     else
     {
         m_mapIcon.SetKey(Game.GlobalInput.KeyList[9]);
         m_mapIcon.Scale = new Vector2(0.5f, 0.5f);
     }
     if (!m_allFilesSaved)
     {
         Player.Game.SaveManager.SaveAllFileTypes(false);
         m_allFilesSaved = true;
     }
     if (Game.PlayerStats.EyeballBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.CASTLE, false);
     }
     if (Game.PlayerStats.FairyBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.GARDEN, false);
     }
     if (Game.PlayerStats.BlobBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.DUNGEON, false);
     }
     if (Game.PlayerStats.FireballBossBeaten)
     {
         RevealSymbol(GameTypes.LevelType.TOWER, false);
     }
     if (Game.PlayerStats.EyeballBossBeaten && Game.PlayerStats.FairyBossBeaten &&
         Game.PlayerStats.BlobBossBeaten && Game.PlayerStats.FireballBossBeaten &&
         !Game.PlayerStats.FinalDoorOpened && Player.ScaleX > 0.1f)
     {
         PlayBossDoorAnimation();
     }
     else if (Game.PlayerStats.FinalDoorOpened)
     {
         m_bossDoor.Locked = false;
         m_bossDoorSprite.ChangeSprite("LastDoorOpen_Character");
         m_bossDoorSprite.GoToFrame(m_bossDoorSprite.TotalFrames);
     }
     if (!m_gateClosed)
     {
         CloseGate(true);
     }
     if (Game.PlayerStats.EyeballBossBeaten && Game.PlayerStats.FairyBossBeaten &&
         Game.PlayerStats.BlobBossBeaten && Game.PlayerStats.FireballBossBeaten &&
         !Game.PlayerStats.FinalDoorOpened && Player.ScaleX > 0.1f)
     {
         Game.PlayerStats.FinalDoorOpened = true;
         Player.AttachedLevel.RunCinematicBorders(6f);
     }
     base.OnEnter();
 }