SETUP.cpp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #include "SETUP.h"
  2. #include "CStoryCore.h"
  3. #include "TGame.h"
  4. #include "XSYS.h"
  5. #include "name.h"
  6. #include "str_conv.h"
  7. MYSTATIC ECountry gs_icountryTable_2FE4C0[] = {
  8. ECountry_ENG_D, ECountry_neg1, ECountry_FRA_A,
  9. ECountry_ITA_1, ECountry_GER_2, ECountry_SPA_0,
  10. ECountry_SPA_0, ECountry_SPA_0, ECountry_CRO_4};
  11. MYSTATIC int gs_idword_2FEE80[] = {0xBF, 0xB0, 0xC0, 0xB7, 0xAD, 0xB2,
  12. 0xAE, 0xB7, 0xAC, 0xBD, 0xB0};
  13. unsigned int s_iDefaultThirdGKCols[20] = {
  14. 0xFF404040, 0xFF404040, 0xFFFFFFFF, 0xFF404040, 0xFF404040,
  15. 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000,
  16. 0xFFC0C0C0, 0xFFC0C0C0, 0xFF000000, 0xFFC0C0C0, 0xFFC0C0C0,
  17. 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; // 0033EA0C
  18. //-------------------------------------------------------------------------------------------------
  19. // 0011BB30
  20. wchar_t* SURNAME_GetNameFromMainList(ECountry) { return nullptr; }
  21. //-------------------------------------------------------------------------------------------------
  22. // 0011BEF8
  23. wchar_t* SURNAME_GetName(int, ECountry, bool) { return nullptr; }
  24. //-------------------------------------------------------------------------------------------------
  25. // 0017864a ^_^ 返回值必须是int否则不是笑脸 实际应该是个char
  26. //单元测试等级: 目测游戏表现
  27. //单元测试内容: 玩游戏第2 6 7关
  28. //单元测试结果: 正常
  29. //已测试分支: loc_178652
  30. //未测试分支: loc_178666
  31. int SETUP_GetCaptainIndex(CTeam* pteam0) { return -1; }
  32. //-------------------------------------------------------------------------------------------------
  33. // 0017829c ^_-
  34. //单元测试等级: 目测游戏表现
  35. //单元测试内容: 玩游戏第三关3到第4关
  36. //单元测试结果: 正常
  37. //已测试分支: 0017829C loc_1782D2
  38. //未测试分支: 无
  39. void SETUP_ExpandPlayer(TPlayerInfo* ptplayerInfo0,
  40. TPlayerInfoLight* ptllayerInfoLight1, int i2,
  41. ECountry country3, bool b5) {
  42. LOGE("%x%x%x%x%x", ptplayerInfo0, ptllayerInfoLight1, i2, country3, b5);
  43. return;
  44. }
  45. //-------------------------------------------------------------------------------------------------
  46. // 00178378 ^_-
  47. //单元测试等级: 目测游戏表现
  48. //单元测试内容: 玩游戏到第3关
  49. //单元测试结果: 正常
  50. //已测试分支: 00178378 loc_1783B4 loc_1783FC
  51. //未测试分支: loc_1783A4 loc_1783B4——2 loc_17842A
  52. void SETUP_ExpandPlayers(CTeam* pteam0, TTeamInfo* pteam1Info1) {
  53. pteam0->field_1EC = 0;
  54. bool r9_bisTeamInternational =
  55. CDataBase::IsTeamInternational(pteam0->sIndex_0);
  56. ECountry r8_ecountry = ECountry_SPA_0;
  57. if (r9_bisTeamInternational == false && pteam0->leagueId_3 <= 5) {
  58. r8_ecountry = gs_icountryTable_2FE4C0[pteam0->leagueId_3];
  59. } else {
  60. // loc_1783A4
  61. r8_ecountry = ECountry_neg1;
  62. }
  63. // loc_1783A8
  64. TPlayerInfoLight* r6_ptplayerInfoLight = pteam1Info1->ptplayerInfoLight_10A8;
  65. // loc_1783E0
  66. for (int r7_i = 0; r7_i != 0x10; r7_i++) {
  67. // loc_1783B4
  68. ECountry r3_ecountry = r8_ecountry; //获取国家
  69. if (r9_bisTeamInternational) {
  70. r3_ecountry = (ECountry)r6_ptplayerInfoLight->country_3;
  71. }
  72. SETUP_ExpandPlayer(&pteam0->ptplayerInfo_1F0[r7_i], r6_ptplayerInfoLight,
  73. r7_i, r3_ecountry, r9_bisTeamInternational);
  74. r6_ptplayerInfoLight++;
  75. pteam0->field_1EC++;
  76. }
  77. // 001783E4
  78. // loc_178400
  79. unsigned int r0_ui = pteam0->field_1EC;
  80. for (unsigned int r6_i = 0; r6_i < r0_ui; r6_i++) {
  81. // loc_1783EA
  82. uchar r0_number = CStoryCore::GetShirtNumber();
  83. if (r6_i != 0x7) {
  84. if (pteam0->ptplayerInfo_1F0[r6_i].shirtNum_5F != r0_number) {
  85. continue;
  86. } else {
  87. // loc_17840A
  88. uint r2_u = 0xC;
  89. while (r2_u <= 0x62) {
  90. r6_i = 0;
  91. while (r6_i < pteam0->field_1EC && r2_u != r0_number) {
  92. r6_i++;
  93. };
  94. if (r6_i >= pteam0->field_1EC) {
  95. // loc_17842A
  96. pteam0->ptplayerInfo_1F0->shirtNum_5F = r2_u;
  97. break;
  98. } else
  99. r2_u = r0_number + 1;
  100. }
  101. break;
  102. }
  103. }
  104. }
  105. // loc_17842C
  106. int i_r1 = 0x0;
  107. // loc_178442
  108. while (i_r1 != 0xB) {
  109. // loc_178434
  110. pteam0->ptplayerInfo_1F0[i_r1].field_50 = gs_idword_2FEE80[i_r1];
  111. i_r1++;
  112. }
  113. // loc_17845A
  114. unsigned int r0_i = 0xB;
  115. while (r0_i < pteam0->field_1EC) {
  116. // loc_178450
  117. // LOGI("loc_178450 ");
  118. pteam0->ptplayerInfo_1F0[r0_i].field_50 = 0xB6;
  119. r0_i++;
  120. }
  121. return;
  122. }
  123. //-------------------------------------------------------------------------------------------------
  124. // 001781d0 ^_-
  125. //单元测试等级: 目测游戏表现
  126. //单元测试内容: resetgame 加载hero
  127. //单元测试结果: 正常
  128. //已测试分支: 001781d0
  129. //未测试分支: 无
  130. void SETUP_StandardPlayer(TPlayerInfo* ptplayInfo0) {
  131. // LOGE("SETUP_StandardPlayer");
  132. }
  133. //-------------------------------------------------------------------------------------------------
  134. // 001784c8 ^_-
  135. //单元测试等级: 目测游戏表现
  136. //单元测试内容:
  137. //单元测试结果: 正常
  138. //已测试分支:loc_17854A loc_17859C loc_1785E8 loc_178626_1 loc_178626_2
  139. //未测试分支: 001784c8
  140. void SETUP_TeamExpand(CTeam* pteam0, TPlayerInfo* ptplayerInfo1,
  141. TPlayerInfo* ptplayerInfo2, ushort us3) {
  142. // 001784C8
  143. }
  144. //-------------------------------------------------------------------------------------------------
  145. // 00178474 ^_-
  146. //单元测试等级: 目测游戏表现
  147. //单元测试内容:
  148. //单元测试结果: 无
  149. //已测试分支: 函数未调用
  150. //未测试分支:
  151. void SETUP_TeamNames() {
  152. // 00178474
  153. }
  154. //-------------------------------------------------------------------------------------------------