Merge pull request #1303 from Toukaiteio/bug-fix-daiyosei

修复 issue #1302: 非官方服务器下界左慈化身技能会导致报错问题的修复
This commit is contained in:
Spmario233 2024-05-03 14:21:35 +08:00 committed by GitHub
commit 3f4cdb5e56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 9 deletions

View File

@ -12873,22 +12873,24 @@ game.import("character", function () {
if (player.storage.rehuashen.current != event.card) { if (player.storage.rehuashen.current != event.card) {
const old = player.storage.rehuashen.current; const old = player.storage.rehuashen.current;
player.storage.rehuashen.current = event.card; player.storage.rehuashen.current = event.card;
const sex = get.character(event.card).sex;
game.broadcastAll( game.broadcastAll(
function (player, character, old) { function (player, character, old, sex) {
player.tempname.remove(old); player.tempname.remove(old);
player.tempname.add(character); player.tempname.add(character);
player.sex = lib.character[event.card][0]; player.sex = sex;
}, },
player, player,
event.card, event.card,
old old,
sex
); );
game.log( game.log(
player, player,
"将性别变为了", "将性别变为了",
"#y" + get.translation(lib.character[event.card][0]) + "性" "#y" + get.translation(sex) + "性"
); );
player.changeGroup(lib.character[event.card][1]); player.changeGroup(get.character(event.card).group);
} }
var link = result.control; var link = result.control;
player.storage.rehuashen.current2 = link; player.storage.rehuashen.current2 = link;
@ -12912,8 +12914,8 @@ game.import("character", function () {
player.when("dieBegin").then(() => { player.when("dieBegin").then(() => {
const name = player.name ? player.name : player.name1; const name = player.name ? player.name : player.name1;
if (name) { if (name) {
const sex = get.character(name, 0); const sex = get.character(name).sex;
const group = get.character(name, 1); const group = get.character(name).group;
if (player.sex != sex) { if (player.sex != sex) {
game.broadcastAll( game.broadcastAll(
(player, sex) => { (player, sex) => {
@ -13035,12 +13037,12 @@ game.import("character", function () {
characterInfo = get.character(node.link); characterInfo = get.character(node.link);
let capt = get.translation(character); let capt = get.translation(character);
if (characterInfo) { if (characterInfo) {
capt += `  ${get.translation(characterInfo[0])}`; capt += `  ${get.translation(characterInfo.sex)}`;
let charactergroup; let charactergroup;
const charactergroups = get.is.double(character, true); const charactergroups = get.is.double(character, true);
if (charactergroups) if (charactergroups)
charactergroup = charactergroups.map((i) => get.translation(i)).join("/"); charactergroup = charactergroups.map((i) => get.translation(i)).join("/");
else charactergroup = get.translation(characterInfo[1]); else charactergroup = get.translation(characterInfo.group);
capt += `  ${charactergroup}`; capt += `  ${charactergroup}`;
} }
uiintro.add(capt); uiintro.add(capt);