Browse Source

Merge pull request #262 from DragonAura/dev

refactor(CAPI): 🎨 change names
tags/0.1.0
shangfengh GitHub 2 years ago
parent
commit
977542a4a7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 214 additions and 171 deletions
  1. +9
    -9
      CAPI/cpp/API/include/constants.h
  2. +11
    -11
      CAPI/cpp/API/include/structures.h
  3. +7
    -7
      CAPI/cpp/API/include/utils.hpp
  4. +3
    -3
      CAPI/cpp/API/src/DebugAPI.cpp
  5. +3
    -3
      CAPI/python/PyAPI/DebugAPI.py
  6. +167
    -124
      CAPI/python/PyAPI/constants.py
  7. +7
    -7
      CAPI/python/PyAPI/structures.py
  8. +7
    -7
      CAPI/python/PyAPI/utils.py

+ 9
- 9
CAPI/cpp/API/include/constants.h View File

@@ -25,7 +25,7 @@ namespace Constants
SCCI int numOfRequiredClassroomForHiddenGate = 3; // 打开隐藏门需要完成的教室数量 SCCI int numOfRequiredClassroomForHiddenGate = 3; // 打开隐藏门需要完成的教室数量


// 人物属性相关 // 人物属性相关
SCCI int basicTreatSpeed = 100;
SCCI int basicEncourageSpeed = 100;
SCCI int basicFixSpeed = 123; SCCI int basicFixSpeed = 123;
SCCI int basicSpeedOfOpeningOrLocking = 4000; SCCI int basicSpeedOfOpeningOrLocking = 4000;
SCCI int basicStudentSpeedOfClimbingThroughWindows = 611; SCCI int basicStudentSpeedOfClimbingThroughWindows = 611;
@@ -34,8 +34,8 @@ namespace Constants


SCCI int basicHp = 3000000; SCCI int basicHp = 3000000;
SCCI int basicMaxGamingAddiction = 60000; SCCI int basicMaxGamingAddiction = 60000;
SCCI int basicTreatmentDegree = 1500000;
SCCI int basicTimeOfRescue = 1000;
SCCI int basicEncouragementDegree = 1500000;
SCCI int basicTimeOfRouse = 1000;


SCCI int basicStudentSpeed = 1270; SCCI int basicStudentSpeed = 1270;
SCCI int basicTrickerSpeed = 1504; SCCI int basicTrickerSpeed = 1504;
@@ -119,7 +119,7 @@ namespace Constants
SCCI int maxHp = basicHp; SCCI int maxHp = basicHp;
SCCI int maxAddiction = basicMaxGamingAddiction * 9 / 10; SCCI int maxAddiction = basicMaxGamingAddiction * 9 / 10;
SCCI int fixSpeed = basicFixSpeed * 6 / 10; SCCI int fixSpeed = basicFixSpeed * 6 / 10;
SCCI int treatSpeed = basicTreatSpeed * 8 / 10;
SCCI int encourageSpeed = basicEncourageSpeed * 8 / 10;
SCCI double concealment = 0.9; SCCI double concealment = 0.9;
SCCI int alertnessRadius = basicStudentAlertnessRadius; SCCI int alertnessRadius = basicStudentAlertnessRadius;
SCCI int viewRange = basicStudentViewRange * 11 / 10; SCCI int viewRange = basicStudentViewRange * 11 / 10;
@@ -134,7 +134,7 @@ namespace Constants
SCCI int maxHp = basicHp * 10; SCCI int maxHp = basicHp * 10;
SCCI int maxAddiction = basicMaxGamingAddiction * 10; SCCI int maxAddiction = basicMaxGamingAddiction * 10;
SCCI int fixSpeed = basicFixSpeed * 0; SCCI int fixSpeed = basicFixSpeed * 0;
SCCI int treatSpeed = basicTreatSpeed * 7 / 10;
SCCI int encourageSpeed = basicEncourageSpeed * 7 / 10;
SCCI double concealment = 0.5; SCCI double concealment = 0.5;
SCCI int alertnessRadius = basicStudentAlertnessRadius / 2; SCCI int alertnessRadius = basicStudentAlertnessRadius / 2;
SCCI int viewRange = basicStudentViewRange * 9 / 10; SCCI int viewRange = basicStudentViewRange * 9 / 10;
@@ -149,7 +149,7 @@ namespace Constants
SCCI int maxHp = basicHp * 11 / 10; SCCI int maxHp = basicHp * 11 / 10;
SCCI int maxAddiction = basicMaxGamingAddiction * 13 / 10; SCCI int maxAddiction = basicMaxGamingAddiction * 13 / 10;
SCCI int fixSpeed = basicFixSpeed * 11 / 10; SCCI int fixSpeed = basicFixSpeed * 11 / 10;
SCCI int treatSpeed = basicTreatSpeed * 8 / 10;
SCCI int encourageSpeed = basicEncourageSpeed * 8 / 10;
SCCI double concealment = 0.9; SCCI double concealment = 0.9;
SCCI int alertnessRadius = basicStudentAlertnessRadius * 9 / 10; SCCI int alertnessRadius = basicStudentAlertnessRadius * 9 / 10;
SCCI int viewRange = basicStudentViewRange * 9 / 10; SCCI int viewRange = basicStudentViewRange * 9 / 10;
@@ -164,7 +164,7 @@ namespace Constants
SCCI int maxHp = basicHp * 0.4; SCCI int maxHp = basicHp * 0.4;
SCCI int maxAddiction = basicMaxGamingAddiction * 0; SCCI int maxAddiction = basicMaxGamingAddiction * 0;
SCCI int fixSpeed = basicFixSpeed; SCCI int fixSpeed = basicFixSpeed;
SCCI int treatSpeed = basicTreatSpeed * 8 / 10;
SCCI int encourageSpeed = basicEncourageSpeed * 8 / 10;
SCCI double concealment = 1; SCCI double concealment = 1;
SCCI int alertnessRadius = basicStudentAlertnessRadius * 1; SCCI int alertnessRadius = basicStudentAlertnessRadius * 1;
SCCI int viewRange = basicStudentViewRange; SCCI int viewRange = basicStudentViewRange;
@@ -179,7 +179,7 @@ namespace Constants
SCCI int maxHp = basicHp * 9 / 10; SCCI int maxHp = basicHp * 9 / 10;
SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10; SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10;
SCCI int fixSpeed = basicFixSpeed * 11 / 10; SCCI int fixSpeed = basicFixSpeed * 11 / 10;
SCCI int treatSpeed = basicTreatSpeed * 9 / 10;
SCCI int encourageSpeed = basicEncourageSpeed * 9 / 10;
SCCI double concealment = 1; SCCI double concealment = 1;
SCCI int alertnessRadius = basicStudentAlertnessRadius; SCCI int alertnessRadius = basicStudentAlertnessRadius;
SCCI int viewRange = basicStudentViewRange * 9 / 10; SCCI int viewRange = basicStudentViewRange * 9 / 10;
@@ -194,7 +194,7 @@ namespace Constants
SCCI int maxHp = basicHp * 32 / 30; SCCI int maxHp = basicHp * 32 / 30;
SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10; SCCI int maxAddiction = basicMaxGamingAddiction * 11 / 10;
SCCI int fixSpeed = basicFixSpeed; SCCI int fixSpeed = basicFixSpeed;
SCCI int treatSpeed = basicTreatSpeed * 2;
SCCI int encourageSpeed = basicEncourageSpeed * 2;
SCCI double concealment = 1; SCCI double concealment = 1;
SCCI int alertnessRadius = basicStudentAlertnessRadius; SCCI int alertnessRadius = basicStudentAlertnessRadius;
SCCI int viewRange = basicStudentViewRange; SCCI int viewRange = basicStudentViewRange;


+ 11
- 11
CAPI/cpp/API/include/structures.h View File

@@ -126,11 +126,11 @@ namespace THUAI6
Addicted = 3, Addicted = 3,
Quit = 4, Quit = 4,
Graduated = 5, Graduated = 5,
Treated = 6,
Rescued = 7,
Encouraged = 6,
Roused = 7,
Stunned = 8, Stunned = 8,
Treating = 9,
Rescuing = 10,
Encouraging = 9,
Rousing = 10,
Swinging = 11, Swinging = 11,
Attacking = 12, Attacking = 12,
Locking = 13, Locking = 13,
@@ -195,9 +195,9 @@ namespace THUAI6
int32_t determination; // 剩余毅力 int32_t determination; // 剩余毅力
int32_t addiction; // 沉迷程度 int32_t addiction; // 沉迷程度
int32_t learningSpeed; int32_t learningSpeed;
int32_t treatSpeed;
int32_t treatProgress;
int32_t rescueProgress;
int32_t encourageSpeed;
int32_t encourageProgress;
int32_t rouseProgress;
double dangerAlert; double dangerAlert;
std::vector<StudentBuffType> buff; // buff std::vector<StudentBuffType> buff; // buff
}; };
@@ -302,11 +302,11 @@ namespace THUAI6
{PlayerState::Addicted, "Addicted"}, {PlayerState::Addicted, "Addicted"},
{PlayerState::Quit, "Quit"}, {PlayerState::Quit, "Quit"},
{PlayerState::Graduated, "Graduated"}, {PlayerState::Graduated, "Graduated"},
{PlayerState::Treated, "Treated"},
{PlayerState::Rescued, "Rescued"},
{PlayerState::Encouraged, "Encouraged"},
{PlayerState::Roused, "Roused"},
{PlayerState::Stunned, "Stunned"}, {PlayerState::Stunned, "Stunned"},
{PlayerState::Treating, "Treating"},
{PlayerState::Rescuing, "Rescuing"},
{PlayerState::Encouraging, "Encouraging"},
{PlayerState::Rousing, "Rousing"},
{PlayerState::Swinging, "Swinging"}, {PlayerState::Swinging, "Swinging"},
{PlayerState::Attacking, "Attacking"}, {PlayerState::Attacking, "Attacking"},
{PlayerState::Locking, "Locking"}, {PlayerState::Locking, "Locking"},


+ 7
- 7
CAPI/cpp/API/include/utils.hpp View File

@@ -146,11 +146,11 @@ namespace Proto2THUAI6
{protobuf::PlayerState::ADDICTED, THUAI6::PlayerState::Addicted}, {protobuf::PlayerState::ADDICTED, THUAI6::PlayerState::Addicted},
{protobuf::PlayerState::QUIT, THUAI6::PlayerState::Quit}, {protobuf::PlayerState::QUIT, THUAI6::PlayerState::Quit},
{protobuf::PlayerState::GRADUATED, THUAI6::PlayerState::Graduated}, {protobuf::PlayerState::GRADUATED, THUAI6::PlayerState::Graduated},
{protobuf::PlayerState::RESCUED, THUAI6::PlayerState::Rescued},
{protobuf::PlayerState::TREATED, THUAI6::PlayerState::Treated},
{protobuf::PlayerState::RESCUED, THUAI6::PlayerState::Roused},
{protobuf::PlayerState::TREATED, THUAI6::PlayerState::Encouraged},
{protobuf::PlayerState::STUNNED, THUAI6::PlayerState::Stunned}, {protobuf::PlayerState::STUNNED, THUAI6::PlayerState::Stunned},
{protobuf::PlayerState::RESCUING, THUAI6::PlayerState::Rescuing},
{protobuf::PlayerState::TREATING, THUAI6::PlayerState::Treating},
{protobuf::PlayerState::RESCUING, THUAI6::PlayerState::Rousing},
{protobuf::PlayerState::TREATING, THUAI6::PlayerState::Encouraging},
{protobuf::PlayerState::SWINGING, THUAI6::PlayerState::Swinging}, {protobuf::PlayerState::SWINGING, THUAI6::PlayerState::Swinging},
{protobuf::PlayerState::ATTACKING, THUAI6::PlayerState::Attacking}, {protobuf::PlayerState::ATTACKING, THUAI6::PlayerState::Attacking},
{protobuf::PlayerState::LOCKING, THUAI6::PlayerState::Locking}, {protobuf::PlayerState::LOCKING, THUAI6::PlayerState::Locking},
@@ -240,9 +240,9 @@ namespace Proto2THUAI6
student->facingDirection = studentMsg.facing_direction(); student->facingDirection = studentMsg.facing_direction();
student->bulletType = bulletTypeDict[studentMsg.bullet_type()]; student->bulletType = bulletTypeDict[studentMsg.bullet_type()];
student->learningSpeed = studentMsg.learning_speed(); student->learningSpeed = studentMsg.learning_speed();
student->treatSpeed = studentMsg.treat_speed();
student->treatProgress = studentMsg.treat_progress();
student->rescueProgress = studentMsg.rescue_progress();
student->encourageSpeed = studentMsg.treat_speed();
student->encourageProgress = studentMsg.treat_progress();
student->rouseProgress = studentMsg.rescue_progress();
student->dangerAlert = studentMsg.danger_alert(); student->dangerAlert = studentMsg.danger_alert();
student->timeUntilSkillAvailable.clear(); student->timeUntilSkillAvailable.clear();
for (int i = 0; i < studentMsg.time_until_skill_available().size(); i++) for (int i = 0; i < studentMsg.time_until_skill_available().size(); i++)


+ 3
- 3
CAPI/cpp/API/src/DebugAPI.cpp View File

@@ -661,7 +661,7 @@ void StudentDebugAPI::PrintStudent() const
props += THUAI6::propTypeDict[prop] + ", "; props += THUAI6::propTypeDict[prop] + ", ";
logger->info("state={}, bullet={}, props={}", THUAI6::playerStateDict[student->playerState], THUAI6::bulletTypeDict[student->bulletType], props); logger->info("state={}, bullet={}, props={}", THUAI6::playerStateDict[student->playerState], THUAI6::bulletTypeDict[student->bulletType], props);
logger->info("type={}, determination={}, addiction={}, danger alert={}", THUAI6::studentTypeDict[student->studentType], student->determination, student->addiction, student->dangerAlert); logger->info("type={}, determination={}, addiction={}, danger alert={}", THUAI6::studentTypeDict[student->studentType], student->determination, student->addiction, student->dangerAlert);
logger->info("learning speed={}, treat speed={}, treat progress={}, rescue progress={}", student->learningSpeed, student->treatSpeed, student->treatProgress, student->rescueProgress);
logger->info("learning speed={}, encourage speed={}, encourage progress={}, rouse progress={}", student->learningSpeed, student->encourageSpeed, student->encourageProgress, student->rouseProgress);
std::string studentBuff = ""; std::string studentBuff = "";
for (const auto& buff : student->buff) for (const auto& buff : student->buff)
studentBuff += THUAI6::studentBuffDict[buff] + ", "; studentBuff += THUAI6::studentBuffDict[buff] + ", ";
@@ -686,7 +686,7 @@ void TrickerDebugAPI::PrintStudent() const
props += THUAI6::propTypeDict[prop] + ", "; props += THUAI6::propTypeDict[prop] + ", ";
logger->info("state={}, bullet={}, props={}", THUAI6::playerStateDict[student->playerState], THUAI6::bulletTypeDict[student->bulletType], props); logger->info("state={}, bullet={}, props={}", THUAI6::playerStateDict[student->playerState], THUAI6::bulletTypeDict[student->bulletType], props);
logger->info("type={}, determination={}, addiction={}, danger alert={}", THUAI6::studentTypeDict[student->studentType], student->determination, student->addiction, student->dangerAlert); logger->info("type={}, determination={}, addiction={}, danger alert={}", THUAI6::studentTypeDict[student->studentType], student->determination, student->addiction, student->dangerAlert);
logger->info("learning speed={}, treat speed={}, treat progress={}, rescue progress={}", student->learningSpeed, student->treatSpeed, student->treatProgress, student->rescueProgress);
logger->info("learning speed={}, encourage speed={}, encourage progress={}, rouse progress={}", student->learningSpeed, student->encourageSpeed, student->encourageProgress, student->rouseProgress);
std::string studentBuff = ""; std::string studentBuff = "";
for (const auto& buff : student->buff) for (const auto& buff : student->buff)
studentBuff += THUAI6::studentBuffDict[buff] + ", "; studentBuff += THUAI6::studentBuffDict[buff] + ", ";
@@ -778,7 +778,7 @@ void StudentDebugAPI::PrintSelfInfo() const
props += THUAI6::propTypeDict[prop] + ", "; props += THUAI6::propTypeDict[prop] + ", ";
logger->info("state={}, bullet={}, props={}", THUAI6::playerStateDict[student->playerState], THUAI6::bulletTypeDict[student->bulletType], props); logger->info("state={}, bullet={}, props={}", THUAI6::playerStateDict[student->playerState], THUAI6::bulletTypeDict[student->bulletType], props);
logger->info("type={}, determination={}, addiction={}, danger alert={}", THUAI6::studentTypeDict[student->studentType], student->determination, student->addiction, student->dangerAlert); logger->info("type={}, determination={}, addiction={}, danger alert={}", THUAI6::studentTypeDict[student->studentType], student->determination, student->addiction, student->dangerAlert);
logger->info("learning speed={}, treat speed={}, treat progress={}, rescue progress={}", student->learningSpeed, student->treatSpeed, student->treatProgress, student->rescueProgress);
logger->info("learning speed={}, encourage speed={}, encourage progress={}, rouse progress={}", student->learningSpeed, student->encourageSpeed, student->encourageProgress, student->rouseProgress);
std::string studentBuff = ""; std::string studentBuff = "";
for (const auto& buff : student->buff) for (const auto& buff : student->buff)
studentBuff += THUAI6::studentBuffDict[buff] + ", "; studentBuff += THUAI6::studentBuffDict[buff] + ", ";


+ 3
- 3
CAPI/python/PyAPI/DebugAPI.py View File

@@ -326,7 +326,7 @@ class StudentDebugAPI(IStudentAPI, IGameTimer):
self.__logger.info( self.__logger.info(
f"type={student.studentType.name}, determination={student.determination}, addiction={student.addiction}, danger alert={student.dangerAlert}") f"type={student.studentType.name}, determination={student.determination}, addiction={student.addiction}, danger alert={student.dangerAlert}")
self.__logger.info( self.__logger.info(
f"learning speed={student.learningSpeed}, treat speed={student.treatSpeed}, treat progress={student.treatProgress}, rescue progress={student.rescueProgress}")
f"learning speed={student.learningSpeed}, encourage speed={student.encourageSpeed}, encourage progress={student.encourageProgress}, rouse progress={student.rouseProgress}")
studentBuff = "" studentBuff = ""
for buff in student.buff: for buff in student.buff:
studentBuff += buff.name + ", " studentBuff += buff.name + ", "
@@ -379,7 +379,7 @@ class StudentDebugAPI(IStudentAPI, IGameTimer):
self.__logger.info( self.__logger.info(
f"type={student.studentType.name}, determination={student.determination}, addiction={student.addiction}, danger alert={student.dangerAlert}") f"type={student.studentType.name}, determination={student.determination}, addiction={student.addiction}, danger alert={student.dangerAlert}")
self.__logger.info( self.__logger.info(
f"learning speed={student.learningSpeed}, treat speed={student.treatSpeed}, treat progress={student.treatProgress}, rescue progress={student.rescueProgress}")
f"learning speed={student.learningSpeed}, encourage speed={student.encourageSpeed}, encourage progress={student.encourageProgress}, rouse progress={student.rouseProgress}")
studentBuff = "" studentBuff = ""
for buff in student.buff: for buff in student.buff:
studentBuff += buff.name + ", " studentBuff += buff.name + ", "
@@ -778,7 +778,7 @@ class TrickerDebugAPI(ITrickerAPI, IGameTimer):
self.__logger.info( self.__logger.info(
f"type={student.studentType.name}, determination={student.determination}, addiction={student.addiction}, danger alert={student.dangerAlert}") f"type={student.studentType.name}, determination={student.determination}, addiction={student.addiction}, danger alert={student.dangerAlert}")
self.__logger.info( self.__logger.info(
f"learning speed={student.learningSpeed}, treat speed={student.treatSpeed}, treat progress={student.treatProgress}, rescue progress={student.rescueProgress}")
f"learning speed={student.learningSpeed}, encourage speed={student.encourageSpeed}, encourage progress={student.encourageProgress}, rouse progress={student.rouseProgress}")
studentBuff = "" studentBuff = ""
for buff in student.buff: for buff in student.buff:
studentBuff += buff.name + ", " studentBuff += buff.name + ", "


+ 167
- 124
CAPI/python/PyAPI/constants.py View File

@@ -40,13 +40,13 @@ class Constants(NoInstance):
basicTrickerSpeed = 1504 basicTrickerSpeed = 1504


basicConcealment = 1.0 basicConcealment = 1.0
basicStudentalertnessRadius = 15 * numOfGridPerCell
basicTrickeralertnessRadius = 17 * numOfGridPerCell
basicStudentviewRange = 10 * numOfGridPerCell
basicTrickerviewRange = 15 * numOfGridPerCell
basicStudentAlertnessRadius = 15 * numOfGridPerCell
basicTrickerAlertnessRadius = 17 * numOfGridPerCell
basicStudentViewRange = 10 * numOfGridPerCell
basicTrickerViewRange = 15 * numOfGridPerCell
PinningDownRange = 5 * numOfGridPerCell PinningDownRange = 5 * numOfGridPerCell


maxNumOfProp = 3 # 人物道具栏容量
maxNumOfProp = 3 # 人物道具栏容量


# 攻击相关 # 攻击相关


@@ -85,168 +85,211 @@ class Constants(NoInstance):
addedTimeOfSpeedWhenInspire = 0.6 addedTimeOfSpeedWhenInspire = 0.6
timeOfAddingSpeedWhenInspire = 6000 timeOfAddingSpeedWhenInspire = 6000



class Assassin: class Assassin:
moveSpeed = (int)(1.1*Constants.basicTrickerSpeed)
concealment = 1.5*Constants.basicConcealment
alertnessRadius = (int)(1.3*Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.2*Constants.basicTrickerViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(1.0*Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.1 * Constants.basicTrickerSpeed)
concealment = 1.5 * Constants.basicConcealment
alertnessRadius = (int)(1.3 * Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.2 * Constants.basicTrickerViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
1.0 * Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class Klee: class Klee:
moveSpeed = (int)(1.0*Constants.basicTrickerSpeed)
concealment = 1.0*Constants.basicConcealment
alertnessRadius = (int)(1.0*Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.0*Constants.basicTrickerViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(1.0*Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.1*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.0 * Constants.basicTrickerSpeed)
concealment = 1.0 * Constants.basicConcealment
alertnessRadius = (int)(1.0 * Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.0 * Constants.basicTrickerViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
1.0 * Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.1 * Constants.basicSpeedOfOpenChest)



class ANoisyPerson: class ANoisyPerson:
moveSpeed = (int)(1.07*Constants.basicTrickerSpeed)
concealment = 0.8*Constants.basicConcealment
alertnessRadius = (int)(0.9*Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.0*Constants.basicTrickerViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(1.1*Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.1*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.07 * Constants.basicTrickerSpeed)
concealment = 0.8 * Constants.basicConcealment
alertnessRadius = (int)(0.9 * Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.0 * Constants.basicTrickerViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
1.1 * Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.1 * Constants.basicSpeedOfOpenChest)



class Idol: class Idol:
moveSpeed = (int)(1.0*Constants.basicTrickerSpeed)
concealment = 0.75*Constants.basicConcealment
alertnessRadius = (int)(1.0*Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.1*Constants.basicTrickerViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(1.0*Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.0 * Constants.basicTrickerSpeed)
concealment = 0.75 * Constants.basicConcealment
alertnessRadius = (int)(1.0 * Constants.basicTrickerAlertnessRadius)
viewRange = (int)(1.1 * Constants.basicTrickerViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
1.0 * Constants.basicTrickerSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class Athlete: class Athlete:
moveSpeed = (int)(1.1*Constants.basicStudentSpeed)
maxHp = (int)(1.0*Constants.basicHp)
maxAddiction = (int)(0.9*Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(0.6*Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.8*Constants.basicLearnSpeed)
concealment = 0.9*Constants.basicConcealment
alertnessRadius = (int)(1.0*Constants.basicStudentAlertnessRadius)
viewRange = (int)(1.1*Constants.basicStudentViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(1.2*Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.1 * Constants.basicStudentSpeed)
maxHp = (int)(1.0 * Constants.basicHp)
maxAddiction = (int)(0.9 * Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(0.6 * Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.8 * Constants.basicLearnSpeed)
concealment = 0.9 * Constants.basicConcealment
alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius)
viewRange = (int)(1.1 * Constants.basicStudentViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
1.2 * Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class Teacher: class Teacher:
moveSpeed = (int)(0.75*Constants.basicStudentSpeed)
maxHp = (int)(10.0*Constants.basicHp)
maxAddiction = (int)(10.0*Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(0.0*Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.7*Constants.basicLearnSpeed)
concealment = 0.5*Constants.basicConcealment
alertnessRadius = (int)(0.5*Constants.basicStudentAlertnessRadius)
viewRange = (int)(0.9*Constants.basicStudentViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(0.5*Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(0.75 * Constants.basicStudentSpeed)
maxHp = (int)(10.0 * Constants.basicHp)
maxAddiction = (int)(10.0 * Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(0.0 * Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.7 * Constants.basicLearnSpeed)
concealment = 0.5 * Constants.basicConcealment
alertnessRadius = (int)(0.5 * Constants.basicStudentAlertnessRadius)
viewRange = (int)(0.9 * Constants.basicStudentViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
0.5 * Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class StraightAStudent: class StraightAStudent:
moveSpeed = (int)(0.8*Constants.basicStudentSpeed)
maxHp = (int)(1.1*Constants.basicHp)
maxAddiction = (int)(1.3*Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.1*Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.8*Constants.basicLearnSpeed)
concealment = 0.9*Constants.basicConcealment
alertnessRadius = (int)(0.9*Constants.basicStudentAlertnessRadius)
viewRange = (int)(0.9*Constants.basicStudentViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(0.83333*Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(0.8 * Constants.basicStudentSpeed)
maxHp = (int)(1.1 * Constants.basicHp)
maxAddiction = (int)(1.3 * Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.1 * Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.8 * Constants.basicLearnSpeed)
concealment = 0.9 * Constants.basicConcealment
alertnessRadius = (int)(0.9 * Constants.basicStudentAlertnessRadius)
viewRange = (int)(0.9 * Constants.basicStudentViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
0.83333 * Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class Robot: class Robot:
moveSpeed = (int)(1.0*Constants.basicStudentSpeed)
maxHp = (int)(0.4*Constants.basicHp)
maxAddiction = (int)(0.0*Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.0*Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.8*Constants.basicLearnSpeed)
concealment = 1.0*Constants.basicConcealment
alertnessRadius = (int)(1.0*Constants.basicStudentAlertnessRadius)
viewRange = (int)(1.0*Constants.basicStudentViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(0.0016*Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.0 * Constants.basicStudentSpeed)
maxHp = (int)(0.4 * Constants.basicHp)
maxAddiction = (int)(0.0 * Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.0 * Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.8 * Constants.basicLearnSpeed)
concealment = 1.0 * Constants.basicConcealment
alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius)
viewRange = (int)(1.0 * Constants.basicStudentViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
0.0016 * Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class TechOtaku: class TechOtaku:
moveSpeed = (int)(0.75*Constants.basicStudentSpeed)
maxHp = (int)(0.9*Constants.basicHp)
maxAddiction = (int)(1.1*Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.1*Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.9*Constants.basicLearnSpeed)
concealment = 1.0*Constants.basicConcealment
alertnessRadius = (int)(1.0*Constants.basicStudentAlertnessRadius)
viewRange = (int)(0.9*Constants.basicStudentViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(0.75*Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(0.75 * Constants.basicStudentSpeed)
maxHp = (int)(0.9 * Constants.basicHp)
maxAddiction = (int)(1.1 * Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.1 * Constants.basicLearnSpeed)
EncourageSpeed = (int)(0.9 * Constants.basicLearnSpeed)
concealment = 1.0 * Constants.basicConcealment
alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius)
viewRange = (int)(0.9 * Constants.basicStudentViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
0.75 * Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class Sunshine: class Sunshine:
moveSpeed = (int)(1.0*Constants.basicStudentSpeed)
maxHp = (int)(1.0667*Constants.basicHp)
maxAddiction = (int)(1.1*Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.0*Constants.basicLearnSpeed)
EncourageSpeed = (int)(2.0*Constants.basicLearnSpeed)
concealment = 1.0*Constants.basicConcealment
alertnessRadius = (int)(1.0*Constants.basicStudentAlertnessRadius)
viewRange = (int)(1.0*Constants.basicStudentViewRange)
speedOfOpeningOrLocking =(int)( 1.0*Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(1.0*Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0*Constants.basicSpeedOfOpenChest)
moveSpeed = (int)(1.0 * Constants.basicStudentSpeed)
maxHp = (int)(1.0667 * Constants.basicHp)
maxAddiction = (int)(1.1 * Constants.basicMaxGamingAddiction)
LearnSpeed = (int)(1.0 * Constants.basicLearnSpeed)
EncourageSpeed = (int)(2.0 * Constants.basicLearnSpeed)
concealment = 1.0 * Constants.basicConcealment
alertnessRadius = (int)(1.0 * Constants.basicStudentAlertnessRadius)
viewRange = (int)(1.0 * Constants.basicStudentViewRange)
speedOfOpeningOrLocking = (int)(
1.0 * Constants.basicSpeedOfOpeningOrLocking)
speedOfClimbingThroughWindows = (int)(
1.0 * Constants.basicStudentSpeedOfClimbingThroughWindows)
speedOfOpenChest = (int)(1.0 * Constants.basicSpeedOfOpenChest)



class CanBeginToCharge: class CanBeginToCharge:
skillCD = (int)(0.8*Constants.commonSkillCD)
durationTime = (int)(0.5*Constants.commonSkillTime)
skillCD = (int)(0.8 * Constants.commonSkillCD)
durationTime = (int)(0.5 * Constants.commonSkillTime)



class BecomeInvisible: class BecomeInvisible:
skillCD = (int)(4*Constants.commonSkillCD/3)
skillCD = (int)(4 * Constants.commonSkillCD / 3)
durationTime = (int)(Constants.commonSkillTime) durationTime = (int)(Constants.commonSkillTime)



class Punish: class Punish:
skillCD = (int)(1.0*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(1.0 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)



class Rouse: class Rouse:
skillCD = (int)(2.0*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(2.0 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)



class Encourage: class Encourage:
skillCD = (int)(2.0*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(2.0 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)



class Inspire: class Inspire:
skillCD = (int)(2.0*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(2.0 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)



class Howl: class Howl:
skillCD = (int)(0.8333*Constants.commonSkillCD)
durationTime = (int)(0*Constants.commonSkillTime)
skillCD = (int)(0.8333 * Constants.commonSkillCD)
durationTime = (int)(0 * Constants.commonSkillTime)



class ShowTime: class ShowTime:
skillCD = (int)(3.0*Constants.commonSkillCD)
durationTime = (int)(1.0*Constants.commonSkillTime)
skillCD = (int)(3.0 * Constants.commonSkillCD)
durationTime = (int)(1.0 * Constants.commonSkillTime)



class JumpyBomb: class JumpyBomb:
skillCD = (int)(0.5*Constants.commonSkillCD)
durationTime = (int)(0.3*Constants.commonSkillTime)
skillCD = (int)(0.5 * Constants.commonSkillCD)
durationTime = (int)(0.3 * Constants.commonSkillTime)



class UseKnife: class UseKnife:
skillCD = (int)(1.0*Constants.commonSkillCD)
durationTime = (int)(0.1*Constants.commonSkillTime)
skillCD = (int)(1.0 * Constants.commonSkillCD)
durationTime = (int)(0.1 * Constants.commonSkillTime)



class UseRobot: class UseRobot:
skillCD = (int)(0.0017*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(0.0017 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)



class WriteAnswers: class WriteAnswers:
skillCD = (int)(1.0*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(1.0 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)



class SummonGolem: class SummonGolem:
skillCD = (int)(1.0*Constants.commonSkillCD)
durationTime = (int)(0.0*Constants.commonSkillTime)
skillCD = (int)(1.0 * Constants.commonSkillCD)
durationTime = (int)(0.0 * Constants.commonSkillTime)

+ 7
- 7
CAPI/python/PyAPI/structures.py View File

@@ -104,11 +104,11 @@ class PlayerState(Enum):
Addicted = 3 Addicted = 3
Quit = 4 Quit = 4
Graduated = 5 Graduated = 5
Treated = 6
Rescued = 7
Encouraged = 6
Roused = 7
Stunned = 8 Stunned = 8
Treating = 9
Rescuing = 10
Encouraging = 9
Rousing = 10
Swinging = 11 Swinging = 11
Attacking = 12 Attacking = 12
Locking = 13 Locking = 13
@@ -163,10 +163,10 @@ class Student(Player):
studentType: StudentType studentType: StudentType
determination: int determination: int
addiction: int addiction: int
treatProgress: int
rescueProgress: int
encourageProgress: int
rouseProgress: int
learningSpeed: int learningSpeed: int
treatSpeed: int
encourageSpeed: int
dangerAlert: float dangerAlert: float
buff: List[StudentBuffType] = [] buff: List[StudentBuffType] = []




+ 7
- 7
CAPI/python/PyAPI/utils.py View File

@@ -136,11 +136,11 @@ class Proto2THUAI6(NoInstance):
MessageType.ADDICTED: THUAI6.PlayerState.Addicted, MessageType.ADDICTED: THUAI6.PlayerState.Addicted,
MessageType.QUIT: THUAI6.PlayerState.Quit, MessageType.QUIT: THUAI6.PlayerState.Quit,
MessageType.GRADUATED: THUAI6.PlayerState.Graduated, MessageType.GRADUATED: THUAI6.PlayerState.Graduated,
MessageType.RESCUED: THUAI6.PlayerState.Rescued,
MessageType.TREATED: THUAI6.PlayerState.Treated,
MessageType.RESCUED: THUAI6.PlayerState.Roused,
MessageType.TREATED: THUAI6.PlayerState.Encouraged,
MessageType.STUNNED: THUAI6.PlayerState.Stunned, MessageType.STUNNED: THUAI6.PlayerState.Stunned,
MessageType.RESCUING: THUAI6.PlayerState.Rescuing,
MessageType.TREATING: THUAI6.PlayerState.Treating,
MessageType.RESCUING: THUAI6.PlayerState.Rousing,
MessageType.TREATING: THUAI6.PlayerState.Encouraging,
MessageType.SWINGING: THUAI6.PlayerState.Swinging, MessageType.SWINGING: THUAI6.PlayerState.Swinging,
MessageType.ATTACKING: THUAI6.PlayerState.Attacking, MessageType.ATTACKING: THUAI6.PlayerState.Attacking,
MessageType.LOCKING: THUAI6.PlayerState.Locking, MessageType.LOCKING: THUAI6.PlayerState.Locking,
@@ -207,9 +207,9 @@ class Proto2THUAI6(NoInstance):
student.facingDirection = studentMsg.facing_direction student.facingDirection = studentMsg.facing_direction
student.bulletType = Proto2THUAI6.bulletTypeDict[studentMsg.bullet_type] student.bulletType = Proto2THUAI6.bulletTypeDict[studentMsg.bullet_type]
student.learningSpeed = studentMsg.learning_speed student.learningSpeed = studentMsg.learning_speed
student.treatSpeed = studentMsg.treat_speed
student.treatProgress = studentMsg.treat_progress
student.rescueProgress = studentMsg.rescue_progress
student.encourageSpeed = studentMsg.treat_speed
student.encourageProgress = studentMsg.treat_progress
student.rouseProgress = studentMsg.rescue_progress
student.dangerAlert = studentMsg.danger_alert student.dangerAlert = studentMsg.danger_alert
student.timeUntilSkillAvailable.clear() student.timeUntilSkillAvailable.clear()
for time in studentMsg.time_until_skill_available: for time in studentMsg.time_until_skill_available:


Loading…
Cancel
Save