Inheritance: MonoBehaviour
示例#1
0
        public Location LoadGameMenu()
        {
            Location       returnData;
            LocationAction locationAction;

            returnData             = new Location();
            returnData.Name        = "Game Menu";
            returnData.Description = "Please choose an initial starting action.";

            List <LocationAction> locationActions = new List <LocationAction>();

            locationAction = new CreateNewCharacterAction();
            locationActions.Add(locationAction);

            if (LoadSave.SavedGameExists())
            {
                locationAction = new LoadSavedGameAction();
                locationActions.Add(locationAction);
            }

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;

            return(returnData);
        }
示例#2
0
        //Used when we actually want to handle a target!
        public static RunStatus HandleTarget(object ret)
        {
            //if (ItemIdentifyBehavior.shouldPreformOOCItemIDing)
            //return ItemIdentifyBehavior.HandleIDBehavior(); //Check if we are doing OOC ID behavior..

            if (Bot.Targeting.Cache.CurrentTarget != null)
            {
                return(Bot.Targeting.Handler.HandleThis());                 //Default Behavior: Current Target
            }
            if (OutOfGame.MuleBehavior)
            {
                if (!OutOfGame.TransferedGear)
                {
                    return(NewMuleGame.StashTransfer());
                }

                return(NewMuleGame.FinishMuleBehavior());
            }

            //Exit Game!!
            if (ExitGame.BehaviorEngaged)
            {
                return(ExitGame.Behavior());
            }

            return(RunStatus.Success);
        }
示例#3
0
 public void Hide_AllScreen()
 {
     Setting.SetActive(false);
     StartGame.SetActive(false);
     LoadGame.SetActive(false);
     ExitGame.SetActive(false);
     Admin.SetActive(false);
 }
示例#4
0
 void Start()
 {
     survival   = FindObjectOfType <Survival>();
     campaign   = FindObjectOfType <Campaign>();
     tutorial   = FindObjectOfType <Tutorial>();
     highscores = FindObjectOfType <HighScores>();
     exitgame   = FindObjectOfType <ExitGame>();
     back       = FindObjectOfType <GameStart_Back>();
 }
示例#5
0
        private void Exit_tolbar_Click(object sender, FormClosingEventArgs e)
        {
            TimeWindow.Stop();
            TimeColor.Stop();
            TimeHelpRoom.Stop();

            TimeTrueAnsver.Stop();
            TimeCallHelp.Stop();


            ExitGame?.Invoke(this, EventArgs.Empty);
        }
示例#6
0
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
        public void EnqueueAndDequeue_1Envelope()
        {
            MessageId         msgId  = new MessageId();
            MessageId         convId = new MessageId();
            ConversationQueue q      = new ConversationQueue();
            ExitGame          msg1   = new ExitGame()
            {
                MsgId = msgId, ConvId = convId, PlayerID = 1, GameID = 1
            };

            q.Enqueue(msg1.Encode());
            byte[] result = q.Dequeue(1);
            Assert.AreEqual(msg1.Encode(), result);
        }
示例#8
0
        public Location LoadInn()
        {
            Location returnData;


            returnData             = new Location();
            returnData.Name        = "Prancing Pony";
            returnData.Description = "You belly up to the bar!";

            // Location Actions
            List <LocationAction> locationActions = new List <LocationAction>();

            LocationAction locationAction = new RumorAction("Bartender", this.InnKeepersRumors);

            locationActions.Add(locationAction);

            //Adding rumors from guest in the inn
            LocationAction guestLocationAction = new RumorAction("Guest", this.InnGuestRumors);

            locationActions.Add(guestLocationAction);

            locationAction = new RestAction(5);
            locationActions.Add(locationAction);

            locationAction = new BuyTravelRation();
            locationActions.Add(locationAction);

            locationAction = new SaveAction();
            locationActions.Add(locationAction);

            locationAction = new MainMenuAction();
            locationActions.Add(locationAction);

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;

            // Adjacent Locations
            Dictionary <string, LocationDefinition> adjacentLocationDefinitions = new Dictionary <string, LocationDefinition>();

            LocationDefinition locationDefinition = GetTownCenterDefinition();

            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            returnData.AdjacentLocationDefinitions = adjacentLocationDefinitions;

            return(returnData);
        }
示例#9
0
        public MenuModule(MenuSendData selections, Bank bank,
                          Dictionary <string, Shape> shipList, Dictionary <string, Level> levelList,
                          Level menuScene, EntityHandler entityHandler, ExitGame exit
                          )
        {
            this.bank          = bank;
            this.shipList      = shipList;
            this.levelList     = levelList;
            this.menuScene     = menuScene;
            this.selections    = selections;
            this.entityHandler = entityHandler;
            exitDelegate       = exit;

            menus = new List <Menu>();
        }
示例#10
0
        public GameSetting PopulateGameSetting(List <string> listOfRows)
        {
            var gameSetting = new GameSetting();


            // Board
            var boardSize = GetGameProperty(listOfRows, "Board Size").FirstOrDefault();

            gameSetting.Board = new Board()
            {
                Size = boardSize
            };

            // Exit Position
            var exit         = GetGameProperty(listOfRows, "Exit Position").FirstOrDefault();
            var exitPosition = new ExitGame();

            exitPosition.InitializeVector(exit.GetLength(0), exit.GetLength(1));
            gameSetting.ExitPosition = exitPosition;

            // Mines
            var listOfMines = GetGameProperty(listOfRows, "Mine");

            foreach (var minePosition in listOfMines)
            {
                var mine = new Mine();
                mine.InitializeVector(minePosition.GetLength(0), minePosition.GetLength(1));
                gameSetting.ListOfMines.Add(mine);
            }

            // Starting Point
            const string turtleLabel     = "Starting Position";
            var          turtlePosition  = GetGameProperty(listOfRows, turtleLabel).FirstOrDefault();
            var          turtleDirection = GetTurtleStartingFacingPosition(listOfRows, turtleLabel);
            var          turtle          = Turtle.GetInstance();

            turtle.InitializeVector(turtlePosition.GetLength(0), turtlePosition.GetLength(1));
            turtle.Direction = turtleDirection;

            gameSetting.Turtle           = turtle;
            gameSetting.InitialDirection = turtleDirection;
            gameSetting.InitialPosition  = turtlePosition;

            return(gameSetting);
        }
示例#11
0
        public void EncodeAndDecode_JoinGame()
        {
            MessageId msgId  = new MessageId();
            MessageId convId = new MessageId();
            ExitGame  msg1   = new ExitGame()
            {
                MsgId = msgId, ConvId = convId, PlayerID = 2, GameID = 5
            };

            byte[] bytes = msg1.Encode();

            ExitGame msg2 = Message.Decode <ExitGame>(bytes);

            Assert.IsNotNull(msg2);
            Assert.AreEqual(msg1.MsgId, msg2.MsgId);
            Assert.AreEqual(msg1.ConvId, msg2.ConvId);
            Assert.AreEqual(msg1.GameID, msg2.GameID);
            Assert.AreEqual(msg1.PlayerID, msg2.PlayerID);
        }
示例#12
0
    void Start()
    {
        // mdm = GetComponentInChildren<MapData> ();
        zi = GameObject.Find("ZoneInfo");
        // Debug.Log("ZI position: "+zi.transform.position.x
        // +", "+zi.transform.position.y
        // +", "+ zi.transform.position.z);

        //Check if the Input Key field in the Unity Editor has an entry

        if (String.IsNullOrEmpty(inputKey))
        {
            inputKey = "OBJECTID";             //default key
            Debug.Log("Using default key of " + inputKey);
        }
        else
        {
            Debug.Log("Using key of " + inputKey);
        }

        //Check that the file input has an entry in the Unity Editor
        if (String.IsNullOrEmpty(inputFile))
        {
            Debug.LogError("ERROR:  Input file not specified in MapManager in Unity Editor");
        }
        else
        {
            Debug.Log("Loading file: " + inputFile);
            records = CSVReader.ReadFile(inputFile, inputKey);
            if (records != null)
            {
                Debug.Log("File " + inputFile + " has records count of " + records.Count);
                /***@TODO: Check if Input Key field is a valid key***/
            }
            else
            {
                Debug.LogError("CSVReader ERROR READING " + inputFile);
                Debug.LogError("Exit ");
                ExitGame.Quit();
            }
        }
    }
示例#13
0
        public Location LoadInn()
        {
            Location returnData;


            returnData             = new Location();
            returnData.Name        = "Beach Tower Inn";
            returnData.Description = "You belly up to the bar!";

            // Location Actions
            List <LocationAction> locationActions = new List <LocationAction>();

            LocationAction locationAction;

            locationAction = new RestAction(100);
            locationActions.Add(locationAction);

            locationAction = new BuyTravelRation();
            locationActions.Add(locationAction);

            locationAction = new SaveAction();
            locationActions.Add(locationAction);

            locationAction = new MainMenuAction();
            locationActions.Add(locationAction);

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;

            // Adjacent Locations
            Dictionary <string, LocationDefinition> adjacentLocationDefinitions = new Dictionary <string, LocationDefinition>();

            LocationDefinition locationDefinition = GetTownCenterDefinition();

            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            returnData.AdjacentLocationDefinitions = adjacentLocationDefinitions;

            return(returnData);
        }
    private void Start()
    {
        sT = GameObject.Find("Scripts").GetComponent <StoryTeller>();

        dT = GameObject.Find("Scripts").GetComponent <Data>();

        if (dT == null)
        {
            Debug.LogError("Data script not found");
            ExitGame.ExitStatic();
        }

        enemies = GameObject.FindGameObjectsWithTag("Enemy");

        positions = new Vector3[enemies.Length];
        for (int i = 0; i < enemies.Length; i++)
        {
            positions[i] = enemies[i].gameObject.transform.position;
        }
    }
示例#15
0
        public override void Load(IContentLoader loader)
        {
            var logoTexture = loader.Load <Texture2D>(ContentPaths.LOGO_START_SCREEN);

            logo = new ImageElement(logoTexture, new ImageElementSettings
            {
                HorizontalAlignment = ImageHorizontalAlignment.Center,
                VerticalAlignment   = ImageVerticalAlignment.Center,
            })
            {
                Position = base.Game.ScreenCenter + new Vector2(0, -100)
            };

            menu = new SimpleMenu(ContentPaths.FONT_UI_GENERAL, new Dictionary <string, Action>()
            {
                { "Start Game", () => StartGame?.Invoke(this, null) },
                { "Exit Game", () => ExitGame?.Invoke(this, null) }
            })
            {
                Position = base.Game.ScreenCenter
            };

            menu.Load(loader);
        }
示例#16
0
        /// <summary>
        /// Exit a game. If game was active and had not finished, player will loose the game.
        /// </summary>
        /// <param name="uid"></param>
        /// <returns>True if request was sent.</returns>
        public async Task <bool> ExitGame(uint uid)
        {
            var result = false;

            // Catch the event for game exit
            var          source  = new TaskCompletionSource <bool>();
            EventHandler handler = (sender, args) =>
            {
                source.TrySetResult(true);
            };

            // In case no answer was received, we have to cancel
            using (var ct = new CancellationTokenSource(NetworkTimeout * 1000))
            {
                ct.Token.Register(() => source.TrySetResult(false));
                try
                {
                    GameExitReceived += handler;
                    var pak = new ExitGame {
                        UID = uid
                    };
                    if (Send(JsonConvert.SerializeObject(pak, _serializerSettings), NetworkPacketType.ExitGame))
                    {
                        result = await source.Task;
                    }
                }
                catch (Exception e) { Log.WriteLine(LogPriority.Error, "NetworkGameClient::ExitGame(): " + e.Message); }
                finally { GameExitReceived -= handler; }
            }
            if (!result) // Screw it!
            {
                UID      = 0;
                IsJoined = false;
            }
            return(result);
        }
示例#17
0
    void Update()
    {
        // Test for universal key codes

        if (Input.GetKeyDown(KeyCode.F11))
        {
            // Change fullscreen movementMode

            SetFullscreen(!fullscreen);
        }

        if ((Input.GetKeyDown(KeyCode.LeftAlt) || Input.GetKeyDown(KeyCode.RightAlt)) && Input.GetKeyDown(KeyCode.F4))
        {
            // End programm

            // Save data

            Save();

            // Close

            ExitGame.Exit();
        }
    }
示例#18
0
        public Location LoadTownCenter()
        {
            Location       returnData;
            LocationAction locationAction;


            returnData             = new Location();
            returnData.Name        = "Banken";
            returnData.Description = "The small town of Banken, located in the middle of the Ashen Forest. There are several wooden buildings throughout the town. The town is mainly populated by Forest Rangers, but there are some civilians living there as well.";

            // Location Actions
            List <LocationAction> locationActions = new List <LocationAction>();

            locationAction = new DisplayStatsAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayInventoryAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayPotionBagAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayEquippedAction();
            locationActions.Add(locationAction);

            locationAction = new AffixSwapperAction();
            locationActions.Add(locationAction);

            locationAction = new StoreAction();
            locationActions.Add(locationAction);

            locationAction = new MainMenuAction();
            locationActions.Add(locationAction);

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;



            // Adjacent Locations
            Dictionary <string, LocationDefinition> adjacentLocationDefinitions = new Dictionary <string, LocationDefinition>();

            LocationDefinition locationDefinition = GetArenaDefinition();

            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetInnDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetWarCouncilDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            Accomplishment investigateShrine = Banken.GetBankenAccomplishments().Find(x => x.Name.Contains("Investigate Religious Shrine"));

            if (GameState.Hero.Accomplishments.Contains(investigateShrine))
            {
                locationDefinition = BankenAshenForest.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            locationDefinition = BeachTower.GetTownInstance().GetTownCenterDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            returnData.AdjacentLocationDefinitions = adjacentLocationDefinitions;

            return(returnData);
        }
示例#19
0
        public InGameUI(Code2015 game, Game parent, GameScene scene, GameState gamelogic)
        {
            this.parent = parent;
            this.logic  = gamelogic;

            this.game      = game;
            this.renderSys = game.RenderSystem;
            this.scene     = scene;


            this.player = parent.HumanPlayer;


            picker = new Picker(game, parent, scene, gamelogic);
            AddElement(picker);


            //this.infoUI = new InfoUI(game, parent, scene, gamelogic);
            //AddElement(infoUI);


            this.miniMap = new MiniMap(game, parent, scene, gamelogic);
            AddElement(miniMap);


            //-----Ruan-----------


            cityStatusInfo = new CitySelectInfo(game, parent, scene, gamelogic);
            AddElement(cityStatusInfo);

            objectStatusInfo = new ObjectSelectInfo(game, parent, scene, gamelogic);
            AddElement(objectStatusInfo);

            sendBallSelect = new RBallTypeSelect(game, parent, scene, gamelogic);
            AddElement(sendBallSelect);



            nigMenu = new NIGMenu(game, parent, scene, gamelogic);
            AddElement(nigMenu);
            nigColor = new NIGColor(game, parent, scene, gamelogic);
            AddElement(nigColor);
            nigWin = new NIGWin(game, parent, scene, gamelogic);
            AddElement(nigWin);
            nigFail = new NIGFail(game, parent, scene, gamelogic);
            AddElement(nigFail);
            nigObjective = new NIGObjective(game, parent, scene, gamelogic);
            AddElement(nigObjective);
            nigColor = new NIGColor(game, parent, scene, gamelogic);
            AddElement(nigColor);

            rankInfo = new RankInfo(game, parent, scene, gamelogic);
            AddElement(rankInfo);

            selectionMarker = new SelectionMarker(renderSys, gamelogic.Field, player);
            scene.Scene.AddObjectToScene(selectionMarker);


            layeredCursor = new Cursor(game, parent, scene, gamelogic, picker, cityStatusInfo, objectStatusInfo,
                                       sendBallSelect, miniMap, selectionMarker, rankInfo);
            AddElement(layeredCursor);


            exit = new ExitGame(game, parent, scene, gamelogic, nigMenu);
            AddElement(exit);

            quest = new Quest(game, parent, scene, gamelogic);
            AddElement(quest);
        }
示例#20
0
        public Location LoadTownCenter()
        {
            Location       returnData;
            LocationAction locationAction;


            returnData             = new Location();
            returnData.Name        = "Beach Tower Main Floor";
            returnData.Description = "Welcome to the main floor of the Beach Tower.";

            // Location Actions
            List <LocationAction> locationActions = new List <LocationAction>();

            locationAction = new DisplayStatsAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayInventoryAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayPotionBagAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayEquippedAction();
            locationActions.Add(locationAction);

            locationAction = new AffixSwapperAction();
            locationActions.Add(locationAction);

            locationAction = new StoreAction();
            locationActions.Add(locationAction);

            locationAction = new MainMenuAction();
            locationActions.Add(locationAction);

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;



            // Adjacent Locations
            Dictionary <string, LocationDefinition> adjacentLocationDefinitions = new Dictionary <string, LocationDefinition>();

            LocationDefinition locationDefinition = GetArenaDefinition();

            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetInnDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetCaptainOfficeDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            Accomplishment beachHeadPirates = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Beach Head Pirates"));

            if (GameState.Hero.Accomplishments.Contains(beachHeadPirates))
            {
                locationDefinition = BeachTowerBeachHead.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment mysteriousHouse = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Mysterious House"));

            if (GameState.Hero.Accomplishments.Contains(mysteriousHouse))
            {
                locationDefinition = BeachTowerMysteriousHouse.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment huntSpies = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Hunt Spies"));

            if (GameState.Hero.Accomplishments.Contains(huntSpies))
            {
                locationDefinition = BeachTowerSpies.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment freeVillage = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Recaptured Village"));

            if (GameState.Hero.Accomplishments.Contains(freeVillage))
            {
                locationDefinition = BeachTowerCapturedVillage.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment battleForTheSeas = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Battle for the Seas"));

            if (GameState.Hero.Accomplishments.Contains(battleForTheSeas))
            {
                locationDefinition = BeachTowerBattleForTheSeas.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            //Travel to Banken
            Accomplishment travelToBanken = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Travel to Banken"));

            if (GameState.Hero.Accomplishments.Contains(battleForTheSeas))
            {
                locationDefinition = Banken.GetTownInstance().GetStartingLocationDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            locationDefinition = Ankou.GetTownInstance().GetTownCenterDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            returnData.AdjacentLocationDefinitions = adjacentLocationDefinitions;

            return(returnData);
        }
示例#21
0
        public Location LoadTownCenter()
        {
            Location       returnData;
            LocationAction locationAction;


            returnData             = new Location();
            returnData.Name        = "Ankou Town Center";
            returnData.Description = "Welcome to the cozy Ankou Town Center.";

            // Location Actions
            List <LocationAction> locationActions = new List <LocationAction>();

            locationAction = new DisplayStatsAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayInventoryAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayPotionBagAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayEquippedAction();
            locationActions.Add(locationAction);

            locationAction = new AffixSwapperAction();
            locationActions.Add(locationAction);

            locationAction = new StoreAction();
            locationActions.Add(locationAction);

            locationAction = new MainMenuAction();
            locationActions.Add(locationAction);

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;



            // Adjacent Locations
            Dictionary <string, LocationDefinition> adjacentLocationDefinitions = new Dictionary <string, LocationDefinition>();

            LocationDefinition locationDefinition = GetArenaDefinition();

            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetInnDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetConstableOfficeDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            Accomplishment scummyMurdererMission = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Scummy Murderer"));

            if (GameState.Hero.Accomplishments.Contains(scummyMurdererMission))
            {
                locationDefinition = AnkouMurderShack.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment locateNecroMission = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Locate Necromancers"));

            if (GameState.Hero.Accomplishments.Contains(locateNecroMission))
            {
                locationDefinition = AnkouForest.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }
            Accomplishment silenceAriean = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Silence Ariean"));

            if (GameState.Hero.Accomplishments.Contains(silenceAriean))
            {
                locationDefinition = AnkouArieansEstate.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }
            Accomplishment killBanditTorturer = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Kill Bandit Torturer"));

            if (GameState.Hero.Accomplishments.Contains(killBanditTorturer))
            {
                locationDefinition = AnkouSeedyInn.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }
            Accomplishment investigateTunnels = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Investigate Tunnels"));

            if (GameState.Hero.Accomplishments.Contains(investigateTunnels))
            {
                locationDefinition = AnkouUndergroundTunnel.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment battleOfAnkou = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Battle of Ankou"));

            if (GameState.Hero.Accomplishments.Contains(battleOfAnkou))
            {
                locationDefinition = AnkouBattle.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment travelToTower = Ankou.GetAnkouAccomplishments().Find(x => x.Name.Contains("Travel to the Tower"));

            if (GameState.Hero.Accomplishments.Contains(travelToTower))
            {
                locationDefinition = BeachTower.GetTownInstance().GetTownCenterDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            locationDefinition = Watertown.GetTownInstance().GetTownCenterDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            returnData.AdjacentLocationDefinitions = adjacentLocationDefinitions;

            return(returnData);
        }
示例#22
0
 private void OnExitGame(ExitGame exitGameEvent)
 {
     Application.Quit();
 }
示例#23
0
文件: GUI.cs 项目: Shiyam23/t-beg
 public void SendResetToGame(string functor)
 {
     Console.WriteLine("Game reset");
     ExitGame.Invoke(this, new ViewEvent_Game("test", functor));
 }
示例#24
0
 private void OnExitGame()
 {
     ExitGame?.Invoke();
 }
示例#25
0
 void Awake()
 {
     sInstance = this;
 }
示例#26
0
 private void ExitButtonOnPointerUp()
 {
     Hide();
     ExitGame?.Invoke();
 }
示例#27
0
        public Location LoadTownCenter()
        {
            Location       returnData;
            LocationAction locationAction;


            returnData             = new Location();
            returnData.Name        = "Watertown Town Center";
            returnData.Description = "Welcome to the cozy Watertown Town Center.";

            // Location Actions
            List <LocationAction> locationActions = new List <LocationAction>();

            locationAction = new DisplayStatsAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayInventoryAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayPotionBagAction();
            locationActions.Add(locationAction);

            locationAction = new DisplayEquippedAction();
            locationActions.Add(locationAction);

            locationAction = new AffixSwapperAction();
            locationActions.Add(locationAction);

            locationAction = new StoreAction();
            locationActions.Add(locationAction);

            locationAction = new MainMenuAction();
            locationActions.Add(locationAction);

            locationAction = new ExitGame();
            locationActions.Add(locationAction);

            returnData.Actions = locationActions;



            // Adjacent Locations
            Dictionary <string, LocationDefinition> adjacentLocationDefinitions = new Dictionary <string, LocationDefinition>();

            LocationDefinition locationDefinition = GetArenaDefinition();

            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetInnDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            locationDefinition = GetConstableOfficeDefinition();
            adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);

            Accomplishment sewerKingAccomplishment = Watertown.GetWatertownAccomplishments().Find(x => x.Name.Contains("Sewer King"));

            if (GameState.Hero.Accomplishments.Contains(sewerKingAccomplishment))
            {
                locationDefinition = WatertownSewer.GetTownInstance().GetSewerEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment banditCaptainAccomplishment = Watertown.GetWatertownAccomplishments().Find(x => x.Name.Contains("Bandit Captain"));

            if (GameState.Hero.Accomplishments.Contains(banditCaptainAccomplishment))
            {
                locationDefinition = WatertownForest.GetTownInstance().GetForestEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment murderRoomAccomplishment = Watertown.GetWatertownAccomplishments().Find(x => x.Name.Contains("Bandit Murder"));

            if (GameState.Hero.Accomplishments.Contains(murderRoomAccomplishment))
            {
                locationDefinition = WatertownBanditHouse.GetTownInstance().GetEntranceDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            Accomplishment banditKingAccomplishment = Watertown.GetWatertownAccomplishments().Find(x => x.Name.Contains("Bandit God King"));

            if (GameState.Hero.Accomplishments.Contains(banditKingAccomplishment))
            {
                locationDefinition = Ankou.GetTownInstance().GetTownCenterDefinition();
                adjacentLocationDefinitions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            returnData.AdjacentLocationDefinitions = adjacentLocationDefinitions;

            return(returnData);
        }
示例#28
0
 public void OnExit()
 {
     ExitGame?.Invoke();
 }
示例#29
0
 private void OnExitGame()
 {
     ExitGame?.Invoke(this, EventArgs.Empty);
 }
示例#30
0
 //Quit Application
 private void exitGame()
 {
     ExitGame.QuitGame();
 }