Merge pull request #1380 from mengxinzxz/PR-Branch

bugfix;分包调整
This commit is contained in:
Spmario233 2024-05-22 17:27:48 +08:00 committed by GitHub
commit 7ab3d9bf77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 58 additions and 19 deletions

View File

@ -466,8 +466,8 @@ const translates = {
dc_lingcao_prefix: "新杀", dc_lingcao_prefix: "新杀",
dcdufeng: "独锋", dcdufeng: "独锋",
dcdufeng_info: "锁定技。出牌阶段开始时你失去1点体力或废除一个装备栏摸X张牌然后你的攻击范围与使用【杀】的次数上限均为X直到回合结束X为你已废除的装备栏数与损失的体力值之和至多为你的体力上限。", dcdufeng_info: "锁定技。出牌阶段开始时你失去1点体力或废除一个装备栏摸X张牌然后你的攻击范围与使用【杀】的次数上限均为X直到回合结束X为你已废除的装备栏数与损失的体力值之和至多为你的体力上限。",
dc_sp_menghuo: "孟获", dc_sp_menghuo: "新杀SP孟获",
dc_sp_menghuo_prefix: "", dc_sp_menghuo_prefix: "新杀SP",
dcmanwang: "蛮王", dcmanwang: "蛮王",
dcmanwang_info: "出牌阶段你可以弃置任意张牌。然后你依次执行以下选项中的前X项⒈获得〖叛侵〗。⒉摸一张牌。⒊回复1点体力。⒋摸两张牌并失去〖叛侵〗。", dcmanwang_info: "出牌阶段你可以弃置任意张牌。然后你依次执行以下选项中的前X项⒈获得〖叛侵〗。⒉摸一张牌。⒊回复1点体力。⒋摸两张牌并失去〖叛侵〗。",
dcpanqin: "叛侵", dcpanqin: "叛侵",

View File

@ -1,10 +1,10 @@
const characterSort = { const characterSort = {
sp_tianji: ["sunhao", "liuxie", "caoang", "hetaihou", "sunluyu", "ol_wangrong", "zuofen", "ol_bianfuren", "qinghegongzhu", "tengfanglan", "ruiji", "caoxiancaohua", "caoyu"], sp_tianji: ["sunhao", "liuxie", "caoang", "hetaihou", "sunluyu", "ol_wangrong", "zuofen", "ol_bianfuren", "qinghegongzhu", "tengfanglan", "ruiji", "caoxiancaohua", "caoyu"],
sp_sibi: ["ol_lukai", "yangxiu", "guotu", "chenlin", "chengyu", "shixie", "fuwan", "wangyun", "zhugejin", "simalang", "maliang", "buzhi", "dongyun", "kanze", "sunqian", "xizhicai", "sunshao", "duxi", "jianggan", "ol_dengzhi", "ol_yangyi", "ol_dongzhao", "ol_chendeng", "jin_yanghu", "wangyan", "xiahouxuan", "quhuang", "zhanghua", "wangguan", "sunhong", "caoxi", "tianchou"], sp_sibi: ["ol_lukai", "yangxiu", "guotu", "chenlin", "chengyu", "shixie", "fuwan", "wangyun", "zhugejin", "simalang", "maliang", "buzhi", "dongyun", "kanze", "sunqian", "xizhicai", "sunshao", "duxi", "jianggan", "ol_dengzhi", "ol_yangyi", "ol_dongzhao", "ol_chendeng", "jin_yanghu", "wangyan", "xiahouxuan", "quhuang", "zhanghua", "wangguan", "sunhong", "caoxi", "tianchou"],
sp_tianzhu: ["yadan", "liyi", "zhangyan", "niujin", "hejin", "hansui", "wutugu", "yanbaihu", "shamoke", "zhugedan", "huangzu", "gaogan", "tadun", "fanjiangzhangda", "ahuinan", "dongtuna", "ol_wenqin"], sp_tianzhu: ["ol_liupi", "yadan", "liyi", "zhangyan", "niujin", "hejin", "hansui", "wutugu", "yanbaihu", "shamoke", "zhugedan", "huangzu", "gaogan", "tadun", "fanjiangzhangda", "ahuinan", "dongtuna", "ol_wenqin"],
sp_nvshi: ["ol_dingshangwan", "lingju", "guanyinping", "zhangxingcai", "mayunlu", "dongbai", "zhaoxiang", "ol_zhangchangpu", "daxiaoqiao", "jin_guohuai", "ol_hujinding"], sp_nvshi: ["ol_dingshangwan", "lingju", "guanyinping", "zhangxingcai", "mayunlu", "dongbai", "zhaoxiang", "ol_zhangchangpu", "daxiaoqiao", "jin_guohuai", "ol_hujinding"],
sp_shaowei: ["simahui", "zhangbao", "zhanglu", "zhugeguo", "xujing", "zhangling", "huangchengyan", "zhangzhi", "lushi"], sp_shaowei: ["ol_pengyang", "simahui", "zhangbao", "zhanglu", "zhugeguo", "xujing", "zhangling", "huangchengyan", "zhangzhi", "lushi"],
sp_huben: ["duanjiong", "ol_mengda", "caohong", "xiahouba", "zhugeke", "zumao", "wenpin", "litong", "mazhong", "heqi", "quyi", "luzhi", "yuejin", "dingfeng", "wuyan", "ol_zhuling", "tianyu", "huojun", "zhaoyǎn", "dengzhong", "ol_furong", "macheng", "ol_zhangyì", "ol_zhujun", "maxiumatie", "luoxian", "ol_huban", "haopu", "ol_qianzhao"], sp_huben: ["duanjiong", "liupan", "ol_mengda", "caohong", "xiahouba", "zhugeke", "zumao", "wenpin", "litong", "mazhong", "heqi", "quyi", "luzhi", "yuejin", "dingfeng", "wuyan", "ol_zhuling", "tianyu", "huojun", "zhaoyǎn", "dengzhong", "ol_furong", "macheng", "ol_zhangyì", "ol_zhujun", "maxiumatie", "luoxian", "ol_huban", "haopu", "ol_qianzhao"],
sp_liesi: ["lvboshe", "mizhu", "weizi", "ol_liuba", "zhangshiping"], sp_liesi: ["lvboshe", "mizhu", "weizi", "ol_liuba", "zhangshiping"],
sp_default: ["sp_diaochan", "sp_zhaoyun", "sp_sunshangxiang", "sp_caoren", "sp_jiangwei", "sp_machao", "sp_caiwenji", "jsp_guanyu", "jsp_huangyueying", "sp_pangde", "sp_jiaxu", "yuanshu", "sp_zhangliao", "sp_ol_zhanghe", "sp_menghuo", "sp_sunce"], sp_default: ["sp_diaochan", "sp_zhaoyun", "sp_sunshangxiang", "sp_caoren", "sp_jiangwei", "sp_machao", "sp_caiwenji", "jsp_guanyu", "jsp_huangyueying", "sp_pangde", "sp_jiaxu", "yuanshu", "sp_zhangliao", "sp_ol_zhanghe", "sp_menghuo", "sp_sunce"],
sp_qifu: ["ol_feiyi", "caoying", "panshu", "caochun", "yuantanyuanshang", "caoshuang", "wolongfengchu", "guansuo", "baosanniang", "fengfangnv", "jin_zhouchu"], sp_qifu: ["ol_feiyi", "caoying", "panshu", "caochun", "yuantanyuanshang", "caoshuang", "wolongfengchu", "guansuo", "baosanniang", "fengfangnv", "jin_zhouchu"],
@ -12,7 +12,7 @@ const characterSort = {
sp_zhongdan: ["cuiyan", "huangfusong"], sp_zhongdan: ["cuiyan", "huangfusong"],
sp_guozhan2: ["sp_dongzhuo", "liqueguosi", "zhangren"], sp_guozhan2: ["sp_dongzhuo", "liqueguosi", "zhangren"],
sp_others: ["hanba", "caiyang"], sp_others: ["hanba", "caiyang"],
sp_waitforsort: ["ol_luyusheng", "ol_pengyang", "ol_tw_zhangji", "ol_liwan", "ol_liuyan", "liupan", "ol_liupi"], sp_waitforsort: ["ol_luyusheng", "ol_tw_zhangji", "ol_liwan", "ol_liuyan"],
}; };
const characterSortTranslate = { const characterSortTranslate = {

View File

@ -914,10 +914,15 @@ const skills = {
multitarget: true, multitarget: true,
multiline: true, multiline: true,
async content(event, trigger, player) { async content(event, trigger, player) {
const targets = event.targets.slice();
if (targets.length == 1) {
await player.discardPlayerCard("e", targets[0], true);
return;
}
let discardedType = []; let discardedType = [];
for (let i = 0; i < 2; i++) { for (let i = 0; i < 2; i++) {
const target = event.targets[i], const target = targets[i],
other = event.targets[1 - i]; other = targets[1 - i];
let cards = target let cards = target
.getDiscardableCards(player, "e") .getDiscardableCards(player, "e")
.filter(card => parseInt(get.subtype(card).slice("equip".length)) <= 2) .filter(card => parseInt(get.subtype(card).slice("equip".length)) <= 2)

View File

@ -14521,7 +14521,7 @@ const skills = {
break; break;
default: default:
player.logSkill("twlingfa"); player.logSkill("twlingfa");
player.addSkills(["twzhian"], ["twlingfa"]); player.changeSkills(["twzhian"], ["twlingfa"]);
break; break;
} }
} }

View File

@ -2788,10 +2788,14 @@ export class Game {
}, },
addSubPlayer: function (player, content) { addSubPlayer: function (player, content) {
if (player && content && content[0] && content[1] && content[2] && content[3] && content[4]) { if (player && content && content[0] && content[1] && content[2] && content[3] && content[4]) {
var skill = content[0]; var skill = content[0],
list = content[3];
lib.skill[skill] = content[1]; lib.skill[skill] = content[1];
lib.character[skill] = content[2]; lib.character[skill] = content[2];
lib.translate[skill] = content[3]; for (let i = 0; i < list.length; i++) {
if (!list[i]) continue;
lib.translate[skill + ["", "_prefix", "_ab"][i]] = list[i];
}
player.storage[skill] = content[4]; player.storage[skill] = content[4];
} }
}, },

View File

@ -2088,13 +2088,19 @@ export const Content = {
} }
player.storage[current].hp = player.hp; player.storage[current].hp = player.hp;
player.storage[current].maxHp = player.maxHp; player.storage[current].maxHp = player.maxHp;
player.storage[current].hujia = player.hujia;
player.storage[current].hs = player.getCards("h"); player.storage[current].hs = player.getCards("h");
player.storage[current].es = player.getCards("e"); player.storage[current].es = player.getCards("e");
player.lose(player.getCards("he"), ui.special)._triggered = null; player.lose(player.getCards("he"), ui.special)._triggered = null;
var cfg = player.storage[event.directresult]; var cfg = player.storage[event.directresult];
player.storage.subplayer.name2 = event.directresult; player.storage.subplayer.name2 = event.directresult;
player.reinit(current, event.directresult, [cfg.hp, cfg.maxHp]); player.reinit(current, event.directresult, [cfg.hp, cfg.maxHp, cfg.hujia]);
if (player.name == event.directresult || player.name1 == event.directresult) {
const groupx = cfg.group || "qun";
player.group = groupx;
player.node.name.dataset.nature = get.groupnature(groupx);
}
if (cfg.hs.length) player.directgain(cfg.hs); if (cfg.hs.length) player.directgain(cfg.hs);
if (cfg.es.length) player.directequip(cfg.es); if (cfg.es.length) player.directequip(cfg.es);
} }
@ -2103,11 +2109,13 @@ export const Content = {
"step 0"; "step 0";
if (player.storage.subplayer) { if (player.storage.subplayer) {
var current = player.storage.subplayer.name2; var current = player.storage.subplayer.name2;
const goon = player.name == current || player.name1 == current;
if (event.remove) { if (event.remove) {
player.lose(player.getCards("he"), ui.discardPile)._triggered = null; player.lose(player.getCards("he"), ui.discardPile)._triggered = null;
} else { } else {
player.storage[current].hp = player.hp; player.storage[current].hp = player.hp;
player.storage[current].maxHp = player.maxHp; player.storage[current].maxHp = player.maxHp;
player.storage[current].hujia = player.hujia;
player.storage[current].hs = player.getCards("h"); player.storage[current].hs = player.getCards("h");
player.storage[current].es = player.getCards("e"); player.storage[current].es = player.getCards("e");
player.lose(player.getCards("he"), ui.special)._triggered = null; player.lose(player.getCards("he"), ui.special)._triggered = null;
@ -2115,11 +2123,17 @@ export const Content = {
player.reinit(current, player.storage.subplayer.name, [ player.reinit(current, player.storage.subplayer.name, [
player.storage.subplayer.hp, player.storage.subplayer.hp,
player.storage.subplayer.maxHp, player.storage.subplayer.maxHp,
player.storage.subplayer.hujia,
]); ]);
if (goon) {
const groupx = player.storage.subplayer.group || "qun";
player.group = groupx;
player.node.name.dataset.nature = get.groupnature(groupx);
}
player.update(); player.update();
if (event.remove) { if (event.remove) {
if (player.storage[current].onremove) { if (player.storage[current].onremove) {
player.storage[current].onremove(player); player.storage[current].onremove(player, current);
} }
delete player.storage[current]; delete player.storage[current];
player.storage.subplayer.skills.remove(current); player.storage.subplayer.skills.remove(current);
@ -2178,13 +2192,20 @@ export const Content = {
name2: event.directresult, name2: event.directresult,
hp: player.hp, hp: player.hp,
maxHp: player.maxHp, maxHp: player.maxHp,
hujia: player.hujia,
skills: event.list.slice(0), skills: event.list.slice(0),
hs: player.getCards("h"), hs: player.getCards("h"),
es: player.getCards("e"), es: player.getCards("e"),
intro2: cfg.intro2, intro2: cfg.intro2,
group: player.group,
}; };
player.removeSkill(event.list); player.removeSkill(event.list);
player.reinit(source, name, [cfg.hp, cfg.maxHp]); player.reinit(source, name, [cfg.hp, cfg.maxHp, cfg.hujia]);
if (player.name == name || player.name1 == name) {
const groupx = cfg.group || "qun";
player.group = groupx;
player.node.name.dataset.nature = get.groupnature(groupx);
}
player.addSkill("subplayer"); player.addSkill("subplayer");
player.lose(player.getCards("he"), ui.special)._triggered = null; player.lose(player.getCards("he"), ui.special)._triggered = null;
if (cfg.hs.length) player.directgain(cfg.hs); if (cfg.hs.length) player.directgain(cfg.hs);

View File

@ -2716,6 +2716,9 @@ export class Player extends HTMLDivElement {
if (Array.isArray(maxHp)) { if (Array.isArray(maxHp)) {
this.maxHp = maxHp[1]; this.maxHp = maxHp[1];
this.hp = maxHp[0]; this.hp = maxHp[0];
if (typeof maxHp[2] == "number") {
this.hujia = maxHp[2];
}
} else { } else {
var num; var num;
if (maxHp === false) { if (maxHp === false) {
@ -7301,6 +7304,7 @@ export class Player extends HTMLDivElement {
cfg.skills = cfg.skills || []; cfg.skills = cfg.skills || [];
cfg.hp = cfg.hp || 1; cfg.hp = cfg.hp || 1;
cfg.maxHp = cfg.maxHp || 1; cfg.maxHp = cfg.maxHp || 1;
cfg.hujia = cfg.hujia || 0;
cfg.sex = cfg.sex || "male"; cfg.sex = cfg.sex || "male";
cfg.group = cfg.group || "qun"; cfg.group = cfg.group || "qun";
cfg.skill = cfg.skill || _status.event.name; cfg.skill = cfg.skill || _status.event.name;
@ -7311,9 +7315,10 @@ export class Player extends HTMLDivElement {
cfg.source = this.name; cfg.source = this.name;
} }
} }
const list = cfg.caption ? [cfg.caption] : ["", "_prefix", "_ab"].map(str => lib.translate[cfg.name + str]);
game.broadcastAll( game.broadcastAll(
//TODO: 这里直接修改trashBin部分后续需要修改为新写法 //TODO: 这里直接修改trashBin部分后续需要修改为新写法
function (player, skill, cfg) { function (player, skill, list, cfg) {
lib.skill[skill] = { lib.skill[skill] = {
intro: { intro: {
content: cfg.intro || "", content: cfg.intro || "",
@ -7324,7 +7329,7 @@ export class Player extends HTMLDivElement {
subplayer: true, subplayer: true,
}, },
}; };
lib.character[skill] = [cfg.sex, cfg.group, cfg.maxHp, cfg.skills, []]; lib.character[skill] = [cfg.sex, cfg.group, parseFloat(cfg.hp) + "/" + parseFloat(cfg.maxHp) + "/" + parseFloat(cfg.hujia), cfg.skills, lib.character[cfg.name].trashBin || []];
if (Array.isArray(cfg.image)) { if (Array.isArray(cfg.image)) {
cfg.image.forEach(image => lib.character[skill][4].push(image)); cfg.image.forEach(image => lib.character[skill][4].push(image));
} else if (typeof cfg.image == "string") { } else if (typeof cfg.image == "string") {
@ -7332,14 +7337,18 @@ export class Player extends HTMLDivElement {
} else { } else {
lib.character[skill].trashBin.push("character:" + cfg.name); lib.character[skill].trashBin.push("character:" + cfg.name);
} }
lib.translate[skill] = cfg.caption || get.rawName(cfg.name); for (let i = 0; i < list.length; i++) {
if (!list[i]) continue;
lib.translate[skill + ["", "_prefix", "_ab"][i]] = list[i];
}
player.storage[skill] = cfg; player.storage[skill] = cfg;
}, },
this, this,
skill, skill,
list,
cfg cfg
); );
game.addVideo("addSubPlayer", this, [skill, lib.skill[skill], lib.character[skill], lib.translate[skill], { name: cfg.name }]); game.addVideo("addSubPlayer", this, [skill, lib.skill[skill], lib.character[skill], list, { name: cfg.name }]);
this.addSkill(skill); this.addSkill(skill);
return skill; return skill;
} }
@ -7348,7 +7357,7 @@ export class Player extends HTMLDivElement {
this.exitSubPlayer(true); this.exitSubPlayer(true);
} else { } else {
if (player.storage[name].onremove) { if (player.storage[name].onremove) {
player.storage[name].onremove(player); player.storage[name].onremove(player, name);
} }
this.removeSkill(name); this.removeSkill(name);
delete this.storage[name]; delete this.storage[name];