Advertisement
Baoulettes

ShowEventsBanners

Jun 13th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.77 KB | None | 0 0
  1. constexpr std::string_view kGetAreas = R"SQL(SELECT
  2. areas.id,
  3. areas.name
  4. FROM
  5. areas)SQL"sv;
  6. constexpr std::string_view kGetQuests = R"SQL(SELECT
  7. quests.id,
  8. quests.area_id,
  9. quests.name
  10. FROM
  11. quests)SQL"sv;
  12. constexpr std::string_view kGetCategories = R"SQL(SELECT
  13. card_categories.id,
  14. card_categories.name
  15. FROM
  16. card_categories)SQL"sv;
  17. bool ShowEventsBanners(NetworkResponse *response) {
  18. using namespace std::string_view_literals;
  19. using json = nlohmann::json;
  20. UD_LOGI("Translation add-on Network : Loading . . .");
  21. auto Quests_List_Keyed = UniDokkan::Database::selectKeyed(kGetQuests, 0);
  22. auto Areas_List_Keyed = UniDokkan::Database::selectKeyed(kGetAreas, 0);
  23. auto Categories_List_Keyed = UniDokkan::Database::selectKeyed(kGetCategories, 0);
  24. auto Check_eventkagi_events = response->jsonBody.find("eventkagi_events");
  25. if (Check_eventkagi_events != response->jsonBody.end()) {
  26. for (auto &EventList_Kagi : response->jsonBody["eventkagi_events"]) {
  27. std::string Event_ID_long = to_string(EventList_Kagi["id"]);
  28. std::string Event_ID = Event_ID_long.substr(0, 3);
  29. int Event_ID_int = std::stoi(Event_ID);
  30. auto Check_quests1 = EventList_Kagi.find("quests");
  31. if (Check_quests1 != EventList_Kagi.end()) {
  32. for (auto &Quests_Name_Kagi : EventList_Kagi["quests"]) {
  33. int Quest_ID = Quests_Name_Kagi["id"];
  34. std::string Quest_Name = Quests_List_Keyed[Quest_ID]["name"].get<std::string>();
  35. Quests_Name_Kagi["name"] = Quest_Name;
  36. auto LimitedEvent = Quests_Name_Kagi.find("limitations");
  37. if (LimitedEvent != Quests_Name_Kagi.end()) {
  38. for (auto &Limitations : Quests_Name_Kagi["limitations"]) {
  39. std::string LimitType = Limitations["type"].get<std::string>();
  40. std::string LimitDesc = Limitations["description"].get<std::string>();
  41. std::string description;
  42. auto LimitID = Limitations["id"];
  43. if (LimitID == 317) {
  44. description = "Seuls les persos suivants peuvent participer \u00e0 ce niveau : \n[Esprit combatif inchang\u00e9 et nouveau pouvoir] \nSon Goku Super Saiyan \n[Rencontre choquante] Humain Artificiel N°18 \n[Forme de combat d'une puissance sans \u00e9gale] Super \nVegeta/Super Trunks \n[Solution trouv\u00e9e lors de l'entra\u00eenement] Son Goku \nSuper Saiyan/Son Gohan Super Saiyan (enfant) \n[Flammes terrestres] Humain Artificiel N°16 \n[Forme \u00e9volu\u00e9e] Cell (forme parfaite) \n[Une \u00e9nergie in\u00e9puisable] C-17 et C-18 \n[Attaques li\u00e9es] Son Gohan Super Saiyan 2 (enfant) \n[Terreur incessante] Cell Parfait \n[Nouvelle force obtenue apr\u00e8s entra\u00eenement] Super Vegeta \n[Esprit combatif exacerb\u00e9] Super Vegeta \n[Attaque p\u00e9rilleuse] Tenshinhan \n[Obsession pour la perfection] Cell (2e forme)",
  45. Limitations["description"] = description;
  46. continue;
  47. }
  48. if (LimitID == 318) {
  49. description = "Pour commencer ce niveau, vous aurez besoin de \n[Esprit combatif inchang\u00e9 et nouveau pouvoir] Son \nGoku Super Saiyan dans votre \u00e9quipe.",
  50. Limitations["description"] = description;
  51. continue;
  52. }
  53. if (LimitID == 319) {
  54. description = "Pour commencer ce niveau, vous aurez besoin de \n[Rencontre choquante] Humain Artificiel N°18 dans votre \u00e9quipe.",
  55. Limitations["description"] = description;
  56. continue;
  57. }
  58. if (LimitID == 320) {
  59. description = "Pour commencer ce niveau, vous aurez besoin de \n[Forme de combat d'une puissance sans \u00e9gale] \nSuper Vegeta/Super Trunks dans votre \u00e9quipe.",
  60. Limitations["description"] = description;
  61. continue;
  62. }
  63. if (LimitID == 321) {
  64. description = "Pour commencer ce niveau, vous aurez besoin de \n[Solution trouv\u00e9e lors de l'entra\u00eenement] \nSon Goku Super Saiyan/Son Gohan Super \nSaiyan (enfant) dans votre \u00e9quipe.",
  65. Limitations["description"] = description;
  66. continue;
  67. }
  68. if (LimitID == 322) {
  69. description = "Seuls les persos suivants peuvent participer \u00e0 ce niveau : \n[Esprit combatif inchang\u00e9 et nouveau pouvoir] \nSon Goku Super Saiyan \n[Rencontre choquante] Humain Artificiel N°18 \n[Forme de combat d'une puissance sans \u00e9gale] Super \nVegeta/Super Trunks \n[Solution trouv\u00e9e lors de l'entra\u00eenement] Son Goku \nSuper Saiyan/Son Gohan Super Saiyan (enfant) \n[Flammes terrestres] Humain Artificiel N°16 \n[Forme \u00e9volu\u00e9e] Cell (forme parfaite) \n[Une \u00e9nergie in\u00e9puisable] C-17 et C-18 \n[Attaques li\u00e9es] Son Gohan Super Saiyan 2 (enfant) \n[Terreur incessante] Cell Parfait \n[Nouvelle force obtenue apr\u00e8s entra\u00eenement] Super Vegeta \n[Esprit combatif exacerb\u00e9] Super Vegeta \n[Attaque p\u00e9rilleuse] Tenshinhan \n[Obsession pour la perfection] Cell (2e forme)",
  70. Limitations["description"] = description;
  71. continue;
  72. }
  73. if (LimitID == 323) {
  74. description = "Pour commencer ce niveau, vous aurez besoin de \n[Esprit combatif inchang\u00e9 et nouveau pouvoir] Son \nGoku Super Saiyan dans votre \u00e9quipe.",
  75. Limitations["description"] = description;
  76. continue;
  77. }
  78. if (LimitID == 324) {
  79. description = "Pour commencer ce niveau, vous aurez besoin de \n[Rencontre choquante] C-18 dans votre \u00e9quipe.",
  80. Limitations["description"] = description;
  81. continue;
  82. }
  83. if (LimitID == 325) {
  84. description = "Pour commencer ce niveau, vous aurez besoin de \n[Forme de combat d'une puissance sans \u00e9gale] \nSuper Vegeta/Super Trunks dans votre \u00e9quipe.",
  85. Limitations["description"] = description;
  86. continue;
  87. }
  88. if (LimitID == 326) {
  89. description = "Pour commencer ce niveau, vous aurez besoin de \n[Solution trouv\u00e9e lors de l'entra\u00eenement] \nSon Goku Super Saiyan/Son Gohan Super \nSaiyan (enfant) dans votre \u00e9quipe.",
  90. Limitations["description"] = description;
  91. continue;
  92. }
  93. if (LimitID == 336) {
  94. description = "Seuls les persos suivants peuvent participer \u00e0 ce niveau : \n\n[Vers un nouvel avenir] Trunks Super Saiyan (futur) \n[R\u00e9sistance h\u00e9ro\u00efque] Son Gohan Super Saiyan (futur) \n[Cyborg r\u00e9pandant la mort] C-17 (futur) \n[Cyborg qui s\u00e8me la destruction] C-18 (futur) \n[Espoir cach\u00e9] Trunks (jeune) \n[\u00catre haineux et destructeur] Cell (1re forme) \n[Monstre insaisissable] Cell (1re forme) \n[Col\u00e8re concentr\u00e9e] Super Trunks \n[Conviction de victoire] Super Trunks",
  95. Limitations["description"] = description;
  96. continue;
  97. }
  98. if (LimitID == 337) {
  99. description = "Pour commencer ce niveau, vous aurez besoin de \n[Vers un nouvel avenir] Trunks Super Saiyan (futur) \ndans votre \u00e9quipe.",
  100. Limitations["description"] = description;
  101. continue;
  102. }
  103. if (LimitID == 338) {
  104. description = "Pour commencer ce niveau, vous aurez besoin de \n[R\u00e9sistance h\u00e9ro\u00efque] Son Gohan Super Saiyan (futur) \ndans votre \u00e9quipe.",
  105. Limitations["description"] = description;
  106. continue;
  107. }
  108. if (LimitID == 339) {
  109. description = "Pour commencer ce niveau, vous aurez besoin de \n[Cyborg r\u00e9pandant la mort] C-17 (futur) dans votre \u00e9quipe.",
  110. Limitations["description"] = description;
  111. continue;
  112. }
  113. if (LimitID == 340) {
  114. description = "Pour commencer ce niveau, vous aurez besoin de \n[Cyborg qui s\u00e8me la destruction] C-18 (futur) dans votre \u00e9quipe.",
  115. Limitations["description"] = description;
  116. continue;
  117. }
  118. if (LimitID == 344) {
  119. description = "* Peut \u00eatre tent\u00e9 avec les persos suivants\u00a0: \n\n[Rage mortelle] Hatchiyack \n[\u00catre myst\u00e9rieux] Whis \n[H\u00e9ros entra\u00een\u00e9] Son Goku Super Saiyan \n[Atout dans la manche] Piccolo \n[Guerrier au c\u0153ur tendre] Son Gohan Super Saiyan (enfant) \n[Toujours plus haut] Son Goku Super Saiyan \n[Reconqu\u00e9rir le sommet] Vegeta Super Saiyan \n[Dignit\u00e9 d'un vrai ma\u00eetre] Piccolo \n[Force pour le futur] Trunks Super Saiyan (jeune) \n[Envol de la nouv. g\u00e9n\u00e9ration] Son Gohan Super Saiyan (enfant) \n[Coup tourbillonnant] Son Goku Super Saiyan 2 \n[Sans retenue] Son Goku Super Saiyan 2 \n[Terrible coup] Son Goku Super Saiyan 2 \n[Explosion de fureur] Son Gohan Super Saiyan (jeune) \n[Force effrayante] Vegeta Super Saiyan 2 \n[La technique rencontre la force] Son Goku Super Saiyan 2 (GT) \n[Force \u00e0 l'unisson] Oob \n[Dernier recours] Son Goku (Kaioken) \n[Adieu, fier guerrier !] Majin Vegeta \n[Majin d\u00e9cha\u00een\u00e9] Boo",
  120. Limitations["description"] = description;
  121. continue;
  122. }
  123. if (LimitID == 345) {
  124. description = "\nPour commencer ce niveau, vous aurez besoin de \n[Rage mortelle] Hatchiyack",
  125. Limitations["description"] = description;
  126. continue;
  127. }
  128. if (LimitID == 346) {
  129. description = "Pour commencer ce niveau, vous aurez besoin de \n[\u00catre myst\u00e9rieux] Whis",
  130. Limitations["description"] = description;
  131. continue;
  132. }
  133. if (LimitID == 351) {
  134. description = "* Peut \u00eatre tent\u00e9 avec les persos suivants\u00a0: \n\n[Rage mortelle] Hatchiyack \n[\u00catre myst\u00e9rieux] Whis \n[H\u00e9ros entra\u00een\u00e9] Son Goku Super Saiyan \n[Atout dans la manche] Piccolo \n[Guerrier au c\u0153ur tendre] Son Gohan Super Saiyan (enfant) \n[Toujours plus haut] Son Goku Super Saiyan \n[Reconqu\u00e9rir le sommet] Vegeta Super Saiyan \n[Dignit\u00e9 d'un vrai ma\u00eetre] Piccolo \n[Force pour le futur] Trunks Super Saiyan (jeune) \n[Envol de la nouv. g\u00e9n\u00e9ration] Son Gohan Super Saiyan (enfant) \n[Coup tourbillonnant] Son Goku Super Saiyan 2 \n[Sans retenue] Son Goku Super Saiyan 2 \n[Terrible coup] Son Goku Super Saiyan 2 \n[Explosion de fureur] Son Gohan Super Saiyan (jeune) \n[Force effrayante] Vegeta Super Saiyan 2 \n[La technique rencontre la force] Son Goku Super Saiyan 2 (GT) \n[Force \u00e0 l'unisson] Oob \n[Dernier recours] Son Goku (Kaioken) \n[Adieu, fier guerrier !] Majin Vegeta \n[Majin d\u00e9cha\u00een\u00e9] Boo",
  135. Limitations["description"] = description;
  136. continue;
  137. }
  138. if (LimitID == 352) {
  139. description = "\nPour commencer ce niveau, vous aurez besoin de \n[Rage mortelle] Hatchiyack",
  140. Limitations["description"] = description;
  141. continue;
  142. }
  143. if (LimitID == 353) {
  144. description = "Pour commencer ce niveau, vous aurez besoin de \n[\u00catre myst\u00e9rieux] Whis",
  145. Limitations["description"] = description;
  146. continue;
  147. }
  148. if (LimitID == 356) {
  149. description = "* Peut \u00eatre tent\u00e9 avec les persos suivants\u00a0: \n\n[Rage mortelle] Hatchiyack \n[\u00catre myst\u00e9rieux] Whis \n[H\u00e9ros entra\u00een\u00e9] Son Goku Super Saiyan \n[Atout dans la manche] Piccolo \n[Guerrier au c\u0153ur tendre] Son Gohan Super Saiyan (enfant) \n[Toujours plus haut] Son Goku Super Saiyan \n[Reconqu\u00e9rir le sommet] Vegeta Super Saiyan \n[Dignit\u00e9 d'un vrai ma\u00eetre] Piccolo \n[Force pour le futur] Trunks Super Saiyan (jeune) \n[Envol de la nouv. g\u00e9n\u00e9ration] Son Gohan Super Saiyan (enfant) \n[Coup tourbillonnant] Son Goku Super Saiyan 2 \n[Sans retenue] Son Goku Super Saiyan 2 \n[Terrible coup] Son Goku Super Saiyan 2 \n[Explosion de fureur] Son Gohan Super Saiyan (jeune) \n[Force effrayante] Vegeta Super Saiyan 2 \n[La technique rencontre la force] Son Goku Super Saiyan 2 (GT) \n[Force \u00e0 l'unisson] Oob \n[Dernier recours] Son Goku (Kaioken) \n[Adieu, fier guerrier !] Majin Vegeta \n[Majin d\u00e9cha\u00een\u00e9] Boo",
  150. Limitations["description"] = description;
  151. continue;
  152. }
  153. if (LimitID == 357) {
  154. description = "\nPour commencer ce niveau, vous aurez besoin de \n[Rage mortelle] Hatchiyack",
  155. Limitations["description"] = description;
  156. continue;
  157. }
  158. if (LimitID == 358) {
  159. description = "Pour commencer ce niveau, vous aurez besoin de \n[\u00catre myst\u00e9rieux] Whis",
  160. Limitations["description"] = description;
  161. continue;
  162. }
  163. if (LimitID == 361) {
  164. description = "Seuls les persos suivants peuvent participer \u00e0 ce niveau : \n\n[Rage mortelle] Hatchiyack \n[\u00catre myst\u00e9rieux] Whis \n[H\u00e9ros entra\u00een\u00e9] Son Goku Super Saiyan \n[Atout dans la manche] Piccolo \n[Guerrier au c\u0153ur tendre] Son Gohan Super Saiyan (enfant) \n[Toujours plus haut] Son Goku Super Saiyan \n[Reconqu\u00e9rir le sommet] Vegeta Super Saiyan \n[Dignit\u00e9 d'un vrai ma\u00eetre] Piccolo \n[Force pour le futur] Trunks Super Saiyan (jeune) \n[Envol de la nouv. g\u00e9n\u00e9ration] Son Gohan Super Saiyan (enfant) \n[Coup tourbillonnant] Son Goku Super Saiyan 2 \n[Sans retenue] Son Goku Super Saiyan 2 \n[Terrible coup] Son Goku Super Saiyan 2 \n[Explosion de fureur] Son Gohan Super Saiyan (jeune) \n[Force effrayante] Vegeta Super Saiyan 2 \n[La technique rencontre la force] Son Goku Super Saiyan 2 (GT) \n[Force \u00e0 l'unisson] Oob \n[Dernier recours] Son Goku (Kaioken) \n[Adieu, fier guerrier !] Majin Vegeta \n[Majin d\u00e9cha\u00een\u00e9] Boo",
  165. Limitations["description"] = description;
  166. continue;
  167. }
  168. if (LimitID == 362) {
  169. description = "Pour commencer ce niveau, vous aurez besoin de \n[Rage mortelle] Hatchiyack dans votre \u00e9quipe.",
  170. Limitations["description"] = description;
  171. continue;
  172. }
  173. if (LimitID == 363) {
  174. description = "Pour commencer ce niveau, vous aurez besoin de \n[\u00catre myst\u00e9rieux] Whis dans votre \u00e9quipe.",
  175. Limitations["description"] = description;
  176. continue;
  177. }
  178. if (LimitID == 366) {
  179. description = "Seuls les persos suivants peuvent participer \u00e0 ce niveau : \n\n[Rage mortelle] Hatchiyack \n[\u00catre myst\u00e9rieux] Whis \n[H\u00e9ros entra\u00een\u00e9] Son Goku Super Saiyan \n[Atout dans la manche] Piccolo \n[Guerrier au c\u0153ur tendre] Son Gohan Super Saiyan (enfant) \n[Toujours plus haut] Son Goku Super Saiyan \n[Reconqu\u00e9rir le sommet] Vegeta Super Saiyan \n[Dignit\u00e9 d'un vrai ma\u00eetre] Piccolo \n[Force pour le futur] Trunks Super Saiyan (jeune) \n[Envol de la nouv. g\u00e9n\u00e9ration] Son Gohan Super Saiyan (enfant) \n[Coup tourbillonnant] Son Goku Super Saiyan 2 \n[Sans retenue] Son Goku Super Saiyan 2 \n[Terrible coup] Son Goku Super Saiyan 2 \n[Explosion de fureur] Son Gohan Super Saiyan (jeune) \n[Force effrayante] Vegeta Super Saiyan 2 \n[La technique rencontre la force] Son Goku Super Saiyan 2 (GT) \n[Force \u00e0 l'unisson] Oob \n[Dernier recours] Son Goku (Kaioken) \n[Adieu, fier guerrier !] Majin Vegeta \n[Majin d\u00e9cha\u00een\u00e9] Boo",
  180. Limitations["description"] = description;
  181. continue;
  182. }
  183. if (LimitID == 367) {
  184. description = "Pour commencer ce niveau, vous aurez besoin de \n[Rage mortelle] Hatchiyack dans votre \u00e9quipe.",
  185. Limitations["description"] = description;
  186. continue;
  187. }
  188. if (LimitID == 368) {
  189. description = "Pour commencer ce niveau, vous aurez besoin de \n[\u00catre myst\u00e9rieux] Whis dans votre \u00e9quipe.",
  190. Limitations["description"] = description;
  191. continue;
  192. }
  193. if (LimitType == "QuestLimitation::CardQuestLimitation::AllowedCategoryQuestLimitation") {
  194. int catid_c = 0;
  195. for (auto &cat_id : Limitations["conditions"]["allowed_category_ids"]) {
  196. std::string Desc_cats = "Pour les personnages de cat\u00e9gorie\n";
  197. std::string curr_cat = Categories_List_Keyed[cat_id]["name"].get<std::string>();
  198. // std::string curr_cat = GetCategoryName(cat_id);
  199. if (catid_c == 0) {
  200. Desc_cats = Desc_cats + "\"" + curr_cat + "\"";
  201. catid_c++;
  202. } else {
  203. Desc_cats = Desc_cats + "\n\"" + curr_cat + "\"";
  204. }
  205. Limitations["description"] = Desc_cats;
  206. }
  207. } else if (LimitDesc == "\u30c9\u30ed\u30c3\u30d7\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3068\u3001\n\u30c9\u30c3\u30ab\u30f3\u899a\u9192\u6e08\u306e\u30c9\u30ed\u30c3\u30d7\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  208. Limitations["description"] = "Uniquement pour les personnages obtenus\ndans les qu\u00eates ou \u00e9v\u00e9nements \n(avant ou apr\u00e8s \u00e9veil Dokkan)";
  209. } else if (LimitDesc == "\u30b3\u30f3\u30c6\u30a3\u30cb\u30e5\u30fc\u4e0d\u53ef") {
  210. Limitations["description"] = "Le \"continue\" n'est pas autoris\u00e9";
  211. } else if (LimitDesc == "\u30b5\u30dd\u30fc\u30c8\u30a2\u30a4\u30c6\u30e0\u6301\u3061\u8fbc\u307f\u5236\u9650 2\u7a2e\u985e\u307e\u3067") {
  212. Limitations["description"] = "Vous ne pouvez emporter que 2 types d'objets de soutien";
  213. } else if (LimitDesc == "\u5b6b\u609f\u7a7a(\u5c11\u5e74\u671f)(\u5927\u733f)\u306f\u6311\u6226\u4e0d\u53ef") {
  214. Limitations["description"] = "Son Goku (enfant) (oozaru) ne peut pas participer";
  215. } else if (LimitDesc == "\u5b6b\u609f\u7a7a(\u5c11\u5e74\u671f)\u3092\u542b\u3080\u30c1\u30fc\u30e0\u3067\u6311\u6226\u53ef\u80fd") {
  216. Limitations["description"] = "Les \u00e9quipes comportant Son Goku (enfant) peuvent participer";
  217. } else if (LimitDesc == "\u30b5\u30dd\u30fc\u30c8\u30a2\u30a4\u30c6\u30e0\u300c\u4ed9\u8c46\u300d\u300c\u30cf\u30a4\u30e4\u30fc\u30c9\u30e9\u30b4\u30f3\u300d\n\u6301\u3061\u8fbc\u307f\u4e0d\u53ef") {
  218. Limitations["description"] = "Les objets de soutien \"Senzu\" \net \"Hire Dragon\" ne sont pas autoris\u00e9s";
  219. } else if (LimitDesc == "\u30b5\u30dd\u30fc\u30c8\u30a2\u30a4\u30c6\u30e0\u6301\u3061\u8fbc\u307f\u4e0d\u53ef") {
  220. Limitations["description"] = "Objets de soutien interdits";
  221. } else if (LimitDesc == "\u30a2\u30c3\u30af\u30de\u30f3\u306f\u6311\u6226\u4e0d\u53ef") {
  222. Limitations["description"] = "Devilman ne peut pas participer";
  223. } else if (LimitDesc == "\u8d85\u6280\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  224. Limitations["description"] = "Type S. TEC uniquement";
  225. } else if (LimitDesc == "\u6975\u6280\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  226. Limitations["description"] = "Type E. TEC uniquement";
  227. } else if (LimitDesc == "\u8d85\u77e5\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  228. Limitations["description"] = "Type S. INT uniquement";
  229. } else if (LimitDesc == "\u6975\u77e5\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  230. Limitations["description"] = "Type E. INT uniquement";
  231. } else if (LimitDesc == "\u8d85\u4f53\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  232. Limitations["description"] = "Type S. END uniquement";
  233. } else if (LimitDesc == "\u6975\u4f53\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  234. Limitations["description"] = "Type E. END uniquement";
  235. } else if (LimitDesc == "\u8d85\u901f\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  236. Limitations["description"] = "Type S. AGI uniquement";
  237. } else if (LimitDesc == "\u6975\u901f\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  238. Limitations["description"] = "Type E. AGI uniquement";
  239. } else if (LimitDesc == "\u8d85\u529b\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  240. Limitations["description"] = "Type S. PUI uniquement";
  241. } else if (LimitDesc == "\u6975\u529b\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  242. Limitations["description"] = "Type E. PUI uniquement";
  243. } else if (LimitDesc == "\u5404\u8d85\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\n1\u4f53\u305a\u3064\u542b\u3080\u30c1\u30fc\u30e0\u3067\u6311\u6226\u53ef\u80fd") {
  244. Limitations["description"] = "Un personnage de chaque type Super requis";
  245. } else if (LimitDesc == "\u8d85\u5c5e\u6027\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3068\u3001\nZ\u899a\u9192\u5f8c\u8d85\u5c5e\u6027\u306b\u306a\u308b\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  246. Limitations["description"] = "Seuls les persos de types Super et \nSuper apr\u00e8s l'\u00e9veil-Z peuvent tenter";
  247. } else if (LimitDesc == "\u6975\u5c5e\u6027\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3068\u3001\nZ\u899a\u9192\u5f8c\u6975\u5c5e\u6027\u306b\u306a\u308b\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  248. Limitations["description"] = "Un personnage de chaque type Extr\u00eame requis";
  249. } else if (LimitDesc == "\u5404\u6975\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\n1\u4f53\u305a\u3064\u542b\u3080\u30c1\u30fc\u30e0\u3067\u6311\u6226\u53ef\u80fd") {
  250. Limitations["description"] = "Seuls les persos Extr\u00eame et Extr\u00eame apr\u00e8s l'\u00e9veil-Z \npeuvent tenter";
  251. }
  252. }
  253. }
  254. }
  255. }
  256. auto Check_banner_image = EventList_Kagi.find("banner_image");
  257. if (Check_banner_image != EventList_Kagi.end()) {
  258. // UD_LOGI("Translation add-on Network : banner_image :");
  259. // UD_LOGI("%s%s%s%s", Base_url, Quest_url, Event_ID, Extension_url);
  260. // std::string banner_image = fmt::format("%s%s%s%s", Base_url, Quest_url, Event_ID, Extension_url);
  261. // EventList_Kagi["banner_image"] = banner_image;
  262. EventList_Kagi["banner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_" + Event_ID + ".png";
  263. }
  264. auto Check_event_image = EventList_Kagi.find("event_image");
  265. if (Check_event_image != EventList_Kagi.end()) {
  266. // UD_LOGI("Translation add-on Network : event_image :");
  267. // UD_LOGI("%s%s%s%s", Base_url, Top_url, Event_ID, Extension_url);
  268. // std::string event_image = fmt::format("%s%s%s%s", Base_url, Top_url, Event_ID, Extension_url);
  269. // EventList_Kagi["event_image"] = event_image;
  270. EventList_Kagi["event_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_" + Event_ID + ".png";
  271. }
  272. auto Check_minibanner_image = EventList_Kagi.find("minibanner_image");
  273. if (Check_minibanner_image != EventList_Kagi.end()) {
  274. // UD_LOGI("Translation add-on Network : minibanner_image :");
  275. // UD_LOGI("%s%s%s%s", Base_url, Event_url, Event_ID, Extension_url);
  276. // std::string minibanner_image = fmt::format("%s%s%s%s", Base_url, Event_url, Event_ID, Extension_url);
  277. // EventList_Kagi["minibanner_image"] = minibanner_image;
  278. // EventList_Kagi["minibanner_image"] = fmt::format("%s%s%s%s", Base_url, Event_url, Event_ID, Extension_url);
  279. EventList_Kagi["minibanner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_event_banner_" + Event_ID + ".png";
  280. }
  281. }
  282. }
  283.  
  284. auto Check_eventkagi_eventkagi_z_battle_stages = response->jsonBody.find("eventkagi_z_battle_stages");
  285. if (Check_eventkagi_eventkagi_z_battle_stages != response->jsonBody.end()) {
  286. for (auto &EZAList_Kagi : response->jsonBody["eventkagi_z_battle_stages"]) {
  287. auto Check_EZAList = EZAList_Kagi.find("id");
  288. if (Check_EZAList!= EZAList_Kagi.end()) {
  289. std::string EZA_ID = to_string(EZAList_Kagi["id"]);
  290. int EZA_ID_int = std::stoi(EZA_ID);
  291. auto Check_banner_image = EZAList_Kagi.find("banner_image");
  292. if (Check_banner_image != EZAList_Kagi.end()) {
  293. EZAList_Kagi["banner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/zbattle_list_banner_" + EZA_ID + ".png";
  294. }
  295. }
  296. }
  297. }
  298.  
  299. auto Check_events = response->jsonBody.find("events");
  300. if (Check_events != response->jsonBody.end()) {
  301. for (auto &EventList : response->jsonBody["events"]) {
  302. std::string Event_ID_long = to_string(EventList["id"]);
  303. std::string Event_ID = Event_ID_long.substr(0, 3);
  304. int Event_ID_int = std::stoi(Event_ID);
  305. auto Check_quests1 = EventList.find("quests");
  306. if (Check_quests1 != EventList.end()) {
  307. for (auto &Quests_Name : EventList["quests"]) {
  308. int Quest_ID = Quests_Name["id"];
  309. std::string Quest_Name = Quests_List_Keyed[Quest_ID]["name"].get<std::string>();
  310. Quests_Name["name"] = Quest_Name;
  311. auto LimitedEvent = Quests_Name.find("limitations");
  312. if (LimitedEvent != Quests_Name.end()) {
  313. for (auto &Limitations : Quests_Name["limitations"]) {
  314. std::string LimitType = Limitations["type"].get<std::string>();
  315. std::string LimitDesc = Limitations["description"].get<std::string>();
  316. auto LimitID = Limitations["id"];
  317. if (LimitType == "QuestLimitation::CardQuestLimitation::AllowedCategoryQuestLimitation") {
  318. int catid_c = 0;
  319. for (auto &cat_id : Limitations["conditions"]["allowed_category_ids"]) {
  320. std::string Desc_cats = "Pour les personnages de cat\u00e9gorie\n";
  321. std::string curr_cat = Categories_List_Keyed[cat_id]["name"].get<std::string>();
  322. // std::string curr_cat = GetCategoryName(cat_id);
  323. if (catid_c == 0) {
  324. Desc_cats = Desc_cats + "\"" + curr_cat + "\"";
  325. catid_c++;
  326. } else {
  327. Desc_cats = Desc_cats + "\n\"" + curr_cat + "\"";
  328. }
  329. Limitations["description"] = Desc_cats;
  330. }
  331. } else if (LimitDesc == "\u30c9\u30ed\u30c3\u30d7\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3068\u3001\n\u30c9\u30c3\u30ab\u30f3\u899a\u9192\u6e08\u306e\u30c9\u30ed\u30c3\u30d7\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  332. Limitations["description"] = "Uniquement pour les personnages obtenus\ndans les qu\u00eates ou \u00e9v\u00e9nements \n(avant ou apr\u00e8s \u00e9veil Dokkan)";
  333. } else if (LimitDesc == "\u30b3\u30f3\u30c6\u30a3\u30cb\u30e5\u30fc\u4e0d\u53ef") {
  334. Limitations["description"] = "Le \"continue\" n'est pas autoris\u00e9";
  335. } else if (LimitDesc == "\u30b5\u30dd\u30fc\u30c8\u30a2\u30a4\u30c6\u30e0\u6301\u3061\u8fbc\u307f\u5236\u9650 2\u7a2e\u985e\u307e\u3067") {
  336. Limitations["description"] = "Vous ne pouvez emporter que 2 types d'objets de soutien";
  337. } else if (LimitDesc == "\u5b6b\u609f\u7a7a(\u5c11\u5e74\u671f)(\u5927\u733f)\u306f\u6311\u6226\u4e0d\u53ef") {
  338. Limitations["description"] = "Son Goku (enfant) (oozaru) ne peut pas participer";
  339. } else if (LimitDesc == "\u5b6b\u609f\u7a7a(\u5c11\u5e74\u671f)\u3092\u542b\u3080\u30c1\u30fc\u30e0\u3067\u6311\u6226\u53ef\u80fd") {
  340. Limitations["description"] = "Les \u00e9quipes comportant Son Goku (enfant) peuvent participer";
  341. } else if (LimitDesc == "\u30b5\u30dd\u30fc\u30c8\u30a2\u30a4\u30c6\u30e0\u300c\u4ed9\u8c46\u300d\u300c\u30cf\u30a4\u30e4\u30fc\u30c9\u30e9\u30b4\u30f3\u300d\n\u6301\u3061\u8fbc\u307f\u4e0d\u53ef") {
  342. Limitations["description"] = "Les objets de soutien \"Senzu\" \net \"Hire Dragon\" ne sont pas autoris\u00e9s";
  343. } else if (LimitDesc == "\u30b5\u30dd\u30fc\u30c8\u30a2\u30a4\u30c6\u30e0\u6301\u3061\u8fbc\u307f\u4e0d\u53ef") {
  344. Limitations["description"] = "Objets de soutien interdits";
  345. } else if (LimitDesc == "\u30a2\u30c3\u30af\u30de\u30f3\u306f\u6311\u6226\u4e0d\u53ef") {
  346. Limitations["description"] = "Devilman ne peut pas participer";
  347. } else if (LimitDesc == "\u8d85\u6280\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  348. Limitations["description"] = "Type S. TEC uniquement";
  349. } else if (LimitDesc == "\u6975\u6280\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  350. Limitations["description"] = "Type E. TEC uniquement";
  351. } else if (LimitDesc == "\u8d85\u77e5\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  352. Limitations["description"] = "Type S. INT uniquement";
  353. } else if (LimitDesc == "\u6975\u77e5\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  354. Limitations["description"] = "Type E. INT uniquement";
  355. } else if (LimitDesc == "\u8d85\u4f53\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  356. Limitations["description"] = "Type S. END uniquement";
  357. } else if (LimitDesc == "\u6975\u4f53\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  358. Limitations["description"] = "Type E. END uniquement";
  359. } else if (LimitDesc == "\u8d85\u901f\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  360. Limitations["description"] = "Type S. AGI uniquement";
  361. } else if (LimitDesc == "\u6975\u901f\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  362. Limitations["description"] = "Type E. AGI uniquement";
  363. } else if (LimitDesc == "\u8d85\u529b\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  364. Limitations["description"] = "Type S. PUI uniquement";
  365. } else if (LimitDesc == "\u6975\u529b\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  366. Limitations["description"] = "Type E. PUI uniquement";
  367. } else if (LimitDesc == "\u5404\u8d85\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\n1\u4f53\u305a\u3064\u542b\u3080\u30c1\u30fc\u30e0\u3067\u6311\u6226\u53ef\u80fd") {
  368. Limitations["description"] = "Un personnage de chaque type Super requis";
  369. } else if (LimitDesc == "\u8d85\u5c5e\u6027\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3068\u3001\nZ\u899a\u9192\u5f8c\u8d85\u5c5e\u6027\u306b\u306a\u308b\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  370. Limitations["description"] = "Seuls les persos de types Super et \nSuper apr\u00e8s l'\u00e9veil-Z peuvent tenter";
  371. } else if (LimitDesc == "\u6975\u5c5e\u6027\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3068\u3001\nZ\u899a\u9192\u5f8c\u6975\u5c5e\u6027\u306b\u306a\u308b\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u306e\u307f\u6311\u6226\u53ef\u80fd") {
  372. Limitations["description"] = "Un personnage de chaque type Extr\u00eame requis";
  373. } else if (LimitDesc == "\u5404\u6975\u5c5e\u6027\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\n1\u4f53\u305a\u3064\u542b\u3080\u30c1\u30fc\u30e0\u3067\u6311\u6226\u53ef\u80fd") {
  374. Limitations["description"] = "Seuls les persos Extr\u00eame et Extr\u00eame apr\u00e8s l'\u00e9veil-Z \npeuvent tenter";
  375. }
  376. }
  377. }
  378. }
  379. }
  380. auto Check_banner_image = EventList.find("banner_image");
  381. if (Check_banner_image != EventList.end()) {
  382. if (InRange(Event_ID_int, 379,400) || InRange(Event_ID_int, 423,500) || InRange(Event_ID_int, 559,600) || InRange(Event_ID_int, 607,700) || InRange(Event_ID_int, 714,800) || InRange(Event_ID_int, 803,900)) {
  383. bool is_valid = RestClient::head("https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_" + Event_ID + ".png").code == 200;
  384. if (is_valid == true) {
  385. EventList["banner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_" + Event_ID + ".png";
  386. } else {}//Donada
  387. } else {
  388. EventList["banner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_list_banner_" + Event_ID + ".png";
  389. }
  390. }
  391. auto Check_event_image = EventList.find("event_image");
  392. if (Check_event_image != EventList.end()) {
  393. if (InRange(Event_ID_int, 379,400) || InRange(Event_ID_int, 423,500) || InRange(Event_ID_int, 559,600) || InRange(Event_ID_int, 607,700) || InRange(Event_ID_int, 714,800) || InRange(Event_ID_int, 803,900)) {
  394. bool is_valid = RestClient::head("https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_" + Event_ID + ".png").code == 200;
  395. if (is_valid == true) {
  396. EventList["event_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_" + Event_ID + ".png";
  397. } else {}//Donada
  398. } else {
  399. EventList["event_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_top_banner_" + Event_ID + ".png";
  400. }
  401. }
  402. auto Check_minibanner_image = EventList.find("minibanner_image");
  403. if (Check_minibanner_image != EventList.end()) {
  404. EventList["minibanner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/quest_event_banner_" + Event_ID + ".png";
  405. }
  406. }
  407. }
  408.  
  409. auto Check_z_battle_stages = response->jsonBody.find("z_battle_stages");
  410. if (Check_z_battle_stages != response->jsonBody.end()) {
  411. for (auto &EZAList : response->jsonBody["z_battle_stages"]) {
  412. auto Check_EZAList = EZAList.find("id");
  413. if (Check_EZAList!= EZAList.end()) {
  414. std::string EZA_ID = to_string(EZAList["id"]);
  415. int EZA_ID_int = std::stoi(EZA_ID);
  416. auto Check_banner_image = EZAList.find("banner_image");
  417. if (Check_banner_image != EZAList.end()) {
  418. EZAList["banner_image"] = "https://www.baoulettes.fr/DokkanEvent/image/zbattle_list_banner_" + EZA_ID + ".png";
  419. }
  420. }
  421. }
  422. }
  423.  
  424. return true;
  425. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement