From cd87134156c3e3e4bba62f7ace76b9b260448fbd Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Wed, 5 Apr 2023 01:24:37 +0800 Subject: [PATCH] build: :construction: adjust the viewRange and AlertnessRadius --- logic/Gaming/ActionManager.cs | 2 +- logic/Preparation/Interface/IOccupation.cs | 36 +- logic/Preparation/Interface/ISkill.cs | 440 ++++++++++----------- logic/Preparation/Utility/GameData.cs | 6 +- logic/规则Logic.md | 2 +- 5 files changed, 244 insertions(+), 242 deletions(-) diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 99ba94a..39e5c32 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -245,7 +245,7 @@ namespace Gaming return false; Chest? chestToOpen = (Chest?)gameMap.OneForInteract(player.Position, GameObjType.Chest); - if (chestToOpen == null || chestToOpen.IsOpen() || chestToOpen.OpenDegree > 0) + if (chestToOpen == null || chestToOpen.OpenDegree > 0) return false; player.PlayerState = PlayerStateType.OpeningTheChest; diff --git a/logic/Preparation/Interface/IOccupation.cs b/logic/Preparation/Interface/IOccupation.cs index fa0d0a2..22e90e2 100644 --- a/logic/Preparation/Interface/IOccupation.cs +++ b/logic/Preparation/Interface/IOccupation.cs @@ -45,10 +45,10 @@ namespace Preparation.Interface public double concealment = GameData.basicConcealment * 1.5; public double Concealment => concealment; - public int alertnessRadius = (int)(GameData.basicAlertnessRadius * 1.3); + public int alertnessRadius = (int)(GameData.basicGhostAlertnessRadius * 1.3); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange * 1.3); + public int viewRange = (int)(GameData.basicGhostViewRange * 1.3); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; @@ -76,10 +76,10 @@ namespace Preparation.Interface public double concealment = GameData.basicConcealment; public double Concealment => concealment; - public int alertnessRadius = (int)(GameData.basicAlertnessRadius * 1.069); + public int alertnessRadius = (int)(GameData.basicGhostAlertnessRadius * 1.069); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange * 1.1); + public int viewRange = (int)(GameData.basicGhostViewRange * 1.1); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = (int)(GameData.basicSpeedOfOpeningOrLocking / 1.1); @@ -107,10 +107,10 @@ namespace Preparation.Interface public double concealment = GameData.basicConcealment * 0.8; public double Concealment => concealment; - public int alertnessRadius = (int)(GameData.basicAlertnessRadius * 0.9); + public int alertnessRadius = (int)(GameData.basicGhostAlertnessRadius * 0.9); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange); + public int viewRange = (int)(GameData.basicGhostViewRange); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; @@ -147,10 +147,10 @@ namespace Preparation.Interface public const double concealment = GameData.basicConcealment * 0.5; public double Concealment => concealment; - public const int alertnessRadius = GameData.basicAlertnessRadius / 2; + public const int alertnessRadius = GameData.basicStudentAlertnessRadius / 2; public int AlertnessRadius => alertnessRadius; - public int viewRange = GameData.basicViewRange * 9 / 10; + public int viewRange = GameData.basicStudentViewRange * 9 / 10; public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; @@ -187,10 +187,10 @@ namespace Preparation.Interface public const double concealment = GameData.basicConcealment * 0.9; public double Concealment => concealment; - public const int alertnessRadius = (int)(GameData.basicAlertnessRadius * 0.9); + public const int alertnessRadius = (int)(GameData.basicGhostAlertnessRadius * 0.9); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange * 1.1); + public int viewRange = (int)(GameData.basicGhostViewRange * 1.1); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking * 12 / 10; @@ -227,10 +227,10 @@ namespace Preparation.Interface public const double concealment = GameData.basicConcealment * 0.9; public double Concealment => concealment; - public const int alertnessRadius = (int)(GameData.basicAlertnessRadius * 0.9); + public const int alertnessRadius = (int)(GameData.basicStudentAlertnessRadius * 0.9); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange * 0.9); + public int viewRange = (int)(GameData.basicStudentViewRange * 0.9); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; @@ -267,10 +267,10 @@ namespace Preparation.Interface public const double concealment = GameData.basicConcealment; public double Concealment => concealment; - public const int alertnessRadius = (int)(GameData.basicAlertnessRadius); + public const int alertnessRadius = (int)(GameData.basicStudentAlertnessRadius); public int AlertnessRadius => alertnessRadius; - public int viewRange = GameData.basicViewRange; + public int viewRange = GameData.basicStudentViewRange; public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; @@ -307,10 +307,10 @@ namespace Preparation.Interface public const double concealment = GameData.basicConcealment; public double Concealment => concealment; - public const int alertnessRadius = (int)(GameData.basicAlertnessRadius); + public const int alertnessRadius = (int)(GameData.basicStudentAlertnessRadius); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange * 0.9); + public int viewRange = (int)(GameData.basicStudentViewRange * 0.9); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; @@ -347,10 +347,10 @@ namespace Preparation.Interface public const double concealment = GameData.basicConcealment * 1.2; public double Concealment => concealment; - public const int alertnessRadius = (int)(GameData.basicAlertnessRadius * 1.2); + public const int alertnessRadius = (int)(GameData.basicStudentAlertnessRadius * 1.2); public int AlertnessRadius => alertnessRadius; - public int viewRange = (int)(GameData.basicViewRange * 1.1); + public int viewRange = (int)(GameData.basicStudentViewRange * 1.1); public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; diff --git a/logic/Preparation/Interface/ISkill.cs b/logic/Preparation/Interface/ISkill.cs index 81f1dd6..5554e87 100644 --- a/logic/Preparation/Interface/ISkill.cs +++ b/logic/Preparation/Interface/ISkill.cs @@ -16,286 +16,286 @@ namespace Preparation.Interface public object ActiveSkillLock { get; } public bool IsBeingUsed { get; set; } } -} -public class CanBeginToCharge : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD * 24 / 30; - public int DurationTime => GameData.commonSkillTime * 5 / 10; + public class CanBeginToCharge : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD * 24 / 30; + public int DurationTime => GameData.commonSkillTime * 5 / 10; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class BecomeInvisible : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD; - public int DurationTime => GameData.commonSkillTime * 6 / 10; + public class BecomeInvisible : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD; + public int DurationTime => GameData.commonSkillTime * 6 / 10; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class Punish : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD; - public int DurationTime => 0; + public class Punish : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD; + public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class Rouse : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD * 2; - public int DurationTime => 0; + public class Rouse : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD * 2; + public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class Encourage : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD * 2; - public int DurationTime => 0; + public class Encourage : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD * 2; + public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class Inspire : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD * 2; - public int DurationTime => 0; + public class Inspire : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD * 2; + public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class Howl : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD * 3 / 4; - public int DurationTime => 0; + public class Howl : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD * 3 / 4; + public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} - -public class JumpyBomb : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD / 2; - public int DurationTime => GameData.commonSkillTime * 3 / 10; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; - public bool isBeingUsed = false; - public bool IsBeingUsed + public class JumpyBomb : IActiveSkill { - get => isBeingUsed; set => isBeingUsed = value; - } -} + public int SkillCD => GameData.commonSkillCD / 2; + public int DurationTime => GameData.commonSkillTime * 3 / 10; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; -public class UseKnife : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD * 2 / 3; - public int DurationTime => GameData.commonSkillTime / 10; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } + } - public bool isBeingUsed = false; - public bool IsBeingUsed + public class UseKnife : IActiveSkill { - get => isBeingUsed; set => isBeingUsed = value; - } -} + public int SkillCD => GameData.commonSkillCD * 2 / 3; + public int DurationTime => GameData.commonSkillTime / 10; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; -public class UseRobot : IActiveSkill -{ - public int SkillCD => GameData.frameDuration; - public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } + } - public bool isBeingUsed = false; - public bool IsBeingUsed + public class UseRobot : IActiveSkill { - get => isBeingUsed; set => isBeingUsed = value; - } -} + public int SkillCD => GameData.frameDuration; + public int DurationTime => 0; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; -public class WriteAnswers : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD; - public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } + } - private int degreeOfMeditation = 0; - public int DegreeOfMeditation + public class WriteAnswers : IActiveSkill { - get => degreeOfMeditation; - set + public int SkillCD => GameData.commonSkillCD; + public int DurationTime => 0; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; + + private int degreeOfMeditation = 0; + public int DegreeOfMeditation { - lock (commonSkillLock) + get => degreeOfMeditation; + set { - degreeOfMeditation = value; + lock (commonSkillLock) + { + degreeOfMeditation = value; + } } } + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; - } -} -public class SummonGolem : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD; - public int DurationTime => 0; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; - - private IGolem? golemSummoned = null; - public IGolem? GolemSummoned + public class SummonGolem : IActiveSkill { - get => golemSummoned; - set + public int SkillCD => GameData.commonSkillCD; + public int DurationTime => 0; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; + + private IGolem? golemSummoned = null; + public IGolem? GolemSummoned { - lock (commonSkillLock) + get => golemSummoned; + set { - golemSummoned = value; + lock (commonSkillLock) + { + golemSummoned = value; + } } } - } - public bool isBeingUsed = false; - public bool IsBeingUsed - { - get => isBeingUsed; set => isBeingUsed = value; + public bool isBeingUsed = false; + public bool IsBeingUsed + { + get => isBeingUsed; set => isBeingUsed = value; + } } -} -public class NullSkill : IActiveSkill -{ - public int SkillCD => GameData.commonSkillCD; - public int DurationTime => GameData.commonSkillTime; - private readonly object commonSkillLock = new object(); - public object ActiveSkillLock => commonSkillLock; - - public bool isBeingUsed = false; - public bool IsBeingUsed + public class NullSkill : IActiveSkill { - get => isBeingUsed; set => isBeingUsed = false; - } -} + public int SkillCD => GameData.commonSkillCD; + public int DurationTime => GameData.commonSkillTime; + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; -public static class SkillFactory -{ - public static IActiveSkill FindIActiveSkill(ActiveSkillType activeSkillType) - { - switch (activeSkillType) + public bool isBeingUsed = false; + public bool IsBeingUsed { - case ActiveSkillType.BecomeInvisible: - return new BecomeInvisible(); - case ActiveSkillType.UseKnife: - return new UseKnife(); - case ActiveSkillType.Howl: - return new Howl(); - case ActiveSkillType.Encourage: - return new Encourage(); - case ActiveSkillType.CanBeginToCharge: - return new CanBeginToCharge(); - case ActiveSkillType.Punish: - return new Punish(); - case ActiveSkillType.JumpyBomb: - return new JumpyBomb(); - case ActiveSkillType.WriteAnswers: - return new WriteAnswers(); - case ActiveSkillType.SummonGolem: - return new SummonGolem(); - case ActiveSkillType.UseRobot: - return new UseRobot(); - case ActiveSkillType.Rouse: - return new Rouse(); - case ActiveSkillType.Inspire: - return new Inspire(); - default: - return new NullSkill(); + get => isBeingUsed; set => isBeingUsed = false; } } - public static ActiveSkillType FindActiveSkillType(IActiveSkill ActiveSkill) + public static class SkillFactory { - switch (ActiveSkill) + public static IActiveSkill FindIActiveSkill(ActiveSkillType activeSkillType) { - case BecomeInvisible: - return ActiveSkillType.BecomeInvisible; - case Howl: - return ActiveSkillType.Howl; - case UseKnife: - return ActiveSkillType.UseKnife; - case Encourage: - return ActiveSkillType.Encourage; - case CanBeginToCharge: - return ActiveSkillType.CanBeginToCharge; - case Inspire: - return ActiveSkillType.Inspire; - case Punish: - return ActiveSkillType.Punish; - case JumpyBomb: - return ActiveSkillType.JumpyBomb; - case WriteAnswers: - return ActiveSkillType.WriteAnswers; - case SummonGolem: - return ActiveSkillType.SummonGolem; - case UseRobot: - return ActiveSkillType.UseRobot; - case Rouse: - return ActiveSkillType.Rouse; - default: - return ActiveSkillType.Null; + switch (activeSkillType) + { + case ActiveSkillType.BecomeInvisible: + return new BecomeInvisible(); + case ActiveSkillType.UseKnife: + return new UseKnife(); + case ActiveSkillType.Howl: + return new Howl(); + case ActiveSkillType.Encourage: + return new Encourage(); + case ActiveSkillType.CanBeginToCharge: + return new CanBeginToCharge(); + case ActiveSkillType.Punish: + return new Punish(); + case ActiveSkillType.JumpyBomb: + return new JumpyBomb(); + case ActiveSkillType.WriteAnswers: + return new WriteAnswers(); + case ActiveSkillType.SummonGolem: + return new SummonGolem(); + case ActiveSkillType.UseRobot: + return new UseRobot(); + case ActiveSkillType.Rouse: + return new Rouse(); + case ActiveSkillType.Inspire: + return new Inspire(); + default: + return new NullSkill(); + } + } + + public static ActiveSkillType FindActiveSkillType(IActiveSkill ActiveSkill) + { + switch (ActiveSkill) + { + case BecomeInvisible: + return ActiveSkillType.BecomeInvisible; + case Howl: + return ActiveSkillType.Howl; + case UseKnife: + return ActiveSkillType.UseKnife; + case Encourage: + return ActiveSkillType.Encourage; + case CanBeginToCharge: + return ActiveSkillType.CanBeginToCharge; + case Inspire: + return ActiveSkillType.Inspire; + case Punish: + return ActiveSkillType.Punish; + case JumpyBomb: + return ActiveSkillType.JumpyBomb; + case WriteAnswers: + return ActiveSkillType.WriteAnswers; + case SummonGolem: + return ActiveSkillType.SummonGolem; + case UseRobot: + return ActiveSkillType.UseRobot; + case Rouse: + return ActiveSkillType.Rouse; + default: + return ActiveSkillType.Null; + } } } } \ No newline at end of file diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index 3e53610..e1054f1 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -106,8 +106,10 @@ namespace Preparation.Utility public const int characterMaxSpeed = 12000; // 最大速度 public const double basicConcealment = 1.0; - public const int basicAlertnessRadius = 10700; - public const int basicViewRange = 5 * numOfPosGridPerCell; + public const int basicStudentAlertnessRadius = 15 * numOfPosGridPerCell; + public const int basicGhostAlertnessRadius = 17 * numOfPosGridPerCell; + public const int basicStudentViewRange = 10 * numOfPosGridPerCell; + public const int basicGhostViewRange = 15 * numOfPosGridPerCell; public const int maxNumOfPropInPropInventory = 3; public static XY PosWhoDie = new XY(1, 1); diff --git a/logic/规则Logic.md b/logic/规则Logic.md index a10f0df..750c87e 100644 --- a/logic/规则Logic.md +++ b/logic/规则Logic.md @@ -76,7 +76,7 @@ - 当求生者血量归零时,求生者自动原地进入沉迷状态,每毫秒增加1沉迷度 - 该学生可由其他的求生者唤醒,唤醒后,血量恢复至1/2并可以重新行动。沉迷程度不清空。 - 一般情况下,唤醒时间为1秒。 -- 进入沉迷状态时。如果求生者原本沉迷程度在(0,20900)中,求生者沉迷程度直接变为20900;如果求生者原本沉迷程度在【20900,40300)中,求生者沉迷程度直接变为40300;如果求生者原本沉迷程度大于40300,从游戏中出局; +- 进入沉迷状态时。如果求生者原本沉迷程度在(0,其最大沉迷度/3)中,求生者沉迷程度直接变为其最大沉迷度/3;如果求生者原本沉迷程度在[其最大沉迷度/3,其最大沉迷度*2/3)中,求生者沉迷程度直接变为其最大沉迷度*2/3;如果求生者原本沉迷程度大于其最大沉迷度*2/3,从游戏中出局; - 当求生者沉迷程度达到该玩家最大沉迷程度时,从游戏中出局 #### 门