Merge branch 'libccy:PR-Branch' into PR-Branch

This commit is contained in:
157 2024-03-11 17:11:19 +08:00 committed by GitHub
commit 1cc48c43a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 231 additions and 98 deletions

View File

@ -200,6 +200,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 1; return 1;
}, },
async content(player,num=1){ async content(player,num=1){
if(!player.hasCard(lib.filter.cardRecastable,'he')) return;
const {result:{bool,cards}}=await player.chooseCard('重铸'+num+'张牌','he',num,lib.filter.cardRecastable,true).set('ai',lib.skill.zhiheng.check); const {result:{bool,cards}}=await player.chooseCard('重铸'+num+'张牌','he',num,lib.filter.cardRecastable,true).set('ai',lib.skill.zhiheng.check);
if(bool) await player.recast(cards); if(bool) await player.recast(cards);
}, },
@ -304,11 +305,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.getStorage('dcjianzhuan').includes(i)) choices.push(i); if(!player.getStorage('dcjianzhuan').includes(i)) choices.push(i);
} }
if(choices.length){ if(choices.length){
const choice=choices.randomGet(); for(const choice of choices){
for(let i=1;i<=3;i++){ for(let i=1;i<=3;i++){
await info[choice].content(player,1); await info[choice].content(player,1);
} }
} }
}
await player.gainMaxHp(2); await player.gainMaxHp(2);
await player.recover(2); await player.recover(2);
await player.changeSkills(['dcfudou'],['dcjianzhuan']); await player.changeSkills(['dcfudou'],['dcjianzhuan']);
@ -1200,8 +1202,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dczixi:{ dczixi:{
init(){ init(){
game.addGlobalSkill('dczixi_judge'); game.addGlobalSkill('dczixi_judge');
game.broadcastAll((list)=>{ game.broadcastAll(()=>lib.skill.dczixi.video());
list.forEach(name=>{ },
video(){
const list=lib.skill.dczixi.zixiList;
for(const name of list){
const namex='dczixi_'+name; const namex='dczixi_'+name;
if(!lib.card[namex]){ if(!lib.card[namex]){
lib.card[namex]={ lib.card[namex]={
@ -1214,8 +1219,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
lib.translate[namex]=lib.translate[name]+'·姊希'; lib.translate[namex]=lib.translate[name]+'·姊希';
lib.translate[namex+'_info']='由【姊希】技能创造的无效果【'+lib.translate[name]+'】'; lib.translate[namex+'_info']='由【姊希】技能创造的无效果【'+lib.translate[name]+'】';
} }
}); }
},lib.skill.dczixi.zixiList);
}, },
audio:2, audio:2,
trigger:{player:['phaseUseBegin','phaseUseEnd']}, trigger:{player:['phaseUseBegin','phaseUseEnd']},
@ -1229,6 +1233,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zixiList:['lebu','bingliang','shandian'], zixiList:['lebu','bingliang','shandian'],
direct:true, direct:true,
async content(event,trigger,player){ async content(event,trigger,player){
game.addVideo('skill',player,['dczixi',[]]);
const names=lib.skill.dczixi.zixiList.filter(name=>{ const names=lib.skill.dczixi.zixiList.filter(name=>{
return player.countCards('h',card=>{ return player.countCards('h',card=>{
return card.hasGaintag('dcqiqin_tag')&&game.hasPlayer(target=>target.canAddJudge(get.autoViewAs({name:'dczixi_'+name},[card]))); return card.hasGaintag('dcqiqin_tag')&&game.hasPlayer(target=>target.canAddJudge(get.autoViewAs({name:'dczixi_'+name},[card])));

View File

@ -1100,7 +1100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(name=='sha'){ if(name=='sha'){
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']); if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']);
for(var nature of lib.inpile_nature){ for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',j]); if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]);
} }
} }
else if(get.type(name)=='trick'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['锦囊','',name]); else if(get.type(name)=='trick'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['锦囊','',name]);

View File

@ -55,7 +55,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sb_tong:['liucheng','sp_yangwan','sb_xiahoushi','sb_zhangfei','sb_zhaoyun','sb_sunce','sb_zhurong','sb_xiaoqiao'], sb_tong:['liucheng','sp_yangwan','sb_xiahoushi','sb_zhangfei','sb_zhaoyun','sb_sunce','sb_zhurong','sb_xiaoqiao'],
sb_yu:['sb_yujin','sb_lvmeng','sb_huangzhong','sb_huanggai','sb_zhouyu','sb_caoren','sb_ganning','sb_yl_luzhi','sb_huangyueying'], sb_yu:['sb_yujin','sb_lvmeng','sb_huangzhong','sb_huanggai','sb_zhouyu','sb_caoren','sb_ganning','sb_yl_luzhi','sb_huangyueying'],
sb_neng:['sb_huaxiong','sb_sunshangxiang','sb_jiangwei','sb_yuanshao','sb_menghuo','sb_guanyu'], sb_neng:['sb_huaxiong','sb_sunshangxiang','sb_jiangwei','sb_yuanshao','sb_menghuo','sb_guanyu'],
sb_waitforsort:['sb_xunyu'], sb_waitforsort:['sb_xunyu','sb_xiahoudun','sb_gaoshun'],
} }
}, },
characterSubstitute:{ characterSubstitute:{

View File

@ -7727,7 +7727,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
characterReplace:{ characterReplace:{
caoren:['caoren','old_caoren','sb_caoren','new_caoren'], caoren:['caoren','old_caoren','sb_caoren','new_caoren','star_caoren'],
sp_caoren:['sp_caoren','jsp_caoren'], sp_caoren:['sp_caoren','jsp_caoren'],
xiahouyuan:['re_xiahouyuan','ol_xiahouyuan','xiahouyuan'], xiahouyuan:['re_xiahouyuan','ol_xiahouyuan','xiahouyuan'],
huangzhong:['re_huangzhong','ol_huangzhong','sb_huangzhong','huangzhong','jsrg_huangzhong'], huangzhong:['re_huangzhong','ol_huangzhong','sb_huangzhong','huangzhong','jsrg_huangzhong'],
@ -7742,7 +7742,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
pangtong:['pangtong','ol_pangtong','re_pangtong','sb_pangtong'], pangtong:['pangtong','ol_pangtong','re_pangtong','sb_pangtong'],
re_jsp_pangtong:['re_jsp_pangtong','jsrg_pangtong','sp_pangtong'], re_jsp_pangtong:['re_jsp_pangtong','jsrg_pangtong','sp_pangtong'],
taishici:['taishici','re_taishici','ol_sb_taishici'], taishici:['taishici','re_taishici','ol_sb_taishici'],
re_yuanshao:['re_yuanshao','ol_yuanshao','xin_yuanshao','ol_sb_yuanshao','sb_yuanshao'], re_yuanshao:['re_yuanshao','ol_yuanshao','xin_yuanshao','ol_sb_yuanshao','star_yuanshao','sb_yuanshao'],
pangde:['re_pangde','ol_pangde','pangde'], pangde:['re_pangde','ol_pangde','pangde'],
yanwen:['yanwen','ol_yanwen','re_yanwen'], yanwen:['yanwen','ol_yanwen','re_yanwen'],
caopi:['caopi','re_caopi','ps_caopi','sb_caopi'], caopi:['caopi','re_caopi','ps_caopi','sb_caopi'],
@ -7751,7 +7751,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zhurong:['zhurong','ol_zhurong','re_zhurong','sb_zhurong'], zhurong:['zhurong','ol_zhurong','re_zhurong','sb_zhurong'],
sunjian:['sunjian','ol_sunjian','re_sunjian','tw_ol_sunjian'], sunjian:['sunjian','ol_sunjian','re_sunjian','tw_ol_sunjian'],
jiaxu:['jiaxu','re_jiaxu','ns_jiaxu','ps_jiaxu'], jiaxu:['jiaxu','re_jiaxu','ns_jiaxu','ps_jiaxu'],
dongzhuo:['dongzhuo','ol_dongzhuo','re_dongzhuo','sp_dongzhuo','yj_dongzhuo'], dongzhuo:['dongzhuo','ol_dongzhuo','re_dongzhuo','star_dongzhuo','sp_dongzhuo','yj_dongzhuo'],
dengai:['dengai','ol_dengai','re_dengai'], dengai:['dengai','ol_dengai','re_dengai'],
sp_ol_zhanghe:['sp_ol_zhanghe','yj_zhanghe','sp_zhanghe','jsrg_zhanghe'], sp_ol_zhanghe:['sp_ol_zhanghe','yj_zhanghe','sp_zhanghe','jsrg_zhanghe'],
jiangwei:['jiangwei','ol_jiangwei','re_jiangwei','ol_sb_jiangwei','sb_jiangwei','jsrg_jiangwei'], jiangwei:['jiangwei','ol_jiangwei','re_jiangwei','ol_sb_jiangwei','sb_jiangwei','jsrg_jiangwei'],

View File

@ -5793,13 +5793,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<lib.inpile.length;i++){ for(var i=0;i<lib.inpile.length;i++){
var name=lib.inpile[i]; var name=lib.inpile[i];
if(name=='sha'){ if(name=='sha'){
if(event.filterCard(get.autoViewAs({name:name},'unsure'),player,event)) list.push(['基本','','sha']); if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','','sha']);
for(var nature of lib.inpile_nature){ for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name:name,nature:nature},'unsure'),player,event)) list.push(['基本','','sha',j]); if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]);
} }
} }
else if(get.type2(name)=='trick'&&event.filterCard(get.autoViewAs({name:name},'unsure'),player,event)) list.push(['锦囊','',name]); else if(get.type2(name)=='trick'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['锦囊','',name]);
else if(get.type(name)=='basic'&&event.filterCard(get.autoViewAs({name:name},'unsure'),player,event)) list.push(['基本','',name]); else if(get.type(name)=='basic'&&event.filterCard(get.autoViewAs({name},'unsure'),player,event)) list.push(['基本','',name]);
} }
return ui.create.dialog('灭吴',[list,'vcard']); return ui.create.dialog('灭吴',[list,'vcard']);
}, },
@ -6513,7 +6513,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
characterReplace:{ characterReplace:{
wangcan:['wangcan','sp_wangcan','tw_wangcan'], wangcan:['wangcan','sp_wangcan','tw_wangcan'],
sunshao:['sunshao','sp_sunshao'], sunshao:['sunshao','sp_sunshao'],
xunchen:['xunchen','re_xunchen','sp_xunchen','tw_xunchen'], xunchen:['xunchen','re_xunchen','sp_xunchen','tw_xunchen','clan_xunchen'],
xinpi:['xinpi','sp_xinpi'], xinpi:['xinpi','sp_xinpi'],
duyu:['duyu','dc_duyu','sp_duyu','pk_sp_duyu'], duyu:['duyu','dc_duyu','sp_duyu','pk_sp_duyu'],
zhangwen:['zhangwen','sp_zhangwen'], zhangwen:['zhangwen','sp_zhangwen'],
@ -6527,7 +6527,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
liuzhang:['liuzhang','tw_liuzhang'], liuzhang:['liuzhang','tw_liuzhang'],
chenzhen:['sp_chenzhen','tw_chenzhen'], chenzhen:['sp_chenzhen','tw_chenzhen'],
feiyi:['ol_feiyi','feiyi','tw_feiyi'], feiyi:['ol_feiyi','feiyi','tw_feiyi'],
wangling:['dc_wangling','wangling','tw_wangling'], wangling:['dc_wangling','wangling','tw_wangling','clan_wangling'],
qiaogong:['qiaogong','tw_qiaogong'], qiaogong:['qiaogong','tw_qiaogong'],
sp_chendong:['sp_chendong','tw_chendong','chendong'], sp_chendong:['sp_chendong','tw_chendong','chendong'],
sp_jiangqing:['sp_jiangqing','tw_jiangqing','jiangqing'], sp_jiangqing:['sp_jiangqing','tw_jiangqing','jiangqing'],

View File

@ -26385,7 +26385,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sunluyu:['sunluyu','re_sunluyu','mb_sunluyu'], sunluyu:['sunluyu','re_sunluyu','mb_sunluyu'],
jin_simazhao:['jin_simazhao','simazhao','sp_simazhao'], jin_simazhao:['jin_simazhao','simazhao','sp_simazhao'],
jin_wangyuanji:['jin_wangyuanji','wangyuanji','sp_wangyuanji'], jin_wangyuanji:['jin_wangyuanji','wangyuanji','sp_wangyuanji'],
wangyun:['wangyun','dc_wangyun','re_wangyun','jsrg_wangyun','old_wangyun','pe_wangyun'], wangyun:['clan_wangyun','wangyun','dc_wangyun','re_wangyun','jsrg_wangyun','old_wangyun','pe_wangyun'],
zhangliang:['xin_zhangliang','re_zhangliang','zhangliang'], zhangliang:['xin_zhangliang','re_zhangliang','zhangliang'],
lingju:['lingju','old_lingju'], lingju:['lingju','old_lingju'],
guansuo:['guansuo','dc_guansuo'], guansuo:['guansuo','dc_guansuo'],

View File

@ -11053,7 +11053,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jin_simashi:['dc_simashi','jin_simashi','simashi'], jin_simashi:['dc_simashi','jin_simashi','simashi'],
jin_yanghuiyu:['jin_yanghuiyu','yanghuiyu'], jin_yanghuiyu:['jin_yanghuiyu','yanghuiyu'],
taoqian:['re_taoqian','taoqian'], taoqian:['re_taoqian','taoqian'],
sp_liubei:['jsrg_liubei','sp_liubei'], jsp_liubei:['jsrg_liubei','jsp_liubei'],
dongcheng:['re_dongcheng','dongcheng'], dongcheng:['re_dongcheng','dongcheng'],
hucheer:['re_hucheer','hucheer','tw_hucheer'], hucheer:['re_hucheer','hucheer','tw_hucheer'],
nanhualaoxian:['re_nanhualaoxian','nanhualaoxian','jsrg_nanhualaoxian'], nanhualaoxian:['re_nanhualaoxian','nanhualaoxian','jsrg_nanhualaoxian'],

View File

@ -2360,7 +2360,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
diaochan:['diaochan','re_diaochan','sb_diaochan'], diaochan:['diaochan','re_diaochan','sb_diaochan'],
huatuo:['huatuo','re_huatuo','old_huatuo'], huatuo:['huatuo','re_huatuo','old_huatuo'],
huaxiong:['huaxiong','re_huaxiong','old_huaxiong','sb_huaxiong','ol_huaxiong'], huaxiong:['huaxiong','re_huaxiong','old_huaxiong','sb_huaxiong','ol_huaxiong'],
yuanshu:['yuanshu','re_yuanshu','yl_yuanshu','old_yuanshu','ol_yuanshu'], yuanshu:['yuanshu','re_yuanshu','yl_yuanshu','old_yuanshu','ol_yuanshu','star_yuanshu'],
gongsunzan:['gongsunzan','re_gongsunzan','dc_gongsunzan','xin_gongsunzan'], gongsunzan:['gongsunzan','re_gongsunzan','dc_gongsunzan','xin_gongsunzan'],
re_lidian:['re_lidian','old_re_lidian','junk_lidian'], re_lidian:['re_lidian','old_re_lidian','junk_lidian'],
}, },

View File

@ -11541,13 +11541,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.getSkills(null,false,false).filter(function(i){ return target.getSkills(null,false,false).filter(function(i){
return get.is.zhuanhuanji(i,current); return get.is.zhuanhuanji(i,target);
}).length>0; }).length>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var list=target.getSkills(null,false,false).filter(function(i){ var list=target.getSkills(null,false,false).filter(function(i){
return get.is.zhuanhuanji(i,current); return get.is.zhuanhuanji(i,target);
}); });
if(list.length==1){ if(list.length==1){
event._result={control:list[0]}; event._result={control:list[0]};

View File

@ -181,8 +181,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
subSkill:{ subSkill:{
true:{ true:{
audio:'dcsbquanmou',
charlotte:true, charlotte:true,
audio:'dcsbquanmou',
audioname:['dc_sb_simayi_shadow'],
trigger:{source:'damageSource'}, trigger:{source:'damageSource'},
forced:true, forced:true,
popup:false, popup:false,
@ -239,8 +240,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
false:{ false:{
audio:'dcsbquanmou',
charlotte:true, charlotte:true,
audio:'dcsbquanmou',
audioname:['dc_sb_simayi_shadow'],
trigger:{source:'damageBegin2'}, trigger:{source:'damageBegin2'},
forced:true, forced:true,
filter(event,player){ filter(event,player){
@ -288,6 +290,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
dcsbpingliao:{ dcsbpingliao:{
audio:2, audio:2,
audioname:['dc_sb_simayi_shadow'],
trigger:{player:'useCard0'}, trigger:{player:'useCard0'},
forced:true, forced:true,
filter(event,player){ filter(event,player){
@ -3366,8 +3369,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(['equip','delay'].includes(get.type(card))&&player.hasValueTarget(card)&&choices.includes('场上')) return '场上'; if(['equip','delay'].includes(get.type(card))&&player.hasValueTarget(card)&&choices.includes('场上')) return '场上';
var val=get.value(card); var val=get.value(card);
var next=_status.currentPhase; var next=_status.currentPhase;
if(next){
if(trigger.name=='damage') next=next.getNext(); if(trigger.name=='damage') next=next.getNext();
if(get.attitude(player,next)>0&&val>=6||get.attitude(player,next)<0&&val<=4.5) return '牌堆顶'; if(get.attitude(player,next)>0&&val>=6||get.attitude(player,next)<0&&val<=4.5) return '牌堆顶';
}
return '牌堆底'; return '牌堆底';
}()); }());
} }
@ -14722,7 +14727,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dclingfang:'凌芳', dclingfang:'凌芳',
dclingfang_info:'锁定技。准备阶段或当其他角色使用黑色牌结算结束后若你是此牌的目标或你使用黑色牌结算结束后若你不是此牌目标你获得1枚“绞”。', dclingfang_info:'锁定技。准备阶段或当其他角色使用黑色牌结算结束后若你是此牌的目标或你使用黑色牌结算结束后若你不是此牌目标你获得1枚“绞”。',
dcfengying:'风影', dcfengying:'风影',
dcfengying_info:'①一名角色的回合开始时,你记录弃牌堆中所有黑色基本牌或黑色普通锦囊牌的牌名。②每回合每种牌名各限一次。你可以将一张点数不大于“绞”数的手牌当做任意一张〖风影①〗记录中的牌使用。', dcfengying_info:'①一名角色的回合开始时,你记录弃牌堆中所有黑色基本牌或黑色普通锦囊牌的牌名。②每回合每种牌名各限一次。你可以将一张点数不大于“绞”数的手牌当做任意一张〖风影①〗记录中的牌使用(无距离和次数限制)。',
dcshouze:'受责', dcshouze:'受责',
dcshouze_info:'锁定技。结束阶段若你有“绞”你弃1枚“绞”随机获得弃牌堆中的一张黑色牌失去1点体力。', dcshouze_info:'锁定技。结束阶段若你有“绞”你弃1枚“绞”随机获得弃牌堆中的一张黑色牌失去1点体力。',
chengbing:'程秉', chengbing:'程秉',

View File

@ -13973,7 +13973,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sundeng:['sundeng','re_sundeng','ns_sundeng'], sundeng:['sundeng','re_sundeng','ns_sundeng'],
caiyong:['caiyong','re_caiyong'], caiyong:['caiyong','re_caiyong'],
chengong:['chengong','re_chengong','sb_chengong'], chengong:['chengong','re_chengong','sb_chengong'],
xunyou:['xunyou','re_xunyou'], xunyou:['xunyou','re_xunyou','clan_xunyou'],
xuezong:['xuezong','tw_xuezong'], xuezong:['xuezong','tw_xuezong'],
huanghao:['huanghao','dc_huanghao','old_huanghao'], huanghao:['huanghao','dc_huanghao','old_huanghao'],
caorui:['caorui','re_caorui','old_caorui'], caorui:['caorui','re_caorui','old_caorui'],
@ -13982,6 +13982,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zhangsong:['zhangsong','re_zhangsong'], zhangsong:['zhangsong','re_zhangsong'],
zhongyao:['zhongyao','re_zhongyao'], zhongyao:['zhongyao','re_zhongyao'],
liwan:['ol_liwan','liwan'], liwan:['ol_liwan','liwan'],
wuxian:['wuxian','clan_wuxian'],
}, },
translate:{ translate:{
old_huaxiong:'将华雄', old_huaxiong:'将华雄',

View File

@ -3776,6 +3776,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jiachong:['dc_jiachong','jin_jiachong','jiachong'], jiachong:['dc_jiachong','jin_jiachong','jiachong'],
yangyan:['yangyan','old_yangyan'], yangyan:['yangyan','old_yangyan'],
yangzhi:['yangzhi','old_yangzhi'], yangzhi:['yangzhi','old_yangzhi'],
zhongyan:['zhongyan','clan_zhongyan'],
}, },
translate:{ translate:{
jin_zhangchunhua:'晋张春华', jin_zhangchunhua:'晋张春华',

View File

@ -2617,7 +2617,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var evt=evt_list[0],character=evt_list[1]; var evt=evt_list[0],character=evt_list[1];
game.addGlobalSkill(evt); game.addGlobalSkill(evt);
var func=function(map,evt){ var func=function(map,evt,character){
for(var i in map){ for(var i in map){
var player=lib.playerOL[i]; var player=lib.playerOL[i];
if(player){ if(player){
@ -2631,20 +2631,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
} }
game.falseZhu.init('re_caocao');
game.trueZhu.init('ol_sb_yuanshao');
game.trueZhu.hp++;
game.trueZhu.maxHp++;
game.falseZhu.hp++;
game.falseZhu.maxHp++;
game.trueZhu.update();
game.falseZhu.update();
ui.arena.classList.add('choose-character'); ui.arena.classList.add('choose-character');
if(evt=='shishengshibai'){ if(evt=='shishengshibai'){
ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
ui.guanduInfo.innerHTML='十胜十败0'; ui.guanduInfo.innerHTML='十胜十败0';
} }
const showGuanduEvent=function(evt){ const showGuanduEvent=function(evt,character){
if(ui['GuanduEvent_'+evt]) return; if(ui['GuanduEvent_'+evt]) return;
ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true); ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true);
lib.setPopped(ui['GuanduEvent_'+evt],function(){ lib.setPopped(ui['GuanduEvent_'+evt],function(){
@ -2660,10 +2652,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
for(const i in lib.playerOL){ for(const i in lib.playerOL){
const target=lib.playerOL[i]; const target=lib.playerOL[i];
if(target==game.me){ if(target==game.me){
showGuanduEvent(evt); showGuanduEvent(evt,character);
} }
else if(target.isOnline2()){ else if(target.isOnline2()){
target.send(showGuanduEvent,evt); target.send(showGuanduEvent,evt,character);
} }
} }
if(lib.config.background_speak) game.playAudio('skill',evt); if(lib.config.background_speak) game.playAudio('skill',evt);
@ -2674,26 +2666,94 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
dialog.close(); dialog.close();
},5000) },5000)
}; };
game.broadcastAll(func,map,evt); game.broadcastAll(func,map,evt,character);
_status.firstAct=game.falseZhu; _status.firstAct=game.falseZhu;
game.delay(0,5000); game.delay(0,5000);
"step 1" "step 1"
event.falseList=['ol_xiahouyuan','litong','zangba','manchong','xunyu','re_guojia','re_zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ game.falseZhu.chooseButtonOL([
if(!Array.isArray(lib.character[name])) return false; [game.falseZhu,[
lib.character[name][1]='wei'; '请选择武将',
[['caocao'],'characterx'],
],true],
[game.trueZhu,[
'请选择武将',
[['re_yuanshao'],'characterx'],
],true]
],function(player,result){
if(game.online||player==game.me){
player.init(result.links[0]);
}
})
"step 2"
game.broadcastAll(function(result){
for(var i in result){
if(!lib.playerOL[i].name){
lib.playerOL[i].init(result[i].links[0]);
}
lib.playerOL[i].hp++;
lib.playerOL[i].maxHp++;
lib.playerOL[i].update();
}
},result);
"step 3"
event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){
if(lib.characterReplace[name]){
let goon = false;
for(let i of lib.characterReplace[name]){
if(lib.character[i]){
lib.character[i][1] = 'wei';
goon = true;
}
}
return goon;
}
else if(lib.character[name]){
lib.character[name][1] = 'wei';
return true; return true;
}
return false;
}); });
event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_zhanghe','chenlin','re_liubei','yj_jushou','guotufengji','gaolan','sp_xuyou','tianfeng','chunyuqiong','sp_shenpei'].filter(function(name){ event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_ol_zhanghe','chenlin','jsp_liubei','yj_jushou','guotufengji','gaolan','xuyou','tianfeng','chunyuqiong','shenpei'].filter(function(name){
if(!Array.isArray(lib.character[name])) return false; if(lib.characterReplace[name]){
lib.character[name][1]='qun'; let goon = false;
for(let i of lib.characterReplace[name]){
if(lib.character[i]){
lib.character[i][1] = 'qun';
goon = true;
}
}
return goon;
}
else if(lib.character[name]){
lib.character[name][1] = 'qun';
return true; return true;
}
return false;
}); });
game.broadcast(function(list1,list2){ game.broadcast(function(list1,list2){
while(list1.length){ for(let name of list1){
lib.character[list1.shift()][1]='wei'; if(lib.characterReplace[name]){
for(let i of lib.characterReplace[name]){
if(lib.character[i]){
lib.character[i][1] = 'wei';
}
}
}
else if(lib.character[name]){
lib.character[name][1] = 'wei';
}
}
for(let name of list2){
if(lib.characterReplace[name]){
for(let i of lib.characterReplace[name]){
if(lib.character[i]){
lib.character[i][1] = 'qun';
}
}
}
else if(lib.character[name]){
lib.character[name][1] = 'qun';
} }
while(list2.length){
lib.character[list2.shift()][1]='qun';
} }
},event.falseList,event.trueList); },event.falseList,event.trueList);
event.map={}; event.map={};
@ -2702,7 +2762,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(current.identity=='zhong'){ if(current.identity=='zhong'){
var choice=event[current.side+'List'].randomRemove(2); var choice=event[current.side+'List'].randomRemove(2);
event.map[current.playerid]=choice; event.map[current.playerid]=choice;
list.push([current,['请选择武将',[choice,'character']],true]); list.push([current,['请选择武将',[choice,'characterx']],true]);
} }
}); });
game.me.chooseButtonOL(list,function(player,result){ game.me.chooseButtonOL(list,function(player,result){
@ -2710,16 +2770,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.init(result.links[0]); player.init(result.links[0]);
} }
}); });
"step 2" "step 4"
for(var i in result){ for(var i in result){
if(result[i]=='ai'){ if(result[i]=='ai'){
result[i]=event.map[i].randomGet(); result[i]=event.map[i].randomRemove(1)[0];
} }
else result[i]=result[i].links[0]; else result[i]=result[i].links[0];
} }
game.broadcastAll(function(result){ game.broadcastAll(function(result){
for(var i in result){ for(var i in result){
lib.playerOL[i].init(result[i]); if(!lib.playerOL[i].name) lib.playerOL[i].init(result[i]);
} }
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');
@ -2733,14 +2793,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
lib.init.onfree(); lib.init.onfree();
ui.arena.classList.add('choose-character'); ui.arena.classList.add('choose-character');
game.falseZhu.init('re_caocao');
game.trueZhu.init('ol_sb_yuanshao');
game.trueZhu.hp++;
game.trueZhu.maxHp++;
game.falseZhu.hp++;
game.falseZhu.maxHp++;
game.trueZhu.update();
game.falseZhu.update();
var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet(); var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet();
var evt=evt_list[0],character=evt_list[1]; var evt=evt_list[0],character=evt_list[1];
game.addGlobalSkill(evt); game.addGlobalSkill(evt);
@ -2767,25 +2819,68 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
},evt); },evt);
game.me.chooseControl('ok').set('dialog',['###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info'),[[character],'character']]); game.me.chooseControl('ok').set('dialog',['###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info'),[[character],'character']]);
'step 1' 'step 1'
event.falseList=['ol_xiahouyuan','litong','zangba','manchong','xunyu','re_guojia','re_zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ game.falseZhu.chooseButton(['请选择你的武将牌',[['caocao'],'characterx']],true);
if(!Array.isArray(lib.character[name])) return false;
lib.character[name][1]='wei';
return true;
});
event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_zhanghe','chenlin','re_liubei','yj_jushou','guotufengji','gaolan','sp_xuyou','tianfeng','chunyuqiong','sp_shenpei'].filter(function(name){
if(!Array.isArray(lib.character[name])) return false;
lib.character[name][1]='qun';
return true;
});
'step 2' 'step 2'
event.falseZhu_choice = result.links[0];
game.trueZhu.chooseButton(['请选择你的武将牌',[['re_yuanshao'],'characterx']],true);
'step 3'
event.trueZhu_choice = result.links[0];
game.falseZhu.init(event.falseZhu_choice);
game.trueZhu.init(event.trueZhu_choice);
game.trueZhu.hp++;
game.trueZhu.maxHp++;
game.falseZhu.hp++;
game.falseZhu.maxHp++;
game.trueZhu.update();
game.falseZhu.update();
'step 4'
event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){
if(lib.characterReplace[name]){
let goon = false;
for(let i of lib.characterReplace[name]){
if(lib.character[i]){
lib.character[i][1] = 'wei';
goon = true;
}
}
return goon;
}
else if(lib.character[name]){
lib.character[name][1] = 'wei';
return true;
}
return false;
});
event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_ol_zhanghe','chenlin','jsp_liubei','yj_jushou','guotufengji','gaolan','xuyou','tianfeng','chunyuqiong','shenpei'].filter(function(name){
if(lib.characterReplace[name]){
let goon = false;
for(let i of lib.characterReplace[name]){
if(lib.character[i]){
lib.character[i][1] = 'qun';
goon = true;
}
}
return goon;
}
else if(lib.character[name]){
lib.character[name][1] = 'qun';
return true;
}
return false;
});
'step 5'
if(game.me.identity!='zhu'){ if(game.me.identity!='zhu'){
event.choose_me=true; event.choose_me=true;
game.me.chooseButton(['请选择你的武将牌',[event[game.me.side+'List'].randomRemove(2),'character']],true); game.me.chooseButton(['请选择你的武将牌',[event[game.me.side+'List'].randomRemove(2),'characterx']],true);
} }
'step 3' 'step 6'
if(event.choose_me) game.me.init(result.links[0]); if(event.choose_me) game.me.init(result.links[0]);
game.countPlayer(function(current){ game.countPlayer(function(current){
if(current!=game.me&&current.identity=='zhong') current.init(event[current.side+'List'].randomRemove(2)[0]); if(current!=game.me&&current.identity=='zhong'){
let choice = event[current.side+'List'].randomRemove(2)[0];
if(lib.characterReplace[choice]) choice = lib.characterReplace[choice].randomGet();
current.init(choice);
}
}); });
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');
@ -4813,11 +4908,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
prompt: '将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1', prompt: '将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1',
viewAs: function(cards, player) { viewAs: function(cards, player) {
var name = false; var name = false;
if(cards.length){
switch (get.name(cards[0], player)) { switch (get.name(cards[0], player)) {
case 'sha': name = 'shan'; break; case 'sha': name = 'shan'; break;
case 'shan': name = 'sha'; break; case 'shan': name = 'sha'; break;
} }
if (name) return { name: name }; if (name) return { name: name };
}
return null; return null;
}, },
onuse: function(links, player) { onuse: function(links, player) {

View File

@ -2721,6 +2721,18 @@ export class Game extends Uninstantable {
} }
} }
}, },
changeSkin: function (player, map) {
if (!player || !map) return;
player.tempname.remove(map.from);
player.tempname.add(map.to);
player.skin[name] = map.to;
const goon = (!lib.character[map.to]);
if (goon) lib.character[map.to] = ['', '', 0, [], (map.list.find(i => i[0] == map.to) || [map.to, []])[1]];
player.smoothAvatar(map.avatar2);
player.node['avatar' + map.name.slice(4)].setBackground(map.to, 'character');
player.node['avatar' + map.name.slice(4)].show();
if (goon) delete lib.character[map.to];
},
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);

View File

@ -2335,16 +2335,25 @@ export class Player extends HTMLDivElement {
if ((get.character(this[i], 3) || []).includes(skill)) { if ((get.character(this[i], 3) || []).includes(skill)) {
const name = (i == 'name2' ? 'name2' : 'name'); const name = (i == 'name2' ? 'name2' : 'name');
if (this.skin[name] != character) { if (this.skin[name] != character) {
game.broadcastAll((player, name, character, list) => { const origin = this.skin[name];
player.tempname.remove(player.skin[name]); game.broadcastAll((player, name, character, list, origin) => {
player.tempname.remove(origin);
player.tempname.add(character); player.tempname.add(character);
player.skin[name] = character; player.skin[name] = character;
const goon = (!lib.character[character]); const goon = (!lib.character[character]);
if (goon) lib.character[character] = ['', '', 0, [], (list.find(i => i[0] == character) || [character, []])[1]]; if (goon) lib.character[character] = ['', '', 0, [], (list.find(i => i[0] == character) || [character, []])[1]];
player.smoothAvatar(name == 'name2');
player.node['avatar' + name.slice(4)].setBackground(character, 'character'); player.node['avatar' + name.slice(4)].setBackground(character, 'character');
player.node['avatar' + name.slice(4)].show(); player.node['avatar' + name.slice(4)].show();
if (goon) delete lib.character[character]; if (goon) delete lib.character[character];
}, this, name, character, list); }, this, name, character, list, origin);
game.addVideo('changeSkin', this, {
from: origin,
to: character,
name: name,
list: list,
avatar2: name == 'name2',
});
} }
} }
} }

View File

@ -6118,9 +6118,12 @@ export class Library extends Uninstantable {
} }
if (config.connect_versus_mode == '2v2' || config.connect_versus_mode == '3v3') { if (config.connect_versus_mode == '2v2' || config.connect_versus_mode == '3v3') {
map.connect_replace_handcard.show(); map.connect_replace_handcard.show();
if(config.connect_versus_mode == '2v2') map.connect_olfeiyang_four.show();
else map.connect_olfeiyang_four.hide();
} }
else { else {
map.connect_replace_handcard.hide(); map.connect_replace_handcard.hide();
map.connect_olfeiyang_four.hide();
} }
}, },
connect_versus_mode: { connect_versus_mode: {