Browse Source

Merge pull request #269 from shangfengh/new

fix: 🐛 fix a bug about the Update of Bgm
tags/0.1.0
Gao Siyan GitHub 2 years ago
parent
commit
9671140693
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 11 deletions
  1. +10
    -6
      logic/GameRules.md
  2. +7
    -4
      logic/Gaming/CharacterManager .cs
  3. +1
    -1
      logic/Server/Properties/launchSettings.json

+ 10
- 6
logic/GameRules.md View File

@@ -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
- 箱子道具不刷新

### 得分
- 眩晕或毅力值归零时无牵制得分
- 眩晕或毅力值归零时无牵制得分

### 信息相关
- Bgm在没有符合条件的情况下,值为0。

+ 7
- 4
logic/Gaming/CharacterManager .cs View File

@@ -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
{


+ 1
- 1
logic/Server/Properties/launchSettings.json View File

@@ -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"
}
}
}

Loading…
Cancel
Save