fix: 🐛 fix the bug about return value when using skill
tags/0.1.0
| @@ -59,7 +59,7 @@ | |||||
| 下面的 CellX 和 CellY 指的是地图格数,而非绝对坐标。 | 下面的 CellX 和 CellY 指的是地图格数,而非绝对坐标。 | ||||
| - `THUAI6::PlaceType GetPlaceType(int32_t cellX, int32_t cellY)` :返回某一位置场地种类信息。场地种类详见 structure.h 。 | - `THUAI6::PlaceType GetPlaceType(int32_t cellX, int32_t cellY)` :返回某一位置场地种类信息。场地种类详见 structure.h 。 | ||||
| - 以下指令,若查询物品当前在视野内,则返回最新进度;若物品当前不在视野内、但曾经出现在视野内,则返回最后一次看到时的进度;若物品从未出现在视野内,或查询位置没有对应的物品,则返回 -1。 | |||||
| - 以下指令,若查询物品当前在视野内,则返回最新进度/状态;若物品当前不在视野内、但曾经出现在视野内,则返回最后一次看到时的进度/状态;若物品从未出现在视野内,或查询位置没有对应的物品,则返回 -1。 | |||||
| - `int32_t GetChestProgress(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 GetGateProgress(int32_t cellX, int32_t cellY) const`:查询特定位置校门开启进度 | ||||
| - `int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const`:查询特定位置教室作业完成进度 | - `int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const`:查询特定位置教室作业完成进度 | ||||
| @@ -72,7 +72,7 @@ | |||||
| 下面的 CellX 和 CellY 指的是地图格数,而非绝对坐标。 | 下面的 CellX 和 CellY 指的是地图格数,而非绝对坐标。 | ||||
| - `def GetPlaceType(self, cellX: int, cellY: int) -> THUAI6.PlaceType` :返回某一位置场地种类信息。场地种类详见 structure.h 。 | - `def GetPlaceType(self, cellX: int, cellY: int) -> THUAI6.PlaceType` :返回某一位置场地种类信息。场地种类详见 structure.h 。 | ||||
| - 以下指令,若查询物品当前在视野内,则返回最新进度;若物品当前不在视野内、但曾经出现在视野内,则返回最后一次看到时的进度;若物品从未出现在视野内,或查询位置没有对应的物品,则返回 -1。 | |||||
| - 以下指令,若查询物品当前在视野内,则返回最新进度/状态;若物品当前不在视野内、但曾经出现在视野内,则返回最后一次看到时的进度/状态;若物品从未出现在视野内,或查询位置没有对应的物品,则返回 -1。 | |||||
| - `def GetChestProgress(self, cellX: int, cellY: int) -> int`:查询特定位置箱子开启进度 | - `def GetChestProgress(self, cellX: int, cellY: int) -> int`:查询特定位置箱子开启进度 | ||||
| - `def GetGateProgress(self, cellX: int, cellY: int) -> int`:查询特定位置校门开启进度 | - `def GetGateProgress(self, cellX: int, cellY: int) -> int`:查询特定位置校门开启进度 | ||||
| - `def GetClassroomProgress(self, cellX: int, cellY: int) -> int`:查询特定位置教室作业完成进度 | - `def GetClassroomProgress(self, cellX: int, cellY: int) -> int`:查询特定位置教室作业完成进度 | ||||
| @@ -64,7 +64,7 @@ CellX=\frac{x}{1000},CellY=\frac{y}{1000} | |||||
| $$ | $$ | ||||
| - 格子有对应区域类型:陆地、墙、草地、教室、校门、隐藏校门、门、窗、箱子 | - 格子有对应区域类型:陆地、墙、草地、教室、校门、隐藏校门、门、窗、箱子 | ||||
| - 隐藏校门刷新点的区域类型始终为隐藏校门 | |||||
| - 任何格子的区域类型(PlaceType)始终不变,所有隐藏校门刷新点的区域类型均为隐藏校门 | |||||
| ### 人物 | ### 人物 | ||||
| - 人物直径为800 | - 人物直径为800 | ||||
| @@ -360,10 +360,12 @@ $$ | |||||
| ### 信息相关 | ### 信息相关 | ||||
| - Bgm在没有符合条件的情况下,值为0。 | - Bgm在没有符合条件的情况下,值为0。 | ||||
| - 不能给自己发信息 | |||||
| ### 技能 | ### 技能 | ||||
| - CD冷却计时是在开始使用技能的瞬间开始的 | - CD冷却计时是在开始使用技能的瞬间开始的 | ||||
| - Klee的小炸弹有碰撞体积 | - Klee的小炸弹有碰撞体积 | ||||
| - 除了切换攻击类型的技能,在不能执行指令的状态下(包括翻窗)均不能使用技能 | |||||
| ### 职业 | ### 职业 | ||||
| - 学生职业可以重复选择 | - 学生职业可以重复选择 | ||||
| @@ -80,4 +80,4 @@ A:初赛结束会调数值及机制,增加新角色 | |||||
| Q:初赛后会修改什么呢? | Q:初赛后会修改什么呢? | ||||
| A:技能冷却时间等属性设为不可见;出生点随机性或可选性;增强教师等职业,削弱职业;规范Debug信息;提供不同格式的信息传递;增加职业;优化游戏结束条件 | |||||
| A:技能冷却时间等属性设为不可见;出生点随机性或可选性;增强教师等职业,削弱职业;规范Debug信息;提供不同格式的信息传递;增加职业;优化游戏结束条件;角色毅力值清空不在使捣蛋鬼产生BGM | |||||
| @@ -1,6 +1,5 @@ | |||||
| using Preparation.Interface; | using Preparation.Interface; | ||||
| using Preparation.Utility; | using Preparation.Utility; | ||||
| using System; | |||||
| namespace GameClass.GameObj | namespace GameClass.GameObj | ||||
| { | { | ||||
| @@ -3,7 +3,6 @@ using System.Threading; | |||||
| using Preparation.Interface; | using Preparation.Interface; | ||||
| using Preparation.Utility; | using Preparation.Utility; | ||||
| using System; | using System; | ||||
| using GameClass.GameObj; | |||||
| namespace GameClass.GameObj | namespace GameClass.GameObj | ||||
| { | { | ||||
| @@ -13,29 +12,47 @@ namespace GameClass.GameObj | |||||
| private readonly Dictionary<uint, XY> birthPointList; // 出生点列表 | private readonly Dictionary<uint, XY> birthPointList; // 出生点列表 | ||||
| public Dictionary<uint, XY> BirthPointList => birthPointList; | public Dictionary<uint, XY> BirthPointList => birthPointList; | ||||
| private object lockForNum = new(); | |||||
| private readonly object lockForNum = new(); | |||||
| private void WhenStudentNumChange() | private void WhenStudentNumChange() | ||||
| { | { | ||||
| if (numOfDeceasedStudent + numOfEscapedStudent == GameData.numOfStudent) | if (numOfDeceasedStudent + numOfEscapedStudent == GameData.numOfStudent) | ||||
| { | { | ||||
| Timer.IsGaming = false; | Timer.IsGaming = false; | ||||
| return; | |||||
| } | } | ||||
| if (GameData.numOfStudent - NumOfDeceasedStudent - NumOfEscapedStudent == 1) | |||||
| if (GameData.numOfStudent - numOfDeceasedStudent - numOfEscapedStudent == 1) | |||||
| { | { | ||||
| GameObjLockDict[GameObjType.EmergencyExit].EnterWriteLock(); | |||||
| GameObjLockDict[GameObjType.Character].EnterReadLock(); | |||||
| try | try | ||||
| { | { | ||||
| foreach (EmergencyExit emergencyExit in GameObjDict[GameObjType.EmergencyExit]) | |||||
| if (emergencyExit.CanOpen) | |||||
| foreach (Character player in GameObjDict[GameObjType.Character]) | |||||
| if (player.PlayerState == PlayerStateType.Addicted) | |||||
| { | { | ||||
| emergencyExit.IsOpen = true; | |||||
| Timer.IsGaming = false; | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| finally | finally | ||||
| { | { | ||||
| GameObjLockDict[GameObjType.EmergencyExit].ExitWriteLock(); | |||||
| GameObjLockDict[GameObjType.Character].ExitReadLock(); | |||||
| } | |||||
| if (Timer.IsGaming) | |||||
| { | |||||
| GameObjLockDict[GameObjType.EmergencyExit].EnterWriteLock(); | |||||
| try | |||||
| { | |||||
| foreach (EmergencyExit emergencyExit in GameObjDict[GameObjType.EmergencyExit]) | |||||
| if (emergencyExit.CanOpen) | |||||
| { | |||||
| emergencyExit.IsOpen = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| finally | |||||
| { | |||||
| GameObjLockDict[GameObjType.EmergencyExit].ExitWriteLock(); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,5 @@ | |||||
| using System; | using System; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Numerics; | |||||
| using System.Threading; | using System.Threading; | ||||
| using Preparation.Interface; | using Preparation.Interface; | ||||
| using Preparation.Utility; | using Preparation.Utility; | ||||
| @@ -6,7 +6,6 @@ using Preparation.Utility; | |||||
| using GameEngine; | using GameEngine; | ||||
| using Preparation.Interface; | using Preparation.Interface; | ||||
| using Timothy.FrameRateTask; | using Timothy.FrameRateTask; | ||||
| using System.Numerics; | |||||
| namespace Gaming | namespace Gaming | ||||
| { | { | ||||
| @@ -17,44 +17,31 @@ namespace Gaming | |||||
| switch (activeSkillType) | switch (activeSkillType) | ||||
| { | { | ||||
| case ActiveSkillType.BecomeInvisible: | case ActiveSkillType.BecomeInvisible: | ||||
| BecomeInvisible(character); | |||||
| break; | |||||
| return BecomeInvisible(character); | |||||
| case ActiveSkillType.UseKnife: | case ActiveSkillType.UseKnife: | ||||
| UseKnife(character); | |||||
| break; | |||||
| return UseKnife(character); | |||||
| case ActiveSkillType.Howl: | case ActiveSkillType.Howl: | ||||
| Howl(character); | |||||
| break; | |||||
| return Howl(character); | |||||
| case ActiveSkillType.CanBeginToCharge: | case ActiveSkillType.CanBeginToCharge: | ||||
| CanBeginToCharge(character); | |||||
| break; | |||||
| return CanBeginToCharge(character); | |||||
| case ActiveSkillType.Inspire: | case ActiveSkillType.Inspire: | ||||
| Inspire(character); | |||||
| break; | |||||
| return Inspire(character); | |||||
| case ActiveSkillType.Encourage: | case ActiveSkillType.Encourage: | ||||
| Encourage(character); | |||||
| break; | |||||
| return Encourage(character); | |||||
| case ActiveSkillType.Punish: | case ActiveSkillType.Punish: | ||||
| Punish(character); | |||||
| break; | |||||
| return Punish(character); | |||||
| case ActiveSkillType.JumpyBomb: | case ActiveSkillType.JumpyBomb: | ||||
| JumpyBomb(character); | |||||
| break; | |||||
| return JumpyBomb(character); | |||||
| case ActiveSkillType.WriteAnswers: | case ActiveSkillType.WriteAnswers: | ||||
| WriteAnswers(character); | |||||
| break; | |||||
| return WriteAnswers(character); | |||||
| case ActiveSkillType.SummonGolem: | case ActiveSkillType.SummonGolem: | ||||
| SummonGolem(character); | |||||
| break; | |||||
| return SummonGolem(character); | |||||
| case ActiveSkillType.UseRobot: | case ActiveSkillType.UseRobot: | ||||
| UseRobot(character); | |||||
| break; | |||||
| return UseRobot(character); | |||||
| case ActiveSkillType.Rouse: | case ActiveSkillType.Rouse: | ||||
| Rouse(character); | |||||
| break; | |||||
| return Rouse(character); | |||||
| case ActiveSkillType.ShowTime: | case ActiveSkillType.ShowTime: | ||||
| ShowTime(character); | |||||
| break; | |||||
| return ShowTime(character); | |||||
| default: | default: | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -1,7 +1,6 @@ | |||||
| using Grpc.Core; | using Grpc.Core; | ||||
| using Protobuf; | using Protobuf; | ||||
| using System.Threading; | using System.Threading; | ||||
| using Timothy.FrameRateTask; | |||||
| using System; | using System; | ||||
| using System.Net.Http.Headers; | using System.Net.Http.Headers; | ||||
| using Gaming; | using Gaming; | ||||