std::future<bool> Move(int64_t timeInMilliseconds, double angleInRadian):移动,timeInMilliseconds 为移动时间,单位毫秒;angleInRadian 表示移动方向,单位弧度,使用极坐标,竖直向下方向为x轴,水平向右方向为y轴std::future<bool> UseSkill(int32_t skillID):使用对应序号的主动技能std::future<bool> EndAllAction():可以使处在下者八项状态中的玩家终止交互std::future<bool> Attack(double angleInRadian):angleInRadian为攻击方向,无论近战远程均产生bullet表示攻击| 攻击类型 | 搞蛋鬼的一般攻击CommonAttackOfGhost | 飞刀FlyingKnife | 蹦蹦炸弹BombBomb | JumpyDumpty |
|---|---|---|---|---|
| 子弹爆炸范围 | 0 | 0 | 1000 | 500 |
| 子弹攻击距离 | 1100 | 39000 | 1100 | 2200 |
| 攻击力 | 1500000 | 1,200,000 | 1,800,000 | 900000 |
| 移动速度/s | 3700 | 7,400 | 3000 | 4300 |
| 前摇(ms) | 297 | 500 | 366 | 0 |
| 未攻击至目标时的后摇(ms) | 800 | 0 | 3700 | 0 |
| 攻击至目标时的后摇(ms) | 3700 | 0 | 3700 | 0 |
| CD(ms) | 800 | 400 | 3000 | - |
| 最大子弹容量 | 1 | 1 | 1 | - |
std::future<bool> StartLearning():在教室(旁)做作业std::future<bool> StartOpenGate():开启校门,所需时间为18秒,开启的进度不清空std::future<bool> Graduate():从开启的校门或隐藏校门毕业。std::future<bool> StartTreatMate(int64_t mateID):勉励对应玩家ID的学生,当达到被勉励程度达到1500000或者最大学习毅力与当前学习毅力的差值时,勉励完成,学生毅力增加对应被勉励程度。std::future<bool> StartRescueMate(int64_t mateID):唤醒对应玩家ID的沉迷的学生,需要时间1秒,之后学习毅力恢复至1/2。沉迷程度不清空。std::future<bool> OpenDoor():开门std::future<bool> CloseDoor():关门std::future<bool> SkipWindow():翻窗时玩家应当在窗前后左右一个格子内std::future<bool> StartOpenChest():开箱后将有2个随机道具掉落在玩家位置。std::future<bool> SendMessage(int64_t, std::string):给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容。bool HaveMessage():是否有队友发来的尚未接收的信息。std::pair<int64_t, std::string> GetMessage():从玩家ID为第一个参数的队友获取信息。bool Wait():阻塞当前线程,直到下一次消息更新时继续运行。std::vector<std::shared_ptr<const THUAI6::Student>> GetStudents() const :返回所有可视学生的信息。
std::vector<std::shared_ptr<const THUAI6::Tricker>> GetTrickers() const :返回所有可视捣蛋鬼的信息。
std::vector<std::shared_ptr<const THUAI6::Prop>> GetProps() const :返回所有可视道具的信息。
std::vector<std::vector<THUAI6::PlaceType>> GetFullMap() const:返回整张地图的地形信息。
THUAI6::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) :返回某一位置场地种类信息。场地种类详见 structure.h 。
bool IsDoorOpen(int32_t cellX, int32_t cellY) const:查询特定位置门是否开启
int32_t GetChestProgress(int32_t cellX, int32_t cellY) const:查询特定位置箱子开启进度
int32_t GetGateProgress(int32_t cellX, int32_t cellY) const:查询特定位置校门开启进度
int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const:查询特定位置教室作业完成进度
THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const::查询特定位置隐藏校门状态
int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const:查询特定位置门开启状态
std::shared_ptr<const THUAI6::GameInfo> GetGameInfo() const:查询当前游戏状态
std::vector<int64_t> GetPlayerGUIDs() const:获取所有玩家的GUID
int GetFrameCount() const:获取目前所进行的帧数
std::shared_ptr<const THUAI6::Tricker> GetSelfInfo() const或std::shared_ptr<const THUAI6::Student> GetSelfInfo() const:获取自己的信息
bool PickProp(THUAI6::PropType prop)捡起与自己处于同一个格子(cell)的道具。bool UseProp(THUAI6::PropType prop)使用对应类型的道具bool ThrowProp(THUAI6::PropType prop)将对应类型的道具扔在原地| 道具 | 对学生增益 | [学生得分条件] | 对搞蛋鬼增益 | [搞蛋鬼得分条件] |
|---|---|---|---|---|
| Key3 | 能开启3教的门 | 不得分 | 能开启3教的门 | 不得分 |
| Key5 | 能开启5教的门 | 不得分 | 能开启5教的门 | 不得分 |
| Key6 | 能开启6教的门 | 不得分 | 能开启6教的门 | 不得分 |
| AddSpeed | 提高移动速度,持续10s | 得分? | 提高移动速度,持续10s | 得分? |
| AddLifeOrClairaudience | 若在10s内Hp归零,该增益消失以使Hp保留100 | 在10s内Hp归零,得分? | 10秒内下一次攻击增伤1800000 | 10秒内有一次攻击,得分? |
| AddHpOrAp | 回血1500000 | 回血成功 | 10秒内下一次攻击增伤1800000 | 10秒内有一次攻击,得分? |
| ShieldOrSpear | 10秒内能抵挡一次伤害 | 10秒内成功抵挡一次伤害 | 10秒内下一次攻击能破盾,如果对方无盾,则增伤900000 | 10秒内攻击中学生 |
| RecoveryFromDizziness | 使用瞬间从眩晕状态中恢复 | 成功从眩晕状态中恢复,得分? | 使用瞬间从眩晕状态中恢复 | 成功从眩晕状态中恢复,得分? |
| 捣蛋鬼职业 | 基本量 | Assassin | Klee | 喧哗者ANoisyPerson |
|---|---|---|---|---|
| 移动速度/s | 1,503 | 1.1 | 1 | 1.07 |
| 隐蔽度 | 1.0 | 1.5 | 1 | 0.8 |
| 警戒范围 | 17000 | 1.3 | 1 | 0.9 |
| 视野范围 | 15000 | 1.2 | 1 | 1 |
| 开锁门速度 | 4000 | 1 | 1 | 1 |
| 翻窗速度 | 1270 | 1 | 1 | 1.1 |
| 翻箱速度 | 1000 | 1 | 1.1 | 1 |
| 学生职业 | 基本量 | 教师Teacher | 健身狂Athlete | 学霸StraightAStudent | 开心果Sunshine |
|---|---|---|---|---|---|
| 移动速度 | 1,270 | 3 / 4 | 1.1 | 0.8 | 1 |
| 最大毅力值 | 3000000 | 10 | 1 | 1.1 | 32/30 |
| 最大沉迷度 | 60000 | 10 | 0.9 | 1.3 | 1.1 |
| 学习一科速度/s | 1.23% | 0 | 0.6 | 1.1 | 1 |
| 勉励速度 | 100 | 0.7 | 0.8 | 0.8 | 2 |
| 隐蔽度 | 1.0 | 0.5 | 0.9 | 0.9 | 1 |
| 警戒范围 | 15000 | 0.5 | 1 | 0.9 | 1 |
| 视野范围 | 10000 | 0.9 | 1.1 | 0.9 | 1 |
| 开锁门速度 | 4000 | 1 | 1 | 1 | 1 |
| 翻窗速度 | 1270 | 0.5 | 1.2 | 10/12 | 1 |
| 翻箱速度 | 1000 | 1 | 1 | 1 | 1 |
static inline int CellToGrid(int cell) noexcept:将地图格数 cell 转换为绝对坐标grid。
static inline int GridToCell(int grid) noexcept:将绝对坐标 grid 转换为地图格数cell。
下面为用于DEBUG的输出函数,选手仅在开启Debug模式的情况下可以使用
void Print(std::string str) const;
void PrintStudent() const;
void PrintTricker() const;
void PrintProp() const;
void PrintSelfInfo() const;
// 指挥本角色进行移动,`timeInMilliseconds` 为移动时间,单位为毫秒;`angleInRadian` 表示移动的方向,单位是弧度,使用极坐标——竖直向下方向为 x 轴,水平向右方向为 y 轴
virtual std::future<bool> Move(int64_t timeInMilliseconds, double angleInRadian) = 0;
// 向特定方向移动
virtual std::future<bool> MoveRight(int64_t timeInMilliseconds) = 0;
virtual std::future<bool> MoveUp(int64_t timeInMilliseconds) = 0;
virtual std::future<bool> MoveLeft(int64_t timeInMilliseconds) = 0;
virtual std::future<bool> MoveDown(int64_t timeInMilliseconds) = 0;
// 捡道具、使用技能
virtual std::future<bool> PickProp(THUAI6::PropType prop) = 0;
virtual std::future<bool> UseProp(THUAI6::PropType prop) = 0;
virtual std::future<bool> UseSkill(int32_t skillID) = 0;
virtual std::future<bool> Attack(double angleInRadian) = 0;
virtual std::future<bool> OpenDoor() = 0;
virtual std::future<bool> CloseDoor() = 0;
virtual std::future<bool> SkipWindow() = 0;
virtual std::future<bool> StartOpenGate() = 0;
virtual std::future<bool> StartOpenChest() = 0;
virtual std::future<bool> EndAllAction() = 0;
// 发送信息、接受信息,注意收消息时无消息则返回nullopt
virtual std::future<bool> SendMessage(int64_t, std::string) = 0;
[[nodiscard]] virtual bool HaveMessage() = 0;
[[nodiscard]] virtual std::pair<int64_t, std::string> GetMessage() = 0;
// 等待下一帧
virtual std::future<bool> Wait() = 0;
// 获取视野内可见的学生/捣蛋鬼的信息
[[nodiscard]] virtual std::vector<std::shared_ptr<const THUAI6::Student>> GetStudents() const = 0;
[[nodiscard]] virtual std::vector<std::shared_ptr<const THUAI6::Tricker>> GetTrickers() const = 0;
// 获取视野内可见的道具信息
[[nodiscard]] virtual std::vector<std::shared_ptr<const THUAI6::Prop>> GetProps() const = 0;
// 获取地图信息,视野外的地图统一为Land
[[nodiscard]] virtual std::vector<std::vector<THUAI6::PlaceType>> GetFullMap() const = 0;
[[nodiscard]] virtual THUAI6::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual bool IsDoorOpen(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual int32_t GetChestProgress(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual int32_t GetGateProgress(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const = 0;
[[nodiscard]] virtual std::shared_ptr<const THUAI6::GameInfo> GetGameInfo() const = 0;
// 获取所有玩家的GUID
[[nodiscard]] virtual std::vector<int64_t> GetPlayerGUIDs() const = 0;
// 获取游戏目前所进行的帧数
[[nodiscard]] virtual int GetFrameCount() const = 0;
/*****选手可能用的辅助函数*****/
// 获取指定格子中心的坐标
[[nodiscard]] static inline int CellToGrid(int cell) noexcept
{
return cell * numOfGridPerCell + numOfGridPerCell / 2;
}
// 获取指定坐标点所位于的格子的 X 序号
[[nodiscard]] static inline int GridToCell(int grid) noexcept
{
return grid / numOfGridPerCell;
}
// 用于DEBUG的输出函数,选手仅在开启Debug模式的情况下可以使用
virtual void Print(std::string str) const = 0;
virtual void PrintStudent() const = 0;
virtual void PrintTricker() const = 0;
virtual void PrintProp() const = 0;
virtual void PrintSelfInfo() const = 0;
};
class IStudentAPI : public IAPI
{
public:
/*****学生阵营的特定函数*****/
virtual std::future<bool> StartLearning() = 0;
virtual std::future<bool> StartTreatMate(int64_t mateID) = 0;
virtual std::future<bool> StartRescueMate(int64_t mateID) = 0;
virtual std::future<bool> Graduate() = 0;
[[nodiscard]] virtual std::shared_ptr<const THUAI6::Student> GetSelfInfo() const = 0;
};
class ITrickerAPI : public IAPI
{
public:
/*****捣蛋鬼阵营的特定函数*****/
[[nodiscard]] virtual std::shared_ptr<const THUAI6::Tricker> GetSelfInfo() const = 0;
};
bool MoveRight(uint32_t timeInMilliseconds)即向右移动,MoveLeft、MoveDown、MoveUp同理| 键位 | 效果 |
|---|---|
| W/NumPad8 | (Both)向上移动 |
| S/NumPad2 | (Both)向下移动 |
| D/NumPad6 | (Both)向右移动 |
| A/NumPad4 | (Both)向左移动 |
| J | (Tri)攻击,方向向上 |
| 鼠标双击某点 | (Tri)攻击,方向与从Tricker指向该点的向量相同 |
| K | (Stu)开始学习 |
| R | (Stu)开始营救(陷入沉迷状态的同伴) |
| T | (Stu)开始勉励(学习毅力下降的同伴) |
| G | (Stu)发出毕业请求 |
| H | (Stu)申请毕业(或称为开校门) |
| O | (Both)开(教学楼)门 |
| P | (Both)关(教学楼)门 |
| U | (Both)翻窗 |
| I | (Both)翻箱子 |
| E | (Both)结束当前行动,回到Idle状态 |
| F | (Both)随机捡起一个在周围的道具 |
| C | (Both)随机扔下一个已经持有的道具 |
| V | (Both)随机使用一个已经持有的道具 |
| B | (Both)使用0号技能 |
| N | (Both)使用1号技能 |
| M | (Both)使用2号技能 |