Example #1
0
        public static void JumpPack()
        {
            try
            {
                if (PlayerMod.GetCurrentCharacter().ToString() != "Loader")
                {
                    Main.LocalPlayerBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage;
                }

                var forwardDirection = Main.LocalPlayerBody.GetComponent <InputBankTest>().moveVector.normalized;
                var aimDirection     = Main.LocalPlayerBody.GetComponent <InputBankTest>().aimDirection.normalized;
                var upDirection      = Main.LocalPlayerBody.GetComponent <InputBankTest>().moveVector.y + 1;
                var downDirection    = Main.LocalPlayerBody.GetComponent <InputBankTest>().moveVector.y - 1;
                var isForward        = Vector3.Dot(forwardDirection, aimDirection) > 0f;

                var isJumping = Main.LocalNetworkUser.inputPlayer.GetButton("Jump");
                // ReSharper disable once CompareOfFloatsByEqualityOperator

                if (isJumping)
                {
                    Main.LocalPlayerBody.characterMotor.velocity.y = upDirection += 0.75f * jumpPackMul;
                    jumpPackMul++;

                    if (jumpPackMul > 200)
                    {
                        jumpPackMul = 200;
                    }
                }
                else
                {
                    jumpPackMul = 1;
                }
            }
            catch (NullReferenceException) { }
        }
Example #2
0
 private void ModStatsRoutine()
 {
     if (_CharacterCollected)
     {
         if (damageToggle)
         {
             PlayerMod.LevelPlayersDamage();
         }
         if (critToggle)
         {
             PlayerMod.LevelPlayersCrit();
         }
         if (attackSpeedToggle)
         {
             PlayerMod.SetplayersAttackSpeed();
         }
         if (armorToggle)
         {
             PlayerMod.SetplayersArmor();
         }
         if (moveSpeedToggle)
         {
             PlayerMod.SetplayersMoveSpeed();
         }
         LocalPlayerBody.RecalculateStats();
     }
 }
Example #3
0
 private void AimBotRoutine()
 {
     if (aimBot)
     {
         PlayerMod.AimBot();
     }
 }
Example #4
0
        public static void DrawBuffMenu(float x, float y, float widthSize, int mulY, GUIStyle BGstyle, GUIStyle buttonStyle, GUIStyle LabelStyle, GUIStyle offStyle)
        {
            GUI.Box(new Rect(x + 0f, y + 0f, widthSize + 20, 50f + 45 * 15), "", BGstyle);
            GUI.Label(new Rect(x + 5f, y + 5f, widthSize + 10, 85f), "B U F F S   L I S T", LabelStyle);

            buffMenuScrollPosition = GUI.BeginScrollView(new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * 15), buffMenuScrollPosition, new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * mulY), false, true);
            PlayerMod.GiveBuff(buttonStyle, "giveBuff");
            GUI.EndScrollView();
        }
Example #5
0
        public static void CharacterWindowMethod(float x, float y, float widthSize, int mulY, GUIStyle BGstyle, GUIStyle buttonStyle, GUIStyle LabelStyle)
        {
            GUI.Box(new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * 15), "", BGstyle);
            GUI.Label(new Rect(x + 5f, y + 5f, widthSize + 5, 85f), "C H A R A C T E R   M E N U", LabelStyle);

            characterScrollPosition = GUI.BeginScrollView(new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * 15), characterScrollPosition, new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * mulY), false, true);
            PlayerMod.ChangeCharacter(buttonStyle, "character");
            GUI.EndScrollView();
        }
Example #6
0
 private void GodRoutine()
 {
     if (godToggle)
     {
         PlayerMod.GodMode();
     }
     else
     {
         LocalHealth.godMode = false;
     }
 }
Example #7
0
        // Clears inventory, duh.
        public static void ClearInventory()
        {
            if (Main.LocalPlayerInv)
            {
                // Loops through every item in ItemIndex enum
                foreach (string itemName in CurrentInventory())
                {
                    ItemIndex itemIndex = (ItemIndex)Enum.Parse(typeof(ItemIndex), itemName); //Convert itemName string to and ItemIndex
                    // If an item exists, delete the whole stack of it
                    Main.LocalPlayerInv.itemAcquisitionOrder.Remove(itemIndex);
                    Main.LocalPlayerInv.ResetItem(itemIndex);
                    int itemCount = Main.LocalPlayerInv.GetItemCount(itemIndex);
                    Main.LocalPlayerInv.RemoveItem(itemIndex, itemCount);

                    // Destroys BeetleGuardAllies on inventory clear, other wise they dont get removed until next stage.
                    var localUser  = LocalUserManager.GetFirstLocalUser();
                    var controller = localUser.cachedMasterController;
                    if (!controller)
                    {
                        return;
                    }
                    var body = controller.master.GetBody();
                    if (!body)
                    {
                        return;
                    }

                    var bullseyeSearch = new BullseyeSearch
                    {
                        filterByLoS       = false,
                        maxDistanceFilter = float.MaxValue,
                        maxAngleFilter    = float.MaxValue
                    };
                    bullseyeSearch.RefreshCandidates();
                    var hurtBoxList = bullseyeSearch.GetResults();
                    foreach (var hurtbox in hurtBoxList)
                    {
                        var    mob     = HurtBox.FindEntityObject(hurtbox);
                        string mobName = mob.name.Replace("Body(Clone)", "");
                        if (mobName == "BeetleGuardAlly")
                        {
                            var health = mob.GetComponent <HealthComponent>();
                            health.Suicide();
                        }
                    }
                }
                Main.LocalPlayerInv.SetEquipmentIndex(EquipmentIndex.None);
            }
            PlayerMod.RemoveAllBuffs();
        }
Example #8
0
        public static void DrawMovementMenu(float x, float y, float widthSize, int mulY, GUIStyle BGstyle, GUIStyle buttonStyle, GUIStyle OnStyle, GUIStyle OffStyle, GUIStyle LabelStyle, GUIStyle Highlighted)
        {
            GUI.Box(new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * mulY), "", BGstyle);
            GUI.Label(new Rect(x + 5f, y + 5f, widthSize + 10, 85f), "M O V E M E N T   M E N U", LabelStyle);

            if (Main.alwaysSprint)
            {
                if (GUI.Button(btn.BtnRect(1, false, "movement"), "A L W A Y S   S P R I N T : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 2, 1)))
                {
                    Main.alwaysSprint = false;
                }
            }
            else if (!Main.alwaysSprint)
            {
                if (GUI.Button(btn.BtnRect(1, false, "movement"), "A L W A Y S   S P R I N T : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 2, 1)))
                {
                    Main.alwaysSprint = true;
                }
            }
            if (Main.FlightToggle)
            {
                if (GUI.Button(btn.BtnRect(2, false, "movement"), "F L I G H T : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 2, 2)))
                {
                    if (PlayerMod.GetCurrentCharacter().ToString() != "Loader")
                    {
                        Main.LocalPlayerBody.bodyFlags &= CharacterBody.BodyFlags.None;
                    }
                    Main.FlightToggle = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(2, false, "movement"), "F L I G H T : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 2, 2)))
            {
                Main.FlightToggle = true;
            }
            if (Main.jumpPackToggle)
            {
                if (GUI.Button(btn.BtnRect(3, false, "movement"), "J U M P - P A C K : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 2, 3)))
                {
                    if (PlayerMod.GetCurrentCharacter().ToString() != "Loader")
                    {
                        Main.LocalPlayerBody.bodyFlags &= CharacterBody.BodyFlags.None;
                    }
                    Main.jumpPackToggle = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(3, false, "movement"), "J U M P - P A C K : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 2, 3)))
            {
                Main.jumpPackToggle = true;
            }
        }
Example #9
0
        public static void Flight()
        {
            try
            {
                if (PlayerMod.GetCurrentCharacter().ToString() != "Loader")
                {
                    Main.LocalPlayerBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage;
                }

                var forwardDirection = Main.LocalPlayerBody.GetComponent <InputBankTest>().moveVector.normalized;
                var aimDirection     = Main.LocalPlayerBody.GetComponent <InputBankTest>().aimDirection.normalized;
                var upDirection      = Main.LocalPlayerBody.GetComponent <InputBankTest>().moveVector.y + 1;
                var downDirection    = Main.LocalPlayerBody.GetComponent <InputBankTest>().moveVector.y - 1;
                var isForward        = Vector3.Dot(forwardDirection, aimDirection) > 0f;

                var isSprinting = Main.alwaysSprint ? Main.LocalPlayerBody.isSprinting : Main.LocalNetworkUser.inputPlayer.GetButton("Sprint");
                var isJumping   = Main.LocalNetworkUser.inputPlayer.GetButton("Jump");
                var isGoingDown = Input.GetKey(KeyCode.X);
                // ReSharper disable once CompareOfFloatsByEqualityOperator
                var isStrafing = Main.LocalNetworkUser.inputPlayer.GetAxis("MoveVertical") != 0f;

                if (isSprinting)
                {
                    if (!Main.alwaysSprint && !Main.LocalNetworkUser.inputPlayer.GetButton("Sprint"))
                    {
                        Main.LocalPlayerBody.isSprinting = false;
                    }

                    Main.LocalPlayerBody.characterMotor.velocity   = forwardDirection * 100f;
                    Main.LocalPlayerBody.characterMotor.velocity.y = upDirection * 0.510005f;
                    if (isStrafing)
                    {
                        if (isForward)
                        {
                            Main.LocalPlayerBody.characterMotor.velocity.y = aimDirection.y * 100f;
                        }
                        else
                        {
                            Main.LocalPlayerBody.characterMotor.velocity.y = aimDirection.y * -100f;
                        }
                    }
                }
                else
                {
                    Main.LocalPlayerBody.characterMotor.velocity   = forwardDirection * 50;
                    Main.LocalPlayerBody.characterMotor.velocity.y = upDirection * 0.510005f;
                    if (isStrafing)
                    {
                        if (isForward)
                        {
                            Main.LocalPlayerBody.characterMotor.velocity.y = aimDirection.y * 50;
                        }
                        else
                        {
                            Main.LocalPlayerBody.characterMotor.velocity.y = aimDirection.y * -50;
                        }
                    }
                }
                if (isJumping)
                {
                    Main.LocalPlayerBody.characterMotor.velocity.y = upDirection * 100;
                }
                if (isGoingDown)
                {
                    Main.LocalPlayerBody.characterMotor.velocity.y = downDirection * 100;
                }
            }
            catch (NullReferenceException) { }
        }
Example #10
0
        public static void DrawPlayerModMenu(float x, float y, float widthSize, int mulY, GUIStyle BGstyle, GUIStyle buttonStyle, GUIStyle OnStyle, GUIStyle OffStyle, GUIStyle LabelStyle, GUIStyle Highlighted)
        {
            GUI.Box(new Rect(x + 0f, y + 0f, widthSize + 10, 50f + 45 * mulY), "", BGstyle);
            GUI.Label(new Rect(x + 5f, y + 5f, widthSize + 5, 85f), "P L A Y E R   M E N U", LabelStyle);

            if (GUI.Button(btn.BtnRect(1, true, "playermod"), "G I V E   M O N E Y : " + PlayerMod.moneyToGive.ToString(), Navigation.HighlighedCheck(buttonStyle, Highlighted, 1, 1)))
            {
                PlayerMod.GiveMoney();
            }
            if (GUI.Button(new Rect(x + widthSize - 80, y + Main.PlayerModBtnY, 40, 40), "-", OffStyle))
            {
                if (PlayerMod.moneyToGive > 50)
                {
                    PlayerMod.moneyToGive -= 50;
                }
            }
            if (GUI.Button(new Rect(x + widthSize - 35, y + Main.PlayerModBtnY, 40, 40), "+", OffStyle))
            {
                if (PlayerMod.moneyToGive >= 50)
                {
                    PlayerMod.moneyToGive += 50;
                }
            }
            if (GUI.Button(btn.BtnRect(2, true, "playermod"), "G I V E   L U N A R   C O I N S : " + PlayerMod.coinsToGive.ToString(), Navigation.HighlighedCheck(buttonStyle, Highlighted, 1, 2)))
            {
                PlayerMod.GiveLunarCoins();
            }
            if (GUI.Button(new Rect(x + widthSize - 80, y + Main.PlayerModBtnY, 40, 40), "-", OffStyle))
            {
                if (PlayerMod.coinsToGive > 10)
                {
                    PlayerMod.coinsToGive -= 10;
                }
            }
            if (GUI.Button(new Rect(x + widthSize - 35, y + Main.PlayerModBtnY, 40, 40), "+", OffStyle))
            {
                if (PlayerMod.coinsToGive >= 10)
                {
                    PlayerMod.coinsToGive += 10;
                }
            }
            if (GUI.Button(btn.BtnRect(3, true, "playermod"), "G I V E   E X P E R I E N C E : " + PlayerMod.xpToGive.ToString(), Navigation.HighlighedCheck(buttonStyle, Highlighted, 1, 3)))
            {
                PlayerMod.GiveXP();
            }
            if (GUI.Button(new Rect(x + widthSize - 80, y + Main.PlayerModBtnY, 40, 40), "-", OffStyle))
            {
                if (PlayerMod.xpToGive > 50)
                {
                    PlayerMod.xpToGive -= 50;
                }
            }
            if (GUI.Button(new Rect(x + widthSize - 35, y + Main.PlayerModBtnY, 40, 40), "+", OffStyle))
            {
                if (PlayerMod.xpToGive >= 50)
                {
                    PlayerMod.xpToGive += 50;
                }
            }
            if (Main._isEditStatsOpen)
            {
                if (GUI.Button(btn.BtnRect(4, false, "playermod"), "S T A T S   M E N U : ON", Navigation.HighlighedCheck(OnStyle, Highlighted, 1, 4)))
                {
                    Main._isEditStatsOpen = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(4, false, "playermod"), "S T A T S   M E N U : OFF", Navigation.HighlighedCheck(OffStyle, Highlighted, 1, 4)))
            {
                Main._isEditStatsOpen = true;
            }
            if (Main._isChangeCharacterMenuOpen)
            {
                if (GUI.Button(btn.BtnRect(5, false, "playermod"), "C H A N G E   C H A R A C T E R : ON", Navigation.HighlighedCheck(OnStyle, Highlighted, 1, 5)))
                {
                    Main._isChangeCharacterMenuOpen = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(5, false, "playermod"), "C H A N G E   C H A R A C T E R : OFF", Navigation.HighlighedCheck(OffStyle, Highlighted, 1, 5)))
            {
                Main._isChangeCharacterMenuOpen = true;
            }

            if (Main._isBuffMenuOpen)
            {
                if (GUI.Button(btn.BtnRect(6, false, "playermod"), "G I V E   B U F F   M E N U : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 1, 6)))
                {
                    Main._isBuffMenuOpen = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(6, false, "playermod"), "G I V E   B U F F   M E N U : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 1, 6)))
            {
                Main._isBuffMenuOpen = true;
            }
            if (GUI.Button(btn.BtnRect(7, false, "playermod"), "R E M O V E   A L L   B U F F S", Navigation.HighlighedCheck(buttonStyle, Highlighted, 1, 7)))
            {
                PlayerMod.RemoveAllBuffs();
            }
            if (Main.aimBot)
            {
                if (GUI.Button(btn.BtnRect(8, false, "playermod"), "A I M B O T : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 1, 8)))
                {
                    EntityStates.FireNailgun.spreadPitchScale = 0.5f;
                    EntityStates.FireNailgun.spreadYawScale   = 1f;
                    EntityStates.FireNailgun.spreadBloomValue = 0.2f;
                    Main.aimBot = false;
                }
            }
            else if (!Main.aimBot)
            {
                if (GUI.Button(btn.BtnRect(8, false, "playermod"), "A I M B O T : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 1, 8)))
                {
                    EntityStates.FireNailgun.spreadPitchScale = 0;
                    EntityStates.FireNailgun.spreadYawScale   = 0;
                    EntityStates.FireNailgun.spreadBloomValue = 0;
                    Main.aimBot = true;
                }
            }
            if (Main.godToggle)
            {
                if (GUI.Button(btn.BtnRect(9, false, "playermod"), "G O D   M O D E : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 1, 9)))
                {
                    Main.godToggle = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(9, false, "playermod"), "G O D   M O D E : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 1, 9)))
            {
                Main.godToggle = true;
            }
            if (Main.skillToggle)
            {
                if (GUI.Button(btn.BtnRect(10, false, "playermod"), "I N F I N I T E   S K I L L S : O N", Navigation.HighlighedCheck(OnStyle, Highlighted, 1, 10)))
                {
                    Main.skillToggle = false;
                }
            }
            else if (GUI.Button(btn.BtnRect(10, false, "playermod"), "I N F I N I T E   S K I L L S : O F F", Navigation.HighlighedCheck(OffStyle, Highlighted, 1, 10)))
            {
                Main.skillToggle = true;
            }
            if (GUI.Button(btn.BtnRect(11, false, "playermod"), "U N L O C K   A L L", Navigation.HighlighedCheck(buttonStyle, Highlighted, 1, 11)))
            {
                PlayerMod.UnlockAll();
            }
        }