예제 #1
0
        public override bool processSelectedItem(string selection, Player playerObject)
        {
            string Name = selection.Substring(0, selection.IndexOf("-") - 1);
            bool success = false;

            if (Name == "Drug Dealers")
            {
                success = playerObject.unlockNPC(Player.NPCType.drug);
            }
            else if (Name == "Gun Runners")
            {
                success = playerObject.unlockNPC(Player.NPCType.guns);
            }
            else if (Name == "Muscle")
            {
                success = playerObject.unlockNPC(Player.NPCType.muscle);
            }
            else if (Name == "Specialists")
            {
                success = playerObject.unlockNPC(Player.NPCType.specialists);
            }
            else if (Name == "Hookers")
            {
                success = playerObject.unlockNPC(Player.NPCType.hookers);
            }
            else if (Name == "Job Seeker")
            {
                success = playerObject.unlockNPC(Player.NPCType.jobs);
            }

            updateMenuOptions(playerObject.getNPCs());

            return success;
        }
예제 #2
0
        public override bool processSelectedItem(string selection, Player playerObject)
        {
            if (displayingJobs)
            {
                displayingJobs = false;

                foreach(job currJob in selectedJobs)
                {
                    if(currJob.missionText == selection)
                    {
                        menuText = selection + "\n";
                        menuText += "Mission reward: $" + currJob.moneyValue + "\n";
                        menuText += "Control reward: " + currJob.controlValue + "\n";
                        menuText += "Number of required Muscle: " + currJob.muscleRequired + "\n";
                        menuText += "Number of required bodyguards: " + currJob.bodyguardsRequired + "\n";
                        menuText += "Number of required hitmen: " + currJob.hitmenRequired + "\n";

                        menuOptions.Clear();
                        menuOptions.Add("Accept");
                        menuOptions.Add("Decline");

                        displayedJob = currJob;
                        break;
                    }
                }

                return false;
            }
            else
            {
                if (selection == "Accept")
                {
                    //need some way of adding this job to a queue back on game. Also only want one job accepted at a time, also need to check that the job is doable.
                    if (playerObject.haveRequiredNumberOfBodyguards(displayedJob.bodyguardsRequired)
                        && playerObject.haveRequiredNumberOfHitmen(displayedJob.hitmenRequired)
                        && playerObject.haveRequiredNumberOfMuscle(displayedJob.muscleRequired))
                    {
                        playerObject.assignJob(displayedJob);
                        menuText = "Sorry Boss, we can only support one job at a time, come back tomorrow";
                        menuOptions.Clear();
                        menuOptions.Add("Ok");

                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    displayingJobs = true;
                    menuText = originalMenuText;
                    updateMenuOptions();
                    return false;
                }
            }
        }
        public override bool processSelectedItem(string selection, Player playerObject)
        {
            string Name = selection.Substring(0, selection.IndexOf("-") - 1);

            if (Name == pimp.name)
            {
                if (playerObject.spendMoney(pimp.initialCost))
                {
                    pimp.currentNumber++;
                    updateMenuOptions();
                    return true;
                }
            }
            else if (Name == hitman.name)
            {
                if (playerObject.spendMoney(hitman.initialCost))
                {
                    hitman.currentNumber++;
                    updateMenuOptions();
                    return true;
                }
            }
            else if (Name == bodyguard.name)
            {
                if (playerObject.spendMoney(bodyguard.initialCost))
                {
                    bodyguard.currentNumber++;
                    updateMenuOptions();
                    return true;
                }
            }
            else if (Name == policeBriber.name)
            {
                if (playerObject.spendMoney(policeBriber.initialCost))
                {
                    policeBriber.currentNumber++;
                    updateMenuOptions();
                    return true;
                }
            }
            return false;
        }
예제 #4
0
        public virtual bool processSelectedItem(string selection, Player playerObject)
        {
            string Name = selection.Substring(0, selection.IndexOf("-") - 1);
            int i = 0;

            foreach (recruit currRecruit in recruitTypes)
            {
                if (currRecruit.name == Name)
                {
                    if (playerObject.spendMoney(currRecruit.initialCost))
                    {
                        recruit incrementDealer = (recruit)recruitTypes[i];
                        incrementDealer.currentNumber++;
                        recruitTypes[i] = incrementDealer;
                        updateMenuOptions();
                        return true;
                    }
                }
                i++;
            }

            return false;
        }
예제 #5
0
 public RandomGameEvents(Player playerIn)
 {
     playerObject = playerIn;
     //randomNumberGenerater = new Random();
 }
예제 #6
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            device = graphics.GraphicsDevice;

            officeTexture = Content.Load<Texture2D>("OfficeTemplate");
            playerTexture = Content.Load<Texture2D>("You");
            NPCTexture = Content.Load<Texture2D>("NPC");
            font = Content.Load<SpriteFont>("Georgia");
            menuTexture = CreateRectangle(400, 400);

            screenWidth = device.PresentationParameters.BackBufferWidth;
            screenHeight = device.PresentationParameters.BackBufferHeight;

            gameOverTexture = CreateRectangle(screenWidth, screenHeight);
            alertTexture = CreateRectangle(screenWidth / 2, screenHeight / 2);

            playerObject = new Player(playerTexture, officeTexture);
            level = new Map(officeTexture, screenWidth, screenHeight, playerObject.getLocation());
            menu = new GameMenu();

            gameEvents = new RandomGameEvents(playerObject);
        }