From 288412bf87d857f8ec2b6e3f918bab6539aaf0c2 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Fri, 19 May 2023 15:11:08 +0800 Subject: [PATCH 1/9] feat: :sparkles: adjust Assassin --- docs/版本更新说明.md | 6 ++- .../GameClass/GameObj/Character/Character.cs | 49 ++++++++++++------- .../SkillManager/SkillManager.ActiveSkill.cs | 19 +++++-- 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/docs/版本更新说明.md b/docs/版本更新说明.md index 7dc7e94..f9e07fa 100644 --- a/docs/版本更新说明.md +++ b/docs/版本更新说明.md @@ -44,5 +44,9 @@ - fix:修复了InSpire会给Tricker加速的问题 - fix:修复了开锁门的bug +# 5月19日15:00更新 +- docs:更新了 游戏机制与平衡性调整更新草案.pdf +- hotfix:修复了移动状态设置错误 + # 最新更新 -- docs:更新了 游戏机制与平衡性调整更新草案.pdf \ No newline at end of file +- feat:Assassin已调整 \ No newline at end of file diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs index 6855120..79d1e4b 100644 --- a/logic/GameClass/GameObj/Character/Character.cs +++ b/logic/GameClass/GameObj/Character/Character.cs @@ -362,8 +362,7 @@ namespace GameClass.GameObj lock (actionLock) { if (playerState == PlayerStateType.Moving) - if (IsMoving == 1) return PlayerStateType.Moving; - else return PlayerStateType.Null; + return (IsMoving == 1) ? PlayerStateType.Moving : PlayerStateType.Null; return playerState; } } @@ -540,27 +539,41 @@ namespace GameClass.GameObj ThreadNum.Release(); } case PlayerStateType.UsingSkill: - if (CharacterType == CharacterType.TechOtaku) { - if (typeof(CraftingBench).IsInstanceOfType(whatInteractingWith)) + switch (CharacterType) { - try - { - ((CraftingBench)whatInteractingWith!).StopSkill(); + case CharacterType.TechOtaku: + { + if (typeof(CraftingBench).IsInstanceOfType(whatInteractingWith)) + { + try + { + ((CraftingBench)whatInteractingWith!).StopSkill(); + return ChangePlayerState(value, gameObj); + } + finally + { + ThreadNum.Release(); + } + } + else + { + if (value != PlayerStateType.UsingSkill) + ((UseRobot)FindActiveSkill(ActiveSkillType.UseRobot)).NowPlayerID = (int)playerID; + return ChangePlayerState(value, gameObj); + } + } + case CharacterType.Assassin: + if (value == PlayerStateType.Moving) return StateNum; + else + { + TryDeleteInvisible(); + return ChangePlayerState(value, gameObj); + } + default: return ChangePlayerState(value, gameObj); - } - finally - { - ThreadNum.Release(); - } - } - else - { - if (value != PlayerStateType.UsingSkill) - ((UseRobot)FindActiveSkill(ActiveSkillType.UseRobot)).NowPlayerID = (int)playerID; } } - return ChangePlayerState(value, gameObj); default: return ChangePlayerState(value, gameObj); } diff --git a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs index 5f05c6b..585dc62 100644 --- a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs +++ b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs @@ -93,16 +93,29 @@ namespace Gaming public static bool BecomeInvisible(Character player) { - if ((!player.Commandable())) return false; ActiveSkill activeSkill = player.FindActiveSkill(ActiveSkillType.BecomeInvisible); + long stateNum = player.SetPlayerState(PlayerStateType.UsingSkill); + if (stateNum == -1) + { + return false; + } return ActiveSkillEffect(activeSkill, player, () => { player.AddScore(GameData.ScoreBecomeInvisible); player.AddInvisible(activeSkill.DurationTime); Debugger.Output(player, "become invisible!"); }, - () => - { }); + () => + { + lock (player.ActionLock) + { + if (stateNum == player.StateNum) + { + player.SetPlayerStateNaturally(); + } + } + } + ); } public bool UseRobot(Character player, int robotID) From 810bc96c14d43d08a852543c4f8e3deb3e9cf440 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Fri, 19 May 2023 18:10:39 +0800 Subject: [PATCH 2/9] feat: :sparkles: adjust the CharacterType "Teacher" --- docs/使用文档.md | 4 +- ...戏机制与平衡性调整更新草案.md | 9 ++-- docs/版本更新说明.md | 3 +- .../SkillManager/SkillManager.ActiveSkill.cs | 45 ++++++++++++++++--- logic/Gaming/SkillManager/SkillManager.cs | 2 + logic/Preparation/Interface/IOccupation.cs | 4 +- logic/Preparation/Interface/ISkill.cs | 10 +++++ logic/Preparation/Utility/GameData.cs | 5 ++- 8 files changed, 64 insertions(+), 18 deletions(-) diff --git a/docs/使用文档.md b/docs/使用文档.md index 40be5fb..8750510 100644 --- a/docs/使用文档.md +++ b/docs/使用文档.md @@ -147,8 +147,8 @@ start python .\CAPI\python\PyAPI\main.py -I 127.0.0.1 -P 8888 -p 0 -d -o -w | 1 | Athlete | | 2 | Teacher | | 3 | StraightAStudent | - | 4 | Robot(目前未实现所有功能) | - | 5 | TechOtaku(目前未实现所有功能) | + | 4 | Robot | + | 5 | TechOtaku | | 6 | Sunshine | * 捣蛋鬼 diff --git a/docs/游戏机制与平衡性调整更新草案.md b/docs/游戏机制与平衡性调整更新草案.md index f08ff94..db29155 100644 --- a/docs/游戏机制与平衡性调整更新草案.md +++ b/docs/游戏机制与平衡性调整更新草案.md @@ -51,7 +51,6 @@ v1.6 - Teacher - 学习速度由0改为50 - 警戒范围由7500改为10000 - - 视野范围由9000降为8000 - 翻窗速度改为1000 - 特质: - 扣血则得分100×受到伤害/基本伤害(1500000) @@ -60,7 +59,7 @@ v1.6 - “使用瞬间,在**视野距离/3范围内(不是可视范围)的**翻窗、开锁门、攻击前后摇、**使用技能期间**的捣蛋鬼会被眩晕(3070+**500***已受伤害/基本伤害(1500000))ms” - 技能喝茶(HaveTea)(新增) - CD:90s - - 在有队友受过伤的情况下,使用瞬间,向当前方向瞬移3000(可以穿墙),如果会碰撞则失败。 + - 使用瞬间,向额外参数/1000.0的角度瞬移3000(可以穿墙),如果会碰撞则失败。 - Robot(新增) - 无技能 - 特性 @@ -71,14 +70,14 @@ v1.6 - 不可使用道具(可以捡起和扔道具) - TechOtaku(新增) - 一名TechOtaku最多可以在场上同时最多拥有3个Robot,无法共享视野 - 0. SummonGolem + 1. SummonGolem - CD:40s,持续时间:6s - 在持续时间中,学生进入人物状态进入UsingSpecialSkill(不能移动),进入其他状态会导致制作机器人失败。 - 在持续时间中,学生面前生成道具CraftingBench;学生进入其他状态或该道具被碰撞后,CraftingBench消失且制作机器人失败。 - 持续时间结束后,道具CraftingBench所在位置生成一个Robot,CraftingBench消失 - TechOtaku的Robot的PlayerId = TechOtaku的PlayerId + n×5(一局游戏理论人数),其中1<=n<=3(自己的n为0) - 新造的Robot的PlayerId的n总是尽量小 - 1. UseRobot + 2. UseRobot - CD:2s,持续时间:0s - 输入额外参数PlayerID,切换到要使用的角色。 - 切换到其他角色时,自己进入UsingSkill状态。 @@ -94,7 +93,7 @@ v1.6 | 勉励速度/ms | 80 | 90 | 100 | 120 | 0 | 100 | | 隐蔽度 | 0.5 | 0.9 | 0.9 | 0.8 | 0.8 | 1.1 | | 警戒范围 | 10000 | 15000 | 13500 | 15000 | 0 | 15000 | -| 视野范围 | 8000 | 11000 | 9000 | 10000 | 0 | 9000 | +| 视野范围 | 9000 | 11000 | 9000 | 10000 | 0 | 9000 | | 开锁门速度/ms | 5000 | 5000 | 5000 | 3500 | 0 | 5000 | | 翻窗速度/ms | 1000 | 1466 | 1018 | 1222 | 1 | 1100 | | 翻箱速度/ms | 1250 | 1250 | 1250 | 1125 | 1000 | 1100 | diff --git a/docs/版本更新说明.md b/docs/版本更新说明.md index f9e07fa..3de31d1 100644 --- a/docs/版本更新说明.md +++ b/docs/版本更新说明.md @@ -49,4 +49,5 @@ - hotfix:修复了移动状态设置错误 # 最新更新 -- feat:Assassin已调整 \ No newline at end of file +- feat:Assassin、Teacher已调整 +- docs:更新了 游戏机制与平衡性调整更新草案.pdf \ No newline at end of file diff --git a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs index 585dc62..cfb2a58 100644 --- a/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs +++ b/logic/Gaming/SkillManager/SkillManager.ActiveSkill.cs @@ -13,7 +13,6 @@ namespace Gaming { public static bool CanBeginToCharge(Character player) { - if ((!player.Commandable())) return false; ActiveSkill skill = player.FindActiveSkill(ActiveSkillType.CanBeginToCharge); Debugger.Output(player, "can begin to charge!"); @@ -118,7 +117,7 @@ namespace Gaming ); } - public bool UseRobot(Character player, int robotID) + public static bool UseRobot(Character player, int robotID) { if ((robotID - player.PlayerID) % GameData.numOfPeople != 0) return false; if ((robotID - (int)player.PlayerID) / GameData.numOfPeople < 0 || (robotID - (int)player.PlayerID) / GameData.numOfPeople > GameData.maxSummonedGolemNum) return false; @@ -274,8 +273,7 @@ namespace Gaming } craftingBench.ParentStateNum = stateNum; gameMap.Add(craftingBench); - /* - */ + return ActiveSkillEffect(activeSkill, player, () => { }, @@ -356,8 +354,8 @@ namespace Gaming || character.PlayerState == PlayerStateType.ClimbingThroughWindows) && XY.DistanceFloor3(character.Position, player.Position) <= player.ViewRange / 3) { - if (CharacterManager.BeStunned(character, GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP)) > 0) - player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP))); + if (CharacterManager.BeStunned(character, GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP) / GameData.basicApOfGhost) > 0) + player.AddScore(GameData.StudentScoreTrickerBeStunned(GameData.timeOfGhostStunnedWhenPunish + GameData.factorOfTimeStunnedWhenPunish * (player.MaxHp - player.HP) / GameData.basicApOfGhost)); break; } } @@ -372,6 +370,41 @@ namespace Gaming { }); } + public bool HaveTea(Character player, int angle1000) + { + long stateNum = player.SetPlayerState(PlayerStateType.UsingSkill); + if (stateNum == -1) + { + return false; + } + player.ThreadNum.WaitOne(); + + XY res = player.Position + new XY(angle1000 / 1000.0, GameData.distanceOfHaveTea); + Debugger.Output(res.ToString()); + if (actionManager.moveEngine.CheckCollision(player, res) != null) + { + player.ThreadNum.Release(); + return false; + } + Debugger.Output("NO Collision!"); + player.ReSetPos(res); + lock (player.ActionLock) + { + if (player.StateNum == stateNum) + { + player.SetPlayerStateNaturally(); + } + } + player.ThreadNum.Release(); + + return ActiveSkillEffect(player.FindActiveSkill(ActiveSkillType.HaveTea), player, () => + { + Debugger.Output(player, "have tea!"); + }, + () => + { }); + } + public bool Rouse(Character player) { if ((!player.Commandable())) return false; diff --git a/logic/Gaming/SkillManager/SkillManager.cs b/logic/Gaming/SkillManager/SkillManager.cs index fd2c21e..b3958cf 100644 --- a/logic/Gaming/SkillManager/SkillManager.cs +++ b/logic/Gaming/SkillManager/SkillManager.cs @@ -30,6 +30,8 @@ namespace Gaming return Encourage(character); case ActiveSkillType.Punish: return Punish(character); + case ActiveSkillType.HaveTea: + return HaveTea(character, parameter); case ActiveSkillType.JumpyBomb: return JumpyBomb(character); case ActiveSkillType.SparksNSplash: diff --git a/logic/Preparation/Interface/IOccupation.cs b/logic/Preparation/Interface/IOccupation.cs index 4d8e606..d7f07e8 100644 --- a/logic/Preparation/Interface/IOccupation.cs +++ b/logic/Preparation/Interface/IOccupation.cs @@ -166,7 +166,7 @@ namespace Preparation.Interface public BulletType InitBullet => BulletType.Null; - public List ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Punish }); + public List ListOfIActiveSkill => new(new ActiveSkillType[] { ActiveSkillType.Punish, ActiveSkillType.HaveTea }); public List ListOfIPassiveSkill => new(new PassiveSkillType[] { }); public const int fixSpeed = 50; @@ -181,7 +181,7 @@ namespace Preparation.Interface public const int alertnessRadius = GameData.basicStudentAlertnessRadius * 2 / 3; public int AlertnessRadius => alertnessRadius; - public int viewRange = GameData.basicStudentViewRange * 8 / 10; + public int viewRange = GameData.basicStudentViewRange * 9 / 10; public int ViewRange => viewRange; public int speedOfOpeningOrLocking = GameData.basicSpeedOfOpeningOrLocking; diff --git a/logic/Preparation/Interface/ISkill.cs b/logic/Preparation/Interface/ISkill.cs index c8fa69d..93aa459 100644 --- a/logic/Preparation/Interface/ISkill.cs +++ b/logic/Preparation/Interface/ISkill.cs @@ -70,6 +70,12 @@ namespace Preparation.Interface public override int DurationTime => 0; } + public class HaveTea : ActiveSkill + { + public override int SkillCD => GameData.commonSkillCD * 3; + public override int DurationTime => 0; + } + public class Rouse : ActiveSkill { public override int SkillCD => GameData.commonSkillCD * 4; @@ -245,6 +251,8 @@ namespace Preparation.Interface return new CanBeginToCharge(); case ActiveSkillType.Punish: return new Punish(); + case ActiveSkillType.HaveTea: + return new HaveTea(); case ActiveSkillType.JumpyBomb: return new JumpyBomb(); case ActiveSkillType.SparksNSplash: @@ -284,6 +292,8 @@ namespace Preparation.Interface return ActiveSkillType.Inspire; case Punish: return ActiveSkillType.Punish; + case HaveTea: + return ActiveSkillType.HaveTea; case JumpyBomb: return ActiveSkillType.JumpyBomb; case SparksNSplash: diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index b24dbd1..538c091 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -214,8 +214,9 @@ namespace Preparation.Utility public const int timeOfStudentStunnedWhenCharge = 2090; public const int timeOfGhostStunnedWhenPunish = 3070; - public const int factorOfTimeStunnedWhenPunish = 500 / basicApOfGhost; - public const int factorOfScoreWhenTeacherAttacked = 100;//每个 + public const int factorOfTimeStunnedWhenPunish = 500; + public const int factorOfScoreWhenTeacherAttacked = 100; + public const int distanceOfHaveTea = 3000; public const int timeOfGhostSwingingAfterHowl = 800; public const int timeOfStudentStunnedWhenHowl = 5500; From b159779ecf10d0f12b431fa054f7bd4196842bfb Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Fri, 19 May 2023 18:13:09 +0800 Subject: [PATCH 3/9] fix: :bug: fix a bug about Interlocked.CompareExchange --- logic/GameClass/GameObj/Bullet/Bullet.cs | 2 +- logic/GameClass/GameObj/Moveable.cs | 4 ++-- logic/Preparation/Interface/ISkill.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/logic/GameClass/GameObj/Bullet/Bullet.cs b/logic/GameClass/GameObj/Bullet/Bullet.cs index fa25353..b7c20a9 100644 --- a/logic/GameClass/GameObj/Bullet/Bullet.cs +++ b/logic/GameClass/GameObj/Bullet/Bullet.cs @@ -14,7 +14,7 @@ namespace GameClass.GameObj protected int ap; public int AP { - get => Interlocked.CompareExchange(ref ap, 0, 1); + get => Interlocked.CompareExchange(ref ap, 0, 0); } public void AddAP(int addAp) { diff --git a/logic/GameClass/GameObj/Moveable.cs b/logic/GameClass/GameObj/Moveable.cs index 7f9c74f..21bf524 100644 --- a/logic/GameClass/GameObj/Moveable.cs +++ b/logic/GameClass/GameObj/Moveable.cs @@ -50,7 +50,7 @@ namespace GameClass.GameObj private int isMoving = 0; public int IsMoving { - get => Interlocked.CompareExchange(ref isMoving, 0, 1); + get => Interlocked.CompareExchange(ref isMoving, 0, 0); set => Interlocked.Exchange(ref isMoving, value); } @@ -157,7 +157,7 @@ namespace GameClass.GameObj /// public int MoveSpeed { - get => Interlocked.CompareExchange(ref moveSpeed, 0, 1); + get => Interlocked.CompareExchange(ref moveSpeed, 0, 0); set => Interlocked.Exchange(ref moveSpeed, value); } /// diff --git a/logic/Preparation/Interface/ISkill.cs b/logic/Preparation/Interface/ISkill.cs index 93aa459..72a1cba 100644 --- a/logic/Preparation/Interface/ISkill.cs +++ b/logic/Preparation/Interface/ISkill.cs @@ -34,7 +34,7 @@ namespace Preparation.Interface { get { - return Interlocked.CompareExchange(ref timeUntilActiveSkillAvailable, 0, 1); + return Interlocked.CompareExchange(ref timeUntilActiveSkillAvailable, 0, 0); } set { @@ -47,7 +47,7 @@ namespace Preparation.Interface public int isBeingUsed = 0;//实为bool public int IsBeingUsed { - get => Interlocked.CompareExchange(ref isBeingUsed, 0, 1); + get => Interlocked.CompareExchange(ref isBeingUsed, 0, 0); set => Interlocked.Exchange(ref isBeingUsed, value); } } @@ -169,7 +169,7 @@ namespace Preparation.Interface private int degreeOfMeditation = 0; public int DegreeOfMeditation { - get => Interlocked.CompareExchange(ref degreeOfMeditation, 0, 1); + get => Interlocked.CompareExchange(ref degreeOfMeditation, 0, 0); set => Interlocked.Exchange(ref degreeOfMeditation, value); } } From f816bbf6efbd880d38ad0eede6057dc3d5a8f25a Mon Sep 17 00:00:00 2001 From: DragonAura Date: Fri, 19 May 2023 19:13:03 +0800 Subject: [PATCH 4/9] feat(CAPI): :sparkles: update constants --- CAPI/cpp/API/include/constants.h | 89 +++++++++++++++++++++----------- CAPI/python/PyAPI/constants.py | 79 ++++++++++++++++++---------- 2 files changed, 109 insertions(+), 59 deletions(-) diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 51d2034..6f0375f 100644 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -32,10 +32,10 @@ namespace Constants // 人物属性相关 SCCI int basicEncourageSpeed = 100; SCCI int basicFixSpeed = 123; - SCCI int basicSpeedOfOpeningOrLocking = 4000; + SCCI int basicSpeedOfOpeningOrLocking = 5000; SCCI int basicStudentSpeedOfClimbingThroughWindows = 1222; SCCI int basicTrickerSpeedOfClimbingThroughWindows = 2540; - SCCI int basicSpeedOfOpenChest = 1000; + SCCI int basicSpeedOfOpenChest = 1250; SCCI int basicHp = 3000000; SCCI int basicMaxGamingAddiction = 60000; @@ -138,19 +138,19 @@ namespace Constants SCCI int moveSpeed = basicStudentSpeed * 9 / 10; SCCI int maxHp = basicHp * 10; SCCI int maxAddiction = basicMaxGamingAddiction * 10; - SCCI int fixSpeed = basicFixSpeed * 0; + SCCI int fixSpeed = (int)(basicFixSpeed * 0.4); SCCI int encourageSpeed = basicEncourageSpeed * 8 / 10; SCCI double concealment = 0.5; - SCCI int alertnessRadius = basicStudentAlertnessRadius / 2; - SCCI int viewRange = basicStudentViewRange * 9 / 10; + SCCI int alertnessRadius = basicStudentAlertnessRadius * 3 / 4; + SCCI int viewRange = basicStudentViewRange * 8 / 10; SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; - SCCI int speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows / 2; + SCCI int speedOfClimbingThroughWindows = (int)(basicStudentSpeedOfClimbingThroughWindows * 0.82); SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct StraightAStudent { - SCCI int moveSpeed = basicStudentSpeed * 96 / 100; + SCCI int moveSpeed = basicStudentSpeed * 24 / 25; SCCI int maxHp = basicHp * 11 / 10; SCCI int maxAddiction = basicMaxGamingAddiction * 13 / 10; SCCI int fixSpeed = basicFixSpeed * 11 / 10; @@ -165,41 +165,41 @@ namespace Constants struct Robot { - SCCI int moveSpeed = basicStudentSpeed; - SCCI int maxHp = basicHp * 0.4; + SCCI int moveSpeed = basicStudentSpeed * 9 / 10; + SCCI int maxHp = basicHp * 0.3; SCCI int maxAddiction = basicMaxGamingAddiction * 0; - SCCI int fixSpeed = basicFixSpeed; + SCCI int fixSpeed = (int)(basicFixSpeed * 0.7); SCCI int encourageSpeed = 0; - SCCI double concealment = 1; - SCCI int alertnessRadius = basicStudentAlertnessRadius * 1; - SCCI int viewRange = basicStudentViewRange; - SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI double concealment = 0.8; + SCCI int alertnessRadius = 0; + SCCI int viewRange = 0; + SCCI int speedOfOpeningOrLocking = 0; SCCI int speedOfClimbingThroughWindows = 1; - SCCI int speedOfOpenChest = basicSpeedOfOpenChest; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest * 4 / 5; }; struct TechOtaku { - SCCI int moveSpeed = basicStudentSpeed * 3 / 4; + SCCI int moveSpeed = (int)(basicStudentSpeed * 0.96); SCCI int maxHp = basicHp * 9 / 10; - SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10; - SCCI int fixSpeed = basicFixSpeed * 11 / 10; - SCCI int encourageSpeed = basicEncourageSpeed * 9 / 10; - SCCI double concealment = 1; + SCCI int maxAddiction = basicMaxGamingAddiction; + SCCI int fixSpeed = (int)(basicFixSpeed * 0.9); + SCCI int encourageSpeed = basicEncourageSpeed; + SCCI double concealment = 1.1; SCCI int alertnessRadius = basicStudentAlertnessRadius; SCCI int viewRange = basicStudentViewRange * 9 / 10; SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; - SCCI int speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 3 / 4; - SCCI int speedOfOpenChest = basicSpeedOfOpenChest; + SCCI int speedOfClimbingThroughWindows = (int)(basicStudentSpeedOfClimbingThroughWindows * 0.9); + SCCI int speedOfOpenChest = basicSpeedOfOpenChest * 22 / 25; }; struct Sunshine { SCCI int moveSpeed = basicStudentSpeed; - SCCI int maxHp = basicHp * 32 / 30; + SCCI int maxHp = basicHp * 16 / 15; SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10; SCCI int fixSpeed = basicFixSpeed; - SCCI int encourageSpeed = basicEncourageSpeed * 12 / 10; + SCCI int encourageSpeed = basicEncourageSpeed * 6 / 5; SCCI double concealment = 1; SCCI int alertnessRadius = basicStudentAlertnessRadius; SCCI int viewRange = basicStudentViewRange; @@ -244,7 +244,19 @@ namespace Constants struct Punish { - SCCI int skillCD = commonSkillCD * 1; + SCCI int skillCD = commonSkillCD * 3 / 2; + SCCI int durationTime = commonSkillTime * 0; + }; + + struct SparksNSplash + { + SCCI int skillCD = commonSkillCD * 3 / 2; + SCCI int durationTime = commonSkillTime * 1; + }; + + struct HaveTea + { + SCCI int skillCD = commonSkillCD * 3; SCCI int durationTime = commonSkillTime * 0; }; @@ -292,7 +304,7 @@ namespace Constants struct UseRobot { - SCCI int skillCD = commonSkillCD / 300; + SCCI int skillCD = commonSkillCD / 15; SCCI int durationTime = commonSkillTime * 0; }; @@ -304,8 +316,8 @@ namespace Constants struct SummonGolem { - SCCI int skillCD = commonSkillCD * 1; - SCCI int durationTime = commonSkillTime * 0; + SCCI int skillCD = commonSkillCD * 4 / 3; + SCCI int durationTime = commonSkillTime * 6; }; struct CommonAttackOfTricker @@ -331,10 +343,10 @@ namespace Constants SCCI int Speed = basicBulletMoveSpeed * 25 / 10; SCCI bool IsRemoteAttack = true; - SCCI int CastTime = basicCastTime * 4 / 5; + SCCI int CastTime = basicCastTime * 6 / 5; SCCI int Backswing = 0; SCCI int RecoveryFromHit = 0; - SCCI int cd = basicBackswing / 2; + SCCI int cd = basicBackswing * 3 / 4; SCCI int maxBulletNum = 1; }; @@ -347,7 +359,7 @@ namespace Constants SCCI bool IsRemoteAttack = false; SCCI int CastTime = (int)BulletAttackRange * 1000 / Speed; - SCCI int Backswing = basicRecoveryFromHit; + SCCI int Backswing = basicBackswing * 3 / 2; SCCI int RecoveryFromHit = basicRecoveryFromHit; SCCI int cd = basicCD; SCCI int maxBulletNum = 1; @@ -361,5 +373,20 @@ namespace Constants SCCI int Speed = basicBulletMoveSpeed * 43 / 37; SCCI bool IsRemoteAttack = false; }; + + struct Strike + { + SCCI double BulletBombRange = 0; + SSC double BulletAttackRange = basicAttackShortRange; + SCCI int ap = basicApOfTricker * 16 / 15; + SCCI int Speed = basicBulletMoveSpeed * 125 / 148; + SCCI bool IsRemoteAttack = false; + + SCCI int CastTime = basicCastTime * 16 / 25; + SCCI int Backswing = basicBackswing; + SCCI int RecoveryFromHit = basicRecoveryFromHit; + SCCI int cd = basicBackswing * 3 / 4; + SCCI int maxBulletNum = 1; + }; } // namespace Constants #endif diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index cdd92cd..ce0ea56 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -27,10 +27,10 @@ class Constants(NoInstance): # 人物属性相关 basicEncourageSpeed = 100 basicLearnSpeed = 123 - basicSpeedOfOpeningOrLocking = 4000 + basicSpeedOfOpeningOrLocking = 5000 basicStudentSpeedOfClimbingThroughWindows = 1222 basicTrickerSpeedOfClimbingThroughWindows = 2540 - basicSpeedOfOpenChest = 1000 + basicSpeedOfOpenChest = 1250 basicHp = 3000000 basicMaxGamingAddiction = 60000 @@ -159,14 +159,14 @@ class Teacher: moveSpeed = (int)(0.9 * Constants.basicStudentSpeed) maxHp = (int)(10.0 * Constants.basicHp) maxAddiction = (int)(10.0 * Constants.basicMaxGamingAddiction) - LearnSpeed = (int)(0.0 * Constants.basicLearnSpeed) + LearnSpeed = (int)(0.4 * Constants.basicLearnSpeed) EncourageSpeed = (int)(0.8 * Constants.basicEncourageSpeed) concealment = 0.5 * Constants.basicConcealment - alertnessRadius = (int)(0.5 * Constants.basicStudentAlertnessRadius) - viewRange = (int)(0.9 * Constants.basicStudentViewRange) + alertnessRadius = (int)(0.75 * Constants.basicStudentAlertnessRadius) + viewRange = (int)(0.8 * Constants.basicStudentViewRange) speedOfOpeningOrLocking = (int)(1.0 * Constants.basicSpeedOfOpeningOrLocking) speedOfClimbingThroughWindows = (int)( - 0.5 * Constants.basicStudentSpeedOfClimbingThroughWindows + 0.82 * Constants.basicStudentSpeedOfClimbingThroughWindows ) speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest) @@ -188,35 +188,35 @@ class StraightAStudent: class Robot: - moveSpeed = (int)(1.0 * Constants.basicStudentSpeed) - maxHp = (int)(0.4 * Constants.basicHp) + moveSpeed = (int)(0.9 * Constants.basicStudentSpeed) + maxHp = (int)(0.3 * Constants.basicHp) maxAddiction = (int)(0.0 * Constants.basicMaxGamingAddiction) - LearnSpeed = (int)(1.0 * Constants.basicLearnSpeed) + LearnSpeed = (int)(0.7 * Constants.basicLearnSpeed) EncourageSpeed = 0 - concealment = 1.0 * Constants.basicConcealment - alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius) - viewRange = (int)(1.0 * Constants.basicStudentViewRange) - speedOfOpeningOrLocking = (int)(1.0 * Constants.basicSpeedOfOpeningOrLocking) + concealment = 0.8 * Constants.basicConcealment + alertnessRadius = (int)(0.0 * Constants.basicStudentAlertnessRadius) + viewRange = (int)(0.0 * Constants.basicStudentViewRange) + speedOfOpeningOrLocking = (int)(0.0 * Constants.basicSpeedOfOpeningOrLocking) speedOfClimbingThroughWindows = (int)( - 0.0016 * Constants.basicStudentSpeedOfClimbingThroughWindows + 0.0008 * Constants.basicStudentSpeedOfClimbingThroughWindows ) - speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest) + speedOfOpenChest = (int)(0.8 * Constants.basicSpeedOfOpenChest) class TechOtaku: - moveSpeed = (int)(0.75 * Constants.basicStudentSpeed) + moveSpeed = (int)(0.96 * Constants.basicStudentSpeed) maxHp = (int)(0.9 * Constants.basicHp) - maxAddiction = (int)(1.1 * Constants.basicMaxGamingAddiction) - LearnSpeed = (int)(1.1 * Constants.basicLearnSpeed) - EncourageSpeed = (int)(0.9 * Constants.basicEncourageSpeed) + maxAddiction = (int)(1.0 * Constants.basicMaxGamingAddiction) + LearnSpeed = (int)(0.9 * Constants.basicLearnSpeed) + EncourageSpeed = (int)(1.0 * Constants.basicEncourageSpeed) concealment = 1.0 * Constants.basicConcealment alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius) viewRange = (int)(0.9 * Constants.basicStudentViewRange) speedOfOpeningOrLocking = (int)(1.0 * Constants.basicSpeedOfOpeningOrLocking) speedOfClimbingThroughWindows = (int)( - 0.75 * Constants.basicStudentSpeedOfClimbingThroughWindows + 0.9 * Constants.basicStudentSpeedOfClimbingThroughWindows ) - speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest) + speedOfOpenChest = (int)(0.88 * Constants.basicSpeedOfOpenChest) class Sunshine: @@ -246,7 +246,17 @@ class BecomeInvisible: class Punish: - skillCD = (int)(1.0 * Constants.commonSkillCD) + skillCD = (int)(1.5 * Constants.commonSkillCD) + durationTime = (int)(0.0 * Constants.commonSkillTime) + + +class SparksNSplash: + skillCD = (int)(1.5 * Constants.commonSkillCD) + durationTime = (int)(1.0 * Constants.commonSkillTime) + + +class HaveTea: + skillCD = (int)(3 * Constants.commonSkillCD) durationTime = (int)(0.0 * Constants.commonSkillTime) @@ -286,7 +296,7 @@ class UseKnife: class UseRobot: - skillCD = (int)(0.0017 * Constants.commonSkillCD) + skillCD = (int)(0.0667 * Constants.commonSkillCD) durationTime = (int)(0.0 * Constants.commonSkillTime) @@ -296,8 +306,8 @@ class WriteAnswers: class SummonGolem: - skillCD = (int)(1.0 * Constants.commonSkillCD) - durationTime = (int)(0.0 * Constants.commonSkillTime) + skillCD = (int)(1.25 * Constants.commonSkillCD) + durationTime = (int)(6.0 * Constants.commonSkillTime) class CommonAttackOfTricker: @@ -319,10 +329,10 @@ class FlyingKnife: ap = Constants.basicApOfTricker * 4 / 5 Speed = Constants.basicBulletMoveSpeed * 25 / 10 IsRemoteAttack = True - CastTime = Constants.basicCastTime * 4 / 5 + CastTime = Constants.basicCastTime * 6 / 5 Backswing = 0 RecoveryFromHit = 0 - cd = Constants.basicBackswing / 2 + cd = Constants.basicBackswing * 3 / 4 maxBulletNum = 1 @@ -333,7 +343,7 @@ class BombBomb: Speed = Constants.basicBulletMoveSpeed * 30 / 37 IsRemoteAttack = False CastTime = BulletAttackRange * 1000 / Speed - Backswing = Constants.basicRecoveryFromHit + Backswing = Constants.basicBackswing * 3 / 2 RecoveryFromHit = Constants.basicRecoveryFromHit cd = Constants.basicCD maxBulletNum = 1 @@ -345,3 +355,16 @@ class JumpyDumpty: ap = (int)(Constants.basicApOfTricker * 0.6) Speed = Constants.basicBulletMoveSpeed * 43 / 37 IsRemoteAttack = False + + +class Strike: + BulletBombRange = 0 + BulletAttackRange = Constants.basicAttackShortRange + ap = Constants.basicApOfTricker * 16 / 5 + Speed = Constants.basicBulletMoveSpeed * 125 / 148 + IsRemoteAttack = False + CastTime = Constants.basicCastTime * 16 / 25 + Backswing = Constants.basicBackswing + RecoveryFromHit = Constants.basicRecoveryFromHit + cd = Constants.basicBackswing * 3 / 4 + maxBulletNum = 1 From 8ced8a0f7520609855c6a0d65e78aeb6f013bd07 Mon Sep 17 00:00:00 2001 From: DragonAura Date: Fri, 19 May 2023 20:51:38 +0800 Subject: [PATCH 5/9] refactor(CAPI): :bug: change / to // --- CAPI/python/PyAPI/constants.py | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index ce0ea56..773b0ab 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -65,8 +65,8 @@ class Constants(NoInstance): # 道具相关 - apPropAdd = basicApOfTricker * 12 / 10 - apSpearAdd = basicApOfTricker * 6 / 10 + apPropAdd = basicApOfTricker * 12 // 10 + apSpearAdd = basicApOfTricker * 6 // 10 # 技能相关 maxNumOfSkill = 3 @@ -85,7 +85,7 @@ class Constants(NoInstance): addedTimeOfSpeedWhenInspire = 1.6 timeOfAddingSpeedWhenInspire = 6000 - addHpWhenEncourage = basicHp / 4 + addHpWhenEncourage = basicHp // 4 checkIntervalWhenShowTime = 200 addAddictionPer100msWhenShowTime = 300 @@ -241,7 +241,7 @@ class CanBeginToCharge: class BecomeInvisible: - skillCD = (int)(4 * Constants.commonSkillCD / 3) + skillCD = (int)(4 * Constants.commonSkillCD // 3) durationTime = (int)(Constants.commonSkillTime) @@ -281,7 +281,7 @@ class Howl: class ShowTime: - skillCD = (int)(8 * Constants.commonSkillCD / 3) + skillCD = (int)(8 * Constants.commonSkillCD // 3) durationTime = (int)(1.0 * Constants.commonSkillTime) @@ -316,7 +316,7 @@ class CommonAttackOfTricker: ap = Constants.basicApOfTricker Speed = Constants.basicBulletMoveSpeed IsRemoteAttack = False - CastTime = BulletAttackRange * 1000 / Speed + CastTime = BulletAttackRange * 1000 // Speed Backswing = Constants.basicBackswing RecoveryFromHit = Constants.basicRecoveryFromHit cd = Constants.basicBackswing @@ -326,45 +326,45 @@ class CommonAttackOfTricker: class FlyingKnife: BulletBombRange = 0 BulletAttackRange = Constants.basicRemoteAttackRange * 13 - ap = Constants.basicApOfTricker * 4 / 5 - Speed = Constants.basicBulletMoveSpeed * 25 / 10 + ap = Constants.basicApOfTricker * 4 // 5 + Speed = Constants.basicBulletMoveSpeed * 25 // 10 IsRemoteAttack = True - CastTime = Constants.basicCastTime * 6 / 5 + CastTime = Constants.basicCastTime * 6 // 5 Backswing = 0 RecoveryFromHit = 0 - cd = Constants.basicBackswing * 3 / 4 + cd = Constants.basicBackswing * 3 // 4 maxBulletNum = 1 class BombBomb: BulletBombRange = Constants.basicBulletBombRange BulletAttackRange = Constants.basicAttackShortRange - ap = Constants.basicApOfTricker * 6 / 5 - Speed = Constants.basicBulletMoveSpeed * 30 / 37 + ap = Constants.basicApOfTricker * 6 // 5 + Speed = Constants.basicBulletMoveSpeed * 30 // 37 IsRemoteAttack = False - CastTime = BulletAttackRange * 1000 / Speed - Backswing = Constants.basicBackswing * 3 / 2 + CastTime = BulletAttackRange * 1000 // Speed + Backswing = Constants.basicBackswing * 3 // 2 RecoveryFromHit = Constants.basicRecoveryFromHit cd = Constants.basicCD maxBulletNum = 1 class JumpyDumpty: - BulletBombRange = Constants.basicBulletBombRange / 2 + BulletBombRange = Constants.basicBulletBombRange // 2 BulletAttackRange = Constants.basicRemoteAttackRange * 2 ap = (int)(Constants.basicApOfTricker * 0.6) - Speed = Constants.basicBulletMoveSpeed * 43 / 37 + Speed = Constants.basicBulletMoveSpeed * 43 // 37 IsRemoteAttack = False class Strike: BulletBombRange = 0 BulletAttackRange = Constants.basicAttackShortRange - ap = Constants.basicApOfTricker * 16 / 5 - Speed = Constants.basicBulletMoveSpeed * 125 / 148 + ap = Constants.basicApOfTricker * 16 // 5 + Speed = Constants.basicBulletMoveSpeed * 125 // 148 IsRemoteAttack = False - CastTime = Constants.basicCastTime * 16 / 25 + CastTime = Constants.basicCastTime * 16 // 25 Backswing = Constants.basicBackswing RecoveryFromHit = Constants.basicRecoveryFromHit - cd = Constants.basicBackswing * 3 / 4 + cd = Constants.basicBackswing * 3 // 4 maxBulletNum = 1 From 5142b7d326f0db422e77981b78b5aa6b31c1fa51 Mon Sep 17 00:00:00 2001 From: DragonAura Date: Fri, 19 May 2023 21:29:28 +0800 Subject: [PATCH 6/9] fix(CAPI): :bug: fix wrong num --- CAPI/python/PyAPI/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index 773b0ab..58587dc 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -296,7 +296,7 @@ class UseKnife: class UseRobot: - skillCD = (int)(0.0667 * Constants.commonSkillCD) + skillCD = (int)(0.0666 * Constants.commonSkillCD) durationTime = (int)(0.0 * Constants.commonSkillTime) @@ -306,7 +306,7 @@ class WriteAnswers: class SummonGolem: - skillCD = (int)(1.25 * Constants.commonSkillCD) + skillCD = (int)(Constants.commonSkillCD * 4 // 3) durationTime = (int)(6.0 * Constants.commonSkillTime) From 361a30e359e69e7d97d63036caa058aaf22c79bb Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Sat, 20 May 2023 00:33:39 +0800 Subject: [PATCH 7/9] fix: :art: deprecate moveReaderWriterLock --- CAPI/cpp/API/include/constants.h | 10 +-- CAPI/python/PyAPI/constants.py | 18 +++-- logic/GameClass/GameObj/Bullet/Bullet.cs | 2 +- .../GameObj/Character/Character.Skill.cs | 2 +- .../GameClass/GameObj/Character/Character.cs | 16 ++--- logic/GameClass/GameObj/GameObj.cs | 25 ++----- logic/GameClass/GameObj/Moveable.cs | 66 +++---------------- logic/GameClass/GameObj/Prop/Gadget.cs | 2 +- logic/GameClass/GameObj/Prop/Item.cs | 2 +- logic/GameEngine/MoveEngine.cs | 8 +-- logic/Preparation/Interface/IMoveable.cs | 2 +- 11 files changed, 38 insertions(+), 115 deletions(-) diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 6f0375f..f67555a 100644 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -138,13 +138,13 @@ namespace Constants SCCI int moveSpeed = basicStudentSpeed * 9 / 10; SCCI int maxHp = basicHp * 10; SCCI int maxAddiction = basicMaxGamingAddiction * 10; - SCCI int fixSpeed = (int)(basicFixSpeed * 0.4); + SCCI int fixSpeed = (int)(basicFixSpeed * 50 / 123); SCCI int encourageSpeed = basicEncourageSpeed * 8 / 10; SCCI double concealment = 0.5; - SCCI int alertnessRadius = basicStudentAlertnessRadius * 3 / 4; + SCCI int alertnessRadius = basicStudentAlertnessRadius * 2 / 3; SCCI int viewRange = basicStudentViewRange * 8 / 10; SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; - SCCI int speedOfClimbingThroughWindows = (int)(basicStudentSpeedOfClimbingThroughWindows * 0.82); + SCCI int speedOfClimbingThroughWindows = (int)(basicStudentSpeedOfClimbingThroughWindows * 1000 / 1222); SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; @@ -377,7 +377,7 @@ namespace Constants struct Strike { SCCI double BulletBombRange = 0; - SSC double BulletAttackRange = basicAttackShortRange; + SCCI double BulletAttackRange = basicAttackShortRange; SCCI int ap = basicApOfTricker * 16 / 15; SCCI int Speed = basicBulletMoveSpeed * 125 / 148; SCCI bool IsRemoteAttack = false; @@ -385,7 +385,7 @@ namespace Constants SCCI int CastTime = basicCastTime * 16 / 25; SCCI int Backswing = basicBackswing; SCCI int RecoveryFromHit = basicRecoveryFromHit; - SCCI int cd = basicBackswing * 3 / 4; + SCCI int cd = basicBackswing; SCCI int maxBulletNum = 1; }; } // namespace Constants diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index 773b0ab..15ee9ed 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -159,14 +159,14 @@ class Teacher: moveSpeed = (int)(0.9 * Constants.basicStudentSpeed) maxHp = (int)(10.0 * Constants.basicHp) maxAddiction = (int)(10.0 * Constants.basicMaxGamingAddiction) - LearnSpeed = (int)(0.4 * Constants.basicLearnSpeed) + LearnSpeed = (int)( Constants.basicLearnSpeed* 50//123) EncourageSpeed = (int)(0.8 * Constants.basicEncourageSpeed) concealment = 0.5 * Constants.basicConcealment - alertnessRadius = (int)(0.75 * Constants.basicStudentAlertnessRadius) + alertnessRadius = (int)(Constants.basicStudentAlertnessRadius * 2 // 3) viewRange = (int)(0.8 * Constants.basicStudentViewRange) speedOfOpeningOrLocking = (int)(1.0 * Constants.basicSpeedOfOpeningOrLocking) speedOfClimbingThroughWindows = (int)( - 0.82 * Constants.basicStudentSpeedOfClimbingThroughWindows + Constants.basicStudentSpeedOfClimbingThroughWindows* 1000 // 1222 ) speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest) @@ -197,9 +197,7 @@ class Robot: alertnessRadius = (int)(0.0 * Constants.basicStudentAlertnessRadius) viewRange = (int)(0.0 * Constants.basicStudentViewRange) speedOfOpeningOrLocking = (int)(0.0 * Constants.basicSpeedOfOpeningOrLocking) - speedOfClimbingThroughWindows = (int)( - 0.0008 * Constants.basicStudentSpeedOfClimbingThroughWindows - ) + speedOfClimbingThroughWindows = 1 speedOfOpenChest = (int)(0.8 * Constants.basicSpeedOfOpenChest) @@ -209,7 +207,7 @@ class TechOtaku: maxAddiction = (int)(1.0 * Constants.basicMaxGamingAddiction) LearnSpeed = (int)(0.9 * Constants.basicLearnSpeed) EncourageSpeed = (int)(1.0 * Constants.basicEncourageSpeed) - concealment = 1.0 * Constants.basicConcealment + concealment = 1.1 * Constants.basicConcealment alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius) viewRange = (int)(0.9 * Constants.basicStudentViewRange) speedOfOpeningOrLocking = (int)(1.0 * Constants.basicSpeedOfOpeningOrLocking) @@ -296,7 +294,7 @@ class UseKnife: class UseRobot: - skillCD = (int)(0.0667 * Constants.commonSkillCD) + skillCD = (int)(2 * Constants.commonSkillCD // 30) durationTime = (int)(0.0 * Constants.commonSkillTime) @@ -306,7 +304,7 @@ class WriteAnswers: class SummonGolem: - skillCD = (int)(1.25 * Constants.commonSkillCD) + skillCD = (int)(4 * Constants.commonSkillCD//3) durationTime = (int)(6.0 * Constants.commonSkillTime) @@ -366,5 +364,5 @@ class Strike: CastTime = Constants.basicCastTime * 16 // 25 Backswing = Constants.basicBackswing RecoveryFromHit = Constants.basicRecoveryFromHit - cd = Constants.basicBackswing * 3 // 4 + cd = Constants.basicBackswing maxBulletNum = 1 diff --git a/logic/GameClass/GameObj/Bullet/Bullet.cs b/logic/GameClass/GameObj/Bullet/Bullet.cs index b7c20a9..54a242c 100644 --- a/logic/GameClass/GameObj/Bullet/Bullet.cs +++ b/logic/GameClass/GameObj/Bullet/Bullet.cs @@ -52,7 +52,7 @@ namespace GameClass.GameObj public Bullet(Character player, int radius, XY Position) : base(Position, radius, GameObjType.Bullet) { - this.canMove = true; + this.ReSetCanMove(true); this.MoveSpeed = this.Speed; this.hasSpear = player.TryUseSpear(); this.Parent = player; diff --git a/logic/GameClass/GameObj/Character/Character.Skill.cs b/logic/GameClass/GameObj/Character/Character.Skill.cs index 1132ff5..195d954 100644 --- a/logic/GameClass/GameObj/Character/Character.Skill.cs +++ b/logic/GameClass/GameObj/Character/Character.Skill.cs @@ -50,7 +50,7 @@ namespace GameClass.GameObj protected Character(XY initPos, int initRadius, CharacterType characterType) : base(initPos, initRadius, GameObjType.Character) { - this.canMove = true; + this.ReSetCanMove(true); this.score = 0; this.buffManager = new BuffManager(); this.occupation = OccupationFactory.FindIOccupation(characterType); diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs index 79d1e4b..dfd4148 100644 --- a/logic/GameClass/GameObj/Character/Character.cs +++ b/logic/GameClass/GameObj/Character/Character.cs @@ -362,7 +362,7 @@ namespace GameClass.GameObj lock (actionLock) { if (playerState == PlayerStateType.Moving) - return (IsMoving == 1) ? PlayerStateType.Moving : PlayerStateType.Null; + return (IsMoving) ? PlayerStateType.Moving : PlayerStateType.Null; return playerState; } } @@ -594,17 +594,9 @@ namespace GameClass.GameObj { lock (actionLock) { - MoveReaderWriterLock.EnterWriteLock(); - try - { - canMove = false; - isRemoved = true; - } - finally - { - MoveReaderWriterLock.ExitWriteLock(); - } - playerState = playerStateType; + TryToRemove(); + ReSetCanMove(false); + SetPlayerState(playerStateType); position = GameData.PosWhoDie; } } diff --git a/logic/GameClass/GameObj/GameObj.cs b/logic/GameClass/GameObj/GameObj.cs index eb8dcaf..46065cd 100644 --- a/logic/GameClass/GameObj/GameObj.cs +++ b/logic/GameClass/GameObj/GameObj.cs @@ -29,40 +29,23 @@ namespace GameClass.GameObj protected XY facingDirection = new(1, 0); public abstract XY FacingDirection { get; } - protected bool canMove; public abstract bool CanMove { get; } public abstract bool IsRigid { get; } public abstract ShapeType Shape { get; } - protected bool isRemoved = false; - public virtual bool IsRemoved + protected int isRemoved = 0; + public bool IsRemoved { get { - gameObjReaderWriterLock.EnterReadLock(); - try - { - return isRemoved; - } - finally - { - gameObjReaderWriterLock.ExitReadLock(); - } + return (Interlocked.CompareExchange(ref isRemoved, 0, 0) == 1); } } public virtual void TryToRemove() { - gameObjReaderWriterLock.EnterWriteLock(); - try - { - isRemoved = true; - } - finally - { - gameObjReaderWriterLock.ExitWriteLock(); - } + Interlocked.Exchange(ref isRemoved, 1); } public int Radius { get; } diff --git a/logic/GameClass/GameObj/Moveable.cs b/logic/GameClass/GameObj/Moveable.cs index 21bf524..8ab496c 100644 --- a/logic/GameClass/GameObj/Moveable.cs +++ b/logic/GameClass/GameObj/Moveable.cs @@ -48,10 +48,10 @@ namespace GameClass.GameObj } private int isMoving = 0; - public int IsMoving + public bool IsMoving { - get => Interlocked.CompareExchange(ref isMoving, 0, 0); - set => Interlocked.Exchange(ref isMoving, value); + get => (Interlocked.CompareExchange(ref isMoving, 0, 0) == 1); + set => Interlocked.Exchange(ref isMoving, value ? 1 : 0); } // 移动,改变坐标 @@ -62,15 +62,7 @@ namespace GameClass.GameObj { lock (actionLock) { - moveReaderWriterLock.EnterReadLock(); - try - { - if (!canMove || isRemoved) return -1; - } - finally - { - moveReaderWriterLock.ExitReadLock(); - } + if (!CanMove || IsRemoved) return -1; if (stateNo != stateNum) return -1; facingDirection = moveVec; this.position += moveVec; @@ -87,49 +79,15 @@ namespace GameClass.GameObj } } + private int canMove; public override bool CanMove { - get - { - moveReaderWriterLock.EnterReadLock(); - try - { - return canMove; - } - finally - { - moveReaderWriterLock.ExitReadLock(); - } - } + get => (Interlocked.CompareExchange(ref canMove, 0, 0) == 1); } public void ReSetCanMove(bool value) { - moveReaderWriterLock.EnterWriteLock(); - try - { - canMove = value; - } - finally - { - moveReaderWriterLock.ExitWriteLock(); - } - } - - public override bool IsRemoved - { - get - { - moveReaderWriterLock.EnterReadLock(); - try - { - return isRemoved; - } - finally - { - moveReaderWriterLock.ExitReadLock(); - } - } + Interlocked.Exchange(ref canMove, (value ? 1 : 0)); } public bool IsAvailableForMove // 是否能接收移动指令 @@ -138,15 +96,7 @@ namespace GameClass.GameObj { lock (actionLock) { - moveReaderWriterLock.EnterReadLock(); - try - { - return isMoving == 0 && canMove && !isRemoved; - } - finally - { - moveReaderWriterLock.ExitReadLock(); - } + return !IsMoving && CanMove && !IsRemoved; } } } diff --git a/logic/GameClass/GameObj/Prop/Gadget.cs b/logic/GameClass/GameObj/Prop/Gadget.cs index 82611b3..4f03443 100644 --- a/logic/GameClass/GameObj/Prop/Gadget.cs +++ b/logic/GameClass/GameObj/Prop/Gadget.cs @@ -24,7 +24,7 @@ namespace GameClass.GameObj public Gadget(XY initPos, int radius = GameData.propRadius) : base(initPos, radius, GameObjType.Gadget) { - this.canMove = false; + this.ReSetCanMove(false); this.MoveSpeed = GameData.propMoveSpeed; } } diff --git a/logic/GameClass/GameObj/Prop/Item.cs b/logic/GameClass/GameObj/Prop/Item.cs index b4d3ea0..4ddb9b2 100644 --- a/logic/GameClass/GameObj/Prop/Item.cs +++ b/logic/GameClass/GameObj/Prop/Item.cs @@ -17,7 +17,7 @@ namespace GameClass.GameObj public Item(XY initPos, int radius = GameData.propRadius) : base(initPos, radius, GameObjType.Item) { - this.canMove = false; + this.ReSetCanMove(false); this.MoveSpeed = 0; } } diff --git a/logic/GameEngine/MoveEngine.cs b/logic/GameEngine/MoveEngine.cs index c94d3cd..c3f0d45 100644 --- a/logic/GameEngine/MoveEngine.cs +++ b/logic/GameEngine/MoveEngine.cs @@ -102,7 +102,7 @@ namespace GameEngine lock (obj.ActionLock) { if (!obj.IsAvailableForMove) { EndMove(obj); return; } - obj.IsMoving = 1; + obj.IsMoving = true; } new Thread @@ -139,7 +139,7 @@ namespace GameEngine if (isEnded) { - obj.IsMoving = 0; + obj.IsMoving = false; EndMove(obj); return; } @@ -184,7 +184,7 @@ namespace GameEngine } if (isEnded) { - obj.IsMoving = 0; + obj.IsMoving = false; EndMove(obj); return; } @@ -224,7 +224,7 @@ namespace GameEngine } } while (flag); } - obj.IsMoving = 0; // 结束移动 + obj.IsMoving = false; // 结束移动 EndMove(obj); } } diff --git a/logic/Preparation/Interface/IMoveable.cs b/logic/Preparation/Interface/IMoveable.cs index e33c1fb..ad87c31 100644 --- a/logic/Preparation/Interface/IMoveable.cs +++ b/logic/Preparation/Interface/IMoveable.cs @@ -8,7 +8,7 @@ namespace Preparation.Interface { object ActionLock { get; } public int MoveSpeed { get; } - public int IsMoving { get; set; } + public bool IsMoving { get; set; } public bool IsRemoved { get; } public bool IsAvailableForMove { get; } public long StateNum { get; } From 66f127992923df8289008356030ea478a17c01c4 Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Sat, 20 May 2023 01:08:29 +0800 Subject: [PATCH 8/9] =?UTF-8?q?docs:=20:memo:=20edit=20=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E6=9C=BA=E5=88=B6=E4=B8=8E=E5=B9=B3=E8=A1=A1=E6=80=A7=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=9B=B4=E6=96=B0=E8=8D=89=E6=A1=88.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/游戏机制与平衡性调整更新草案.md | 3 ++- logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/游戏机制与平衡性调整更新草案.md b/docs/游戏机制与平衡性调整更新草案.md index db29155..2d53e33 100644 --- a/docs/游戏机制与平衡性调整更新草案.md +++ b/docs/游戏机制与平衡性调整更新草案.md @@ -22,6 +22,7 @@ v1.6 - 增强为“可以攻击未写完的作业” - 增强为“可以攻击使门被打开(可以重新被锁上)” - 小炸弹JumpyDumpty + - 攻击距离改为1600 - 小炸弹不受道具增益影响 - 修改为“小炸弹与自己无碰撞体积” - strike(新增) @@ -31,7 +32,7 @@ v1.6 | 攻击(子弹)类型 |搞蛋鬼的一般攻击CommonAttackOfTricker|飞刀FlyingKnife | 蹦蹦炸弹BombBomb | 小炸弹JumpyDumpty | strike | | :--------------------- | :---------------------| :--------------------- | :--------------------- | :--------------------- | :--------------------- | | 子弹爆炸范围 | 0 | 0 | 2000 | 1000 | 0 | -| 子弹攻击距离 | 2200 | 78000 | 2200 | 4400 | 2000 | +| 子弹攻击距离 | 2200 | 78000 | 2200 | 1600 | 2000 | | 攻击力 | 1500000 | 1200000 | 1800000 | 900000 | 1600000 | | 移动速度/s | 7400 | 18500 | 6000 | 8600 | 6250 | | 前摇(ms) | 297 | 600 | 366 | - | 320 | diff --git a/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs b/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs index 72a0ee7..9aa78ce 100644 --- a/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs +++ b/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs @@ -165,7 +165,7 @@ namespace GameClass.GameObj ap = (int)(GameData.basicApOfGhost * 0.6); } public override double BulletBombRange => GameData.basicBulletBombRange / 2; - public override double AttackDistance => GameData.basicAttackShortRange * 2; + public override double AttackDistance => GameData.basicAttackShortRange * 16 / 22; public override int Speed => (int)(GameData.basicBulletMoveSpeed * 43 / 37); public override bool IsRemoteAttack => false; From 9b733817404d53499a5957c14b4985859c3e927e Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Sat, 20 May 2023 01:18:56 +0800 Subject: [PATCH 9/9] docs: :memo: edit constants.h --- CAPI/cpp/API/include/constants.h | 2 +- CAPI/python/PyAPI/constants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index f67555a..f2689bf 100644 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -368,7 +368,7 @@ namespace Constants struct JumpyDumpty { SCCI double BulletBombRange = basicBulletBombRange / 2; - SCCI double BulletAttackRange = basicRemoteAttackRange * 2; + SCCI double BulletAttackRange = basicAttackShortRange * 16 / 22; SCCI int ap = (int)(basicApOfTricker * 0.6); SCCI int Speed = basicBulletMoveSpeed * 43 / 37; SCCI bool IsRemoteAttack = false; diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index 2b33365..ddd7cb2 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -349,7 +349,7 @@ class BombBomb: class JumpyDumpty: BulletBombRange = Constants.basicBulletBombRange // 2 - BulletAttackRange = Constants.basicRemoteAttackRange * 2 + BulletAttackRange = Constants.basicAttackShortRange * 16 / 22 ap = (int)(Constants.basicApOfTricker * 0.6) Speed = Constants.basicBulletMoveSpeed * 43 // 37 IsRemoteAttack = False