Ejemplo n.º 1
0
        public static string Capture(List <string> parameters)
        {
            if (parameters != null && parameters.Count == 2)
            {
                string name = parameters[0].Trim().ToLower();
                SCP    scp  = GameManager.Instance.GetSCP(name);

                if (scp != null)
                {
                    int index;
                    if (!int.TryParse(parameters[1], out index))
                    {
                        return("usage:\n" +
                               "capture <name> <cellnumber>");
                    }

                    SCPManager manager = GameManager.Instance.GetComponent <SCPManager>();

                    if (manager.CaptureSCP(scp.Name, GameManager.Instance.FindCell(index)))
                    {
                        return($"Captured {scp.Name}, moved into cell {index}");
                    }
                    else
                    {
                        return($"Capture of {scp.Name} unsuccessful!");
                    }
                }
                else
                {
                    return($"{name} not found!");
                }
            }
            return("usage:\n" +
                   "capture <name> <cellnumber>");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// GameManager will be a singleton and hold all of the money
        /// and people in a given room
        /// </summary>
        void Start()
        {
            // Create the defaults for the staff
            staff = new Dictionary <StaffType, List <Staff> >()
            {
                { StaffType.research, new List <Staff>() },
                { StaffType.security, new List <Staff>() }
            };

            // Create the defaults for the SCPs
            scps = new Dictionary <DangerLevel, List <SCP> >()
            {
                { DangerLevel.safe, new List <SCP>() },
                { DangerLevel.euclid, new List <SCP>() },
                { DangerLevel.keter, new List <SCP>() },
            };

            // Creates the commands to be used in the terminal
            commands = new Dictionary <string, RunCommand>()
            {
                { "capture", RunCommands.Capture },
                { "list", RunCommands.List },
                { "hire", RunCommands.Hire },
                { "move", RunCommands.Move },
                { "upgrade", RunCommands.Upgrade },
            };

            buildings = new Dictionary <string, GameObject>()
            {
                { "research", Instantiate(researchBuildingPrefab, screenLocation) },
                { "security", Instantiate(securityBuildingPrefab, screenLocation) },
                { "containment", Instantiate(containmentBuildingPrefab, screenLocation) }
            };

            siteMap = Instantiate(siteMapPrefab, screenLocation);

            siteName = "69";
            location = "~";
            money    = 10000;

            sceneSelect  = GetComponent <PictureSwap>();
            scpManager   = GetComponent <SCPManager>();
            staffManager = GetComponent <StaffManager>();
            moneyManager = GetComponent <Money>();
        }