| @@ -175,7 +175,7 @@ namespace GameClass.GameObj | |||||
| public Dictionary<BgmType, double> BgmDictionary | public Dictionary<BgmType, double> BgmDictionary | ||||
| { | { | ||||
| get => bgmDictionary; | get => bgmDictionary; | ||||
| set | |||||
| private set | |||||
| { | { | ||||
| lock (gameObjLock) | lock (gameObjLock) | ||||
| { | { | ||||
| @@ -183,6 +183,12 @@ namespace GameClass.GameObj | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| public void AddBgm(BgmType bgm, double value) | |||||
| { | |||||
| if (BgmDictionary.ContainsKey(bgm)) | |||||
| BgmDictionary[bgm] = value; | |||||
| else BgmDictionary.Add(bgm, value); | |||||
| } | |||||
| private int alertnessRadius; | private int alertnessRadius; | ||||
| public int AlertnessRadius | public int AlertnessRadius | ||||
| @@ -111,7 +111,7 @@ namespace Gaming | |||||
| } | } | ||||
| } | } | ||||
| if (bgmVolume > 0) | if (bgmVolume > 0) | ||||
| newPlayer.BgmDictionary.Add(BgmType.StudentIsApproaching, bgmVolume); | |||||
| newPlayer.AddBgm(BgmType.StudentIsApproaching, bgmVolume); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -120,7 +120,7 @@ namespace Gaming | |||||
| if (person.IsGhost()) | if (person.IsGhost()) | ||||
| { | { | ||||
| if (XY.Distance(newPlayer.Position, person.Position) <= (newPlayer.AlertnessRadius / person.Concealment)) | if (XY.Distance(newPlayer.Position, person.Position) <= (newPlayer.AlertnessRadius / person.Concealment)) | ||||
| newPlayer.BgmDictionary.Add(BgmType.GhostIsComing, (double)newPlayer.AlertnessRadius / XY.Distance(newPlayer.Position, person.Position)); | |||||
| newPlayer.AddBgm(BgmType.GhostIsComing, (double)newPlayer.AlertnessRadius / XY.Distance(newPlayer.Position, person.Position)); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -144,7 +144,7 @@ namespace Gaming | |||||
| } | } | ||||
| } | } | ||||
| if (bgmVolume > 0) | if (bgmVolume > 0) | ||||
| newPlayer.BgmDictionary.Add(BgmType.StudentIsApproaching, bgmVolume); | |||||
| newPlayer.AddBgm(BgmType.StudentIsApproaching, bgmVolume); | |||||
| } | } | ||||
| @@ -126,8 +126,8 @@ namespace Preparation.Utility | |||||
| EmergencyExit = 10, | EmergencyExit = 10, | ||||
| Window = 11, | Window = 11, | ||||
| Door3 = 12, | Door3 = 12, | ||||
| Door4 =13, | |||||
| Door5 = 14, | |||||
| Door5 = 13, | |||||
| Door6 = 14, | |||||
| Chest = 15, | Chest = 15, | ||||
| } | } | ||||
| public enum BgmType | public enum BgmType | ||||
| @@ -22,7 +22,11 @@ namespace Server | |||||
| case Preparation.Utility.PlaceType.Chest: | case Preparation.Utility.PlaceType.Chest: | ||||
| return Protobuf.PlaceType.Chest; | return Protobuf.PlaceType.Chest; | ||||
| case Preparation.Utility.PlaceType.Door3: | case Preparation.Utility.PlaceType.Door3: | ||||
| return Protobuf.PlaceType.Door; | |||||
| return Protobuf.PlaceType.Door3; | |||||
| case Preparation.Utility.PlaceType.Door5: | |||||
| return Protobuf.PlaceType.Door5; | |||||
| case Preparation.Utility.PlaceType.Door6: | |||||
| return Protobuf.PlaceType.Door6; | |||||
| case Preparation.Utility.PlaceType.Generator: | case Preparation.Utility.PlaceType.Generator: | ||||
| return Protobuf.PlaceType.Classroom; | return Protobuf.PlaceType.Classroom; | ||||
| case Preparation.Utility.PlaceType.Grass: | case Preparation.Utility.PlaceType.Grass: | ||||
| @@ -211,8 +211,10 @@ namespace Server | |||||
| case 9: return Protobuf.PlaceType.Gate; | case 9: return Protobuf.PlaceType.Gate; | ||||
| case 10: return Protobuf.PlaceType.HiddenGate; | case 10: return Protobuf.PlaceType.HiddenGate; | ||||
| case 11: return Protobuf.PlaceType.Window; | case 11: return Protobuf.PlaceType.Window; | ||||
| case 12: return Protobuf.PlaceType.Door; | |||||
| case 13: return Protobuf.PlaceType.Chest; | |||||
| case 12: return Protobuf.PlaceType.Door3; | |||||
| case 13: return Protobuf.PlaceType.Door5; | |||||
| case 14: return Protobuf.PlaceType.Door6; | |||||
| case 15: return Protobuf.PlaceType.Chest; | |||||
| default: return Protobuf.PlaceType.NullPlaceType; | default: return Protobuf.PlaceType.NullPlaceType; | ||||
| } | } | ||||
| } | } | ||||