Ejemplo n.º 1
0
 public static void Pcix_Console_MOD_ExtractComand(DebugConsoleScript __instance, ref string text)
 {
     string[] array = text.Split(new char[]
     {
         ' '
     });
     DebugConsoleScript.DebugCmdParam debugCmdParam;
     if (__instance.dic.TryGetValue(array[0], out debugCmdParam))
     {
         if (debugCmdParam.CheckParameterValidate(array))
         {
             Harmony_Patch.ExecuteModdedCommand(array[0], debugCmdParam);
         }
     }
 }
Ejemplo n.º 2
0
        public static void ExecuteModdedCommand(string cmd, DebugConsoleScript.DebugCmdParam cmdParam)
        {
            if (cmdParam.onlyBattle && Singleton <StageController> .Instance.State != StageController.StageState.Battle)
            {
                return;
            }
            switch (cmd)
            {
            case "help":
                Harmony_Patch.HelpCommand();
                break;

            case "showids":
                bool state = DebugConsoleScript.ParamParser.GetBool(cmdParam.paramValue[0]);
                Harmony_Patch.ShowIds(state);
                break;

            case "removeunit":
                string team  = DebugConsoleScript.ParamParser.GetString(cmdParam.paramValue[0]);
                int    index = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[1]);
                switch (team)
                {
                case "player":
                    RemoveUnit(Faction.Player, index);
                    break;

                case "enemy":
                    RemoveUnit(Faction.Enemy, index);
                    break;
                }
                break;

            case "addunit":
                index = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[0]);
                int id = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[1]);
                AddUnit(id, index);
                break;

            case "battleprepare":
                OpenBattlePrepare();
                break;

            case "restorelight":
                index = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[0]);
                int count = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[1]);
                RestoreLight(index, count);
                break;

            case "fullhealth":
                index = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[0]);
                FullHealth(index);
                break;

            case "drawcards":
                index = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[0]);
                count = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[1]);
                DrawCards(index, count);
                break;

            case "revive":
                index = DebugConsoleScript.ParamParser.GetInteger(cmdParam.paramValue[0]);
                Revive(index);
                break;
            }
            cmdParam.Clear();
        }