Browse Source

Merge pull request #160 from shangfengh/new

fix: 🐛
tags/0.1.0
Timothy Liu GitHub 3 years ago
parent
commit
1f4eb10f9f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 140 additions and 95 deletions
  1. +1
    -0
      dependency/proto/Message2Clients.proto
  2. +4
    -2
      dependency/proto/MessageType.proto
  3. +2
    -2
      logic/Client/MainWindow.xaml.cs
  4. +6
    -3
      logic/Client/StatusBarOfSurvivor.xaml.cs
  5. +7
    -1
      logic/GameClass/GameObj/Character/Character.cs
  6. +46
    -0
      logic/GameClass/GameObj/Map/Door.cs
  7. +20
    -0
      logic/GameClass/GameObj/Map/Map.cs
  8. +9
    -9
      logic/GameClass/GameObj/Map/MapInfo.cs
  9. +7
    -36
      logic/GameClass/GameObj/Map/Window.cs
  10. +4
    -6
      logic/GameEngine/MoveEngine.cs
  11. +1
    -19
      logic/Gaming/ActionManager.cs
  12. +3
    -3
      logic/Gaming/Game.cs
  13. +4
    -2
      logic/Preparation/Utility/EnumType.cs
  14. +1
    -0
      logic/Preparation/Utility/GameData.cs
  15. +15
    -6
      logic/Server/CopyInfo.cs
  16. +4
    -2
      logic/Server/GameServer.cs
  17. +6
    -4
      logic/规则Logic.md

+ 1
- 0
dependency/proto/Message2Clients.proto View File

@@ -123,6 +123,7 @@ message MessageOfDoor
int32 y = 2;
bool is_open = 3;
int32 number = 4;
int32 progress = 5;
}

message MessageOfChest


+ 4
- 2
dependency/proto/MessageType.proto View File

@@ -24,8 +24,10 @@ enum PlaceType // 地图中的所有物件类型
GATE = 5;
HIDDEN_GATE = 6;
WINDOW = 7;
DOOR = 8;
CHEST = 9;
DOOR3 = 8;
DOOR5 = 9;
DOOR6 = 10;
CHEST = 11;
// 待补充有特殊效果的地形

}


+ 2
- 2
logic/Client/MainWindow.xaml.cs View File

@@ -848,11 +848,11 @@ namespace Client
};
if (data.IsOpen)
{
icon.Text = Convert.ToString("");
icon.Text = Convert.ToString("1");
}
else
{
icon.Text = Convert.ToString("");
icon.Text = Convert.ToString("0");
}
UpperLayerOfMap.Children.Add(icon);
}


+ 6
- 3
logic/Client/StatusBarOfSurvivor.xaml.cs View File

@@ -83,9 +83,12 @@ namespace Client
break;
}//不完全
scores.Text = "Scores:" + obj.Score;
skillprogress0.Value = 100 - obj.TimeUntilSkillAvailable[0] / coolTime * 100;
skillprogress1.Value = 100 - obj.TimeUntilSkillAvailable[1] / coolTime * 100;
skillprogress2.Value = 100 - obj.TimeUntilSkillAvailable[2] / coolTime * 100;
if (obj.TimeUntilSkillAvailable[0]>=0)
skillprogress0.Value = 100 - obj.TimeUntilSkillAvailable[0] / coolTime * 100;
if(obj.TimeUntilSkillAvailable[1] >= 0)
skillprogress1.Value = 100 - obj.TimeUntilSkillAvailable[1] / coolTime * 100;
if(obj.TimeUntilSkillAvailable[2] >= 0)
skillprogress2.Value = 100 - obj.TimeUntilSkillAvailable[2] / coolTime * 100;
if (obj.PlayerState == PlayerState.Quit)
{
skillprogress0.Value = skillprogress1.Value = skillprogress2.Value = 0;


+ 7
- 1
logic/GameClass/GameObj/Character/Character.cs View File

@@ -175,7 +175,7 @@ namespace GameClass.GameObj
public Dictionary<BgmType, double> BgmDictionary
{
get => bgmDictionary;
set
private set
{
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;
public int AlertnessRadius


+ 46
- 0
logic/GameClass/GameObj/Map/Door.cs View File

@@ -0,0 +1,46 @@
using Preparation.Interface;
using Preparation.Utility;

namespace GameClass.GameObj
{
/// <summary>
/// 门
/// </summary>
public class Door : GameObj
{
public Door(XY initPos, PlaceType placeType) :
base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Door)
{
this.place = placeType;
this.CanMove = false;
}
public override bool IsRigid => true;
public override ShapeType Shape => ShapeType.Square;
protected override bool IgnoreCollideExecutor(IGameObj targetObj)
{
return isOpen;
}

private bool isOpen = false;
public bool IsOpen
{
get => isOpen;
set
{
lock (gameObjLock)
isOpen = value;
}
}

private int openOrLockDegree = 0;
public int OpenOrLockDegree
{
get => openOrLockDegree;
set
{
lock (gameObjLock)
openOrLockDegree = (value > 0) ? value : 0;
}
}
}
}

+ 20
- 0
logic/GameClass/GameObj/Map/Map.cs View File

@@ -190,6 +190,26 @@ namespace GameClass.GameObj
Add(new Chest(GameData.GetCellCenterPos(i, j)));
break;
}
case (uint)PlaceType.Door3:
{
Add(new Door(GameData.GetCellCenterPos(i, j), PlaceType.Door3));
break;
}
case (uint)PlaceType.Door5:
{
Add(new Door(GameData.GetCellCenterPos(i, j), PlaceType.Door5));
break;
}
case (uint)PlaceType.Door6:
{
Add(new Door(GameData.GetCellCenterPos(i, j), PlaceType.Door6));
break;
}
case (uint)PlaceType.Window:
{
Add(new Window(GameData.GetCellCenterPos(i, j)));
break;
}
case (uint)PlaceType.BirthPoint1:
case (uint)PlaceType.BirthPoint2:
case (uint)PlaceType.BirthPoint3:


+ 9
- 9
logic/GameClass/GameObj/Map/MapInfo.cs View File

@@ -13,11 +13,11 @@ namespace GameClass.GameObj
/// </summary>
public static uint[,] defaultMap = new uint[,] {
{ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
{ 6, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
{ 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
{ 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
{ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }
};
}


+ 7
- 36
logic/GameClass/GameObj/Map/Window.cs View File

@@ -4,7 +4,7 @@ using Preparation.Utility;
namespace GameClass.GameObj
{
/// <summary>
/// 出口
///
/// </summary>
public class Window : GameObj
{
@@ -18,50 +18,21 @@ namespace GameClass.GameObj
public override ShapeType Shape => ShapeType.Square;
protected override bool IgnoreCollideExecutor(IGameObj targetObj)
{
if (targetObj.Type != GameObjType.Character)
return true; // 非玩家不碰撞
else if (!((Character)targetObj).IsGhost())
return true; // 不是鬼不碰撞
if (targetObj == whoIsClimbing)
return true;
return false;
}

private bool powerSupply = false;
public bool PowerSupply
private Character? whoIsClimbing = null;
public Character? WhoIsClimbing
{
get => powerSupply;
get => whoIsClimbing;
set
{
lock (gameObjLock)
powerSupply = value;
whoIsClimbing = value;
}
}

private bool isOpening = false;
public bool IsOpening
{
get => isOpening;
set
{
lock (gameObjLock)
isOpening = value;
}
}

private int openDegree = 0;
public int OpenDegree
{
get => openDegree;
set
{
if (value > 0)
lock (gameObjLock)
openDegree = (value < GameData.degreeOfOpenedDoorway) ? value : GameData.degreeOfOpenedDoorway;
else
lock (gameObjLock)
openDegree = 0;
}
}

public bool IsOpen() => (OpenDegree == GameData.degreeOfOpenedDoorway);
}
}

+ 4
- 6
logic/GameEngine/MoveEngine.cs View File

@@ -1,4 +1,5 @@
using System;
using System.Numerics;
using System.Threading;
using Preparation.Interface;
using Preparation.Utility;
@@ -60,14 +61,11 @@ namespace GameEngine
/// <param name="moveVec">移动的位移向量</param>
private void MoveMax(IMoveable obj, XY moveVec)
{

/*由于四周是墙,所以人物永远不可能与越界方块碰撞*/
XY nextPos = obj.Position + moveVec;
//double maxLen
_ = collisionChecker.FindMax(obj, nextPos, moveVec);
//maxLen = Math.Min(maxLen, obj.MoveSpeed / GameData.numOfStepPerSecond);

obj.MovingSetPos(moveVec, GetPlaceType(nextPos));
double maxLen = collisionChecker.FindMax(obj, nextPos, moveVec);
maxLen = Math.Min(maxLen, obj.MoveSpeed / GameData.numOfStepPerSecond);
obj.MovingSetPos(new XY(moveVec.Angle(), maxLen), GetPlaceType(nextPos));
}

public void MoveObj(IMoveable obj, int moveTime, double direction)


+ 1
- 19
logic/Gaming/ActionManager.cs View File

@@ -288,25 +288,7 @@ namespace Gaming
{
if ((!player.Commandable()) || player.PlayerState == PlayerStateType.IsOpeningTheChest)
return false;
Chest? chestToOpen = null;


gameMap.GameObjLockDict[GameObjType.Chest].EnterReadLock();
try
{
foreach (Chest chest in gameMap.GameObjDict[GameObjType.Chest])
{
if (GameData.ApproachToInteract(chest.Position, player.Position))
{
chestToOpen = chest;
break;
}
}
}
finally
{
gameMap.GameObjLockDict[GameObjType.Chest].ExitReadLock();
}
Chest? chestToOpen = (Chest?)gameMap.OneForInteract(player.Position, GameObjType.Chest);

if (chestToOpen == null || chestToOpen.IsOpen)
return false;


+ 3
- 3
logic/Gaming/Game.cs View File

@@ -111,7 +111,7 @@ namespace Gaming
}
}
if (bgmVolume > 0)
newPlayer.BgmDictionary.Add(BgmType.StudentIsApproaching, bgmVolume);
newPlayer.AddBgm(BgmType.StudentIsApproaching, bgmVolume);
}
else
{
@@ -120,7 +120,7 @@ namespace Gaming
if (person.IsGhost())
{
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;
}
}
@@ -144,7 +144,7 @@ namespace Gaming
}
}
if (bgmVolume > 0)
newPlayer.BgmDictionary.Add(BgmType.StudentIsApproaching, bgmVolume);
newPlayer.AddBgm(BgmType.StudentIsApproaching, bgmVolume);
}




+ 4
- 2
logic/Preparation/Utility/EnumType.cs View File

@@ -125,8 +125,10 @@ namespace Preparation.Utility
Doorway = 9,
EmergencyExit = 10,
Window = 11,
Door = 12,
Chest = 13,
Door3 = 12,
Door5 = 13,
Door6 = 14,
Chest = 15,
}
public enum BgmType
{


+ 1
- 0
logic/Preparation/Utility/GameData.cs View File

@@ -106,6 +106,7 @@ namespace Preparation.Utility
public const double basicBulletBombRange = 3000; // 基本子弹爆炸范围
#endregion
#region 技能相关
public const int maxNumOfSkill = 3;
public const int commonSkillCD = 30000; // 普通技能标准冷却时间
public const int commonSkillTime = 10000; // 普通技能标准持续时间
/// <summary>


+ 15
- 6
logic/Server/CopyInfo.cs View File

@@ -21,8 +21,12 @@ namespace Server
return Protobuf.PlaceType.Gate;
case Preparation.Utility.PlaceType.Chest:
return Protobuf.PlaceType.Chest;
case Preparation.Utility.PlaceType.Door:
return Protobuf.PlaceType.Door;
case Preparation.Utility.PlaceType.Door3:
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:
return Protobuf.PlaceType.Classroom;
case Preparation.Utility.PlaceType.Grass:
@@ -196,9 +200,11 @@ namespace Server

foreach (var keyValue in player.TimeUntilActiveSkillAvailable)
msg.StudentMessage.TimeUntilSkillAvailable.Add(keyValue.Value);
for (int i = 0; i < GameData.maxNumOfSkill - player.TimeUntilActiveSkillAvailable.Count(); ++i)
msg.StudentMessage.TimeUntilSkillAvailable.Add(-1);

foreach (var Value in player.PropInventory)
msg.StudentMessage.Prop.Add(ToPropType(Value.GetPropType()));
foreach (var value in player.PropInventory)
msg.StudentMessage.Prop.Add(ToPropType(value.GetPropType()));

msg.StudentMessage.Place = ToPlaceType(player.Place);
msg.StudentMessage.Guid = player.ID;
@@ -237,9 +243,12 @@ namespace Server
msg.TrickerMessage.Speed = player.MoveSpeed;
foreach (var keyValue in player.TimeUntilActiveSkillAvailable)
msg.TrickerMessage.TimeUntilSkillAvailable.Add(keyValue.Value);
for (int i = 0; i < GameData.maxNumOfSkill - player.TimeUntilActiveSkillAvailable.Count(); ++i)
msg.StudentMessage.TimeUntilSkillAvailable.Add(-1);

msg.TrickerMessage.Place = ToPlaceType(player.Place);
foreach (var Value in player.PropInventory)
msg.StudentMessage.Prop.Add(ToPropType(Value.GetPropType()));
foreach (var value in player.PropInventory)
msg.StudentMessage.Prop.Add(ToPropType(value.GetPropType()));

msg.TrickerMessage.TrickerType = ToTrickerType(player.CharacterType);
msg.TrickerMessage.Guid = player.ID;


+ 4
- 2
logic/Server/GameServer.cs View File

@@ -211,8 +211,10 @@ namespace Server
case 9: return Protobuf.PlaceType.Gate;
case 10: return Protobuf.PlaceType.HiddenGate;
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;
}
}


+ 6
- 4
logic/规则Logic.md View File

@@ -28,7 +28,7 @@
- 只展示外部需要的属性,部分属性被省略

### BgmType
- 枚举类BgmType
- *枚举类BgmType*
1. 不详的感觉:监管者进入(求生者的警戒半径/监管者的隐蔽度)时,求生者收到;监管者距离求生者越近,Bgm音量越大。bgmVolume=(警戒半径/二者距离)
2. 期待搞事的感觉:求生者进入(监管者的警戒半径/求生者的隐蔽度)时,监管者收到;监管者距离求生者越近,Bgm音量越大。bgmVolume=(警戒半径/可被发觉的最近的求生者距离)
3. 修理电机的声音: 监管者警戒半径内有电机正在被修理时收到;bgmVolume=(警戒半径*电机修理程度/二者距离)/10300000
@@ -135,7 +135,7 @@
- 沉迷游戏程度
- 最大沉迷游戏程度
- 被治疗程度
- *(去)救援(别人)程度*
- *被救援程度*

### 搞蛋鬼:人物
@@ -186,12 +186,11 @@
### 箱子:物体
- *是否开启*
- *开箱进度*
- *是否正在被开启*

### 门:物体
- *属于那个教学区*
- *是否锁上*
- *是否正在被锁*
- *开锁门进度*
- 不提供是否可以锁上的属性

### 电机(建议称为homework):物体
@@ -237,6 +236,9 @@
- *当门所在格子内有人时,无法锁门(必须从门外锁门)*
- *锁门时其他人可以进入门所在格子,锁门过程中断*
- *钥匙只会出现在箱子中,每个教学区都有2把钥匙*
- *一扇门只允许同时一个人开锁门*
- *开锁门未完成前,门状态表现为原来的状态*
- *开锁门进度中断后清空*

### 窗
- *求生者和监管者都可以翻越窗户,但通常情况下监管者翻越窗户的速度**高于**求生者。*


Loading…
Cancel
Save