Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

拆了proceed2 #1708

Merged
merged 26 commits into from
Aug 14, 2024
Merged

Conversation

Rintim
Copy link
Contributor

@Rintim Rintim commented Aug 12, 2024

PR受影响的平台

所有平台

诱因和背景

proceed2罪恶滔天,人所不齿,故拆了,顺带改了点内容

PR描述

proceed2拆成了不同函数,虽然大致逻辑没变

Dockerfile中的node.js版本升到了20

现在扩展可以通过增加connect属性来使联机可用,且支持更多的内容


扩展更新

标准的扩展形式如下:

let extension = {
	name: "xxx",
	content: ...,
	precontent: ...,
	package: { ... },
	...
};

现在你可以简单的像添加editable: false来防止他人从游戏中更改扩展一样,添加connect: true来使扩展在联机模式下可加载:

let extension = {
	name: "xxx",
	connect: true,
	content: ...,
	precontent: ...,
	package: { ... },
	...
};

这样就能使扩展在联机模式下也被读取,不用在通过特别的操作来逃逸无名杀的拒绝加载

不过此时,扩展的武将和卡牌依然无法在联机中读取,你需要在武将和卡牌除同样加上connect属性才行:

let extension = {
	name: "xxx",
	connect: true,
	content: ...,
	precontent: ...,
	package: {
		character: {
			character: { ... },
			translate: { ... },
			connect: true,
		},
		card: {
			card: { ... },
			translate: { ... },
			list: [ ... ],
			connect: true,
		},
		...
	},
	...
};

同时现在可以直接在charactercard下写诸如dynamicTranslate等属性:

let extension = {
	name: "xxx",
	connect: true,
	content: ...,
	precontent: ...,
	package: {
		character: {
			character: { ... },
			translate: { ... },
			connect: true,
			dynamicTranslate: { ... },
			characterReplace: { ... },
			...
		},
		card: {
			card: { ... },
			translate: { ... },
			list: [ ... ],
			connect: true,
			cardType: { ... },
			...
		},
		...
	},
	...
};

为啥需要两个connect才能使扩展武将联机

为了方便属性导入,目前的逻辑是直接将处理过的package.character.characterpackage.card.card通过武将包和卡牌包的导入时函数进行导入,而武将包和卡牌包的函数仍然需要判断一遍connect属性,故需要写两遍

从逻辑上来说,不是所有的可联机扩展都对武将/卡牌进行了联机处理,也不是所有可联机武将/卡牌扩展的卡牌/武将都能联机——即使这在无名杀中或许并不常见——故并未做额外处理,联机武将和联机卡牌需要再次设置connect: true才能联机

PR测试

测了,能跑

扩展适配

无需适配,但以前的联机框架能改就改,未来可能会炸

检查清单

  • 我已经进行了充足的测试,且现有的测试都已通过
  • 我没有把该PR提交到master分支
  • 如果此次PR中添加了新的武将,则我已在character/rank.js中添加对应的武将强度评级,并对双人武将/复姓武将添加name:xxx的参数
  • 如果此次PR中添加了新的语音文件,则我已在lib.translate中加入语音文件的文字台词
  • 如果此次PR涉及到新功能的添加,我已在PR描述中写入详细文档
  • 如果此次PR需要扩展跟进,我已在扩展适配中写入详细文档
  • 如果这个PR解决了一个issue,我在诱因和背景中明确链接到该issue
  • 我保证该PR中没有随意修改换行符等内容,没有制造出大量的Diff
  • 我保证该PR遵循项目中.editorconfigeslint.config.mjsprettier.config.mjs所规定的代码样式,并且已经通过prettier格式化过代码

@nonameShijian nonameShijian merged commit 41ec4f4 into libccy:PR-Branch Aug 14, 2024
@Rintim Rintim deleted the Dev-Enhancement-IHateProceed2 branch August 15, 2024 06:40
@Rintim Rintim mentioned this pull request Aug 16, 2024
9 tasks
@nonameShijian nonameShijian mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants