Projekt přejmenován. Neko nastaven na výchozí pozici
This commit is contained in:
parent
1a27dd6fab
commit
ceac37920b
104 changed files with 873 additions and 208 deletions
168
ONDClient/SoundManager.cs
Normal file
168
ONDClient/SoundManager.cs
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
using System;
|
||||
using GlobalClassLib;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using MonoGameLibrary;
|
||||
|
||||
namespace ONDClient;
|
||||
|
||||
public static class SoundManager {
|
||||
private static SoundEffect ambience;
|
||||
private static SoundEffect ventWalk;
|
||||
private static SoundEffect camSwitch;
|
||||
private static SoundEffect lightOff;
|
||||
private static SoundEffect lightOn;
|
||||
private static SoundEffect doorClose;
|
||||
private static SoundEffect doorCloseRemote;
|
||||
private static SoundEffect doorOpen;
|
||||
private static SoundEffect doorOpenRemote;
|
||||
private static SoundEffect monitorFlip;
|
||||
private static SoundEffect powerOut;
|
||||
private static SoundEffect mareMove;
|
||||
private static SoundEffect dashMove;
|
||||
private static SoundEffect spotMove;
|
||||
private static SoundEffect spotActivate;
|
||||
private static SoundEffect nekoPurr;
|
||||
private static SoundEffect jumpscare;
|
||||
private static SoundEffect nekoAnger;
|
||||
private static SoundEffect nekoMove;
|
||||
private static SoundEffect bell;
|
||||
|
||||
private static SoundEffectInstance ambienceInstance;
|
||||
private static SoundEffectInstance nekoPurrInstance;
|
||||
|
||||
private static Random random = new();
|
||||
|
||||
public static void LoadSounds() {
|
||||
ambience = Core.content.Load<SoundEffect>("sounds/ambience");
|
||||
ventWalk = Core.content.Load<SoundEffect>("sounds/vent-walk");
|
||||
camSwitch = Core.content.Load<SoundEffect>("sounds/camera-switch");
|
||||
lightOff = Core.content.Load<SoundEffect>("sounds/light-off");
|
||||
lightOn = Core.content.Load<SoundEffect>("sounds/light-on");
|
||||
doorClose = Core.content.Load<SoundEffect>("sounds/door-close");
|
||||
doorCloseRemote = Core.content.Load<SoundEffect>("sounds/door-close-remote");
|
||||
doorOpen = Core.content.Load<SoundEffect>("sounds/door-open");
|
||||
doorOpenRemote = Core.content.Load<SoundEffect>("sounds/door-open-remote");
|
||||
monitorFlip = Core.content.Load<SoundEffect>("sounds/monitor-flip");
|
||||
powerOut = Core.content.Load<SoundEffect>("sounds/powerout");
|
||||
mareMove = Core.content.Load<SoundEffect>("sounds/mare-move");
|
||||
dashMove = Core.content.Load<SoundEffect>("sounds/dash-move");
|
||||
spotMove = Core.content.Load<SoundEffect>("sounds/spot-move");
|
||||
spotActivate = Core.content.Load<SoundEffect>("sounds/spot-activate");
|
||||
nekoPurr = Core.content.Load<SoundEffect>("sounds/neko-purr");
|
||||
jumpscare = Core.content.Load<SoundEffect>("sounds/jumpscare");
|
||||
nekoAnger = Core.content.Load<SoundEffect>("sounds/neko-angry");
|
||||
nekoMove = Core.content.Load<SoundEffect>("sounds/neko-move1");
|
||||
bell = Core.content.Load<SoundEffect>("sounds/bell");
|
||||
|
||||
nekoPurrInstance = nekoPurr.CreateInstance();
|
||||
ambienceInstance = ambience.CreateInstance();
|
||||
}
|
||||
|
||||
public static void StartAmbience() {
|
||||
ambienceInstance = ambience.CreateInstance();
|
||||
ambienceInstance.IsLooped = true;
|
||||
ambienceInstance.Volume = 0.75f;
|
||||
ambienceInstance.Play();
|
||||
}
|
||||
public static void StopAmbience() {
|
||||
ambienceInstance.Stop();
|
||||
}
|
||||
|
||||
public static void PlayDoor(bool doorState) {
|
||||
if (doorState){
|
||||
doorClose.Play();
|
||||
}
|
||||
else{
|
||||
doorOpen.Play();
|
||||
}
|
||||
}
|
||||
public static void PlayDoorRemote(bool doorState) {
|
||||
if (doorState){
|
||||
doorCloseRemote.Play();
|
||||
}
|
||||
else{
|
||||
doorOpenRemote.Play();
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlayLight(bool lightState) {
|
||||
if (lightState){
|
||||
lightOn.Play();
|
||||
}
|
||||
else{
|
||||
lightOff.Play();
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlayJumpscare() => jumpscare.Play();
|
||||
|
||||
public static void PlayPowerOut() => powerOut.Play();
|
||||
|
||||
public static void PlayNekoMove() => nekoMove.Play();
|
||||
|
||||
public static void PlayNekoAnger() => nekoAnger.Play();
|
||||
|
||||
public static void PlaySpotActivate() => spotActivate.Play();
|
||||
|
||||
public static void PlaySpotMove() => spotMove.Play();
|
||||
|
||||
public static void PlayDashMove() => dashMove.Play();
|
||||
|
||||
public static void PlayMareMove() => mareMove.Play();
|
||||
|
||||
public static void PlayMonitorFlip() => monitorFlip.Play();
|
||||
|
||||
public static void PlayCameraSwitch() => camSwitch.Play();
|
||||
|
||||
public static void PlayVentWalk() => ventWalk.Play();
|
||||
|
||||
public static void PlayBell() => bell.Play();
|
||||
|
||||
public static void StartNekoPurr() {
|
||||
nekoPurrInstance = nekoPurr.CreateInstance();
|
||||
nekoPurrInstance.IsLooped = true;
|
||||
nekoPurrInstance.Play();
|
||||
}
|
||||
|
||||
public static void StopNekoPurr() {
|
||||
nekoPurrInstance.Stop();
|
||||
}
|
||||
|
||||
private static SoundEffectInstance GetRandomisedPitchInstance(SoundEffect effect) {
|
||||
SoundEffectInstance instance = effect.CreateInstance();
|
||||
instance.Pitch = (float)(random.NextDouble() - 0.5) / 5;
|
||||
instance.Play();
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void PlayEnemyMove(ClientEnemy enemy) {
|
||||
switch ((EnemyType)enemy.TypeId){
|
||||
case EnemyType.NEKO:
|
||||
PlayNekoMove();
|
||||
break;
|
||||
case EnemyType.SPOT:
|
||||
PlaySpotMove();
|
||||
break;
|
||||
case EnemyType.MARE:
|
||||
PlayMareMove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void PlayEnemyReset(ClientEnemy enemy) {
|
||||
switch ((EnemyType)enemy.TypeId){
|
||||
case EnemyType.NEKO:
|
||||
PlayNekoMove();
|
||||
break;
|
||||
case EnemyType.SPOT:
|
||||
PlaySpotMove();
|
||||
break;
|
||||
case EnemyType.MARE:
|
||||
PlayMareMove();
|
||||
break;
|
||||
case EnemyType.DASH:
|
||||
PlayDashMove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue