Example #1
0
        static bool Prefix(Player __instance, WeaponType wt, bool silent)
        {
            if (!GameplayManager.IsMultiplayer || !MPClassic.matchEnabled)
            {
                return(true);
            }

            if (wt != WeaponType.IMPULSE)
            {
                return(true);
            }

            if (!silent && __instance.isLocalPlayer)
            {
                GameplayManager.AddHUDMessage(Loc.LS("IMPULSE+ UPGRADED TO IMPULSE++ Q"), -1, true);
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.hud_notify_message1, 1f, 0.15f, 0.1f, false);
                __instance.m_weapon_level[(int)wt] = WeaponUnlock.LEVEL_2A;
            }

            if (__instance.isLocalPlayer)
            {
                __instance.MaybeShow3rdWeaponTip();
                __instance.UpdateCurrentWeaponName();
            }

            return(false);
        }
Example #2
0
        private static void swapToWeapon(string weaponName, bool silent = false)
        {
            if (!(GameManager.m_local_player.m_weapon_type.Equals(stringToWeaponType(weaponName))))
            {
                GameManager.m_local_player.Networkm_weapon_type = stringToWeaponType(weaponName);
                GameManager.m_local_player.CallCmdSetCurrentWeapon(GameManager.m_local_player.m_weapon_type);


                if (GameManager.m_game_state != GameManager.GameState.GAMEPLAY)
                {
                    return;
                }

                UIElement.WEAPON_SELECT_FLASH = 1.25f;
                UIElement.WEAPON_SELECT_NAME  = string.Format(Loc.LS("{0} SELECTED"), Player.WeaponNames[GameManager.m_local_player.m_weapon_type]);
                if (!silent)
                {
                    SFXCueManager.PlayCue2D(SFXCue.hud_cycle_typeA1, 1f, 0f, 0f, false);
                    GameManager.m_audio.PlayCue2D(363, 0.1f, 0f, 0f, false);
                    GameManager.m_local_player.c_player_ship.SetRefireDelayAfterWeaponSwitch();
                }

                GameManager.m_local_player.c_player_ship.m_thunder_power = 0f;
                GameManager.m_local_player.c_player_ship.SwitchVisibleWeapon(false, WeaponType.NUM);
            }
            if (!silent)
            {
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.hud_notify_message1, 1f, 0.15f, 0.1f, false);
            }
        }
Example #3
0
        public static void swapToMissile(int weapon_num, bool silent = false)
        {
            if (GameManager.m_local_player.m_missile_level[weapon_num] == WeaponUnlock.LOCKED || GameManager.m_local_player.m_missile_ammo[weapon_num] == 0)//GameManager.m_local_player.m_missile_ammo[weapon_num] == 0)
            {
                return;
            }
            if (GameManager.m_local_player.m_missile_type != (MissileType)weapon_num)
            {
                GameManager.m_local_player.Networkm_missile_type = (MissileType)weapon_num;
                GameManager.m_local_player.CallCmdSetCurrentMissile(GameManager.m_local_player.Networkm_missile_type);

                if (GameManager.m_game_state != GameManager.GameState.GAMEPLAY)
                {
                    return;
                }

                UIElement.WEAPON_SELECT_FLASH = 1.25f;
                UIElement.WEAPON_SELECT_NAME  = string.Format(Loc.LS("{0} SELECTED"), Player.MissileNames[GameManager.m_local_player.m_missile_type]);
                if (!silent)
                {
                    SFXCueManager.PlayCue2D(SFXCue.hud_cycle_typeA2, 1f, 0f, 0f, false);
                    GameManager.m_audio.PlayCue2D(362, 0.1f, 0f, 0f, false);

                    GameManager.m_local_player.c_player_ship.SetRefireDelayAfterMissileSwitch();
                }
                if (GameManager.m_local_player.m_missile_type == MissileType.DEVASTATOR)
                {
                    SFXCueManager.PlayCue2D(SFXCue.hud_warning_selected_dev, 1f, 0f, 0f, false);
                }

                GameManager.m_local_player.UpdateCurrentMissileName();
            }
        }
Example #4
0
        private static void OnCTFNotifyOld(NetworkMessage rawMsg)
        {
            var msg = rawMsg.ReadMessage <StringMessage>().value;

            GameplayManager.AddHUDMessage(msg, -1, true);
            SFXCueManager.PlayRawSoundEffect2D(SoundEffect.hud_notify_message1);
        }
Example #5
0
        private static void OnCTFNotify(NetworkMessage rawMsg)
        {
            var msg = rawMsg.ReadMessage <CTFNotifyMessage>();

            if (msg.m_message != null)
            {
                GameplayManager.AddHUDMessage(msg.m_message, -1, true);
            }
            Debug.Log("OnCTFNotify " + msg.m_event);
            switch (msg.m_event)
            {
            case CTFEvent.PICKUP:
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.sfx_lockdown_initiated, 1f, 0.8f, 0f, false);
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.sfx_alien_tele_warp, 1f, 0f, 0f, false);
                break;

            case CTFEvent.DROP:
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.cine_sfx_warning_2, 0.7f, 0f, 0f, false);
                break;

            case CTFEvent.RETURN:
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.sfx_matcenter_warp_high1, 1.1f, 0f, 0f, false);
                break;

            case CTFEvent.SCORE:
                SFXCueManager.PlayRawSoundEffect2D(SoundEffect.ui_upgrade, 1f, 0f, 0f, false);
                break;
            }
        }
Example #6
0
 private static void doNeverSelectStuffForSecondary(int i)
 {
     MPAutoSelection.SecondaryNeverSelect[i] = !MPAutoSelection.SecondaryNeverSelect[i];
     if (!MPAutoSelection.SecondaryNeverSelect[i])
     {
         SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
     }
     else
     {
         SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
     }
     DrawMpAutoselectOrderingScreen.saveToFile();
 }
 private static void doNeverSelectStuffForSecondary(int i)
 {
     MPAutoSelection.SecondaryNeverSelect[i] = !MPAutoSelection.SecondaryNeverSelect[i];
     if (!MPAutoSelection.SecondaryNeverSelect[i])
     {
         SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
     }
     else
     {
         SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
     }
     ExtendedConfig.Section_AutoSelect.Set(true);
 }
Example #8
0
 private static void doSelectedStuffForSecondary(int i)
 {
     if (selected2 < 1)
     {
         DrawMpAutoselectOrderingScreen.isSecondarySelected[i] = true;
         GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
     }
     else
     {
         DrawMpAutoselectOrderingScreen.isSecondarySelected[i] = true;
         DrawMpAutoselectOrderingScreen.SwapSelectedSecondary();
         SFXCueManager.PlayCue2D(SFXCue.ui_upgrade, 0.8f, 0f, 0f, false);
     }
 }
Example #9
0
 private static void doSelectedStuffForPrimary(int i)
 {
     if (selected < 1)
     {
         DrawMpAutoselectOrderingScreen.isPrimarySelected[i] = true;
         GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
     }
     else
     {
         if (DrawMpAutoselectOrderingScreen.isPrimarySelected[i])
         {
             DrawMpAutoselectOrderingScreen.isPrimarySelected[i] = false;
             GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
         }
         else
         {
             DrawMpAutoselectOrderingScreen.isPrimarySelected[i] = true;
             DrawMpAutoselectOrderingScreen.SwapSelectedPrimary();
             SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
         }
     }
 }
 private static void doSelectedStuffForSecondary(int i)
 {
     if (selected2 < 1)
     {
         MPAutoSelectUI_UIElement_Draw.isSecondarySelected[i] = true;
         GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
     }
     else
     {
         if (MPAutoSelectUI_UIElement_Draw.isSecondarySelected[i])
         {
             MPAutoSelectUI_UIElement_Draw.isSecondarySelected[i] = false;
             GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
         }
         else
         {
             MPAutoSelectUI_UIElement_Draw.isSecondarySelected[i] = true;
             MPAutoSelectUI_UIElement_Draw.SwapSelectedSecondary();
             SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
         }
     }
 }
            public static void Postfix(int amt, MissileType mt, Player __instance)
            {
                if ((GameplayManager.IsChallengeMode || GameplayManager.IsMission) && !GameplayManager.IsMultiplayerActive && MPAutoSelection.secondarySwapFlag && __instance == GameManager.m_local_player)
                {
                    uConsole.Log(mt.ToString() + ", amt:" + amt);
                    int         new_missile     = MPAutoSelection.getMissilePriority(mt);
                    int         current_missile = MPAutoSelection.getMissilePriority(GameManager.m_local_player.m_missile_type);
                    MissileType old_missile     = GameManager.m_local_player.m_missile_type;
                    if (new_missile < current_missile && !MPAutoSelection.SecondaryNeverSelect[new_missile])
                    {
                        sp_next_missileType = mt;
                        delay = 1;
                    }

                    if (GameManager.m_local_player.m_missile_type == MissileType.DEVASTATOR && old_missile != MissileType.DEVASTATOR)
                    {
                        if (MPAutoSelection.zorc)
                        {
                            SFXCueManager.PlayCue2D(SFXCue.enemy_boss1_alert, 1f, 0f, 0f, false);
                            GameplayManager.AlertPopup(Loc.LS("DEVASTATOR SELECTED"), string.Empty, 5f);
                        }
                    }
                }
            }
Example #12
0
            public static void Postfix()
            {
                selected  = DrawMpAutoselectOrderingScreen.returnPrimarySelected();
                selected2 = DrawMpAutoselectOrderingScreen.returnSecondarySelected();
                switch (MenuManager.m_menu_sub_state)
                {
                case MenuSubState.ACTIVE:
                    if (MenuManager.m_menu_micro_state == 3)
                    {
                        switch (UIManager.m_menu_selection)
                        {
                        case 200:
                        case 201:
                        case 202:
                        case 203:
                            if (UIManager.PushedSelect(100))
                            {
                                MenuManager.m_menu_micro_state = UIManager.m_menu_selection - 200;
                                MenuManager.UIPulse(1f);
                                GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
                            }
                            break;

                        // Triggers Swap Logic for the Primary Weapon Buttons
                        case 1720:
                        case 1721:
                        case 1722:
                        case 1723:
                        case 1724:
                        case 1725:
                        case 1726:
                        case 1727:         // int nwhen (MenuManager.m_menu_micro_state > 1719 && MenuManager.m_menu_micro_state <= 1727):
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(UIManager.m_menu_selection - 1720);
                            }
                            break;


                        // Triggers Swap Logic for the Secondary Weapon Buttons
                        case 1728:
                        case 1729:
                        case 1730:
                        case 1731:
                        case 1732:
                        case 1733:
                        case 1734:
                        case 1735:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(UIManager.m_menu_selection - 1728);
                            }
                            break;

                        // Triggers Neverselect Logic for the Primary Buttons
                        case 2000:
                        case 2001:
                        case 2002:
                        case 2003:
                        case 2004:
                        case 2005:
                        case 2006:
                        case 2007:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(UIManager.m_menu_selection - 2000);
                            }
                            break;

                        // Triggers Neverselect Logic for the Secondary Buttons
                        case 2010:
                        case 2011:
                        case 2012:
                        case 2013:
                        case 2014:
                        case 2015:
                        case 2016:
                        case 2017:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(UIManager.m_menu_selection - 2010);
                            }
                            break;

                        case 2100:
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.primarySwapFlag || MPAutoSelection.secondarySwapFlag)
                                {
                                    MPAutoSelection.primarySwapFlag   = false;
                                    MPAutoSelection.secondarySwapFlag = false;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.primarySwapFlag    = true;
                                    MPAutoSelection.secondarySwapFlag  = true;
                                    MenuManager.opt_primary_autoswitch = 0;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2102:
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.secondarySwapFlag)
                                {
                                    MPAutoSelection.secondarySwapFlag = false;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.secondarySwapFlag = true;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2103:
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.primarySwapFlag)
                                {
                                    MPAutoSelection.primarySwapFlag = false;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.primarySwapFlag    = true;
                                    MenuManager.opt_primary_autoswitch = 0;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2104:         //
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.zorc)
                                {
                                    MPAutoSelection.zorc = false;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.zorc = true;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2105:         //
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.dontAutoselectAfterFiring)
                                {
                                    MPAutoSelection.dontAutoselectAfterFiring = false;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.dontAutoselectAfterFiring = true;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2106:         //
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.swapWhileFiring)
                                {
                                    MPAutoSelection.swapWhileFiring = false;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.swapWhileFiring = true;
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;



                        default:
                            if (UIManager.PushedSelect(100) && UIManager.m_menu_selection == 100)
                            {
                                uConsole.Log("Definitly 203 " + Player.Mp_loadout1 + " : " + Player.Mp_loadout2);
                                UIManager.DestroyAll(false);
                                MenuManager.PlaySelectSound(1f);
                                if (MPAutoSelection.isCurrentlyInLobby)
                                {
                                    MenuManager.ChangeMenuState(MenuState.MP_PRE_MATCH_MENU, false);
                                }
                                else
                                {
                                    MenuManager.ChangeMenuState(MenuState.MP_MENU, false);
                                }
                                DrawMpAutoselectOrderingScreen.isInitialised = false;
                            }
                            break;
                        }
                    }
                    else
                    {
                        //uConsole.Log("NOT 203 "+Player.Mp_loadout1 + " : " + Player.Mp_loadout2);
                        if (Player.Mp_loadout1 == 203 || Player.Mp_loadout2 == 203)
                        {
                            Player.Mp_loadout1 = loadout1LastTick;
                            Player.Mp_loadout2 = loadout2LastTick;
                        }
                        else
                        {
                            loadout1LastTick = Player.Mp_loadout1;
                            loadout2LastTick = Player.Mp_loadout2;
                        }
                        if (UIManager.PushedSelect(100) && UIManager.m_menu_selection == 203)
                        {
                            //MenuManager.SetDefaultSelection(-1);
                            MenuManager.m_menu_micro_state = 3;
                            MenuManager.UIPulse(1f);
                            GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
                        }
                    }



                    break;
                }
            }
Example #13
0
            public static void Postfix()
            {
                selected  = DrawMpAutoselectOrderingScreen.returnPrimarySelected();
                selected2 = DrawMpAutoselectOrderingScreen.returnSecondarySelected();
                switch (MenuManager.m_menu_sub_state)
                {
                case MenuSubState.ACTIVE:
                    if (MenuManager.m_menu_micro_state == 3)
                    {
                        switch (UIManager.m_menu_selection)
                        {
                        case 200:
                        case 201:
                        case 202:
                        case 203:
                            if (UIManager.PushedSelect(100))
                            {
                                MenuManager.m_menu_micro_state = UIManager.m_menu_selection - 200;
                                MenuManager.UIPulse(1f);
                                GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
                            }
                            break;

                        case 1720:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(0);
                            }
                            break;

                        case 1721:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(1);
                            }
                            break;

                        case 1722:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(2);
                            }
                            break;

                        case 1723:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(3);
                            }
                            break;

                        case 1724:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(4);
                            }
                            break;

                        case 1725:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(5);
                            }
                            break;

                        case 1726:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(6);
                            }
                            break;

                        case 1727:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForPrimary(7);
                            }
                            break;

                        case 1728:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(0);
                            }
                            break;

                        case 1729:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(1);
                            }
                            break;

                        case 1730:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(2);
                            }
                            break;

                        case 1731:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(3);
                            }
                            break;

                        case 1732:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(4);
                            }
                            break;

                        case 1733:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(5);
                            }
                            break;

                        case 1734:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(6);
                            }
                            break;

                        case 1735:
                            if (UIManager.PushedSelect(100))
                            {
                                doSelectedStuffForSecondary(7);
                            }
                            break;

                        case 2000:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(0);
                            }
                            break;

                        case 2001:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(1);
                            }
                            break;

                        case 2002:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(2);
                            }
                            break;

                        case 2003:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(3);
                            }
                            break;

                        case 2004:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(4);
                            }
                            break;

                        case 2005:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(5);
                            }
                            break;

                        case 2006:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(6);
                            }
                            break;

                        case 2007:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForPrimary(7);
                            }
                            break;

                        case 2010:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(0);
                            }
                            break;

                        case 2011:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(1);
                            }
                            break;

                        case 2012:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(2);
                            }
                            break;

                        case 2013:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(3);
                            }
                            break;

                        case 2014:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(4);
                            }
                            break;

                        case 2015:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(5);
                            }
                            break;

                        case 2016:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(6);
                            }
                            break;

                        case 2017:
                            if (UIManager.PushedSelect(100))
                            {
                                doNeverSelectStuffForSecondary(7);
                            }
                            break;

                        case 2100:
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.primarySwapFlag || MPAutoSelection.secondarySwapFlag)
                                {
                                    MPAutoSelection.primarySwapFlag   = false;
                                    MPAutoSelection.secondarySwapFlag = false;
                                    SFXCueManager.PlayCue2D(SFXCue.enemy_detonatorA_death_roll, 0.8f, 0f, 0f, false);
                                    //SFXCueManager.PlayRawSoundEffect2D(SoundEffect.door_close2, 1f, -0.2f, 0.25f, false);
                                }
                                else
                                {
                                    MPAutoSelection.primarySwapFlag    = true;
                                    MPAutoSelection.secondarySwapFlag  = true;
                                    MenuManager.opt_primary_autoswitch = 0;
                                    SFXCueManager.PlayCue2D(SFXCue.enemy_detonatorB_alert, 0.8f, 0f, 0f, false);
                                    // SFXCueManager.PlayRawSoundEffect2D(SoundEffect.door_open2, 1f, -0.2f, 0.25f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2101:         //REPLACE
                            /*
                             *      if (UIManager.PushedSelect(100))
                             *      {
                             * if (MPAutoSelection.patchPrevNext)
                             * {
                             * MPAutoSelection.patchPrevNext = false;
                             * SFXCueManager.PlayCue2D(SFXCue.guidebot_response_negative, 0.8f, 0f, 0f, false);
                             * }
                             * else
                             * {
                             * MPAutoSelection.patchPrevNext = true;
                             * SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
                             * }
                             * DrawMpAutoselectOrderingScreen.saveToFile();
                             *      }*/
                            break;

                        case 2102:
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.secondarySwapFlag)
                                {
                                    MPAutoSelection.secondarySwapFlag = false;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_response_negative, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.secondarySwapFlag = true;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2103:
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.primarySwapFlag)
                                {
                                    MPAutoSelection.primarySwapFlag = false;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_response_negative, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.primarySwapFlag = true;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2104:         //
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.zorc)
                                {
                                    MPAutoSelection.zorc = false;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_response_negative, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.zorc = true;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;

                        case 2105:         //
                            if (UIManager.PushedSelect(100))
                            {
                                if (MPAutoSelection.COswapToHighest)
                                {
                                    MPAutoSelection.COswapToHighest = false;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_response_negative, 0.8f, 0f, 0f, false);
                                }
                                else
                                {
                                    MPAutoSelection.COswapToHighest = true;
                                    SFXCueManager.PlayCue2D(SFXCue.guidebot_objective_found, 0.8f, 0f, 0f, false);
                                }
                                DrawMpAutoselectOrderingScreen.saveToFile();
                            }
                            break;



                        default:
                            if (UIManager.PushedSelect(100) && UIManager.m_menu_selection == 100)
                            {
                                uConsole.Log("Definitly 203 " + Player.Mp_loadout1 + " : " + Player.Mp_loadout2);
                                UIManager.DestroyAll(false);
                                MenuManager.PlaySelectSound(1f);
                                if (MPAutoSelection.isCurrentlyInLobby)
                                {
                                    MenuManager.ChangeMenuState(MenuState.MP_PRE_MATCH_MENU, false);
                                }
                                else
                                {
                                    MenuManager.ChangeMenuState(MenuState.MP_MENU, false);
                                }
                                DrawMpAutoselectOrderingScreen.isInitialised = false;
                            }
                            break;
                        }
                    }
                    else
                    {
                        //uConsole.Log("NOT 203 "+Player.Mp_loadout1 + " : " + Player.Mp_loadout2);
                        if (Player.Mp_loadout1 == 203 || Player.Mp_loadout2 == 203)
                        {
                            Player.Mp_loadout1 = loadout1LastTick;
                            Player.Mp_loadout2 = loadout2LastTick;
                        }
                        else
                        {
                            loadout1LastTick = Player.Mp_loadout1;
                            loadout2LastTick = Player.Mp_loadout2;
                        }
                        if (UIManager.PushedSelect(100) && UIManager.m_menu_selection == 203)
                        {
                            //MenuManager.SetDefaultSelection(-1);
                            MenuManager.m_menu_micro_state = 3;
                            MenuManager.UIPulse(1f);
                            GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
                        }
                    }



                    break;
                }
            }
Example #14
0
        private static void Prefix(Collision collision, MonsterBall __instance)
        {
            float d = 1f;

            SFXCueManager.PlayRawSoundEffectPos(SoundEffect.imp_force_field1, collision.contacts[0].point, 0.4f, UnityEngine.Random.Range(-0.3f, 0f), 0f);
            GameObject gameObject = collision.collider.gameObject;

            Player player = gameObject.GetComponent <Player>();

            if (player != null)
            {
                MonsterballAddon.SetPlayer(player);
            }

            Projectile proj = gameObject.GetComponent <Projectile>();

            if (proj == null || proj.m_type == ProjPrefab.none)
            {
                return;
            }

            if (proj.m_owner_player)
            {
                MonsterballAddon.SetPlayer(proj.m_owner_player);
            }

            var     mb      = __instance;
            Vector3 forward = proj.c_transform.forward;

            if (proj.m_type == ProjPrefab.proj_impulse)
            {
                mb.c_rigidbody.AddForce(forward.normalized * 50f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.proj_driller)
            {
                Vector3 vector = ((mb.transform.position - collision.transform.position).normalized + forward.normalized) / 2f;
                mb.c_rigidbody.AddForce(vector.normalized * 35f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.proj_shotgun)
            {
                Vector3 vector2 = ((mb.transform.position - collision.transform.position).normalized + forward.normalized) / 2f;
                mb.c_rigidbody.AddForce(vector2.normalized * 8f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.proj_flak_cannon)
            {
                mb.c_rigidbody.AddForce(forward.normalized * 20f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.proj_reflex)
            {
                Vector3 vector3 = ((mb.transform.position - collision.transform.position).normalized + forward.normalized) / 2f;
                mb.c_rigidbody.AddForce(vector3.normalized * 40f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.proj_beam)
            {
                Vector3 vector4 = ((mb.transform.position - collision.transform.position).normalized + forward.normalized) / 2f;
                mb.c_rigidbody.AddForce(vector4.normalized * 120f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_smart || proj.m_type == ProjPrefab.missile_smart_mini || proj.m_type == ProjPrefab.missile_timebomb || proj.m_type == ProjPrefab.missile_vortex)
            {
                Vector3 vector5 = ((mb.transform.position - collision.transform.position).normalized + forward.normalized) / 2f;
                mb.c_rigidbody.AddForce(vector5.normalized * 500f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_devastator)
            {
                Vector3 vector6 = ((mb.transform.position - collision.transform.position).normalized + forward.normalized) / 2f;
                mb.c_rigidbody.AddForce(vector6.normalized * 2200f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_devastator_mini)
            {
                Vector3 normalized = (mb.transform.position - collision.transform.position).normalized;
                mb.c_rigidbody.AddForce(normalized * 1000f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_falcon)
            {
                mb.c_rigidbody.AddForce(forward.normalized * 200f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_hunter)
            {
                mb.c_rigidbody.AddForce(forward.normalized * 100f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_pod)
            {
                mb.c_rigidbody.AddForce(forward.normalized * 50f * d, ForceMode.Impulse);
            }
            if (proj.m_type == ProjPrefab.missile_creeper)
            {
                mb.c_rigidbody.AddForce(forward.normalized * 100f * d, ForceMode.Impulse);
            }
        }
            private static void AutoSelectUpdate(ref float m_menu_state_timer)
            {
                selected  = MPAutoSelectUI_UIElement_Draw.returnPrimarySelected();
                selected2 = MPAutoSelectUI_UIElement_Draw.returnSecondarySelected();
                UIManager.MouseSelectUpdate();
                switch (MenuManager.m_menu_sub_state)
                {
                case MenuSubState.INIT:
                    if (m_menu_state_timer > 0.25f)
                    {
                        UIManager.CreateUIElement(UIManager.SCREEN_CENTER, 7000, Menus.uiAutoSelect);
                        MenuManager.m_menu_sub_state = MenuSubState.ACTIVE;
                        m_menu_state_timer           = 0f;
                        MenuManager.SetDefaultSelection(0);
                    }
                    break;

                case MenuSubState.ACTIVE:
                    UIManager.ControllerMenu();
                    Controls.m_disable_menu_letter_keys = false;

                    if (m_menu_state_timer > 0.25f)
                    {
                        if (UIManager.PushedSelect(100) || (MenuManager.option_dir && UIManager.PushedDir() || UIManager.SliderMouseDown()))
                        {
                            MenuManager.MaybeReverseOption();
                            switch (UIManager.m_menu_selection)
                            {
                            case 100:
                                MenuManager.PlaySelectSound(1f);
                                m_menu_state_timer = 0f;
                                UIManager.DestroyAll(false);
                                MenuManager.m_menu_state       = 0;
                                MenuManager.m_menu_micro_state = 0;
                                MenuManager.m_menu_sub_state   = MenuSubState.BACK;
                                break;

                            case 200:
                            case 201:
                            case 202:
                            case 203:
                                if (UIManager.PushedSelect(100))
                                {
                                    MenuManager.m_menu_micro_state = UIManager.m_menu_selection - 200;
                                    MenuManager.UIPulse(1f);
                                    GameManager.m_audio.PlayCue2D(364, 0.4f, 0.07f, 0f, false);
                                }
                                break;

                            // Triggers Swap Logic for the Primary Weapon Buttons
                            case 1720:
                            case 1721:
                            case 1722:
                            case 1723:
                            case 1724:
                            case 1725:
                            case 1726:
                            case 1727:         // int nwhen (MenuManager.m_menu_micro_state > 1719 && MenuManager.m_menu_micro_state <= 1727):
                                if (UIManager.PushedSelect(100))
                                {
                                    doSelectedStuffForPrimary(UIManager.m_menu_selection - 1720);
                                }
                                break;


                            // Triggers Swap Logic for the Secondary Weapon Buttons
                            case 1728:
                            case 1729:
                            case 1730:
                            case 1731:
                            case 1732:
                            case 1733:
                            case 1734:
                            case 1735:
                                if (UIManager.PushedSelect(100))
                                {
                                    doSelectedStuffForSecondary(UIManager.m_menu_selection - 1728);
                                }
                                break;

                            // Triggers Neverselect Logic for the Primary Buttons
                            case 2000:
                            case 2001:
                            case 2002:
                            case 2003:
                            case 2004:
                            case 2005:
                            case 2006:
                            case 2007:
                                if (UIManager.PushedSelect(100))
                                {
                                    doNeverSelectStuffForPrimary(UIManager.m_menu_selection - 2000);
                                }
                                break;

                            // Triggers Neverselect Logic for the Secondary Buttons
                            case 2010:
                            case 2011:
                            case 2012:
                            case 2013:
                            case 2014:
                            case 2015:
                            case 2016:
                            case 2017:
                                if (UIManager.PushedSelect(100))
                                {
                                    doNeverSelectStuffForSecondary(UIManager.m_menu_selection - 2010);
                                }
                                break;

                            case 2100:
                                if (UIManager.PushedSelect(100))
                                {
                                    if (MPAutoSelection.primarySwapFlag || MPAutoSelection.secondarySwapFlag)
                                    {
                                        MPAutoSelection.primarySwapFlag   = false;
                                        MPAutoSelection.secondarySwapFlag = false;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    }
                                    else
                                    {
                                        MPAutoSelection.primarySwapFlag    = true;
                                        MPAutoSelection.secondarySwapFlag  = true;
                                        MenuManager.opt_primary_autoswitch = 0;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                    }
                                    ExtendedConfig.Section_AutoSelect.Set(true);
                                }
                                break;

                            case 2102:
                                if (UIManager.PushedSelect(100))
                                {
                                    if (MPAutoSelection.secondarySwapFlag)
                                    {
                                        MPAutoSelection.secondarySwapFlag = false;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    }
                                    else
                                    {
                                        MPAutoSelection.secondarySwapFlag = true;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                    }
                                    ExtendedConfig.Section_AutoSelect.Set(true);
                                }
                                break;

                            case 2103:
                                if (UIManager.PushedSelect(100))
                                {
                                    if (MPAutoSelection.primarySwapFlag)
                                    {
                                        MPAutoSelection.primarySwapFlag = false;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    }
                                    else
                                    {
                                        MPAutoSelection.primarySwapFlag    = true;
                                        MenuManager.opt_primary_autoswitch = 0;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                    }
                                    ExtendedConfig.Section_AutoSelect.Set(true);
                                }
                                break;

                            case 2104:
                                if (UIManager.PushedSelect(100))
                                {
                                    if (MPAutoSelection.zorc)
                                    {
                                        MPAutoSelection.zorc = false;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    }
                                    else
                                    {
                                        MPAutoSelection.zorc = true;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                    }
                                    ExtendedConfig.Section_AutoSelect.Set(true);
                                }
                                break;

                            case 2105:
                                if (UIManager.PushedSelect(100))
                                {
                                    if (MPAutoSelection.dontAutoselectAfterFiring)
                                    {
                                        MPAutoSelection.dontAutoselectAfterFiring = false;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    }
                                    else
                                    {
                                        MPAutoSelection.dontAutoselectAfterFiring = true;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                    }
                                    ExtendedConfig.Section_AutoSelect.Set(true);
                                }
                                break;

                            case 2106:
                                if (UIManager.PushedSelect(100))
                                {
                                    if (MPAutoSelection.swapWhileFiring)
                                    {
                                        MPAutoSelection.swapWhileFiring = false;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    }
                                    else
                                    {
                                        MPAutoSelection.swapWhileFiring = true;
                                        SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_picker, 0.8f, 0f, 0f, false);
                                    }
                                    ExtendedConfig.Section_AutoSelect.Set(true);
                                }
                                break;

                            case 2107:
                                if (UIManager.PushedSelect(100))
                                {
                                    SFXCueManager.PlayCue2D(SFXCue.hud_weapon_cycle_close, 0.8f, 0f, 0f, false);
                                    ExtendedConfig.Section_AutoSelect.Set();
                                    ExtendedConfig.Section_AutoSelect.ApplySettings();
                                }
                                break;
                            }
                        }
                    }
                    break;

                case MenuSubState.BACK:
                    if (m_menu_state_timer > 0.25f)
                    {
                        MenuManager.ChangeMenuState(((Stack <MenuState>)AccessTools.Field(typeof(MenuManager), "m_back_stack").GetValue(null)).Pop(), true);
                        AccessTools.Field(typeof(MenuManager), "m_went_back").SetValue(null, true);
                    }
                    break;

                case MenuSubState.START:
                    if (m_menu_state_timer > 0.25f)
                    {
                    }
                    break;
                }
            }