Пример #1
0
 public void InitializeGame(ITMGame game)
 {
     this.game = game;
     world     = game.World;
     map       = world.Map;
     game.AddEventItemSwing(Items.TreeFeller, onAxeSwing);
 }
Пример #2
0
 public Vehicle(VehiclesMod mod, VehicleDataXML data)
 {
     this.mod      = mod;
     map           = mod.Map;
     this.data     = data;
     DrawRotY      = data.RotY / 180f * MathHelper.Pi;
     smokeParticle = NewSmokeParticleData();
 }
Пример #3
0
 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);
 }
Пример #4
0
        public void BuildCustomMesh(ITMMeshBuilder meshBuilder, ITMMap map, GlobalPoint3D p, byte blockID)
        {
            switch ((Block)blockID)
            {
            case Blocks.TrainTrackStraight:
                BuildMeshTrainTrackStraight(meshBuilder, map, p, blockID);
                break;

            case Blocks.TrainTrackCorner:
                BuildMeshTrainTrackCorner(meshBuilder, map, p, blockID);
                break;
            }
        }
Пример #5
0
        BoundingBox GetBlockBoxCore(ITMMap map, GlobalPoint3D p)
        {
            float tilesize = map.TileSize;
            var   box      = new BoundingBox();

            box.Min.X = p.X * tilesize;
            box.Min.Y = p.Y * tilesize;
            box.Min.Z = p.Z * tilesize;
            box.Max.X = box.Min.X + tilesize;
            box.Max.Y = box.Min.Y + tilesize;
            box.Max.Z = box.Min.Z + tilesize;
            return(box);
        }
        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);
        }
Пример #7
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);
        }
Пример #8
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();
        }
Пример #9
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.");
        }
Пример #10
0
        void BuildMeshTrainTrackCorner(ITMMeshBuilder meshBuilder, ITMMap map, GlobalPoint3D p, byte blockID)
        {
            var tilesize = map.TileSize;
            var tc1      = meshBuilder.TexCoords1[blockID];
            var tc2      = meshBuilder.TexCoords2[blockID];
            var tc3      = meshBuilder.TexCoords3[blockID];
            var tc4      = meshBuilder.TexCoords4[blockID];

            meshBuilder.RotateTexCoords(ref p, (byte)BlockFace.Left, ref tc1, ref tc2, ref tc3, ref tc4);

            var data = new AVParams();

            data.Point    = p;
            data.BlockID  = blockID;
            data.IsCorner = true;
            data.Face     = (int)BlockFace.Up;
            data.Pos1     = map.GetPosition(p);
            data.Pos1.Y  -= tilesize;
            data.Pos2.X   = data.Pos1.X + tilesize;
            data.Pos2.Z   = data.Pos1.Z + tilesize;
            data.Pos2.Y   = data.Pos1.Y;

            data.X  = data.Pos1.X;
            data.Y  = data.Pos1.Y + 0.1f;
            data.Z  = data.Pos1.Z;
            data.TC = new NormalizedShort2(tc3.X, tc3.Y);
            meshBuilder.AddVertex(ref data);
            data.X  = data.Pos2.X;
            data.TC = new NormalizedShort2(tc1.X, tc1.Y);
            meshBuilder.AddVertex(ref data);
            data.Z  = data.Pos2.Z;
            data.TC = new NormalizedShort2(tc2.X, tc2.Y);
            meshBuilder.AddVertex(ref data);
            data.X  = data.Pos1.X;
            data.TC = new NormalizedShort2(tc4.X, tc4.Y);
            meshBuilder.AddVertex(ref data);
        }
Пример #11
0
 public void InitializeGame(ITMGame game)
 {
     this.game  = game;
     this.world = game.World;
     this.map   = game.World.Map;
 }
Пример #12
0
        void BuildMeshTrainTrackStraight(ITMMeshBuilder meshBuilder, ITMMap map, GlobalPoint3D p, byte blockID)
        {
            var tilesize = map.TileSize;
            var tc1      = meshBuilder.TexCoords1[blockID];
            var tc2      = meshBuilder.TexCoords2[blockID];
            var tc3      = meshBuilder.TexCoords3[blockID];
            var tc4      = meshBuilder.TexCoords4[blockID];

            meshBuilder.RotateTexCoords(ref p, (byte)BlockFace.Left, ref tc1, ref tc2, ref tc3, ref tc4);

            var data = new AVParams();

            data.Point    = p;
            data.BlockID  = blockID;
            data.IsCorner = true;
            data.Face     = (int)BlockFace.Up;
            data.Pos1     = map.GetPosition(p);
            data.Pos1.Y  -= tilesize;
            data.Pos2.X   = data.Pos1.X + tilesize;
            data.Pos2.Z   = data.Pos1.Z + tilesize;
            data.Pos2.Y   = data.Pos1.Y;
            var y1 = data.Pos1.Y;
            var y2 = data.Pos2.Y;
            var y3 = data.Pos2.Y;
            var y4 = data.Pos1.Y;

            #region Raise End
            Block b;
            var   aux = map.GetAuxData(p) & 0x01;
            if (aux == 0)
            {
                ++p.X;
                b = (Block)map.GetBlockID(p);
                if (b != Blocks.TrainTrackStraight && b != Blocks.TrainTrackCorner)
                {
                    ++p.Y;
                    b = (Block)map.GetBlockID(p);
                    if (b == Blocks.TrainTrackStraight || b == Blocks.TrainTrackCorner)
                    {
                        y2 += tilesize; y3 += tilesize;
                    }
                }
                else
                {
                    p.X -= 2;
                    b    = (Block)map.GetBlockID(p);
                    if (b != Blocks.TrainTrackStraight && b != Blocks.TrainTrackCorner)
                    {
                        ++p.Y;
                        b = (Block)map.GetBlockID(p);
                        if (b == Blocks.TrainTrackStraight || b == Blocks.TrainTrackCorner)
                        {
                            y1 += tilesize; y4 += tilesize;
                        }
                    }
                }
            }
            else
            {
                ++p.Z;
                b = (Block)map.GetBlockID(p);
                if (b != Blocks.TrainTrackStraight && b != Blocks.TrainTrackCorner)
                {
                    ++p.Y;
                    b = (Block)map.GetBlockID(p);
                    if (b == Blocks.TrainTrackStraight || b == Blocks.TrainTrackCorner)
                    {
                        y3 += tilesize; y4 += tilesize;
                    }
                }
                else
                {
                    p.Z -= 2;
                    b    = (Block)map.GetBlockID(p);
                    if (b != Blocks.TrainTrackStraight && b != Blocks.TrainTrackCorner)
                    {
                        ++p.Y;
                        b = (Block)map.GetBlockID(p);
                        if (b == Blocks.TrainTrackStraight || b == Blocks.TrainTrackCorner)
                        {
                            y1 += tilesize; y2 += tilesize;
                        }
                    }
                }
            }
            #endregion

            data.X  = data.Pos1.X;
            data.Y  = y1 + 0.1f;
            data.Z  = data.Pos1.Z;
            data.TC = new NormalizedShort2(tc3.X, tc3.Y);
            meshBuilder.AddVertex(ref data);
            data.X  = data.Pos2.X;
            data.Y  = y2 + 0.1f;
            data.TC = new NormalizedShort2(tc1.X, tc1.Y);
            meshBuilder.AddVertex(ref data);
            data.Z  = data.Pos2.Z;
            data.Y  = y3 + 0.1f;
            data.TC = new NormalizedShort2(tc2.X, tc2.Y);
            meshBuilder.AddVertex(ref data);
            data.X  = data.Pos1.X;
            data.Y  = y4 + 0.1f;
            data.TC = new NormalizedShort2(tc4.X, tc4.Y);
            meshBuilder.AddVertex(ref data);
        }
Пример #13
0
 ArcadeMachine ITMPluginArcade.GetArcadeMachine(int gameID, ITMGame game, ITMMap map, ITMPlayer player, GlobalPoint3D p, BlockFace face)
 {
     return(new BrickbreakerGame(game, map, player, p, face));
 }
Пример #14
0
 public TotalRoboGame(ITMGame game, ITMMap map, ITMPlayer player, GlobalPoint3D point, BlockFace face)
     : base(game, map, player, point, face)
 {
 }
Пример #15
0
 void OnComponentPasted(ITMPlayer player, ITMMap map, GlobalPoint3D p, BlockFace facing)
 {
     pasteMap    = map;
     pastePoint  = p;
     pasteFacing = facing;
 }