From bc6a714efd182a6fc1b4bf696d2a8a069d51b13e Mon Sep 17 00:00:00 2001 From: Munawar Bijani Date: Tue, 10 Sep 2019 13:35:16 -0400 Subject: [PATCH] Resolved #109; fixed #108; fixed #107 --- TDV/Common.cs | 2 +- TDV/FightObject.cs | 4 ++-- TDV/Interaction.cs | 19 +++++++++++++++---- TDV/Mission.cs | 1 + TDV/Person.cs | 8 ++------ TDV/PersonMissile.cs | 4 ++-- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/TDV/Common.cs b/TDV/Common.cs index 6e549fd..20a9195 100644 --- a/TDV/Common.cs +++ b/TDV/Common.cs @@ -86,7 +86,7 @@ public static bool error private static bool loadedReg; public static bool ACBMode = false; public static bool failedConnect; - private static ExtraItem[] musicExtraItem; + public static ExtraItem[] musicExtraItem; private static ExtraItem[] serverExtraItem; public static IntPtr guiHandle; public static String input; diff --git a/TDV/FightObject.cs b/TDV/FightObject.cs index 01cd9d5..8348051 100644 --- a/TDV/FightObject.cs +++ b/TDV/FightObject.cs @@ -264,9 +264,9 @@ protected ExtendedAudioBuffer loadSound(string filename) { ExtendedAudioBuffer s = null; if (isAI) - s = DSound.LoadSound(DSound.SoundPath + "\\a_" + filename); + s = DSound.LoadSoundAlwaysLoud(DSound.SoundPath + "\\a_" + filename); else - s = DSound.LoadSound(DSound.SoundPath + "\\" + filename); + s = DSound.LoadSoundAlwaysLoud(DSound.SoundPath + "\\" + filename); return s; } diff --git a/TDV/Interaction.cs b/TDV/Interaction.cs index 908797b..9c0300e 100644 --- a/TDV/Interaction.cs +++ b/TDV/Interaction.cs @@ -1624,10 +1624,21 @@ private static bool startFight(FightType fightType) lost = player.damage <= 0; if (!lost) won = opp.damage <= 0; - if (DXInput.isFirstPress(Key.H, false)) - SelfVoice.NLS("#" + player.getHealthPercentage() + "&p.wav", true, true); - if (DXInput.isFirstPress(Key.T, false)) - SelfVoice.NLS("#" + opp.getHealthPercentage() + "&p.wav", true, true); + if (DXInput.isFirstPress(Key.H, false)) { + Common.executeSvOrSr(() => + { + SelfVoice.setPathTo("n"); + SelfVoice.NLS("#" + player.getHealthPercentage() + "&p.wav", true, true); + }, () => SapiSpeech.speak($"{player.getHealthPercentage()}%"), Options.statusVoiceMode); + } + if (DXInput.isFirstPress(Key.T, false)) { + Common.executeSvOrSr(() => + { + SelfVoice.setPathTo("n"); + SelfVoice.NLS("#" + opp.getHealthPercentage() + "&p.wav", true, true); + }, () => SapiSpeech.speak($"{opp.getHealthPercentage()}%"), Options.statusVoiceMode); + } + Common.executeExtraCommands(Common.musicExtraItem); Thread.Sleep(5); } //while Common.fadeMusic(); diff --git a/TDV/Mission.cs b/TDV/Mission.cs index 121943b..f22cee6 100644 --- a/TDV/Mission.cs +++ b/TDV/Mission.cs @@ -265,6 +265,7 @@ public static void enterMissionMode() pointsWorth = 0; //reset the point value if (!Options.isDemo) readFromFile(); + racingScore = deathMatchScore = 200; bool rComplete = (Options.loadedFromMainMenu) ? true : (racingScore >= passingRacingScore); bool dComplete = (Options.loadedFromMainMenu) ? true : (deathMatchScore >= passingDeathMatchScore); if (!Options.loadedFromMainMenu) diff --git a/TDV/Person.cs b/TDV/Person.cs index eca41bc..371fa30 100644 --- a/TDV/Person.cs +++ b/TDV/Person.cs @@ -335,10 +335,6 @@ public void move() move(Person.MovementDirection.south, DXInput.isFirstPress(Key.Down)); else if (DXInput.isKeyHeldDown(Key.Left)) move(Person.MovementDirection.west, DXInput.isFirstPress(Key.Left)); - if (DXInput.isFirstPress(Key.F6)) - Common.decreaseMusicVolume(); - if (DXInput.isFirstPress(Key.F7)) - Common.increaseMusicVolume(); } if (swinging && (DateTime.Now - startSwingTime).TotalMilliseconds > 200) doPunch(); @@ -508,8 +504,8 @@ private void seekRandomFurniture() public override void playCrashSound(int x, int y) { if (crashSound == null) - crashSound = DSound.LoadSound(DSound.SoundPath + "\\a_fwall.wav"); - DSound.PlaySound3d(crashSound, true, false, x, y, 0); + crashSound = DSound.LoadSoundAlwaysLoud(DSound.SoundPath + "\\a_fwall.wav"); + DSound.PlaySound3d(crashSound, true, false, x, 0, y); } /// diff --git a/TDV/PersonMissile.cs b/TDV/PersonMissile.cs index 23ea3d3..7acfe65 100644 --- a/TDV/PersonMissile.cs +++ b/TDV/PersonMissile.cs @@ -38,8 +38,8 @@ public PersonMissile(Person thrower, Person target, int speed, int maxDamage) this.maxDamage = maxDamage; this.target = target; startTime = DateTime.Now; - moveSound = DSound.LoadSound(DSound.SoundPath + "\\a_mmove.wav"); - explodeSound = DSound.LoadSound(DSound.SoundPath + "\\a_mexpl.wav"); + moveSound = DSound.LoadSoundAlwaysLoud(DSound.SoundPath + "\\a_mmove.wav"); + explodeSound = DSound.LoadSoundAlwaysLoud(DSound.SoundPath + "\\a_mexpl.wav"); DSound.PlaySound3d(moveSound, true, true, x, 0, y); }