Browse Source

Merge pull request #278 from Shawqeem/dev

fix bugs to make robots in the field
tags/0.1.0
shangfengh GitHub 3 years ago
parent
commit
92d2b5ddc9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions
  1. +7
    -2
      logic/Client/MainWindow.xaml.cs
  2. +2
    -2
      logic/cmd/gameServer.cmd

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

@@ -675,7 +675,7 @@ namespace Client
MaxButton.Content = "🗖";
foreach (var obj in listOfHuman)
{
if (obj.PlayerId < GameData.numOfStudent)
if (obj.PlayerId < GameData.numOfStudent && obj.StudentType != StudentType.Robot)
{
IStudentType occupation = (IStudentType)OccupationFactory.FindIOccupation(Transformation.ToStudentType(obj.StudentType));
totalLife[obj.PlayerId] = occupation.MaxHp;
@@ -749,7 +749,8 @@ namespace Client
DrawMap();
foreach (var data in listOfHuman)
{
StatusBarsOfSurvivor[data.PlayerId].SetValue(data, data.PlayerId);
if (data.StudentType != StudentType.Robot)
StatusBarsOfSurvivor[data.PlayerId].SetValue(data, data.PlayerId);
if (CanSee(data))
{
Ellipse icon = new()
@@ -761,6 +762,8 @@ namespace Client
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth * radiusTimes, data.X * unitHeight / 1000.0 - unitHeight * radiusTimes, 0, 0),
Fill = Brushes.BlueViolet,
};
if (data.StudentType == StudentType.Robot)
icon.Fill = Brushes.Gray;
TextBox num = new()
{
FontSize = 7 * UpperLayerOfMap.ActualHeight / 650,
@@ -775,6 +778,8 @@ namespace Client
IsReadOnly = true,
Foreground = Brushes.White,
};
if (data.StudentType == StudentType.Robot)
num.Text = Convert.ToString(data.PlayerId - Preparation.Utility.GameData.numOfPeople);
UpperLayerOfMap.Children.Add(icon);
UpperLayerOfMap.Children.Add(num);
}


+ 2
- 2
logic/cmd/gameServer.cmd View File

@@ -6,9 +6,9 @@ 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 4

start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 0 --type 1 --occupation 6
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 0 --type 1 --occupation 5

start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 1 --type 1 --occupation 2
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 1 --type 1 --occupation 5

start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 2 --type 1 --occupation 3



Loading…
Cancel
Save