Merge pull request #1326 from copcap/dev

录像部分的功能添加与bug修复;台词添加与修正
This commit is contained in:
Spmario233 2024-05-07 22:27:30 +08:00 committed by GitHub
commit 2bb3bc6489
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 90 additions and 27 deletions

View File

@ -1823,27 +1823,40 @@ const skills = {
if (result.bool) { if (result.bool) {
game.broadcastAll( game.broadcastAll(
function (moved, player) { function (moved, player) {
var tags = ["dctuoyu_fengtian", "dctuoyu_qingqu", "dctuoyu_junshan"];
var cards = [];
for (var i = 0; i < moved.length; i++) {
for (var card of moved[i]) {
cards.unshift(card);
for (var j = 0; j < tags.length; j++) {
if (i == j + 1) {
if (!card.hasGaintag(tags[j] + "_tag")) card.addGaintag(tags[j] + "_tag");
} else {
if (card.hasGaintag(tags[j] + "_tag")) card.removeGaintag(tags[j] + "_tag");
}
}
}
}
if (player == game.me) { if (player == game.me) {
const cards = moved.flat(1).reverse();
game.addVideo("lose", game.me, [get.cardsInfo(cards), [], [], []]); game.addVideo("lose", game.me, [get.cardsInfo(cards), [], [], []]);
for (var i = 0; i < cards.length; i++) { for (var i = 0; i < cards.length; i++) {
cards[i].goto(ui.special); cards[i].goto(ui.special);
} }
game.me.directgain(cards, false); game.me.directgain(cards, false);
} }
var tags = ["dctuoyu_fengtian", "dctuoyu_qingqu", "dctuoyu_junshan"];
var map = {};
for (var i = 0; i < moved.length; i++) {
for (var card of moved[i]) {
for (var j = 0; j < tags.length; j++) {
const tag = `${tags[j]}_tag`;
if (!map[tag]) map[tag] = [[], []];
if (i == j + 1) {
map[tag][0].add(card);
if (!card.hasGaintag(tag)) {
card.addGaintag(tag);
}
} else {
if (card.hasGaintag(tag)) {
map[tag][1].add(card);
card.removeGaintag(tag);
}
}
}
}
}
for (const tag in map) {
if (map[tag][0].length) game.addVideo("addGaintag", player, [get.cardsInfo(map[tag][0]), tag]);
if (map[tag][1].length) game.addVideo("removeGaintag", player, [tag, get.cardsInfo(map[tag][1])]);
}
game.addVideo("delay", null, 1);
}, },
result.moved, result.moved,
player player

View File

@ -4,24 +4,24 @@ export default {
"#mbkuili1": "此犹有转胜之机,吾等切不可自乱。", "#mbkuili1": "此犹有转胜之机,吾等切不可自乱。",
"#mbkuili2": "不患败战于人,但恐军心已溃啊。", "#mbkuili2": "不患败战于人,但恐军心已溃啊。",
"#mb_sp_guanqiujian:die": "汝不讨篡权逆臣,何杀吾讨贼义军……", "#mb_sp_guanqiujian:die": "汝不讨篡权逆臣,何杀吾讨贼义军……",
"#mbqianlong1": "朕为天子,岂忍威权去!", "#mbqianlong1": "朕为天子,岂忍威权去!",
"#mbqianlong2": "朕行之决矣,正使死何惧!", "#mbqianlong2": "朕行之决矣,正使死何惧!",
"#mbqianlong3": "权臣震主,竟视天子于无物!", "#mbqianlong3": "权臣震主,竟视天子于无物!",
"#mbqianlong4": "假以时日,必讨司马一族!", "#mbqianlong4": "假以时日,必讨司马一族!",
"#mbqianlong5": "若安司马于外,或则皇权可收。", "#mbqianlong5": "若安司马于外,或则皇权可收。",
"#mbqianlong6": "暗恤忠君之士,以待破之机。", "#mbqianlong6": "暗恤忠君之士,以待破之机。",
"#mbweitong1": "手无实权难卫统,朦胧睡,睡去还惊。", "#mbweitong1": "手无实权难卫统,朦胧睡,睡去还惊。",
"#mb_caomao:die": "纵不成身死,朕亦为太祖子孙,大魏君王……", "#mb_caomao:die": "纵不成身死,朕亦为太祖子孙,大魏君王……",
"#mbkuangli1": "我已受命弑君,汝等还不散去!", "#mbkuangli1": "我已受命弑君,汝等还不散去!",
"#mbkuangli2": "谁再聚众作乱,我就将其杀之!", "#mbkuangli2": "谁再聚众作乱,我就将其杀之!",
"#mbxiongsi1": "既想杀人灭口,那就同归于尽!", "#mbxiongsi1": "既想杀人灭口,那就同归于尽!",
"#mbxiongsi2": "贾充!你不仁就别怪我不义!", "#mbxiongsi2": "贾充!你不仁就别怪我不义!",
"#chengji:die": "汝等要卸磨杀驴吗?啊……", "#chengji:die": "汝等要卸磨杀驴吗?啊……",
"#mbzuoyou1": "陛下亲讨乱,臣等安不随护!", "#mbzuoyou1": "陛下亲讨乱,臣等安不随护!",
"#mbzuoyou2": "纵有亡身之险,亦忠陛下一人。", "#mbzuoyou2": "纵有亡身之险,亦忠陛下一人。",
"#mbshishou1": "此乃天子御驾,尔等谁敢近前!", "#mbshishou1": "此乃天子御驾,尔等谁敢近前!",
"#mbshishou2": "吾等侍卫在侧,必保陛下无虞!", "#mbshishou2": "吾等侍卫在侧,必保陛下无虞!",
"#lizhaojiaobo:die": "陛下!尔等乱臣,安敢弑君,啊……", "#lizhaojiaobo:die": "陛下!尔等乱臣,安敢弑君,啊……",
"#mbxuetu1": "天子依仗在此,逆贼安扰圣驾。", "#mbxuetu1": "天子依仗在此,逆贼安扰圣驾。",
"#mbxuetu2": "末将救驾来迟,还望陛下恕罪。", "#mbxuetu2": "末将救驾来迟,还望陛下恕罪。",
"#mbweiming1": "诸位东归洛阳,奉愿随驾以护。", "#mbweiming1": "诸位东归洛阳,奉愿随驾以护。",
@ -32,7 +32,7 @@ export default {
"#shoufa2": "毒蛇恶蝎,奉旨而行!", "#shoufa2": "毒蛇恶蝎,奉旨而行!",
"#zhoulin1": "本大王承天大法,岂与诸葛亮小计等同!", "#zhoulin1": "本大王承天大法,岂与诸葛亮小计等同!",
"#zhoulin2": "料一山野书生,安识我南中御兽之术!", "#zhoulin2": "料一山野书生,安识我南中御兽之术!",
"#yuxiang": "啊啊,好大的火光啊!", "#yuxiang": "啊啊,好大的火光啊!",
"#muludawang:die": "啊啊,诸葛亮神人降世,吾等难挡天威。", "#muludawang:die": "啊啊,诸葛亮神人降世,吾等难挡天威。",
"#guimou1": "不过卒合之师,岂是将军之敌乎?", "#guimou1": "不过卒合之师,岂是将军之敌乎?",
"#guimou2": "连鸡势不俱栖,依珪计便可一一解离。", "#guimou2": "连鸡势不俱栖,依珪计便可一一解离。",

View File

@ -15,7 +15,7 @@ export default {
"#starweilin2": "天下事在我,我今为之,谁敢不从?", "#starweilin2": "天下事在我,我今为之,谁敢不从?",
"#starzhangrong1": "尔欲行大事,问过吾掌中兵刃否?", "#starzhangrong1": "尔欲行大事,问过吾掌中兵刃否?",
"#starzhangrong2": "西凉铁骑曳城,天下高楼可摧!", "#starzhangrong2": "西凉铁骑曳城,天下高楼可摧!",
"#starhaoshou1": "满朝主公,试吾剑不利否?", "#starhaoshou1": "满朝诸公,视吾剑不利否?",
"#starhaoshou2": "顺我者生,逆我者十死无生!", "#starhaoshou2": "顺我者生,逆我者十死无生!",
"#star_dongzhuo:die": "美人迷人眼,溢权昏人智……", "#star_dongzhuo:die": "美人迷人眼,溢权昏人智……",
"#starcanxi1": "大势散于天下,全宝玺者其谁?", "#starcanxi1": "大势散于天下,全宝玺者其谁?",

View File

@ -9,6 +9,11 @@ export default {
"#twxiayong1": "一招之差,不足决此战胜负!", "#twxiayong1": "一招之差,不足决此战胜负!",
"#twxiayong2": "这般身手,也敢来战我?", "#twxiayong2": "这般身手,也敢来战我?",
"#tw_wenchou:die": "黄泉路上,你我兄弟亦不可独行……", "#tw_wenchou:die": "黄泉路上,你我兄弟亦不可独行……",
"#twqiaosi1": "身居长位,犹处峭崖之巅。",
"#twqiaosi2": "为长而不得承嗣,岂有善种乎?",
"#twbaizu1": "今袁氏之事,岂独因我?",
"#twbaizu2": "长幼之序不明,何惜操戈以正!",
"#tw_yuantan:die": "咄,儿过我,必使富贵。呃……!",
"#twhuajing1": "瞬息之间,已蕴森罗万象之法!", "#twhuajing1": "瞬息之间,已蕴森罗万象之法!",
"#twhuajing2": "万般兵器,皆由吾心所化!", "#twhuajing2": "万般兵器,皆由吾心所化!",
"#twtianshou1": "既怀远志,此武可助汝成之!", "#twtianshou1": "既怀远志,此武可助汝成之!",
@ -246,7 +251,7 @@ export default {
"#twfengji1": "蜂趋蚁附,皆为道来。", "#twfengji1": "蜂趋蚁附,皆为道来。",
"#twfengji2": "蜂攒蚁集,皆为道往!", "#twfengji2": "蜂攒蚁集,皆为道往!",
"#twyiju1": "鸱张蚁聚,为从天道!", "#twyiju1": "鸱张蚁聚,为从天道!",
"#twyiju2": "黄之道,苍天之示。", "#twyiju2": "黄之道,苍天之示。",
"#twbudao1": "得天之力,从天之道。", "#twbudao1": "得天之力,从天之道。",
"#twbudao2": "黄天大道,泽及苍生。", "#twbudao2": "黄天大道,泽及苍生。",
"#tw_zhangmancheng:die": "天师,曼成尽力了。", "#tw_zhangmancheng:die": "天师,曼成尽力了。",

View File

@ -2988,6 +2988,11 @@ export class Game {
player.node["avatar" + map.name.slice(4)].show(); player.node["avatar" + map.name.slice(4)].show();
if (goon) delete lib.character[map.to]; 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) { skill: function (player, content) {
if (typeof content == "string") { if (typeof content == "string") {
if (lib.skill[content]) lib.skill[content].video(player); if (lib.skill[content]) lib.skill[content].video(player);
@ -3313,7 +3318,21 @@ export class Game {
}, },
removeGaintag: function (player, content) { removeGaintag: function (player, content) {
if (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 player.removeGaintag(content);
} else { } else {
console.log(player); console.log(player);

View File

@ -640,6 +640,7 @@ export const Content = {
event.originGroup = player.group; event.originGroup = player.group;
if (!event.group) event.group = player.group; if (!event.group) event.group = player.group;
var group = event.group; var group = event.group;
game.addVideo("changeGroup", player, group);
player.getHistory("custom").push(event); player.getHistory("custom").push(event);
if (event.broadcast !== false) { if (event.broadcast !== false) {
game.broadcast( game.broadcast(
@ -2774,7 +2775,7 @@ export const Content = {
if (ui.updateVideoMenu) { if (ui.updateVideoMenu) {
ui.updateVideoMenu(); ui.updateVideoMenu();
} }
_status.videoDuration = 1; _status.videoDuration = 1 / parseFloat(lib.config.video_default_play_speed.slice(0, -1));
ui.create.system("返回", function () { ui.create.system("返回", function () {
var mode = localStorage.getItem(lib.configprefix + "playbackmode"); var mode = localStorage.getItem(lib.configprefix + "playbackmode");
if (mode) { if (mode) {
@ -2787,6 +2788,14 @@ export const Content = {
game.playVideo(_status.playback, lib.config.mode); game.playVideo(_status.playback, lib.config.mode);
}); });
ui.create.system("暂停", ui.click.pause, true).id = "pausebutton"; ui.create.system("暂停", ui.click.pause, true).id = "pausebutton";
var atempo = ui.create.system(
"原速",
function () {
_status.videoDuration = 1;
updateDuration();
},
true
);
var slow = ui.create.system( var slow = ui.create.system(
"减速", "减速",
function () { function () {
@ -2804,6 +2813,7 @@ export const Content = {
true true
); );
var updateDuration = function () { var updateDuration = function () {
atempo.innerHTML = `原速(当前${Math.round(100 / _status.videoDuration) / 100}倍速)`;
if (_status.videoDuration > 1) { if (_status.videoDuration > 1) {
slow.classList.add("glow"); slow.classList.add("glow");
} else { } else {
@ -2815,6 +2825,7 @@ export const Content = {
fast.classList.remove("glow"); fast.classList.remove("glow");
} }
}; };
updateDuration();
ui.system.style.display = ""; ui.system.style.display = "";
ui.refresh(ui.system); ui.refresh(ui.system);
ui.system.show(); ui.system.show();

View File

@ -965,6 +965,20 @@ export class Library {
}, },
unfrequent: true, unfrequent: true,
}, },
video_default_play_speed: {
name: "默认录像播放速度",
init: "1x",
intro: "设置播放游戏录像时默认的播放速度",
item: {
"0.25x": "0.25倍速",
"0.5x": "0.5倍速",
"1x": "原速",
"1.5x": "1.5倍速",
"2x": "2倍速",
"4x": "4倍速",
},
unfrequent: true,
},
max_loadtime: { max_loadtime: {
name: "最长载入时间", name: "最长载入时间",
intro: "设置游戏从启动到完成载入所需的最长时间,超过此时间未完成载入会报错,若设备较慢或安装了较多扩展可适当延长此时间", intro: "设置游戏从启动到完成载入所需的最长时间,超过此时间未完成载入会报错,若设备较慢或安装了较多扩展可适当延长此时间",
@ -12812,7 +12826,8 @@ export class Library {
} }
player.playerid = i; player.playerid = i;
player.nickname = info.nickname; 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.identity = info.identity;
player.identityShown = info.identityShown; player.identityShown = info.identityShown;
player.hp = info.hp; player.hp = info.hp;