Skip to content

Commit

Permalink
resources: move gLang.kPetNames to resources/pet_names.js
Browse files Browse the repository at this point in the history
This is unused at the moment, but should be useful for the raid
emulator.

This is working towards #1221.
  • Loading branch information
quisquous committed Jul 30, 2020
1 parent bbb8623 commit b17b3be
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 120 deletions.
20 changes: 0 additions & 20 deletions resources/lang/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ class CactbotLanguageCn extends CactbotLanguage {
Pull: '开怪',
});

this.kPetNames = Object.freeze([
// Pulled from http://cafemaker.wakingsands.com/Pet?pretty=true
'绿宝石兽',
'黄宝石兽',
'伊弗利特之灵',
'泰坦之灵',
'迦楼罗之灵',
'朝日小仙女',
'夕月小仙女',
'车式浮空炮塔',
'象式浮空炮塔',
'亚灵神巴哈姆特',
'亚灵神不死鸟',
'炽天使',
'月长宝石兽',
'英雄的掠影',
'后式自走人偶',
'分身',
]);

this.countdownStartRegex = function() {
return Regexes.gameLog({
capture: true,
Expand Down
20 changes: 0 additions & 20 deletions resources/lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ class CactbotLanguageDe extends CactbotLanguage {
Pull: 'Pull',
});

this.kPetNames = Object.freeze([
// Pulled from https://xivapi.com/Pet?pretty=true&language=de
'Smaragd-Karfunkel',
'Topas-Karfunkel',
'Ifrit-Egi',
'Titan-Egi',
'Garuda-Egi',
'Eos',
'Selene',
'Selbstschuss-Gyrocopter TURM',
'Selbstschuss-Gyrocopter LÄUFER',
'Demi-Bahamut',
'Demi-Phönix',
'Seraph',
'Mondstein-Karfunkel',
'Schattenschemen',
'Automaton DAME',
'Gedoppeltes Ich',
]);

this.countdownStartRegex = function() {
return Regexes.gameLog({
capture: true,
Expand Down
20 changes: 0 additions & 20 deletions resources/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ class CactbotLanguageEn extends CactbotLanguage {
Pull: 'Pull',
});

this.kPetNames = Object.freeze([
// Pulled from https://xivapi.com/Pet?pretty=true&language=en
'Emerald Carbuncle',
'Topaz Carbuncle',
'Ifrit-Egi',
'Titan-Egi',
'Garuda-Egi',
'Eos',
'Selene',
'Rook Autoturret',
'Bishop Autoturret',
'Demi-Bahamut',
'Demi-Phoenix',
'Seraph',
'Moonstone Carbuncle',
'Esteem',
'Automaton Queen',
'Bunshin',
]);

this.countdownStartRegex = function() {
return Regexes.gameLog({
capture: true,
Expand Down
20 changes: 0 additions & 20 deletions resources/lang/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ class CactbotLanguageFr extends CactbotLanguage {
Pull: 'Pull',
});

this.kPetNames = Object.freeze([
// Pulled from https://xivapi.com/Pet?pretty=true&language=fr
'Carbuncle émeraude',
'Carbuncle topaze',
'Ifrit-Egi',
'Titan-Egi',
'Garuda-Egi',
'Eos',
'Selene',
'Auto-tourelle Tour',
'Auto-tourelle Fou',
'Demi-Bahamut',
'Demi-Phénix',
'Séraphin',
'Carbuncle hécatolite',
'Estime',
'Automate Reine',
'Ombre',
]);

this.countdownStartRegex = function() {
return Regexes.gameLog({
capture: true,
Expand Down
20 changes: 0 additions & 20 deletions resources/lang/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ class CactbotLanguageJa extends CactbotLanguage {
Pull: 'タゲ取る',
});

this.kPetNames = Object.freeze([
// Pulled from https://xivapi.com/Pet?pretty=true&language=ja
'カーバンクル・エメラルド',
'カーバンクル・トパーズ',
'イフリート・エギ',
'タイタン・エギ',
'ガルーダ・エギ',
'フェアリー・エオス',
'フェアリー・セレネ',
'オートタレット・ルーク',
'オートタレット・ビショップ',
'デミ・バハムート',
'デミ・フェニックス',
'セラフィム',
'カーバンクル・ムーンストーン',
'英雄の影身',
'オートマトン・クイーン',
'分身',
]);

this.countdownStartRegex = function() {
return Regexes.gameLog({
capture: true,
Expand Down
20 changes: 0 additions & 20 deletions resources/lang/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ class CactbotLanguageKo extends CactbotLanguage {
Pull: '풀링',
});

this.kPetNames = Object.freeze([
// Pulled from https://github.com/Ra-Workspace/ffxiv-datamining-ko/blob/master/csv/Pet.csv
'카벙클 에메랄드',
'카벙클 토파즈',
'이프리트 에기',
'타이탄 에기',
'가루다 에기',
'요정 에오스',
'요정 셀레네',
'자동포탑 룩',
'자동포탑 비숍',
'데미바하무트',
'데미피닉스',
'세라핌',
'카벙클 문스톤',
'영웅의 환영',
'자동인형 퀸',
'분신',
]);

this.countdownStartRegex = function() {
return Regexes.gameLog({
capture: true,
Expand Down
118 changes: 118 additions & 0 deletions resources/pet_names.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
'use strict';

// Auto-generated from gen_pet_names.py
// DO NOT EDIT THIS FILE DIRECTLY

const PetNamesByLang = {
'cn': [
'绿宝石兽',
'黄宝石兽',
'伊弗利特之灵',
'泰坦之灵',
'迦楼罗之灵',
'朝日小仙女',
'夕月小仙女',
'车式浮空炮塔',
'象式浮空炮塔',
'亚灵神巴哈姆特',
'亚灵神不死鸟',
'炽天使',
'月长宝石兽',
'英雄的掠影',
'后式自走人偶',
'分身',
],
'de': [
'Smaragd-Karfunkel',
'Topas-Karfunkel',
'Ifrit-Egi',
'Titan-Egi',
'Garuda-Egi',
'Eos',
'Selene',
'Selbstschuss-Gyrocopter TURM',
'Selbstschuss-Gyrocopter LÄUFER',
'Demi-Bahamut',
'Demi-Phönix',
'Seraph',
'Mondstein-Karfunkel',
'Schattenschemen',
'Automaton DAME',
'Gedoppeltes Ich',
],
'en': [
'Emerald Carbuncle',
'Topaz Carbuncle',
'Ifrit-Egi',
'Titan-Egi',
'Garuda-Egi',
'Eos',
'Selene',
'Rook Autoturret',
'Bishop Autoturret',
'Demi-Bahamut',
'Demi-Phoenix',
'Seraph',
'Moonstone Carbuncle',
'Esteem',
'Automaton Queen',
'Bunshin',
],
'fr': [
'Carbuncle émeraude',
'Carbuncle topaze',
'Ifrit-Egi',
'Titan-Egi',
'Garuda-Egi',
'Eos',
'Selene',
'Auto-tourelle Tour',
'Auto-tourelle Fou',
'Demi-Bahamut',
'Demi-Phénix',
'Séraphin',
'Carbuncle hécatolite',
'Estime',
'Automate Reine',
'Ombre',
],
'ja': [
'カーバンクル・エメラルド',
'カーバンクル・トパーズ',
'イフリート・エギ',
'タイタン・エギ',
'ガルーダ・エギ',
'フェアリー・エオス',
'フェアリー・セレネ',
'オートタレット・ルーク',
'オートタレット・ビショップ',
'デミ・バハムート',
'デミ・フェニックス',
'セラフィム',
'カーバンクル・ムーンストーン',
'英雄の影身',
'オートマトン・クイーン',
'分身',
],
'ko': [
'카벙클 에메랄드',
'카벙클 토파즈',
'이프리트 에기',
'타이탄 에기',
'가루다 에기',
'요정 에오스',
'요정 셀레네',
'자동포탑 룩',
'자동포탑 비숍',
'데미바하무트',
'데미피닉스',
'세라핌',
'카벙클 문스톤',
'영웅의 환영',
'자동인형 퀸',
'분신',
],
};

if (typeof module !== 'undefined')
module.exports = PetNamesByLang;
29 changes: 29 additions & 0 deletions util/gen_pet_names.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python

import coinach
import csv
import csv_util
import os

_OUTPUT_FILE = "pet_names.js"


if __name__ == "__main__":
keys = ["Name"]

tables = {}
for lang in ["en", "fr", "de", "ja"]:
reader = coinach.CoinachReader(verbose=True)
tables[lang] = csv_util.make_map(reader.exd("Pet", lang=lang), keys)
tables["cn"] = csv_util.get_cn_table("Pet", keys)
tables["ko"] = csv_util.get_ko_table("Pet", keys)

tables = {lang: [name for name in table.keys() if name] for lang, table in tables.items()}

writer = coinach.CoinachWriter(verbose=True)
writer.write(
os.path.join("resources", _OUTPUT_FILE),
os.path.basename(os.path.abspath(__file__)),
"PetNamesByLang",
tables,
)

0 comments on commit b17b3be

Please sign in to comment.