diff --git a/CAPI/cpp/API/include/API.h b/CAPI/cpp/API/include/API.h index 7416f622..f5811e6b 100755 --- a/CAPI/cpp/API/include/API.h +++ b/CAPI/cpp/API/include/API.h @@ -80,7 +80,7 @@ class IAPI public: // 选手可执行的操作,应当保证所有函数的返回值都应当为std::future,例如下面的移动函数: // 指挥本角色进行移动,`timeInMilliseconds` 为移动时间,单位为毫秒;`angleInRadian` 表示移动的方向,单位是弧度,使用极坐标——竖直向下方向为 x 轴,水平向右方向为 y 轴 - // 发送信息、接受信息,注意收消息时无消息则返回nullopt + // 发送信息、接受信息,注意收消息时无消息则返回(-1,"") virtual std::future SendTextMessage(int32_t toPlayerID, std::string) = 0; virtual std::future SendBinaryMessage(int32_t toPlayerID, std::string) = 0; [[nodiscard]] virtual bool HaveMessage() = 0; diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index a01d5f99..a535aee9 100755 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -26,12 +26,12 @@ namespace Constants struct Home { SCCI int32_t maxHp = 24000; - SCCI int32_t energySpeed = 1; + SCCI int32_t energySpeed = 100; }; struct Factory { SCCI int32_t maxHp = 8000; - SCCI int32_t energySpeed = 3; + SCCI int32_t energySpeed = 300; }; struct Community { @@ -52,7 +52,7 @@ namespace Constants SCCI int32_t basicArmor = 0; SCCI int32_t basicShield = 0; SCCI int32_t Speed = 3000; - SCCI int32_t Cost = 40; + SCCI int32_t Cost = 4000; }; struct MilitaryShip { @@ -60,7 +60,7 @@ namespace Constants SCCI int32_t basicArmor = 400; SCCI int32_t basicShield = 400; SCCI int32_t Speed = 2800; - SCCI int32_t Cost = 120; + SCCI int32_t Cost = 12000; }; struct FlagShip { @@ -68,53 +68,53 @@ namespace Constants SCCI int32_t basicArmor = 800; SCCI int32_t basicShield = 800; SCCI int32_t Speed = 2700; - SCCI int32_t Cost = 500; + SCCI int32_t Cost = 50000; }; // 模块 struct Producer { - SCCI int32_t energySpeed1 = 5; - SCCI int32_t energySpeed2 = 7; - SCCI int32_t energySpeed3 = 10; + SCCI int32_t energySpeed1 = 100; + SCCI int32_t energySpeed2 = 200; + SCCI int32_t energySpeed3 = 300; SCCI int32_t Cost1 = 0; - SCCI int32_t Cost2 = 40; - SCCI int32_t Cost3 = 80; + SCCI int32_t Cost2 = 4000; + SCCI int32_t Cost3 = 8000; }; struct Constructor { - SCCI int32_t constructSpeed1 = 500; - SCCI int32_t constructSpeed2 = 750; - SCCI int32_t constructSpeed3 = 1000; + SCCI int32_t constructSpeed1 = 300; + SCCI int32_t constructSpeed2 = 400; + SCCI int32_t constructSpeed3 = 500; SCCI int32_t Cost1 = 0; - SCCI int32_t Cost2 = 40; - SCCI int32_t Cost3 = 80; + SCCI int32_t Cost2 = 4000; + SCCI int32_t Cost3 = 8000; }; struct Armor { SCCI int32_t armor1 = 2000; SCCI int32_t armor2 = 3000; SCCI int32_t armor3 = 4000; - SCCI int32_t Cost1 = 60; - SCCI int32_t Cost2 = 120; - SCCI int32_t Cost3 = 180; + SCCI int32_t Cost1 = 6000; + SCCI int32_t Cost2 = 12000; + SCCI int32_t Cost3 = 18000; }; struct Shield { SCCI int32_t shield1 = 2000; SCCI int32_t shield2 = 3000; SCCI int32_t shield3 = 4000; - SCCI int32_t Cost1 = 60; - SCCI int32_t Cost2 = 120; - SCCI int32_t Cost3 = 180; + SCCI int32_t Cost1 = 6000; + SCCI int32_t Cost2 = 12000; + SCCI int32_t Cost3 = 18000; }; struct Weapon { SCCI int32_t LaserCost = 0; - SCCI int32_t PlasmaCost = 120; - SCCI int32_t ShellCost = 130; - SCCI int32_t MissileCost = 180; - SCCI int32_t ArcCost = 240; + SCCI int32_t PlasmaCost = 12000; + SCCI int32_t ShellCost = 13000; + SCCI int32_t MissileCost = 18000; + SCCI int32_t ArcCost = 24000; }; // 子弹 @@ -169,10 +169,5 @@ namespace Constants SCCI int32_t CastTime = 600; // ms SCCI int32_t BackSwing = 600; }; - - // SCCI int32_t basicStudentAlertnessRadius = 15 * numOfGridPerCell; - // SCCI int32_t basicTrickerAlertnessRadius = 17 * numOfGridPerCell; - // SCCI int32_t basicStudentViewRange = 10 * numOfGridPerCell; - // SCCI int32_t basicTrickerViewRange = 13 * numOfGridPerCell; } // namespace Constants #endif diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index 4a08f7ab..e0aaabfc 100755 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -926,7 +926,7 @@ void Logic::Main(CreateAIFunc createAI, std::string IP, std::string port, bool f fileLogger->set_pattern(pattern); printLogger->set_pattern(pattern); if (file) - fileLogger->set_level(spdlog::level::trace); + fileLogger->set_level(spdlog::level::debug); else fileLogger->set_level(spdlog::level::off); if (print) @@ -936,10 +936,8 @@ void Logic::Main(CreateAIFunc createAI, std::string IP, std::string port, bool f if (warnOnly) printLogger->set_level(spdlog::level::warn); logger = std::make_unique("logicLogger", spdlog::sinks_init_list{fileLogger, printLogger}); - // TODO - // logger->flush_on(spdlog::level::warn); - logger->flush_on(spdlog::level::trace); + logger->flush_on(spdlog::level::warn); // 打印当前的调试信息 logger->info("*********Basic Info*********"); logger->info("asynchronous: {}", asynchronous); diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index e767c8f2..d6e5103e 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -11,94 +11,81 @@ class Constants: recycleMultiplier = 0.5 sizeOfShip = 800 - class Home: maxHp = 24000 - energySpeed = 1 - + energySpeed = 100 class Factory: maxHp = 8000 - energySpeed = 3 - + energySpeed = 300 class Community: maxHp = 6000 - class Fort: maxHp = 12000 attackRange = 8000 damage = 1200 - class CivilianShip: Speed = 3000 basicArmor = 0 basicShield = 0 maxHp = 3000 - Cost = 40 - + Cost = 4000 class MilitaryShip: Speed = 2800 basicArmor = 400 basicShield = 400 maxHp = 4000 - Cost = 120 - + Cost = 12000 class FlagShip: Speed = 2700 basicArmor = 800 basicShield = 800 maxHp = 12000 - Cost = 500 - + Cost = 50000 class Producer: - energySpeed1 = 5 - energySpeed2 = 7 - energySpeed3 = 10 + energySpeed1 = 100 + energySpeed2 = 200 + energySpeed3 = 300 Cost1 = 0 - Cost2 = 40 - Cost3 = 80 - + Cost2 = 4000 + Cost3 = 8000 class Constructor: - constructSpeed1 = 500 - constructSpeed2 = 750 - constructSpeed3 = 1000 + constructSpeed1 = 300 + constructSpeed2 = 400 + constructSpeed3 = 500 Cost1 = 0 - Cost2 = 40 - Cost3 = 80 - + Cost2 = 4000 + Cost3 = 8000 class Armor: armor1 = 2000 armor2 = 3000 armor3 = 4000 - Cost1 = 60 - Cost2 = 120 - Cost3 = 180 - + Cost1 = 6000 + Cost2 = 12000 + Cost3 = 18000 class Shield: shield1 = 2000 shield2 = 3000 shield3 = 4000 - Cost1 = 60 - Cost2 = 120 - Cost3 = 180 - + Cost1 = 6000 + Cost2 = 12000 + Cost3 = 18000 class Weapon: LaserCost = 0 - PlasmaCost = 120 - ShellCost = 130 - MissleCost = 180 - ArcCost = 240 - + PlasmaCost = 12000 + ShellCost = 13000 + MissleCost = 18000 + ArcCost = 24000 class Laser: Damage = 1200 @@ -109,17 +96,15 @@ class Laser: CastTime = 300 BackSwing = 300 - class Plasma: Damage = 1300 AttackRange = 4000 - ArmorDamageMultiplier = 2 + ArmorDamageMultiplier = 2.0 ShieldDamageMultiplier = 0.4 Speed = 10000 CastTime = 400 BackSwing = 400 - class Shell: Damage = 1800 AttackRange = 4000 @@ -129,7 +114,6 @@ class Shell: CastTime = 200 BackSwing = 200 - class Missle: Damage = 1600 AttackRange = 8000 @@ -140,7 +124,6 @@ class Missle: CastTime = 600 BackSwing = 600 - class Arc: Damage = 3200 AttackRange = 8000 diff --git a/installer/Model/Logger.cs b/installer/Model/Logger.cs index 17d23282..0ad6008b 100644 --- a/installer/Model/Logger.cs +++ b/installer/Model/Logger.cs @@ -281,11 +281,11 @@ protected override void Log(LogLevel logLevel, int eventId, string message) writer.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}, {eventId}] Warning: {message}"); break; case LogLevel.Error: - writer.WriteLine("\nError happens!"); + writer.WriteLine("\nError occurred!"); writer.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}, {eventId}] Error: {message}\n"); break; case LogLevel.Critical: - writer.WriteLine("\nCritical error happens!"); + writer.WriteLine("\nCritical error occurred!"); writer.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}, {eventId}] Critical: {message}\n"); break; default: @@ -323,11 +323,11 @@ protected override void Log(LogLevel logLevel, string message) writer.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}, ~] Warning: {message}"); break; case LogLevel.Error: - writer.WriteLine("\nError happens!"); + writer.WriteLine("\nError occurred!"); writer.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}, ~] Error: {message}\n"); break; case LogLevel.Critical: - writer.WriteLine("\nCritical error happens!"); + writer.WriteLine("\nCritical error occurred!"); writer.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}, ~] Critical: {message}\n"); break; default: