revert 许攸, someInD

This commit is contained in:
Spmario233 2023-09-25 18:16:09 +08:00
parent 4efdcd827c
commit 56a3a26850
4 changed files with 120 additions and 61 deletions

View File

@ -188,6 +188,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
junk_huangyueying:['female','shu',3,['junkjizhi','junkqicai']],
junk_lidian:['male','wei',3,['xunxun','junkwangxi']],
junk_duanwei:['male','qun',4,['junklangmie']],
junk_xuyou:["male","qun",3,["nzry_chenglve","junkshicai","nzry_cunmu"]],
},
characterFilter:{
key_jojiro:function(mode){
@ -222,7 +223,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
diy_default:["diy_yuji","diy_caiwenji","diy_lukang","diy_zhenji"],
diy_noname:['noname'],
diy_key:["key_lucia","key_kyousuke","key_yuri","key_haruko","key_umi","key_rei","key_komari","key_yukine","key_yusa","key_misa","key_masato","key_iwasawa","key_kengo","key_yoshino","key_yui","key_tsumugi","key_saya","key_harukakanata","key_inari","key_shiina","key_sunohara","key_rin","key_sasami","key_akane","key_doruji","key_yuiko","key_riki","key_hisako","key_hinata","key_noda","key_tomoya","key_nagisa","key_ayato","key_ao","key_yuzuru","sp_key_kanade","key_mio","key_midori","key_kyoko","key_shizuru","key_shiorimiyuki","key_miki","key_shiori","key_kaori","sp_key_yuri","key_akiko","key_abyusa","key_godan","key_yuu","key_ryoichi","key_kotori","key_jojiro","key_shiroha","key_shizuku","key_hiroto","key_sakuya","key_youta","key_rumi","key_chihaya","key_yukito","key_asara","key_kotomi","key_mia","key_kano","db_key_liyingxia","key_erika","key_satomi","key_iriya","key_fuuko"],
diy_trashbin:['old_jiakui','ol_guohuai','junk_zhangrang','old_bulianshi','junk_sunquan','ol_maliang','junk_liubei','junk_huangyueying','junk_lidian','junk_duanwei'],
diy_trashbin:['old_jiakui','ol_guohuai','junk_zhangrang','old_bulianshi','junk_sunquan','ol_maliang','junk_liubei','junk_huangyueying','junk_lidian','junk_duanwei','junk_xuyou'],
},
},
characterIntro:{
@ -12543,6 +12544,64 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
//手杀削弱版许攸
junkshicai:{
audio:'nzry_shicai_2',
trigger:{player:'useCardAfter'},
filter:function(event,player){
if(!event.cards.filterInD('oe').length) return false;
return player.getHistory('useCard',evt=>get.type2(evt.card)==get.type2(event.card)).indexOf(event)==0;
},
prompt2:function(event,player){
const cards=event.cards.filterInD('oe');
return '你可以将'+get.translation(cards)+(cards.length>1?'以任意顺序':'')+'置于牌堆顶,然后摸一张牌';
},
content:function(){
'step 0'
event.cards=trigger.cards.filterInD('oe');
var lose_list=[];
event.cards.forEach(card=>{
var owner=get.owner(card);
if(owner){
var arr=lose_list.find(i=>i[0]==owner);
if(arr) arr[1].push(card);
else lose_list.push([owner,[card]]);
}
});
if(lose_list.length){
game.loseAsync({
lose_list:lose_list,
}).setContent('chooseToCompareLose');
}
'step 1'
if(cards.length>1){
var next=player.chooseToMove('恃才:将牌按顺序置于牌堆顶');
next.set('list',[['牌堆顶',cards]]);
next.set('reverse',((_status.currentPhase&&_status.currentPhase.next)?get.attitude(player,_status.currentPhase.next)>0:false));
next.set('processAI',function(list){
var cards=list[0][1].slice(0);
cards.sort(function(a,b){
return (_status.event.reverse?1:-1)*(get.value(b)-get.value(a));
});
return [cards];
});
}
'step 2'
if(result.bool&&result.moved&&result.moved[0].length) cards=result.moved[0].slice(0);
cards.reverse();
game.cardsGotoPile(cards,'insert');
game.log(player,'将',cards,'置于了牌堆顶');
player.draw();
},
ai:{
reverseOrder:true,
skillTagFilter:function(player){
if(player.getHistory('useCard',function(evt){
return get.type(evt.card)=='equip';
}).length>0) return false;
},
},
},
//削弱版段煨
junklangmie:{
audio:'langmie',
@ -19101,6 +19160,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
junkwangxi_tag:'invisible',
junklangmie:'狼灭',
junklangmie_info:'其他角色的结束阶段开始时你可以选择一项⒈若其本回合内使用过某种类型的牌超过一张则你弃置一张牌并摸两张牌。⒉若其本回合累计造成过的伤害大于1则你弃置一张牌然后对其造成1点伤害。',
junkshicai:"恃才",
junkshicai_info:"当你使用牌结束完毕后,若此牌与你本回合使用的牌类型均不同,则你可以将此牌置于牌堆顶,然后摸一张牌。",
ol_guohuai_ab:'郭淮',
old_jiakui:'通渠贾逵',
ol_guohuai:'三血郭淮',
@ -19113,6 +19174,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
junk_lidian_ab:'李典',
junk_duanwei:'削弱段煨',
junk_duanwei_ab:'段煨',
junk_xuyou:'手杀许攸',
diy_tieba:'吧友设计',
diy_xushi:'玩点论杀·虚实篇',

View File

@ -948,6 +948,7 @@ window.noname_character_rank={
'jsrg_xuyou',
'jsrg_zhangliao',
'jsrg_zhenji',
'junk_xuyou',
],
b:[
'diy_feishi',
@ -2491,6 +2492,7 @@ window.noname_character_rank={
'std_panfeng',
're_caochong',
're_caorui',
'junk_xuyou',
],
}
};

View File

@ -57,7 +57,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"wangping":["male","shu",4,["nzry_feijun","nzry_binglve"],[]],
"luji":["male","wu",3,["nzry_huaiju","nzry_yili","nzry_zhenglun"],[]],
"sunliang":["male","wu",3,["nzry_kuizhu","nzry_zhizheng","nzry_lijun"],['zhu']],
"xuyou":["male","qun",3,["nzry_chenglve","nzry_shicai","nzry_cunmu"],[]],
xuyou:["male","qun",3,["nzry_chenglve","nzry_shicai","nzry_cunmu"]],
"yl_luzhi":["male","qun",3,["nzry_mingren","nzry_zhenliang"],["die_audio"]],
"kuailiangkuaiyue":["male","wei",3,["nzry_jianxiang","nzry_shenshi"],[]],
@ -2157,25 +2157,45 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
nzry_shicai:{
audio:'nzry_shicai_2',
trigger:{player:'useCardAfter'},
filter:function(event,player){
if(!event.cards.filterInD('oe').length) return false;
return player.getHistory('useCard',evt=>get.type2(evt.card)==get.type2(event.card)).indexOf(event)==0;
trigger:{player:['useCardAfter','useCardToTargeted']},
prompt2:function(event,player){
const cards=event.cards.filterInD('oe');
return '你可以将'+get.translation(cards)+(cards.length>1?'以任意顺序':'')+'置于牌堆顶,然后摸一张牌';
},
prompt:function(event,player){
return get.prompt('nzry_shicai')+'(将'+get.translation(event.cards.filterInD('oe'))+'置于牌堆顶)';
filter:function(event,player){
if(!event.cards.someInD()) return false;
let evt=event,type=get.type2(evt.card,false);
if(event.name=='useCardToPlayered'){
if(type!='equip'||player!=event.target) return false;
evt=evt.getParent();
}
else{
if(type=='equip') return false;
}
return !player.hasHistory('useCard',evtx=>{
return evtx!=evt&&get.type2(evtx.card,false)==type;
},evt);
},
check:function(event,player){
if(get.type(event.card)=='equip'){
if(get.subtype(event.card)=='equip6') return true;
if(get.equipResult(player,player,event.card.name)<=0) return true;
var eff1=player.getUseValue(event.card);
var subtype=get.subtype(event.card);
return player.countCards('h',function(card){
return get.subtype(card)==subtype&&player.getUseValue(card)>=eff1;
})>0;
}
return true;
},
content:function(){
'step 0'
event.cards=trigger.cards.filterInD('oe');
var cards=event.cards.filter(card=>get.owner(card));
if(!cards.length){
event.goto(2);
return;
var cards=trigger.cards.filterInD();
if(cards.length==1){
event._result={bool:true,moved:[cards]};
}
event.cards.removeArray(cards);
if(cards.length>1){
var next=player.chooseToMove('恃才:将牌按顺序置于牌堆顶');
else{
var next=player.chooseToMove('恃才:将牌按顺序置于牌堆顶',true);
next.set('list',[['牌堆顶',cards]]);
next.set('reverse',((_status.currentPhase&&_status.currentPhase.next)?get.attitude(player,_status.currentPhase.next)>0:false));
next.set('processAI',function(list){
@ -2186,43 +2206,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return [cards];
});
}
else event._result={bool:true,moved:[cards]};
'step 1'
var cardx=result.moved[0].slice(0);
while(cardx.length){
var card=cardx.pop(),owner=get.owner(card);
owner.lose([card],ui.cardPile,'insert');
game.log(player,'将',card,'置于牌堆顶');
if(result.bool){
var cards=result.moved[0];
cards.reverse();
game.cardsGotoPile(cards,'insert');
game.log(player,'将',cards,'置于牌堆顶');
}
game.updateRoundNumber();
if(!cards.length){
player.draw();
event.finish();
}
'step 2'
if(cards.length>1){
var next=player.chooseToMove('恃才:将牌按顺序置于牌堆顶');
next.set('list',[['牌堆顶',cards]]);
next.set('reverse',((_status.currentPhase&&_status.currentPhase.next)?get.attitude(player,_status.currentPhase.next)>0:false));
next.set('processAI',function(list){
var cards=list[0][1].slice(0);
cards.sort(function(a,b){
return (_status.event.reverse?1:-1)*(get.value(b)-get.value(a));
});
return [cards];
});
}
'step 3'
if(result.bool&&result.moved&&result.moved[0].length) cards=result.moved[0].slice(0);
while(cards.length){
var card=cards.pop();
if(get.position(card,true)=='o'){
card.fix();
ui.cardPile.insertBefore(card,ui.cardPile.firstChild);
game.log(player,'将',card,'置于牌堆顶');
}
}
game.updateRoundNumber();
player.draw();
},
subSkill:{'2':{audio:2}},
@ -3994,7 +3984,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){
if(event.player!=player&&event.player.isIn()){
return event.player.getHistory('lose',function(evt){
return evt.type=='discard'&&evt.getParent('phaseDiscard')==event&&evt.hs.filterInD('d').length>0;
return evt.type=='discard'&&evt.getParent('phaseDiscard')==event&&evt.hs.someInD('d');
}).length>0;
}
return false;
@ -4638,7 +4628,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'useCardAfter'},
forced:true,
filter:function(event,player){
return (event.card.name=='nanman'&&event.player!=player&&event.cards.filterInD().length>0);
return (event.card.name=='nanman'&&event.player!=player&&event.cards.someInD());
},
content:function(){
player.gain(trigger.cards.filterInD(),'gain2');
@ -7751,8 +7741,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"nzry_chenglve1":"成略",
"nzry_chenglve":"成略",
"nzry_chenglve_info":"转换技,出牌阶段限一次,阴:你可以摸一张牌,然后弃置两张手牌。阳:你可以摸两张牌,然后弃置一张手牌。若如此做,直到本回合结束,你使用与弃置牌花色相同的牌无距离和次数限制。",
"nzry_shicai":"恃才",
"nzry_shicai_info":"当你使用牌结束完毕后,若此牌与你本回合使用的牌类型均不同,则你可以将此牌置于牌堆顶,然后摸一张牌。",
"nzry_cunmu":"寸目",
"nzry_cunmu_info":"锁定技,当你摸牌时,改为从牌堆底摸牌。",
"nzry_kuizhu":"溃诛",
@ -8112,6 +8100,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
olkongsheng_info:'①准备阶段开始时你可以将任意张牌置于你的武将牌上称为“箜”。②结束阶段开始时若你有不为装备牌的“箜”则你获得“箜”中的非装备牌然后令一名角色依次使用“箜”中的装备牌并失去1点体力。',
dcwanglie:"往烈",
dcwanglie_info:"①出牌阶段,你对其他角色使用的前两张牌无距离限制。②当你于出牌阶段内使用牌时,你可以令此牌不能被响应,然后你于本阶段内不能使用牌指定其他角色为目标。",
nzry_shicai:"恃才",
nzry_shicai_info:"当你使用非装备牌结算结束后,或成为自己使用装备牌的目标后,若此牌与你本回合使用的牌类型均不同,则你可以将此牌置于牌堆顶,然后摸一张牌。",
shenhua_feng:'神话再临·风',
shenhua_huo:'神话再临·火',

View File

@ -7650,12 +7650,17 @@
enumerable:false,
writable:true,
value:function(pos){
if(!pos) pos='o';
var list=[];
for(var i=0;i<this.length;i++){
if(pos.indexOf(get.position(this[i],true))!=-1) list.push(this[i]);
}
return list;
if(typeof pos!='string') pos='o';
return this.filter(card=>pos.includes(get.position(card,true)));
}
});
Object.defineProperty(Array.prototype, "someInD", {
configurable:true,
enumerable:false,
writable:true,
value:function(pos){
if(typeof pos!='string') pos='o';
return this.some(card=>pos.includes(get.position(card,true)));
}
});
Object.defineProperty(Array.prototype, "contains", {