Exemple #1
0
 public void InitializeGame(ITMGame game)
 {
     this.game = game;
     world     = game.World;
     map       = world.Map;
     game.AddEventItemSwing(Items.TreeFeller, onAxeSwing);
 }
Exemple #2
0
        private void ConsoleCommand(string str, ITMGame game, ITMPlayer player1, ITMPlayer player2, IOutputLog log)
        {
            str = str.ToLower();
            string[] commands = str.Split(' ');

            if (commands.Length > 1)
            {
                switch (commands[1])
                {
                case "help": log.WriteLine(QuickGatherHelp(commands)); break;

                case "toggleveinmine": log.WriteLine(ToggleVeinMining()); break;

                case "togglelumberjack": log.WriteLine(ToggleLumberJack()); break;

                case "toggleharvest": log.WriteLine(ToggleHarvesting()); break;

                case "saveconfig": log.WriteLine(SaveConfigs()); break;

                case "ver": log.WriteLine(GetVersion()); break;

                case "version": log.WriteLine(GetVersion()); break;

                default: log.WriteLine("Unknown Command use 'qg help' for more info"); break;
                }
            }
            else
            {
                log.WriteLine("Unknown Command use 'qg help' for help");
            }
        }
 void ITMPlugin.InitializeGame(ITMGame game)
 {
     this.game = game;
     game.World.ComponentPasted += OnComponentPasted;
     game.AddEventItemSwing(Item.DebugTool, Paste);
     game.AddEventItemSwing(Item.Wand, OverrideInput);
 }
Exemple #4
0
 public void RegisterEvents(ITMGame game)
 {
     foreach (Item item in this.Keys)
     {
         game.AddEventItemSwing(item, ItemSwingEvent);
         Logger.Log($"Registered {Globals1.ItemData[(int)item].IDString} swing event");
     }
 }
Exemple #5
0
        public void InitializeGame(ITMGame game)
        {
            this.game   = game;
            this.helper = new TMHelper(game);
            this.random = new Random();

            game.AddEventItemSwing(Items.Dice, EventSwingItem);
        }
 public void InitializeGame(ITMGame game)
 {
     Game  = game;
     World = game.World;
     Map   = game.World.Map;
     game.AddNotification("GTA Mod: Activated", NotifyRecipient.Local);
     game.AddEventItemSwing(Items.TrainSpawner, OnTrainSpawnerSwing);
     game.AddEventItemSwing(Items.VehicleSpawner, OnVehicleSpawnerSwing);
     game.AddItemCustomSetup(Item.Rasta, Permissions.Admin);
 }
Exemple #7
0
        public void InitializeGame(ITMGame game)
        {
            this.game   = game;
            this.helper = new TMHelper(game);

            foreach (Block b in badBlocks)
            {
                game.AddEventBlockMined(b, this.EventBlockMined);
                game.AddEventBlockPlaced(b, this.EventBlockPlaced);
            }
        }
        NewGuiMenu ITMPluginGUI.GetItemCustomSetupScreen(ITMGame game, ITMPlayer player, GlobalPoint3D p, Item itemID)
        {
            switch (itemID)
            {
            case Item.Rasta:
                return(new VehicleSetupScreen(game, player, p));

            default:
                return(null);
            }
        }
Exemple #9
0
 public SimpleScreen(INewGuiMenuScreen screen, ITMGame game, ITMPlayer player)
     : base(screen, game, player)
 {
     if (data.TextBox == null)
     {
         // one time initialization of static data
         data.TextBox     = "Some Text";
         data.DataField   = "Edit Me";
         data.SliderValue = 0.5f;
     }
 }
Exemple #10
0
 public void InitializeGame(ITMGame game)
 {
     try
     {
         _InitializeGame(game);
     }
     catch (Exception e)
     {
         Logger.LogErr($"Failed to InitializeGame\n{e}");
         throw new Exception("Failed to InitializeGame");
     }
 }
Exemple #11
0
 private void _InitializeGame(ITMGame game)
 {
     this.game = game;
     setRegistry.RegisterEvents(game);
     game.AddConsoleCommand((cmd, g, player, player2, output) =>
     {
         string[] args   = cmd.Split(' ');
         Item item       = itemDictionary.Get(args[1]);
         string idstring = Globals1.ItemData[(int)item].IDString;
         output.WriteLine($"{item}, {idstring}");
         output.WriteLine($"[{idstring.Equals(args[1], StringComparison.InvariantCultureIgnoreCase)}] {args[1]} == {idstring}");
     }, "regtest", "", "");
 }
        public void InitializeGame(ITMGame game)
        {
            this.game = game;

            //if (game.CurrentBiome == BiomeType.Grasslands && game.IsEasyDifficulty)
            //{
            //    OreProperties.AddOre(new OreProperty() { BlockID = Block.Diamond, DepositFrequency = 1000, DepositSize = 60, MaxDepth = 0.2f, MinDepth = 0 });
            //    OreProperties.AddOre(new OreProperty() { BlockID = Block.Ruby, DepositFrequency = 1000, DepositSize = 60, MaxDepth = 0.2f, MinDepth = 0 });
            //    OreProperties.AddOre(new OreProperty() { BlockID = Block.None, DepositFrequency = 1000000, DepositSize = 600, MaxDepth = 0.99f, MinDepth = 0 });
            //}

            game.AddNotification("Craig Mod 1: Activated", NotifyRecipient.Local);
        }
        ArcadeMachine ITMPluginArcade.GetArcadeMachine(int gameID, ITMGame game, ITMMap map, ITMPlayer player, GlobalPoint3D p, BlockFace face)
        {
            switch (gameID)
            {
            case 0:
                return(new TotalPongGame(game, map, player, p, face));

            case 1:
                return(new TotalDefenderGame(game, map, player, p, face));

            case 2:
                return(new TotalRoboGame(game, map, player, p, face));
            }
            return(null);
        }
Exemple #14
0
        public void InitializeGame(ITMGame game)
        {
            this.game  = game;
            this.world = game.World;
            this.map   = world.Map;

            // Preload sound effects so gameplay is not stuttered by load.
            pickSounds = new SoundEffect[4];
            //pickSounds[0] = game.AudioManager.LoadSoundEffectFromStream(ModPath + "357_reload1.wav");
            //pickSounds[1] = game.AudioManager.LoadSoundEffectFromStream(ModPath + "357_reload2.wav");
            //pickSounds[2] = game.AudioManager.LoadSoundEffectFromStream(ModPath + "357_reload3.wav");
            //pickSounds[3] = game.AudioManager.LoadSoundEffectFromStream(ModPath + "smg1_reload.wav");

            game.AddNotification("Lockpick Activated", NotifyRecipient.Local);
            game.AddEventItemSwing(Items.Lockpick, OnLockpickSwing);
        }
Exemple #15
0
        void ITMPlugin.InitializeGame(ITMGame game)
        {
            this.game    = game;
            entities     = new Entity[500];
            entityData   = new EntityData[500];
            entityActive = new bool[500];
            spawnPoints  = new List <Spawn>(100);
            entityCount  = 0;

            for (int i = 0; i < entities.Length; ++i)
            {
                entities[i]     = new Entity();
                entityData[i]   = new EntityData();
                entityActive[i] = false;
            }
        }
Exemple #16
0
        public void InitializeGame(ITMGame game)
        {
            lumberJackToolsCfg  = new ConfigFile("LumberJack.cfg");
            lumberJackBlocksCfg = new ConfigFile("LumberJackBlocks.cfg");

            veinMineToolsCfg = new ConfigFile("VeinMine.cfg");
            veinMineOresCfg  = new ConfigFile("VeinMineBlocks.cfg");

            harvestToolsCfg = new ConfigFile("Harvest.cfg");


            FloodSearchList = new List <GlobalPoint3D>();


            this.game = game;
            world     = game.World;
            map       = world.Map;
            game.AddEventBlockMined(Block.None, MyAction);
            game.AddConsoleCommand(ConsoleCommand, "qg", "runs specified command", "Commands: ToggleVeinMine, ToggleLumberJack, ToggleHarvest");


            if (!File.Exists(lumberJackToolsCfg.pathFileName))
            {
                BuildDefaultLumberJackToolConfig();
            }
            if (!File.Exists(lumberJackBlocksCfg.pathFileName))
            {
                BuildDefaultLumberJackBlockConfig();
            }

            if (!File.Exists(veinMineToolsCfg.pathFileName))
            {
                BuildDefaultMiningToolsConfig();
            }
            if (!File.Exists(veinMineOresCfg.pathFileName))
            {
                BuildDefaultMiningBlocksConfig();
            }

            if (!File.Exists(harvestToolsCfg.pathFileName))
            {
                BuildDefaultHarvestToolConfig();
            }

            LoadAllConfigs();
            RetrieveConfigData();
        }
Exemple #17
0
        public void InitializeGame(ITMGame game)
        {
            this.game  = game;
            this.world = game.World;
            this.map   = world.Map;

            // Preload sound effects so gameplay is not stuttered by load.
            pickSounds    = new SoundEffect[4];
            pickSounds[0] = game.AudioManager.LoadSoundEffectFromStream(FileSystem.RootPath + ModPath + "357_reload1.wav");
            pickSounds[1] = game.AudioManager.LoadSoundEffectFromStream(FileSystem.RootPath + ModPath + "357_reload2.wav");
            pickSounds[2] = game.AudioManager.LoadSoundEffectFromStream(FileSystem.RootPath + ModPath + "357_reload3.wav");
            pickSounds[3] = game.AudioManager.LoadSoundEffectFromStream(FileSystem.RootPath + ModPath + "smg1_reload.wav");

            game.AddNotification("Lockpick Activated", NotifyRecipient.Local);
            game.AddEventItemSwing(Items.Lockpick, OnLockpickSwing);
            game.AddConsoleCommand(CmdUnlock, "unlock", "Use lockpick on a Locked Door", "Use lockpick on a Locked Door\n\nunlock\n\nExamples:\nunlock  -- unlock the door.");
        }
Exemple #18
0
        public void InitializeGame(ITMGame game)
        {
            Game           = game;
            Logger.Logged += Logged;

            _ScriptPath = Path.Combine(Path.Combine(FileSystem.RootPath, game.World.WorldPath), "Scripts");

            if (!Directory.Exists(_ScriptPath))
            {
                Directory.CreateDirectory(_ScriptPath);
            }

            game.AddConsoleCommand((s, tmGame, arg3, arg4, arg5) =>
            {
                Script _s        = new Script();
                _s.Globals["os"] = new OSAPI(arg5);
                try
                {
                    _s.DoString(s.Substring(3));
                }
                catch (Exception e)
                {
                    Logger.Error(e.ToString());
                    arg5.WriteLine(e.ToString());
                }
            }, "lua", "Runs Lua.", "Runs Lua from the console.");

            game.AddConsoleCommand((s, tmGame, arg3, arg4, arg5) =>
            {
                string[] args    = s.Split(' ');
                Script _s        = new Script();
                _s.Globals["os"] = new OSAPI();
                try
                {
                    _s.DoFile(Path.Combine(_ScriptPath, args[1]));
                }
                catch (Exception e)
                {
                    Logger.Error(e.ToString());
                    arg5.WriteLine(e.ToString());
                }
            }, "dolua", "Runs Lua from a file.", "Runs lua from a file globally.");
        }
Exemple #19
0
 public VehicleSetupScreen(INewGuiMenuScreen screen, ITMGame game, ITMPlayer player, GlobalPoint3D p)
     : base(screen, game, player)
 {
     point = p;
 }
 void ITMPlugin.InitializeGame(ITMGame game)
 {
 }
 public void InitializeGame(ITMGame game)
 {
     Logger.Logged += Logged;
     _game          = game;
 }
Exemple #22
0
 ArcadeMachine ITMPluginArcade.GetArcadeMachine(int gameID, ITMGame game, ITMMap map, ITMPlayer player, GlobalPoint3D p, BlockFace face)
 {
     return(new BrickbreakerGame(game, map, player, p, face));
 }
Exemple #23
0
 public void InitializeGame(ITMGame game)
 {
     this.game = game;
     game.AddNotification("Arcade Games: Activated", NotifyRecipient.Local);
 }
Exemple #24
0
 void CmdUnlock(string command, ITMGame game, ITMPlayer caller, ITMPlayer player, IOutputLog log)
 {
     OnLockpickSwing(Items.Lockpick, player.RightHand);
 }
Exemple #25
0
 public TMHelper(ITMGame game)
 {
     this.game = game;
 }
 public void InitializeGame(ITMGame game)
 {
     this.game = game;
 }
Exemple #27
0
 public void InitializeGame(ITMGame game)
 {
     this.game  = game;
     this.world = game.World;
     this.map   = game.World.Map;
 }
Exemple #28
0
 public TotalRoboGame(ITMGame game, ITMMap map, ITMPlayer player, GlobalPoint3D point, BlockFace face)
     : base(game, map, player, point, face)
 {
 }
 public VehicleSetupScreen(ITMGame game, ITMPlayer player, GlobalPoint3D p)
     : base(game, player)
 {
     point = p;
 }
Exemple #30
0
 public void InitializeGame(ITMGame game)
 {
 }