Beispiel #1
0
 protected override void onKeypress(KeypressEventArgs eventArgs)
 {
     if (!Inactive && (eventArgs.Keypress == Keys.E || eventArgs.Gamepad.IsButtonDown(Buttons.X)))
     {
         string text = "This is the evidence you can use to blackmail August! Now you just have to find him.";
         SubtitleBox.AddMessage(text);
         (eventArgs.Sender as Player).UpdateProgressionData("hasblackmail", "true");
         Inactive = true;
     }
 }
Beispiel #2
0
 protected override void onKeypress(KeypressEventArgs eventArgs)
 {
     if (!Inactive && canTalk && (eventArgs.Keypress == Keys.E || eventArgs.Gamepad.IsButtonDown(Buttons.X)) && eventArgs.Distance < talkDistance && text != null)
     {
         if (IsPolice && (eventArgs.Sender as Player).Morality < evilThreshold)
         {
             SubtitleBox.AddMessage(policeText, Name);
         }
         else if (IsGang && (eventArgs.Sender as Player).Morality > evilThreshold)
         {
             SubtitleBox.AddMessage(gangText, Name);
         }
         else
         {
             SubtitleBox.AddMessage(text, Name);
         }
         canTalk = false;
     }
 }
Beispiel #3
0
        public void DrawScene(GameTime gameTime)
        {
            RenderingDevice.GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            RenderingDevice.GraphicsDevice.RasterizerState   = RasterizerState.CullNone;
            RenderingDevice.GraphicsDevice.BlendState        = BlendState.Opaque;

            RenderingDevice.Draw();

            actorList.Sort(new Comparison <Actor>(sortActorList));
            actorList.Reverse();
            foreach (Actor a in actorList)
            {
                a.Draw(); // draws billboards and anything else
            }
            august.Draw();
            Player.Draw();

            SubtitleBox.Draw();
        }
Beispiel #4
0
 protected override void onKeypress(KeypressEventArgs eventArgs)
 {
     if (!talked)
     {
         if ((eventArgs.Sender as Player).HasProgressionData("hasblackmail"))
         {
             text   = hasEvidence;
             talked = true;
             SubtitleBox.AddMessage(text, Name, delegate { fading = true; });
             return;
         }
         else if (active)
         {
             text = attacking;
         }
         else
         {
             text = noEvidence;
         }
         base.onKeypress(eventArgs);
     }
 }
Beispiel #5
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if ((!IsActive && Loader != null) || locked)
            {
                base.Update(gameTime);
                return;
            }

            Input.Update(gameTime, false);
            MediaSystem.Update(gameTime, Program.Game.IsActive);

            if (Loading)
            {
                IsFixedTimeStep = true;
                Loader l = loadingScreen.Update(gameTime);
                if (l != null)
                {
                    IsFixedTimeStep = false;
                    Loader          = l;
                    loadingScreen   = null;
                    Loading         = false;
                    MenuHandler.Create(Loader);
                    createActors();
                }
            }
            else
            {
                GameState statePrior = GameManager.State;
                MenuHandler.Update(gameTime);
                bool stateChanged = GameManager.State != statePrior;

                if (GameManager.State == GameState.Running)
                {
                    IsMouseVisible = false;
                    if ((Input.CheckKeyboardJustPressed(Keys.Escape) ||
                         Input.CheckXboxJustPressed(Buttons.Start)) && !stateChanged)
                    {
                        //MediaSystem.PlaySoundEffect(SFXOptions.Pause);
                        GameManager.State = GameState.Paused;
                    }
                    else
                    {
                        GameManager.Space.Update((float)(gameTime.ElapsedGameTime.TotalSeconds));
                        RenderingDevice.Update(gameTime);

                        Player.Update(gameTime);
                        SubtitleBox.Update();
                        august.Update(gameTime);
                        foreach (Actor a in actorList)
                        {
                            a.Update(gameTime);
                        }

                        if (IsActive)
                        {
                            Mouse.SetPosition(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);
                        }
                    }
                }
                else if (GameManager.State != GameState.Ending && GameManager.State != GameState.GameOver && GameManager.State != GameState.Menuing_Lev)
                {
                    IsMouseVisible = true;
                }
            }

            base.Update(gameTime);
        }