Esempio n. 1
0
        private void DrawHooks_DrawInterface(SpriteBatch sb, HandledEventArgs e)
        {
            if (GameHooks.IsWorldRunning && currentSettings != null)
            {
                if (currentSettings.DrawGrid)
                {
                    TrainerHelper.DrawGrid(sb, gridTexture);
                }

                if (currentSettings.DrawGridCursor)
                {
                    TrainerHelper.DrawGridCursor(sb, border);
                }

                if (currentSettings.DrawPartyText)
                {
                    TrainerHelper.DrawPartyText(sb);
                }
            }
        }
Esempio n. 2
0
        private void TerrariaHooks_Update(GameTime gameTime)
        {
            if (trainerSettings != null && Game.IsActive)
            {
                if (trainerSettings.EnableTrainer)
                {
                    currentSettings = trainerSettings;
                }
                else
                {
                    currentSettings = defaultSettings;
                }

                if (InputManager.IsKeyPressed(Keys.F7))
                {
                    trainerForm.Visible = !trainerForm.Visible;
                }

                if (GameHooks.IsWorldRunning && !Main.chatMode)
                {
                    if (currentSettings.AllowBankOpen && InputManager.IsControlKeyDown && InputManager.IsKeyPressed(Keys.B))
                    {
                        TrainerHelper.OpenBank();
                    }
                    else if (currentSettings.CreateWater && InputManager.IsControlKeyDown && InputManager.IsKeyDown(Keys.Z, 250))
                    {
                        TrainerHelper.AddLiquidToCursor(true);
                    }
                    else if (currentSettings.CreateLava && InputManager.IsControlKeyDown && InputManager.IsKeyDown(Keys.X, 250))
                    {
                        TrainerHelper.AddLiquidToCursor(false);
                    }
                    else if (currentSettings.AllowCameraMove)
                    {
                        MoveCamera(gameTime);
                    }

                    if (currentSettings.CreateTile)
                    {
                        if ((InputManager.IsControlKeyDown || InputManager.IsShiftKeyDown) && InputManager.IsMouseButtonPressed(MouseButtons.Right))
                        {
                            positionOnClick = TrainerHelper.TileTarget;
                            rightMouseDown  = true;
                        }
                        else if (rightMouseDown && InputManager.IsMouseButtonReleased(MouseButtons.Right))
                        {
                            Item item = me.inventory[me.selectedItem];

                            if (item.active)
                            {
                                if (item.createTile >= 0)
                                {
                                    if (InputManager.IsControlKeyDown)
                                    {
                                        TrainerHelper.CreateRectangleTile(positionOnClick, TrainerHelper.TileTarget, item.createTile, false);
                                    }
                                    else if (InputManager.IsShiftKeyDown)
                                    {
                                        TrainerHelper.CreateLineTile(positionOnClick, TrainerHelper.TileTarget, item.createTile, false);
                                    }
                                }
                                else if (item.createWall >= 0)
                                {
                                    if (InputManager.IsControlKeyDown)
                                    {
                                        TrainerHelper.CreateRectangleTile(positionOnClick, TrainerHelper.TileTarget, item.createWall, true);
                                    }
                                    else if (InputManager.IsShiftKeyDown)
                                    {
                                        TrainerHelper.CreateLineTile(positionOnClick, TrainerHelper.TileTarget, item.createWall, true);
                                    }
                                }
                            }

                            rightMouseDown = false;
                        }
                        else if (!rightMouseDown && InputManager.IsMouseButtonDown(MouseButtons.Right))
                        {
                            Item item = me.inventory[me.selectedItem];

                            if (item.active)
                            {
                                if (item.createTile >= 0)
                                {
                                    TrainerHelper.AddTileToCursor(item.createTile, false, currentSettings.BigBrushSize);
                                }
                                else if (item.createWall >= 0)
                                {
                                    TrainerHelper.AddTileToCursor(item.createWall, true, currentSettings.BigBrushSize);
                                }
                            }
                        }
                    }

                    if ((InputManager.IsControlKeyDown || InputManager.IsShiftKeyDown) && InputManager.IsMouseButtonPressed(MouseButtons.Middle))
                    {
                        positionOnClick = TrainerHelper.TileTarget;
                        middleMouseDown = true;
                    }
                    else if (middleMouseDown && InputManager.IsMouseButtonReleased(MouseButtons.Middle))
                    {
                        if (currentSettings.DestroyTile)
                        {
                            if (InputManager.IsControlKeyDown)
                            {
                                TrainerHelper.DestroyRectangleTile(positionOnClick, TrainerHelper.TileTarget, false);
                            }
                            else if (InputManager.IsShiftKeyDown)
                            {
                                TrainerHelper.DestroyLineTile(positionOnClick, TrainerHelper.TileTarget, false);
                            }
                        }

                        if (currentSettings.DestroyWall)
                        {
                            if (InputManager.IsControlKeyDown)
                            {
                                TrainerHelper.DestroyRectangleTile(positionOnClick, TrainerHelper.TileTarget, true);
                            }
                            else if (InputManager.IsShiftKeyDown)
                            {
                                TrainerHelper.DestroyLineTile(positionOnClick, TrainerHelper.TileTarget, true);
                            }
                        }

                        middleMouseDown = false;
                    }
                    else if (!middleMouseDown && InputManager.IsMouseButtonDown(MouseButtons.Middle))
                    {
                        if (currentSettings.DestroyTile)
                        {
                            TrainerHelper.DestroyTileFromCursor(false, currentSettings.BigBrushSize);
                        }

                        if (currentSettings.DestroyWall)
                        {
                            TrainerHelper.DestroyTileFromCursor(true, currentSettings.BigBrushSize);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
 private void GameHooks_LoadContent(ContentManager obj)
 {
     gridTexture = TrainerHelper.CreateGrid(Game.GraphicsDevice, 0.1f);
     border      = DrawingHelper.CreateOnePixelTexture(Game.GraphicsDevice, Color.White);
 }
Esempio n. 4
0
        private void PlayerHooks_UpdatePhysics(Player obj)
        {
            if (GameHooks.IsWorldRunning && currentSettings != null)
            {
                #region Abilities

                if (currentSettings.Immune)
                {
                    me.immune = true;
                }

                if (currentSettings.InfiniteHealth)
                {
                    me.statLife = me.statLifeMax;
                }

                if (currentSettings.InfiniteMana)
                {
                    me.statMana = me.statManaMax;
                }

                if (currentSettings.InfiniteBreath)
                {
                    me.breath = me.breathMax;
                }

                if (currentSettings.InfiniteAmmo)
                {
                    foreach (Item item in me.inventory)
                    {
                        if (item.ammo > 0)
                        {
                            item.stack = item.maxStack - 1;
                        }
                    }
                }

                if (currentSettings.InfiniteBuffTime)
                {
                    for (int i = 0; i < 10; i++)
                    {
                        if (me.buffType[i] > 0 && me.buffTime[i] > 0)
                        {
                            me.buffTime[i] = 3600;
                        }
                    }
                }

                if (currentSettings.NoFallDamage)
                {
                    me.noFallDmg = true;
                }

                if (currentSettings.NoKnockback)
                {
                    me.noKnockback = true;
                }

                if (currentSettings.JumpBoost)
                {
                    me.jumpBoost = true;
                }

                if (currentSettings.InfiniteJump)
                {
                    me.doubleJump = true;
                    me.jumpAgain  = true;
                }
                else if (currentSettings.DoubleJump)
                {
                    me.doubleJump = true;
                }

                if (currentSettings.RocketBoots)
                {
                    me.rocketBoots = true;
                }

                if (currentSettings.UseFlipper)
                {
                    me.accFlipper = true;
                }

                if (currentSettings.FireWalk)
                {
                    me.fireWalk = true;
                }

                if (currentSettings.SpawnMax)
                {
                    me.spawnMax = true;
                }

                if (currentSettings.InstantRespawn)
                {
                    me.respawnTimer = 0;
                }

                if (currentSettings.NoPotionCooldown)
                {
                    me.potionDelay = 0;
                }

                if (currentSettings.NoManaCost)
                {
                    me.manaCost = 0;
                }

                me.SpeedModifier *= currentSettings.MovementSpeed;

                #endregion Abilities

                #region Other

                if (currentSettings.LightYourCharacter)
                {
                    TrainerHelper.LightCharacter();
                }

                if (currentSettings.LightCursor)
                {
                    TrainerHelper.LightCursor();
                }

                if (currentSettings.AllowKillGuide)
                {
                    me.killGuide = true;
                }

                if (currentSettings.DeathAura)
                {
                    TrainerHelper.KillWhoTouchingMe();
                }

                if (currentSettings.CursorKillNPC)
                {
                    TrainerHelper.KillWhoTouchingCursor();
                }

                #endregion Other

                #region Potions

                if (currentSettings.ObsidianSkin)
                {
                    me.lavaImmune = true;
                    me.fireWalk   = true;
                }

                if (currentSettings.Regeneration)
                {
                    me.lifeRegen += 4;
                }

                if (currentSettings.Swiftness)
                {
                    me.SpeedModifier *= 1.25f;
                }

                if (currentSettings.Gills)
                {
                    me.gills = true;
                }

                if (currentSettings.Ironskin)
                {
                    me.statDefense += 10;
                }

                if (currentSettings.ManaRegeneration)
                {
                    me.manaRegen += 20;
                }

                if (currentSettings.MagicPower)
                {
                    me.magicBoost *= 1.2f;
                }

                if (currentSettings.Featherfall)
                {
                    me.slowFall = true;
                }

                if (currentSettings.Spelunker)
                {
                    me.findTreasure = true;
                }

                if (currentSettings.Invisibility)
                {
                    me.invis = true;
                }

                if (currentSettings.Shine)
                {
                    TrainerHelper.LightCharacter();
                }

                if (currentSettings.NightOwl)
                {
                    me.nightVision = true;
                }

                if (currentSettings.Battle)
                {
                    me.enemySpawns = true;
                }

                if (currentSettings.Thorns)
                {
                    me.thorns = true;
                }

                if (currentSettings.WaterWalking)
                {
                    me.waterWalk = true;
                }

                if (currentSettings.Archery)
                {
                    me.archer = true;
                }

                if (currentSettings.Hunter)
                {
                    me.detectCreature = true;
                }

                if (currentSettings.Gravitation)
                {
                    me.gravControl = true;
                }

                #endregion Potions
            }
        }