diff --git a/logic/GameRules.md b/logic/GameRules.md index 9244692..f49482b 100644 --- a/logic/GameRules.md +++ b/logic/GameRules.md @@ -1,5 +1,5 @@ # 规则 -V4.2 +V4.3 - [规则](#规则) - [简则](#简则) - [地图](#地图) @@ -43,6 +43,7 @@ V4.2 - [窗](#窗-1) - [箱子](#箱子-1) - [得分](#得分-1) + - [信息相关](#信息相关-1) ## 简则 @@ -125,10 +126,10 @@ V4.2 - 开箱后将有2个随机道具掉落在玩家位置。 ### 信息相关 -- Bgm - 1. 不详的感觉(dangerAlert):捣蛋鬼进入(学生的警戒半径/捣蛋鬼的隐蔽度)时,学生收到;捣蛋鬼距离学生越近,Bgm音量越大。bgmVolume=(警戒半径/二者距离) - 2. 期待搞事的感觉(trickDesire):学生进入(捣蛋鬼的警戒半径/学生的隐蔽度)时,捣蛋鬼收到;捣蛋鬼距离学生越近,Bgm音量越大。bgmVolume=(警戒半径/可被发觉的最近的学生距离) - 3. 学习的声音(classVolume): 捣蛋鬼警戒半径内有人学习时收到;bgmVolume=(警戒半径x学习进度百分比)/二者距离 +- Bgm (在structures.h/.py中的student类或Tricker类中作为其属性) + 1. 不详的感觉(dangerAlert):如果捣蛋鬼进入(学生的警戒半径/捣蛋鬼的隐蔽度)的距离,则学生的dangerAlert=(int)(警戒半径/二者距离) + 2. 期待搞事的感觉(trickDesire):如果有学生进入(捣蛋鬼的警戒半径/学生的隐蔽度)的距离,则捣蛋鬼trickDesire=(警戒半径/可被发觉的最近的学生距离) + 3. 学习的声音(classVolume): 警戒半径内有人学习时,捣蛋鬼classVolume=(警戒半径x学习进度百分比)/二者距离 - 可以向其他每一个队友发送不超过256字节的信息 ### 可视范围 @@ -337,4 +338,7 @@ V4.2 - 箱子道具不刷新 ### 得分 -- 眩晕或毅力值归零时无牵制得分 \ No newline at end of file +- 眩晕或毅力值归零时无牵制得分 + +### 信息相关 +- Bgm在没有符合条件的情况下,值为0。 \ No newline at end of file diff --git a/logic/Gaming/CharacterManager .cs b/logic/Gaming/CharacterManager .cs index e5242a0..399666f 100644 --- a/logic/Gaming/CharacterManager .cs +++ b/logic/Gaming/CharacterManager .cs @@ -149,8 +149,12 @@ namespace Gaming { if (person.IsGhost()) { - if (!noise && XY.Distance(newPlayer.Position, person.Position) <= (newPlayer.AlertnessRadius / person.Concealment)) - newPlayer.AddBgm(BgmType.GhostIsComing, (double)newPlayer.AlertnessRadius / XY.Distance(newPlayer.Position, person.Position)); + if (!noise) + { + if (XY.Distance(newPlayer.Position, person.Position) <= (newPlayer.AlertnessRadius / person.Concealment)) + newPlayer.AddBgm(BgmType.GhostIsComing, (double)newPlayer.AlertnessRadius / XY.Distance(newPlayer.Position, person.Position)); + else newPlayer.AddBgm(BgmType.GhostIsComing, 0); + } if (newPlayer.CharacterType != CharacterType.Teacher && !newPlayer.NoHp() && newPlayer.PlayerState != PlayerStateType.Stunned && XY.Distance(newPlayer.Position, person.Position) <= GameData.PinningDownRange) { TimePinningDown += GameData.checkInterval; @@ -182,8 +186,7 @@ namespace Gaming bgmVolume = (double)newPlayer.AlertnessRadius * generator.DegreeOfRepair / GameData.degreeOfFixedGenerator / XY.Distance(newPlayer.Position, generator.Position); } } - if (bgmVolume > 0) - newPlayer.AddBgm(BgmType.GeneratorIsBeingFixed, bgmVolume); + newPlayer.AddBgm(BgmType.GeneratorIsBeingFixed, bgmVolume); } finally { diff --git a/logic/Server/Properties/launchSettings.json b/logic/Server/Properties/launchSettings.json index f15a2d1..5a08357 100644 --- a/logic/Server/Properties/launchSettings.json +++ b/logic/Server/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "Server": { "commandName": "Project", - "commandLineArgs": "--ip 0.0.0.0 -p 8888 --studentCount 1 --trickerCount 0" + "commandLineArgs": "--ip 0.0.0.0 -p 8888 --characterID 2030" } } } \ No newline at end of file