From 5fe49de4dd068047cdd2d479c5da9fd300915891 Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Tue, 4 Apr 2023 02:05:06 +0800
Subject: [PATCH 1/4] refactor: :zap: rebuild the fuction of DegreeOfTreatment
---
.../GameObj/Character/Character.Student.cs | 37 +++++++++++++++----
.../GameClass/GameObj/Character/Character.cs | 16 --------
logic/Gaming/ActionManager.cs | 32 ++--------------
logic/Gaming/CharacterManager .cs | 2 +-
logic/规则Logic.md | 6 +--
5 files changed, 35 insertions(+), 58 deletions(-)
diff --git a/logic/GameClass/GameObj/Character/Character.Student.cs b/logic/GameClass/GameObj/Character/Character.Student.cs
index 4606393..d38cb8f 100644
--- a/logic/GameClass/GameObj/Character/Character.Student.cs
+++ b/logic/GameClass/GameObj/Character/Character.Student.cs
@@ -71,16 +71,39 @@ namespace GameClass.GameObj
public int DegreeOfTreatment
{
get => degreeOfTreatment;
- set
+ private set
{
- if (value > 0)
- lock (gameObjLock)
- degreeOfTreatment = (value < MaxHp - HP) ? value : MaxHp - HP;
- else
- lock (gameObjLock)
- degreeOfTreatment = 0;
+ degreeOfTreatment = value;
}
}
+ public void SetDegreeOfTreatment0()
+ {
+ DegreeOfTreatment = 0;
+ }
+ public bool SetDegreeOfTreatment(int value, Student whoTreatYou)
+ {
+ if (value <= 0) { degreeOfTreatment = 0; return false; }
+ if (value >= MaxHp - HP)
+ {
+ whoTreatYou.AddScore(GameData.StudentScoreTreat(MaxHp - HP));
+ HP = MaxHp;
+ degreeOfTreatment = 0;
+ return true;
+ }
+ if (value >= GameData.basicTreatmentDegree)
+ {
+ whoTreatYou.AddScore(GameData.StudentScoreTreat(GameData.basicTreatmentDegree));
+ HP += GameData.basicTreatmentDegree;
+ DegreeOfTreatment = 0;
+ return true;
+ }
+ DegreeOfTreatment = value;
+ return false;
+ }
+ public bool AddDegreeOfTreatment(int value, Student student)
+ {
+ return SetDegreeOfTreatment(value + degreeOfTreatment, student);
+ }
private int timeOfRescue = 0;
public int TimeOfRescue
diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs
index 9441ef1..ffcd602 100644
--- a/logic/GameClass/GameObj/Character/Character.cs
+++ b/logic/GameClass/GameObj/Character/Character.cs
@@ -242,22 +242,6 @@ namespace GameClass.GameObj
}
}
- ///
- /// 尝试加血
- ///
- /// 欲加量
- /// 加操作是否成功
- public bool TryAddHp(int add)
- {
- if (hp < MaxHp)
- {
- lock (gameObjLock)
- hp = MaxHp > hp + add ? hp + add : MaxHp;
- Debugger.Output(this, " hp has added to: " + hp.ToString());
- return true;
- }
- return false;
- }
///
/// 尝试减血
///
diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs
index 316784e..5cb0541 100644
--- a/logic/Gaming/ActionManager.cs
+++ b/logic/Gaming/ActionManager.cs
@@ -166,19 +166,6 @@ namespace Gaming
playerTreated.HP == playerTreated.MaxHp || !GameData.ApproachToInteract(playerTreated.Position, player.Position))
return false;
- if (playerTreated.HP + playerTreated.DegreeOfTreatment >= playerTreated.MaxHp)
- {
- playerTreated.HP = playerTreated.MaxHp;
- playerTreated.DegreeOfTreatment = 0;
- return false;
- }
-
- if (playerTreated.DegreeOfTreatment >= GameData.basicTreatmentDegree)
- {
- playerTreated.HP += GameData.basicTreatmentDegree;
- playerTreated.DegreeOfTreatment = 0;
- return false;
- }
new Thread
(
() =>
@@ -186,10 +173,11 @@ namespace Gaming
playerTreated.PlayerState = PlayerStateType.Treated;
player.PlayerState = PlayerStateType.Treating;
new FrameRateTaskExecutor(
- loopCondition: () => playerTreated.PlayerState == PlayerStateType.Treated && player.PlayerState == PlayerStateType.Treating && gameMap.Timer.IsGaming && playerTreated.HP + playerTreated.DegreeOfTreatment < playerTreated.MaxHp && playerTreated.DegreeOfTreatment < GameData.basicTreatmentDegree && GameData.ApproachToInteract(playerTreated.Position, player.Position),
+ loopCondition: () => playerTreated.PlayerState == PlayerStateType.Treated && player.PlayerState == PlayerStateType.Treating && gameMap.Timer.IsGaming && GameData.ApproachToInteract(playerTreated.Position, player.Position),
loopToDo: () =>
{
- playerTreated.DegreeOfTreatment += GameData.frameDuration * player.TreatSpeed;
+ if (playerTreated.AddDegreeOfTreatment(GameData.frameDuration * player.TreatSpeed, player))
+ playerTreated.PlayerState = PlayerStateType.Null;
},
timeInterval: GameData.frameDuration,
finallyReturn: () => 0
@@ -199,20 +187,6 @@ namespace Gaming
if (playerTreated.PlayerState == PlayerStateType.Treated) playerTreated.PlayerState = PlayerStateType.Null;
if (player.PlayerState == PlayerStateType.Treating) player.PlayerState = PlayerStateType.Null;
-
- if (playerTreated.HP + playerTreated.DegreeOfTreatment >= playerTreated.MaxHp)
- {
- player.AddScore(GameData.StudentScoreTreat(playerTreated.MaxHp - playerTreated.HP));
- playerTreated.HP = playerTreated.MaxHp;
- playerTreated.DegreeOfTreatment = 0;
- }
- else
- if (playerTreated.DegreeOfTreatment >= GameData.basicTreatmentDegree)
- {
- player.AddScore(GameData.StudentScoreTreat(GameData.basicTreatmentDegree));
- playerTreated.HP += GameData.basicTreatmentDegree;
- playerTreated.DegreeOfTreatment = 0;
- }
}
)
{ IsBackground = true }.Start();
diff --git a/logic/Gaming/CharacterManager .cs b/logic/Gaming/CharacterManager .cs
index 5ca2c3e..3c7e1cb 100644
--- a/logic/Gaming/CharacterManager .cs
+++ b/logic/Gaming/CharacterManager .cs
@@ -328,7 +328,7 @@ namespace Gaming
bullet.Parent.AddScore(GameData.TrickerScoreAttackStudent(subHp));
bullet.Parent.HP = (int)(bullet.Parent.HP + (bullet.Parent.Vampire * subHp));
}
- student.DegreeOfTreatment = 0;
+ student.SetDegreeOfTreatment0();
if (student.HP <= 0)
student.TryActivatingLIFE(); // 如果有复活甲
diff --git a/logic/规则Logic.md b/logic/规则Logic.md
index 9068f34..7b89a7b 100644
--- a/logic/规则Logic.md
+++ b/logic/规则Logic.md
@@ -231,7 +231,6 @@
- 未开启完成的箱子在下一次需要重新开始开启。
- 箱子开启后其中道具才可以被观测和拿取
-
## 游戏内Logic底层的枚举类型、类与属性
- 底层实现中的属性,不代表界面全部都需要展示,也可能需要额外展示信息
- 只展示外部需要的属性,部分属性被省略
@@ -288,7 +287,6 @@
- 玩家状态(不可叠加)
- Bgm(字典)
- 得分
-- ~~回血率/原始回血率~~
- 当前子弹类型
- 原始子弹类型
- 持有道具 (最多三个)(数组)
@@ -310,12 +308,10 @@
### 学生:人物
- 修理电机速度
- 治疗速度
-- ~~救人速度~~
-- ~~自愈次数~~
- 沉迷游戏程度
- 最大沉迷游戏程度
- 被治疗程度
-- *被救援程度*
+- 被救援程度
### 搞蛋鬼:人物
无
From 11e1be0960ed9d8265a7352aaf06970c4bbd65b0 Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Tue, 4 Apr 2023 09:18:28 +0800
Subject: [PATCH 2/4] refactor: :art: refactor the struction of code
---
.../GameObj/Character/Character.Skill.cs | 31 +--
.../GameObj/Character/Character.Student.cs | 8 +-
logic/GameClass/GameObj/Character/Skill.cs | 250 ------------------
logic/Gaming/ActionManager.cs | 5 +-
logic/Gaming/Game.cs | 20 --
logic/Preparation/Interface/ICharacter.cs | 2 +
logic/Preparation/Interface/IOccupation.cs | 49 +++-
logic/Preparation/Interface/ISkill.cs | 249 ++++++++++++++++-
logic/Server/GameServer.cs | 1 -
logic/规则Logic.md | 2 -
10 files changed, 296 insertions(+), 321 deletions(-)
delete mode 100644 logic/GameClass/GameObj/Character/Skill.cs
diff --git a/logic/GameClass/GameObj/Character/Character.Skill.cs b/logic/GameClass/GameObj/Character/Character.Skill.cs
index 06d8c10..a1dc379 100644
--- a/logic/GameClass/GameObj/Character/Character.Skill.cs
+++ b/logic/GameClass/GameObj/Character/Character.Skill.cs
@@ -61,34 +61,7 @@ namespace GameClass.GameObj
this.CanMove = true;
this.score = 0;
this.buffManager = new BuffManager();
- switch (characterType)
- {
- case CharacterType.Assassin:
- this.occupation = new Assassin();
- break;
- case CharacterType.Robot:
- this.occupation = new Robot();
- break;
- case CharacterType.Teacher:
- this.occupation = new Teacher();
- break;
- case CharacterType.Klee:
- this.occupation = new Klee();
- break;
- case CharacterType.StraightAStudent:
- this.occupation = new StraightAStudent();
- break;
- case CharacterType.ANoisyPerson:
- this.occupation = new ANoisyPerson();
- break;
- case CharacterType.TechOtaku:
- this.occupation = new TechOtaku();
- break;
- case CharacterType.Athlete:
- default:
- this.occupation = new Athlete();
- break;
- }
+ this.occupation = OccupationFactory.FindIOccupation(characterType);
this.MaxHp = this.hp = Occupation.MaxHp;
this.OrgMoveSpeed = this.moveSpeed = Occupation.MoveSpeed;
this.BulletOfPlayer = this.OriBulletOfPlayer = Occupation.InitBullet;
@@ -103,7 +76,7 @@ namespace GameClass.GameObj
foreach (var activeSkill in this.Occupation.ListOfIActiveSkill)
{
this.IActiveSkillDictionary.Add(activeSkill, SkillFactory.FindIActiveSkill(activeSkill));
- this.TimeUntilActiveSkillAvailable.Add(activeSkill, IActiveSkillDictionary[activeSkill].SkillCD);
+ this.TimeUntilActiveSkillAvailable.Add(activeSkill, 0);
}
// UsePassiveSkill(); //创建player时开始被动技能,这一过程也可以放到gamestart时进行
diff --git a/logic/GameClass/GameObj/Character/Character.Student.cs b/logic/GameClass/GameObj/Character/Character.Student.cs
index d38cb8f..60fa091 100644
--- a/logic/GameClass/GameObj/Character/Character.Student.cs
+++ b/logic/GameClass/GameObj/Character/Character.Student.cs
@@ -122,12 +122,12 @@ namespace GameClass.GameObj
public Student(XY initPos, int initRadius, CharacterType characterType) : base(initPos, initRadius, characterType)
{
- this.OrgFixSpeed = this.fixSpeed = ((IStudent)Occupation).FixSpeed;
- this.TreatSpeed = this.OrgTreatSpeed = ((IStudent)Occupation).TreatSpeed;
- this.MaxGamingAddiction = ((IStudent)Occupation).MaxGamingAddiction;
+ this.OrgFixSpeed = this.fixSpeed = ((IStudentType)Occupation).FixSpeed;
+ this.TreatSpeed = this.OrgTreatSpeed = ((IStudentType)Occupation).TreatSpeed;
+ this.MaxGamingAddiction = ((IStudentType)Occupation).MaxGamingAddiction;
}
}
- public class Golem : Student
+ public class Golem : Student, IGolem
{
private Character? parent; // 主人
public Character? Parent
diff --git a/logic/GameClass/GameObj/Character/Skill.cs b/logic/GameClass/GameObj/Character/Skill.cs
deleted file mode 100644
index 4f6c6a3..0000000
--- a/logic/GameClass/GameObj/Character/Skill.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-using Preparation.Interface;
-using Preparation.Utility;
-
-namespace GameClass.GameObj
-{
- 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;
-
- 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;
-
- private readonly object commonSkillLock = new object();
- public object ActiveSkillLock => commonSkillLock;
-
- 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;
-
- private readonly object commonSkillLock = new object();
- public object ActiveSkillLock => commonSkillLock;
-
- public bool isBeingUsed = false;
- public bool IsBeingUsed
- {
- get => isBeingUsed; set => isBeingUsed = value;
- }
- }
-
- public class Rouse : 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;
- }
- }
-
- 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;
-
- 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
- {
- get => isBeingUsed; set => isBeingUsed = value;
- }
- }
-
- 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 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 class WriteAnswers : IActiveSkill
- {
- 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
- {
- get => degreeOfMeditation;
- set
- {
- lock (commonSkillLock)
- {
- degreeOfMeditation = 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 Golem? golemSummoned = null;
- public Golem? GolemSummoned
- {
- get => golemSummoned;
- set
- {
- lock (commonSkillLock)
- {
- golemSummoned = 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
- {
- get => isBeingUsed; set => isBeingUsed = false;
- }
- }
-
- public static class SkillFactory
- {
- public static IActiveSkill FindIActiveSkill(ActiveSkillType activeSkillType)
- {
- switch (activeSkillType)
- {
- case ActiveSkillType.BecomeInvisible:
- return new BecomeInvisible();
- case ActiveSkillType.UseKnife:
- return new UseKnife();
- case ActiveSkillType.Howl:
- return new Howl();
- 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();
- 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 CanBeginToCharge:
- return ActiveSkillType.CanBeginToCharge;
- 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/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs
index 5cb0541..35f6c38 100644
--- a/logic/Gaming/ActionManager.cs
+++ b/logic/Gaming/ActionManager.cs
@@ -173,7 +173,7 @@ namespace Gaming
playerTreated.PlayerState = PlayerStateType.Treated;
player.PlayerState = PlayerStateType.Treating;
new FrameRateTaskExecutor(
- loopCondition: () => playerTreated.PlayerState == PlayerStateType.Treated && player.PlayerState == PlayerStateType.Treating && gameMap.Timer.IsGaming && GameData.ApproachToInteract(playerTreated.Position, player.Position),
+ loopCondition: () => playerTreated.PlayerState == PlayerStateType.Treated && player.PlayerState == PlayerStateType.Treating && gameMap.Timer.IsGaming,
loopToDo: () =>
{
if (playerTreated.AddDegreeOfTreatment(GameData.frameDuration * player.TreatSpeed, player))
@@ -182,11 +182,10 @@ namespace Gaming
timeInterval: GameData.frameDuration,
finallyReturn: () => 0
)
-
.Start();
- if (playerTreated.PlayerState == PlayerStateType.Treated) playerTreated.PlayerState = PlayerStateType.Null;
if (player.PlayerState == PlayerStateType.Treating) player.PlayerState = PlayerStateType.Null;
+ else if (playerTreated.PlayerState == PlayerStateType.Treated) playerTreated.PlayerState = PlayerStateType.Null;
}
)
{ IsBackground = true }.Start();
diff --git a/logic/Gaming/Game.cs b/logic/Gaming/Game.cs
index 709b84e..edbdb3c 100644
--- a/logic/Gaming/Game.cs
+++ b/logic/Gaming/Game.cs
@@ -270,26 +270,6 @@ namespace Gaming
else
return false;
}
- public void AllActiveSkillDisabledTemporarily()
- {
- if (!gameMap.Timer.IsGaming)
- return;
- gameMap.GameObjLockDict[GameObjType.Character].EnterWriteLock();
- try
- {
- foreach (Character player in gameMap.GameObjDict[GameObjType.Character])
- {
- foreach (var activeSkill in player.Occupation.ListOfIActiveSkill)
- {
- player.SetTimeUntilActiveSkillAvailable(activeSkill, 0);
- }
- }
- }
- finally
- {
- gameMap.GameObjLockDict[GameObjType.Character].ExitWriteLock();
- }
- }
public void AllPlayerUsePassiveSkill()
{
diff --git a/logic/Preparation/Interface/ICharacter.cs b/logic/Preparation/Interface/ICharacter.cs
index 4f69fba..c4b175c 100644
--- a/logic/Preparation/Interface/ICharacter.cs
+++ b/logic/Preparation/Interface/ICharacter.cs
@@ -15,4 +15,6 @@ namespace Preparation.Interface
public bool IsGhost();
}
+ public interface IStudent : ICharacter { }
+ public interface IGolem : IStudent { }
}
\ No newline at end of file
diff --git a/logic/Preparation/Interface/IOccupation.cs b/logic/Preparation/Interface/IOccupation.cs
index fd57eb6..6a101e1 100644
--- a/logic/Preparation/Interface/IOccupation.cs
+++ b/logic/Preparation/Interface/IOccupation.cs
@@ -18,18 +18,18 @@ namespace Preparation.Interface
public int SpeedOfOpenChest { get; }
}
- public interface IGhost : IOccupation
+ public interface IGhostType : IOccupation
{
}
- public interface IStudent : IOccupation
+ public interface IStudentType : IOccupation
{
public int FixSpeed { get; }
public int TreatSpeed { get; }
public int MaxGamingAddiction { get; }
}
- public class Assassin : IGhost
+ public class Assassin : IGhostType
{
private const int moveSpeed = (int)(GameData.basicGhostMoveSpeed * 1.1);
public int MoveSpeed => moveSpeed;
@@ -60,7 +60,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class Klee : IGhost
+ public class Klee : IGhostType
{
private const int moveSpeed = (int)(GameData.basicGhostMoveSpeed * 155 / 127);
public int MoveSpeed => moveSpeed;
@@ -91,7 +91,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = (int)(GameData.basicSpeedOfOpenChest * 1.1);
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class ANoisyPerson : IGhost
+ public class ANoisyPerson : IGhostType
{
private const int moveSpeed = (int)(GameData.basicGhostMoveSpeed * 1.07);
public int MoveSpeed => moveSpeed;
@@ -122,7 +122,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = (int)(GameData.basicSpeedOfOpenChest);
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class Teacher : IStudent
+ public class Teacher : IStudentType
{
private const int moveSpeed = GameData.basicStudentMoveSpeed * 3 / 4;
public int MoveSpeed => moveSpeed;
@@ -162,7 +162,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class Athlete : IStudent
+ public class Athlete : IStudentType
{
private const int moveSpeed = GameData.basicStudentMoveSpeed * 40 / 38;
public int MoveSpeed => moveSpeed;
@@ -202,7 +202,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class StraightAStudent : IStudent
+ public class StraightAStudent : IStudentType
{
private const int moveSpeed = (int)(GameData.basicStudentMoveSpeed * 0.8);
public int MoveSpeed => moveSpeed;
@@ -242,7 +242,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class Robot : IStudent
+ public class Robot : IStudentType
{
private const int moveSpeed = (int)(GameData.basicStudentMoveSpeed);
public int MoveSpeed => moveSpeed;
@@ -282,7 +282,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class TechOtaku : IStudent
+ public class TechOtaku : IStudentType
{
private const int moveSpeed = (int)(GameData.basicStudentMoveSpeed * 0.75);
public int MoveSpeed => moveSpeed;
@@ -322,7 +322,7 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
- public class Sunshine : IStudent
+ public class Sunshine : IStudentType
{
private const int moveSpeed = GameData.basicStudentMoveSpeed;
public int MoveSpeed => moveSpeed;
@@ -362,4 +362,31 @@ namespace Preparation.Interface
public int speedOfOpenChest = GameData.basicSpeedOfOpenChest;
public int SpeedOfOpenChest => speedOfOpenChest;
}
+
+ public static class OccupationFactory
+ {
+ public static IOccupation FindIOccupation(CharacterType characterType)
+ {
+ switch (characterType)
+ {
+ case CharacterType.Assassin:
+ return new Assassin();
+ case CharacterType.Robot:
+ return new Robot();
+ case CharacterType.Teacher:
+ return new Teacher();
+ case CharacterType.Klee:
+ return new Klee();
+ case CharacterType.StraightAStudent:
+ return new StraightAStudent();
+ case CharacterType.ANoisyPerson:
+ return new ANoisyPerson();
+ case CharacterType.TechOtaku:
+ return new TechOtaku();
+ case CharacterType.Athlete:
+ default:
+ return new Athlete();
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/logic/Preparation/Interface/ISkill.cs b/logic/Preparation/Interface/ISkill.cs
index c38663b..5c66d58 100644
--- a/logic/Preparation/Interface/ISkill.cs
+++ b/logic/Preparation/Interface/ISkill.cs
@@ -1,4 +1,7 @@
-namespace Preparation.Interface
+using Preparation.Interface;
+using Preparation.Utility;
+
+namespace Preparation.Interface
{
public interface ISkill
{
@@ -13,4 +16,248 @@
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;
+
+ private readonly object commonSkillLock = new object();
+ public object ActiveSkillLock => commonSkillLock;
+
+ 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;
+
+ private readonly object commonSkillLock = new object();
+ public object ActiveSkillLock => commonSkillLock;
+
+ 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;
+
+ private readonly object commonSkillLock = new object();
+ public object ActiveSkillLock => commonSkillLock;
+
+ public bool isBeingUsed = false;
+ public bool IsBeingUsed
+ {
+ get => isBeingUsed; set => isBeingUsed = value;
+ }
+}
+
+public class Rouse : 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;
+ }
+}
+
+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;
+
+ 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
+ {
+ get => isBeingUsed; set => isBeingUsed = value;
+ }
+}
+
+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 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 class WriteAnswers : IActiveSkill
+{
+ 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
+ {
+ get => degreeOfMeditation;
+ set
+ {
+ lock (commonSkillLock)
+ {
+ degreeOfMeditation = 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
+ {
+ get => golemSummoned;
+ set
+ {
+ lock (commonSkillLock)
+ {
+ golemSummoned = 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
+ {
+ get => isBeingUsed; set => isBeingUsed = false;
+ }
+}
+
+public static class SkillFactory
+{
+ public static IActiveSkill FindIActiveSkill(ActiveSkillType activeSkillType)
+ {
+ switch (activeSkillType)
+ {
+ case ActiveSkillType.BecomeInvisible:
+ return new BecomeInvisible();
+ case ActiveSkillType.UseKnife:
+ return new UseKnife();
+ case ActiveSkillType.Howl:
+ return new Howl();
+ 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();
+ 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 CanBeginToCharge:
+ return ActiveSkillType.CanBeginToCharge;
+ 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/Server/GameServer.cs b/logic/Server/GameServer.cs
index 013320a..6f6aacb 100644
--- a/logic/Server/GameServer.cs
+++ b/logic/Server/GameServer.cs
@@ -59,7 +59,6 @@ namespace Server
{
game.AllPlayerUsePassiveSkill();
ReportGame(GameState.GameStart);
- game.AllActiveSkillDisabledTemporarily();
flag = false;
}
else ReportGame(GameState.GameRunning);
diff --git a/logic/规则Logic.md b/logic/规则Logic.md
index 7b89a7b..a10f0df 100644
--- a/logic/规则Logic.md
+++ b/logic/规则Logic.md
@@ -196,8 +196,6 @@
- 不加说明,这里“学生”往往包括职业“教师”
### 初始状态
-- 所有玩家可以立刻使用主动技能
- - 虽然一开始会接到仍需的冷却时间,但实际上是CD
- 玩家出生点固定且一定为空地
### 交互
From fcfcd2042e62843950a8729912a867f3b9b63aa8 Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Tue, 4 Apr 2023 10:20:11 +0800
Subject: [PATCH 3/4] build: :construction: adjust the time of LockingOrOpening
the Door
---
.../GameClass/GameObj/Character/Character.Skill.cs | 2 +-
logic/GameClass/GameObj/Map/Generator.cs | 2 +-
logic/Gaming/ActionManager.cs | 13 ++++++-------
logic/Preparation/Utility/GameData.cs | 4 ++--
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/logic/GameClass/GameObj/Character/Character.Skill.cs b/logic/GameClass/GameObj/Character/Character.Skill.cs
index a1dc379..61b0c96 100644
--- a/logic/GameClass/GameObj/Character/Character.Skill.cs
+++ b/logic/GameClass/GameObj/Character/Character.Skill.cs
@@ -76,7 +76,7 @@ namespace GameClass.GameObj
foreach (var activeSkill in this.Occupation.ListOfIActiveSkill)
{
this.IActiveSkillDictionary.Add(activeSkill, SkillFactory.FindIActiveSkill(activeSkill));
- this.TimeUntilActiveSkillAvailable.Add(activeSkill, 0);
+ this.TimeUntilActiveSkillAvailable.Add(activeSkill, IActiveSkillDictionary[activeSkill].SkillCD);
}
// UsePassiveSkill(); //创建player时开始被动技能,这一过程也可以放到gamestart时进行
diff --git a/logic/GameClass/GameObj/Map/Generator.cs b/logic/GameClass/GameObj/Map/Generator.cs
index 4c68df9..53d9d14 100644
--- a/logic/GameClass/GameObj/Map/Generator.cs
+++ b/logic/GameClass/GameObj/Map/Generator.cs
@@ -33,7 +33,7 @@ namespace GameClass.GameObj
public bool Repair(int addDegree, Character character)
{
- if (DegreeOfRepair == GameData.degreeOfFixedGenerator) return false;
+ if (DegreeOfRepair == GameData.degreeOfFixedGenerator) return true;
int orgDegreeOfRepair = degreeOfRepair;
DegreeOfRepair += addDegree;
if (DegreeOfRepair > orgDegreeOfRepair)
diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs
index 35f6c38..2cf1f00 100644
--- a/logic/Gaming/ActionManager.cs
+++ b/logic/Gaming/ActionManager.cs
@@ -68,20 +68,19 @@ namespace Gaming
() =>
{
new FrameRateTaskExecutor(
- loopCondition: () => player.PlayerState == PlayerStateType.Fixing && gameMap.Timer.IsGaming && generatorForFix.DegreeOfRepair < GameData.degreeOfFixedGenerator,
+ loopCondition: () => gameMap.Timer.IsGaming && player.PlayerState == PlayerStateType.Fixing,
loopToDo: () =>
{
- generatorForFix.Repair(player.FixSpeed * GameData.frameDuration, player);
+ if (generatorForFix.Repair(player.FixSpeed * GameData.frameDuration, player))
+ {
+ player.PlayerState = PlayerStateType.Null;
+ gameMap.NumOfRepairedGenerators++;
+ }
},
timeInterval: GameData.frameDuration,
finallyReturn: () => 0
)
.Start();
- if (generatorForFix.DegreeOfRepair >= GameData.degreeOfFixedGenerator)
- {
- gameMap.NumOfRepairedGenerators++;
- if (player.PlayerState == PlayerStateType.Fixing) player.PlayerState = PlayerStateType.Null;
- }
}
)
diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs
index 7ef90e5..46cc842 100644
--- a/logic/Preparation/Utility/GameData.cs
+++ b/logic/Preparation/Utility/GameData.cs
@@ -84,7 +84,7 @@ namespace Preparation.Utility
public const int basicTreatSpeed = 100;
public const int basicFixSpeed = 100;
- public const int basicSpeedOfOpeningOrLocking = 30;
+ public const int basicSpeedOfOpeningOrLocking = 40;
public const int basicStudentSpeedOfClimbingThroughWindows = 611;
public const int basicGhostSpeedOfClimbingThroughWindows = 1270;
public const int basicSpeedOfOpenChest = 1000;
@@ -229,7 +229,7 @@ namespace Preparation.Utility
#endregion
#region 物体相关
public const int degreeOfFixedGenerator = 10300000;
- public const int degreeOfLockingOrOpeningTheDoor = 10000;
+ public const int degreeOfLockingOrOpeningTheDoor = 100000;
public const int degreeOfOpenedChest = 10000;
public const int degreeOfOpenedDoorway = 18000;
public const int maxNumOfPropInChest = 2;
From fb5318d4b4d5d821a2e5067d3fd502ee7fb6ec35 Mon Sep 17 00:00:00 2001
From: shangfengh <3495281661@qq.com>
Date: Tue, 4 Apr 2023 11:26:24 +0800
Subject: [PATCH 4/4] feat: :sparkles: add a new CharacterType Sunshine
---
logic/Client/StatusBarOfHunter.xaml.cs | 1 -
logic/Gaming/ActionManager.cs | 7 ++-
.../SkillManager/SkillManager.ActiveSkill.cs | 58 ++++++++++++++++++-
logic/Gaming/SkillManager/SkillManager.cs | 6 ++
logic/Preparation/Interface/IOccupation.cs | 2 +-
logic/Preparation/Interface/ISkill.cs | 40 ++++++++++++-
logic/Preparation/Utility/EnumType.cs | 2 +
logic/Preparation/Utility/GameData.cs | 14 ++---
8 files changed, 113 insertions(+), 17 deletions(-)
diff --git a/logic/Client/StatusBarOfHunter.xaml.cs b/logic/Client/StatusBarOfHunter.xaml.cs
index 8b3e970..dfff6ca 100644
--- a/logic/Client/StatusBarOfHunter.xaml.cs
+++ b/logic/Client/StatusBarOfHunter.xaml.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs
index 2cf1f00..99ba94a 100644
--- a/logic/Gaming/ActionManager.cs
+++ b/logic/Gaming/ActionManager.cs
@@ -23,8 +23,8 @@ namespace Gaming
{
if (((Bullet)collisionObj).Parent != player && ((Bullet)collisionObj).TypeOfBullet == BulletType.JumpyDumpty)
{
- if (CharacterManager.BeStunned((Character)player, ((Bullet)collisionObj).AP / GameData.timeFactorOfGhostFainting))
- player.AddScore(GameData.TrickerScoreStudentBeStunned(((Bullet)collisionObj).AP / GameData.timeFactorOfGhostFainting));
+ if (CharacterManager.BeStunned((Character)player, GameData.TimeOfStunnedWhenJumpyDumpty))
+ player.AddScore(GameData.TrickerScoreStudentBeStunned(GameData.TimeOfStunnedWhenJumpyDumpty));
gameMap.Remove((GameObj)collisionObj);
}
}
@@ -145,6 +145,7 @@ namespace Gaming
EmergencyExit? emergencyExit = (EmergencyExit?)gameMap.OneForInteract(player.Position, GameObjType.EmergencyExit);
if (emergencyExit != null && emergencyExit.IsOpen)
{
+ player.AddScore(GameData.StudentScoreEscape);
++gameMap.NumOfEscapedStudent;
player.Die(PlayerStateType.Escaped);
return true;
@@ -208,7 +209,7 @@ namespace Gaming
() =>
{
new FrameRateTaskExecutor(
- loopCondition: () => playerRescued.PlayerState == PlayerStateType.Rescued && player.PlayerState == PlayerStateType.Rescuing && gameMap.Timer.IsGaming && GameData.ApproachToInteract(playerRescued.Position, player.Position),
+ loopCondition: () => playerRescued.PlayerState == PlayerStateType.Rescued && player.PlayerState == PlayerStateType.Rescuing && gameMap.Timer.IsGaming,
loopToDo: () =>
{
playerRescued.TimeOfRescue += GameData.frameDuration;
diff --git a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs
index d13f75c..bc0ea72 100644
--- a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs
+++ b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs
@@ -153,7 +153,7 @@ namespace Gaming
&& gameMap.CanSee(player, character))
{
if (CharacterManager.BeStunned(character, GameData.TimeOfGhostFaintingWhenPunish))
- player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.TimeOfGhostFaintingWhenPunish + (player.MaxHp - player.HP) / GameData.timeFactorOfGhostFainting));
+ player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.TimeOfGhostFaintingWhenPunish));
break;
}
}
@@ -198,6 +198,62 @@ namespace Gaming
{ });
}
+ public bool Encourage(Character player)
+ {
+ if ((!player.Commandable())) return false;
+ return ActiveSkillEffect(player.FindIActiveSkill(ActiveSkillType.Encourage), player, () =>
+ {
+ gameMap.GameObjLockDict[GameObjType.Character].EnterReadLock();
+ try
+ {
+ foreach (Character character in gameMap.GameObjDict[GameObjType.Character])
+ {
+ if ((character.HP < character.MaxHp) && gameMap.CanSee(player, character))
+ {
+ player.AddScore(GameData.StudentScoreTreat(character.MaxHp - character.HP));
+ character.HP = character.MaxHp;
+ ((Student)character).SetDegreeOfTreatment0();
+ break;
+ }
+ }
+ }
+ finally
+ {
+ gameMap.GameObjLockDict[GameObjType.Character].ExitReadLock();
+ }
+ Debugger.Output(player, "encourage someone!");
+ },
+ () =>
+ { });
+ }
+
+ public bool Inspire(Character player)
+ {
+ if ((!player.Commandable())) return false;
+ return ActiveSkillEffect(player.FindIActiveSkill(ActiveSkillType.Inspire), player, () =>
+ {
+ gameMap.GameObjLockDict[GameObjType.Character].EnterReadLock();
+ try
+ {
+ foreach (Character character in gameMap.GameObjDict[GameObjType.Character])
+ {
+ if (gameMap.CanSee(player, character))
+ {
+ player.AddScore(GameData.StudentScoreTreat(character.MaxHp - character.HP));
+ character.AddMoveSpeed(GameData.PropDuration);
+ }
+ }
+ }
+ finally
+ {
+ gameMap.GameObjLockDict[GameObjType.Character].ExitReadLock();
+ }
+ Debugger.Output(player, "inspires!");
+ },
+ () =>
+ { });
+ }
+
public static bool ActiveSkillEffect(IActiveSkill activeSkill, Character player, Action startSkill, Action endSkill)
{
lock (activeSkill.ActiveSkillLock)
diff --git a/logic/Gaming/SkillManager/SkillManager.cs b/logic/Gaming/SkillManager/SkillManager.cs
index e6622f4..0d2edf4 100644
--- a/logic/Gaming/SkillManager/SkillManager.cs
+++ b/logic/Gaming/SkillManager/SkillManager.cs
@@ -28,6 +28,12 @@ namespace Gaming
case ActiveSkillType.CanBeginToCharge:
CanBeginToCharge(character);
break;
+ case ActiveSkillType.Inspire:
+ Inspire(character);
+ break;
+ case ActiveSkillType.Encourage:
+ Encourage(character);
+ break;
case ActiveSkillType.Punish:
Punish(character);
break;
diff --git a/logic/Preparation/Interface/IOccupation.cs b/logic/Preparation/Interface/IOccupation.cs
index 6a101e1..fa0d0a2 100644
--- a/logic/Preparation/Interface/IOccupation.cs
+++ b/logic/Preparation/Interface/IOccupation.cs
@@ -335,7 +335,7 @@ namespace Preparation.Interface
public BulletType InitBullet => BulletType.Null;
- public List ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Rouse });
+ public List ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Rouse, ActiveSkillType.Encourage, ActiveSkillType.Inspire });
public List ListOfIPassiveSkill => new(new PassiveSkillType[] { });
public const int fixSpeed = GameData.basicFixSpeed * 11 / 10;
diff --git a/logic/Preparation/Interface/ISkill.cs b/logic/Preparation/Interface/ISkill.cs
index 5c66d58..81f1dd6 100644
--- a/logic/Preparation/Interface/ISkill.cs
+++ b/logic/Preparation/Interface/ISkill.cs
@@ -64,7 +64,37 @@ public class Punish : IActiveSkill
public class Rouse : IActiveSkill
{
- public int SkillCD => GameData.commonSkillCD;
+ public int SkillCD => GameData.commonSkillCD * 2;
+ 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 class Encourage : IActiveSkill
+{
+ public int SkillCD => GameData.commonSkillCD * 2;
+ 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 class Inspire : IActiveSkill
+{
+ public int SkillCD => GameData.commonSkillCD * 2;
public int DurationTime => 0;
private readonly object commonSkillLock = new object();
@@ -213,6 +243,8 @@ public static class SkillFactory
return new UseKnife();
case ActiveSkillType.Howl:
return new Howl();
+ case ActiveSkillType.Encourage:
+ return new Encourage();
case ActiveSkillType.CanBeginToCharge:
return new CanBeginToCharge();
case ActiveSkillType.Punish:
@@ -227,6 +259,8 @@ public static class SkillFactory
return new UseRobot();
case ActiveSkillType.Rouse:
return new Rouse();
+ case ActiveSkillType.Inspire:
+ return new Inspire();
default:
return new NullSkill();
}
@@ -242,8 +276,12 @@ public static class SkillFactory
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:
diff --git a/logic/Preparation/Utility/EnumType.cs b/logic/Preparation/Utility/EnumType.cs
index b748df9..cbc4028 100644
--- a/logic/Preparation/Utility/EnumType.cs
+++ b/logic/Preparation/Utility/EnumType.cs
@@ -98,6 +98,8 @@ namespace Preparation.Utility
Howl = 9,
UseRobot = 10,
Rouse = 11,
+ Encourage = 12,
+ Inspire = 13,
}
public enum PassiveSkillType
{
diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs
index 46cc842..3e53610 100644
--- a/logic/Preparation/Utility/GameData.cs
+++ b/logic/Preparation/Utility/GameData.cs
@@ -193,23 +193,17 @@ namespace Preparation.Utility
public const int maxNumOfSkill = 3;
public const int commonSkillCD = 30000; // 普通技能标准冷却时间
public const int commonSkillTime = 10000; // 普通技能标准持续时间
- ///
- /// BeginToCharge
- ///
+
public const int TimeOfGhostFaintingWhenCharge = 7220;
public const int TimeOfStudentFaintingWhenCharge = 2090;
- ///
- /// Punish
- ///
public const int TimeOfGhostFaintingWhenPunish = 3070;
- public const int timeFactorOfGhostFainting = 250;
- ///
- /// Howl
- ///
public const int TimeOfGhostSwingingAfterHowl = 3070;
public const int TimeOfStudentFaintingWhenHowl = 6110;
+
+ public const int TimeOfStunnedWhenJumpyDumpty = 3070;
+
#endregion
#region 道具相关
public const int PropRadius = numOfPosGridPerCell / 2;