修改模板,对Key武将进行分包

This commit is contained in:
Spmario233 2024-05-02 01:00:37 +08:00
parent a6f9e90390
commit aa19a08668
7 changed files with 76 additions and 254 deletions

View File

@ -28,6 +28,7 @@
### 检查清单
<!-- 请在`[]`中加一个`x`来勾选方框且周围没有空格,如下所示:`[x]` -->
- [ ] 我已经进行了充足的测试,且现有的测试都已通过
- [ ] 如果此次PR中添加了新的武将/新的语音文件,则我已在`character/rank.js`中添加对应的武将强度评级/在`lib.translate`中加入语音文件的文字台词
- [ ] 如果此次PR涉及到新功能的添加我已在`PR描述`中写入详细文档
- [ ] 如果此次PR需要扩展跟进我已在`扩展适配`中写入详细文档
- [ ] 如果这个PR解决了一个issue我在`诱因和背景`中明确链接到该issue

View File

@ -142,11 +142,7 @@ const characters = {
group: "key",
hp: 3,
hujia: 2,
skills: [
"sunohara_chengshuang",
"sunohara_tiaoyin",
"sunohara_jianren",
],
skills: ["sunohara_chengshuang", "sunohara_tiaoyin", "sunohara_jianren"],
},
key_rin: {
sex: "female",

View File

@ -5,11 +5,15 @@ import pinyins from "./pinyin.js";
import skills from "./skill.js";
import translates from "./translate.js";
import voices from "./voices.js";
import { characterSort, characterSortTranslate } from "./sort.js";
game.import("character", function () {
return {
name: "key",
character: { ...characters },
characterSort: {
key: characterSort,
},
characterFilter: {
key_jojiro(mode) {
return mode == "chess" || mode == "tafang";
@ -25,74 +29,12 @@ game.import("character", function () {
},
},
characterTitle: {
key_satomi: "#rHeaven Burns Red",
key_erika: "#rHeaven Burns Red",
db_key_liyingxia: "#rHeaven Burns Red",
key_kano: "#bAIR",
key_mia: "#bLoopers",
key_kotomi: "#gClannad<br>技能设计:落英逐紫裙",
key_asara: "#bRewrite",
key_yukito: "#bAIR",
key_chihaya: "#bRewrite",
key_rumi: "#rONE ~輝く季節へ~",
key_youta: "#b神様になった日",
key_sakuya: "#bRewrite",
key_hiroto: "#b神様になった日",
key_shizuku: "#bSummer Pockets",
key_shiroha: "#bSummer Pockets",
key_jojiro: "#bCharlotte<br>战棋专属角色",
key_kotori: "#bRewrite",
key_ryoichi: "#bSummer Pockets",
key_yuu: "#bCharlotte",
key_godan: "#rAngel Beats!",
key_abyusa: "#rAngel Beats!",
key_akiko: "#bKanon",
key_kaori: "#bKanon",
key_shiori: "#bKanon",
key_miki: "#bSummer Pockets",
key_shiorimiyuki: "#rAngel Beats!",
key_shizuru: "#bRewrite",
key_kyoko: "#bSummer Pockets",
sp_key_kanade: "#rAngel Beats!",
key_yuzuru: "#rAngel Beats!",
key_tsumugi: "#bSummer Pockets",
key_ayato: "#rAngel Beats!",
key_nagisa: "#gClannad",
key_tomoya: "#gClannad",
key_noda: "#rAngel Beats!",
key_hinata: "#rAngel Beats!",
key_hisako: "#rAngel Beats!",
key_doruji: "#bLittle Busters!",
key_riki: "#bLittle Busters!",
key_yuiko: "#bLittle Busters!",
key_akane: "#bRewrite",
key_sasami: "#bLittle Busters!",
key_rin: "#bLittle Busters!",
key_shiina: "#rAngel Beats!",
key_inari: "#bSummer Pockets",
key_saya: "#bLittle Busters!",
key_harukakanata: "#bLittle Busters!",
key_yui: "#rAngel Beats!",
key_yoshino: "#bRewrite",
key_kengo: "#bLittle Busters!",
key_iwasawa: "#rAngel Beats!",
key_masato: "#bLittle Busters!",
key_yusa: "#bCharlotte",
key_misa: "#rCharlotte",
key_yukine: "#gClannad",
key_komari: "#bLittle Busters!",
key_umi: "#bSummer Pockets",
key_rei: "#gHarmonia",
key_lucia: "#bRewrite",
key_kyousuke: "#bLittle Busters!",
key_yuri: "#rAngel Beats!",
key_haruko: "#bAIR",
sp_key_yuri: "#bAngel Beats!",
key_fuuko: "#gClannad",
key_kotomi: "#g落英逐紫裙",
key_jojiro: "战棋专属角色",
},
card: { ...cards },
skill: { ...skills },
translate: { ...translates, ...voices },
translate: { ...translates, ...voices, ...characterSortTranslate },
pinyins: { ...pinyins },
};
});

35
character/key/sort.js Normal file
View File

@ -0,0 +1,35 @@
const characterSort = {
key_one: ["key_rumi"],
key_kanon: ["key_shiori", "key_kaori", "key_akiko"],
key_air: ["key_haruko", "key_yukito", "key_crow", "key_kano"],
key_clannad: ["key_yukine", "key_sunohara", "key_tomoya", "key_nagisa", "key_kotomi", "key_fuuko"],
key_littlebusters: ["key_kyousuke", "key_komari", "key_masato", "key_kengo", "key_saya", "key_harukakanata", "key_rin", "key_sasami", "key_doruji", "key_yuiko", "key_riki", "key_mio", "key_midori"],
key_rewrite: ["key_lucia", "key_akane", "key_shizuru", "key_kotori", "key_sakuya", "key_chihaya", "key_asara"],
key_angelbeats: ["sp_key_yuri", "key_yuri", "key_iwasawa", "key_yoshino", "key_yui", "key_shiina", "key_hisako", "key_hinata", "key_noda", "key_ayato", "key_yuzuru", "sp_key_kanade", "key_shiorimiyuki", "key_abyusa", "key_godan"],
key_charlotte: ["key_yusa", "key_misa", "key_yuu", "key_jojiro"],
key_harmonia: ["key_rei"],
key_kamisamaninattahi: ["key_hiroto", "key_youta"],
key_summerpockets: ["key_umi", "key_umi2", "key_tsumugi", "key_inari", "key_ao", "key_kyoko", "key_miki", "key_ryoichi", "key_shiroha", "key_shizuku"],
key_loopers: ["key_mia"],
key_lunaria: ["key_iriya"],
key_heavenburnsred: ["db_key_liyingxia", "key_erika", "key_satomi"],
};
const characterSortTranslate = {
key_one: "ONE ~辉之季节~",
key_kanon: "Kanon",
key_air: "AIR",
key_clannad: "Clannad",
key_littlebusters: "Little Busters!",
key_rewrite: "Rewrite",
key_angelbeats: "Angel Beats!",
key_charlotte: "Charlotte",
key_harmonia: "Harmonia",
key_summerpockets: "Summer Pockets",
key_kamisamaninattahi: "成神之日",
key_loopers: "Loopers",
key_lunaria: "LUNARiA",
key_heavenburnsred: "炽焰天穹",
};
export { characterSort, characterSortTranslate };

View File

@ -1,7 +1,6 @@
window.config = {
extension_sources: {
"GitHub Proxy":
"https://mirror.ghproxy.com/https://raw.githubusercontent.com/libccy/noname-extension/master/",
"GitHub Proxy": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/libccy/noname-extension/master/",
FastGit: "https://raw.fgit.cf/libccy/noname-extension/master/",
GitHub: "https://raw.githubusercontent.com/libccy/noname-extension/master/",
},
@ -9,141 +8,24 @@ window.config = {
forbidai: ["ns_liuzhang"],
forbidai_user: [],
forbidall: [],
forbidstone: [
"zhugedan",
"pal_xuanxiao",
"hs_malfurion",
"lusu",
"chenlin",
"hs_siwangzhiyi",
"gjqt_bailitusu",
"yuanshao",
"swd_anka",
"swd_nicole",
"daqiao",
"re_daqiao",
"hs_xuanzhuanjijia",
"zhuran",
"huatuo",
"swd_tuwei",
"hs_guldan",
"wangyi",
"caoang",
"swd_guyue",
"swd_rongshuang",
"swd_jiangziya",
"guojia",
"re_guojia",
"shen_caocao",
"swd_qiner",
"caopi",
"hs_yngvar",
"guansuo",
"gjqt_aruan",
"swd_hanluo",
"hs_anduin",
"swd_huanglei",
"yxs_yujix",
"yxs_luzhishen",
"swd_muyun",
"ow_tianshi",
"pal_yuejinzhao",
"hs_antonidas",
"xushi",
"hs_lreno",
],
forbidstone: ["zhugedan", "pal_xuanxiao", "hs_malfurion", "lusu", "chenlin", "hs_siwangzhiyi", "gjqt_bailitusu", "yuanshao", "swd_anka", "swd_nicole", "daqiao", "re_daqiao", "hs_xuanzhuanjijia", "zhuran", "huatuo", "swd_tuwei", "hs_guldan", "wangyi", "caoang", "swd_guyue", "swd_rongshuang", "swd_jiangziya", "guojia", "re_guojia", "shen_caocao", "swd_qiner", "caopi", "hs_yngvar", "guansuo", "gjqt_aruan", "swd_hanluo", "hs_anduin", "swd_huanglei", "yxs_yujix", "yxs_luzhishen", "swd_muyun", "ow_tianshi", "pal_yuejinzhao", "hs_antonidas", "xushi", "hs_lreno"],
forbidchess: ["hetaihou", "swd_kangnalishi"],
forbidboss: ["caiwenji", "gjqt_aruan", "pal_xuanxiao", "swd_hupo"],
forbiddouble: [
"zhugedan",
"swd_kangnalishi",
"dongzhuo",
"wutugu",
"hs_siwangzhiyi",
"hs_ronghejuren",
"hs_shanlingjuren",
],
forbidthreecard: [
"qiankunbiao",
"shenhuofeiya",
"gw_ciguhanshuang",
"gw_birinongwu",
"gw_qinpendayu",
"gw_poxiao",
],
forbiddouble: ["zhugedan", "swd_kangnalishi", "dongzhuo", "wutugu", "hs_siwangzhiyi", "hs_ronghejuren", "hs_shanlingjuren"],
forbidthreecard: ["qiankunbiao", "shenhuofeiya", "gw_ciguhanshuang", "gw_birinongwu", "gw_qinpendayu", "gw_poxiao"],
zhinang_tricks: ["guohe", "wuxie", "wuzhong", "dongzhuxianji"],
connect_zhinang_tricks: ["guohe", "wuxie", "wuzhong", "dongzhuxianji"],
all: {
sgscharacters: [
"standard",
"shenhua",
"xinghuoliaoyuan",
"refresh",
"yijiang",
"sp",
"sp2",
"xianding",
"huicui",
"extra",
"old",
"mobile",
"shiji",
"tw",
"yingbian",
"offline",
"jsrg",
"sb",
"clan",
"collab",
"onlyOL",
],
sgscards: [
"standard",
"extra",
"sp",
"guozhan",
"zhulu",
"yingbian",
"yongjian",
],
sgsmodes: [
"identity",
"guozhan",
"versus",
"doudizhu",
"single",
"brawl",
"connect",
],
stockmode: [
"identity",
"guozhan",
"versus",
"boss",
"doudizhu",
"single",
"chess",
"stone",
"connect",
"brawl",
"tafang",
],
sgscharacters: ["standard", "shenhua", "xinghuoliaoyuan", "refresh", "yijiang", "sp", "sp2", "xianding", "huicui", "extra", "old", "mobile", "shiji", "tw", "yingbian", "offline", "jsrg", "sb", "clan", "collab", "onlyOL"],
sgscards: ["standard", "extra", "sp", "guozhan", "zhulu", "yingbian", "yongjian"],
sgsmodes: ["identity", "guozhan", "versus", "doudizhu", "single", "brawl", "connect"],
stockmode: ["identity", "guozhan", "versus", "boss", "doudizhu", "single", "chess", "stone", "connect", "brawl", "tafang"],
stockextension: ["boss", "cardpile", "coin", "wuxing"],
layout: ["default", "newlayout"],
theme: ["woodden", "music", "simple"],
card_font: ["xiaozhuan", "huangcao", "caoshu", "xingshu"],
double_hp: ["hejiansan", "pingjun", "zuidazhi", "zuixiaozhi", "zonghe"],
image_background_filter: [
"default",
"blur",
"gray",
"sepia",
"invert",
"saturate",
"contrast",
"hue",
"brightness",
],
image_background_filter: ["default", "blur", "gray", "sepia", "invert", "saturate", "contrast", "hue", "brightness"],
},
game: "sgs",
@ -247,37 +129,10 @@ window.config = {
sort: "type_sort",
cards: ["standard", "extra"],
characters: [
"standard",
"shenhua",
"sp",
"sp2",
"yijiang",
"refresh",
"xinghuoliaoyuan",
"mobile",
"extra",
"yingbian",
"sb",
"tw",
"offline",
"clan",
"collab",
"xianding",
"huicui",
"shiji",
"jsrg",
"onlyOL",
],
characters: ["standard", "shenhua", "sp", "sp2", "yijiang", "refresh", "xinghuoliaoyuan", "mobile", "extra", "yingbian", "sb", "tw", "offline", "clan", "collab", "xianding", "huicui", "shiji", "jsrg", "onlyOL"],
moderned_chracters: ["key"],
connect_characters: ["diy"],
connect_cards: [
"huanlekapai",
"guozhan",
"sp",
"zhulu",
"yingbian",
"yongjian",
],
connect_cards: ["huanlekapai", "guozhan", "sp", "zhulu", "yingbian", "yongjian"],
plays: [],
extensions: [],
banned: [],
@ -309,29 +164,8 @@ window.config = {
["zhu", "zhong", "nei", "fan", "fan", "fan"],
["zhu", "zhong", "zhong", "nei", "fan", "fan", "fan"],
["zhu", "zhong", "zhong", "nei", "fan", "fan", "fan", "fan"],
[
"zhu",
"zhong",
"zhong",
"zhong",
"nei",
"fan",
"fan",
"fan",
"fan",
],
[
"zhu",
"zhong",
"zhong",
"zhong",
"nei",
"nei",
"fan",
"fan",
"fan",
"fan",
],
["zhu", "zhong", "zhong", "zhong", "nei", "fan", "fan", "fan", "fan"],
["zhu", "zhong", "zhong", "zhong", "nei", "nei", "fan", "fan", "fan", "fan"],
],
choice: {
zhu: 3,

View File

@ -1489,7 +1489,7 @@ export class Game {
* @param {skillInfo} [skillInfo]
* @returns {string[]}
*/
function getAudioList(skill, options, skillInfo, useRawAudio) {
function getAudioList(skill, options, skillInfo) {
const info = skillInfo || lib.skill[skill];
if (!info) {
console.error(new ReferenceError(`parseSkillAudio: Cannot find ${skill} in lib.skill`));
@ -1558,8 +1558,6 @@ export class Game {
}
/**
* 根据skill中的audio,audioname,audioname2和player来获取技能台词列表
* @typedef {[string,number]|string|number|boolean} audioInfo
* @typedef {{audio: audioInfo, audioname?:string[], audioname2?:{[playerName: string]: audioInfo}}} skillInfo
* @param { string } skill 技能名
* @param { Player | Object | string } [player] 角色/角色名
* @param { skillInfo | audioInfo } [skillInfo] 预设的skillInfo/audioInfo(转为skillInfo)覆盖lib.skill[skill]
@ -1574,6 +1572,22 @@ export class Game {
});
return voiceMap;
}
/**
* 根据skill中的audio,audioname,audioname2和player来获取技能台词列表及其对应的源文件名
* @param { string } skill 技能名
* @param { Player | Object | string } [player] 角色/角色名
* @param { skillInfo | audioInfo } [skillInfo] 预设的skillInfo/audioInfo(转为skillInfo)覆盖lib.skill[skill]
* @returns { Object } 语音地址列表
*/
parseSkillTextMap(skill, player, skillInfo) {
const audios = game.parseSkillAudio(skill, player, skillInfo, true);
const voiceMap = {};
audios.forEach(audioname => {
const voiceText = lib.translate[`#${audioname}`];
if (voiceText) voiceMap[audioname] = voiceText;
});
return voiceMap;
}
/**
*
* @param { string } skill

View File

@ -12,7 +12,7 @@ export const importCardPack = generateImportFunction("card", (name) => `../../ca
* @returns {Promise<void>}
*/
export const importCharacterPack = generateImportFunction("character", (name) => {
const alreadyModernCharacterPack = ["key"];
const alreadyModernCharacterPack = lib.config.moderned_chracters || [];
return alreadyModernCharacterPack.includes(name)
? `../../character/${name}/index.js`