修复变更势力在录像和联机重连中的问题

This commit is contained in:
copcap 2024-05-06 15:19:40 +08:00
parent b32d9388f6
commit 28b5206aa7
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
3 changed files with 23 additions and 2 deletions

View File

@ -2988,6 +2988,11 @@ export class Game {
player.node["avatar" + map.name.slice(4)].show();
if (goon) delete lib.character[map.to];
},
changeGroup: function (player, targetGroup) {
if (!player || !targetGroup) return;
player.group = targetGroup;
player.node.name.dataset.nature = get.groupnature(targetGroup);
},
skill: function (player, content) {
if (typeof content == "string") {
if (lib.skill[content]) lib.skill[content].video(player);
@ -3313,7 +3318,21 @@ export class Game {
},
removeGaintag: function (player, content) {
if (player && content) {
if (Array.isArray(content)) player.removeGaintag.apply(player, content);
if (Array.isArray(content)) {
const checkMatch = function (l1, l2) {
for (var i = 0; i < l1.length; i++) {
for (var j = 0; j < l2.length; j++) {
if (l2[j].suit == l1[i][0] && l2[j].number == l1[i][1] && l2[j].name == l1[i][2]) {
l2[j].addGaintag(content[0]);
l2.splice(j--, 1);
break;
}
}
}
};
// player.removeGaintag.apply(player, content);
checkMatch(content[1], player.getCards("h"));
}
else player.removeGaintag(content);
} else {
console.log(player);

View File

@ -640,6 +640,7 @@ export const Content = {
event.originGroup = player.group;
if (!event.group) event.group = player.group;
var group = event.group;
game.addVideo("changeGroup", player, group);
player.getHistory("custom").push(event);
if (event.broadcast !== false) {
game.broadcast(

View File

@ -12812,7 +12812,8 @@ export class Library {
}
player.playerid = i;
player.nickname = info.nickname;
player.changeGroup(info.group, false, "nobroadcast");
player.group = info.group;
player.node.name.dataset.nature = get.groupnature(info.group);
player.identity = info.identity;
player.identityShown = info.identityShown;
player.hp = info.hp;