diff --git a/CAPI/cpp/API/include/constants.h b/CAPI/cpp/API/include/constants.h index 1bf0cd6..19b8331 100644 --- a/CAPI/cpp/API/include/constants.h +++ b/CAPI/cpp/API/include/constants.h @@ -303,5 +303,59 @@ namespace Constants SCCI int skillCD = commonSkillCD * 1; SCCI int durationTime = commonSkillTime * 0; }; + + struct CommonAttackOfTricker + { + SCCI double BulletBombRange = 0; + SCCI double BulletAttackRange = basicAttackShortRange; + SCCI int ap = basicApOfTricker; + SCCI int Speed = basicBulletMoveSpeed; + SCCI bool IsRemoteAttack = false; + + SCCI int CastTime = (int)BulletAttackRange * 1000 / Speed; + SCCI int Backswing =basicBackswing; + SCCI int RecoveryFromHit =basicRecoveryFromHit; + SCCI int cd = basicBackswing; + SCCI int maxBulletNum = 1; + }; + + struct FlyingKnife + { + SCCI double BulletBombRange = 0; + SCCI double BulletAttackRange = basicRemoteAttackRange * 13; + SCCI int ap = basicApOfTricker* 4 / 5; + SCCI int Speed = basicBulletMoveSpeed* 25 / 10; + SCCI bool IsRemoteAttack = true; + + SCCI int CastTime = basicCastTime * 4 / 5; + SCCI int Backswing =0; + SCCI int RecoveryFromHit =0; + SCCI int cd = basicBackswing / 2; + SCCI int maxBulletNum = 1; + }; + + struct BombBomb + { + SCCI double BulletBombRange = basicBulletBombRange; + SCCI double BulletAttackRange = basicAttackShortRange; + SCCI int ap = basicApOfTricker * 6 / 5; + SCCI int Speed = basicBulletMoveSpeed* 30 / 37; + SCCI bool IsRemoteAttack = false; + + SCCI int CastTime = (int)BulletAttackRange * 1000 / Speed; + SCCI int Backswing =basicRecoveryFromHit; + SCCI int RecoveryFromHit =basicRecoveryFromHit; + SCCI int cd = basicCD; + SCCI int maxBulletNum = 1; + }; + + struct JumpyDumpty + { + SCCI double BulletBombRange = basicBulletBombRange / 2; + SCCI double BulletAttackRange = basicRemoteAttackRange * 2; + SCCI int ap = (int)(basicApOfTricker* 0.6); + SCCI int Speed = basicBulletMoveSpeed* 43 / 37; + SCCI bool IsRemoteAttack = false; + }; } // namespace Constants #endif diff --git a/CAPI/cpp/API/src/AI.cpp b/CAPI/cpp/API/src/AI.cpp index c37b914..19b8208 100644 --- a/CAPI/cpp/API/src/AI.cpp +++ b/CAPI/cpp/API/src/AI.cpp @@ -20,7 +20,7 @@ extern const THUAI6::TrickerType trickerType = THUAI6::TrickerType::Assassin; // 可以在AI.cpp内部声明变量与函数 -void AI::play(IStudentAPI& api) +void AI::play(IStudentAPI& api)//每帧执行一次AI::play(IStudentAPI& api)或AI::play(ITrickerAPI& api)(除非执行该函数超过一帧50ms),获取的信息都是这一帧的开始的状态 { // 公共操作 if (this->playerID == 0) diff --git a/CAPI/python/PyAPI/AI.py b/CAPI/python/PyAPI/AI.py index efa1a1a..09af335 100644 --- a/CAPI/python/PyAPI/AI.py +++ b/CAPI/python/PyAPI/AI.py @@ -41,7 +41,7 @@ class AssistFunction: class AI(IAI): def __init__(self, pID: int): self.__playerID = pID - + # 每帧执行一次StudentPlay或TrickerPlay(除非执行该函数超过一帧50ms),获取的信息都是这一帧的开始的状态 def StudentPlay(self, api: IStudentAPI) -> None: # 公共操作 if self.__playerID == 0: diff --git a/CAPI/python/PyAPI/constants.py b/CAPI/python/PyAPI/constants.py index 9426e73..eadf4b8 100644 --- a/CAPI/python/PyAPI/constants.py +++ b/CAPI/python/PyAPI/constants.py @@ -51,22 +51,22 @@ class Constants(NoInstance): # 攻击相关 - basicApOfTricker = 1500000 - basicCD = 3000 # 初始子弹冷却 - basicCastTime = 500 # 基本前摇时间 - basicBackswing = 800 # 基本后摇时间 - basicRecoveryFromHit = 3700 # 基本命中攻击恢复时长 + Constants.basicApOfTricker = 1500000 + Constants.basicCD = 3000 # 初始子弹冷却 + Constants.basicCastTime = 500 # 基本前摇时间 + Constants.basicBackswing = 800 # 基本后摇时间 + Constants.basicRecoveryFromHit = 3700 # 基本命中攻击恢复时长 basicStunnedTimeOfStudent = 4300 - basicBulletmoveSpeed = 7400 # 基本子弹移动速度 - basicRemoteAttackRange = 6000 # 基本远程攻击范围 - basicAttackShortRange = 2200 # 基本近程攻击范围 - basicBulletBombRange = 2000 # 基本子弹爆炸范围 + Constants.basicBulletMoveSpeed = 7400 # 基本子弹移动速度 + Constants.basicRemoteAttackRange = 6000 # 基本远程攻击范围 + Constants.basicAttackShortRange = 2200 # 基本近程攻击范围 + Constants.basicBulletBombRange = 2000 # 基本子弹爆炸范围 # 道具相关 - apPropAdd = basicApOfTricker * 12 / 10 - apSpearAdd = basicApOfTricker * 6 / 10 + apPropAdd = Constants.basicApOfTricker * 12 / 10 + apSpearAdd = Constants.basicApOfTricker * 6 / 10 # 技能相关 maxNumOfSkill = 3 @@ -298,3 +298,46 @@ class WriteAnswers: class SummonGolem: skillCD = (int)(1.0 * Constants.commonSkillCD) durationTime = (int)(0.0 * Constants.commonSkillTime) + +class CommonAttackOfTricker: + BulletBombRange = 0 + BulletAttackRange = Constants.Constants.basicAttackShortRange + ap = Constants.basicApOfTricker + Speed = Constants.basicBulletMoveSpeed + IsRemoteAttack = False + CastTime = BulletAttackRange * 1000 / Speed + Backswing =Constants.basicBackswing + RecoveryFromHit =Constants.basicRecoveryFromHit + cd = Constants.basicBackswing + maxBulletNum = 1 + +class FlyingKnife: + BulletBombRange = 0 + BulletAttackRange = Constants.basicRemoteAttackRange * 13 + ap = Constants.basicApOfTricker* 4 / 5 + Speed = Constants.basicBulletMoveSpeed* 25 / 10 + IsRemoteAttack = True + CastTime = Constants.basicCastTime * 4 / 5 + Backswing =0 + RecoveryFromHit =0 + cd = Constants.basicBackswing / 2 + maxBulletNum = 1 + +class BombBomb: + BulletBombRange = Constants.basicBulletBombRange + BulletAttackRange = Constants.basicAttackShortRange + ap = Constants.basicApOfTricker * 6 / 5 + Speed = Constants.basicBulletMoveSpeed* 30 / 37 + IsRemoteAttack = False + CastTime = BulletAttackRange * 1000 / Speed + Backswing =Constants.basicRecoveryFromHit + RecoveryFromHit =Constants.basicRecoveryFromHit + cd = Constants.basicCD + maxBulletNum = 1 + +class JumpyDumpty: + BulletBombRange = Constants.basicBulletBombRange / 2 + BulletAttackRange = Constants.basicRemoteAttackRange * 2 + ap = (int)(Constants.basicApOfTricker* 0.6) + Speed = Constants.basicBulletMoveSpeed* 43 / 37 + IsRemoteAttack = False \ No newline at end of file diff --git a/docs/GameRules.md b/docs/GameRules.md index 464632f..c88870f 100644 --- a/docs/GameRules.md +++ b/docs/GameRules.md @@ -1,5 +1,5 @@ # 规则 -V5.4 +V5.5 - [规则](#规则) - [简则](#简则) - [地图](#地图) @@ -89,10 +89,10 @@ $$ 8. 翻窗 Climbing ### 攻击 -- 攻击类型CommonAttackOfGhost攻击未写完的作业,会造成对应攻击力的损坏 +- 攻击类型CommonAttackOfTricker攻击未写完的作业,会造成对应攻击力的损坏 - 捣蛋鬼攻击交互状态或前后摇的学生,将使学生眩晕4.3s -| 攻击(子弹)类型 |搞蛋鬼的一般攻击CommonAttackOfGhost| 飞刀FlyingKnife | 蹦蹦炸弹BombBomb | 小炸弹JumpyDumpty | +| 攻击(子弹)类型 |搞蛋鬼的一般攻击CommonAttackOfTricker| 飞刀FlyingKnife | 蹦蹦炸弹BombBomb | 小炸弹JumpyDumpty | | :------------ | :--------------------- | :--------------------- | :--------------------- | :--------------------- | | 子弹爆炸范围 | 0 | 0 | 2000 | 1000 | | 子弹攻击距离 | 2200 | 78000 | 2200 | 4400 | @@ -199,7 +199,7 @@ $$ | 翻箱速度/ms | 1000 | 1100 | 1000 |1000| #### Assassin -- 普通攻击为 CommonAttackOfGhost +- 普通攻击为 CommonAttackOfTricker - 主动技能 0. 隐身 BecomeInvisible - CD:40s 持续时间:10s @@ -211,7 +211,7 @@ $$ - 不直接得分 #### Klee -- 普通攻击为 CommonAttackOfGhost +- 普通攻击为 CommonAttackOfTricker - 主动技能 0. 蹦蹦炸弹 JumpyBomb - CD:15s 持续时间:3s @@ -221,7 +221,7 @@ $$ - 不直接得分,通过眩晕等获得对应得分 #### 喧哗者ANoisyPerson -- 普通攻击为 CommonAttackOfGhost +- 普通攻击为 CommonAttackOfTricker - 主动技能 0. 嚎叫 Howl - CD:25s @@ -231,7 +231,7 @@ $$ - 在场所有学生Bgm系统被设为无用的值 #### Idol -- 普通攻击为 CommonAttackOfGhost +- 普通攻击为 CommonAttackOfTricker - 主动技能 0. ShowTime - CD: 80s 持续时间:10s diff --git a/docs/QandA.md b/docs/QandA.md index 1ccc5c8..ae141da 100644 --- a/docs/QandA.md +++ b/docs/QandA.md @@ -18,6 +18,9 @@ Q: 怎么修改.cmd参数? A: 见选手包中的使用文档部分 +Q:卡死在第一帧不动 + +A:大概率是你的代码死循环了 Q: 怎么开始游戏? diff --git a/docs/使用文档.md b/docs/使用文档.md index 2f1205e..9edc8ae 100644 --- a/docs/使用文档.md +++ b/docs/使用文档.md @@ -17,6 +17,7 @@ - Linux:首先自行安装`gRPC`,具体方法可以参考官方教程https://grpc.io/docs/languages/cpp/quickstart/。 - 然后在`CAPI\cpp\API\src\AI.cpp`中编写代码 - 选手不应当修改`AI.cpp`中原来有的代码,除了`void AI::play(IStudentAPI& api)`和`void AI::play(ITrickerAPI& api)` + - 每帧执行一次`AI::play(IStudentAPI& api)`或`AI::play(ITrickerAPI& api)`(除非执行该函数超过一帧50ms),获取的信息都是这一帧的开始的状态 - 选手可以在`AI.cpp`内`void AI::play`外新增函数和变量 - Windows:然后用Visual Studio打开`CAPI\cpp\CAPI.sln`编译,注意使用Debug模式 - Linux:用`cmake`,对`CAPI\cpp\CMakeLists.txt`进行编译 @@ -28,6 +29,7 @@ - 首先在Python环境下运行`GeneratePythonProto.cmd`,以安装必要的包、并生成对应的grpc python文件 - 然后在`CAPI\python\PyAPI\AI.py`中编写代码 - 选手不应当修改`AI.py`中原来有的代码,除了`StudentPlay(self, api: IStudentAPI)`和`TrickerPlay(self, api: ITrickerAPI)` + - 每帧执行一次`AI::play(IStudentAPI& api)`或`AI::play(ITrickerAPI& api)`(除非执行该函数超过一帧50ms),获取的信息都是这一帧的开始的状态 - 选手可以在`AI.py`内新增函数和变量 - Windows:最后通过运行`RunPython.cmd`执行比赛代码 - Linux:通过运行`RunPython.sh`执行比赛代码