From 2d18b381beb6d2c9747055fbefc75ff36af364eb Mon Sep 17 00:00:00 2001 From: shangfengh <3495281661@qq.com> Date: Wed, 12 Apr 2023 10:58:04 +0800 Subject: [PATCH] refactor: :bug: change the double of constants into int --- CAPI/cpp/API/include/constants.h | 230 +++++++++++++------------- CAPI/python/PyAPI/constants.py | 7 +- logic/Gaming/ActionManager.cs | 1 - logic/Preparation/Interface/ISkill.cs | 2 +- 4 files changed, 117 insertions(+), 123 deletions(-) diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 3ac4e1f..bafde1c 100644 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -40,7 +40,7 @@ namespace Constants SCCI int basicStudentSpeed = 1270; SCCI int basicTrickerSpeed = 1504; - SCCI double basicConcealment = 1.0; + SCCI double basicConcealment = 1; SCCI int basicStudentAlertnessRadius = 15 * numOfGridPerCell; SCCI int basicTrickerAlertnessRadius = 17 * numOfGridPerCell; SCCI int basicStudentViewRange = 10 * numOfGridPerCell; @@ -71,136 +71,136 @@ namespace Constants // 职业相关 struct Assassin { - SCCI double moveSpeed = basicTrickerSpeed * 1.1; + SCCI int moveSpeed = basicTrickerSpeed * 11 / 10; SCCI double concealment = 1.5; - SCCI double alertnessRadius = basicTrickerAlertnessRadius * 1.3; - SCCI double viewRange = basicTrickerViewRange * 1.2; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows * 1.0; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int alertnessRadius = basicTrickerAlertnessRadius * 13 / 10; + SCCI int viewRange = basicTrickerViewRange * 12 / 10; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct Klee { - SCCI double moveSpeed = basicTrickerSpeed * 1.0; - SCCI double concealment = 1.0; - SCCI double alertnessRadius = basicTrickerAlertnessRadius * 1.0; - SCCI double viewRange = basicTrickerViewRange * 1.0; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows * 1.0; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.1; + SCCI int moveSpeed = basicTrickerSpeed; + SCCI double concealment = 1; + SCCI int alertnessRadius = basicTrickerAlertnessRadius; + SCCI int viewRange = basicTrickerViewRange; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest * 11 / 10; }; struct ANoisyPerson { - SCCI double moveSpeed = basicTrickerSpeed * 1.07; + SCCI int moveSpeed = (int)(basicTrickerSpeed * 1.07); SCCI double concealment = 0.8; - SCCI double alertnessRadius = basicTrickerAlertnessRadius * 0.9; - SCCI double viewRange = basicTrickerViewRange * 1.0; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows * 1.1; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.1; + SCCI int alertnessRadius = basicTrickerAlertnessRadius * 9 / 10; + SCCI int viewRange = basicTrickerViewRange; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows * 11 / 10; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest * 11 / 10; }; struct Idol { - SCCI double moveSpeed = basicTrickerSpeed * 1.0; + SCCI int moveSpeed = basicTrickerSpeed; SCCI double concealment = 0.75; - SCCI double alertnessRadius = basicTrickerAlertnessRadius * 1.0; - SCCI double viewRange = basicTrickerViewRange * 1.1; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows * 1.0; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int alertnessRadius = basicTrickerAlertnessRadius; + SCCI int viewRange = basicTrickerViewRange * 11 / 10; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicTrickerSpeedOfClimbingThroughWindows; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct Athlete { - SCCI double moveSpeed = basicStudentSpeed * 1.1; - SCCI double maxHp = basicHp * 1.0; - SCCI double maxAddiction = basicMaxGamingAddiction * 0.9; - SCCI double fixSpeed = basicFixSpeed * 0.6; - SCCI double treatSpeed = basicTreatSpeed * 0.8; + SCCI int moveSpeed = basicStudentSpeed * 11 / 10; + SCCI int maxHp = basicHp; + SCCI int maxAddiction = basicMaxGamingAddiction * 9 / 10; + SCCI int fixSpeed = basicFixSpeed * 6 / 10; + SCCI int treatSpeed = basicTreatSpeed * 8 / 10; SCCI double concealment = 0.9; - SCCI double alertnessRadius = basicStudentAlertnessRadius * 1.0; - SCCI double viewRange = basicStudentViewRange * 1.1; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 1.2; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int alertnessRadius = basicStudentAlertnessRadius; + SCCI int viewRange = basicStudentViewRange * 11 / 10; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 12 / 10; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct Teacher { - SCCI double moveSpeed = basicStudentSpeed * 0.75; - SCCI double maxHp = basicHp * 10.0; - SCCI double maxAddiction = basicMaxGamingAddiction * 10.0; - SCCI double fixSpeed = basicFixSpeed * 0.0; - SCCI double treatSpeed = basicTreatSpeed * 0.7; + SCCI int moveSpeed = basicStudentSpeed * 3 / 4; + SCCI int maxHp = basicHp * 10; + SCCI int maxAddiction = basicMaxGamingAddiction * 10; + SCCI int fixSpeed = basicFixSpeed * 0; + SCCI int treatSpeed = basicTreatSpeed * 7 / 10; SCCI double concealment = 0.5; - SCCI double alertnessRadius = basicStudentAlertnessRadius * 0.5; - SCCI double viewRange = basicStudentViewRange * 0.9; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 0.5; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int alertnessRadius = basicStudentAlertnessRadius / 2; + SCCI int viewRange = basicStudentViewRange * 9 / 10; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows / 2; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct StraightAStudent { - SCCI double moveSpeed = basicStudentSpeed * 0.8; - SCCI double maxHp = basicHp * 1.1; - SCCI double maxAddiction = basicMaxGamingAddiction * 1.3; - SCCI double fixSpeed = basicFixSpeed * 1.1; - SCCI double treatSpeed = basicTreatSpeed * 0.8; + SCCI int moveSpeed = basicStudentSpeed * 8 / 10; + SCCI int maxHp = basicHp * 11 / 10; + SCCI int maxAddiction = basicMaxGamingAddiction * 13 / 10; + SCCI int fixSpeed = basicFixSpeed * 11 / 10; + SCCI int treatSpeed = basicTreatSpeed * 8 / 10; SCCI double concealment = 0.9; - SCCI double alertnessRadius = basicStudentAlertnessRadius * 0.9; - SCCI double viewRange = basicStudentViewRange * 0.9; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 0.83333; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int alertnessRadius = basicStudentAlertnessRadius * 9 / 10; + SCCI int viewRange = basicStudentViewRange * 9 / 10; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 10 / 12; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct Robot { - SCCI double moveSpeed = basicStudentSpeed * 1.0; - SCCI double maxHp = basicHp * 0.4; - SCCI double maxAddiction = basicMaxGamingAddiction * 0.0; - SCCI double fixSpeed = basicFixSpeed * 1.0; - SCCI double treatSpeed = basicTreatSpeed * 0.8; - SCCI double concealment = 1.0; - SCCI double alertnessRadius = basicStudentAlertnessRadius * 1; - SCCI double viewRange = basicStudentViewRange * 1.0; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 0.0016; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int moveSpeed = basicStudentSpeed; + SCCI int maxHp = basicHp * 0.4; + SCCI int maxAddiction = basicMaxGamingAddiction * 0; + SCCI int fixSpeed = basicFixSpeed; + SCCI int treatSpeed = basicTreatSpeed * 8 / 10; + SCCI double concealment = 1; + SCCI int alertnessRadius = basicStudentAlertnessRadius * 1; + SCCI int viewRange = basicStudentViewRange; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = 1; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; struct TechOtaku { - SCCI double moveSpeed = basicStudentSpeed * 0.75; - SCCI double maxHp = basicHp * 0.9; - SCCI double maxAddiction = basicMaxGamingAddiction * 1.1; - SCCI double fixSpeed = basicFixSpeed * 1.1; - SCCI double treatSpeed = basicTreatSpeed * 0.9; - SCCI double concealment = 1.0; - SCCI double alertnessRadius = basicStudentAlertnessRadius; - SCCI double viewRange = basicStudentViewRange * 0.9; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 0.75; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int moveSpeed = basicStudentSpeed * 3 / 4; + SCCI int maxHp = basicHp * 9 / 10; + SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10; + SCCI int fixSpeed = basicFixSpeed * 11 / 10; + SCCI int treatSpeed = basicTreatSpeed * 9 / 10; + SCCI double concealment = 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; }; struct Sunshine { - SCCI double moveSpeed = basicStudentSpeed * 1.0; - SCCI double maxHp = basicHp * 1.0667; - SCCI double maxAddiction = basicMaxGamingAddiction * 1.1; - SCCI double fixSpeed = basicFixSpeed * 1.0; - SCCI double treatSpeed = basicTreatSpeed * 2.0; - SCCI double concealment = 1.0; - SCCI double alertnessRadius = basicStudentAlertnessRadius * 1.0; - SCCI double viewRange = basicStudentViewRange * 1.0; - SCCI double speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking * 1.0; - SCCI double speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows * 1.0; - SCCI double speedOfOpenChest = basicSpeedOfOpenChest * 1.0; + SCCI int moveSpeed = basicStudentSpeed; + SCCI int maxHp = basicHp * 32 / 30; + SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10; + SCCI int fixSpeed = basicFixSpeed; + SCCI int treatSpeed = basicTreatSpeed * 2; + SCCI double concealment = 1; + SCCI int alertnessRadius = basicStudentAlertnessRadius; + SCCI int viewRange = basicStudentViewRange; + SCCI int speedOfOpeningOrLocking = basicSpeedOfOpeningOrLocking; + SCCI int speedOfClimbingThroughWindows = basicStudentSpeedOfClimbingThroughWindows; + SCCI int speedOfOpenChest = basicSpeedOfOpenChest; }; // 技能相关 @@ -222,80 +222,80 @@ namespace Constants SCCI int timeOfAddingSpeedWhenInspire = 6000; struct CanBeginToCharge { - SCCI double skillCD = 4 / 3; - SCCI double durationTime = 1; + SCCI int skillCD = commonSkillCD * 4 / 3; + SCCI int durationTime = commonSkillTime * 1; }; struct BecomeInvisible { - SCCI double skillCD = 2.0; - SCCI double durationTime = 0.6; + SCCI int skillCD = commonSkillCD * 2; + SCCI int durationTime = commonSkillTime * 6 / 10; }; struct Punish { - SCCI double skillCD = 1.0; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 1; + SCCI int durationTime = commonSkillTime * 0; }; struct Rouse { - SCCI double skillCD = 2.0; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 2; + SCCI int durationTime = commonSkillTime * 0; }; struct Encourage { - SCCI double skillCD = 2.0; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 2; + SCCI int durationTime = commonSkillTime * 0; }; struct Inspire { - SCCI double skillCD = 2.0; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 2; + SCCI int durationTime = commonSkillTime * 0; }; struct Howl { - SCCI double skillCD = 0.8333; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 25 / 30; + SCCI int durationTime = commonSkillTime * 0; }; struct ShowTime { - SCCI double skillCD = 3.0; - SCCI double durationTime = 1.0; + SCCI int skillCD = commonSkillCD * 3; + SCCI int durationTime = commonSkillTime * 1; }; struct JumpyBomb { - SCCI double skillCD = 0.5; - SCCI double durationTime = 0.3; + SCCI int skillCD = commonSkillCD / 2; + SCCI int durationTime = commonSkillTime * 3 / 10; }; struct UseKnife { - SCCI double skillCD = 1.0; - SCCI double durationTime = 0.1; + SCCI int skillCD = commonSkillCD * 1; + SCCI int durationTime = commonSkillTime / 10; }; struct UseRobot { - SCCI double skillCD = 0.0017; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD / 300; + SCCI int durationTime = commonSkillTime * 0; }; struct WriteAnswers { - SCCI double skillCD = 1.0; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 1; + SCCI int durationTime = commonSkillTime * 0; }; struct SummonGolem { - SCCI double skillCD = 1.0; - SCCI double durationTime = 0.0; + SCCI int skillCD = commonSkillCD * 1; + SCCI int durationTime = commonSkillTime * 0; }; } // namespace Constants #endif diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index ded61af..ec0c9ac 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -29,16 +29,12 @@ class Constants(NoInstance): basicHp = 3000000 basicMaxGamingAddiction = 60000 - BeginGamingAddiction = 20900 - MidGamingAddiction = 40300 basicEncouragementDegree = 1500000 basicTimeOfRouse = 1000 basicStudentSpeed = 1270 basicTrickerSpeed = 1504 - maxSpeed = 12000 - basicConcealment = 1.0 basicStudentAlertnessRadius = 15 * numOfGridPerCell basicTrickerAlertnessRadius = 17 * numOfGridPerCell @@ -46,7 +42,7 @@ class Constants(NoInstance): basicTrickerViewRange = 15 * numOfGridPerCell PinningDownRange = 5 * numOfPosGridPerCell - maxNumOfProp = 3 + maxNumOfProp = 3 # 人物道具栏容量 # 攻击相关 @@ -66,7 +62,6 @@ class Constants(NoInstance): apPropAdd = basicApOfTricker * 12 / 10 apSpearAdd = basicApOfTricker * 6 / 10 - remainHpWhenAddLife = 100 class Assassin: moveSpeed = 1.1*basicTrickerSpeed diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 5c6e5d8..54b29eb 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -382,7 +382,6 @@ namespace Gaming loopToDo: () => { flag = ((gameMap.PartInTheSameCell(doorToLock.Position, GameObjType.Character)) == null); - Preparation.Utility.Debugger.Output(doorToLock, flag.ToString()); doorToLock.OpenOrLockDegree += GameData.frameDuration * player.SpeedOfOpeningOrLocking; }, timeInterval: GameData.frameDuration, diff --git a/logic/Preparation/Interface/ISkill.cs b/logic/Preparation/Interface/ISkill.cs index 50a6082..2491d48 100644 --- a/logic/Preparation/Interface/ISkill.cs +++ b/logic/Preparation/Interface/ISkill.cs @@ -166,7 +166,7 @@ namespace Preparation.Interface public class UseRobot : IActiveSkill { - public int SkillCD => GameData.frameDuration; + public int SkillCD => GameData.commonSkillCD / 300; public int DurationTime => 0; private readonly object commonSkillLock = new object(); public object ActiveSkillLock => commonSkillLock;