public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == TAKE_CARD && containsSDCard)
                {
                    menu.RemoveOption(TAKE_CARD);

                    bool taken = GameController.Instance().GetEquipment().AddBySlug("sd_card");
                    if (taken == true)
                    {
                        ((SDCardHolder)InteractablesRepository.Instance().Get("sd_card_holder")).ContainsSDCard = false;
                        containsSDCard = false;
                        sdCardTaken    = true;
                        MainQuest.OnSDCardFound();
                    }
                }

                return(true);
            }

            return(false);
        }
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == WAKE_UP)
                {
                    if (wakedUp)
                    {
                        GameController.Instance().SetDialog(null);
                        MainQuest.OnWakeUp();
                    }
                    else
                    {
                        wakedUp = true;
                        menu    = new Menu(new List <string>()
                        {
                            WAKE_UP
                        });
                    }
                }
                else if (menu.GetCurrent() == SLEEP)
                {
                    GameController.Instance().SetDialog(new WakeUpDialog(sleep + 1));
                }

                return(true);
            }

            return(false);
        }
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == FINISH)
                {
                    state = 1;
                    menu  = new Menu(new List <string>()
                    {
                        NEXT
                    });
                }
                else if (menu.GetCurrent() == NEXT)
                {
                    GameController.Instance().SetDialog(null);
                    ((Thermostat)InteractablesRepository.Instance().Get("thermostat")).Hacked = true;
                    MainQuest.OnRaspberryPiMounted();
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 4
0
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == TAKE_PI && containsRaspberry)
                {
                    menu.RemoveOption(TAKE_PI);

                    bool taken = GameController.Instance().GetEquipment().Add(ItemsRepository.Instance().Get("raspberry_pi_blank"));
                    if (taken == true)
                    {
                        ((Chest)InteractablesRepository.Instance().Get("chest")).ContainsRaspberry = false;
                        containsRaspberry = false;
                        raspberryTaken    = true;

                        menu = new Menu(new List <string>()
                        {
                            LEAVE
                        });

                        MainQuest.OnRaspberryFound();
                    }
                }
                else if (menu.GetCurrent() == TAKE_DUCK && containsDuck)
                {
                    containsDuck = false;
                    menu.RemoveOption(TAKE_DUCK);

                    bool taken = GameController.Instance().GetEquipment().Add(ItemsRepository.Instance().Get("rubber_duck"));
                    if (taken == true)
                    {
                        ((Chest)InteractablesRepository.Instance().Get("chest")).ContainsDuck = false;
                    }
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 5
0
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == NEXT)
                {
                    if (state++ >= 4)
                    {
                        menu = new Menu(new List <string>()
                        {
                            UNDERSTAND, MISUNDERSTAND
                        });
                    }
                }
                else if (menu.GetCurrent() == UNDERSTAND)
                {
                    ((MrRobotParking)InteractablesRepository.Instance().Get("mr_robot_parking")).PlanExplained = true;

                    GameController.Instance().SetDialog(null);
                    MainQuest.OnTryGetInStillMountain();
                }
                else if (menu.GetCurrent() == MISUNDERSTAND)
                {
                    state = 1;
                    menu  = new Menu(new List <string>()
                    {
                        NEXT
                    });
                }

                return(true);
            }

            return(false);
        }
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == OPEN || menu.GetCurrent() == OPEN_AGAIN)
                {
                    if ((new Random()).Next(0, 10) == 0)
                    {
                        menu = new Menu(new List <string>()
                        {
                            GET_IN, LEAVE
                        });
                        SuccessOpen = 1;
                    }
                    else
                    {
                        menu = new Menu(new List <string>()
                        {
                            OPEN_AGAIN, LEAVE
                        });
                        SuccessOpen = -1;
                    }
                }
                else if (menu.GetCurrent() == GET_IN)
                {
                    GameController.Instance().SetDialog(null);
                    MainQuest.OnBackdoorPicklocked();
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 7
0
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == NEXT)
                {
                    if (state >= 8)
                    {
                        MainQuest.OnActionBegin();
                        GameController.Instance().SetDialog(null);
                    }
                    else
                    {
                        state++;
                    }
                }
                else if (menu.GetCurrent() == READY)
                {
                    menu = new Menu(new List <string>()
                    {
                        NEXT
                    });
                    state++;
                }

                return(true);
            }

            return(false);
        }
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == CONEY_ISLAND)
                {
                    GameController.Instance().SetDialog(null);
                    MainQuest.OnConeyIslandTransition();
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 9
0
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (choice == ( char )32)
                {
                    if (menu.GetCurrent() == LEAVE)
                    {
                        GameController.Instance().SetDialog(null);
                    }
                    else if (menu.GetCurrent() == INSTALL_ROOTKIT && raspberryInEquipment)
                    {
                        menu.RemoveOption(INSTALL_ROOTKIT);

                        bool installed = GameController.Instance().GetEquipment().AddBySlug("raspberry_pi_rootkit");
                        if (installed == true)
                        {
                            GameController.Instance().GetEquipment().RemoveBySlug("raspberry_pi_blank");
                            GameController.Instance().GetEquipment().RemoveBySlug("sd_card");
                            raspberryInEquipment = false;
                            rootkitInstalled     = true;
                            menu = new Menu(new List <string>()
                            {
                                LEAVE
                            });
                            MainQuest.OnRootkitInstalled();
                        }
                    }
                    else if (menu.GetCurrent() == PLAY_CP77)
                    {
                        romeroCall = true;
                        menu       = new Menu(
                            new List <string>()
                        {
                            SKIP_ROMERO
                        }
                            );
                    }
                    else if (menu.GetCurrent() == WATCH_YT)
                    {
                        funnyCats = true;
                        menu      = new Menu(
                            new List <string>()
                        {
                            LEAVE
                        }
                            );
                    }
                    else if (menu.GetCurrent() == SKIP_ROMERO)
                    {
                        skipRomero = true;
                        menu       = new Menu(
                            new List <string>()
                        {
                            LEAVE
                        }
                            );
                    }

                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 10
0
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == CONTROL)
                {
                    state = 1;
                    if (mounted)
                    {
                        menu = new Menu(new List <string>()
                        {
                            FINANCIALS, SILENCE
                        });
                    }
                    else
                    {
                        menu = new Menu(new List <string>()
                        {
                            FAILED
                        });
                    }
                }
                else if (menu.GetCurrent() == FAILED)
                {
                    GameController.Instance().GameOver();
                }
                else if (menu.GetCurrent() == FINANCIALS || (state == 0 && menu.GetCurrent() == SILENCE) || (state == 1 && menu.GetCurrent() == SILENCE))
                {
                    state = 2;
                    menu  = new Menu(new List <string>()
                    {
                        NEXT
                    });
                }
                else if (menu.GetCurrent() == NEXT)
                {
                    state++;
                    if (state == 6)
                    {
                        menu = new Menu(new List <string>()
                        {
                            LET_HIM_GO, TAKE_CARD
                        });
                        MainQuest.OnTyrellLeft();
                    }
                }
                else if (menu.GetCurrent() == LET_HIM_GO)
                {
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == TAKE_CARD)
                {
                    state = 7;
                    menu  = new Menu(new List <string>()
                    {
                        END
                    });
                    GameController.Instance().GetEquipment().Add(ItemsRepository.Instance().Get("magnetic_card"));
                }
                else if (menu.GetCurrent() == END)
                {
                    GameController.Instance().SetDialog(null);
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 11
0
        public bool HandleKeyPress(char choice)
        {
            if (menu.HandleKeyPress(choice))
            {
                return(true);
            }
            else if (choice == ( char )32)
            {
                if (menu.GetCurrent() == LEAVE || menu.GetCurrent() == NOTHING || menu.GetCurrent() == NOT_YET || menu.GetCurrent() == FOLLOW_BILL)
                {
                    state = 0;
                    GameController.Instance().SetDialog(null);
                }
                else if (menu.GetCurrent() == VISIT)
                {
                    menu = new Menu(new List <string>()
                    {
                        LIAM_SEPIOL, SAM_SEPIOL, SAM_ESMAIL
                    });
                    state++;
                }
                else if (menu.GetCurrent() == SAM_SEPIOL)
                {
                    menu = new Menu(new List <string>()
                    {
                        YES, NOT_YET
                    });
                    state++;
                }
                else if (menu.GetCurrent() == SAM_ESMAIL || menu.GetCurrent() == LIAM_SEPIOL)
                {
                    ((Bill)InteractablesRepository.Instance().Get("bill")).CheatAttemptPossible = false;
                    menu = new Menu(new List <string>()
                    {
                        LEAVE
                    });
                    state = 100;
                    MainQuest.OnBillFailed();
                }
                else if (menu.GetCurrent() == YES)
                {
                    ((Bill)InteractablesRepository.Instance().Get("bill")).CheatAttemptPossible = false;
                    menu = new Menu(new List <string>()
                    {
                        NEXT
                    });
                    state++;
                }
                else if (menu.GetCurrent() == NEXT)
                {
                    state++;
                    if (state == 7)
                    {
                        menu = new Menu(new List <string>()
                        {
                            ASK, ESCAPE
                        });
                    }
                }
                else if (menu.GetCurrent() == ASK)
                {
                    menu = new Menu(new List <string>()
                    {
                        END_TOUR, DESTROY_BILL
                    });
                    state = 20;
                }
                else if (menu.GetCurrent() == ESCAPE)
                {
                    menu = new Menu(new List <string>()
                    {
                        FOLLOW_BILL
                    });
                    state = 101;
                    MainQuest.OnBillFailed();
                }
                else if (menu.GetCurrent() == END_TOUR)
                {
                    menu = new Menu(new List <string>()
                    {
                        FOLLOW_BILL
                    });
                    state = 102;
                    MainQuest.OnBillFailed();
                }
                else if (menu.GetCurrent() == DESTROY_BILL)
                {
                    menu = new Menu(new List <string>()
                    {
                        LOOK_ON_BILL
                    });
                    state++;
                }
                else if (menu.GetCurrent() == LOOK_ON_BILL)
                {
                    menu = new Menu(new List <string>()
                    {
                        BREAK_IN
                    });
                    state = 103;
                }
                else if (menu.GetCurrent() == BREAK_IN)
                {
                    MainQuest.OnBillDestroyed();
                    GameController.Instance().SetDialog(null);
                }

                return(true);
            }

            return(false);
        }
Ejemplo n.º 12
0
 public static void OnBackdoorPicklocked()
 {
     GameController.Instance().SetRoom(RoomsRepository.Instance().Get("corridor_i"));
     GameController.Instance().SetPlayer(new Point(0, 12));
     MainQuest.OnGetInSteelMountain();
 }
Ejemplo n.º 13
0
 public static void OnBillDestroyed()
 {
     GameController.Instance().SetRoom(RoomsRepository.Instance().Get("corridor_iii"));
     GameController.Instance().SetPlayer(new Point(15, 6));
     MainQuest.OnGetInSteelMountain();
 }