Ejemplo n.º 1
0
        private static void cc_mots(ConCommandArgs args)
        {
            args.CheckArgumentCount(1);
            if (!PluginEntry.Modules[ModuleName].IsEnabled)
            {
                Debug.LogWarning("The Motd module is not enabled.");
            }
            var    MOTD  = (MotD)PluginEntry.Modules[ModuleName];
            string stage = args.GetArgString(0).ToLower();

            if (args.Count < 2)
            {
                string mots = MOTD.GetMotS(args.GetArgString(0));
                if (mots == "")
                {
                    Debug.LogFormat("Stage '{0}' does not have any message set.", stage);
                }
                else
                {
                    Debug.Log(mots);
                }
                return;
            }
            string newMessage = Util.Console.MergeArgs(args, 2);

            MOTD.SetMotS(stage, newMessage);
            Debug.Log("Something something mots set.");
        }
Ejemplo n.º 2
0
 private static void CCChangeNetworkBodies(ConCommandArgs args)
 {
     DD2LobbySetupComponent.debug_characters = new string[]
     {
         args.GetArgString(0),
         args.GetArgString(1),
         args.GetArgString(2),
         args.GetArgString(3)
     };
 }
        private static void DropItemCommand(ConCommandArgs args)
        {
            var itemName  = args.GetArgString(0);
            var itemIndex = ItemNameToIndex(itemName);

            if (itemIndex == ItemIndex.None)
            {
                Console.print("Can't find item specified");
                return;
            }

            var count = args.TryGetArgInt(1) ?? 1;

            KookehsDropItemMod.Logger.LogDebug("Item index: " + itemIndex);

            var master = args.GetSenderMaster();

            var inventory     = master.inventory;
            var charTransform = master.GetBody().GetFieldValue <Transform>("transform");

            for (int i = 0; i < count; i++)
            {
                DropItemHandler.DropItem(charTransform, inventory, PickupCatalog.FindPickupIndex(itemIndex));
            }
        }
Ejemplo n.º 4
0
        private static void DeathStateClear(ConCommandArgs args)
        {
            var playerNetworkUser         = NetworkUser.readOnlyLocalPlayersList[0];
            var playerMasterObject        = playerNetworkUser.masterObject;
            var playerCameraRigController = playerNetworkUser.cameraRigController;

            CharacterMaster enemyToSpectate = null;

            if (args.Count == 1)
            {
                var masters = CharacterMaster.instancesList;
                foreach (var master in masters)
                {
                    if (master.name.StartsWith(args.GetArgString(0)))
                    {
                        enemyToSpectate = master;
                    }
                }
            }
            if (enemyToSpectate != null)
            {
                playerNetworkUser.masterObject = enemyToSpectate.gameObject;
                playerNetworkUser.masterObject = enemyToSpectate.GetBodyObject();
            }
        }
Ejemplo n.º 5
0
        public static void CCSubmodule(ConCommandArgs args)
        {
            args.CheckArgumentCount(1);
            string module = args.GetArgString(0);

            if (PluginEntry.Modules.ContainsKey(module))
            {
                if (args.Count == 1)
                {
                    Debug.LogFormat($"Module {module} is {(PluginEntry.Modules[module].IsEnabled ? "enabled" : "disabled")}.");
                    return;
                }
                bool?value = args.TryGetArgBool(1);
                if (value.HasValue)
                {
                    PluginEntry.Modules[module].IsEnabled = value.Value;
                }
                else
                {
                    Debug.Log("Cannot parse second argument.");
                }
            }
            else
            {
                Debug.LogFormat("Module not found. Available modules: {0}", string.Join(", ", PluginEntry.Modules.Keys));
            }
        }
Ejemplo n.º 6
0
        public static void Diorama(ConCommandArgs args)
        {
            var path    = "prefabs/stagedisplay/" + args.GetArgString(0) + "DioramaDisplay";
            var gay     = Resources.Load(path);
            var diorama = (GameObject)UnityEngine.Object.Instantiate(gay);

            diorama.transform.position = new Vector3(args.GetArgFloat(1), args.GetArgFloat(2), args.GetArgFloat(3));
        }
Ejemplo n.º 7
0
        public static void CMD_SpawnPrefab(ConCommandArgs args)
        {
            var path    = args.GetArgString(0);
            var gay     = Resources.Load(path);
            var diorama = (GameObject)UnityEngine.Object.Instantiate(gay);

            diorama.transform.position = new Vector3(args.GetArgFloat(1), args.GetArgFloat(2), args.GetArgFloat(3));
        }
Ejemplo n.º 8
0
        private static void ShowEndgameText(ConCommandArgs args)
        {
            if (args.GetArgString(0).ToLower() == "custom")
            {
                flavorText = args.GetArgString(1);
            }
            else
            {
                var bodyIndex = BodyCatalog.FindBodyIndexCaseInsensitive(args.GetArgString(0));
                if (bodyIndex < 0)
                {
                    Debug.Log("Couldn't find body index!");
                    return;
                }
                var survivorIndex = SurvivorCatalog.GetSurvivorIndexFromBodyIndex(bodyIndex);
                if (survivorIndex < 0)
                {
                    Debug.Log("Couldn't find survivor index!");
                    return;
                }
                SurvivorDef survivorDef = SurvivorCatalog.GetSurvivorDef(survivorIndex);
                if (!survivorDef)
                {
                    Debug.Log("SurvivorDef not found!");
                    return;
                }

                bool isWinQuote = true;
                if (args.Count == 2)
                {
                    if (args.GetArgString(1).ToLower() == "fail")
                    {
                        isWinQuote = false;
                    }
                }
                flavorText = GetOutroText(survivorDef, isWinQuote);
            }
            Debug.Log("Outro Text: " + flavorText);
            Debug.Log(Language.GetString(flavorText));
            RoR2.Console.instance.SubmitCmd(null, "set_scene outro", false);
        }
Ejemplo n.º 9
0
        //[ConCommand(commandName = "spawn_effect", flags = ConVarFlags.ExecuteOnServer, helpText = "")]
        public static void ChangeLight(ConCommandArgs args)
        {
            var effect = Resources.Load <GameObject>(args.GetArgString(0));

            if (effect)
            {
                EffectManager.SpawnEffect(effect, new EffectData
                {
                    origin = args.senderBody.corePosition,
                    scale  = JellyShockSkill.novaRadius
                }, true);
            }
        }
Ejemplo n.º 10
0
        private static void DCFindObject(ConCommandArgs args)
        {
            var component = args.senderMasterObject.GetComponent <DesCloneCommandComponent>();

            if (component)
            {
                var gameObj = GetGameObject(args.GetArgString(0));
                if (gameObj)
                {
                    component.chosenObject = gameObj;
                    Debug.Log(string.Format("Found GameObject {0} : {1}", gameObj, gameObj.name));
                }
                else
                {
                    Debug.Log("Couldn't find object!");
                }
            }
        }
Ejemplo n.º 11
0
        private static void SelectPast(ConCommandArgs args)
        {
            var character = args.GetArgString(0).ToLower();

            switch (character)
            {
            case "acrid":
                break;

            case "commando":
                break;

            case "engineer":
                break;

            case "captain":
                break;

            default:
                Debug.Log("No past data found for this name.");
                break;
            }
        }
Ejemplo n.º 12
0
        public static void ChangeLight(ConCommandArgs args)
        {
            var a = UnityEngine.Object.Instantiate(Resources.Load <GameObject>(args.GetArgString(0)));

            a.transform.position = args.senderBody.corePosition;
        }
Ejemplo n.º 13
0
 private void GameNetworkManager_CCConnect(On.RoR2.Networking.GameNetworkManager.orig_CCConnect orig, ConCommandArgs args)
 {
     if (args.Count == 2)
     {
         RoR2.Console.instance.SubmitCmd(args.sender ? args.sender : null, $"cl_password {args.GetArgString(1)}", false);
     }
     orig(args);
 }