Esempio n. 1
0
        public override void Update(GameTime gameTime)
        {
            if (((Hacking)parent).Start)
            {
                timedown--;
                if (timedown <= 0)
                {
                    Visible  = !Visible;
                    timedown = 30;
                }
                if (IGGamePad.GetKeyTrigger(pad, Buttons.DPadUp))
                {
                    Coo = new Point(Coo.X, Coo.Y - 1);
                }
                else if (IGGamePad.GetKeyTrigger(pad, Buttons.DPadDown))
                {
                    Coo = new Point(Coo.X, Coo.Y + 1);
                }
                else if (IGGamePad.GetKeyTrigger(pad, Buttons.DPadLeft))
                {
                    Coo = new Point(Coo.X - 1, Coo.Y);
                }
                else if (IGGamePad.GetKeyTrigger(pad, Buttons.DPadRight))
                {
                    Coo = new Point(Coo.X + 1, Coo.Y);
                }

                /*if (player == "P0")
                 * {
                 *  if (GameKeyboard.GetKeyTrigger(Keys.W))
                 *  {
                 *      Coo = new Point(Coo.X, Coo.Y - 1);
                 *  }
                 *  else if (GameKeyboard.GetKeyTrigger(Keys.S))
                 *  {
                 *      Coo = new Point(Coo.X, Coo.Y + 1);
                 *  }
                 *  else if (GameKeyboard.GetKeyTrigger(Keys.A))
                 *  {
                 *      Coo = new Point(Coo.X - 1, Coo.Y);
                 *  }
                 *  else if (GameKeyboard.GetKeyTrigger(Keys.D))
                 *  {
                 *      Coo = new Point(Coo.X + 1, Coo.Y);
                 *  }
                 * }*/
                base.Update(gameTime);
            }
        }
 public override void Update(GameTime gameTime)
 {
     if (Visible)
     {
         if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.Start))
         {
             ReSet(null, null);
         }
         else if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.B))
         {
             Back(null, null);
         }
         else if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.Back))
         {
             ToTitle(null, null);
         }
     }
     base.Update(gameTime);
 }
Esempio n. 3
0
        public override void Update(GameTime gameTime)
        {
            if (!warning.Visible)
            {
                if (warningCountDown > -1)
                {
                    warningCountDown--;
                }
                if (warningCountDown == 0)
                {
                    warningCountDown          = 30;
                    antivirus.Warning.Visible = !antivirus.Warning.Visible;
                }
            }
            else
            {
                if (antivirus.Warning.Visible)
                {
                    antivirus.Warning.Visible = false;
                }
            }
            if (isShutdown)
            {
                Refract -= 0.1f;
                if (refract <= 0)
                {
                    Refract = 0;
                    OnShutdown();
                }
            }

            if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.Start) && !warning.Visible)
            {
                Start();
            }
            else if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.Back) && !warning.Visible)
            {
                Shutdown();
            }

            base.Update(gameTime);
        }
Esempio n. 4
0
        protected override void ActionB()
        {
            isDamage = (IGGamePad.GetKeyState(playerControl.Player, Buttons.B) && PlayerState["paralysis"] <= 0);
            if (isDamage)
            {
                selfDamage++;
            }
            else if (selfDamage > 0)
            {
                selfDamage--;
            }

            if (selfDamage > 500)
            {
                PlayerState["paralysis"] = selfDamage / 5;
                SetVibration(0.5f, 0.5f, 800);
                selfDamage--;
            }
            base.ActionB();
        }
Esempio n. 5
0
 public override void Update(GameTime gameTime)
 {
     if (Visible)
     {
         if (start)
         {
             if (parent.gameWindowsIDs[parent.gameWindowsIDs.Count - 1] != UIID)
             {
                 SetFocus();
             }
             if (!sounds["hacking"].GetState(SoundState.Playing))
             {
                 sounds["hacking"].Play();
             }
             if (timedown > 0)
             {
                 timedown--;
             }
             if (timedown <= 0)
             {
                 if (GameRun.ActiveScene is TitleScene)
                 {
                     foreach (var l in Players)
                     {
                         l.Value.SetChara();
                     }
                     ((BaseScene)parent).IsRun = false;
                     ((BaseScene)parent).GameRun.scenes["stagescene"].IsRun = true;
                     ((BaseScene)parent).GameRun.scenes["stagescene"].Initialize();
                     parent.Initialize();
                 }
             }
             time.Text = GetText("TimeDown") + (timedown / 60f).ToString();
         }
         else if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.A))
         {
             OnStart(null, null);
         }
         base.Update(gameTime);
     }
 }
Esempio n. 6
0
 public override void Update(GameTime gameTime)
 {
     if (Visible)
     {
         if (!soundplay)
         {
             sounds["warning01"].Play();
             soundplay = true;
         }
         if (onHacking)
         {
             if (!sounds["warning02"].GetState(SoundState.Playing))
             {
                 sounds["warning02"].Play();
             }
             if (timedown > 570)
             {
                 timedown--;
             }
             if (timedown == 590)
             {
                 CanClose             = false;
                 Text                 = GetText("Warning");
                 warningText.Text     = GetText("OnHackingText");
                 warningText.TextSize = 16f;
                 Size                 = Size / 2;
                 warningText.Location = ((size - warningText.Size) / 2).ToPoint();
                 ok.Visible           = false;
                 cancel.Visible       = false;
             }
             if (timedown == 570)
             {
                 Location = Point.Zero;
                 ((TitleScene)parent).Hacking.Visible = true;
                 ((TitleScene)parent).Hacking.SetFocus();
                 timedown--;
             }
             if (timedown < 570 && ((TitleScene)parent).Hacking.Start)
             {
                 timedown--;
             }
             if ((timedown > 300 && timedown % 60 == 0) ||
                 (timedown > 150 && timedown <= 300 && timedown % 30 == 0) ||
                 (timedown > 75 && timedown <= 150 && timedown % 15 == 0) ||
                 (timedown > 30 && timedown <= 75 && timedown % 6 == 0) ||
                 timedown <= 30)
             {
                 Location = new Point(rnd.Next(0, parent.Size.Width - Size.Width), rnd.Next(0, parent.Size.Height - Size.Height));
             }
         }
         if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.A) && !onHacking)
         {
             OK();
         }
         else if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.B) && !onHacking)
         {
             Cancel(null, null);
         }
     }
     base.Update(gameTime);
 }
Esempio n. 7
0
 public override void Update(GameTime gameTime)
 {
     if (GameKeyboard.GetKeyUpTrigger(Keys.Escape))
     {
         OpenBackMenu();
     }
     if (start.Visible)
     {
         start.Text     = (((GameStage)stages["Stage01"]).StartTime / 60).ToString();
         start.Location = ((size - start.Size) / 2).ToPoint();
         if (((GameStage)stages["Stage01"]).StartTime == 0)
         {
             start.Visible = false;
         }
     }
     if ((runStage.MouseWin || runStage.CatWin) && !gameOver.Visible)
     {
         Dictionary <string, string> result = new Dictionary <string, string>();
         if (runStage.MouseWin && runStage.CatWin)
         {
             result["winer"] = "引き分け";
         }
         else if (runStage.MouseWin)
         {
             sounds["viruswin"].Play();
             result["winer"] = "個人情報大量漏出";
         }
         else if (runStage.CatWin)
         {
             sounds["antiviruswin"].Play();
             result["winer"] = "ウィルス全滅";
         }
         result["thedatafind"] = string.Format($"取り戻せた情報量:{runStage.AntivirusPoint}");
         result["thedatalost"] = string.Format($"盗まれた情報量:{runStage.MousePoint}");
         gameOver.ShowResult(result);
     }
     if (!backMenu.Visible && !gameOver.Visible)
     {
         base.Update(gameTime);
     }
     else
     {
         if (backMenu.Visible)
         {
             backMenu.Update(gameTime);
         }
         if (gameOver.Visible)
         {
             gameOver.Update(gameTime);
         }
     }
     if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.Start) && gameOver.Visible)
     {
         Initialize();
     }
     else if (IGGamePad.GetKeyTrigger(PlayerIndex.One, Buttons.Back))
     {
         if (gameOver.Visible)
         {
             IsRun = false;
             GameRun.scenes["title"].IsRun = true;
             Initialize();
         }
         else if (!backMenu.Visible)
         {
             OpenBackMenu();
         }
     }
 }