diff --git a/games/kerrr3/base_files/config.json b/games/kerrr3/base_files/config.json new file mode 100644 index 000000000..fc40cadab --- /dev/null +++ b/games/kerrr3/base_files/config.json @@ -0,0 +1,59 @@ +{ + "name": "Koihime Enbu RyoRaiRai Version 3", + "smashgg_game_id": 22404, + "challonge_game_id": null, + "character_to_codename": { + "Bachō Mōki": { + "codename": "Bacho" + }, + "Chō'un Shiryū": { + "codename": "Choun" + }, + "Chōhi Yokutoku": { + "codename": "Chochi" + }, + "Chōryō Bun'en": { + "codename": "Choryo" + }, + "Gakushin Bunken": { + "codename": "Gakushin" + }, + "Jokō Kōmei": { + "codename": "Joko" + }, + "Kakōton Genjō": { + "codename": "Kakoton" + }, + "Kakōen Myōsai": { + "codename": "Kakoen" + }, + "Kan'u Unchō": { + "codename": "Kanu" + }, + "Kannei Kōha": { + "codename": "Kannei" + }, + "Sonken Kōyū": { + "codename": "Kouyū" + }, + "Ryofu Hōsen": { + "codename": "Ryofu" + }, + "Shūtai Yōhei": { + "codename": "Shutai" + }, + "Sonken Chūbō": { + "codename": "Sonken" + }, + "Sonshōkō": { + "codename": "Sonshoko" + }, + "Sōsō Mōtoku": { + "codename": "Soso" + } + }, + "stage_to_codename": {}, + "version": "1.0", + "description": "Base config to use this game.", + "credits": "Assets ripped from Mizuumi Wiki (https://wiki.gbl.gg/w/Koihime_Enbu/RyoRaiRai_V3)" +} \ No newline at end of file diff --git a/games/kerrr3/base_files/icon/config.json b/games/kerrr3/base_files/icon/config.json new file mode 100644 index 000000000..618c260ae --- /dev/null +++ b/games/kerrr3/base_files/icon/config.json @@ -0,0 +1,8 @@ +{ + "prefix": "icon_", + "postfix": "_", + "type": [ + "icon" + ], + "version": "1.0" +} \ No newline at end of file diff --git a/games/kerrr3/base_files/icon/icon_Bacho_0.png b/games/kerrr3/base_files/icon/icon_Bacho_0.png new file mode 100644 index 000000000..cf34a1bab Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Bacho_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Chochi_0.png b/games/kerrr3/base_files/icon/icon_Chochi_0.png new file mode 100644 index 000000000..c4fc9588d Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Chochi_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Choryo_0.png b/games/kerrr3/base_files/icon/icon_Choryo_0.png new file mode 100644 index 000000000..9c6384501 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Choryo_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Choun_0.png b/games/kerrr3/base_files/icon/icon_Choun_0.png new file mode 100644 index 000000000..d8ff27dcd Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Choun_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Gakushin_0.png b/games/kerrr3/base_files/icon/icon_Gakushin_0.png new file mode 100644 index 000000000..fa5ba995c Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Gakushin_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Joko_0.png b/games/kerrr3/base_files/icon/icon_Joko_0.png new file mode 100644 index 000000000..22cfe3070 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Joko_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Kakoen_0.png b/games/kerrr3/base_files/icon/icon_Kakoen_0.png new file mode 100644 index 000000000..7047dd879 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Kakoen_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Kakoton_0.png b/games/kerrr3/base_files/icon/icon_Kakoton_0.png new file mode 100644 index 000000000..409d60852 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Kakoton_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Kannei_0.png b/games/kerrr3/base_files/icon/icon_Kannei_0.png new file mode 100644 index 000000000..6035884d1 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Kannei_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Kanu_0.png b/games/kerrr3/base_files/icon/icon_Kanu_0.png new file mode 100644 index 000000000..a5fe7c80f Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Kanu_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Kouyuu_0.png b/games/kerrr3/base_files/icon/icon_Kouyuu_0.png new file mode 100644 index 000000000..b065a59cb Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Kouyuu_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Ryofu_0.png b/games/kerrr3/base_files/icon/icon_Ryofu_0.png new file mode 100644 index 000000000..2402addae Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Ryofu_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Shutai_0.png b/games/kerrr3/base_files/icon/icon_Shutai_0.png new file mode 100644 index 000000000..a1fbc9650 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Shutai_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Sonken_0.png b/games/kerrr3/base_files/icon/icon_Sonken_0.png new file mode 100644 index 000000000..7d34791eb Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Sonken_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Sonshoko_0.png b/games/kerrr3/base_files/icon/icon_Sonshoko_0.png new file mode 100644 index 000000000..acc9ebdc5 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Sonshoko_0.png differ diff --git a/games/kerrr3/base_files/icon/icon_Soso_0.png b/games/kerrr3/base_files/icon/icon_Soso_0.png new file mode 100644 index 000000000..2ade328f6 Binary files /dev/null and b/games/kerrr3/base_files/icon/icon_Soso_0.png differ diff --git a/games/kerrr3/base_files/logo.png b/games/kerrr3/base_files/logo.png new file mode 100644 index 000000000..de94af436 Binary files /dev/null and b/games/kerrr3/base_files/logo.png differ diff --git a/games/kerrr3/full/config.json b/games/kerrr3/full/config.json new file mode 100644 index 000000000..27345b290 --- /dev/null +++ b/games/kerrr3/full/config.json @@ -0,0 +1,109 @@ +{ + "name": "Portraits", + "description": "Character portraits", + "prefix": "full_", + "postfix": "_", + "type": [ + "full" + ], + "credits": "Assets ripped from Mizuumi Wiki (https://wiki.gbl.gg/w/Koihime_Enbu/RyoRaiRai_V3)", + "version": "1.0", + "eyesights": { + "Bacho": { + "0": { + "x": 306, + "y": 290 + } + }, + "Chochi": { + "0": { + "x": 856, + "y": 427 + } + }, + "Choryo": { + "0": { + "x": 929, + "y": 194 + } + }, + "Choun": { + "0": { + "x": 529, + "y": 263 + } + }, + "Gakushin": { + "0": { + "x": 387, + "y": 149 + } + }, + "Joko": { + "0": { + "x": 256, + "y": 178 + } + }, + "Kakoen": { + "0": { + "x": 577, + "y": 515 + } + }, + "Kakoton": { + "0": { + "x": 528, + "y": 310 + } + }, + "Kannei": { + "0": { + "x": 412, + "y": 206 + } + }, + "Kanu": { + "0": { + "x": 451, + "y": 361 + } + }, + "Kouy\u016b": { + "0": { + "x": 507, + "y": 162 + } + }, + "Ryofu": { + "0": { + "x": 695, + "y": 467 + } + }, + "Shutai": { + "0": { + "x": 526, + "y": 248 + } + }, + "Sonken": { + "0": { + "x": 570, + "y": 190 + } + }, + "Sonshoko": { + "0": { + "x": 622, + "y": 271 + } + }, + "Soso": { + "0": { + "x": 519, + "y": 217 + } + } + } +} \ No newline at end of file diff --git a/games/kerrr3/full/full_Bacho_0.png b/games/kerrr3/full/full_Bacho_0.png new file mode 100644 index 000000000..ea1f882de Binary files /dev/null and b/games/kerrr3/full/full_Bacho_0.png differ diff --git a/games/kerrr3/full/full_Chochi_0.png b/games/kerrr3/full/full_Chochi_0.png new file mode 100644 index 000000000..a2c258bfb Binary files /dev/null and b/games/kerrr3/full/full_Chochi_0.png differ diff --git a/games/kerrr3/full/full_Choryo_0.png b/games/kerrr3/full/full_Choryo_0.png new file mode 100644 index 000000000..58f35cda2 Binary files /dev/null and b/games/kerrr3/full/full_Choryo_0.png differ diff --git a/games/kerrr3/full/full_Choun_0.png b/games/kerrr3/full/full_Choun_0.png new file mode 100644 index 000000000..117423e4e Binary files /dev/null and b/games/kerrr3/full/full_Choun_0.png differ diff --git a/games/kerrr3/full/full_Gakushin_0.png b/games/kerrr3/full/full_Gakushin_0.png new file mode 100644 index 000000000..9c6eeabfa Binary files /dev/null and b/games/kerrr3/full/full_Gakushin_0.png differ diff --git a/games/kerrr3/full/full_Joko_0.png b/games/kerrr3/full/full_Joko_0.png new file mode 100644 index 000000000..37272e2bf Binary files /dev/null and b/games/kerrr3/full/full_Joko_0.png differ diff --git a/games/kerrr3/full/full_Kakoen_0.png b/games/kerrr3/full/full_Kakoen_0.png new file mode 100644 index 000000000..3cff0228c Binary files /dev/null and b/games/kerrr3/full/full_Kakoen_0.png differ diff --git a/games/kerrr3/full/full_Kakoton_0.png b/games/kerrr3/full/full_Kakoton_0.png new file mode 100644 index 000000000..e550847ad Binary files /dev/null and b/games/kerrr3/full/full_Kakoton_0.png differ diff --git a/games/kerrr3/full/full_Kannei_0.png b/games/kerrr3/full/full_Kannei_0.png new file mode 100644 index 000000000..502404d30 Binary files /dev/null and b/games/kerrr3/full/full_Kannei_0.png differ diff --git a/games/kerrr3/full/full_Kanu_0.png b/games/kerrr3/full/full_Kanu_0.png new file mode 100644 index 000000000..98b60d783 Binary files /dev/null and b/games/kerrr3/full/full_Kanu_0.png differ diff --git a/games/kerrr3/full/full_Kouyuu_0.png b/games/kerrr3/full/full_Kouyuu_0.png new file mode 100644 index 000000000..104982d9a Binary files /dev/null and b/games/kerrr3/full/full_Kouyuu_0.png differ diff --git a/games/kerrr3/full/full_Ryofu_0.png b/games/kerrr3/full/full_Ryofu_0.png new file mode 100644 index 000000000..391d5f6c2 Binary files /dev/null and b/games/kerrr3/full/full_Ryofu_0.png differ diff --git a/games/kerrr3/full/full_Shutai_0.png b/games/kerrr3/full/full_Shutai_0.png new file mode 100644 index 000000000..4fa4c3b48 Binary files /dev/null and b/games/kerrr3/full/full_Shutai_0.png differ diff --git a/games/kerrr3/full/full_Sonken_0.png b/games/kerrr3/full/full_Sonken_0.png new file mode 100644 index 000000000..c595d1c11 Binary files /dev/null and b/games/kerrr3/full/full_Sonken_0.png differ diff --git a/games/kerrr3/full/full_Sonshoko_0.png b/games/kerrr3/full/full_Sonshoko_0.png new file mode 100644 index 000000000..c91e3201a Binary files /dev/null and b/games/kerrr3/full/full_Sonshoko_0.png differ diff --git a/games/kerrr3/full/full_Soso_0.png b/games/kerrr3/full/full_Soso_0.png new file mode 100644 index 000000000..a7f4f9db1 Binary files /dev/null and b/games/kerrr3/full/full_Soso_0.png differ diff --git a/utilities/download_smashgg/game_data.json b/utilities/download_smashgg/game_data.json index 66635d24c..bb4f2aea2 100644 --- a/utilities/download_smashgg/game_data.json +++ b/utilities/download_smashgg/game_data.json @@ -916,5 +916,10 @@ "name": "Plasma Sword: Nightmare of Bilstein", "smashgg_id": 11821, "image_type": "icon" + }, + { + "smashgg_id": 22404, + "name": "Koihime Enbu RyoRaiRai Version 3", + "image_type": "icon" } ] \ No newline at end of file diff --git a/utilities/generate_eyesights_dict/generate_eyesights_dict.py b/utilities/generate_eyesights_dict/generate_eyesights_dict.py index bb36439e8..316a4cfc3 100644 --- a/utilities/generate_eyesights_dict/generate_eyesights_dict.py +++ b/utilities/generate_eyesights_dict/generate_eyesights_dict.py @@ -1,7 +1,7 @@ import json import collections -game_codename = "tekken5dr" +game_codename = "kerrr3" config_path = f"../../games/{game_codename}/base_files/config.json" diff --git a/utilities/get_icons_from_mizuumi/get_icons_from_mizuumi_koihime.py b/utilities/get_icons_from_mizuumi/get_icons_from_mizuumi_koihime.py new file mode 100644 index 000000000..3b08f6c7b --- /dev/null +++ b/utilities/get_icons_from_mizuumi/get_icons_from_mizuumi_koihime.py @@ -0,0 +1,183 @@ +import requests +from bs4 import BeautifulSoup as BS +import json +from pathlib import Path +from unidecode import unidecode + +base_url = "https://wiki.gbl.gg/w/Koihime_Enbu/RyoRaiRai_V3/Chouhi_Yokutoku" + +mizuumi_page = requests.get(base_url) +mizuumi_content = mizuumi_page.text +mizuumi_soup = BS(mizuumi_content, features="html.parser") + +parse_tables = mizuumi_soup.findAll('tr') +for tag in parse_tables: + if "Characters" in str(tag): + character_icons_table = tag.findAll( + 'span', {'style': f'text-align:center; float:left; overflow:hidden; margin-left:1px; margin-right:1px; font-size:1.0'}) + +game_id = 22404 + +download_folder_name = "../download_smashgg/download" +base_files_folder_name = f"{download_folder_name}/base_files" +portraits_folder_name = f"{download_folder_name}/full" +icon_folder_name = f"{base_files_folder_name}/icon" +for folder_name in (download_folder_name, base_files_folder_name, portraits_folder_name, icon_folder_name): + Path(folder_name).mkdir(parents=True, exist_ok=True) + + +def get_icon_from_character_name(character_name): + list_img_tags = mizuumi_soup.findAll('img') + for tag in list_img_tags: + try: + alt_text = tag["alt"] + except: + alt_text = None + if (character_name in alt_text) and ("Icon" in tag["src"]): + smol = f'https://wiki.gbl.gg{tag["src"]}' + beeg = "/".join(smol.replace("/thumb", "").split("/")[:-1]) + return(beeg) + + +def get_portrait(character_name, page_link): + character_page = requests.get(page_link) + character_page_soup = BS(character_page.text, features="html.parser") + character_page_links_tag_list = character_page_soup.findAll('a', href=True) + portrait_wiki_link = None + for tag in character_page_links_tag_list: + link = tag["href"] + if ("_Profile" in link) and ("File:Koihime" in link): + portrait_wiki_link = link + if portrait_wiki_link: + portrait_wiki_page = requests.get( + f"https://wiki.gbl.gg{portrait_wiki_link}") + portrait_wiki_soup = BS(portrait_wiki_page.text, features="html.parser") + portrait_page_links_tag_list = portrait_wiki_soup.findAll('a', href=True) + # print(portrait_page_links_tag_list) + for tag in portrait_page_links_tag_list: + text = tag.get_text() + link = tag["href"] + if ("Original file" in text or "_Profile.png" in text) and "_Profile" in link: + break + return(f"https://wiki.gbl.gg{link}") + else: + return(None) + + +def get_all_links(): + list_characters = [] + list_characters_page = [] + + for character_tag in character_icons_table: + href_tags = character_tag.findAll('a', href=True) + for href_tag in href_tags: + if "Fate Unlimited Codes" not in href_tag["title"]: + list_characters_page.append(f'https://wiki.gbl.gg{href_tag["href"]}') + list_characters.append(href_tag.text) + + character_dict = {} + + for i in range(len(list_characters)): + # icon_link = get_icon_from_character_name( + # list_characters[i].encode("ascii", "ignore").decode()) + icon_link = None + portrait_link = get_portrait( + list_characters[i], list_characters_page[i]) + print(list_characters[i], portrait_link) + character_dict[list_characters[i]] = { + "codename": unidecode(list_characters[i]).replace(' ', '').replace('&', '').replace('.', '').replace('(', '').replace(')', '').replace('-', '').replace("'", ''), + "portrait_url": portrait_link, + "icon_url": icon_link + } + + return(character_dict) + + +def generate_configs(character_dict): + with open(f"../download_smashgg/game_data.json", 'rt') as game_data_file: + game_data = json.loads(game_data_file.read()) + found = False + for game in game_data: + if game.get("smashgg_id") == game_id: + game_name = game.get("name") + image_type = game.get("image_type") + challonge_id = game.get("challonge_id") + found = True + + if not found: + print("Game not found") + exit(1) + + description = "Base config to use this game." + credits = 'Assets ripped from Mizuumi Wiki (https://wiki.gbl.gg/w/Koihime_Enbu/RyoRaiRai_V3)' + version = "1.0" + + config_dict: dict = { + "name": str(game_name), + "smashgg_game_id": game_id, + "challonge_game_id": challonge_id, + "character_to_codename": {}, + "stage_to_codename": {}, + "version": version, + "description": str(description), + "credits": str(credits) + } + + icon_config_dict = { + "prefix": "icon_", + "postfix": "_", + "type": ["icon"], + "version": version + } + + portrait_config_dict = { + "name": "Portraits", + "description": "Character portraits", + "prefix": "full_", + "postfix": "_", + "type": ["full"], + "credits": str(credits), + "version": "1.0" + } + + for character_name in character_dict.keys(): + config_dict["character_to_codename"][character_name] = { + "codename": character_dict.get(character_name).get("codename") + } + + with open(f"{base_files_folder_name}/config.json", 'wt') as main_config_file: + config_file_content = json.dumps(config_dict, indent=2) + main_config_file.write(config_file_content) + + with open(f"{icon_folder_name}/config.json", 'wt') as icon_config_file: + icon_config_file_content = json.dumps(icon_config_dict, indent=2) + icon_config_file.write(icon_config_file_content) + + with open(f"{portraits_folder_name}/config.json", 'wt') as portrait_config_file: + portrait_config_file_content = json.dumps( + portrait_config_dict, indent=2) + portrait_config_file.write(portrait_config_file_content) + + return config_dict, icon_config_dict, portrait_config_dict + + +def download_all_images(character_dict: dict, icon_config_dict, portrait_config_dict): + for character_name in character_dict.keys(): + character_data = character_dict.get(character_name) + icon_filename = f'{icon_folder_name}/{icon_config_dict.get("prefix")}{character_data.get("codename")}{icon_config_dict.get("postfix")}0.png' + portrait_filename = f'{portraits_folder_name}/{portrait_config_dict.get("prefix")}{character_data.get("codename")}{portrait_config_dict.get("postfix")}0.png' + + if character_data.get("icon_url"): + with open(icon_filename, 'wb') as f: + icon_file = requests.get(character_data.get("icon_url")) + f.write(icon_file.content) + if character_data.get("portrait_url"): + with open(portrait_filename, 'wb') as f: + portrait_file = requests.get(character_data.get("portrait_url")) + f.write(portrait_file.content) + + +character_dict = get_all_links() +# print(json.dumps(character_dict, indent=2)) +main_config_dict, icon_config_dict, portrait_config_dict = generate_configs(character_dict) +download_all_images(character_dict, icon_config_dict, portrait_config_dict)