feat: 🐛 display the progress of classroom/chest/door

display the progress of classroom/chest/door
This commit is contained in:
Shawqeem 2023-03-28 23:36:28 +08:00
parent e101c072ef
commit 9280daa085
22 changed files with 528 additions and 387 deletions

View File

@ -170,7 +170,7 @@ message MessageOfObj
message MessageOfAll
{
int32 game_time = 1;
int32 subject_left = 2; //
int32 subject_finished = 2; //
int32 student_graduated = 3; //
int32 student_quited = 4; // 退
int32 student_score = 5;

View File

@ -1,6 +1,6 @@
using System.Windows;
[assembly:ThemeInfo(
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, // where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)

View File

@ -22,6 +22,7 @@
<ItemGroup>
<ProjectReference Include="..\..\dependency\proto\Protos.csproj" />
<ProjectReference Include="..\..\playback\Playback\Playback.csproj" />
<ProjectReference Include="..\Preparation\Preparation.csproj" />
</ItemGroup>
<ItemGroup>

View File

@ -18,9 +18,9 @@ using Grpc.Core;
using Protobuf;
using Playback;
using CommandLine;
using Preparation.Utility;
// 目前MainWindow还未复现的功能
// private void ReactToCommandline()
// private void ClickToSetMode(object sender, RoutedEventArgs e)
// private void Bonus()
@ -49,7 +49,7 @@ namespace Client
listOfProp = new List<MessageOfProp>();
listOfHuman = new List<MessageOfStudent>();
listOfButcher = new List<MessageOfTricker>();
listOfBullet=new List<MessageOfBullet>();
listOfBullet = new List<MessageOfBullet>();
listOfBombedBullet = new List<MessageOfBombedBullet>();
listOfAll = new List<MessageOfAll>();
listOfChest = new List<MessageOfChest>();
@ -57,17 +57,9 @@ namespace Client
listOfDoor = new List<MessageOfDoor>();
listOfGate = new List<MessageOfGate>();
WindowStartupLocation = WindowStartupLocation.CenterScreen;
//comInfo[0] = "127.0.0.1";
//comInfo[1] = "8888";
//comInfo[2] = "0";
//comInfo[3] = "1";
//comInfo[4] = "1";
//ConnectToServer(comInfo);
//OnReceive();
ReactToCommandline();
}
private void SetStatusBar()
{
StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
@ -103,6 +95,7 @@ namespace Client
mapFlag = true;
}
}
private void ReactToCommandline()
{
string[] args = Environment.GetCommandLineArgs();
@ -115,12 +108,12 @@ namespace Client
{ options = o; });
if (options == null || options.cl == false)
{
OnReceive();
OnReceive();
}
else
{
//if (options.PlaybackFile == DefaultArgumentOptions.FileName)
//{
if (options.PlaybackFile == DefaultArgumentOptions.FileName)
{
try
{
string[] comInfo = new string[5];
@ -136,18 +129,19 @@ namespace Client
{
OnReceive();
}
//}
//else
//{
// Playback(options.PlaybackFile, options.PlaybackSpeed);
//}
}
else
{
Playback(options.PlaybackFile, options.PlaybackSpeed);
}
}
}
private void Playback(string fileName, double pbSpeed = 2.0)
{
var pbClient = new PlaybackClient(fileName, pbSpeed);
int[,]? map;
if ((map = pbClient.ReadDataFromFile(listOfProp, listOfHuman, listOfButcher, listOfBullet,listOfBombedBullet, listOfAll, listOfChest, listOfClassroom,listOfDoor, listOfGate, drawPicLock)) != null)
if ((map = pbClient.ReadDataFromFile(listOfProp, listOfHuman, listOfButcher, listOfBullet, listOfBombedBullet, listOfAll, listOfChest, listOfClassroom, listOfDoor, listOfGate, drawPicLock)) != null)
{
isClientStocked = false;
isPlaybackMode = true;
@ -175,8 +169,6 @@ namespace Client
connect += comInfo[1];
Channel channel = new Channel(connect, ChannelCredentials.Insecure);
client = new AvailableService.AvailableServiceClient(channel);
// 没判断连没连上
PlayerMsg playerMsg = new PlayerMsg();
playerMsg.PlayerId = playerID;
playerType = Convert.ToInt64(comInfo[3]) switch
@ -185,7 +177,7 @@ namespace Client
1 => PlayerType.StudentPlayer,
2 => PlayerType.TrickerPlayer,
};
playerMsg.PlayerType=playerType;
playerMsg.PlayerType = playerType;
if (Convert.ToInt64(comInfo[3]) == 1)
{
humanOrButcher = true;
@ -321,7 +313,7 @@ namespace Client
case 10:
foreach (var obj in listOfAll)
{
if(obj.HiddenGateRefreshed)
if (obj.SubjectFinished >= Preparation.Utility.GameData.numOfGeneratorRequiredForEmergencyExit)
{
mapPatches[i, j].Fill = Brushes.LightSalmon;
mapPatches[i, j].Stroke = Brushes.LightSalmon;
@ -408,6 +400,7 @@ namespace Client
switch (obj.MessageOfObjCase)
{
case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
{
human = obj.StudentMessage;
@ -542,7 +535,7 @@ namespace Client
{
ErrorDisplayer error = new("Error: " + ex.ToString());
error.Show();
}
}
}
private int GetX(int x)
@ -553,6 +546,7 @@ namespace Client
{
return y / 1000 + 1;
}
//待修改
private bool CanSee(MessageOfStudent msg)
{
@ -565,9 +559,9 @@ namespace Client
if (human.Guid == msg.Guid) // 自己能看见自己
return true;
}
if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
if (msg.Place == Protobuf.PlaceType.Grass || msg.Place == Protobuf.PlaceType.Gate || msg.Place == Protobuf.PlaceType.HiddenGate)
return false;
if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
if (msg.Place == Protobuf.PlaceType.Land || msg.Place == Protobuf.PlaceType.Classroom)
return true;
if (humanOrButcher && human != null)
{
@ -591,9 +585,9 @@ namespace Client
if (butcher.Guid == msg.Guid) // 自己能看见自己
return true;
}
if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
if (msg.Place == Protobuf.PlaceType.Grass || msg.Place == Protobuf.PlaceType.Gate || msg.Place == Protobuf.PlaceType.HiddenGate)
return false;
if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
if (msg.Place == Protobuf.PlaceType.Land || msg.Place == Protobuf.PlaceType.Classroom)
return true;
if (humanOrButcher && human != null)
{
@ -610,7 +604,7 @@ namespace Client
private bool CanSee(MessageOfProp msg)
{
if (msg.Place == PlaceType.Land)
if (msg.Place == Protobuf.PlaceType.Land)
return true;
if (humanOrButcher && human != null)
{
@ -627,7 +621,7 @@ namespace Client
private bool CanSee(MessageOfBullet msg)
{
if (msg.Place == PlaceType.Land)
if (msg.Place == Protobuf.PlaceType.Land)
return true;
if (humanOrButcher && human != null)
{
@ -688,7 +682,7 @@ namespace Client
{
foreach (var data in listOfAll)
{
StatusBarsOfCircumstance.SetValue(data);
StatusBarsOfCircumstance.SetValue(data, gateOpened);
}
if (!hasDrawed && mapFlag)
DrawMap();
@ -732,25 +726,25 @@ namespace Client
{
switch (data.Type)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
DrawProp(data, "🔑");
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
DrawProp(data, "🔑");
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
DrawProp(data, "🔑");
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
DrawProp(data, "⛸");
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
DrawProp(data, "♥");
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
DrawProp(data, "🏅");
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
DrawProp(data, "🛡");
break;
default:
@ -779,7 +773,7 @@ namespace Client
{
switch (data.Type)
{
case BulletType.FastBullet:
case Protobuf.BulletType.FastBullet:
{
Ellipse icon = new();
double bombRange = data.BombRange / 1000;
@ -792,7 +786,7 @@ namespace Client
UpperLayerOfMap.Children.Add(icon);
break;
}
case BulletType.AtomBomb:
case Protobuf.BulletType.AtomBomb:
{
Ellipse icon = new Ellipse();
double bombRange = data.BombRange / 1000;
@ -805,7 +799,7 @@ namespace Client
UpperLayerOfMap.Children.Add(icon);
break;
}
case BulletType.OrdinaryBullet:
case Protobuf.BulletType.OrdinaryBullet:
{
Ellipse icon = new Ellipse();
double bombRange = data.BombRange / 1000;
@ -818,7 +812,7 @@ namespace Client
UpperLayerOfMap.Children.Add(icon);
break;
}
/*case BulletType.LineBullet:
/*case Protobuf.BulletType.LineBullet:
{
double bombRange = data.BombRange / 1000;
DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
@ -832,67 +826,68 @@ namespace Client
{
TextBox icon = new()
{
FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
Text = Convert.ToString(data.Progress),
Text = Convert.ToString((int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfFixedGenerator)),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
//Margin = new Thickness(25,25, 0, 0),
Background = Brushes.Transparent,
BorderBrush = Brushes.Transparent,
IsReadOnly = true
};
UpperLayerOfMap.Children.Add(icon);
}
foreach(var data in listOfChest)
foreach (var data in listOfChest)
{
TextBox icon = new()
{
FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
Text = Convert.ToString(data.Progress),
Text = Convert.ToString((int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedChest)),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
//Margin = new Thickness(25,25, 0, 0),
Background = Brushes.Transparent,
BorderBrush = Brushes.Transparent,
IsReadOnly = true
};
UpperLayerOfMap.Children.Add(icon);
}
foreach(var data in listOfGate)
foreach (var data in listOfGate)
{
int deg = (int)(100.0 * data.Progress / Preparation.Utility.GameData.degreeOfOpenedDoorway);
if (deg == 100)
{
gateOpened = true;
}
TextBox icon = new()
{
FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
Text = Convert.ToString(data.Progress),
Text = Convert.ToString(deg),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
//Margin = new Thickness(25,25, 0, 0),
Background = Brushes.Transparent,
BorderBrush = Brushes.Transparent,
IsReadOnly = true
};
UpperLayerOfMap.Children.Add(icon);
}
foreach(var data in listOfDoor)
foreach (var data in listOfDoor)
{
TextBox icon = new()
{
FontSize = 10 * UpperLayerOfMap.ActualHeight / 650,
FontSize = 8 * UpperLayerOfMap.ActualHeight / 650,
Width = unitWidth,
Height = unitHeight,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
//Margin = new Thickness(25,25, 0, 0),
Background = Brushes.Transparent,
BorderBrush = Brushes.Transparent,
IsReadOnly = true
@ -904,7 +899,7 @@ namespace Client
else
{
icon.Text = Convert.ToString("闭");
}
}
UpperLayerOfMap.Children.Add(icon);
}
//}
@ -927,176 +922,176 @@ namespace Client
{
if (!isPlaybackMode)
{
switch (e.Key)
{
case Key.W:
case Key.NumPad8:
MoveMsg msgW = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = Math.PI
};
client.Move(msgW);
break;
case Key.S:
case Key.NumPad2:
MoveMsg msgS = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = 0
};
client.Move(msgS);
break;
case Key.D:
case Key.NumPad6:
MoveMsg msgD = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = Math.PI / 2
};
client.Move(msgD);
break;
case Key.A:
case Key.NumPad4:
MoveMsg msgA = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = 3 * Math.PI / 2
};
client.Move(msgA);
break;
case Key.J:
AttackMsg msgJ = new()
{
PlayerId = playerID,
Angle = Math.PI
};
client.Attack(msgJ);
break;
case Key.K:
IDMsg msgK = new()
{
PlayerId = playerID,
};
client.StartLearning(msgK);
break;
case Key.R:
TreatAndRescueMsg msgR = new()
{
PlayerId = playerID,
};
client.StartRescueMate(msgR);
break;
case Key.T:
TreatAndRescueMsg msgT = new()
{
PlayerId = playerID,
};
client.StartTreatMate(msgT);
break;
case Key.G:
IDMsg msgG = new()
{
PlayerId = playerID,
};
client.Graduate(msgG);
break;
case Key.H:
IDMsg msgH = new()
{
PlayerId = playerID,
};
client.StartOpenGate(msgH);
break;
case Key.O:
IDMsg msgO = new()
{
PlayerId = playerID,
};
client.OpenDoor(msgO);
break;
case Key.P:
IDMsg msgP = new()
{
PlayerId = playerID,
};
client.CloseDoor(msgP);
break;
case Key.U:
IDMsg msgU = new()
{
PlayerId = playerID,
};
client.SkipWindow(msgU);
break;
case Key.I:
IDMsg msgI = new()
{
PlayerId = playerID,
};
client.StartOpenChest(msgI);
break;
case Key.E:
IDMsg msgE = new()
{
PlayerId = playerID,
};
client.EndAllAction(msgE);
break;
case Key.F:
PropMsg msgF = new()
{
PlayerId = playerID,
PropType= PropType.NullPropType,
};
client.PickProp(msgF);
break;
case Key.C:
PropMsg msgC = new()
{
PlayerId = playerID,
PropType = PropType.NullPropType,
};
client.ThrowProp(msgC);
break;
case Key.V:
PropMsg msgV = new()
{
PlayerId = playerID,
PropType = PropType.NullPropType,
};
client.UseProp(msgV);
break;
case Key.B:
SkillMsg msgB = new()
{
PlayerId = playerID,
SkillId = 0,
};
client.UseSkill(msgB);
break;
case Key.N:
SkillMsg msgN = new()
{
PlayerId = playerID,
SkillId = 1,
};
client.UseSkill(msgN);
break;
case Key.M:
SkillMsg msgM = new()
{
PlayerId = playerID,
SkillId = 2,
};
client.UseSkill(msgM);
break;
default:
break;
switch (e.Key)
{
case Key.W:
case Key.NumPad8:
MoveMsg msgW = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = Math.PI
};
client.Move(msgW);
break;
case Key.S:
case Key.NumPad2:
MoveMsg msgS = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = 0
};
client.Move(msgS);
break;
case Key.D:
case Key.NumPad6:
MoveMsg msgD = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = Math.PI / 2
};
client.Move(msgD);
break;
case Key.A:
case Key.NumPad4:
MoveMsg msgA = new()
{
PlayerId = playerID,
TimeInMilliseconds = 50,
Angle = 3 * Math.PI / 2
};
client.Move(msgA);
break;
case Key.J:
AttackMsg msgJ = new()
{
PlayerId = playerID,
Angle = Math.PI
};
client.Attack(msgJ);
break;
case Key.K:
IDMsg msgK = new()
{
PlayerId = playerID,
};
client.StartLearning(msgK);
break;
case Key.R:
TreatAndRescueMsg msgR = new()
{
PlayerId = playerID,
};
client.StartRescueMate(msgR);
break;
case Key.T:
TreatAndRescueMsg msgT = new()
{
PlayerId = playerID,
};
client.StartTreatMate(msgT);
break;
case Key.G:
IDMsg msgG = new()
{
PlayerId = playerID,
};
client.Graduate(msgG);
break;
case Key.H:
IDMsg msgH = new()
{
PlayerId = playerID,
};
client.StartOpenGate(msgH);
break;
case Key.O:
IDMsg msgO = new()
{
PlayerId = playerID,
};
client.OpenDoor(msgO);
break;
case Key.P:
IDMsg msgP = new()
{
PlayerId = playerID,
};
client.CloseDoor(msgP);
break;
case Key.U:
IDMsg msgU = new()
{
PlayerId = playerID,
};
client.SkipWindow(msgU);
break;
case Key.I:
IDMsg msgI = new()
{
PlayerId = playerID,
};
client.StartOpenChest(msgI);
break;
case Key.E:
IDMsg msgE = new()
{
PlayerId = playerID,
};
client.EndAllAction(msgE);
break;
case Key.F:
PropMsg msgF = new()
{
PlayerId = playerID,
PropType = Protobuf.PropType.NullPropType,
};
client.PickProp(msgF);
break;
case Key.C:
PropMsg msgC = new()
{
PlayerId = playerID,
PropType = Protobuf.PropType.NullPropType,
};
client.ThrowProp(msgC);
break;
case Key.V:
PropMsg msgV = new()
{
PlayerId = playerID,
PropType = Protobuf.PropType.NullPropType,
};
client.UseProp(msgV);
break;
case Key.B:
SkillMsg msgB = new()
{
PlayerId = playerID,
SkillId = 0,
};
client.UseSkill(msgB);
break;
case Key.N:
SkillMsg msgN = new()
{
PlayerId = playerID,
SkillId = 1,
};
client.UseSkill(msgN);
break;
case Key.M:
SkillMsg msgM = new()
{
PlayerId = playerID,
SkillId = 2,
};
client.UseSkill(msgM);
break;
default:
break;
}
}
}
@ -1106,7 +1101,7 @@ namespace Client
{
if (!isPlaybackMode)
{
if (humanOrButcher&&human != null)
if (humanOrButcher && human != null)
{
AttackMsg msgJ = new()
{
@ -1182,7 +1177,7 @@ namespace Client
{
_ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
}
catch (Exception exc)
catch (Exception)
{
// ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
// error.Show();
@ -1231,7 +1226,7 @@ namespace Client
{
throw new Exception("敬请期待");
}
catch (Exception exc)
catch (Exception)
{
// ErrorDisplayer error = new(exc.Message);
// error.Show();
@ -1329,5 +1324,7 @@ namespace Client
private string[] comInfo = new string[5];
ArgumentOptions? options = null;
bool gateOpened = false;
}
}

View File

@ -36,8 +36,8 @@ namespace Client
}
}
public int[,]? ReadDataFromFile(List<MessageOfProp> listOfProp,List<MessageOfStudent> listOfHuman,List<MessageOfTricker> listOfButcher,List<MessageOfBullet> listOfBullet,
List<MessageOfBombedBullet> listOfBombedBullet,List<MessageOfAll> listOfAll,List<MessageOfChest> listOfChest,List<MessageOfClassroom> listOfClassroom,
public int[,]? ReadDataFromFile(List<MessageOfProp> listOfProp, List<MessageOfStudent> listOfHuman, List<MessageOfTricker> listOfButcher, List<MessageOfBullet> listOfBullet,
List<MessageOfBombedBullet> listOfBombedBullet, List<MessageOfAll> listOfAll, List<MessageOfChest> listOfChest, List<MessageOfClassroom> listOfClassroom,
List<MessageOfDoor> listOfDoor, List<MessageOfGate> listOfGate, object dataLock)
{
if (Reader == null)

View File

@ -2,7 +2,7 @@
"profiles": {
"Client": {
"commandName": "Project",
"commandLineArgs": "--cl --playbackFile=D:\\2_autumn\\thuai6\\playback.thuaipb --characterID=4 --type=2 --occupation=1"
"commandLineArgs": "--cl --ip 127.0.0.1 --port 8888 --characterID 0 --type 1 --occupation 1"
}
}
}

View File

@ -17,9 +17,9 @@
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="62*"/>
</Grid.ColumnDefinitions>
<TextBox Name="time" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Time⏳" Grid.Row="0" Grid.ColumnSpan="2" FontSize="14"/>
<TextBox Name="status" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="📱&#xA;🚪:&#xA;🆘:&#xA;🏃:&#xA;⚰️:" Grid.Row="1" Grid.ColumnSpan="2" FontSize="13"/>
<TextBox Name="scoresOfStudents" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores of Students" Grid.Row="2" Grid.ColumnSpan="2" FontSize="12"/>
<TextBox Name="scoresOfTrickers" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores of Tricker" Grid.Row="3" Grid.ColumnSpan="2" FontSize="12"/>
<TextBox Name="time" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Time⏳: " Grid.Row="0" Grid.ColumnSpan="2" FontSize="14"/>
<TextBox Name="status" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="📱: &#xA;🚪: &#xA;🆘: &#xA;🏃: &#xA;⚰️: " Grid.Row="1" Grid.ColumnSpan="2" FontSize="13"/>
<TextBox Name="scoresOfStudents" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores of Students: " Grid.Row="2" Grid.ColumnSpan="2" FontSize="12"/>
<TextBox Name="scoresOfTrickers" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores of Tricker: " Grid.Row="3" Grid.ColumnSpan="2" FontSize="12"/>
</Grid>
</UserControl>

View File

@ -36,11 +36,12 @@ namespace Client
scoresOfStudents.FontSize = scoresOfTrickers.FontSize = fontsize;
}
public void SetValue(MessageOfAll obj)
public void SetValue(MessageOfAll obj, bool gateOpened)
{
bool hiddenGateRefreshed = false, hiddenGateOpened = false;
time.Text = "Time⏳: " + Convert.ToString(obj.GameTime);
status.Text = "📱: " + Convert.ToString(obj.SubjectLeft) + "\n🚪: ";
if(obj.GateOpened)
status.Text = "📱: " + Convert.ToString(obj.SubjectFinished) + "\n🚪: ";
if (gateOpened)
{
status.Text += "Open\n🆘: ";
}
@ -48,9 +49,17 @@ namespace Client
{
status.Text += "Close\n🆘: ";
}
if(obj.HiddenGateRefreshed)
if (obj.SubjectFinished >= Preparation.Utility.GameData.numOfGeneratorRequiredForEmergencyExit)
{
if(obj.HiddenGateOpened)
hiddenGateRefreshed = true;
}
if (Preparation.Utility.GameData.numOfStudent == 1 + obj.StudentQuited + obj.StudentGraduated)
{
hiddenGateOpened = true;
}
if (hiddenGateRefreshed)
{
if (hiddenGateOpened)
{
status.Text += "Open\n🏃: ";
}
@ -63,10 +72,10 @@ namespace Client
{
status.Text += "Unrefreshed\n🏃: ";
}
status.Text += Convert.ToString(obj.StudentGraduated)+ "\n⚰: ";
status.Text += Convert.ToString(obj.StudentGraduated) + "\n⚰: ";
status.Text += Convert.ToString(obj.StudentQuited);
scoresOfStudents.Text = "Scores of Students" + Convert.ToString(obj.StudentScore);
scoresOfTrickers.Text = "Scores of Tricker" + Convert.ToString(obj.TrickerScore);
scoresOfStudents.Text = "Scores of Students: " + Convert.ToString(obj.StudentScore);
scoresOfTrickers.Text = "Scores of Tricker: " + Convert.ToString(obj.TrickerScore);
}
}
}

View File

@ -22,10 +22,10 @@
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="21*"/>
</Grid.ColumnDefinitions>
<TextBox Name="serial" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="👥null👻null&#xD;&#xA;职业" Grid.Row="0" Grid.ColumnSpan="4" FontSize="12"/>
<TextBox Name="status" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="🏃🏿‍" Grid.Row="1" Grid.ColumnSpan="2" />
<TextBox Name="serial" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="👥null👻null&#xD;&#xA;职业: " Grid.Row="0" Grid.ColumnSpan="4" FontSize="12"/>
<TextBox Name="status" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="🏃🏿‍: " Grid.Row="1" Grid.ColumnSpan="2" />
<TextBox Name="state" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" />
<TextBox Name="scores" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores" Grid.Row="2" Grid.ColumnSpan="4"/>
<TextBox Name="scores" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores: " Grid.Row="2" Grid.ColumnSpan="4"/>
<TextBox Name="activeSkill0" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="" Grid.Row="3" Grid.ColumnSpan="2"/>
<ProgressBar Name="skillprogress0" Background="White" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2"/>

View File

@ -36,7 +36,7 @@ namespace Client
}
public void SetFontSize(double fontsize)
{
serial.FontSize = scores.FontSize = state.FontSize = status.FontSize=activeSkill0.FontSize = activeSkill1.FontSize = activeSkill2.FontSize = prop0.FontSize = prop1.FontSize = prop2.FontSize = prop3.FontSize = fontsize;
serial.FontSize = scores.FontSize = state.FontSize = status.FontSize = activeSkill0.FontSize = activeSkill1.FontSize = activeSkill2.FontSize = prop0.FontSize = prop1.FontSize = prop2.FontSize = prop3.FontSize = fontsize;
}
private void SetStaticValue(MessageOfTricker obj)
@ -45,23 +45,23 @@ namespace Client
{
case TrickerType.Assassin:
coolTime0 = coolTime1 = coolTime2 = 10000;
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业Assassin";
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业: Assassin";
break;
case TrickerType._2:
coolTime0 = coolTime1 = coolTime2 = 20000;
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业TrickerType2";
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业: TrickerType2";
break;
case TrickerType._3:
coolTime0 = coolTime1 = coolTime2 = 30000;
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业TrickerType3";
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业: TrickerType3";
break;
case TrickerType._4:
coolTime0 = coolTime1 = coolTime2 = 40000;
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业TrickerType4";
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业: TrickerType4";
break;
case TrickerType.NullTrickerType:
coolTime0 = coolTime1 = coolTime2 = -1;
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业NullTrickerType";
serial.Text = "👥" + Convert.ToString(1) + "👻" + Convert.ToString(obj.PlayerId) + "\n职业: NullTrickerType";
break;
}
activeSkill0.Text = "Skill0";
@ -71,7 +71,7 @@ namespace Client
}
private void SetDynamicValue(MessageOfTricker obj)
{
status.Text = "🏃🏿‍"+Convert.ToString(obj.Speed);
status.Text = "🏃🏿‍: " + Convert.ToString(obj.Speed);
switch (obj.PlayerState)
{
case PlayerState.Idle:
@ -114,10 +114,10 @@ namespace Client
state.Text = "Locking";
break;
case PlayerState.Rummaging:
state.Text ="Rummaging";
state.Text = "Rummaging";
break;
case PlayerState.Climbing:
state.Text ="Climbing";
state.Text = "Climbing";
break;
case PlayerState.OpeningAChest:
state.Text = "OpeningAChest";
@ -131,7 +131,7 @@ namespace Client
default:
break;
}
scores.Text = "Scores:" + Convert.ToString(obj.Score);
scores.Text = "Scores: " + Convert.ToString(obj.Score);
if (obj.TimeUntilSkillAvailable[0] >= 0)
skillprogress0.Value = 100 - obj.TimeUntilSkillAvailable[0] / coolTime0 * 100;
if (obj.TimeUntilSkillAvailable[1] >= 0)
@ -153,25 +153,25 @@ namespace Client
case 0:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop0.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop0.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop0.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop0.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop0.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop0.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop0.Text = "🛡";
break;
default:
@ -183,25 +183,25 @@ namespace Client
case 1:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop1.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop1.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop1.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop1.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop1.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop1.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop1.Text = "🛡";
break;
default:
@ -213,25 +213,25 @@ namespace Client
case 2:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop2.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop2.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop2.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop2.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop2.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop2.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop2.Text = "🛡";
break;
default:
@ -243,25 +243,25 @@ namespace Client
case 3:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop3.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop3.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop3.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop3.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop3.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop3.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop3.Text = "🛡";
break;
default:

View File

@ -23,9 +23,9 @@
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<TextBox Name="serial" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="👥null🧓null&#xD;&#xA;职业" Grid.Row="0" Grid.ColumnSpan="4" FontSize="12"/>
<TextBox Name="status" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="♥" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="4"/>
<TextBox Name="scores" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores" Grid.Row="3" Grid.ColumnSpan="4"/>
<TextBox Name="serial" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="👥null🧓null&#xD;&#xA;职业: " Grid.Row="0" Grid.ColumnSpan="4" FontSize="12"/>
<TextBox Name="status" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="♥: " Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="4"/>
<TextBox Name="scores" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="Scores: " Grid.Row="3" Grid.ColumnSpan="4"/>
<TextBox Name="activeSkill0" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="" Grid.Row="4" Grid.ColumnSpan="2"/>
<ProgressBar Name="skillprogress0" Background="White" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2"/>
<TextBox Name="activeSkill1" IsReadOnly="True" BorderBrush="LightGray" TextWrapping="Wrap" Text="" Grid.Row="5" Grid.ColumnSpan="2"/>

View File

@ -39,23 +39,23 @@ namespace Client
{
case StudentType.Athlete:
coolTime0 = coolTime1 = coolTime2 = 10000;
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业Athlete";
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业: Athlete";
break;
case StudentType._2:
coolTime0 = coolTime1 = coolTime2 = 20000;
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业StudentType2";
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业: StudentType2";
break;
case StudentType._3:
coolTime0 = coolTime1 = coolTime2 = 30000;
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业StudentType3";
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业: StudentType3";
break;
case StudentType._4:
coolTime0 = coolTime1 = coolTime2 = 40000;
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业StudentType4";
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业: StudentType4";
break;
case StudentType.NullStudentType:
coolTime0 = coolTime1 = coolTime2 = -1;
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业NullStudentType";
serial.Text = "👥" + Convert.ToString(2) + "🧓" + Convert.ToString(obj.PlayerId) + "\n职业: NullStudentType";
break;
}
activeSkill0.Text = "Skill0";
@ -65,107 +65,107 @@ namespace Client
}
private void SetDynamicValue(MessageOfStudent obj)
{
int life= obj.Determination,death=obj.Addiction;
switch(obj.PlayerState)
int life = obj.Determination, death = obj.Addiction;
switch (obj.PlayerState)
{
case PlayerState.Idle:
status.Text = "♥" + Convert.ToString(life)+"\nIdle";
status.Text = "♥: " + Convert.ToString(life) + "\nIdle";
break;
case PlayerState.Learning:
status.Text = "♥" + Convert.ToString(life)+ "\nLearning";
status.Text = "♥: " + Convert.ToString(life) + "\nLearning";
break;
case PlayerState.Addicted:
status.Text = "💀" + Convert.ToString(death)+ "\nAddicted";
status.Text = "💀: " + Convert.ToString(death) + "\nAddicted";
break;
case PlayerState.Graduated:
status.Text = status.Text = "♥" + "\nGraduated";
break;
case PlayerState.Quit:
status.Text = "💀"+"\nQuit";
status.Text = "💀" + "\nQuit";
break;
case PlayerState.Treated:
status.Text = "♥" + Convert.ToString(life) + "\nTreated";
status.Text = "♥: " + Convert.ToString(life) + "\nTreated";
break;
case PlayerState.Rescued:
status.Text = "💀" + Convert.ToString(death)+ "\nRescued";
status.Text = "💀: " + Convert.ToString(death) + "\nRescued";
break;
case PlayerState.Stunned:
status.Text = "♥" + Convert.ToString(life) + "\nStunned";
status.Text = "♥: " + Convert.ToString(life) + "\nStunned";
break;
case PlayerState.Treating:
status.Text = "♥" + Convert.ToString(life) + "\nTreating";
status.Text = "♥: " + Convert.ToString(life) + "\nTreating";
break;
case PlayerState.Rescuing:
status.Text = "♥" + Convert.ToString(life) + "\nRescuing";
status.Text = "♥: " + Convert.ToString(life) + "\nRescuing";
break;
case PlayerState.Swinging:
status.Text = "♥" + Convert.ToString(life) + "\nSwinging";
status.Text = "♥: " + Convert.ToString(life) + "\nSwinging";
break;
case PlayerState.Attacking:
status.Text = "♥" + Convert.ToString(life) + "\nAttacking";
status.Text = "♥: " + Convert.ToString(life) + "\nAttacking";
break;
case PlayerState.Locking:
status.Text = "♥" + Convert.ToString(life) + "\nLocking";
status.Text = "♥: " + Convert.ToString(life) + "\nLocking";
break;
case PlayerState.Rummaging:
status.Text = "♥" + Convert.ToString(life) + "\nRummaging";
status.Text = "♥: " + Convert.ToString(life) + "\nRummaging";
break;
case PlayerState.Climbing:
status.Text = "♥" + Convert.ToString(life) + "\nClimbing";
status.Text = "♥: " + Convert.ToString(life) + "\nClimbing";
break;
case PlayerState.OpeningAChest:
status.Text = "♥" + Convert.ToString(life) + "\nOpeningAChest";
status.Text = "♥: " + Convert.ToString(life) + "\nOpeningAChest";
break;
case PlayerState.UsingSpecialSkill:
status.Text = "♥" + Convert.ToString(life) + "\nUsingSpecialSkill";
status.Text = "♥: " + Convert.ToString(life) + "\nUsingSpecialSkill";
break;
case PlayerState.OpeningAGate:
status.Text = "♥" + Convert.ToString(life) + "\nOpeningAGate";
status.Text = "♥: " + Convert.ToString(life) + "\nOpeningAGate";
break;
default:
break;
}
scores.Text = "Scores:" + obj.Score;
if (obj.TimeUntilSkillAvailable[0]>=0)
scores.Text = "Scores: " + obj.Score;
if (obj.TimeUntilSkillAvailable[0] >= 0)
skillprogress0.Value = 100 - obj.TimeUntilSkillAvailable[0] / coolTime0 * 100;
if(obj.TimeUntilSkillAvailable[1] >= 0)
if (obj.TimeUntilSkillAvailable[1] >= 0)
skillprogress1.Value = 100 - obj.TimeUntilSkillAvailable[1] / coolTime1 * 100;
if(obj.TimeUntilSkillAvailable[2] >= 0)
if (obj.TimeUntilSkillAvailable[2] >= 0)
skillprogress2.Value = 100 - obj.TimeUntilSkillAvailable[2] / coolTime2 * 100;
if (obj.PlayerState == PlayerState.Quit)
{
skillprogress0.Value = skillprogress1.Value = skillprogress2.Value = 0;
skillprogress0.Background = skillprogress1.Background= skillprogress2.Background=Brushes.Gray;
skillprogress0.Background = skillprogress1.Background = skillprogress2.Background = Brushes.Gray;
}
else
skillprogress0.Background = skillprogress1.Background= skillprogress2.Background=Brushes.White;
skillprogress0.Background = skillprogress1.Background = skillprogress2.Background = Brushes.White;
int cnt = 0;
foreach (var icon in obj.Prop)
{
switch(cnt)
switch (cnt)
{
case 0:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop0.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop0.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop0.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop0.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop0.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop0.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop0.Text = "🛡";
break;
default:
@ -177,25 +177,25 @@ namespace Client
case 1:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop1.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop1.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop1.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop1.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop1.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop1.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop1.Text = "🛡";
break;
default:
@ -207,25 +207,25 @@ namespace Client
case 2:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop2.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop2.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop2.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop2.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop2.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop2.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop2.Text = "🛡";
break;
default:
@ -237,25 +237,25 @@ namespace Client
case 3:
switch (icon)
{
case PropType.Key3:
case Protobuf.PropType.Key3:
prop3.Text = "🔑";
break;
case PropType.Key5:
case Protobuf.PropType.Key5:
prop3.Text = "🔑";
break;
case PropType.Key6:
case Protobuf.PropType.Key6:
prop3.Text = "🔑";
break;
case PropType.AddSpeed:
case Protobuf.PropType.AddSpeed:
prop3.Text = "⛸";
break;
case PropType.AddLifeOrAp:
case Protobuf.PropType.AddLifeOrAp:
prop3.Text = "🏅";
break;
case PropType.AddHpOrAp:
case Protobuf.PropType.AddHpOrAp:
prop3.Text = "♥";
break;
case PropType.ShieldOrSpear:
case Protobuf.PropType.ShieldOrSpear:
prop3.Text = "🛡";
break;
default:
@ -266,7 +266,7 @@ namespace Client
break;
default:
break;
}
}
}
}
public void SetValue(MessageOfStudent obj)

View File

@ -5,7 +5,7 @@ namespace ClientTest
{
public class Program
{
public static async Task Main(string[] args)
public static Task Main(string[] args)
{
Thread.Sleep(3000);
Channel channel = new Channel("127.0.0.1:8888", ChannelCredentials.Insecure);
@ -36,17 +36,7 @@ namespace ClientTest
Console.WriteLine("Move!");
}
/*while (await call.ResponseStream.MoveNext())
{
//Console.WriteLine("hi");
var currentGameInfo = call.ResponseStream.Current;
for (int i = 0; i < currentGameInfo.ObjMessage.Count; i++)
{
if (currentGameInfo.ObjMessage[i].MessageOfObjCase == MessageOfObj.MessageOfObjOneofCase.StudentMessage)
Console.WriteLine($"Human is at ({currentGameInfo.ObjMessage[i].StudentMessage.X}, {currentGameInfo.ObjMessage[i].StudentMessage.Y})");
}
}*/
return Task.CompletedTask;
}
}
}

View File

@ -28,12 +28,12 @@ namespace GameClass.GameObj
{
if (value > 0)
lock (gameObjLock)
openDegree = (value > GameData.degreeOfOpeningChest) ? GameData.degreeOfOpeningChest : value;
openDegree = (value > GameData.degreeOfOpenedChest) ? GameData.degreeOfOpenedChest : value;
else
lock (gameObjLock)
openDegree = 0;
}
}
public bool IsOpen() => (OpenDegree == GameData.degreeOfOpeningChest);
public bool IsOpen() => (OpenDegree == GameData.degreeOfOpenedChest);
}
}

View File

@ -203,7 +203,7 @@ namespace Preparation.Utility
#region
public const int degreeOfFixedGenerator = 10300000;
public const int degreeOfLockingOrOpeningTheDoor = 10000;
public const int degreeOfOpeningChest = 10000;
public const int degreeOfOpenedChest = 10000;
public const int degreeOfOpenedDoorway = 18000;
public const int maxNumOfPropInChest = 2;
public const int numOfGeneratorRequiredForRepair = 7;

View File

@ -270,10 +270,10 @@ namespace Server
foreach (var value in player.PropInventory)
msg.StudentMessage.Prop.Add(ToPropType(value.GetPropType()));
msg.StudentMessage.Place = ToPlaceType(player.Place);
msg.StudentMessage.Place = ToPlaceType((Preparation.Utility.PlaceType)player.Place);
msg.StudentMessage.Guid = player.ID;
msg.StudentMessage.PlayerState = ToPlayerState(player.PlayerState);
msg.StudentMessage.PlayerState = ToPlayerState((PlayerStateType)player.PlayerState);
msg.StudentMessage.PlayerId = player.PlayerID;
msg.StudentMessage.ViewRange = player.ViewRange;
msg.StudentMessage.Radius = player.Radius;
@ -288,7 +288,7 @@ namespace Server
msg.StudentMessage.Buff.Add(ToStudentBuffType(kvp.Key));
}
msg.StudentMessage.BulletType = ToBulletType(player.BulletOfPlayer);
msg.StudentMessage.BulletType = ToBulletType((Preparation.Utility.BulletType)player.BulletOfPlayer);
msg.StudentMessage.LearningSpeed = player.FixSpeed;
msg.StudentMessage.TreatSpeed = player.TreatSpeed;
msg.StudentMessage.FacingDirection = player.FacingDirection.Angle();
@ -310,7 +310,7 @@ namespace Server
for (int i = 0; i < GameData.maxNumOfSkill - player.TimeUntilActiveSkillAvailable.Count(); ++i)
msg.TrickerMessage.TimeUntilSkillAvailable.Add(-1);
msg.TrickerMessage.Place = ToPlaceType(player.Place);
msg.TrickerMessage.Place = ToPlaceType((Preparation.Utility.PlaceType)player.Place);
foreach (var value in player.PropInventory)
msg.TrickerMessage.Prop.Add(ToPropType(value.GetPropType()));
@ -320,11 +320,11 @@ namespace Server
msg.TrickerMessage.PlayerId = player.PlayerID;
msg.TrickerMessage.ViewRange = player.ViewRange;
msg.TrickerMessage.Radius = player.Radius;
msg.TrickerMessage.PlayerState = ToPlayerState(player.PlayerState);
msg.TrickerMessage.PlayerState = ToPlayerState((PlayerStateType)player.PlayerState);
msg.TrickerMessage.TrickDesire = (player.BgmDictionary.ContainsKey(BgmType.StudentIsApproaching)) ? player.BgmDictionary[BgmType.StudentIsApproaching] : 0;
msg.TrickerMessage.ClassVolume = (player.BgmDictionary.ContainsKey(BgmType.GeneratorIsBeingFixed)) ? player.BgmDictionary[BgmType.GeneratorIsBeingFixed] : 0;
msg.TrickerMessage.FacingDirection = player.FacingDirection.Angle();
msg.TrickerMessage.BulletType = ToBulletType(player.BulletOfPlayer);
msg.TrickerMessage.BulletType = ToBulletType((Preparation.Utility.BulletType)player.BulletOfPlayer);
foreach (KeyValuePair<Preparation.Utility.BuffType, bool> kvp in player.Buff)
{
if (kvp.Value)
@ -344,7 +344,7 @@ namespace Server
msg.BulletMessage.FacingDirection = bullet.FacingDirection.Angle();
msg.BulletMessage.Guid = bullet.ID;
msg.BulletMessage.Team = (bullet.Parent.IsGhost()) ? PlayerType.TrickerPlayer : PlayerType.StudentPlayer;
msg.BulletMessage.Place = ToPlaceType(bullet.Place);
msg.BulletMessage.Place = ToPlaceType((Preparation.Utility.PlaceType)bullet.Place);
msg.BulletMessage.BombRange = bullet.BulletBombRange;
msg.BulletMessage.Speed = bullet.Speed;
return msg;
@ -359,7 +359,7 @@ namespace Server
msg.PropMessage.Y = prop.Position.y;
msg.PropMessage.FacingDirection = prop.FacingDirection.Angle();
msg.PropMessage.Guid = prop.ID;
msg.PropMessage.Place = ToPlaceType(prop.Place);
msg.PropMessage.Place = ToPlaceType((Preparation.Utility.PlaceType)prop.Place);
return msg;
}

View File

@ -0,0 +1,142 @@

namespace Preparation.Utility
{
/// <summary>
/// 存放所有用到的枚举类型
/// </summary>
public enum PlayerStateType
{
Null = 0,
Addicted = 1,
Escaped = 2,
Swinging = 3,//指后摇
Deceased = 4,
Moving = 5,
Treating = 6,
Rescuing = 7,
Fixing = 8,
Treated = 9,
Rescued = 10,
Stunned = 11,
TryingToAttack = 12,//指前摇
LockingOrOpeningTheDoor = 13,
OpeningTheChest = 14,
ClimbingThroughWindows = 15,
UsingSkill = 16,
OpeningTheDoorway = 17,
}
public enum GameObjType
{
Null = 0,
Character = 1,
Prop = 2,
PickedProp = 3,
Bullet = 4,
BombedBullet = 5,
Wall = 6,
Grass = 7,
Generator = 8, // 发电机
Doorway = 9,
EmergencyExit = 10,
OutOfBoundBlock = 11, // 范围外
Window = 12,
Door = 13,
Chest = 14,
}
public enum ShapeType
{
Null = 0,
Circle = 1, // 子弹和人物为圆形,格子为方形
Square = 2
}
public enum BulletType // 子弹类型
{
Null = 0,
OrdinaryBullet = 1, // 普通子弹
AtomBomb = 2, // 原子弹
FastBullet = 3, // 快速子弹
LineBullet = 4, // 直线子弹
FlyingKnife = 5, //飞刀
CommonAttackOfGhost = 6,
// Ram = 7,
}
public enum PropType // 道具类型
{
Null = 0,
AddSpeed = 1,
AddLifeOrAp = 2,
AddHpOrAp = 3,
ShieldOrSpear = 4,
Key3 = 5,
Key5 = 6,
Key6 = 7,
}
public enum CharacterType // 职业
{
Null = 0,
Assassin = 1,
Athlete = 2,
RecoverAfterBattle = 3,
SpeedUpWhenLeavingGrass = 4,
Teacher = 5,
PSkill5 = 6
}
public enum ActiveSkillType // 主动技能
{
Null = 0,
BecomeInvisible = 1,
BecomeVampire = 2,
NuclearWeapon = 3,
SuperFast = 4,
UseKnife = 5,
CanBeginToCharge = 6,
Punish = 7,
}
public enum PassiveSkillType
{
Null = 0,
BecomeInvisible = 1,
BecomeVampire = 2,
NuclearWeapon = 3,
SuperFast = 4,
ASkill4 = 5,
ASkill5 = 6
}
public enum BuffType // buff
{
Null = 0,
AddSpeed = 1,
AddLIFE = 2,
Shield = 3,
Spear = 4,
AddAp = 5,
}
public enum PlaceType
{
Null = 0,
BirthPoint1 = 1,//必须从1开始
BirthPoint2 = 2,
BirthPoint3 = 3,
BirthPoint4 = 4,
BirthPoint5 = 5,
Wall = 6,
Grass = 7,
Generator = 8, // 发电机
Doorway = 9,
EmergencyExit = 10,
Window = 11,
Door3 = 12,
Door5 = 13,
Door6 = 14,
Chest = 15,
}
public enum BgmType
{
Null = 0,
GhostIsComing = 1,
StudentIsApproaching = 2,
GeneratorIsBeingFixed = 3,
}
}

View File

@ -2,7 +2,7 @@
"profiles": {
"Server": {
"commandName": "Project",
"commandLineArgs": "--ip 0.0.0.0 -p 8888"
"commandLineArgs": "--ip 0.0.0.0 -p 8888 --teamCount 1 --studentCount 1 --trickerCount 0"
}
}
}

View File

@ -1,22 +1,16 @@
@echo off
<<<<<<< HEAD
start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --port 8888 --studentCount 1 --trickerCount 1 --gameTimeInSecond 600 --fileName test
start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --studentCount 2 --trickerCount 1 --gameTimeInSecond 600 --fileName test
ping -n 2 127.0.0.1 > NUL
::start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port=8888 --characterID=4 --type=2 --occupation=1
=======
start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --studentCount 1 --trickerCount 1 --gameTimeInSecond 600 --fileName test
>>>>>>> 4e3f3ccafe0e3c791ca4dbe137b32a7d252ae9d5
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 4 --type 2 --occupation 1
ping -n 2 127.0.0.1 > NUL
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port=8888 --characterID=0 --type=1 --occupation=1
<<<<<<< HEAD
=======
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 0 --type 1 --occupation 1
ping -n 2 127.0.0.1 > NUL
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port=8888 --characterID=4 --type=2 --occupation=1
>>>>>>> 4e3f3ccafe0e3c791ca4dbe137b32a7d252ae9d5
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 1 --type 1 --occupation 1

View File

@ -1,3 +1,3 @@
@echo off
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --playbackFile D:\2_autumn\thuai6\THUAI6\logic\cmd\first_test.thuaipb
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --playbackFile D:\2_autumn\thuai6\THUAI6\logic\cmd\test.thuaipb

View File

@ -19,6 +19,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GameEngine", "GameEngine\Ga
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Playback", "..\playback\Playback\Playback.csproj", "{FF22960A-6BD9-4C80-A029-9A39FB8F64C4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{14C1A4DC-3F6C-4A3E-8CD0-2E595C99F1C6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{F8CD6F8B-0EEE-43B6-BEDF-240E1DBB013D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -57,6 +61,10 @@ Global
{FF22960A-6BD9-4C80-A029-9A39FB8F64C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF22960A-6BD9-4C80-A029-9A39FB8F64C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF22960A-6BD9-4C80-A029-9A39FB8F64C4}.Release|Any CPU.Build.0 = Release|Any CPU
{F8CD6F8B-0EEE-43B6-BEDF-240E1DBB013D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8CD6F8B-0EEE-43B6-BEDF-240E1DBB013D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8CD6F8B-0EEE-43B6-BEDF-240E1DBB013D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8CD6F8B-0EEE-43B6-BEDF-240E1DBB013D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE