From 4ccb6cf9122b6eab10a3ed4f471e1b2ad448d485 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Sat, 4 Mar 2023 22:50:36 +0800 Subject: [PATCH 1/2] feat: :sparkles: add the fuction of Stop --- logic/GameClass/GameObj/Character/Character.cs | 1 + logic/Gaming/ActionManager.cs | 14 ++++++++++++++ logic/Gaming/Game.cs | 12 ++++++++++++ logic/Preparation/Utility/EnumType.cs | 3 +++ 4 files changed, 30 insertions(+) diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs index 6ab6ba1..033de45 100644 --- a/logic/GameClass/GameObj/Character/Character.cs +++ b/logic/GameClass/GameObj/Character/Character.cs @@ -477,6 +477,7 @@ namespace GameClass.GameObj playerState = playerStateType; CanMove = false; IsResetting = true; + Position = GameData.PosWhoDie; } } diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 16df5fc..20c00d8 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -22,6 +22,20 @@ namespace Gaming return true; } + public bool Stop(Character player) + { + if (player.PlayerState == PlayerStateType.IsRescuing || player.PlayerState == PlayerStateType.IsRescued + || player.PlayerState == PlayerStateType.IsFixing || player.PlayerState == PlayerStateType.IsMoving + || player.PlayerState == PlayerStateType.IsTreated || player.PlayerState == PlayerStateType.IsTreating + || player.PlayerState == PlayerStateType.IsClosingDoor || player.PlayerState == PlayerStateType.IsOpeningDoor + || player.PlayerState == PlayerStateType.IsClimbingThtoughWindows) + { + player.PlayerState = PlayerStateType.Null; + return true; + } + return false; + } + public bool Fix(Student player)// 自动检查有无发电机可修 { if (player.PlayerState != PlayerStateType.Null || player.IsGhost()) diff --git a/logic/Gaming/Game.cs b/logic/Gaming/Game.cs index cf905e7..2b578ec 100644 --- a/logic/Gaming/Game.cs +++ b/logic/Gaming/Game.cs @@ -242,6 +242,18 @@ namespace Gaming } return false; } + public bool Stop(long playerID) + { + if (!gameMap.Timer.IsGaming) + return false; + Character player = gameMap.FindPlayer(playerID); + if (player != null) + { + return actionManager.Stop(player); + } + return false; + } + public void Attack(long playerID, double angle) { if (!gameMap.Timer.IsGaming) diff --git a/logic/Preparation/Utility/EnumType.cs b/logic/Preparation/Utility/EnumType.cs index 19d3a04..4bb5146 100644 --- a/logic/Preparation/Utility/EnumType.cs +++ b/logic/Preparation/Utility/EnumType.cs @@ -19,6 +19,9 @@ namespace Preparation.Utility IsRescued = 10, IsStunned = 11, IsTryingToAttack = 12,//指前摇 + IsOpeningDoor = 13, + IsClosingDoor = 14, + IsClimbingThtoughWindows = 15, } public enum GameObjType { From b1b7587eded14b05095b30a333b103b91a25d458 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Sat, 4 Mar 2023 23:29:50 +0800 Subject: [PATCH 2/2] fix: :bug: fix the deficiency of skill --- logic/GameClass/GameObj/Character/Character.cs | 2 +- logic/GameClass/Skill/ActiveSkill.cs | 4 ++++ logic/Preparation/Utility/EnumType.cs | 2 +- logic/Preparation/Utility/GameData.cs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs index 033de45..95788f8 100644 --- a/logic/GameClass/GameObj/Character/Character.cs +++ b/logic/GameClass/GameObj/Character/Character.cs @@ -65,7 +65,7 @@ namespace GameClass.GameObj } set { - if (!(value == PlayerStateType.IsMoving || value == PlayerStateType.Null)) + if (!(value == PlayerStateType.IsMoving)) lock (gameObjLock) IsMoving = false; diff --git a/logic/GameClass/Skill/ActiveSkill.cs b/logic/GameClass/Skill/ActiveSkill.cs index 87ff08c..c67e969 100644 --- a/logic/GameClass/Skill/ActiveSkill.cs +++ b/logic/GameClass/Skill/ActiveSkill.cs @@ -214,6 +214,10 @@ namespace GameClass.Skill { case BecomeInvisible: return ActiveSkillType.BecomeInvisible; + case UseKnife: + return ActiveSkillType.UseKnife; + case BeginToCharge: + return ActiveSkillType.BeginToCharge; default: return ActiveSkillType.Null; } diff --git a/logic/Preparation/Utility/EnumType.cs b/logic/Preparation/Utility/EnumType.cs index 4bb5146..37fffbe 100644 --- a/logic/Preparation/Utility/EnumType.cs +++ b/logic/Preparation/Utility/EnumType.cs @@ -82,7 +82,7 @@ namespace Preparation.Utility NuclearWeapon = 3, SuperFast = 4, UseKnife = 5, - ASkill5 = 6 + BeginToCharge = 6 } public enum PassiveSkillType { diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index 813cb0a..51b3875 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -7,7 +7,7 @@ namespace Preparation.Utility { #region 基本常数与常方法 public const int numOfPosGridPerCell = 1000; // 每格的【坐标单位】数 - public const int numOfStepPerSecond = 100; // 每秒行走的步数 + public const int numOfStepPerSecond = 20; // 每秒行走的步数 public const int frameDuration = 50; // 每帧时长 public const int lengthOfMap = 50000; // 地图长度