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); }
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; } }
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); } }
private static void OnCTFNotifyOld(NetworkMessage rawMsg) { var msg = rawMsg.ReadMessage <StringMessage>().value; GameplayManager.AddHUDMessage(msg, -1, true); SFXCueManager.PlayRawSoundEffect2D(SoundEffect.hud_notify_message1); }