From f24e926515a40a9952c19c29511ebcbd19a067d2 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Sat, 25 Mar 2023 22:30:44 +0800 Subject: [PATCH] fix: :ambulance: fix a bug that moving can't stop fixing --- logic/GameClass/GameObj/Character/Skill.cs | 10 +++++ logic/Gaming/ActionManager.cs | 1 + logic/Gaming/PropManager.cs | 8 +++- logic/Preparation/Interface/IOccupation.cs | 2 +- logic/Preparation/Utility/EnumType.cs | 2 +- logic/Preparation/Utility/GameData.cs | 5 +-- logic/规则Logic.md | 45 +++++++++++++--------- 7 files changed, 47 insertions(+), 26 deletions(-) diff --git a/logic/GameClass/GameObj/Character/Skill.cs b/logic/GameClass/GameObj/Character/Skill.cs index 6ce89e3..41cdc53 100644 --- a/logic/GameClass/GameObj/Character/Skill.cs +++ b/logic/GameClass/GameObj/Character/Skill.cs @@ -29,6 +29,15 @@ namespace GameClass.GameObj public object ActiveSkillLock => commonSkillLock; } + public class Punish : IActiveSkill + { + public int SkillCD => GameData.commonSkillCD; + public int DurationTime => GameData.commonSkillTime / 10 * 6; + + private readonly object commonSkillLock = new object(); + public object ActiveSkillLock => commonSkillLock; + } + public class NuclearWeapon : IActiveSkill // 核武器 { public int SkillCD => GameData.commonSkillCD / 3 * 7; @@ -86,6 +95,7 @@ namespace GameClass.GameObj return ActiveSkillType.UseKnife; case CanBeginToCharge: return ActiveSkillType.CanBeginToCharge; + case Teacher: default: return ActiveSkillType.Null; } diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 2d60b26..b2791a2 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -18,6 +18,7 @@ namespace Gaming public bool MovePlayer(Character playerToMove, int moveTimeInMilliseconds, double moveDirection) { if (!playerToMove.Commandable()) return false; + playerToMove.PlayerState = PlayerStateType.Moving; moveEngine.MoveObj(playerToMove, moveTimeInMilliseconds, moveDirection); return true; } diff --git a/logic/Gaming/PropManager.cs b/logic/Gaming/PropManager.cs index 26fcff2..4d3e692 100644 --- a/logic/Gaming/PropManager.cs +++ b/logic/Gaming/PropManager.cs @@ -43,8 +43,12 @@ namespace Gaming break; case PropType.AddHpOrAp: if (!player.IsGhost()) - player.HP += GameData.basicTreatmentDegree; - else player.AddAp(GameData.PropDuration); + if (player.HP < player.MaxHp) + { + player.HP += GameData.basicTreatmentDegree; + player.AddScore(GameData.ScorePropAddHp); + } + else player.AddAp(GameData.PropDuration); break; default: break; diff --git a/logic/Preparation/Interface/IOccupation.cs b/logic/Preparation/Interface/IOccupation.cs index b8c3bcc..2830825 100644 --- a/logic/Preparation/Interface/IOccupation.cs +++ b/logic/Preparation/Interface/IOccupation.cs @@ -76,7 +76,7 @@ namespace Preparation.Interface public BulletType InitBullet => BulletType.Null; - public List ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.CanBeginToCharge }); + public List ListOfIActiveSkill => new(new ActiveSkillType[] { }); public List ListOfIPassiveSkill => new(new PassiveSkillType[] { }); public const int fixSpeed = 0; diff --git a/logic/Preparation/Utility/EnumType.cs b/logic/Preparation/Utility/EnumType.cs index a36c6c1..d9fcb36 100644 --- a/logic/Preparation/Utility/EnumType.cs +++ b/logic/Preparation/Utility/EnumType.cs @@ -79,7 +79,7 @@ namespace Preparation.Utility Athlete = 2, RecoverAfterBattle = 3, SpeedUpWhenLeavingGrass = 4, - PSkill4 = 5, + Teacher = 5, PSkill5 = 6 } public enum ActiveSkillType // 主动技能 diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index bb1e265..45220e3 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -128,11 +128,8 @@ namespace Preparation.Utility public const int ScorePropUseShield = 20; public const int ScorePropUseSpear = 20; public const int ScorePropAddAp = 10; + public const int ScorePropAddHp = 50; - public static int ScoreUseProp(PropType prop, bool IsGhost) - { - return 0; - } public static int ScoreUseSkill(ActiveSkillType activeSkillType) { return 0; diff --git a/logic/规则Logic.md b/logic/规则Logic.md index 2a8004c..fa2d5a7 100644 --- a/logic/规则Logic.md +++ b/logic/规则Logic.md @@ -262,23 +262,6 @@ - [箱子不可被关闭] - [箱子内道具最多两个] -### 道具 -- 每次玩家试图捡起道具时,需要确保道具栏有空位 -- indexing指道具栏数组下标从0开始 -- 扔道具 - - Logic内实现 - ~~~csharp - public void ThrowProp(long playerID, int indexing) - ~~~ - - 对应下标出现空位,不会对数组进行重新排序 -- 使用道具 - - Logic内实现 - ~~~csharp - public void UseProp(long playerID,int indexing) - ~~~ - - 对应下标出现空位,不会对数组进行重新排序 - - ### 治疗 - 可行动的求生者可以对受伤的其他求生者进行治疗,治疗完成后会回复被治疗程度的血量。 - 治疗时每毫秒增加相当于治疗者治疗速度的被治疗程度 @@ -340,4 +323,30 @@ #### ~~解除眩晕~~ -#### ~~自愈~~ \ No newline at end of file +#### ~~自愈~~ + +## 道具 +- 每次玩家试图捡起道具时,需要确保道具栏有空位 +- indexing指道具栏数组下标从0开始 +- 扔道具 + - Logic内实现 + ~~~csharp + public void ThrowProp(long playerID, int indexing) + ~~~ + - 对应下标出现空位,不会对数组进行重新排序 +- 使用道具 + - Logic内实现 + ~~~csharp + public void UseProp(long playerID,int indexing) + ~~~ + - 对应下标出现空位,不会对数组进行重新排序 + +| 道具 | 对学生增益 | [学生得分条件] | 对搞蛋鬼增益 | [搞蛋鬼得分条件] | +| :-------- | :-------------------------------------- | :-----------------| :-------------------------------------- |:-----------------| +| AddSpeed | 提高移动速度,持续10s |不得分| 提高移动速度,持续10s |不得分| +| AddLifeOrAp |若在10s内Hp归零,该增益消失以使Hp保留100|在10s内Hp归零,得分? |10秒内下一次攻击增伤1800000|10秒内有一次攻击,得分? | +| AddHpOrAp |回血1500000 | 回血成功 | 10秒内下一次攻击增伤1800000|10秒内有一次攻击,得分? | +| ShieldOrSpear | 10秒内能抵挡一次伤害 | 10秒内成功抵挡一次伤害 |10秒内下一次攻击能破盾,如果对方无盾,则增伤900000| 10秒内攻击中学生| +| Key3 | 能开启3教的门 |不得分| 能开启3教的门 |不得分| +| Key5 | 能开启5教的门 |不得分| 能开启3教的门 |不得分| +| Key6 | 能开启6教的门 |不得分| 能开启3教的门 |不得分|