コード例 #1
0
        public void UseExit(ExitWrapper exit)
        {
            WriteText("-------------------------------------------", null);

            var movementResult = new ScriptWrapper(CurrentGame.Settings.MovementScript).Execute();

            foreach (var a in CurrentGame.ActiveStatusEffects)
            {
                a.RunOnMove();
            }
            CheckStatusEffectsResolved();
            bool result = true;

            foreach (var a in CurrentGame.EquippedItems.Select(a => a.Value).Where(a => a != null).Distinct())
            {
                var res = new ScriptWrapper(a.item.EquipmentRef.OnMove).Execute();
                if (res == false)
                {
                    result = false;
                }
            }
            if ((movementResult == null || movementResult == true) && result)
            {
                CurrentGame.CurrentRoom = CurrentGame.Rooms[exit.ExitBase.RoomID];
            }

            OutputCurrentRoomDescription();
            MainViewModel.GetMainViewModelStatic().CurrentGame.RunActiveEvents();

            GC.Collect();
        }
コード例 #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            ExitWrapper.Init(this);
            mGraphics.GraphicsProfile = GraphicsProfile.HiDef;

            if (Settings.Dict["Fullscreen"] == "on")
            {
                ScreenSize.CurrentSize(mGraphics);
            }
            else
            {
                mGraphics.ApplyChanges();
            }
            IsMouseVisible = false;
            mCamera        = new Camera(mGraphics)
            {
                Position = AMainMenuPage.sCameraPosition
            };
            CameraWrapper.Init(mCamera);
            Globals.GetResolution(mGraphics);
            mInputManager = new InputManager(Content);
            mInputManager.GetCam(mCamera);
            ExitWrapper.LoadInputManager(mInputManager);
            CameraWrapper.LoadInputManager(mInputManager);
            ModelManager.Initialize(mGraphics.GraphicsDevice, Content, mCamera);
            AKi.LoadInputManager(mInputManager);
            ToolBox.Initialize(mGraphics, mCamera);
            SoundManager.Init();
            mMusicManager = new MusicManager(Content, "music/background", "music/win", "music/lose");

            mSoundEffectManager = new SoundEffectManager(Content, "sounds/battering_ram", "sounds/bowman", "sounds/cavalry", "sounds/swordsman", "sounds/hero");
            AAudioMenu.Init(mSoundEffectManager, mMusicManager);
            GameState.Init(mSoundEffectManager);

            base.Initialize();
        }
コード例 #3
0
 public override void IsClicked(Action <List <Screen> > addScreens, Action <List <Screen> > removeScreens)
 {
     ExitWrapper.Quit();
 }