public Location LoadShipThree()
        {
            Location returnData;

            returnData             = new Location();
            returnData.Name        = "Pirate Ship Three";
            returnData.Description = "A large ship full of pirate slave masters and slaves.";
            bool defeatedMobs = Convert.ToBoolean(LocationHandler.GetLocationStateValue(BeachTower.LOCATION_STATE_KEY, BeachTowerPirateShips.SHIP_THREE_MOBS));
            bool freedSlaves  = Convert.ToBoolean(LocationHandler.GetLocationStateValue(BeachTower.LOCATION_STATE_KEY, BeachTowerPirateShips.SHIP_THREE_SLAVES));

            if (!defeatedMobs)
            {
                returnData.Description = "A large ship full of pirateslave masters and slaves.";

                List <LocationAction> locationActions = new List <LocationAction>();
                List <Mob>            mobs            = new List <Mob>();
                mobs.Add(new SlaveMaster());
                mobs.Add(new Slave());
                mobs.Add(new Slave());
                mobs.Add(new Slave());
                mobs.Add(new SlaveMaster());
                mobs.Add(new Slave());
                mobs.Add(new Slave());
                mobs.Add(new Slave());
                mobs.Add(new SlaveMaster());
                mobs.Add(new Slave());
                mobs.Add(new Slave());
                mobs.Add(new Slave());
                mobs.Add(new SlaveMaster());
                CombatAction combatAction = new CombatAction("Slave Masters and Slaves", mobs);
                combatAction.PostCombat += ShipThreeMobs;
                locationActions.Add(combatAction);
                returnData.Actions = locationActions;
            }
            else
            {
                returnData.Description = "A large ship full of dead pirateslave masters and slaves.";
            }

            if (defeatedMobs && !freedSlaves)
            {
                List <LocationAction> locationActions = new List <LocationAction>();
                TakeItemAction        itemAction      = new TakeItemAction("Free", "Slaves", "You free the remaining slaves and send them back toward the shore, hoping the Beach Tower guard can get to them before any other pirates find them.");
                locationActions.Add(itemAction);
                itemAction.PostItem += FreeSlavesShipThree;
                returnData.Actions   = locationActions;
            }


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

            //Town Center
            LocationDefinition locationDefinition = BeachTowerPirateShips.GetTownInstance().GetShipTwoDefinition();

            adjacentLocationDefintions.Add(locationDefinition.LocationKey, locationDefinition);

            if (defeatedMobs && freedSlaves)
            {
                locationDefinition = BeachTowerPirateShips.GetTownInstance().GetShipFourDefinition();
                adjacentLocationDefintions.Add(locationDefinition.LocationKey, locationDefinition);
            }

            returnData.AdjacentLocationDefinitions = adjacentLocationDefintions;

            return(returnData);
        }
示例#2
0
        public Location LoadWestTents()
        {
            Location returnData;

            returnData      = new Location();
            returnData.Name = "West Tents";
            bool defeatedPirates = Convert.ToBoolean(LocationHandler.GetLocationStateValue(BeachTower.LOCATION_STATE_KEY, BeachTowerBeachHead.WEST_PIRATES));
            bool tookChest       = Convert.ToBoolean(LocationHandler.GetLocationStateValue(BeachTower.LOCATION_STATE_KEY, BeachTowerBeachHead.WEST_CHEST));

            //Actions
            if (!defeatedPirates)
            {
                returnData.Description = "A collection of tents in the west. There are two pirates mingling about and a treasure chest.";

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

                List <Mob> mobs = new List <Mob>();
                mobs.Add(new Pirate());
                mobs.Add(new Pirate());
                CombatAction combatAction = new CombatAction("Pirates", mobs);
                combatAction.PostCombat += WestPirates;

                locationActions.Add(combatAction);

                returnData.Actions = locationActions;
            }
            else
            {
                if (!tookChest)
                {
                    returnData.Description = "A collection of tents in the west. There are two dead headless pirates treasure chest.";
                }
                else
                {
                    returnData.Description = "A collection of tents in the west. There are two dead headless pirates and an open treasure chest.";
                }
            }

            if (defeatedPirates && !tookChest)
            {
                List <LocationAction> locationActions = new List <LocationAction>();
                TreasureChestAction   itemAction      = new TreasureChestAction(2);
                locationActions.Add(itemAction);
                itemAction.PostItem += WestChest;
                returnData.Actions   = locationActions;
            }

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

            //Town Center
            LocationDefinition locationDefinition = BeachTowerBeachHead.GetTownInstance().GetCenterCampDefinition();

            adjacentLocationDefintions.Add(locationDefinition.LocationKey, locationDefinition);

            if (defeatedPirates)
            {
                Accomplishment report = BeachTower.GetBeachTowerAccomplishments().Find(x => x.Name.Contains("Pirate Ships"));
                if (GameState.Hero.Accomplishments.Contains(report))
                {
                    locationDefinition = BeachTowerPirateShips.GetTownInstance().GetEntranceDefinition();
                    adjacentLocationDefintions.Add(locationDefinition.LocationKey, locationDefinition);
                }

                returnData.AdjacentLocationDefinitions = adjacentLocationDefintions;
            }

            returnData.AdjacentLocationDefinitions = adjacentLocationDefintions;

            return(returnData);
        }