Merge branch 'PR-Branch' of https://github.com/libccy/noname into PR-Branch

This commit is contained in:
Spmario233 2024-01-09 21:09:01 +08:00
commit 79c5846e47
347 changed files with 158054 additions and 41203 deletions

4
.gitignore vendored
View File

@ -2,8 +2,11 @@
!extension/cardpile !extension/cardpile
!extension/coin !extension/coin
!extension/wuxing !extension/wuxing
!node_modules/@types
!node_modules/noname-typings
!node_modules/options !node_modules/options
!node_modules/ultron !node_modules/ultron
!node_modules/undici-types
!node_modules/ws !node_modules/ws
._* ._*
.DS_Store .DS_Store
@ -21,5 +24,6 @@ localStorage.json
main.js main.js
node_modules node_modules
noname.ico noname.ico
package-lock.json
package.json package.json
Thumbs.db Thumbs.db

BIN
audio/die/caoxian.mp3 Normal file

Binary file not shown.

BIN
audio/die/caoyi.mp3 Normal file

Binary file not shown.

BIN
audio/die/dc_sb_lusu.mp3 Normal file

Binary file not shown.

BIN
audio/die/dc_sb_zhouyu.mp3 Normal file

Binary file not shown.

BIN
audio/die/dc_sunchen.mp3 Normal file

Binary file not shown.

BIN
audio/die/dongwan.mp3 Normal file

Binary file not shown.

BIN
audio/die/mb_chengui.mp3 Normal file

Binary file not shown.

BIN
audio/die/mb_huban.mp3 Normal file

Binary file not shown.

BIN
audio/die/sb_guanyu.mp3 Normal file

Binary file not shown.

BIN
audio/die/xiahoumao.mp3 Normal file

Binary file not shown.

BIN
audio/skill/cuguo1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/cuguo2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcjieling1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcjieling2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dclingxi1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dclingxi2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcmiyi1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcmiyi2.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/skill/dcshengdu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcshengdu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcyinjun1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dcyinjun2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczhifou1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczhifou2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczigu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczigu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczuowei1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/dczuowei2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/guimou1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/guimou2.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/skill/mbdaoshu1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/mbdaoshu2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/mbdaoshu3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/mbyilie1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/mbyilie2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/mbyilie3.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/skill/sbhuoji3.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
audio/skill/sbwusheng1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/sbwusheng2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/sbwusheng3.mp3 Normal file

Binary file not shown.

BIN
audio/skill/sbyijue1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/sbyijue2.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/skill/tongwei1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/tongwei2.mp3 Normal file

Binary file not shown.

BIN
audio/skill/xutuhuanjin.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
audio/skill/zhouxian1.mp3 Normal file

Binary file not shown.

BIN
audio/skill/zhouxian2.mp3 Normal file

Binary file not shown.

View File

@ -123,31 +123,43 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 0; return 0;
}, },
result:{ result:{
target:(player,target)=>{ target:(player,target,card)=>{
if(target&&target.isDying()) return 2; if(target&&target.isDying()) return 2;
if(!target || target._jiu_temp || !target.isPhaseUsing()) return 0; if(!target || target._jiu_temp || !target.isPhaseUsing()) return 0;
if(!target.getCardUsable('sha') || lib.config.mode==='stone'&&!player.isMin()&&player.getActCount()+1>=player.actcount) return 0; let usable=target.getCardUsable('sha');
let shas = player.getCards('hs',card=>get.name(card)==='sha'&&!ui.selected.cards.includes(card)), card; if(!usable || lib.config.mode==='stone'&&!player.isMin()&&player.getActCount()+1>=player.actcount || !target.mayHaveSha(player,'use',card)) return 0;
if(!shas.length || !target.hasSha() || shas.length>1&&(target.getCardUsable('sha')>1 || target.countCards('hs','zhuge'))) return 0; let effs={order:0},temp;
target._jiu_temp = true; target.getCards('hs',i=>{
shas.sort((a,b)=>get.order(b)-get.order(a)); if(get.name(i)!=='sha' || ui.selected.cards.includes(i)) return false;
for(let i=0; i<shas.length; i++){ temp=get.order(i,target);
let tars = []; if(temp<effs.order) return false;
if(lib.filter.filterCard(shas[i],target)) tars = game.filterPlayer(current=>{ if(temp>effs.order) effs={order:temp};
return get.attitude(target,current)<0&&target.canUse(shas[i],current,null,true)&&!current.hasSkillTag('filterDamage',null,{ effs[i.cardid]={
card:i,
target:null,
eff:0
};
});
delete effs.order;
for(let i in effs){
if(!lib.filter.filterCard(effs[i].card,target)) continue;
game.filterPlayer(current=>{
if(get.attitude(target,current)>=0 || !target.canUse(effs[i].card,current,null,true) || current.hasSkillTag('filterDamage',null,{
player:target, player:target,
card:shas[i], card:effs[i].card,
jiu:true jiu:true
})&&get.effect(current,shas[i],target)>0; })) return false;
temp=get.effect(current,effs[i].card,target,player);
if(temp<=effs[i].eff) return false;
effs[i].target=current;
effs[i].eff=temp;
return false;
}); });
if(!tars.length) continue; if(!effs[i].target) continue;
tars.sort((a,b)=>{ if(target.hasSkillTag('directHit_ai',true,{
return get.effect(b,shas[i],target)-get.effect(a,shas[i],target); target:effs[i].target,
}); card:i
if(!tars[0].mayHaveShan(player,'use') || target.hasSkillTag('directHit_ai',true,{ },true) || usable===1&&(target.needsToDiscard()>Math.max(0,3-target.hp) || !effs[i].target.mayHaveShan(player,'use'))){
target:tars[0],
card:shas[i]
},true) || target.needsToDiscard()>Math.max(0,3-target.hp)){
delete target._jiu_temp; delete target._jiu_temp;
return 1; return 1;
} }
@ -192,6 +204,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
game.addVideo('cardDialog',null,[get.translation(target)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]); game.addVideo('cardDialog',null,[get.translation(target)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]);
event.card2=result.cards[0]; event.card2=result.cards[0];
game.log(target,'展示了',event.card2); game.log(target,'展示了',event.card2);
game.addCardKnower(result.cards, 'everyone');
event._result={}; event._result={};
player.chooseToDiscard({suit:get.suit(event.card2)},function(card){ player.chooseToDiscard({suit:get.suit(event.card2)},function(card){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
@ -218,10 +231,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
value:[3,1], value:[3,1],
useful:1, useful:1,
}, },
wuxie:function(target,card,player,viewer,state){ wuxie:function(target,card,player,viewer,status){
let att=get.attitude(viewer,target), eff=get.effect(target,card,player,target); if(get.attitude(viewer,player._trueMe||player)>0) return 0;
if(status*get.attitude(viewer,player)>0&&!player.isMad() || status*eff*att>=0) return 0; if(status*get.attitude(viewer,target)*get.effect(target,card,player,target)>=0) return 0;
if(get.attitude(viewer,player)>=0 || _status.event.getRand('huogong_wuxie')*4>player.countCards('h')) return 0; if(_status.event.getRand('huogong_wuxie')*4>player.countCards('h')) return 0;
}, },
result:{ result:{
player:function(player){ player:function(player){
@ -290,7 +303,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
recastable:true, recastable:true,
ai:{ ai:{
wuxie:(target,card,player,viewer, status)=>{ wuxie:(target,card,player,viewer, status)=>{
if(status*get.attitude(viewer,player)>0&&!player.isMad() || target.hasSkillTag('nodamage') || target.hasSkillTag('nofire') || target.hasSkillTag('nothunder') || get.attitude(viewer,player)>0 || (1+target.countCards('hs'))*_status.event.getRand()>1.57) return 0; if(status*get.attitude(viewer,player._trueMe||player)>0 || target.hasSkillTag('nodamage') || target.hasSkillTag('nofire') || target.hasSkillTag('nothunder') || get.attitude(viewer,player)>0 || (1+target.countCards('hs'))*_status.event.getRand()>1.57) return 0;
}, },
basic:{ basic:{
order:(item,player)=>{ order:(item,player)=>{
@ -425,7 +438,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
value:function(card,player,index,method){ value:function(card,player,index,method){
if(player.isDisabled(2)) return 0.01; if(player.isDisabled(2)) return 0.01;
if(player.getEquips('tengjia').contains(card)){ if(player.getEquips('tengjia').includes(card)){
if(player.hasSkillTag('noDirectDamage')) return 10; if(player.hasSkillTag('noDirectDamage')) return 10;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current!=player&&get.attitude(current,player)<0&&current.hasSkillTag('fireAttack',null,null,true); return current!=player&&get.attitude(current,player)<0&&current.hasSkillTag('fireAttack',null,null,true);
@ -628,8 +641,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var muniu=player.getEquip('muniu'); var muniu=player.getEquip('muniu');
if(!muniu||!muniu.cards||!muniu.cards.length) return; if(!muniu||!muniu.cards||!muniu.cards.length) return;
for(var i of ui.selected.cards){ for(var i of ui.selected.cards){
if(i==muniu&&muniu.cards.contains(card)) return false; if(i==muniu&&muniu.cards.includes(card)) return false;
if(muniu.cards.contains(i)&&card==muniu) return false; if(muniu.cards.includes(i)&&card==muniu) return false;
} }
}, },
}, },
@ -673,7 +686,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var muniu=player.getEquip('muniu'); var muniu=player.getEquip('muniu');
if(!muniu||!muniu.cards) return false; if(!muniu||!muniu.cards) return false;
return event.ss.filter(function(card){ return event.ss.filter(function(card){
return muniu.cards.contains(card); return muniu.cards.includes(card);
}).length>0; }).length>0;
}, },
content:function(){ content:function(){

View File

@ -804,7 +804,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var es=target.getGainableCards(player,'e') var es=target.getGainableCards(player,'e')
if(es.length){ if(es.length){
player.choosePlayerCard('e',target,true).set('es',es).set('filterButton',function(button){ player.choosePlayerCard('e',target,true).set('es',es).set('filterButton',function(button){
return _status.event.es.contains(button.link); return _status.event.es.includes(button.link);
}); });
} }
else{ else{
@ -995,7 +995,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
filterTarget:true, filterTarget:true,
wuxieable:true, wuxieable:true,
content:function(){ content:function(){
if(player.getEnemies().contains(target)){ if(player.getEnemies().includes(target)){
target.getDebuff(); target.getDebuff();
} }
else{ else{

View File

@ -67,7 +67,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
current.chooseToDiscard('he','弃置一张牌,并视为对'+get.translation(target)+'使用一张【杀】,或点击「取消」弃置其一张牌').set('ai',function(card){ current.chooseToDiscard('he','弃置一张牌,并视为对'+get.translation(target)+'使用一张【杀】,或点击「取消」弃置其一张牌').set('ai',function(card){
if(!_status.event.goon) return 0; if(!_status.event.goon) return 0;
return 5-get.value(card); return 5-get.value(card);
}).set('goon',(get.effect(target,{name:'guohe'},current)<get.effect(target,{name:'sha'},current))); }).set('goon',(get.effect(target,{name:'guohe'},current)<get.effect(current,{name:'guohe'},current)+get.effect(target,{name:'sha'},current)));
} }
else{ else{
current.chooseBool('是否视为对'+get.translation(target)+'使用一张【杀】?','若点击「取消」则改为获得其一张牌').set('ai',function(){ current.chooseBool('是否视为对'+get.translation(target)+'使用一张【杀】?','若点击「取消」则改为获得其一张牌').set('ai',function(){
@ -164,7 +164,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
'step 3' 'step 3'
event.give_cards=event.give_cards.filterInD('d'); event.give_cards=event.give_cards.filterInD('d');
if(!event.give_cards.length||!game.hasPlayer(function(current){ if(!event.give_cards.length||!game.hasPlayer(function(current){
return current!=target&&current.identity=='wu'&&!event.given_list.contains(current); return current!=target&&current.identity=='wu'&&!event.given_list.includes(current);
})) event.finish(); })) event.finish();
else{ else{
target.chooseButton(['是否将弃置的牌交给其他吴势力角色?',event.give_cards],[1,2]); target.chooseButton(['是否将弃置的牌交给其他吴势力角色?',event.give_cards],[1,2]);
@ -173,7 +173,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
event.cards2=result.links; event.cards2=result.links;
target.chooseTarget(true,'选择获得'+get.translation(event.cards2)+'的角色',function(card,player,target){ target.chooseTarget(true,'选择获得'+get.translation(event.cards2)+'的角色',function(card,player,target){
return target!=player&&target.identity=='wu'&&!_status.event.targets.contains(target); return target!=player&&target.identity=='wu'&&!_status.event.targets.includes(target);
}).set('targets',event.given_list); }).set('targets',event.given_list);
} }
else event.finish(); else event.finish();
@ -225,7 +225,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){
player.chooseControl().set('prompt','文和乱武:请选择一项').set('choiceList',[ player.chooseControl().set('prompt','文和乱武:请选择一项').set('choiceList',[
'令'+str+'弃置两张类型不同的手牌', '令'+str+'弃置两张类型不同的手牌',
'弃置'+str+'的一张手牌', '弃置'+str+'的一张手牌',
]); ]).set('ai',()=>{
let target=_status.event.getParent().target,hs=target.getCards('h'),type=[],att=get.attitude(_status.event.player,target);
if(hs.length<2) return att>0?1:0;
hs.forEach(i=>{
type.add(get.type2(i,target));
});
if(target.identity!=='qun'){
if(Boolean(att>0)===Boolean(type.length>1)) return 1;
return 0;
}
if(type.length<2||target.hp<3) return att>0?1:0;
if(hs.length===2) return att>0?0:1;
return att>0?1:0;
});
'step 2' 'step 2'
if(result.index==0){ if(result.index==0){
var list=[],hs=target.getCards('h'); var list=[],hs=target.getCards('h');
@ -530,7 +543,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
if(get.cardtag(card,'yingbian_add')){ if(get.cardtag(card,'yingbian_add')){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0;
})) base+=6; })) base+=6;
} }
return 0; return 0;
@ -629,7 +642,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
contentBefore:function(){ contentBefore:function(){
if(get.mode()=='guozhan'){ if(get.mode()=='guozhan'){
var evt=event.getParent(); var evt=event.getParent();
if(evt&&evt.targets&&evt.targets.contains(player)){ if(evt&&evt.targets&&evt.targets.includes(player)){
evt.fixedSeat=true; evt.fixedSeat=true;
evt.targets.sortBySeat(); evt.targets.sortBySeat();
evt.targets.remove(player); evt.targets.remove(player);
@ -708,13 +721,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
selectTarget:-1, selectTarget:-1,
chooseai:function(event,player){ chooseai:function(event,player){
if(player.hasSkillTag('mingzhi_yes')) return '选项一'; if(player.hasSkillTag('mingzhi_yes')) return '选项一';
if(_status.event.controls.contains('选项三')){ if(_status.event.controls.includes('选项三')){
if(player.hasSkillTag('mingzhi_no')) return '选项三'; if(player.hasSkillTag('mingzhi_no')) return '选项三';
return Math.random()<0.5?'选项一':'选项三'; return Math.random()<0.5?'选项一':'选项三';
} }
else{ else{
if(_status.event.getParent().nomingzhi){ if(_status.event.getParent().nomingzhi){
if(_status.event.controls.contains('选项二')) return '选项二'; if(_status.event.controls.includes('选项二')) return '选项二';
return '选项一'; return '选项一';
} }
if(player.hasSkillTag('maixie_hp')||player.hp<=2) return '选项一'; if(player.hasSkillTag('maixie_hp')||player.hp<=2) return '选项一';
@ -772,7 +785,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
_status.chiling=true; _status.chiling=true;
currentPhase.addTempSkill('g_chiling3'); currentPhase.addTempSkill('g_chiling3');
} }
if(!lib.inpile.contains('zhaoshu')){ if(!lib.inpile.includes('zhaoshu')){
lib.inpile.push('zhaoshu'); lib.inpile.push('zhaoshu');
var card=game.createCard2('zhaoshu','club',3); var card=game.createCard2('zhaoshu','club',3);
game.log(card,'被置于了牌堆底'); game.log(card,'被置于了牌堆底');
@ -1006,7 +1019,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
result:{ result:{
player:function(player,target){ player:function(player,target){
if(player.countCards('h')<=player.hp) return 0; if(player.countCards('h')<=player.hp) return 0;
if(player.storage.zhibi&&player.storage.zhibi.contains(target)) return 0; if(player.storage.zhibi&&player.storage.zhibi.includes(target)) return 0;
return target.isUnseen()?1:0; return target.isUnseen()?1:0;
} }
} }
@ -1133,7 +1146,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
['club',12,'gz_wenheluanwu'], ['club',12,'gz_wenheluanwu'],
]; ];
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(lib.inpile.contains(list[i][2])) list.splice(i--,1); if(lib.inpile.includes(list[i][2])) list.splice(i--,1);
} }
if(list.length){ if(list.length){
var card=list.randomGet(); var card=list.randomGet();
@ -1227,7 +1240,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
equipSkill:true, equipSkill:true,
mod:{ mod:{
canBeReplaced:function(card,player){ canBeReplaced:function(card,player){
if(player.getEquips('liulongcanjia').contains(card)) return false; if(player.getEquips('liulongcanjia').includes(card)) return false;
}, },
}, },
}, },
@ -1239,7 +1252,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return get.effect(event.target,event.card,event.player,player)<0; return get.effect(event.target,event.card,event.player,player)<0;
}, },
filter:function(event,player){ filter:function(event,player){
if(['huoshaolianying','huogong'].contains(event.card.name)) return true; if(['huoshaolianying','huogong'].includes(event.card.name)) return true;
if(event.card.name=='sha') return game.hasNature(event.card,'fire'); if(event.card.name=='sha') return game.hasNature(event.card,'fire');
return false; return false;
}, },
@ -1249,7 +1262,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(['huoshaolianying','huogong'].contains(card.name)||(card.name=='sha'&&game.hasNature(card,'fire'))){ if(['huoshaolianying','huogong'].includes(card.name)||(card.name=='sha'&&game.hasNature(card,'fire'))){
return 'zeroplayertarget'; return 'zeroplayertarget';
} }
}, },
@ -1269,7 +1282,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(target.isMinor()&&['tiesuo','lulitongxin'].contains(card.name)){ if(target.isMinor()&&['tiesuo','lulitongxin'].includes(card.name)){
return 'zeroplayertarget'; return 'zeroplayertarget';
} }
}, },
@ -1288,7 +1301,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
filterCard:function(card,player){ filterCard:function(card,player){
var cards=player.getEquips('dinglanyemingzhu'); var cards=player.getEquips('dinglanyemingzhu');
if(cards.length) return cards.some(card2=>card2!=card&&!ui.selected.cards.contains(card2)) if(cards.length) return cards.some(card2=>card2!=card&&!ui.selected.cards.includes(card2))
return true; return true;
}, },
prompt:'出牌阶段限一次你可以弃置至多X张牌X为你的体力上限然后摸等量的牌' prompt:'出牌阶段限一次你可以弃置至多X张牌X为你的体力上限然后摸等量的牌'
@ -1331,6 +1344,19 @@ game.import('card',function(lib,game,ui,get,ai,_status){
})){ })){
return [0,0,0,0]; return [0,0,0,0];
} }
},
target:(card,player,target)=>{
if(target._g_taipingyaoshu_temp) return;
if(get.subtype(card)==='equip2'&&target.getEquip('taipingyaoshu')&&!target.countEmpty(2)){
target._g_taipingyaoshu_temp=true;
let lose=get.effect(target,{name:'losehp'},target,target),
draw=2*get.effect(target,{name:'draw'},target,target);
delete target._g_taipingyaoshu_temp;
if(lose<0&&target.hp<=1&&!target.hasCard(i=>{
return get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable');
})) draw=0;
return [1,(lose+draw)/get.attitude(target,target)];
}
} }
} }
} }
@ -1354,7 +1380,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
trigger:{source:'dieAfter'}, trigger:{source:'dieAfter'},
filter:function(event,player){ filter:function(event,player){
if(event.reason&&event.reason.card&&event.reason.card.name=='sha'){ if(event.reason&&event.reason.card&&event.reason.card.name=='sha'){
return event.player.isDead()&&lib.group.contains(player.identity)&&player.isMinor(); return event.player.isDead()&&lib.group.includes(player.identity)&&player.isMinor();
} }
return false; return false;
}, },
@ -1364,7 +1390,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var list=[]; var list=[];
for(var i=0;i<_status.characterlist.length;i++){ for(var i=0;i<_status.characterlist.length;i++){
var info=lib.character[_status.characterlist[i]]; var info=lib.character[_status.characterlist[i]];
if(info[4]&&info[4].contains('jun')) continue; if(info[4]&&info[4].includes('jun')) continue;
if(info[1]==player.identity){ if(info[1]==player.identity){
list.push(_status.characterlist[i]); list.push(_status.characterlist[i]);
} }

View File

@ -353,7 +353,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
enable:function(card,player){ enable:function(card,player){
var enemies=player.getEnemies(); var enemies=player.getEnemies();
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.hp==1&&enemies.contains(current); return current.hp==1&&enemies.includes(current);
}); });
}, },
notarget:true, notarget:true,
@ -364,7 +364,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
var enemies=player.getEnemies(); var enemies=player.getEnemies();
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return current.hp==1&&enemies.contains(current); return current.hp==1&&enemies.includes(current);
}); });
if(list.length){ if(list.length){
var target=list.randomGet(); var target=list.randomGet();
@ -520,7 +520,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}); });
player.line(list1); player.line(list1);
for(var i=0;i<list1.length;i++){ for(var i=0;i<list1.length;i++){
list1[i].animate('target'); list1[i].addTempClass('target');
} }
setTimeout(function(){ setTimeout(function(){
var list11=list1.slice(0); var list11=list1.slice(0);
@ -1031,7 +1031,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var list=[]; var list=[];
for(var i in lib.card){ for(var i in lib.card){
if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; if(lib.card[i].mode&&lib.card[i].mode.includes(lib.config.mode)==false) continue;
if(lib.card[i].vanish) continue; if(lib.card[i].vanish) continue;
if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]);
} }
@ -1201,10 +1201,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return player.canUse('gw_aozuzhilei',current)&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; return player.canUse('gw_aozuzhilei',current)&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0;
}); });
var baoxue=game.hasPlayer(function(current){ var baoxue=game.hasPlayer(function(current){
return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2,3].contains(current.countCards('h'))&&!current.hasSkillTag('noh'); return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2,3].includes(current.countCards('h'))&&!current.hasSkillTag('noh');
}); });
var baoxue2=game.hasPlayer(function(current){ var baoxue2=game.hasPlayer(function(current){
return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2].contains(current.countCards('h'))&&!current.hasSkillTag('noh'); return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2].includes(current.countCards('h'))&&!current.hasSkillTag('noh');
}); });
var baoxue3=game.hasPlayer(function(current){ var baoxue3=game.hasPlayer(function(current){
return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&current.countCards('h')>=2&&!current.hasSkillTag('noh'); return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&current.countCards('h')>=2&&!current.hasSkillTag('noh');
@ -1401,10 +1401,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
result:{ result:{
target:function(player,current){ target:function(player,current){
if(current.hasSkill('gw_qinpendayu')) return 0; if(current.hasSkill('gw_qinpendayu')) return 0;
if(current.needsToDiscard()) return -1; return Math.max(-1,-0.1-0.3*current.needsToDiscard(2));
if(current.needsToDiscard(1)) return -0.7;
if(current.needsToDiscard(2)) return -0.4;
return -0.1;
} }
}, },
order:1.2, order:1.2,
@ -2112,7 +2109,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}).sortBySeat(); }).sortBySeat();
var enemies=player.getEnemies(); var enemies=player.getEnemies();
for(var i=0;i<enemies.length;i++){ for(var i=0;i<enemies.length;i++){
if(list.contains(enemies[i])){ if(list.includes(enemies[i])){
break; break;
} }
} }
@ -2144,7 +2141,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
priority:-11, priority:-11,
filter:function(event,player){ filter:function(event,player){
if(_status.connectMode) return false; if(_status.connectMode) return false;
if(!lib.config.cards.contains('gwent')) return false; if(!lib.config.cards.includes('gwent')) return false;
if(player.isMin()) return false; if(player.isMin()) return false;
if(game.fixedPile) return false; if(game.fixedPile) return false;
return event.num>0&&event.parent.name=='phaseDraw'; return event.num>0&&event.parent.name=='phaseDraw';

View File

@ -173,7 +173,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
equipSkill:true, equipSkill:true,
filter:function (event,player){ filter:function (event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.countCards('he')>0; return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.countCards('he')>0;
}, },
content:function (){ content:function (){
@ -201,7 +201,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var skills=info[3]; var skills=info[3];
for(var j=0;j<skills.length;j++){ for(var j=0;j<skills.length;j++){
if(lib.translate[skills[j]+'_info']&&lib.skill[skills[j]]&& if(lib.translate[skills[j]+'_info']&&lib.skill[skills[j]]&&
!lib.skill[skills[j]].unique&&!pss.contains(skills[j])){ !lib.skill[skills[j]].unique&&!pss.includes(skills[j])){
return true; return true;
} }
} }
@ -233,7 +233,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
for(var j=0;j<skills.length;j++){ for(var j=0;j<skills.length;j++){
if(lib.translate[skills[j]+'_info']&&lib.skill[skills[j]]&& if(lib.translate[skills[j]+'_info']&&lib.skill[skills[j]]&&
!lib.skill[skills[j]].unique&& !lib.skill[skills[j]].unique&&
!pss.contains(skills[j])){ !pss.includes(skills[j])){
list.push(skills[j]); list.push(skills[j]);
} }
} }

View File

@ -197,6 +197,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return lib.card.shandian.ai.result.target(player,target); return lib.card.shandian.ai.result.target(player,target);
} }
}, },
tag:{
damage:0.25,
natureDamage:0.25,
thunderDamage:0.25,
}
} }
}, },
qibaodao:{ qibaodao:{
@ -530,7 +535,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
popup:false, popup:false,
filter:function(event,player){ filter:function(event,player){
if(event.player==player) return false; if(event.player==player) return false;
if(event.getParent().directHit.contains(player)) return false; if(event.getParent().directHit.includes(player)) return false;
var num=player.countCards('h','jinchan'); var num=player.countCards('h','jinchan');
return num&&num==player.countCards('h'); return num&&num==player.countCards('h');
}, },

View File

@ -14,6 +14,16 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
} }
}, },
draw:{
ai:{
result:{
target:1
},
tag:{
draw:1
}
}
},
losehp:{ losehp:{
ai:{ ai:{
result:{ result:{
@ -138,25 +148,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){
next.set('prompt2','(在此之后仍需弃置一张手牌)'); next.set('prompt2','(在此之后仍需弃置一张手牌)');
} }
next.set('ai1',function(card){ next.set('ai1',function(card){
var target=_status.event.player; if(_status.event.useShan) return get.order(card);
var evt=_status.event.getParent();
var bool=true;
if(_status.event.shanRequired>1&&!get.is.object(card)&&target.countCards('h','shan')<_status.event.shanRequired-(_status.event.shanIgnored||0)){
bool=false;
}
else if(target.hasSkillTag('useShan')){
bool=true;
}
else if(target.hasSkillTag('noShan')){
bool=false;
}
else if(get.damageEffect(target,evt.player,target,evt.card.nature)>=0) bool=false;
if(bool){
return get.order(card);
}
return 0; return 0;
}).set('shanRequired',event.shanRequired); }).set('shanRequired',event.shanRequired);
next.set('respondTo',[player,card]); next.set('respondTo',[player,card]);
next.set('useShan',(()=>{
if(target.hasSkillTag('noShan',null,event)) return false;
if(target.hasSkillTag('useShan',null,event)) return true;
if(event.baseDamage+event.extraDamage<=0 || get.attitude(target,player._trueMe||player)>0) return false;
if(event.shanRequired>1&&target.mayHaveShan(target,'use',null,'count')<event.shanRequired-(event.shanIgnored||0)) return false;
if(event.baseDamage+event.extraDamage>=target.hp+
((player.hasSkillTag('jueqing',false,target)||target.hasSkill('gangzhi'))?target.hujia:0)) return true;
if(!game.hasNature(event.card, 'ice')&&get.damageEffect(target,player,target,get.nature(event.card))>=0) return false;
return true;
})());
//next.autochoose=lib.filter.autoRespondShan; //next.autochoose=lib.filter.autoRespondShan;
} }
"step 2" "step 2"
@ -228,17 +233,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(get.cardtag(card,'yingbian_hit')){ if(get.cardtag(card,'yingbian_hit')){
hit=true; hit=true;
if(targets.some(target=>{ if(targets.some(target=>{
return target.mayHaveShan(viewer)&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0; return target.mayHaveShan(viewer,'use')&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0;
})) base+=5; })) base+=5;
} }
if(get.cardtag(card,'yingbian_add')){ if(get.cardtag(card,'yingbian_add')){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0;
})) base+=5; })) base+=5;
} }
if(get.cardtag(card,'yingbian_damage')){ if(get.cardtag(card,'yingbian_damage')){
if(targets.some(target=>{ if(targets.some(target=>{
return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer)||player.hasSkillTag('directHit_ai',true,{ return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer,'use')||player.hasSkillTag('directHit_ai',true,{
target:target, target:target,
card:card, card:card,
},true))&&!target.hasSkillTag('filterDamage',null,{ },true))&&!target.hasSkillTag('filterDamage',null,{
@ -252,10 +257,6 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
canLink:function(player,target,card){ canLink:function(player,target,card){
if(!target.isLinked()&&!player.hasSkill('wutiesuolian_skill')) return false; if(!target.isLinked()&&!player.hasSkill('wutiesuolian_skill')) return false;
if(target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
target:target,
card:card,
},true)) return false;
if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false; if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false;
return true; return true;
}, },
@ -265,9 +266,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
order:function(item,player){ order:function(item,player){
if(player.hasSkillTag('presha',true,null,true)) return 10; if(player.hasSkillTag('presha',true,null,true)) return 10;
if(game.hasNature(item,'linked')){ if(typeof item==='object'&&game.hasNature(item,'linked')){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current!=player&&current.isLinked()&&player.canUse(item,current,null,true)&&get.effect(current,item,player,player)>0&&lib.card.sha.ai.canLink(player,current,item); return current!=player&&lib.card.sha.ai.canLink(player,current,item)&&player.canUse(item,current,null,true)&&get.effect(current,item,player,player)>0;
})&&game.countPlayer(function(current){ })&&game.countPlayer(function(current){
return current.isLinked()&&get.damageEffect(current,player,player,get.nature(item))>0; return current.isLinked()&&get.damageEffect(current,player,player,get.nature(item))>0;
})>1) return 3.1; })>1) return 3.1;
@ -295,7 +296,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
return -1.5; return -1.5;
}(); }();
if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{ if(!isLink&&target.mayHaveShan(player,'use')&&!player.hasSkillTag('directHit_ai',true,{
target:target, target:target,
card:card, card:card,
},true)) return eff/1.2; },true)) return eff/1.2;
@ -457,7 +458,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(target.hp>0){ if(target.hp>0){
if(!player.isPhaseUsing()) return 0; if(!player.isPhaseUsing()) return 0;
let min = 7.2-4*player.hp/player.maxHp, let min = 7.2-4*player.hp/player.maxHp,
nd = player.needsToDiscard(-player.countCards('h',i=>!taos.includes(i)&&get.value(i)<min)), nd = player.needsToDiscard(0,(i,player)=>{
return !player.canIgnoreHandcard(i)&&(taos.includes(i)||get.value(i)>=min);
}),
keep = nd?0:2; keep = nd?0:2;
if(nd>2 || taos.length>1&&(nd>1||nd&&player.hp<1+taos.length) || target.identity==='zhu'&&(nd||target.hp<3)&&(mode==='identity'||mode==='versus'||mode==='chess') || !player.hasFriend()) return 2; if(nd>2 || taos.length>1&&(nd>1||nd&&player.hp<1+taos.length) || target.identity==='zhu'&&(nd||target.hp<3)&&(mode==='identity'||mode==='versus'||mode==='chess') || !player.hasFriend()) return 2;
if(game.hasPlayer(current=>{ if(game.hasPlayer(current=>{
@ -1111,7 +1114,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
modTarget:true, modTarget:true,
content:function(){ content:function(){
if(get.is.versus()){ if(get.is.versus()){
if(game.friend.contains(target)){ if(game.friend.includes(target)){
if(game.friend.length<game.enemy.length){ if(game.friend.length<game.enemy.length){
target.draw(3);return; target.draw(3);return;
} }
@ -1232,10 +1235,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
event._result={}; event._result={};
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer,status){
if(player==game.me&&get.attitude(viewer,player)>0){ if(player===game.me&&get.attitude(viewer,player._trueMe||player)>0) return 0;
return 0; if(status*get.attitude(viewer,target)*get.effect(target,card,player,target)>=0) return 0;
}
}, },
basic:{ basic:{
order:5, order:5,
@ -1299,9 +1301,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){ if(get.attitude(viewer,player._trueMe||player)>0) return 0;
return 0;
}
}, },
basic:{ basic:{
order:7.5, order:7.5,
@ -1578,7 +1578,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
wuxie:(target,card,player,viewer,status)=>{ wuxie:(target,card,player,viewer,status)=>{
if(status*get.attitude(viewer,player)>0&&!player.isMad() || target.hp>2&&!target.hasCard(i=>{ if(status*get.attitude(viewer,player._trueMe||player)>0 || target.hp>2&&!target.hasCard(i=>{
let val=get.value(i,target),subtypes=get.subtypes(i); let val=get.value(i,target),subtypes=get.subtypes(i);
if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false; if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false;
return val>3+Math.min(5,target.hp); return val>3+Math.min(5,target.hp);
@ -1599,7 +1599,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
yingbian:function(card,player,targets,viewer){ yingbian:function(card,player,targets,viewer){
if(get.attitude(viewer,player)<=0) return 0; if(get.attitude(viewer,player)<=0) return 0;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0;
})) return 6; })) return 6;
return 0; return 0;
}, },
@ -1816,7 +1816,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
}).set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ }).set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.filterTarget.apply(this,arguments); return lib.filter.filterTarget.apply(this,arguments);
}).set('sourcex',event.addedTarget).set('addCount',false).set('respondTo',[player,card]); }).set('sourcex',event.addedTarget).set('addCount',false).set('respondTo',[player,card]);
} }
@ -1828,9 +1828,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer){ wuxie:function(target,card,player,viewer){
if(player==game.me&&get.attitude(viewer,player)>0){ if(player==game.me&&get.attitude(viewer,player._trueMe||player)>0) return 0;
return 0;
}
}, },
basic:{ basic:{
order:8, order:8,
@ -1844,12 +1842,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return num+get.value(i,player); return num+get.value(i,player);
},0); },0);
}, },
target:(player,target)=>{ target:(player,target,card)=>{
let targets=get.copy(ui.selected.targets); let targets=[].concat(ui.selected.targets);
if(_status.event.preTarget) targets.add(_status.event.preTarget); if(_status.event.preTarget) targets.add(_status.event.preTarget);
if(targets.length){ if(targets.length){
let preTarget=targets.lastItem,pre=_status.event.getTempCache('jiedao_result',preTarget); let preTarget=targets.lastItem,pre=_status.event.getTempCache('jiedao_result',preTarget.playerid);
if(pre&&pre.target.isIn()) return target===pre.target?pre.eff:0; if(pre&&pre.card===card&&pre.target.isIn()) return target===pre.target?pre.eff:0;
return get.effect(target,{name:'sha'},preTarget,player)/get.attitude(player,target); return get.effect(target,{name:'sha'},preTarget,player)/get.attitude(player,target);
} }
let arms=(target.hasSkillTag('noe')?0.32:-0.15)*target.getEquips(1).reduce((num,i)=>{ let arms=(target.hasSkillTag('noe')?0.32:-0.15)*target.getEquips(1).reduce((num,i)=>{
@ -1865,7 +1863,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
},-100); },-100);
if(!addTar) return arms; if(!addTar) return arms;
sha/=get.attitude(player,target); sha/=get.attitude(player,target);
_status.event.putTempCache('jiedao_result',target,{ _status.event.putTempCache('jiedao_result',target.playerid,{
card:card,
target:addTar, target:addTar,
eff:sha eff:sha
}); });
@ -2040,7 +2039,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
var skills=current.getSkills(); //var skills=current.getSkills();
for(var j=0;j<current.skills.length;j++){ for(var j=0;j<current.skills.length;j++){
var rejudge=get.tag(current.skills[j],'rejudge',current); var rejudge=get.tag(current.skills[j],'rejudge',current);
if(rejudge!=undefined){ if(rejudge!=undefined){
@ -2085,9 +2084,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
}, },
tag:{ tag:{
// damage:1, damage:0.16,
// natureDamage:1, natureDamage:0.16,
// thunderDamage:1, thunderDamage:0.16,
} }
} }
}, },
@ -2154,7 +2153,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skillTagFilter:function(player){ skillTagFilter:function(player){
if(_status.qinglong_guozhan){ if(_status.qinglong_guozhan){
for(var i=0;i<_status.qinglong_guozhan.length;i++){ for(var i=0;i<_status.qinglong_guozhan.length;i++){
if(_status.qinglong_guozhan[i].targets.contains(player)) return true; if(_status.qinglong_guozhan[i].targets.includes(player)) return true;
} }
} }
return false; return false;
@ -2267,7 +2266,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
cardUsable:function(card,player,num){ cardUsable:function(card,player,num){
var cards=player.getEquips('zhuge') var cards=player.getEquips('zhuge')
if(card.name=='sha'){ if(card.name=='sha'){
if(!cards.length||player.hasSkill('zhuge_skill',null,false)||cards.some(card=>(card!=_status.zhuge_temp&&!ui.selected.cards.contains(card)))){ if(!cards.length||player.hasSkill('zhuge_skill',null,false)||cards.some(card=>(card!=_status.zhuge_temp&&!ui.selected.cards.includes(card)))){
if(get.is.versus()||get.is.changban()){ if(get.is.versus()||get.is.changban()){
return num+3; return num+3;
} }
@ -2278,7 +2277,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
cardEnabled2:function(card,player){ cardEnabled2:function(card,player){
if(!_status.event.addCount_extra||player.hasSkill('zhuge_skill',null,false)) return; if(!_status.event.addCount_extra||player.hasSkill('zhuge_skill',null,false)) return;
var cards=player.getEquips('zhuge'); var cards=player.getEquips('zhuge');
if(card&&cards.contains(card)){ if(card&&cards.includes(card)){
try{ try{
var cardz=get.card(); var cardz=get.card();
} }
@ -2358,7 +2357,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
charlotte:true, charlotte:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.qinggang2&&event.card&&player.storage.qinggang2.contains(event.card)&&(event.name!='damage'||event.notLink()); return player.storage.qinggang2&&event.card&&player.storage.qinggang2.includes(event.card)&&(event.name!='damage'||event.notLink());
}, },
silent:true, silent:true,
forced:true, forced:true,
@ -2385,7 +2384,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
if(!player.hasSkill('qinglong_skill',null,false)){ if(!player.hasSkill('qinglong_skill',null,false)){
var cards=player.getEquips('qinglong'); var cards=player.getEquips('qinglong');
if(!cards.some(card2=>card2!=card&&!ui.selected.cards.contains(card2))) return false; if(!cards.some(card2=>card2!=card&&!ui.selected.cards.includes(card2))) return false;
} }
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},trigger.target,-1).set('addCount',false).logSkill='qinglong_skill'; },trigger.target,-1).set('addCount',false).logSkill='qinglong_skill';
@ -2440,8 +2439,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card,player){ var next=player.chooseToDiscard(get.prompt('guanshi'),2,'he',function(card,player){
if(_status.event.ignoreCard) return true; if(_status.event.ignoreCard) return true;
var cards=player.getEquips('guanshi'); var cards=player.getEquips('guanshi');
if(!cards.contains(card)) return true; if(!cards.includes(card)) return true;
return cards.some(cardx=>(cardx!=card&&!ui.selected.cards.contains(cardx))); return cards.some(cardx=>(cardx!=card&&!ui.selected.cards.includes(cardx)));
}).set('ignoreCard',player.hasSkill('guanshi_skill',null,false)).set('complexCard',true) }).set('ignoreCard',player.hasSkill('guanshi_skill',null,false)).set('complexCard',true)
next.logSkill='guanshi_skill'; next.logSkill='guanshi_skill';
next.set('ai',function(card){ next.set('ai',function(card){
@ -2472,7 +2471,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player._guanshi_temp) return; if(player._guanshi_temp) return;
player._guanshi_temp=true; player._guanshi_temp=true;
var bool=(get.attitude(player,arg.target)<0&&arg.card&&arg.card.name=='sha'&&player.countCards('he',function(card){ var bool=(get.attitude(player,arg.target)<0&&arg.card&&arg.card.name=='sha'&&player.countCards('he',function(card){
return card!=player.getEquip('guanshi')&&card!=arg.card&&(!arg.card.cards||!arg.card.cards.contains(card))&&get.value(card)<5; return card!=player.getEquip('guanshi')&&card!=arg.card&&(!arg.card.cards||!arg.card.cards.includes(card))&&get.value(card)<5;
})>1); })>1);
delete player._guanshi_temp; delete player._guanshi_temp;
return bool; return bool;
@ -2523,7 +2522,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(get.mode()!='guozhan') return false; if(get.mode()!='guozhan') return false;
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
return game.hasPlayer(function(target){ return game.hasPlayer(function(target){
if(event.targets.contains(target)) return false; if(event.targets.includes(target)) return false;
if(!lib.filter.filterTarget(event.card,player,target)) return false; if(!lib.filter.filterTarget(event.card,player,target)) return false;
if(target.identity=='ye'||target.identity=='unknown') return true; if(target.identity=='ye'||target.identity=='unknown') return true;
for(var i=0;i<event.targets.length;i++){ for(var i=0;i<event.targets.length;i++){
@ -2539,7 +2538,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var cardx=_status.event.cardx; var cardx=_status.event.cardx;
if(!lib.filter.filterTarget(cardx,player,target)) return false; if(!lib.filter.filterTarget(cardx,player,target)) return false;
var targets=_status.event.targets.slice(0).concat(ui.selected.targets); var targets=_status.event.targets.slice(0).concat(ui.selected.targets);
if(targets.contains(target)) return false; if(targets.includes(target)) return false;
if(target.identity=='ye'||target.identity=='unknown') return true; if(target.identity=='ye'||target.identity=='unknown') return true;
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
if(target.identity==targets[i].identity) return false; if(target.identity==targets[i].identity) return false;
@ -2564,7 +2563,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
silent:true, silent:true,
onremove:true, onremove:true,
content:function(){ content:function(){
if(player.storage[event.name].contains(trigger.card)) trigger.getParent().excluded.addArray(trigger.getParent().targets); if(player.storage[event.name].includes(trigger.card)) trigger.getParent().excluded.addArray(trigger.getParent().targets);
}, },
group:'fangtian_guozhan_remove', group:'fangtian_guozhan_remove',
}, },
@ -2572,7 +2571,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
trigger:{player:['useCardAfter','useCardCancelled']}, trigger:{player:['useCardAfter','useCardCancelled']},
silent:true, silent:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.fangtian_guozhan_trigger&&player.storage.fangtian_guozhan_trigger.contains(event.card); return player.storage.fangtian_guozhan_trigger&&player.storage.fangtian_guozhan_trigger.includes(event.card);
}, },
content:function(){ content:function(){
player.storage.fangtian_guozhan_trigger.remove(trigger.card); player.storage.fangtian_guozhan_trigger.remove(trigger.card);
@ -2864,7 +2863,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(game.checkMod(map.card,map.target,current,'unchanged','wuxieJudgeRespondable',map.target)==false) return false; if(game.checkMod(map.card,map.target,current,'unchanged','wuxieJudgeRespondable',map.target)==false) return false;
} }
else{ else{
if(trigger.getParent().directHit.contains(current)) return false; if(trigger.getParent().directHit.includes(current)) return false;
if(game.checkMod(map.card,map.player,map.target,current,'unchanged','wuxieEnabled',current)==false) return false; if(game.checkMod(map.card,map.player,map.target,current,'unchanged','wuxieEnabled',current)==false) return false;
if(game.checkMod(map.card,map.player,map.target,current,'unchanged','wuxieRespondable',map.player)==false) return false; if(game.checkMod(map.card,map.player,map.target,current,'unchanged','wuxieRespondable',map.player)==false) return false;
} }
@ -3194,14 +3193,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
event.respond_info=info; event.respond_info=info;
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
if(event.nowuxie) return false; if(event.nowuxie) return false;
if(event.directHit&&event.directHit.contains(current)) return false; if(event.directHit&&event.directHit.includes(current)) return false;
if(event.triggername=='phaseJudge'){ if(event.triggername=='phaseJudge'){
if(game.checkMod(trigger.card,player,current,'unchanged','wuxieJudgeEnabled',current)==false) return false; if(game.checkMod(trigger.card,player,current,'unchanged','wuxieJudgeEnabled',current)==false) return false;
if(game.checkMod(trigger.card,player,current,'unchanged','wuxieJudgeRespondable',player)==false) return false; if(game.checkMod(trigger.card,player,current,'unchanged','wuxieJudgeRespondable',player)==false) return false;
if(event.stateplayer&&event.statecard&&(game.checkMod(event.statecard,event.stateplayer,player,current,'unchanged','wuxieRespondable',event.stateplayer)==false)) return false; if(event.stateplayer&&event.statecard&&(game.checkMod(event.statecard,event.stateplayer,player,current,'unchanged','wuxieRespondable',event.stateplayer)==false)) return false;
} }
else{ else{
if(!event.statecard&&trigger.getParent().directHit.contains(current)) return false; if(!event.statecard&&trigger.getParent().directHit.includes(current)) return false;
if(game.checkMod(trigger.card,player,trigger.target,current,'unchanged','wuxieEnabled',current)==false) return false; if(game.checkMod(trigger.card,player,trigger.target,current,'unchanged','wuxieEnabled',current)==false) return false;
if(game.checkMod(trigger.card,player,trigger.target,current,'unchanged','wuxieRespondable',player)==false) return false; if(game.checkMod(trigger.card,player,trigger.target,current,'unchanged','wuxieRespondable',player)==false) return false;
if(event.stateplayer&&event.statecard&&(game.checkMod(event.statecard,event.stateplayer,trigger.player,current,'unchanged','wuxieRespondable',event.stateplayer)==false)) return false; if(event.stateplayer&&event.statecard&&(game.checkMod(event.statecard,event.stateplayer,trigger.player,current,'unchanged','wuxieRespondable',event.stateplayer)==false)) return false;

View File

@ -1107,7 +1107,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
enable:function(card,player){ enable:function(card,player){
var es=player.getCards('e'); var es=player.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)&& if(lib.inpile.includes(es[i].name)&&
!lib.card[es[i].name].nopower&& !lib.card[es[i].name].nopower&&
!lib.card[es[i].name].unique&& !lib.card[es[i].name].unique&&
!es[i].nopower){ !es[i].nopower){
@ -1120,7 +1120,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return target==player; return target==player;
// var es=target.getCards('e'); // var es=target.getCards('e');
// for(var i=0;i<es.length;i++){ // for(var i=0;i<es.length;i++){
// if(lib.inpile.contains(es[i].name)) return true; // if(lib.inpile.includes(es[i].name)) return true;
// } // }
// return false; // return false;
}, },
@ -1149,7 +1149,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var cards=[]; var cards=[];
var time=0; var time=0;
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
if(!lib.inpile.contains(es[i].name)||lib.card[es[i].name].nopower||lib.card[es[i].name].unique||es[i].nopower){ if(!lib.inpile.includes(es[i].name)||lib.card[es[i].name].nopower||lib.card[es[i].name].unique||es[i].nopower){
es.splice(i--,1); es.splice(i--,1);
} }
} }
@ -1205,7 +1205,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
// var es=target.getCards('e'); // var es=target.getCards('e');
// var num=0; // var num=0;
// for(var i=0;i<es.length;i++){ // for(var i=0;i<es.length;i++){
// if(lib.inpile.contains(es[i].name)) num++; // if(lib.inpile.includes(es[i].name)) num++;
// } // }
// return num; // return num;
// } // }
@ -1236,7 +1236,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
var list=get.inpile('equip'); var list=get.inpile('equip');
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(!types.contains(lib.card[list[i]].subtype)){ if(!types.includes(lib.card[list[i]].subtype)){
list.splice(i--,1); list.splice(i--,1);
} }
} }
@ -3055,7 +3055,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
type.add(get.type(result.links[i],'trick')); type.add(get.type(result.links[i],'trick'));
} }
for(var i=0;i<ui.cardPile.childNodes.length;i++){ for(var i=0;i<ui.cardPile.childNodes.length;i++){
if(!type.contains(get.type(ui.cardPile.childNodes[i],'trick'))){ if(!type.includes(get.type(ui.cardPile.childNodes[i],'trick'))){
player.gain(ui.cardPile.childNodes[i],'gain'); player.gain(ui.cardPile.childNodes[i],'gain');
break; break;
} }
@ -3296,7 +3296,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
priority:55, priority:55,
filter:function(event){ filter:function(event){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.player.countCards('he')>0; return event.player.countCards('he')>0;
}, },
content:function(){ content:function(){
@ -3391,10 +3391,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]); game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
for(var i=0;i<event.cards.length;i++) event.cards[i].discard(); for(var i=0;i<event.cards.length;i++) event.cards[i].discard();
// var node=card.copy('thrown','center',ui.arena).animate('start'); // var node=card.copy('thrown','center',ui.arena).addTempClass('start');
var node; var node;
if(game.chess){ if(game.chess){
node=card.copy('thrown','center',ui.arena).animate('start'); node=card.copy('thrown','center',ui.arena).addTempClass('start');
} }
else{ else{
node=player.$throwordered(card.copy(),true); node=player.$throwordered(card.copy(),true);
@ -3641,7 +3641,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
forced:true, forced:true,
filter:function(event){ filter:function(event){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&event.card.name=='sha'&&event.player.countCards('he'); return event.card&&event.card.name=='sha'&&event.player.countCards('he');
}, },
content:function(){ content:function(){
@ -3803,7 +3803,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return get.attitude(player,event.player)<=0; return get.attitude(player,event.player)<=0;
}, },
filter:function(event){ filter:function(event){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&event.card.name=='sha'&&event.player&&event.player.isAlive(); return event.card&&event.card.name=='sha'&&event.player&&event.player.isAlive();
}, },
logTarget:'player', logTarget:'player',
@ -4264,7 +4264,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
switch(get.type(hs[i])){ switch(get.type(hs[i])){
case 'equip':types.add(get.subtype(hs[i]));break; case 'equip':types.add(get.subtype(hs[i]));break;
case 'hslingjian':lingjians.add(hs[i].name);break; case 'hslingjian':lingjians.add(hs[i].name);break;
case 'jiqi':if(!lingjians.contains(hs[i].name)) lingjians.unshift(hs[i].name);break; case 'jiqi':if(!lingjians.includes(hs[i].name)) lingjians.unshift(hs[i].name);break;
} }
} }
var str=''; var str='';
@ -4305,7 +4305,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
filterCard:function(card){ filterCard:function(card){
var type=get.type(card); var type=get.type(card);
if(type=='equip'){ if(type=='equip'){
if(!lib.inpile.contains(card.name)) return false; if(!lib.inpile.includes(card.name)) return false;
if(lib.card[card.name].nopower) return false; if(lib.card[card.name].nopower) return false;
if(lib.card[card.name].unique) return false; if(lib.card[card.name].unique) return false;
if(card.nopower) return false; if(card.nopower) return false;
@ -4329,7 +4329,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(!player.countCards('h',{type:['hslingjian','jiqi']})) return false; if(!player.countCards('h',{type:['hslingjian','jiqi']})) return false;
var es=player.getCards('he',{type:'equip'}); var es=player.getCards('he',{type:'equip'});
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)&& if(lib.inpile.includes(es[i].name)&&
!lib.card[es[i].name].nopower&& !lib.card[es[i].name].nopower&&
!lib.card[es[i].name].unique&& !lib.card[es[i].name].unique&&
!es[i].nopower){ !es[i].nopower){
@ -4440,7 +4440,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.hasNature()&&event.player&&event.player.isAlive(); return event.hasNature()&&event.player&&event.player.isAlive();
}, },
content:function(){ content:function(){

View File

@ -28,7 +28,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
wuxie:function(target,card,player,viewer,status){ wuxie:function(target,card,player,viewer,status){
if(status*get.attitude(viewer,player)>0&&!player.isMad()) return 0; if(get.attitude(viewer,player._trueMe||player)>0) return 0;
if(!card.yingbian_all&&get.distance(player,target)>1&&!target.hasCard(i=>{ if(!card.yingbian_all&&get.distance(player,target)>1&&!target.hasCard(i=>{
let val=get.value(i,target),subtypes=get.subtypes(i); let val=get.value(i,target),subtypes=get.subtypes(i);
if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false; if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false;
@ -51,7 +51,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
if(get.cardtag(card,'yingbian_add')){ if(get.cardtag(card,'yingbian_add')){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0;
})) base+=5; })) base+=5;
} }
if(get.cardtag(card,'yingbian_hit')){ if(get.cardtag(card,'yingbian_hit')){
@ -179,17 +179,34 @@ game.import('card',function(lib,game,ui,get,ai,_status){
yingbian:function(card,player,targets,viewer){ yingbian:function(card,player,targets,viewer){
if(get.attitude(viewer,player)<=0) return 0; if(get.attitude(viewer,player)<=0) return 0;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0; return !targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0;
})) return 6; })) return 6;
return 0; return 0;
}, },
result:{ result:{
target:function(player,target,cardx){ target:(player,target,card)=>{
if(player.hasSkillTag('viewHandcard',null,target,true)) return target.countCards('h',function(card){ //if(typeof card!=='object') return -2;
return get.suit(card)!=get.suit(cardx) let suit=get.suit(card),
})>0?-1.5:0; view=player.hasSkillTag('viewHandcard',null,target,true),
return -1.4; fz=0,
}, fm=0;
target.getCards('h',i=>{
if(i.isKnownBy(player)){
if(suit!==get.suit(i)){
if(view||get.is.shownCard(i)) return -2;
fz++;
fm++;
}
else if(!view&&!get.is.shownCard(i)) fm++;
}
else{
fz+=0.75;
fm++;
}
});
if(!fm) return 0;
return -2*fz/fm;
}
}, },
tag:{ tag:{
damage:1, damage:1,
@ -545,7 +562,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(info.allowMultiple==false) return false; if(info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){ if(event.targets&&!info.multitarget){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current);
})){ })){
return true; return true;
} }
@ -557,7 +574,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(trigger.yingbian_addTarget) player.chooseTarget('应变:是否为'+get.translation(trigger.card)+'增加一个目标?',function(card,player,target){ if(trigger.yingbian_addTarget) player.chooseTarget('应变:是否为'+get.translation(trigger.card)+'增加一个目标?',function(card,player,target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
var card=trigger.card; var card=trigger.card;
return !trigger.targets.contains(target)&&lib.filter.targetEnabled2(card,player,target)&&lib.filter.targetInRange(card,player,target); return !trigger.targets.includes(target)&&lib.filter.targetEnabled2(card,player,target)&&lib.filter.targetInRange(card,player,target);
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
var card=_status.event.getTrigger().card; var card=_status.event.getTrigger().card;
@ -574,7 +591,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
if(trigger.yingbian_removeTarget&&trigger.targets.length>1) player.chooseTarget('应变:是否为'+get.translation(trigger.card)+'减少一个目标?',function(card,player,target){ if(trigger.yingbian_removeTarget&&trigger.targets.length>1) player.chooseTarget('应变:是否为'+get.translation(trigger.card)+'减少一个目标?',function(card,player,target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
return trigger.targets.contains(target); return trigger.targets.includes(target);
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
var card=_status.event.getTrigger().card; var card=_status.event.getTrigger().card;

View File

@ -162,11 +162,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9, order:9,
value:function(card,player){ value:function(card,player){
if(player.getEquips(1).contains(card)) return 0; if(player.getEquips(1).includes(card)) return 0.4;
return 4; return 4;
}, },
equipValue:function(card,player){ equipValue:function(card,player){
if(player.getCards('e').contains(card)) return 0; if(player.getCards('e').includes(card)) return 0.4;
return -get.value(player.getCards('e')); return -get.value(player.getCards('e'));
}, },
basic:{ basic:{
@ -196,7 +196,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 2; return 2;
}, },
value:function(card,player){ value:function(card,player){
if(player.getEquips(1).contains(card)) return -3; if(player.getEquips(1).includes(card)) return -3;
return 3; return 3;
}, },
basic:{ basic:{
@ -226,11 +226,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9, order:9,
equipValue:function(card,player){ equipValue:function(card,player){
if(get.position(card)=='e') return -2; if(get.position(card)=='e'){
if(player.hasSex('male')) return -7;
return 0;
}
return 2; return 2;
}, },
value:function(card,player){ value:function(card,player){
if(player.getEquips(2).contains(card)) return -3; if(player.getEquips(2).includes(card)){
if(player.hasSex('male')) return -8;
return 0;
}
return 3; return 3;
}, },
basic:{ basic:{
@ -260,11 +266,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9, order:9,
equipValue:function(card,player){ equipValue:function(card,player){
if(get.position(card)=='e') return -1; if(get.position(card)=='e') return -8;
return 1; return 1;
}, },
value:function(card,player){ value:function(card,player){
if(player.getEquips(2).contains(card)) return -2.5; if(player.getEquips(2).includes(card)) return -10;
return 2.5; return 2.5;
}, },
basic:{ basic:{
@ -298,7 +304,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
order:9, order:9,
equipValue:0, equipValue:0,
value:function(card,player){ value:function(card,player){
if(player.getEquips(2).contains(card)) return 0; if(player.getEquips(2).includes(card)) return 0;
return 0.5; return 0.5;
}, },
basic:{ basic:{
@ -523,14 +529,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(!player._start_cards) return false; if(!player._start_cards) return false;
var hs=player.getCards('h'); var hs=player.getCards('h');
for(var card of player._start_cards){ for(var card of player._start_cards){
if(get.name(card,player)=='du'&&hs.contains(card)) return true; if(get.name(card,player)=='du'&&hs.includes(card)) return true;
} }
} }
else{ else{
if(event.getParent().name!='draw') return false; if(event.getParent().name!='draw') return false;
var hs=player.getCards('h'); var hs=player.getCards('h');
for(var card of event.cards){ for(var card of event.cards){
if(get.name(card,player)=='du'&&hs.contains(card)) return true; if(get.name(card,player)=='du'&&hs.includes(card)) return true;
} }
} }
return false; return false;
@ -540,12 +546,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var hs=player.getCards('h'); var hs=player.getCards('h');
if(trigger.name=='phase'){ if(trigger.name=='phase'){
event.cards=player._start_cards.filter(function(card){ event.cards=player._start_cards.filter(function(card){
return (get.name(card,player)=='du'&&hs.contains(card)); return (get.name(card,player)=='du'&&hs.includes(card));
}); });
} }
else{ else{
event.cards=trigger.cards.filter(function(card){ event.cards=trigger.cards.filter(function(card){
return (get.name(card,player)=='du'&&hs.contains(card)); return (get.name(card,player)=='du'&&hs.includes(card));
}); });
} }
if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true}); if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
@ -553,7 +559,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
player.chooseCardTarget({ player.chooseCardTarget({
filterCard:function(card){ filterCard:function(card){
return _status.event.cards.contains(card); return _status.event.cards.includes(card);
}, },
filterTarget:lib.filter.notMe, filterTarget:lib.filter.notMe,
selectCard:[1,cards.length], selectCard:[1,cards.length],

View File

@ -653,7 +653,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
player.chooseCardButton('偷梁换柱',target.getCards('h')).ai=function(button){ player.chooseCardButton('偷梁换柱',target.getCards('h')).ai=function(button){
var val=get.value(button.link,player,'raw')-minval; var val=get.value(button.link,player,'raw')-minval;
if(val>=0){ if(val>=0){
if(colors.contains(get.color(button.link))){ if(colors.includes(get.color(button.link))){
val+=3; val+=3;
} }
} }
@ -872,7 +872,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
trigger:{target:'shaBefore'}, trigger:{target:'shaBefore'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return !event.getParent().directHit.contains(player)&&player.hasUsableCard('youdishenru'); return !event.getParent().directHit.includes(player)&&player.hasUsableCard('youdishenru');
}, },
content:function(){ content:function(){
event.youdiinfo={ event.youdiinfo={
@ -892,7 +892,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(event.player==player) return false; if(event.player==player) return false;
if(!event.player.countCards('he')) return false; if(!event.player.countCards('he')) return false;
if(!lib.filter.targetEnabled({name:'chenhuodajie'},player,event.player)) return false; if(!lib.filter.targetEnabled({name:'chenhuodajie'},player,event.player)) return false;
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return player.hasUsableCard('chenhuodajie'); return player.hasUsableCard('chenhuodajie');
}, },
content:function(){ content:function(){

View File

@ -45,7 +45,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var cards=[]; var cards=[];
for(var i=0;i<num;i++){ for(var i=0;i<num;i++){
var cardx=get.cardPile(function(card){ var cardx=get.cardPile(function(card){
return get.type(card)=='equip'&&!cards.contains(card); return get.type(card)=='equip'&&!cards.includes(card);
}); });
if(cardx) cards.push(cardx); if(cardx) cards.push(cardx);
} }
@ -90,7 +90,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}); });
next.set('equips',equips); next.set('equips',equips);
next.set('filterButton',function(button){ next.set('filterButton',function(button){
return _status.event.equips.contains(button.link); return _status.event.equips.includes(button.link);
}); });
next.set('dialog',event.preResult); next.set('dialog',event.preResult);
next.set('closeDialog',false); next.set('closeDialog',false);
@ -237,13 +237,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
target:function(player,target,card){ target:function(player,target,card){
var cards=ui.selected.cards.concat(card.cards||[]); var cards=ui.selected.cards.concat(card.cards||[]);
var num=player.countCards('he',function(card){ var num=player.countCards('he',function(card){
if(cards.contains(card)) return false; if(cards.includes(card)) return false;
if(get.type(card)=='equip') return 8>get.value(card); if(get.type(card)=='equip') return 8>get.value(card);
return 6>get.value(card); return 6>get.value(card);
}); });
if(!num) return 0; if(!num) return 0;
if(player.countCards('he',function(card){ if(player.countCards('he',function(card){
if(cards.contains(card)) return false; if(cards.includes(card)) return false;
if(get.type(card)=='equip') return 4>get.value(card); if(get.type(card)=='equip') return 4>get.value(card);
return false; return false;
})) return 1.6; })) return 1.6;
@ -335,11 +335,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9, order:9,
value:function(card,player){ value:function(card,player){
if(player.getEquips(4).contains(card)) return 0; if(player.getEquips(4).includes(card)) return 0;
return 4; return 4;
}, },
equipValue:function(card,player){ equipValue:function(card,player){
if(player.getCards('e').contains(card)) return 0; if(player.getCards('e').includes(card)) return 0;
return -get.value(player.getCards('e')); return -get.value(player.getCards('e'));
}, },
basic:{ basic:{
@ -370,7 +370,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hasSkill(skills[i])) return 5; if(player.hasSkill(skills[i])) return 5;
} }
if(player.countCards('h',function(card){ if(player.countCards('h',function(card){
return get.color(card)=='black'&&['wuxie','caochuan'].contains(card); return get.color(card)=='black'&&['wuxie','caochuan'].includes(card);
})) return 5; })) return 5;
return 2; return 2;
}, },
@ -397,7 +397,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 2; return 2;
}, },
value:function(card,player){ value:function(card,player){
if(player.getEquips(1).contains(card)) return -1.5; if(player.getEquips(1).includes(card)){
if(player.hasSkillTag('noh')) return 0;
return -3.5;
}
return 1.5; return 1.5;
}, },
basic:{ basic:{
@ -436,7 +439,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 2; return 2;
}, },
value:function(card,player){ value:function(card,player){
if(player.getEquips(1).contains(card)) return -3; if(player.getEquips(1).includes(card)) return -3.5;
return 3; return 3;
}, },
basic:{ basic:{
@ -471,11 +474,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9, order:9,
equipValue:function(card,player){ equipValue:function(card,player){
if(get.position(card)=='e') return -1; if(get.position(card)=='e') return -7;
return 1; return 1;
}, },
value:function(card,player){ value:function(card,player){
if(player.getEquips(2).contains(card)) return -2.5; if(player.getEquips(2).includes(card)) return -9;
return 2.5; return 2.5;
}, },
basic:{ basic:{
@ -532,7 +535,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9.5, order:9.5,
equipValue:function(card,player){ equipValue:function(card,player){
if(player.getEquips(2).contains(card)){ if(player.getEquips(2).includes(card)){
if(player.sex!='male') return 0; if(player.sex!='male') return 0;
var num=player.countCards('he',function(cardx){ var num=player.countCards('he',function(cardx){
return cardx!=card; return cardx!=card;
@ -648,7 +651,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:9.5, order:9.5,
equipValue:function(card,player){ equipValue:function(card,player){
if(!player.getEquips(5).contains(card)) return 5; if(!player.getEquips(5).includes(card)) return 5;
if(_status.jinhe&&_status.jinhe[card.cardid]&&_status.event.name!='gainPlayerCard') return 3*player.countCards('h'); if(_status.jinhe&&_status.jinhe[card.cardid]&&_status.event.name!='gainPlayerCard') return 3*player.countCards('h');
return 0; return 0;
}, },
@ -814,13 +817,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
var cards=player.getEquips('wufengjian'); var cards=player.getEquips('wufengjian');
return player.hasCard(function(card){ return player.hasCard(function(card){
return !cards.contains(card); return !cards.includes(card);
},'he'); },'he');
}, },
content:function(){ content:function(){
if(player!=game.me&&!player.isUnderControl()&&!player.isOnline()) game.delayx(); if(player!=game.me&&!player.isUnderControl()&&!player.isOnline()) game.delayx();
player.chooseToDiscard(true,'he',function(card){ player.chooseToDiscard(true,'he',function(card){
return !_status.event.cards.contains(card); return !_status.event.cards.includes(card);
}).set('cards',player.getEquips('wufengjian')); }).set('cards',player.getEquips('wufengjian'));
}, },
}, },
@ -844,7 +847,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
priority:6, priority:6,
filter:function(event,player){ filter:function(event,player){
if(event.directHit||!get.tag(event.card,'damage')||!['basic','trick'].contains(get.type(event.card))) return false; if(event.directHit||!get.tag(event.card,'damage')||!['basic','trick'].includes(get.type(event.card))) return false;
return player.hasUsableCard('caochuan'); return player.hasUsableCard('caochuan');
}, },
content:function(){ content:function(){

View File

@ -40,7 +40,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCardAfter'}, trigger:{player:'useCardAfter'},
filter:function(event,player){ filter:function(event,player){
const storage=player.storage.clanbaichu||{}; const storage=player.storage.clanbaichu||{};
if(Object.values(storage).contains(event.card.name)) return true; if(Object.values(storage).includes(event.card.name)) return true;
const suit=get.suit(event.card); const suit=get.suit(event.card);
if(suit=='none') return false; if(suit=='none') return false;
if(!player.hasSkill('qice')) return true; if(!player.hasSkill('qice')) return true;
@ -87,7 +87,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.delayx(); game.delayx();
} }
'step 2' 'step 2'
if(Object.values(player.getStorage('clanbaichu')).contains(trigger.card.name)){ if(Object.values(player.getStorage('clanbaichu')).includes(trigger.card.name)){
player.chooseDrawRecover(true); player.chooseDrawRecover(true);
} }
}, },
@ -194,8 +194,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
var list; var list;
if(trigger.card.name=='sha') list=player.getStorage('clanqiuxin_effect').filter(listx=>trigger.targets.contains(listx[0])&&listx[1]==0); if(trigger.card.name=='sha') list=player.getStorage('clanqiuxin_effect').filter(listx=>trigger.targets.includes(listx[0])&&listx[1]==0);
if(get.type(trigger.card)=='trick') list=player.getStorage('clanqiuxin_effect').filter(listx=>trigger.targets.contains(listx[0])&&listx[1]==1); if(get.type(trigger.card)=='trick') list=player.getStorage('clanqiuxin_effect').filter(listx=>trigger.targets.includes(listx[0])&&listx[1]==1);
player.unmarkAuto('clanqiuxin_effect',list); player.unmarkAuto('clanqiuxin_effect',list);
var targets=list.map(listx=>listx[0]); var targets=list.map(listx=>listx[0]);
event.targets=targets; event.targets=targets;
@ -253,7 +253,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
num+=trigger.player.getHistory('useCard',evtx=>evtx.getParent(phase)==evt).length; num+=trigger.player.getHistory('useCard',evtx=>evtx.getParent(phase)==evt).length;
} }
} }
trigger.player.chooseCard('是否重铸任意张牌名字数为'+num+'的牌?',[1,Infinity],'he',(card,player)=>_status.event.cards.contains(card)&&player.canRecast(card)).set('ai',card=>{ trigger.player.chooseCard('是否重铸任意张牌名字数为'+num+'的牌?',[1,Infinity],'he',(card,player)=>_status.event.cards.includes(card)&&player.canRecast(card)).set('ai',card=>{
var val=get.value(card); var val=get.value(card);
return 6-val; return 6-val;
}).set('cards',trigger.player.getCards('he',card=>{ }).set('cards',trigger.player.getCards('he',card=>{
@ -278,7 +278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=get.cardNameLength(trigger.card); var num=get.cardNameLength(trigger.card);
event.num=num; event.num=num;
player.chooseTarget(get.prompt('clanjiejian'),'令一名目标角色摸'+get.cnNumber(num)+'张牌',function(card,player,target){ player.chooseTarget(get.prompt('clanjiejian'),'令一名目标角色摸'+get.cnNumber(num)+'张牌',function(card,player,target){
return _status.event.getTrigger().targets.contains(target); return _status.event.getTrigger().targets.includes(target);
}).set('ai',target=>get.attitude(_status.event.player,target)); }).set('ai',target=>get.attitude(_status.event.player,target));
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -287,11 +287,32 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.draw(num); target.draw(num);
} }
}, },
ai:{threaten:3}, ai:{
threaten:3,
effect:{
player:(card,player,target)=>{
if(!target||typeof card!=='object'||player._clanjiejian_mod_temp||get.type(card)==='equip'||
get.attitude(player,target)<=0||get.cardNameLength(card)!==player.getHistory('useCard').length+1) return;
let targets=[target],evt=_status.event.getParent('useCard');
targets.addArray(ui.selected.targets);
if(evt&&evt.card==card) targets.addArray(evt.targets);
return [1,0.8*get.cardNameLength(card)/targets.length];
}
}
},
mod:{ mod:{
aiOrder:function(player,card,num){ aiOrder:function(player,card,num){
if(typeof card=='object'&&get.cardNameLength(card)==player.getHistory('useCard').length+1&&get.type(card)!='equip'){ if(typeof card=='object'&&get.type(card)!=='equip'){
if(get.effect(player,card,player,player)>0) return num+10; let cs=get.cardNameLength(card)-player.getHistory('useCard').length-1;
if(cs<0) return num;
if(cs>0) return num/3;
player._clanjiejian_mod_temp=true;
let bool=game.hasPlayer(target=>{
if(get.attitude(player,target)<=0||!player.canUse(card,target,null,true)) return false;
return get.effect(target,card,player,player)+get.effect(target,{name:'draw'},player,player)>0;
});
delete player._clanjiejian_mod_temp;
if(bool) return num+15;
} }
}, },
}, },
@ -305,22 +326,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return typeof num=='number'&&num>0; return typeof num=='number'&&num>0;
}, },
check:function(event,player){ check:function(event,player){
var num=get.cardNameLength(event.card); let num=get.cardNameLength(event.card)-player.getDamagedHp();
if(num>=player.getDamagedHp()) return true; if(num>=0) return true;
return player.getHistory('useSkill',evt=>evt.skill=='clanhuanghan').length&&player.hasSkill('clanbaozu',null,false,false)&&player.awakenedSkills.contains('clanbaozu'); if(num<-1) return false;
if(player.hasSkill('clanbaozu',null,false,false)&&player.awakenedSkills.includes('clanbaozu')&&player.getHistory('useSkill',evt=>{
return evt.skill=='clanhuanghan';
}).length) return true;
return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.draw(get.cardNameLength(trigger.card)); player.draw(get.cardNameLength(trigger.card));
if(player.isDamaged()) player.chooseToDiscard(player.getDamagedHp(),'he',true); if(player.isDamaged()) player.chooseToDiscard(player.getDamagedHp(),'he',true);
'step 1' 'step 1'
if(player.getHistory('useSkill',evt=>evt.skill=='clanhuanghan').length>1&&player.hasSkill('clanbaozu',null,false,false)&&player.awakenedSkills.contains('clanbaozu')){ if(player.getHistory('useSkill',evt=>evt.skill=='clanhuanghan').length>1&&player.hasSkill('clanbaozu',null,false,false)&&player.awakenedSkills.includes('clanbaozu')){
player.restoreSkill('clanbaozu'); player.restoreSkill('clanbaozu');
player.popup('保族'); player.popup('保族');
game.log(player,'恢复了技能','#【保族】'); game.log(player,'恢复了技能','#【保族】');
} }
}, },
ai:{threaten:3}, ai:{
threaten:3,
effect:{
target:(card,player,target)=>{
if(!get.tag(card,'damage')||player.hasSkillTag('jueqing',false,target)) return;
let num=get.cardNameLength(card)-target.getDamagedHp();
if(num>0) return [1,num+0.1];
}
}
},
}, },
//族钟会 //族钟会
clanyuzhi:{ clanyuzhi:{
@ -356,7 +390,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('clanyuzhi'); player.logSkill('clanyuzhi');
if(num2>0&&num1>num2) game.log(player,'的野心已开始膨胀','#y('+num1+'张>'+num2+'张)'); if(num2>0&&num1>num2) game.log(player,'的野心已开始膨胀','#y('+num1+'张>'+num2+'张)');
if(num1>num3) game.log(player,'的行动未达到野心','#y('+num3+'张<'+num1+'张)'); if(num1>num3) game.log(player,'的行动未达到野心','#y('+num3+'张<'+num1+'张)');
if(player.hasSkill('clanbaozu',null,false,false)) player.chooseBool('迂志:是否失去〖保族〗?','若选择“否”则你失去1点体力').set('choice',player.awakenedSkills.contains('clanbaozu')); if(player.hasSkill('clanbaozu',null,false,false)) player.chooseBool('迂志:是否失去〖保族〗?','若选择“否”则你失去1点体力').set('choice',player.awakenedSkills.includes('clanbaozu'));
else event._result={bool:false}; else event._result={bool:false};
} }
else event.goto(2); else event.goto(2);
@ -545,7 +579,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return evt.getParent().name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards.length; return evt.getParent().name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards.length;
})&&Math.abs(player.countCards('h')-current.countCards('h'))==2; })&&Math.abs(player.countCards('h')-current.countCards('h'))==2;
}); });
if(targets.contains(target)){ if(targets.includes(target)){
if(player.countCards('h')<target.countCards('h')) return get.sgn(num+0.5)*Math.sqrt(2-num); if(player.countCards('h')<target.countCards('h')) return get.sgn(num+0.5)*Math.sqrt(2-num);
else return num*(2+num); else return num*(2+num);
} }
@ -596,7 +630,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
var num=trigger.player.countCards('h'); var num=trigger.player.countCards('h');
trigger.player.chooseCard('是否重铸任意张牌名字数为'+num+'的牌?',[1,Infinity],'he',(card,player)=>_status.event.cards.contains(card)&&player.canRecast(card)).set('ai',card=>{ trigger.player.chooseCard('是否重铸任意张牌名字数为'+num+'的牌?',[1,Infinity],'he',(card,player)=>_status.event.cards.includes(card)&&player.canRecast(card)).set('ai',card=>{
var val=get.value(card); var val=get.value(card);
return 6-val; return 6-val;
}).set('cards',trigger.player.getCards('he',card=>{ }).set('cards',trigger.player.getCards('he',card=>{
@ -736,7 +770,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.targets&&!info.multitarget){ if(event.targets&&!info.multitarget){
return game.filterPlayer().some(current=>{ return game.filterPlayer().some(current=>{
if(!current.hasSkill('clanmingjie_'+player.playerid)) return false; if(!current.hasSkill('clanmingjie_'+player.playerid)) return false;
return !event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current);
}); });
} }
return false; return false;
@ -746,7 +780,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.chooseTarget(get.prompt('clanmingjie_effect'),'令任意【铭戒】目标角色成为'+get.translation(trigger.card)+'的目标',function(card,player,target){ player.chooseTarget(get.prompt('clanmingjie_effect'),'令任意【铭戒】目标角色成为'+get.translation(trigger.card)+'的目标',function(card,player,target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
if(trigger.targets.contains(target)||!target.isIn()||!target.hasSkill('clanmingjie_'+player.playerid)) return false; if(trigger.targets.includes(target)||!target.isIn()||!target.hasSkill('clanmingjie_'+player.playerid)) return false;
return lib.filter.targetEnabled2(trigger.card,player,target)&&lib.filter.targetInRange(trigger.card,player,target); return lib.filter.targetEnabled2(trigger.card,player,target)&&lib.filter.targetInRange(trigger.card,player,target);
},[1,Infinity]).set('ai',function(target){ },[1,Infinity]).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
@ -963,7 +997,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var len=get.cardNameLength(evt.card); var len=get.cardNameLength(evt.card);
list.add(len); list.add(len);
}); });
if(!list.contains(count)) return count; if(!list.includes(count)) return count;
if(list.length) return list.randomGet(); if(list.length) return list.randomGet();
return 4; return 4;
}()); }());
@ -1145,7 +1179,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.hasCard(card=>{ if(player.hasCard(card=>{
return get.value(card)<5&&!['shan','tao','jiu','wuxie','caochuan'].contains(get.name(card)); return get.value(card)<5&&!['shan','tao','jiu','wuxie','caochuan'].includes(get.name(card));
},'he')) return -1; },'he')) return -1;
return 0; return 0;
}, },
@ -1192,7 +1226,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage[`temp_ban_${skill}`]){ if(player.storage[`temp_ban_${skill}`]){
delete player.storage[`temp_ban_${skill}`]; delete player.storage[`temp_ban_${skill}`];
} }
if(player.awakenedSkills.contains(skill)){ if(player.awakenedSkills.includes(skill)){
player.restoreSkill(skill); player.restoreSkill(skill);
resetSkills.add(skill); resetSkills.add(skill);
} }
@ -1339,7 +1373,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'联诛:是否对'+get.translation(event.targetx)+'使用一张杀?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'联诛:是否对'+get.translation(event.targetx)+'使用一张杀?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',event.targetx).set('addCount',false); }).set('sourcex',event.targetx).set('addCount',false);
'step 7' 'step 7'
@ -1398,9 +1432,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.classList.remove('linked2'); target.classList.remove('linked2');
var eff=cards[0][1]; var eff=cards[0][1];
if(eff>0) return eff; if(eff>0) return eff;
return Math.max((get.effect(target,{name:'wuzhong'},player,player)+get.effect(player,{name:'wuzhong'},player,player)/3),get.recoverEffect(target,player,player)); return Math.max((2*get.effect(target,{name:'draw'},player,player)+0.6*get.effect(player,{name:'draw'},player,player)),get.recoverEffect(target,player,player));
} }
return Math.max((get.effect(target,{name:'wuzhong'},player,player)+get.effect(player,{name:'wuzhong'},player,player)/3),get.recoverEffect(target,player,player)); return Math.max((2*get.effect(target,{name:'draw'},player,player)+0.6*get.effect(player,{name:'draw'},player,player)),get.recoverEffect(target,player,player));
}).set('goon',player.countCards('hs',card=>{ }).set('goon',player.countCards('hs',card=>{
return get.name(card)=='jiu'&&player.hasUseTarget(card); return get.name(card)=='jiu'&&player.hasUseTarget(card);
})&&player.countCards('hs',card=>{ })&&player.countCards('hs',card=>{
@ -1425,7 +1459,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player,target=_status.event.getParent().target; var player=_status.event.player,target=_status.event.getParent().target;
if(!target.isDamaged()) return 0; if(!target.isDamaged()) return 0;
if(get.attitude(player,target)<=0&&player.countCards('he',card=>get.value(card)<0)>=2) return 0; if(get.attitude(player,target)<=0&&player.countCards('he',card=>get.value(card)<0)>=2) return 0;
return (get.effect(target,{name:'wuzhong'},player,player)+get.effect(player,{name:'wuzhong'},player,player)/3)>get.recoverEffect(target,player,player)?0:1; return (2*get.effect(target,{name:'draw'},player,player)+0.6*get.effect(player,{name:'draw'},player,player))>get.recoverEffect(target,player,player)?0:1;
}); });
} }
else event.finish(); else event.finish();
@ -1460,7 +1494,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
locked:false, locked:false,
charlotte:true, charlotte:true,
filter:function(event,player){ filter:function(event,player){
return player.getStorage('clanfangzhen_remove').contains(game.roundNumber); return player.getStorage('clanfangzhen_remove').includes(game.roundNumber);
}, },
content:function(){ content:function(){
player.removeSkill('clanfangzhen'); player.removeSkill('clanfangzhen');
@ -1605,7 +1639,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
popup:false, popup:false,
onremove:true, onremove:true,
filter:function(event,player){ filter:function(event,player){
return player.getStorage('clanlianhe_effect').contains(event.player); return player.getStorage('clanlianhe_effect').includes(event.player);
}, },
marktext:'连', marktext:'连',
intro:{content:'已选择目标:$'}, intro:{content:'已选择目标:$'},
@ -1723,7 +1757,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=choices.sort((a,b)=>a[1]-b[1])[0]; var list=choices.sort((a,b)=>a[1]-b[1])[0];
if(list[1]<2) return list[0]; if(list[1]<2) return list[0];
else{ else{
if(_status.event.controls.contains('clanxumin')) return 'clanxumin'; if(_status.event.controls.includes('clanxumin')) return 'clanxumin';
return list[0]; return list[0];
} }
}); });
@ -1881,11 +1915,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var namex=name; var namex=name;
if(nature&&nature.length){ if(nature&&nature.length){
namex+=nature; namex+=nature;
if(names.contains(namex)) continue; if(names.includes(namex)) continue;
list.push([get.type(card),'',name,nature]); list.push([get.type(card),'',name,nature]);
} }
else{ else{
if(names.contains(namex)) continue; if(names.includes(namex)) continue;
list.push([get.type(card),'',name]); list.push([get.type(card),'',name]);
} }
names.push(namex); names.push(namex);
@ -2092,7 +2126,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return !player.isDisabledJudge()||player.countCards('h',card=>['sha','shan'].contains(get.name(card)))>0; return !player.isDisabledJudge()||player.countCards('h',card=>['sha','shan'].includes(get.name(card)))>0;
}, },
chooseButton:{ chooseButton:{
dialog:function(event,player){ dialog:function(event,player){
@ -2111,7 +2145,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
switch (button.link){ switch (button.link){
case 'damage': case 'damage':
if(get.damageEffect(player,player,player,'fire')>=0) return 10; if(get.damageEffect(player,player,player,'fire')>=0) return 10;
if(player.hp>=Math.max(2,3-player.getFriends().length)&&game.countPlayer(current=>get.attitude(player,current)<0&&current.countCards('h',card=>['sha','shan'].contains(get.name(card))))) return 0.8+Math.random(); if(player.hp>=Math.max(2,3-player.getFriends().length)&&game.countPlayer(current=>get.attitude(player,current)<0&&current.countCards('h',card=>['sha','shan'].includes(get.name(card))))) return 0.8+Math.random();
return 0; return 0;
case 'shan': case 'shan':
if(player.countCards('h','shan')==1) return 8+Math.random(); if(player.countCards('h','shan')==1) return 8+Math.random();
@ -2142,10 +2176,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var eff=get.damageEffect(player,player,player,'fire'),disabled=!player.isDisabledJudge(); var eff=get.damageEffect(player,player,player,'fire'),disabled=!player.isDisabledJudge();
if((player.countCards('h','sha')==1||player.countCards('h','shan')==1)&&eff<0&&!disabled) return 8; if((player.countCards('h','sha')==1||player.countCards('h','shan')==1)&&eff<0&&!disabled) return 8;
else if(eff>=0&&!disabled) return 5.8; else if(eff>=0&&!disabled) return 5.8;
if(!disabled&&!player.countCards('h',card=>['sha','shan'].contains(get.name(card)))){ if(!disabled&&!player.countCards('h',card=>['sha','shan'].includes(get.name(card)))){
if((!player.hasSkill('clanhuanyin')||!player.canSave(player))&&player.hp<=1) return 0; if((!player.hasSkill('clanhuanyin')||!player.canSave(player))&&player.hp<=1) return 0;
if(player.canSave(player)&&player.hp==1&&player.countCards('h')<=1) return 2.6; if(player.canSave(player)&&player.hp==1&&player.countCards('h')<=1) return 2.6;
if(player.hp<Math.max(2,3-player.getFriends().length)||!game.countPlayer(current=>get.attitude(player,current)<0&&current.countCards('h',card=>['sha','shan'].contains(get.name(card))))) return 0; if(player.hp<Math.max(2,3-player.getFriends().length)||!game.countPlayer(current=>get.attitude(player,current)<0&&current.countCards('h',card=>['sha','shan'].includes(get.name(card))))) return 0;
} }
return 2.5; return 2.5;
}, },
@ -2178,7 +2212,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player,chosen=_status.event.getParent().choice,att=get.attitude(player,target); var player=_status.event.player,chosen=_status.event.getParent().choice,att=get.attitude(player,target);
if(chosen=='damage'){ if(chosen=='damage'){
if(att>0) return 0; if(att>0) return 0;
return -att/2+target.countCards('h',card=>['sha','shan'].contains(get.name(card))); return -att/2+target.countCards('h',card=>['sha','shan'].includes(get.name(card)));
} }
return get.damageEffect(target,player,player,'fire'); return get.damageEffect(target,player,player,'fire');
}); });
@ -2215,13 +2249,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.chooseControl(list).set('choiceList',choiceList).set('ai',()=>{ target.chooseControl(list).set('choiceList',choiceList).set('ai',()=>{
var controls=_status.event.controls.slice(),player=_status.event.player,user=_status.event.getParent().player; var controls=_status.event.controls.slice(),player=_status.event.player,user=_status.event.getParent().player;
if(controls.length==1) return controls[0]; if(controls.length==1) return controls[0];
if(controls.contains('选项一')&&get.damageEffect(player,user,player,'fire')>=0) return '选项一'; if(controls.includes('选项一')&&get.damageEffect(player,user,player,'fire')>=0) return '选项一';
if(controls.contains('选项一')&&player.hp<=2&&player.countCards('h',card=>['sha','shan'].contains(get.name(card)))<=3) controls.remove('选项一'); if(controls.includes('选项一')&&player.hp<=2&&player.countCards('h',card=>['sha','shan'].includes(get.name(card)))<=3) controls.remove('选项一');
if(controls.length==1) return controls[0]; if(controls.length==1) return controls[0];
if(player.getCards('h','sha').reduce((p,c)=>p+get.value(c,player),0)>player.getCards('h','sha').reduce((p,c)=>p+get.value(c,player),0)){ if(player.getCards('h','sha').reduce((p,c)=>p+get.value(c,player),0)>player.getCards('h','sha').reduce((p,c)=>p+get.value(c,player),0)){
if(controls.contains('选项三')) return '选项三'; if(controls.includes('选项三')) return '选项三';
} }
else if(controls.contains('选项二')) return '选项二'; else if(controls.includes('选项二')) return '选项二';
return controls.randomGet(); return controls.randomGet();
}); });
} else event.finish(); } else event.finish();
@ -2243,7 +2277,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCardAfter'}, trigger:{player:'useCardAfter'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(!lib.suit.contains(get.suit(event.card))) return false; if(!lib.suit.includes(get.suit(event.card))) return false;
var card=event.card,suit=get.suit(card); var card=event.card,suit=get.suit(card);
for(var i=player.actionHistory.length-1; i>=0; i--){ for(var i=player.actionHistory.length-1; i>=0; i--){
var history=player.actionHistory[i].useCard; var history=player.actionHistory[i].useCard;

View File

@ -4,6 +4,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
name:'collab', name:'collab',
connect:true, connect:true,
character:{ character:{
dc_sunce:['male','wu',4,['dcshuangbi']],
nezha:['male','qun',2,['dcsantou','dcfaqi']], nezha:['male','qun',2,['dcsantou','dcfaqi']],
dc_caocao:['male','wei',4,['dcjianxiong']], dc_caocao:['male','wei',4,['dcjianxiong']],
dc_liubei:['male','shu',4,['dcrende']], dc_liubei:['male','shu',4,['dcrende']],
@ -34,10 +35,89 @@ game.import('character',function(lib,game,ui,get,ai,_status){
collab_tongque:["sp_fuwan","sp_fuhuanghou","sp_jiben","old_lingju",'sp_mushun'], collab_tongque:["sp_fuwan","sp_fuhuanghou","sp_jiben","old_lingju",'sp_mushun'],
collab_duanwu:['sunwukong','longwang','taoshen'], collab_duanwu:['sunwukong','longwang','taoshen'],
collab_decade:['libai','xiaoyuehankehan','zhutiexiong','wu_zhutiexiong'], collab_decade:['libai','xiaoyuehankehan','zhutiexiong','wu_zhutiexiong'],
collab_remake:['dc_caocao','dc_liubei','dc_sunquan','nezha'], collab_remake:['dc_caocao','dc_liubei','dc_sunquan','nezha','dc_sunce'],
}, },
}, },
skill:{ skill:{
//孙策
//双壁=100%技能周瑜+100%原画孙策
dcshuangbi:{
audio:2,
enable:'phaseUse',
usable:1,
content:function*(event,map){
var player=map.player,num=game.countPlayer();
var result=yield player.chooseControl().set('choiceList',[
'摸'+get.cnNumber(num)+'张牌,本回合手牌上限+'+parseFloat(num),
'弃置至多'+get.cnNumber(num)+'张牌,随机对其他角色造成等量火焰伤害',
'视为使用'+get.cnNumber(num)+'张火【杀】或【火攻】',
]).set('ai',()=>{
var player=_status.event.player,card={name:'sha',nature:'fire'};
if(!game.hasPlayer(target=>player.canUse(card,target)&&get.effect(target,card,player,player)>0)) return 0;
return 2;
});
player.flashAvatar('dcshuangbi',['re_zhouyu','shen_zhouyu','dc_sb_zhouyu'][result.index]);
switch(result.index){
case 0:
player.draw(num);
player.addTempSkill('dcshuangbi_effect');
player.addMark('dcshuangbi_effect',num,false);
break;
case 1:
var result2=yield player.chooseToDiscard('双壁:弃置至多'+get.cnNumber(num)+'张牌,随机对其他角色造成等量火焰伤害',[1,num],'he').set('ai',card=>1/(get.value(card)||0.5));
if(result2.bool){
var map={},sum=result2.cards.length;
var targets=game.filterPlayer(target=>target!=player);
if(targets.length){
while(sum){
sum--;
var target=targets.randomGet();
player.line(target);
target.damage(1,'fire');
game.delayx();
}
}
}
break;
case 2:
while(num&&game.hasPlayer(target=>player.canUse({name:'sha',nature:'fire'},target)||player.canUse({name:'huogong'},target))){
num--;
var list=[];
if(game.hasPlayer(target=>player.canUse({name:'sha',nature:'fire'},target))) list.push(['基本','','sha','fire']);
if(game.hasPlayer(target=>player.canUse({name:'huogong'},target))) list.push(['锦囊','','huogong']);
var result2=yield player.chooseButton([
'双壁:请选择你要使用的牌',
[list,'vcard']],
true).set('ai',button=>button.link[2]=='sha'?1:0);
if(result2.bool){
var card={
name:result2.links[0][2],
nature:result2.links[0][3],
};
yield player.chooseUseTarget(true,card,false);
}
else break;
}
break;
}
},
ai:{
order:9,
result:{player:1},
},
subSkill:{
effect:{
charlotte:true,
onremove:true,
intro:{content:'手牌上限+#'},
mod:{
maxHandcard:function(player,num){
return num+player.countMark('dcshuangbi_effect');
},
},
},
},
},
//哪吒 //哪吒
dcsantou:{ dcsantou:{
audio:2, audio:2,
@ -95,34 +175,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player._dcsantou_temp) return; if(player._dcsantou_temp) return;
if(get.tag(card,'damage')){ if(get.tag(card,'damage')){
const hp=target.getHp(); const hp=target.getHp();
player._dcsantou_temp=true;
const losehp=get.effect(target,{name:'losehp'},target,target)/get.attitude(target,target);
delete player._dcsantou_temp;
if(hp>=3){ if(hp>=3){
if(target.hasHistory('useSkill',evt=>evt.skill=='dcsantou'&&evt.event.getTrigger().source==player)) return [1,-2]; if(target.hasHistory('useSkill',evt=>evt.skill=='dcsantou'&&evt.event.getTrigger().source==player)) return [0,losehp,0,0];
else if(get.attitude(player,target)<0){ else if(get.attitude(player,target)<0){
if(card.name=='sha') return; let hs=player.getCards('hs',i=>{
let sha=false; return i!==card&&(!card.cards||!card.cards.includes(i));
player._dcsantou_temp=true; }),num=player.getCardUsable('sha');
let num=player.countCards('h',card=>{ if(card.name==='sha') num--;
if(card.name=='sha'){ hs=hs.filter(i=>{
if(sha) return false; if(!player.canUse(i,target)) return false;
else sha=true; if(get.tag(card,'damage')&&get.name(i,player)!=='sha') return true;
if(num){
num--;
return true;
} }
return get.tag(card,'damage')&&player.canUse(card,target)&&get.effect(target,card,player,player)>0; return false;
}); }).length;
delete player._dcsantou_temp; if(player.hasSkillTag('damage',null,{target:target})) hs++;
if(player.hasSkillTag('damage')){ if(!hs) return 'zeroplayertarget';
num++; num=1-2/3/hs;
} return [num,0,num,0];
if(num<2){
var enemies=player.getEnemies();
if(enemies.length==1&&enemies[0]==target&&player.needsToDiscard()){
return;
}
return 0;
}
} }
} }
else if(hp==2&&get.tag(card,'natureDamage')||hp==1&&get.color(card)=='red'&&get.itemtype(card)=='card') return [1,-2]; if(hp==2&&get.tag(card,'natureDamage')||hp==1&&typeof card=='object'&&get.color(card)=='red') return [0,losehp,0,0];
else return 0; return 'zeroplayertarget';
} }
} }
} }
@ -160,6 +239,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
else event.finish(); else event.finish();
},
ai:{
reverseEquip:true
} }
}, },
//隅泣曹操 //隅泣曹操
@ -220,7 +302,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
lose:false, lose:false,
delay:false, delay:false,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player.getStorage('dcrende_targeted').contains(target)) return false; if(player.getStorage('dcrende_targeted').includes(target)) return false;
return player!=target&&target.countGainableCards(player,'h')>1; return player!=target&&target.countGainableCards(player,'h')>1;
}, },
content:function(){ content:function(){
@ -254,9 +336,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player; var player=_status.event.player;
var card={name:button.link[2],nature:button.link[3],isCard:true}; var card={name:button.link[2],nature:button.link[3],isCard:true};
if(card.name=='tao'){ if(card.name=='tao'){
if(player.hp==1||(player.hp==2&&!player.hasShan())||player.needsToDiscard()){ if(player.hp==1||(player.hp==2&&!player.hasShan())||player.needsToDiscard()) return 5;
return 5;
}
return 1; return 1;
} }
if(card.name=='sha'){ if(card.name=='sha'){
@ -335,7 +415,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var hs=player.getCards('h'); var hs=player.getCards('h');
if(!hs.length) event.num=0; if(!hs.length) event.num=0;
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(!cards.contains(hs[i])){ if(!cards.includes(hs[i])){
event.num=0;break; event.num=0;break;
} }
} }
@ -351,7 +431,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
locked:false, locked:false,
filter:function(event,player){ filter:function(event,player){
return !player.getStorage('dczhiheng_hit').contains(event.player); return !player.getStorage('dczhiheng_hit').includes(event.player);
}, },
content:function(){ content:function(){
player.addTempSkill('dczhiheng_hit'); player.addTempSkill('dczhiheng_hit');
@ -372,10 +452,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
ai:{ ai:{
order:1, order:function(item,player){
if(player.hasCard((i)=>{
return get.value(i)>Math.max(6,9-player.hp);
},'he')) return 1;
return 10;
},
result:{ result:{
player:1 player:1
}, },
nokeep:true,
skillTagFilter:function(player,tag,arg){
if(tag==='nokeep') return (!arg||arg&&arg.card&&get.name(arg.card)==='tao')&&player.isPhaseUsing()&&player.countSkill('dczhiheng')<1+player.getStorage('dczhiheng_hit').length&&player.hasCard((card)=>{
return get.name(card)!=='tao';
},'h');
},
threaten:1.55 threaten:1.55
}, },
}, },
@ -511,14 +602,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!evt||!evt.hs||!evt.hs.length) return false; if(!evt||!evt.hs||!evt.hs.length) return false;
if(event.name=='lose'){ if(event.name=='lose'){
for(var i in event.gaintag_map){ for(var i in event.gaintag_map){
if(event.gaintag_map[i].contains('dctongliao')) return true; if(event.gaintag_map[i].includes('dctongliao')) return true;
} }
return false; return false;
} }
return player.hasHistory('lose',function(evt){ return player.hasHistory('lose',function(evt){
if(event!=evt.getParent()) return false; if(event!=evt.getParent()) return false;
for(var i in evt.gaintag_map){ for(var i in evt.gaintag_map){
if(evt.gaintag_map[i].contains('dctongliao')) return true; if(evt.gaintag_map[i].includes('dctongliao')) return true;
} }
return false; return false;
}); });
@ -529,17 +620,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var cards=trigger.getl(player).hs,ids=[]; var cards=trigger.getl(player).hs,ids=[];
if(trigger.name=='lose'){ if(trigger.name=='lose'){
for(var i in trigger.gaintag_map){ for(var i in trigger.gaintag_map){
if(trigger.gaintag_map[i].contains('dctongliao')) ids.push(i); if(trigger.gaintag_map[i].includes('dctongliao')) ids.push(i);
} }
} }
else player.getHistory('lose',function(evt){ else player.getHistory('lose',function(evt){
if(trigger!=evt.getParent()) return false; if(trigger!=evt.getParent()) return false;
for(var i in evt.gaintag_map){ for(var i in evt.gaintag_map){
if(evt.gaintag_map[i].contains('dctongliao')) ids.push(i); if(evt.gaintag_map[i].includes('dctongliao')) ids.push(i);
} }
}); });
for(var card of cards){ for(var card of cards){
if(ids.contains(card.cardid)) num+=get.number(card,player); if(ids.includes(card.cardid)) num+=get.number(card,player);
} }
if(num>0) player.draw(num); if(num>0) player.draw(num);
} }
@ -551,7 +642,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCardAfter'}, trigger:{player:'useCardAfter'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
if(player.getStorage('dcwudao_effect').contains(get.type2(event.card,false))) return false; if(player.getStorage('dcwudao_effect').includes(get.type2(event.card,false))) return false;
var history=player.getHistory('useCard'),index=history.indexOf(event); var history=player.getHistory('useCard'),index=history.indexOf(event);
if(index<1) return false; if(index<1) return false;
var evt=history[index-1]; var evt=history[index-1];
@ -571,7 +662,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
popup:false, popup:false,
onremove:true, onremove:true,
filter:function(event,player){ filter:function(event,player){
return player.getStorage('dcwudao_effect').contains(get.type2(event.card,false)); return player.getStorage('dcwudao_effect').includes(get.type2(event.card,false));
}, },
content:function(){ content:function(){
if(get.tag(trigger.card,'damage')>0) trigger.baseDamage++; if(get.tag(trigger.card,'damage')>0) trigger.baseDamage++;
@ -581,7 +672,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
directHit_ai:true, directHit_ai:true,
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(arg&&arg.card&&player.getStorage('dcwudao_effect').contains(get.type2(arg.card))) return true; if(arg&&arg.card&&player.getStorage('dcwudao_effect').includes(get.type2(arg.card))) return true;
return false; return false;
}, },
}, },
@ -1046,7 +1137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
logTarget:'player', logTarget:'player',
filter:function(event,player){ filter:function(event,player){
return player!=event.player&&!player.hasHistory('useSkill',function(evt){ return player!=event.player&&!player.hasHistory('useSkill',function(evt){
return evt.skill=='dccibei'&&evt.targets.contains(event.player); return evt.skill=='dccibei'&&evt.targets.includes(event.player);
}); });
}, },
check:function(event,player){ check:function(event,player){
@ -1080,25 +1171,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
canBeGained:function(card,source,player){ canBeGained:function(card,source,player){
if(player.getEquips('ruyijingubang').contains(card)) return false; if(player.getEquips('ruyijingubang').includes(card)) return false;
}, },
canBeDiscarded:function(card,source,player){ canBeDiscarded:function(card,source,player){
if(player.getEquips('ruyijingubang').contains(card)) return false; if(player.getEquips('ruyijingubang').includes(card)) return false;
}, },
canBeReplaced:function(card,player){ canBeReplaced:function(card,player){
if(player.getEquips('ruyijingubang').contains(card)) return false; if(player.getEquips('ruyijingubang').includes(card)) return false;
}, },
cardname:function(card){ cardname:function(card){
if(get.subtype(card,false)=='equip1') return 'sha'; if(get.subtype(card,false)=='equip1') return 'sha';
}, },
cardnature:function(card){ cardnature:function(card){
if(get.subtypes(card,false).contains('equip1')) return false; if(get.subtypes(card,false).includes('equip1')) return false;
}, },
cardDiscardable:function(card,player){ cardDiscardable:function(card,player){
if(player.getEquips('ruyijingubang').contains(card)) return false; if(player.getEquips('ruyijingubang').includes(card)) return false;
}, },
cardEnabled2:function(card,player){ cardEnabled2:function(card,player){
if(player.getEquips('ruyijingubang').contains(card)) return false; if(player.getEquips('ruyijingubang').includes(card)) return false;
}, },
}, },
group:'dcruyi_blocker', group:'dcruyi_blocker',
@ -1107,16 +1198,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:['loseBefore','disableEquipBefore']}, trigger:{player:['loseBefore','disableEquipBefore']},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event.name=='disableEquip') return (event.slots.contains('equip1')); if(event.name=='disableEquip') return (event.slots.includes('equip1'));
var cards=player.getEquips('ruyijingubang'); var cards=player.getEquips('ruyijingubang');
return event.cards.some(card=>cards.contains(card)); return event.cards.some(card=>cards.includes(card));
}, },
content:function(){ content:function(){
if(trigger.name=='lose'){ if(trigger.name=='lose'){
trigger.cards.removeArray(player.getEquips('ruyijingubang')); trigger.cards.removeArray(player.getEquips('ruyijingubang'));
} }
else{ else{
while(trigger.slots.contains('equip1')) trigger.slots.remove('equip1'); while(trigger.slots.includes('equip1')) trigger.slots.remove('equip1');
} }
}, },
}, },
@ -1184,7 +1275,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.tag(card,'damage')>0&&player!=target){ if(get.tag(card,'damage')>0&&player!=target){
if(player.getStat('skill').ruyijingubang_skill&&player.storage.ruyijingubang_skill!=1) return; if(player.getStat('skill').ruyijingubang_skill&&player.storage.ruyijingubang_skill!=1) return;
if(player.hasSkill('dccibei')&&!player.hasHistory('useSkill',function(evt){ if(player.hasSkill('dccibei')&&!player.hasHistory('useSkill',function(evt){
return evt.skill=='dccibei'&&evt.targets.contains(target); return evt.skill=='dccibei'&&evt.targets.includes(target);
})){ })){
return [1,3]; return [1,3];
} }
@ -1227,7 +1318,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(num!=4) return true; if(num!=4) return true;
var card=event.card; var card=event.card;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current);
})){ })){
return true; return true;
} }
@ -1238,7 +1329,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=player.storage.ruyijingubang_skill; var num=player.storage.ruyijingubang_skill;
if(num==4){ if(num==4){
player.chooseTarget(get.prompt('ruyijingubang_effect'),'为'+get.translation(trigger.card)+'额外指定一个目标',function(card,player,target){ player.chooseTarget(get.prompt('ruyijingubang_effect'),'为'+get.translation(trigger.card)+'额外指定一个目标',function(card,player,target){
return !_status.event.sourcex.contains(target)&&player.canUse(_status.event.card,target,false); return !_status.event.sourcex.includes(target)&&player.canUse(_status.event.card,target,false);
}).set('sourcex',trigger.targets).set('ai',function(target){ }).set('sourcex',trigger.targets).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
return get.effect(target,_status.event.card,player,player); return get.effect(target,_status.event.card,player,player);
@ -1501,7 +1592,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'密信:对'+get.translation(targets[1])+'使用一张【杀】,或令其观看并获得你的一张手牌').set('complexSelect',true).set('filterTarget',function(card,player,target){ },'密信:对'+get.translation(targets[1])+'使用一张【杀】,或令其观看并获得你的一张手牌').set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',targets[1]); }).set('sourcex',targets[1]);
'step 2' 'step 2'
@ -1752,6 +1843,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dcsantou_info:'锁定技。①当你受到伤害时防止之然后若以下有条件成立你失去1点体力1.你于本回合此前以此法防止过该伤害来源的伤害且你的体力值不小于32.本次伤害为属性伤害且你的体力值为23.本次伤害的渠道为红色的牌且你的体力值为1。②游戏开始时若你的体力上限小于3你将体力上限加至3并将体力回复至3。', dcsantou_info:'锁定技。①当你受到伤害时防止之然后若以下有条件成立你失去1点体力1.你于本回合此前以此法防止过该伤害来源的伤害且你的体力值不小于32.本次伤害为属性伤害且你的体力值为23.本次伤害的渠道为红色的牌且你的体力值为1。②游戏开始时若你的体力上限小于3你将体力上限加至3并将体力回复至3。',
dcfaqi:'法器', dcfaqi:'法器',
dcfaqi_info:'当你于出牌阶段使用装备牌结算结束后,你视为使用一张本回合未以此法使用过的普通锦囊牌。', dcfaqi_info:'当你于出牌阶段使用装备牌结算结束后,你视为使用一张本回合未以此法使用过的普通锦囊牌。',
dc_sunce:'经典孙策',
dc_sunce_prefix:'经典',
dcshuangbi:'双壁',
dcshuangbi_info:'出牌阶段限一次你可以选择一项①摸X张牌本回合手牌上限+X②弃置至多X张牌随机对其他角色造成等量火焰伤害③视为使用X张火【杀】或【火攻】。X为场上存活角色数',
collab_olympic:'OL·伦敦奥运会', collab_olympic:'OL·伦敦奥运会',
collab_tongque:'OL·铜雀台', collab_tongque:'OL·铜雀台',

View File

@ -751,7 +751,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{ result:{
player:function(player){ player:function(player){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
var num=1+player.countCards('h',card=>!ui.selected.cards.contains(card)); var num=1+player.countCards('h',card=>!ui.selected.cards.includes(card));
if(!game.hasPlayer(current=>{ if(!game.hasPlayer(current=>{
return current!=player&&current.countCards('h')>num; return current!=player&&current.countCards('h')>num;
})||!game.hasPlayer(current=>{ })||!game.hasPlayer(current=>{
@ -794,7 +794,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.color(card)==color; return get.color(card)==color;
},'h')){ },'h')){
if(color=='red') return get.recoverEffect(player,player,player)+2/Math.max(2,get.value(button.link)); if(color=='red') return get.recoverEffect(player,player,player)+2/Math.max(2,get.value(button.link));
if(color=='black') return get.effect(target,{name:'wuzhong'},target,player)+2/Math.max(2,get.value(button.link)); if(color=='black') return 2*get.effect(target,{name:'draw'},target,player)+2/Math.max(2,get.value(button.link));
} }
return get.value(button.link)/3; return get.value(button.link)/3;
}) })
@ -828,7 +828,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var prompt2='用'+get.translation(event.card1)+'交换对方的'+get.translation(event.card2); var prompt2='用'+get.translation(event.card1)+'交换对方的'+get.translation(event.card2);
if(color=='black'){ if(color=='black'){
prompt2+=',然后对方摸两张牌'; prompt2+=',然后对方摸两张牌';
next.set('goon',get.effect(target,{name:'wuzhong'},target,player)>0); next.set('goon',2*get.effect(target,{name:'draw'},target,player)>0);
} }
else if(color=='red'&&player.isDamaged()){ else if(color=='red'&&player.isDamaged()){
prompt2+='然后你回复1点体力'; prompt2+='然后你回复1点体力';
@ -877,7 +877,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.number(card,target)==min&&lib.filter.canBeGained(card,player,target); return get.number(card,target)==min&&lib.filter.canBeGained(card,player,target);
}),att=get.attitude(player,target) }),att=get.attitude(player,target)
return Math.max.apply(Math,cards.map(card=>{ return Math.max.apply(Math,cards.map(card=>{
if(target.getCards('j').contains(card)){ if(target.getCards('j').includes(card)){
var efff=get.effect(target,{ var efff=get.effect(target,{
name:card.viewAs||card.name, name:card.viewAs||card.name,
cards:[card], cards:[card],
@ -886,7 +886,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(efff==0) return 0; if(efff==0) return 0;
return 1.5*att; return 1.5*att;
} }
if(target.getCards('e').contains(card)){ if(target.getCards('e').includes(card)){
var evalue=get.value(card,target); var evalue=get.value(card,target);
if(target.hasSkillTag('noe')){ if(target.hasSkillTag('noe')){
if(evalue>=7){ if(evalue>=7){
@ -933,7 +933,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var gives=cards.filter(card=>get.number(card,target)==max); var gives=cards.filter(card=>get.number(card,target)==max);
if(gives.length<=1) event._result={bool:true,cards:gives}; if(gives.length<=1) event._result={bool:true,cards:gives};
else target.chooseCard('he',true,'选择给出一张点数最大的牌',function(card){ else target.chooseCard('he',true,'选择给出一张点数最大的牌',function(card){
return _status.event.cards.contains(card); return _status.event.cards.includes(card);
}).set('cards',gives); }).set('cards',gives);
} }
else event.goto(7); else event.goto(7);
@ -961,7 +961,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.number(card,target)==min&&lib.filter.canBeGained(card,player,target); return get.number(card,target)==min&&lib.filter.canBeGained(card,player,target);
}),att=get.attitude(player,target) }),att=get.attitude(player,target)
return Math.max.apply(Math,cards.map(card=>{ return Math.max.apply(Math,cards.map(card=>{
if(target.getCards('j').contains(card)){ if(target.getCards('j').includes(card)){
var efff=get.effect(target,{ var efff=get.effect(target,{
name:card.viewAs||card.name, name:card.viewAs||card.name,
cards:[card], cards:[card],
@ -970,7 +970,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(efff==0) return 0; if(efff==0) return 0;
return 1.5*att; return 1.5*att;
} }
if(target.getCards('e').contains(card)){ if(target.getCards('e').includes(card)){
var evalue=get.value(card,target); var evalue=get.value(card,target);
if(target.hasSkillTag('noe')){ if(target.hasSkillTag('noe')){
if(evalue>=7){ if(evalue>=7){
@ -993,7 +993,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})),cards=target2.getCards('ej',card=>get.number(card,target2)==min); })),cards=target2.getCards('ej',card=>get.number(card,target2)==min);
if(cards.length<=1) target.gain(cards,target2,'give','bySelf'); if(cards.length<=1) target.gain(cards,target2,'give','bySelf');
else target.gainPlayerCard(target2,'ej',true).set('filterButton',function(button){ else target.gainPlayerCard(target2,'ej',true).set('filterButton',function(button){
return _status.event.cards.contains(button.link); return _status.event.cards.includes(button.link);
}).set('cards',cards); }).set('cards',cards);
} }
'step 7' 'step 7'
@ -1105,7 +1105,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
player.chooseTarget('是否令一名其他角色摸等量的牌?',lib.filter.notMe).set('ai',target=>{ player.chooseTarget('是否令一名其他角色摸等量的牌?',lib.filter.notMe).set('ai',target=>{
var player=get.player(); var player=get.player();
return get.effect(target,{name:'wuzhong'},player,player); return get.effect(target,{name:'draw'},player,player);
}); });
'step 2' 'step 2'
if(result.bool){ if(result.bool){
@ -1202,13 +1202,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
mod:{ mod:{
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(player.getStorage('dddbingjian_blocker').contains(card.name)) return false; if(player.getStorage('dddbingjian_blocker').includes(card.name)) return false;
}, },
cardRespondable:function(card,player){ cardRespondable:function(card,player){
if(player.getStorage('dddbingjian_blocker').contains(card.name)) return false; if(player.getStorage('dddbingjian_blocker').includes(card.name)) return false;
}, },
cardSavable:function(card,player){ cardSavable:function(card,player){
if(player.getStorage('dddbingjian_blocker').contains(card.name)) return false; if(player.getStorage('dddbingjian_blocker').includes(card.name)) return false;
}, },
}, },
mark:true, mark:true,
@ -1311,7 +1311,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
event.cards=trigger.remained.filterInD(); event.cards=trigger.remained.filterInD();
player.chooseTarget('仝御:令一名角色获得'+get.translation(event.cards),function(card,player,target){ player.chooseTarget('仝御:令一名角色获得'+get.translation(event.cards),function(card,player,target){
return _status.event.targets.contains(target); return _status.event.targets.includes(target);
}).set('targets',trigger.getParent().dddtongyu_targets).set('ai',function(target){ }).set('targets',trigger.getParent().dddtongyu_targets).set('ai',function(target){
var att=get.attitude(_status.event.player,target); var att=get.attitude(_status.event.player,target);
if(att<3) return 0; if(att<3) return 0;
@ -1369,7 +1369,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseControl(choices,'cancel2').set('prompt',get.prompt('dddzhilian')).set('prompt2',prompt2).set('ai',function(){ player.chooseControl(choices,'cancel2').set('prompt',get.prompt('dddzhilian')).set('prompt2',prompt2).set('ai',function(){
var player=_status.event.player; var player=_status.event.player;
var targets=_status.event.getParent().targets.slice(0); var targets=_status.event.getParent().targets.slice(0);
if(targets.contains(player)){ if(targets.includes(player)){
targets.remove(player); targets.remove(player);
if(get.attitude(player,targets[0])>0) return 0; if(get.attitude(player,targets[0])>0) return 0;
if(targets[0].countCards('he')>0&&!targets[0].hasCard(card=>get.value(card,targets[0])<=0,'e')&&player.countCards('h','sha')>0) return 1; if(targets[0].countCards('he')>0&&!targets[0].hasCard(card=>get.value(card,targets[0])<=0,'e')&&player.countCards('h','sha')>0) return 1;
@ -1391,7 +1391,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{ else{
for(var target of targets) target.chooseToDiscard('he',true); for(var target of targets) target.chooseToDiscard('he',true);
} }
if(!targets.contains(player)) event.finish(); if(!targets.includes(player)) event.finish();
} }
else event.finish(); else event.finish();
'step 2' 'step 2'
@ -1432,7 +1432,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.attitude(source,player)<=0) return -get.value(card); if(get.attitude(source,player)<=0) return -get.value(card);
var name=get.name(card),color=get.color(card); var name=get.name(card),color=get.color(card);
if(name=='sha'||player.getUseValue(card)<=0||player.hasCard(card2=>{ if(name=='sha'||player.getUseValue(card)<=0||player.hasCard(card2=>{
return card2!=card&&!ui.selected.cards.contains(card2)&&get.name(card2)==name; return card2!=card&&!ui.selected.cards.includes(card2)&&get.name(card2)==name;
})){ })){
if(!ui.selected.cards.length&&color=='black') return 1+Math.random(); if(!ui.selected.cards.length&&color=='black') return 1+Math.random();
return Math.random(); return Math.random();
@ -1501,7 +1501,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.attitude(source,player)<=0) return -get.value(card); if(get.attitude(source,player)<=0) return -get.value(card);
var name=get.name(card),color=get.color(card); var name=get.name(card),color=get.color(card);
if(name=='sha'||player.getUseValue(card)<=0||player.hasCard(card2=>{ if(name=='sha'||player.getUseValue(card)<=0||player.hasCard(card2=>{
return card2!=card&&!ui.selected.cards.contains(card2)&&get.name(card2)==name; return card2!=card&&!ui.selected.cards.includes(card2)&&get.name(card2)==name;
})){ })){
if(!ui.selected.cards.length&&color=='black') return 1+Math.random(); if(!ui.selected.cards.length&&color=='black') return 1+Math.random();
return Math.random(); return Math.random();
@ -1538,7 +1538,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
).set('colors',colors).set('ai',function(card){ ).set('colors',colors).set('ai',function(card){
var player=_status.event.player,target=_status.event.getParent().target; var player=_status.event.player,target=_status.event.getParent().target;
if(get.attitude(player,target)<0) return false; if(get.attitude(player,target)<0) return false;
if(!_status.event.colors.contains(get.color(card,player))) return 0; if(!_status.event.colors.includes(get.color(card,player))) return 0;
if(game.hasNature(card)) return 1.2; if(game.hasNature(card)) return 1.2;
return 1; return 1;
}) })
@ -1676,7 +1676,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.countCards('h')==target.countCards('h')&&player!=target; return player.countCards('h')==target.countCards('h')&&player!=target;
}).set('ai',target=>{ }).set('ai',target=>{
var player=get.player(); var player=get.player();
return Math.max(get.effect(target,{name:'wuzhong'},player,player),get.effect(target,{name:'guohe'},player,player)/2); return Math.max(get.effect(target,{name:'draw'},player,player),get.effect(target,{name:'guohe'},player,player)/2);
}); });
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
@ -1729,7 +1729,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})){ })){
player.chooseTarget('整军:是否令一名角色摸一张牌?').set('ai',function(target){ player.chooseTarget('整军:是否令一名角色摸一张牌?').set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
return get.effect(target,{name:'wuzhong'},player,player); return get.effect(target,{name:'draw'},player,player);
}); });
} }
else event.goto(2); else event.goto(2);
@ -1817,7 +1817,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(event.card.name!='sha'||!player.isPhaseUsing()) return false; if(event.card.name!='sha'||!player.isPhaseUsing()) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current);
}); });
}, },
content:function(){ content:function(){
@ -1827,7 +1827,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'为'+get.translation(trigger.card)+'增加任意个目标', '为'+get.translation(trigger.card)+'增加任意个目标',
function(card,player,target){ function(card,player,target){
var event=_status.event.getTrigger(); var event=_status.event.getTrigger();
return !event.targets.contains(target)&&lib.filter.targetEnabled2(event.card,player,target); return !event.targets.includes(target)&&lib.filter.targetEnabled2(event.card,player,target);
}, },
[1,Infinity] [1,Infinity]
).set('ai',function(target){ ).set('ai',function(target){
@ -1943,7 +1943,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
if(!event.cards) event.cards=[]; if(!event.cards) event.cards=[];
var cards=trigger.getd().filter(function(i){ var cards=trigger.getd().filter(function(i){
if(!event.cards.contains(i)&&get.position(i,true)=='d'&&get.color(i,false)=='black'&&get.type(i,null,true)=='basic'){ if(!event.cards.includes(i)&&get.position(i,true)=='d'&&get.color(i,false)=='black'&&get.type(i,null,true)=='basic'){
var card=get.autoViewAs({name:'bingliang'},[i]); var card=get.autoViewAs({name:'bingliang'},[i]);
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current.canAddJudge(card); return current.canAddJudge(card);
@ -2421,7 +2421,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
cards:links, cards:links,
selectCard:-1, selectCard:-1,
position:'x', position:'x',
filterCard:(card)=>lib.skill['dddzhijie_backup'].cards.contains(card), filterCard:(card)=>lib.skill['dddzhijie_backup'].cards.includes(card),
popname:true, popname:true,
precontent:function(){ precontent:function(){
player.addTempSkill('dddzhijie_draw'); player.addTempSkill('dddzhijie_draw');
@ -2527,7 +2527,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!source||source==player||!source.hasSkill('dddfusi')||source.countCards('h')==0||source.hasCard(function(card){ if(!source||source==player||!source.hasSkill('dddfusi')||source.countCards('h')==0||source.hasCard(function(card){
return !get.is.shownCard(card); return !get.is.shownCard(card);
},'h')) return; },'h')) return;
if(player.getCards('h').contains(card)) return false; if(player.getCards('h').includes(card)) return false;
}, },
}, },
enable:"chooseToUse", enable:"chooseToUse",
@ -2746,7 +2746,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var storage=player.getStorage('dddchashi'); var storage=player.getStorage('dddchashi');
if(!storage||!storage.length) return false; if(!storage||!storage.length) return false;
if(event.player!=storage[1]||!event.player.isIn()) return false; if(event.player!=storage[1]||!event.player.isIn()) return false;
// if(!player.getCards('he').contains(storage[0])||!storage[0].hasGaintag('dddchashi')) return false; // if(!player.getCards('he').includes(storage[0])||!storage[0].hasGaintag('dddchashi')) return false;
if(get.suit(event.card)!=get.suit(storage[0])&&get.type2(event.card)!=get.type2(storage[0])) return false; if(get.suit(event.card)!=get.suit(storage[0])&&get.type2(event.card)!=get.type2(storage[0])) return false;
// var evt=event.getParent('phaseUse'); // var evt=event.getParent('phaseUse');
// if(evt.player) // if(evt.player)
@ -2941,7 +2941,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else event.finish(); else event.finish();
'step 2' 'step 2'
if(event.choices.contains('第一组')){ if(event.choices.includes('第一组')){
var del=player.countCards('h')-player.getExpansions('dddmiaoxing_1').length; var del=player.countCards('h')-player.getExpansions('dddmiaoxing_1').length;
if(del>=0){ if(del>=0){
if(del!=0) player.addToExpansion(get.cards(del),player,'draw').gaintag.add('dddmiaoxing_1'); if(del!=0) player.addToExpansion(get.cards(del),player,'draw').gaintag.add('dddmiaoxing_1');
@ -2959,7 +2959,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
'step 4' 'step 4'
player.markSkill('dddmiaoxing'); player.markSkill('dddmiaoxing');
if(event.choices.contains('第二组')){ if(event.choices.includes('第二组')){
var del=player.countCards('h')-player.getExpansions('dddmiaoxing_2').length; var del=player.countCards('h')-player.getExpansions('dddmiaoxing_2').length;
if(del>=0){ if(del>=0){
if(del!=0) player.addToExpansion(get.cards(del),player,'draw').gaintag.add('dddmiaoxing_2'); if(del!=0) player.addToExpansion(get.cards(del),player,'draw').gaintag.add('dddmiaoxing_2');
@ -3073,7 +3073,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
var cards=lib.inpile.filter(i=>{ var cards=lib.inpile.filter(i=>{
return get.type(i)=='trick'&&!player.getStorage('dddfenji').contains(i); return get.type(i)=='trick'&&!player.getStorage('dddfenji').includes(i);
}).map(i=>['锦囊','',i]); }).map(i=>['锦囊','',i]);
player.chooseButton([get.prompt('dddfenji'),[cards,'vcard']]).set('ai',button=>{ player.chooseButton([get.prompt('dddfenji'),[cards,'vcard']]).set('ai',button=>{
var evt=_status.event.getTrigger(); var evt=_status.event.getTrigger();
@ -3146,8 +3146,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseTarget('侠横对一名角色造成1点伤害',true).set('ai',target=>{ player.chooseTarget('侠横对一名角色造成1点伤害',true).set('ai',target=>{
var player=_status.event.player,eff=get.damageEffect(target,player,player),targetx=_status.event.targetx; var player=_status.event.player,eff=get.damageEffect(target,player,player),targetx=_status.event.targetx;
if(player.storage['dddxiaheng_del']) return eff; if(player.storage['dddxiaheng_del']) return eff;
var fix=player.getStorage('dddxiaheng').contains(target)?0.75:1; var fix=player.getStorage('dddxiaheng').includes(target)?0.75:1;
if(target==player&&targetx!=player&&player.isHealthy()&&!player.getStorage('dddxiaheng').contains(player)&&player.hp>2) return 100; if(target==player&&targetx!=player&&player.isHealthy()&&!player.getStorage('dddxiaheng').includes(player)&&player.hp>2) return 100;
return eff*(player.hp==1||target==targetx?0.1:1)*fix; return eff*(player.hp==1||target==targetx?0.1:1)*fix;
}).set('targetx',targets[0]); }).set('targetx',targets[0]);
'step 3' 'step 3'
@ -3161,7 +3161,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 4' 'step 4'
if(player.storage['dddxiaheng_del']) event.finish(); if(player.storage['dddxiaheng_del']) event.finish();
else{ else{
if(!targets.contains(player)) player.loseMaxHp(); if(!targets.includes(player)) player.loseMaxHp();
if(targets.length==1){ if(targets.length==1){
player.removeSkill('dddxiaheng'); player.removeSkill('dddxiaheng');
game.log(player,'失去了技能','#g【侠横】'); game.log(player,'失去了技能','#g【侠横】');
@ -3491,7 +3491,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var current=event.players.shift(); var current=event.players.shift();
event.current=current; event.current=current;
current.chooseTarget('是否视为对一名没赢的角色使用一张【杀】?',(card,player,target)=>{ current.chooseTarget('是否视为对一名没赢的角色使用一张【杀】?',(card,player,target)=>{
return player.canUse('sha',target,false)&&_status.event.targets.contains(target); return player.canUse('sha',target,false)&&_status.event.targets.includes(target);
}).set('ai',target=>{ }).set('ai',target=>{
return get.effect(target,{name:'sha'},get.player(),get.player()); return get.effect(target,{name:'sha'},get.player(),get.player());
}).set('targets',event.targets); }).set('targets',event.targets);
@ -3559,7 +3559,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(event.ai_targets.length){ if(event.ai_targets.length){
for(var i=0;i<event.ai_targets.length;i++){ for(var i=0;i<event.ai_targets.length;i++){
if(targets.contains(event.ai_targets[i])){ if(targets.includes(event.ai_targets[i])){
var target=event.ai_targets[i]; var target=event.ai_targets[i];
var cards=target.getCards('h').sort((a,b)=>{ var cards=target.getCards('h').sort((a,b)=>{
return event.ai(b)-event.ai(a); return event.ai(b)-event.ai(a);
@ -3648,7 +3648,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.lose_list=lose_list; event.lose_list=lose_list;
event.getNum=function(card){ event.getNum=function(card){
for(var i of event.lose_list){ for(var i of event.lose_list){
if(i[1].contains&&i[1].contains(card)) return get.number(card,i[0]); if(i[1].includes&&i[1].includes(card)) return get.number(card,i[0]);
} }
return get.number(card,false); return get.number(card,false);
} }
@ -3677,7 +3677,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 7" "step 7"
if(event.iwhile<targets.length){ if(event.iwhile<targets.length){
event.target=targets[event.iwhile]; event.target=targets[event.iwhile];
event.target.animate('target'); event.target.addTempClass('target');
event.card2=event.cardlist[event.iwhile]; event.card2=event.cardlist[event.iwhile];
event.num2=event.getNum(event.card2); event.num2=event.getNum(event.card2);
game.log(event.target,'的拼点牌为',event.card2); game.log(event.target,'的拼点牌为',event.card2);
@ -3689,7 +3689,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.goto(9); event.goto(9);
} }
"step 8" "step 8"
var key=event.players.contains(target)?'num1':'num2'; var key=event.players.includes(target)?'num1':'num2';
event.result[key].push(event.num2); event.result[key].push(event.num2);
event.iwhile++; event.iwhile++;
event.goto(7); event.goto(7);
@ -3740,7 +3740,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.player=player; event.player=player;
event._global_waiting=true; event._global_waiting=true;
event.result=[]; event.result=[];
if(targets.contains(player)){ if(targets.includes(player)){
if(event.fixedResult&&event.fixedResult[player.playerid]){ if(event.fixedResult&&event.fixedResult[player.playerid]){
event.result[0]=player; event.result[0]=player;
event.result[1]=event.fixedResult[player.playerid]; event.result[1]=event.fixedResult[player.playerid];
@ -3752,7 +3752,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseCardTarget({ player.chooseCardTarget({
targets:targets, targets:targets,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return _status.event.targets.contains(target); return _status.event.targets.includes(target);
}, },
selectCard:1, selectCard:1,
prompt:'是否于此次拼点加入其中一方?', prompt:'是否于此次拼点加入其中一方?',
@ -3767,7 +3767,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
} }
'step 1' 'step 1'
if(targets.contains(player)){ if(targets.includes(player)){
event.result[0]=player; event.result[0]=player;
event.result[1]=result.cards[0]; event.result[1]=result.cards[0];
event.result[2]=result.skill; event.result[2]=result.skill;
@ -3909,7 +3909,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var N=player.countMark('dddshichao')+1; var N=player.countMark('dddshichao')+1;
player.chooseTarget('逝潮:选择一名手牌数第'+get.cnNumber(N)+'大的角色',true,(card,player,target)=>{ player.chooseTarget('逝潮:选择一名手牌数第'+get.cnNumber(N)+'大的角色',true,(card,player,target)=>{
return _status.event.targets.contains(target); return _status.event.targets.includes(target);
}).set('ai',target=>{ }).set('ai',target=>{
var zhu=get.zhu(player)||game.filterPlayer(i=>i.getSeatNum()==1)[0]; var zhu=get.zhu(player)||game.filterPlayer(i=>i.getSeatNum()==1)[0];
return Math.min(target.countCards('h')-player.countCards('h'),zhu.maxHp-player.countCards('h')); return Math.min(target.countCards('h')-player.countCards('h'),zhu.maxHp-player.countCards('h'));
@ -3947,7 +3947,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
up:{ up:{
trigger:{source:'damageBegin2'}, trigger:{source:'damageBegin2'},
filter:function(event,player){ filter:function(event,player){
return player.getStorage('dddshichao_up').contains(event.player); return player.getStorage('dddshichao_up').includes(event.player);
}, },
charlotte:true, charlotte:true,
check:function(event,player){ check:function(event,player){
@ -4138,7 +4138,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.hasSkill('dddyouxue_old_acted',null,false,false)) return false; if(player.hasSkill('dddyouxue_old_acted',null,false,false)) return false;
var seat=event.player.getSeatNum(); var seat=event.player.getSeatNum();
var next=event.player.next; var next=event.player.next;
if(!game.players.contains(next)) next=game.findNext(next); if(!game.players.includes(next)) next=game.findNext(next);
var seat2=next.getSeatNum(); var seat2=next.getSeatNum();
if(seat==seat2) return false; if(seat==seat2) return false;
if(seat<seat2) return vseat>seat&&vseat<=seat2; if(seat<seat2) return vseat>seat&&vseat<=seat2;
@ -4576,7 +4576,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(evt.name!='die'||evt.source!=event.player||event.player==player) return false; if(evt.name!='die'||evt.source!=event.player||event.player==player) return false;
if(!player.hasZhuSkill('dddfuyi',event.player)) return false; if(!player.hasZhuSkill('dddfuyi',event.player)) return false;
var skills=player.getSkills('dddxiaoxing',null,false,false); var skills=player.getSkills('dddxiaoxing',null,false,false);
return !skills.contains('dddxiaoxing')||!skills.contains('dddlangzhi'); return !skills.includes('dddxiaoxing')||!skills.includes('dddlangzhi');
}, },
direct:true, direct:true,
global:'dddfuyi_sha', global:'dddfuyi_sha',
@ -4613,7 +4613,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var str='取消此次奖惩,令其获得'; var str='取消此次奖惩,令其获得';
var skills=player.getSkills('dddxiaoxing',null,false,false); var skills=player.getSkills('dddxiaoxing',null,false,false);
var bool1=!skills.contains('dddxiaoxing'),bool2=!skills.contains('dddlangzhi'); var bool1=!skills.includes('dddxiaoxing'),bool2=!skills.includes('dddlangzhi');
var choices=[]; var choices=[];
if(bool1) { if(bool1) {
str+='〖枭行〗'; str+='〖枭行〗';
@ -4631,8 +4631,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
choices.push('cancel2'); choices.push('cancel2');
trigger.player.chooseControl(choices).set('prompt','是否对'+get.translation(player)+'发动【附义】?').set('prompt2',str).set('ai',()=>{ trigger.player.chooseControl(choices).set('prompt','是否对'+get.translation(player)+'发动【附义】?').set('prompt2',str).set('ai',()=>{
if(get.attitude(_status.event.player,_status.event.getParent().player)<=2) return 'cancel2'; if(get.attitude(_status.event.player,_status.event.getParent().player)<=2) return 'cancel2';
if(_status.event.choices.contains('dddfuyi_both')) return 'dddfuyi_both'; if(_status.event.choices.includes('dddfuyi_both')) return 'dddfuyi_both';
if(_status.event.choices.contains('dddlangzhi')) return 'dddlangzhi'; if(_status.event.choices.includes('dddlangzhi')) return 'dddlangzhi';
return Math.random()<0.5?'dddxiaoxing':'cancel2'; return Math.random()<0.5?'dddxiaoxing':'cancel2';
}); });
'step 1' 'step 1'
@ -4701,7 +4701,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:'dddzhuanshe', audio:'dddzhuanshe',
trigger:{global:'useCard2'}, trigger:{global:'useCard2'},
filter:function(event,player){ filter:function(event,player){
if(!player.getStorage('dddzhuanshe_effect').contains(event.card.name)) return false; if(!player.getStorage('dddzhuanshe_effect').includes(event.card.name)) return false;
if(event.player!=_status.currentPhase) return false; if(event.player!=_status.currentPhase) return false;
var type=get.type(event.card,null,false); var type=get.type(event.card,null,false);
if(type!='basic'&&type!='trick') return false; if(type!='basic'&&type!='trick') return false;
@ -4709,7 +4709,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(info.allowMultiple==false) return false; if(info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){ if(event.targets&&!info.multitarget){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,event.player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,event.player,current);
})){ })){
return true; return true;
} }
@ -4725,7 +4725,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var prompt2='为'+get.translation(trigger.card)+'增加一个目标' var prompt2='为'+get.translation(trigger.card)+'增加一个目标'
player.chooseTarget(get.prompt('dddzhuanshe_effect'),function(card,player,target){ player.chooseTarget(get.prompt('dddzhuanshe_effect'),function(card,player,target){
var player=_status.event.source; var player=_status.event.source;
return !_status.event.targets.contains(target)&&lib.filter.targetEnabled2(_status.event.card,player,target); return !_status.event.targets.includes(target)&&lib.filter.targetEnabled2(_status.event.card,player,target);
}).set('prompt2',prompt2).set('ai',function(target){ }).set('prompt2',prompt2).set('ai',function(target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
var player=_status.event.source; var player=_status.event.source;
@ -5024,7 +5024,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=[],cards=player.getCards('h'); var list=[],cards=player.getCards('h');
for(var i of cards){ for(var i of cards){
var suit=get.suit(i,player); var suit=get.suit(i,player);
if(!lib.suit.contains(suit)) continue; if(!lib.suit.includes(suit)) continue;
list.add(suit); list.add(suit);
} }
if(player.storage['dddlanghuai']){ if(player.storage['dddlanghuai']){
@ -5043,7 +5043,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=[],cards=player.getCards('h'); var list=[],cards=player.getCards('h');
for(var i of cards){ for(var i of cards){
var suit=get.suit(i,player); var suit=get.suit(i,player);
if(!lib.suit.contains(suit)) continue; if(!lib.suit.includes(suit)) continue;
list.add(suit); list.add(suit);
} }
if(player.storage['dddlanghuai']){ if(player.storage['dddlanghuai']){
@ -5078,12 +5078,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
var num=1; var num=1;
if(get.attitude(player,target)>0){ if(get.attitude(player,target)>0){
if(player.needsToDiscard()){ if(player.needsToDiscard()) num=0.7;
num=0.7; else num=0.5;
}
else{
num=0.5;
}
} }
if(target.hp>=4) return [1,num*2.5]; if(target.hp>=4) return [1,num*2.5];
if(target.hp==3) return [1,num*1.5]; if(target.hp==3) return [1,num*1.5];
@ -5112,8 +5108,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else choiceList[1]='<span style="opacity:0.5; text-decoration:line-through; ">'+choiceList[1]+'</span>'; else choiceList[1]='<span style="opacity:0.5; text-decoration:line-through; ">'+choiceList[1]+'</span>';
if(choices.length==1&&choices[0]=='选项一') event._result={control:'选项一'}; if(choices.length==1&&choices[0]=='选项一') event._result={control:'选项一'};
else player.chooseControl(choices).set('choiceList',choiceList).set('ai',()=>{ else player.chooseControl(choices).set('choiceList',choiceList).set('ai',()=>{
if(!_status.event.controls.contains('选项一')) return 1; if(!_status.event.controls.includes('选项一')) return 1;
if(!_status.event.controls.contains('选项二')) return 0; if(!_status.event.controls.includes('选项二')) return 0;
var player=_status.event.player; var player=_status.event.player;
var num=0; var num=0;
for(var card of player.getCards('he')){ for(var card of player.getCards('he')){
@ -5185,7 +5181,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var cards=top.addArray(bottom); var cards=top.addArray(bottom);
player.$throw(cards.length,1000); player.$throw(cards.length,1000);
player.lose(cards,ui.cardPile).set('top',top).insert_index=function(event,card){ player.lose(cards,ui.cardPile).set('top',top).insert_index=function(event,card){
if(event.top.contains(card)) return ui.cardPile.firstChild; if(event.top.includes(card)) return ui.cardPile.firstChild;
return null; return null;
}; };
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -282,7 +282,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCard'}, trigger:{player:'useCard'},
silent:true, silent:true,
filter:function(event,player){ filter:function(event,player){
return get.type(event.card)=='land'&&!player.storage.qingshu_all.contains(event.card.name); return get.type(event.card)=='land'&&!player.storage.qingshu_all.includes(event.card.name);
}, },
content:function(){ content:function(){
player.storage.qingshu.push(trigger.card.name); player.storage.qingshu.push(trigger.card.name);
@ -642,7 +642,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
nums.add(player.storage.lingyan[i].number); nums.add(player.storage.lingyan[i].number);
} }
return player.hasCard(function(card){ return player.hasCard(function(card){
return !nums.contains(card.number); return !nums.includes(card.number);
},'h'); },'h');
}, },
init:function(player){ init:function(player){
@ -671,7 +671,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<player.storage.lingyan.length;i++){ for(var i=0;i<player.storage.lingyan.length;i++){
nums.add(player.storage.lingyan[i].number); nums.add(player.storage.lingyan[i].number);
} }
return !nums.contains(card); return !nums.includes(card);
}, },
check:function(card){ check:function(card){
return 8-get.value(card); return 8-get.value(card);
@ -879,7 +879,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.list.sortBySeat(); event.list.sortBySeat();
delete player.storage.lianjing_targets; delete player.storage.lianjing_targets;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(!event.list.contains(game.players[i])){ if(!event.list.includes(game.players[i])){
game.players[i].out('lianjing'); game.players[i].out('lianjing');
event.exlist.push(game.players[i]); event.exlist.push(game.players[i]);
} }
@ -987,7 +987,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!event.card.isCard) return false; if(!event.card.isCard) return false;
if(event.cards[0]&&event.cards[0].zhenying_link) return false; if(event.cards[0]&&event.cards[0].zhenying_link) return false;
if(get.color(event.card)!='black') return false; if(get.color(event.card)!='black') return false;
if(['delay','equip'].contains(get.type(event.card))) return false; if(['delay','equip'].includes(get.type(event.card))) return false;
return true; return true;
}, },
content:function(){ content:function(){
@ -1270,7 +1270,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.storage.yunyin) return true; if(!player.storage.yunyin) return true;
var hs=player.getCards('h'); var hs=player.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(!player.storage.yunyin.contains(get.suit(hs[i]))) return true; if(!player.storage.yunyin.includes(get.suit(hs[i]))) return true;
} }
return false; return false;
}, },
@ -1279,7 +1279,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.chooseToDiscard(get.prompt('yunyin'),function(card){ player.chooseToDiscard(get.prompt('yunyin'),function(card){
if(!player.storage.yunyin) return true; if(!player.storage.yunyin) return true;
return !player.storage.yunyin.contains(get.suit(card)); return !player.storage.yunyin.includes(get.suit(card));
}).set('logSkill','yunyin').ai=function(card){ }).set('logSkill','yunyin').ai=function(card){
return 9-get.value(card); return 9-get.value(card);
} }
@ -1444,14 +1444,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(!player.storage.liuying) player.storage.liuying=[]; if(!player.storage.liuying) player.storage.liuying=[];
return event.card&&event.card.name=='sha'&&game.hasPlayer(function(current){ return event.card&&event.card.name=='sha'&&game.hasPlayer(function(current){
return !player.storage.liuying.contains(current)&&player.canUse('sha',current,false); return !player.storage.liuying.includes(current)&&player.canUse('sha',current,false);
}); });
}, },
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('liuying'),function(card,player,target){ player.chooseTarget(get.prompt('liuying'),function(card,player,target){
return !player.storage.liuying.contains(target)&&player.canUse('sha',target,false); return !player.storage.liuying.includes(target)&&player.canUse('sha',target,false);
}).ai=function(target){ }).ai=function(target){
return get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
}; };
@ -1497,7 +1497,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=0; var num=0;
for(var i=0;i<he.length;i++){ for(var i=0;i<he.length;i++){
var info=lib.card[he[i].name]; var info=lib.card[he[i].name];
if(info.type=='equip'&&!info.nomod&&!info.unique&&lib.inpile.contains(he[i].name)){ if(info.type=='equip'&&!info.nomod&&!info.unique&&lib.inpile.includes(he[i].name)){
num++; num++;
if(num>=2) return true; if(num>=2) return true;
} }
@ -1506,7 +1506,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:function(card){ filterCard:function(card){
if(ui.selected.cards.length&&card.name==ui.selected.cards[0].name) return false; if(ui.selected.cards.length&&card.name==ui.selected.cards[0].name) return false;
var info=get.info(card); var info=get.info(card);
return info.type=='equip'&&!info.nomod&&!info.unique&&lib.inpile.contains(card.name); return info.type=='equip'&&!info.nomod&&!info.unique&&lib.inpile.includes(card.name);
}, },
selectCard:2, selectCard:2,
position:'he', position:'he',
@ -1638,11 +1638,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
meiying:{ meiying:{
global:'meiying2',
globalSilent:true, globalSilent:true,
trigger:{global:'phaseEnd'}, trigger:{global:'phaseEnd'},
filter:function(event,player){ filter:function(event,player){
return event.player!=player&&!event.player.tempSkills.meiying3&&event.player.isAlive()&&player.countCards('he',{color:'red'})>0; return event.player!=player&&event.player.isAlive()&&player.countCards('he',{color:'red'})&&event.player.getHistory('useCard',evt=>{
return evt.targets&&evt.targets.some(i=>i!==event.player);
}).length===0;
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -1665,18 +1666,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
expose:0.1 expose:0.1
} }
}, },
meiying2:{
trigger:{player:'useCard'},
filter:function(event,player){
return _status.currentPhase==player&&event.targets&&(event.targets.length>1||event.targets[0]!=player);
},
forced:true,
popup:false,
content:function(){
player.addTempSkill('meiying3');
}
},
meiying3:{},
jianwu:{ jianwu:{
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
forced:true, forced:true,
@ -1693,13 +1682,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return (event.targets.contains(current)==false&&current!=player&& return (event.targets.includes(current)==false&&current!=player&&
lib.filter.targetEnabled(event.card,player,current)) lib.filter.targetEnabled(event.card,player,current))
}); });
}, },
content:function(){ content:function(){
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return (trigger.targets.contains(current)==false&&current!=player&& return (trigger.targets.includes(current)==false&&current!=player&&
lib.filter.targetEnabled(trigger.card,player,current)) lib.filter.targetEnabled(trigger.card,player,current))
}); });
if(list.length){ if(list.length){

View File

@ -329,10 +329,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.canUse('gw_aozuzhilei',current)&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; return player.canUse('gw_aozuzhilei',current)&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0;
}); });
var baoxue=game.hasPlayer(function(current){ var baoxue=game.hasPlayer(function(current){
return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2,3].contains(current.countCards('h'))&&!current.hasSkillTag('noh'); return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2,3].includes(current.countCards('h'))&&!current.hasSkillTag('noh');
}); });
var baoxue2=game.hasPlayer(function(current){ var baoxue2=game.hasPlayer(function(current){
return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2].contains(current.countCards('h'))&&!current.hasSkillTag('noh'); return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2].includes(current.countCards('h'))&&!current.hasSkillTag('noh');
}); });
var baoxue3=game.hasPlayer(function(current){ var baoxue3=game.hasPlayer(function(current){
return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&current.countCards('h')>=2&&!current.hasSkillTag('noh'); return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&current.countCards('h')>=2&&!current.hasSkillTag('noh');
@ -648,7 +648,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
var skip=['shunshou','huogong','shandianjian','jiu']; var skip=['shunshou','huogong','shandianjian','jiu'];
player.chooseCardButton(get.prompt('gwminxiang'),list).set('ai',function(button){ player.chooseCardButton(get.prompt('gwminxiang'),list).set('ai',function(button){
if(skip.contains(button.link.name)) return 0; if(skip.includes(button.link.name)) return 0;
var val=get.value(button.link); var val=get.value(button.link);
if(get.tag(button.link,'damage')){ if(get.tag(button.link,'damage')){
val+=3; val+=3;
@ -701,7 +701,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var hs=player.getCards('h'); var hs=player.getCards('h');
var names=[]; var names=[];
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(['basic','trick'].contains(get.type(hs[i]))&&!get.info(hs[i]).multitarget){ if(['basic','trick'].includes(get.type(hs[i]))&&!get.info(hs[i]).multitarget){
names.add(hs[i].name); names.add(hs[i].name);
} }
} }
@ -715,14 +715,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return false; return false;
}, },
check:function(card){ check:function(card){
if(['shunshou','huogong','shandianjian','jiu','tianxianjiu'].contains(card.name)) return 0; if(['shunshou','huogong','shandianjian','jiu','tianxianjiu'].includes(card.name)) return 0;
if(get.tag(card,'damage')){ if(get.tag(card,'damage')){
return get.value(card)+2; return get.value(card)+2;
} }
return get.value(card); return get.value(card);
}, },
filterCard:function(card,player){ filterCard:function(card,player){
if(!['basic','trick'].contains(get.type(card))) return false; if(!['basic','trick'].includes(get.type(card))) return false;
return game.countPlayer(function(current){ return game.countPlayer(function(current){
return current!=player&&lib.filter.targetEnabled3({name:card.name},player,current); return current!=player&&lib.filter.targetEnabled3({name:card.name},player,current);
})>1; })>1;
@ -936,7 +936,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}); });
'step 1' 'step 1'
if(event.targets.contains(result.targets[0])){ if(event.targets.includes(result.targets[0])){
player.popup('成功'); player.popup('成功');
game.log(player,'发动','【血契】','成功'); game.log(player,'发动','【血契】','成功');
var dialog=ui.create.dialog('hidden'); var dialog=ui.create.dialog('hidden');
@ -1265,7 +1265,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
event.repeat=false; event.repeat=false;
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return event.targets.contains(current)&&current.countCards('he'); return event.targets.includes(current)&&current.countCards('he');
}); });
if(list.length){ if(list.length){
var target=list.randomGet(); var target=list.randomGet();
@ -1606,7 +1606,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(target.hasSkill('gwqinwu')){ if(target.hasSkill('gwqinwu')){
att/=1.5; att/=1.5;
} }
if(target.hasJudge('lebu')||target.skipList.contains('phaseUse')){ if(target.hasJudge('lebu')||target.skipList.includes('phaseUse')){
att/=2; att/=2;
} }
return att; return att;
@ -1676,7 +1676,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'useCard'}, trigger:{global:'useCard'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.getEnemies().contains(event.player)&& return player.getEnemies().includes(event.player)&&
get.type(event.card,'trick')=='trick'&&get.color(event.card)==get.color(player.storage.huanshu2); get.type(event.card,'trick')=='trick'&&get.color(event.card)==get.color(player.storage.huanshu2);
}, },
mark:true, mark:true,
@ -1717,7 +1717,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return ui.create.dialog('结印',[[['','','gw_wenyi'],['','','gw_yanziyaoshui'],['','','gw_kunenfayin']],'vcard'],'hidden'); return ui.create.dialog('结印',[[['','','gw_wenyi'],['','','gw_yanziyaoshui'],['','','gw_kunenfayin']],'vcard'],'hidden');
}, },
filter:function(button,player){ filter:function(button,player){
if(player.storage.gwjieyin.contains(button.link[2])){ if(player.storage.gwjieyin.includes(button.link[2])){
return false; return false;
} }
return true; return true;
@ -1822,8 +1822,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:['useCard','respondAfter']}, trigger:{player:['useCard','respondAfter']},
silent:true, silent:true,
content:function(){ content:function(){
if(player.storage.zhengjun_one.contains(trigger.card.name)){ if(player.storage.zhengjun_one.includes(trigger.card.name)){
if(!player.storage.zhengjun.contains(trigger.card.name)){ if(!player.storage.zhengjun.includes(trigger.card.name)){
player.storage.zhengjun.add(trigger.card.name); player.storage.zhengjun.add(trigger.card.name);
event.trigger('zhengjun'); event.trigger('zhengjun');
} }
@ -1926,7 +1926,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(result.bool){ if(result.bool){
for(var i=0;i<player.storage.bolang.length;i++){ for(var i=0;i<player.storage.bolang.length;i++){
if(!player.storage.bolang[i].vanishtag.contains('bolang')){ if(!player.storage.bolang[i].vanishtag.includes('bolang')){
player.storage.bolang.splice(i--,1); player.storage.bolang.splice(i--,1);
} }
} }
@ -1945,7 +1945,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<player.storage.bolang.length;i++){ for(var i=0;i<player.storage.bolang.length;i++){
if(player.storage.bolang[i].vanishtag.contains('bolang')){ if(player.storage.bolang[i].vanishtag.includes('bolang')){
return true; return true;
} }
} }
@ -1954,7 +1954,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var list=[]; var list=[];
for(var i=0;i<player.storage.bolang.length;i++){ for(var i=0;i<player.storage.bolang.length;i++){
if(player.storage.bolang[i].vanishtag.contains('bolang')){ if(player.storage.bolang[i].vanishtag.includes('bolang')){
list.push(player.storage.bolang[i]); list.push(player.storage.bolang[i]);
} }
} }
@ -2038,7 +2038,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var list=get.gainableSkills(function(info){ var list=get.gainableSkills(function(info){
if(typeof info.enable=='string') return info.enable=='phaseUse'; if(typeof info.enable=='string') return info.enable=='phaseUse';
if(Array.isArray(info.enable)) return info.enable.contains('phaseUse'); if(Array.isArray(info.enable)) return info.enable.includes('phaseUse');
},player); },player);
list.remove(player.getSkills()); list.remove(player.getSkills());
list=list.randomGets(3); list=list.randomGets(3);
@ -2189,7 +2189,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
for(var i=0;i<ui.discardPile.childElementCount;i++){ for(var i=0;i<ui.discardPile.childElementCount;i++){
var card=ui.discardPile.childNodes[i]; var card=ui.discardPile.childNodes[i];
if(card.vanishtag.contains('_gwshenyu')) continue; if(card.vanishtag.includes('_gwshenyu')) continue;
if(get.type(card)=='spell'&&get.subtype(card)!='spell_gold'){ if(get.type(card)=='spell'&&get.subtype(card)!='spell_gold'){
return true; return true;
} }
@ -2201,7 +2201,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=[]; var list=[];
for(var i=0;i<ui.discardPile.childElementCount;i++){ for(var i=0;i<ui.discardPile.childElementCount;i++){
var card=ui.discardPile.childNodes[i]; var card=ui.discardPile.childNodes[i];
if(card.vanishtag.contains('_gwshenyu')) continue; if(card.vanishtag.includes('_gwshenyu')) continue;
if(get.type(card)=='spell'&&get.subtype(card)!='spell_gold'){ if(get.type(card)=='spell'&&get.subtype(card)!='spell_gold'){
list.push(card); list.push(card);
} }
@ -2682,7 +2682,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('gwtianbian'); player.logSkill('gwtianbian');
var list=[]; var list=[];
for(var i in lib.card){ for(var i in lib.card){
if(lib.inpile.contains(i)&& if(lib.inpile.includes(i)&&
lib.card[i].selectTarget==-1&& lib.card[i].selectTarget==-1&&
lib.card[i].type!='equip'&& lib.card[i].type!='equip'&&
lib.card[i].ai&&lib.card[i].ai.tag&& lib.card[i].ai&&lib.card[i].ai.tag&&
@ -3008,7 +3008,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.card=get.cards()[0]; event.card=get.cards()[0];
player.showCards(event.card,get.translation(player)+'对'+get.translation(trigger.player)+'发动了【穿心】'); player.showCards(event.card,get.translation(player)+'对'+get.translation(trigger.player)+'发动了【穿心】');
'step 1' 'step 1'
if(player.storage.gwchuanxin&&!player.storage.gwchuanxin.contains(get.suit(event.card))){ if(player.storage.gwchuanxin&&!player.storage.gwchuanxin.includes(get.suit(event.card))){
player.useCard({name:'sha'},[event.card],trigger.target,false); player.useCard({name:'sha'},[event.card],trigger.target,false);
} }
}, },
@ -3070,13 +3070,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
var type=get.type(event.card,'trick'); var type=get.type(event.card,'trick');
return type=='trick'&&game.hasPlayer(function(current){ return type=='trick'&&game.hasPlayer(function(current){
return player.canUse('sha',current,false)&&!event.targets.contains(current); return player.canUse('sha',current,false)&&!event.targets.includes(current);
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('fengjian'),function(card,player,target){ player.chooseTarget(get.prompt('fengjian'),function(card,player,target){
return player.canUse('sha',target,false)&&!trigger.targets.contains(target); return player.canUse('sha',target,false)&&!trigger.targets.includes(target);
}).ai=function(target){ }).ai=function(target){
return get.effect(target,{name:'sha',nature:'thunder'},player,player); return get.effect(target,{name:'sha',nature:'thunder'},player,player);
} }
@ -3295,7 +3295,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
player.chooseCard(hs.length,true,'选择还给'+get.translation(target)+'的牌').ai=function(card){ player.chooseCard(hs.length,true,'选择还给'+get.translation(target)+'的牌').ai=function(card){
if(damage){ if(damage){
return hs.contains(card)?1:0; return hs.includes(card)?1:0;
} }
else{ else{
return -get.value(card,player,'raw'); return -get.value(card,player,'raw');
@ -3311,7 +3311,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
'step 3' 'step 3'
for(var i=0;i<event.hs2.length;i++){ for(var i=0;i<event.hs2.length;i++){
if(!event.hs.contains(event.hs2[i])) return; if(!event.hs.includes(event.hs2[i])) return;
} }
player.line(target); player.line(target);
target.damage(); target.damage();
@ -4363,7 +4363,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
event.list=result.links.slice(0); event.list=result.links.slice(0);
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(!event.list.contains(event.cards[i])){ if(!event.list.includes(event.cards[i])){
event.cards[i].discard(); event.cards[i].discard();
} }
} }

View File

@ -121,7 +121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
// hs_baiguyoulong:['male','qun',4,['hstianqi']], // hs_baiguyoulong:['male','qun',4,['hstianqi']],
hs_yangyanwageli:['female','qun',3,['hspuzhao','hsyanxin']], hs_yangyanwageli:['female','qun',3,['hspuzhao','hsyanxin']],
hs_aiqinvyao:['famale','qun',4,['nsaiqi','nsbeiming']], hs_aiqinvyao:['female','qun',4,['nsaiqi','nsbeiming']],
hs_yelinlonghou:['female','qun',4,['ylyuchu']], hs_yelinlonghou:['female','qun',4,['ylyuchu']],
hs_yelinchulong:["male","qun",1,[],['unseen']], hs_yelinchulong:["male","qun",1,[],['unseen']],
@ -313,7 +313,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
priority:-1, priority:-1,
filter:function(event,player){ filter:function(event,player){
return event.cards.contains(player.storage.wxuying); return event.cards.includes(player.storage.wxuying);
}, },
content:function(){ content:function(){
if(_status.currentPhase==player){ if(_status.currentPhase==player){
@ -668,7 +668,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(lib.filter.skillDisabled(event.skill)) return false; if(lib.filter.skillDisabled(event.skill)) return false;
if(!game.expandSkills(event.player.getStockSkills()).contains(event.skill)) return false; if(!game.expandSkills(event.player.getStockSkills()).includes(event.skill)) return false;
return _status.currentPhase==event.player&&event.player.isEnemiesOf(player); return _status.currentPhase==event.player&&event.player.isEnemiesOf(player);
}, },
content:function(){ content:function(){
@ -707,13 +707,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
// if(get.is.converted(event)) return false; // if(get.is.converted(event)) return false;
if(!player.countCards('he')) return false; if(!player.countCards('he')) return false;
// if(!event.targets||!event.targets.contains(player)) return false; // if(!event.targets||!event.targets.includes(player)) return false;
var info=get.info(event.card); var info=get.info(event.card);
if(info.type!='trick'&&info.type!='basic') return false; if(info.type!='trick'&&info.type!='basic') return false;
if(info.multitarget) return false; if(info.multitarget) return false;
if(event.targets.length>1) return true; if(event.targets.length>1) return true;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,event.player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,event.player,current);
}); });
}, },
direct:true, direct:true,
@ -721,7 +721,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var bool1=(trigger.targets.length>1); var bool1=(trigger.targets.length>1);
var bool2=game.hasPlayer(function(current){ var bool2=game.hasPlayer(function(current){
return !trigger.targets.contains(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current); return !trigger.targets.includes(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current);
}); });
if(bool1&&bool2){ if(bool1&&bool2){
player.chooseControlList(true,get.prompt('hshuanling'),[ player.chooseControlList(true,get.prompt('hshuanling'),[
@ -754,10 +754,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
if(event.type=='add'){ if(event.type=='add'){
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
return !trigger.targets.contains(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current); return !trigger.targets.includes(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current);
}); });
var num2=game.countPlayer(function(current){ var num2=game.countPlayer(function(current){
if(!trigger.targets.contains(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current)){ if(!trigger.targets.includes(current)&&lib.filter.targetEnabled2(trigger.card,trigger.player,current)){
return get.effect(current,trigger.card,player,player)>0; return get.effect(current,trigger.card,player,player)>0;
} }
return false; return false;
@ -772,7 +772,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
prompt:event.unchosen?get.prompt('hshuanling'):null, prompt:event.unchosen?get.prompt('hshuanling'):null,
prompt2:'弃置任意张牌,并为'+get.translation(trigger.card)+'增加等量的目标', prompt2:'弃置任意张牌,并为'+get.translation(trigger.card)+'增加等量的目标',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !trigger.targets.contains(target)&&lib.filter.targetEnabled2(trigger.card,trigger.player,target); return !trigger.targets.includes(target)&&lib.filter.targetEnabled2(trigger.card,trigger.player,target);
}, },
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>=num2) return 0; if(ui.selected.cards.length>=num2) return 0;
@ -787,7 +787,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{ else{
var num=trigger.targets.length-1; var num=trigger.targets.length-1;
var num2=game.countPlayer(function(current){ var num2=game.countPlayer(function(current){
if(trigger.targets.contains(current)){ if(trigger.targets.includes(current)){
return get.effect(current,trigger.card,player,player)<0; return get.effect(current,trigger.card,player,player)<0;
} }
return false; return false;
@ -801,10 +801,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
prompt:event.unchosen?get.prompt('hshuanling'):null, prompt:event.unchosen?get.prompt('hshuanling'):null,
prompt2:'弃置任意张牌,并为'+get.translation(trigger.card)+'减少等量的目标', prompt2:'弃置任意张牌,并为'+get.translation(trigger.card)+'减少等量的目标',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return trigger.targets.contains(target); return trigger.targets.includes(target);
}, },
ai1:function(card){ ai1:function(card){
if(!player.needsToDiscard(ui.selected.cards.length)) return 0; if(!player.needsToDiscard(0,(i,player)=>{
return !ui.selected.cards.includes(i)&&!player.canIgnoreHandcard(i);
})) return 0;
if(ui.selected.cards.length>=num2) return 0; if(ui.selected.cards.length>=num2) return 0;
return Math.max(5,get.value(trigger.card))-get.value(card)-1; return Math.max(5,get.value(trigger.card))-get.value(card)-1;
}, },
@ -959,7 +961,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.ylyuchu2&&player.storage.ylyuchu3){ if(player.storage.ylyuchu2&&player.storage.ylyuchu3){
var idx=player.storage.ylyuchu2.indexOf(event.player); var idx=player.storage.ylyuchu2.indexOf(event.player);
var target=player.storage.ylyuchu3[idx]; var target=player.storage.ylyuchu3[idx];
if(target&&player.storage.ylyuchu.contains(target)){ if(target&&player.storage.ylyuchu.includes(target)){
return true; return true;
} }
} }
@ -969,7 +971,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.ylyuchu2&&player.storage.ylyuchu3){ if(player.storage.ylyuchu2&&player.storage.ylyuchu3){
var idx=player.storage.ylyuchu2.indexOf(trigger.player); var idx=player.storage.ylyuchu2.indexOf(trigger.player);
var target=player.storage.ylyuchu3[idx]; var target=player.storage.ylyuchu3[idx];
if(target&&player.storage.ylyuchu.contains(target)){ if(target&&player.storage.ylyuchu.includes(target)){
player.callSubPlayer(target); player.callSubPlayer(target);
player.storage.ylyuchu2[idx]=null; player.storage.ylyuchu2[idx]=null;
} }
@ -1043,7 +1045,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:'cards' content:'cards'
}, },
filter:function(event,player){ filter:function(event,player){
if(ui.cardPile.firstChild&&ui.cardPile.firstChild.vanishtag.contains('nsaiqi')){ if(ui.cardPile.firstChild&&ui.cardPile.firstChild.vanishtag.includes('nsaiqi')){
return false; return false;
} }
return true; return true;
@ -1205,7 +1207,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
var current=game.expandSkills(player.getSkills()); var current=game.expandSkills(player.getSkills());
var list=get.gainableSkills(function(info,skill,name){ var list=get.gainableSkills(function(info,skill,name){
if(current.contains(skill)) return false; if(current.includes(skill)) return false;
return lib.characterPack.hearth&&lib.characterPack.hearth[name]; return lib.characterPack.hearth&&lib.characterPack.hearth[name];
}); });
if(!list.length){ if(!list.length){
@ -1214,7 +1216,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var skill=list.randomGet(); var skill=list.randomGet();
var source=[]; var source=[];
for(var i in lib.characterPack.hearth){ for(var i in lib.characterPack.hearth){
if(lib.characterPack.hearth[i][3].contains(skill)){ if(lib.characterPack.hearth[i][3].includes(skill)){
source.push(i); source.push(i);
} }
} }
@ -1225,7 +1227,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var skills=[skill]; var skills=[skill];
var nameskills=lib.characterPack.hearth[name][3] var nameskills=lib.characterPack.hearth[name][3]
for(var i=0;i<nameskills.length;i++){ for(var i=0;i<nameskills.length;i++){
if(list.contains(nameskills[i])){ if(list.includes(nameskills[i])){
skills.add(nameskills[i]); skills.add(nameskills[i]);
} }
} }
@ -1310,7 +1312,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
popup:false, popup:false,
content:function(){ content:function(){
var card=ui.cardPile.firstChild; var card=ui.cardPile.firstChild;
if(lib.inpile.contains(card.name)){ if(lib.inpile.includes(card.name)){
for(var i=1;i<ui.cardPile.childElementCount;i++){ for(var i=1;i<ui.cardPile.childElementCount;i++){
var card2=ui.cardPile.childNodes[i]; var card2=ui.cardPile.childNodes[i];
if(get.color(card2)=='red'){ if(get.color(card2)=='red'){
@ -1434,7 +1436,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(game.showIdentity){ if(game.showIdentity){
game.showIdentity(); game.showIdentity();
} }
if(player.isUnderControl(true)||player.getFriends().contains(game.me)){ if(player.isUnderControl(true)||player.getFriends().includes(game.me)){
game.over(true); game.over(true);
} }
else{ else{
@ -1479,7 +1481,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd',player:'damageEnd'}, trigger:{source:'damageEnd',player:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return (event.source!=player&&event.source.isIn())||(event.player!=player&&event.player.isIn()); return (event.source!=player&&event.source.isIn())||(event.player!=player&&event.player.isIn());
}, },
content:function(){ content:function(){
@ -1554,7 +1556,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(event.name=='damage') return event.notLink()&&(event.card?true:false); if(event.name=='damage') return event.notLink()&&(event.card?true:false);
var info=get.info(event.card); var info=get.info(event.card);
if(info.multitarget&&event.targets&&event.targets.contains(player)) return false; if(info.multitarget&&event.targets&&event.targets.includes(player)) return false;
return event.getRand()<0.65; return event.getRand()<0.65;
}, },
content:function(){ content:function(){
@ -1573,7 +1575,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
targetEnabled:function(card,player,target){ targetEnabled:function(card,player,target){
if(!player.getEnemies().contains(target)) return false; if(!player.getEnemies().includes(target)) return false;
} }
} }
}, },
@ -1597,7 +1599,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'recoverAfter'}, trigger:{global:'recoverAfter'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return player.getEnemies().contains(event.player); return player.getEnemies().includes(event.player);
}, },
content:function(){ content:function(){
player.loseHp(); player.loseHp();
@ -1780,7 +1782,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
content:function(){ content:function(){
player.draw(); player.draw();
if(trigger.player&&trigger.player.isIn()&&!trigger._notrigger.contains(trigger.player)){ if(trigger.player&&trigger.player.isIn()&&!trigger._notrigger.includes(trigger.player)){
trigger.player.randomDiscard(); trigger.player.randomDiscard();
} }
}, },
@ -1866,7 +1868,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(hs.length){ if(hs.length){
var list2=[]; var list2=[];
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
if(list2.contains(hs[i].name)){ if(list2.includes(hs[i].name)){
hs.splice(i--,1); hs.splice(i--,1);
} }
else{ else{
@ -1876,7 +1878,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var card=hs.randomGet(); var card=hs.randomGet();
var list=[]; var list=[];
for(var i=0;i<lib.inpile.length;i++){ for(var i=0;i<lib.inpile.length;i++){
if(!list2.contains(lib.inpile[i])&& if(!list2.includes(lib.inpile[i])&&
(get.type(lib.inpile[i])!='equip'||Math.random()<0.5)){ (get.type(lib.inpile[i])!='equip'||Math.random()<0.5)){
list.push(lib.inpile[i]); list.push(lib.inpile[i]);
} }
@ -2255,7 +2257,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
var list=[]; var list=[];
for(var i in lib.card){ for(var i in lib.card){
if(game.bannedcards&&game.bannedcards.contains(i)) continue; if(game.bannedcards&&game.bannedcards.includes(i)) continue;
if(lib.card[i].type=='delay'){ if(lib.card[i].type=='delay'){
list.push(['锦囊','',i]); list.push(['锦囊','',i]);
} }
@ -3196,7 +3198,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=['yushou_misha','yushou_huofu','yushou_leiouke']; var list=['yushou_misha','yushou_huofu','yushou_leiouke'];
var skills=player.getSkills(); var skills=player.getSkills();
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(!skills.contains(list[i])) list.splice(i--,1); if(!skills.includes(list[i])) list.splice(i--,1);
} }
if(list.length){ if(list.length){
player.removeSkill(list.randomGet()); player.removeSkill(list.randomGet());
@ -3539,7 +3541,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!info) return 0; if(!info) return 0;
if(!Array.isArray(info.names)) return 0; if(!Array.isArray(info.names)) return 0;
var names=info.names; var names=info.names;
if(names.contains('xingjiegoutong')&&target.countCards('h')>=3) return -1; if(names.includes('xingjiegoutong')&&target.countCards('h')>=3) return -1;
var num=0; var num=0;
for(var i=0;i<names.length;i++){ for(var i=0;i<names.length;i++){
var info2=lib.card[names[i]]; var info2=lib.card[names[i]];
@ -3746,7 +3748,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'tuteng5','tuteng6','tuteng7','tuteng8']; 'tuteng5','tuteng6','tuteng7','tuteng8'];
var rand2=[]; var rand2=[];
for(var i=0;i<target.skills.length;i++){ for(var i=0;i<target.skills.length;i++){
if(rand.contains(target.skills[i])){ if(rand.includes(target.skills[i])){
rand.remove(target.skills[i]); rand.remove(target.skills[i]);
rand2.push(target.skills[i]); rand2.push(target.skills[i]);
} }
@ -3781,11 +3783,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.chooseButton(dialog,2,true).filterButton=function(button){ target.chooseButton(dialog,2,true).filterButton=function(button){
if(ui.selected.buttons.length){ if(ui.selected.buttons.length){
var current=ui.selected.buttons[0].name; var current=ui.selected.buttons[0].name;
if(rand.contains(current)){ if(rand.includes(current)){
return rand2.contains(button.name); return rand2.includes(button.name);
} }
else{ else{
return rand.contains(button.name); return rand.includes(button.name);
} }
} }
return true; return true;
@ -3801,10 +3803,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{ else{
var gain; var gain;
if(target.hp<target.maxHp){ if(target.hp<target.maxHp){
if(rand.contains('tuteng1')){ if(rand.includes('tuteng1')){
gain='tuteng1'; gain='tuteng1';
} }
else if(rand.contains('tuteng3')){ else if(rand.includes('tuteng3')){
gain='tuteng3'; gain='tuteng3';
} }
else{ else{
@ -3813,7 +3815,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.removeSkill(rand2.randomGet()) target.removeSkill(rand2.randomGet())
} }
else{ else{
if(rand2.contains('tuteng1')){ if(rand2.includes('tuteng1')){
gain=rand.randomGet(); gain=rand.randomGet();
target.removeSkill('tuteng1'); target.removeSkill('tuteng1');
} }
@ -4073,7 +4075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return ui.create.dialog([list,'vcard']); return ui.create.dialog([list,'vcard']);
}, },
filter:function(button,player){ filter:function(button,player){
if(player.storage.nuyan.contains(button.link[2])) return false; if(player.storage.nuyan.includes(button.link[2])) return false;
return lib.filter.filterCard({name:button.link[2]},player,_status.event.getParent()); return lib.filter.filterCard({name:button.link[2]},player,_status.event.getParent());
}, },
check:function(button){ check:function(button){
@ -4325,7 +4327,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'equipEnd'}, trigger:{player:'equipEnd'},
frequent:true, frequent:true,
filter:function(event){ filter:function(event){
return lib.inpile.contains(event.card.name)&&get.subtype(event.card)=='equip1'&&typeof lib.cardType.hslingjian=='number'; return lib.inpile.includes(event.card.name)&&get.subtype(event.card)=='equip1'&&typeof lib.cardType.hslingjian=='number';
}, },
content:function(){ content:function(){
var num=1; var num=1;
@ -4400,7 +4402,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return false; return false;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player.storage.mobao.contains(target); return player.storage.mobao.includes(target);
}, },
position:'he', position:'he',
selectTarget:-1, selectTarget:-1,
@ -4531,7 +4533,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
xueren:{ xueren:{
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
filter:function(event){ filter:function(event){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&event.card.name=='sha'&&event.player.isAlive(); return event.card&&event.card.name=='sha'&&event.player.isAlive();
}, },
check:function(event,player){ check:function(event,player){
@ -4742,7 +4744,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var types=[]; var types=[];
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
var type=get.type(hs[i],'trick'); var type=get.type(hs[i],'trick');
if(types.contains(type)){ if(types.includes(type)){
return false; return false;
} }
else{ else{
@ -4909,7 +4911,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.addSkill('xunbao2'); player.addSkill('xunbao2');
game.delay(2); game.delay(2);
event.node=event.card.copy('thrown','center','thrownhighlight',ui.arena).animate('start'); event.node=event.card.copy('thrown','center','thrownhighlight',ui.arena).addTempClass('start');
ui.arena.classList.add('thrownhighlight'); ui.arena.classList.add('thrownhighlight');
game.addVideo('thrownhighlight1'); game.addVideo('thrownhighlight1');
game.addVideo('centernode',null,get.cardInfo(event.card)); game.addVideo('centernode',null,get.cardInfo(event.card));
@ -5648,7 +5650,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd',player:'damageEnd'}, trigger:{source:'damageEnd',player:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
if(player==event.source){ if(player==event.source){
return event.player!=player&&event.player.countCards('e'); return event.player!=player&&event.player.countCards('e');
} }
@ -5827,7 +5829,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.card.name=='sha'&&event.player!=player&& return event.card.name=='sha'&&event.player!=player&&
get.distance(player,event.targets[0])<=1&& get.distance(player,event.targets[0])<=1&&
player.countCards('h','shan')>0&& player.countCards('h','shan')>0&&
event.targets.contains(player)==false&&event.targets.length==1; event.targets.includes(player)==false&&event.targets.length==1;
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -6283,7 +6285,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
// alter:true, // alter:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
if(get.is.altered('xshixin')&&event.player.hp<player.hp) return false; if(get.is.altered('xshixin')&&event.player.hp<player.hp) return false;
return event.player.isAlive()&&event.player!=player; return event.player.isAlive()&&event.player!=player;
}, },
@ -6516,7 +6518,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
// alter:true, // alter:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&get.color(event.card)=='black'&& return event.card&&get.color(event.card)=='black'&&
!event.player.isTurnedOver()&&event.player.isAlive(); !event.player.isTurnedOver()&&event.player.isAlive();
}, },
@ -6541,7 +6543,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
// alter:true, // alter:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&get.color(event.card)=='black'&& return event.card&&get.color(event.card)=='black'&&
!event.player.isTurnedOver()&&event.player.isAlive(); !event.player.isTurnedOver()&&event.player.isAlive();
}, },
@ -6762,7 +6764,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
bingshuang:{ bingshuang:{
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return event.card&&get.type(event.card)=='trick'&& return event.card&&get.type(event.card)=='trick'&&
event.player.isAlive()&&!event.player.isTurnedOver(); event.player.isAlive()&&!event.player.isTurnedOver();
}, },
@ -8001,7 +8003,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var rand=['tuteng1','tuteng2','tuteng3','tuteng4','tuteng5','tuteng6','tuteng7','tuteng8']; var rand=['tuteng1','tuteng2','tuteng3','tuteng4','tuteng5','tuteng6','tuteng7','tuteng8'];
var rand2=[]; var rand2=[];
for(var i=0;i<rand.length;i++){ for(var i=0;i<rand.length;i++){
if(player.skills.contains(rand[i])){ if(player.skills.includes(rand[i])){
rand2.push(rand[i]); rand2.push(rand[i]);
rand.splice(i--,1); rand.splice(i--,1);
} }
@ -8045,7 +8047,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
rand=rand.concat(['tuteng5','tuteng6','tuteng7','tuteng8']); rand=rand.concat(['tuteng5','tuteng6','tuteng7','tuteng8']);
} }
for(var i=0;i<player.skills.length;i++){ for(var i=0;i<player.skills.length;i++){
if(rand.contains(player.skills[i])){ if(rand.includes(player.skills[i])){
rand.remove(player.skills[i]); rand.remove(player.skills[i]);
rand2.push(player.skills[i]); rand2.push(player.skills[i]);
} }
@ -8073,11 +8075,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseButton(dialog,2,true).filterButton=function(button){ player.chooseButton(dialog,2,true).filterButton=function(button){
if(ui.selected.buttons.length){ if(ui.selected.buttons.length){
var current=ui.selected.buttons[0].name; var current=ui.selected.buttons[0].name;
if(rand.contains(current)){ if(rand.includes(current)){
return rand2.contains(button.name); return rand2.includes(button.name);
} }
else{ else{
return rand.contains(button.name); return rand.includes(button.name);
} }
} }
return true; return true;
@ -8095,7 +8097,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
else{ else{
if(player.hp<player.maxHp&&rand.contains('tuteng1')){ if(player.hp<player.maxHp&&rand.includes('tuteng1')){
player.addSkill('tuteng1'); player.addSkill('tuteng1');
} }
else{ else{
@ -8158,7 +8160,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'tuteng5','tuteng6','tuteng7','tuteng8']; 'tuteng5','tuteng6','tuteng7','tuteng8'];
var num=0; var num=0;
for(var i=0;i<player.skills.length;i++){ for(var i=0;i<player.skills.length;i++){
if(rand.contains(player.skills[i])) num++; if(rand.includes(player.skills[i])) num++;
if(num>=3){ if(num>=3){
return true; return true;
} }
@ -8238,7 +8240,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var tuteng=['tuteng1','tuteng2','tuteng3','tuteng4', var tuteng=['tuteng1','tuteng2','tuteng3','tuteng4',
'tuteng5','tuteng6','tuteng7','tuteng8']; 'tuteng5','tuteng6','tuteng7','tuteng8'];
for(var i=0;i<player.skills.length;i++){ for(var i=0;i<player.skills.length;i++){
if(tuteng.contains(player.skills[i])) return true; if(tuteng.includes(player.skills[i])) return true;
} }
return false; return false;
}, },
@ -8247,7 +8249,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'tuteng5','tuteng6','tuteng7','tuteng8']; 'tuteng5','tuteng6','tuteng7','tuteng8'];
var rand=[]; var rand=[];
for(var i=0;i<player.skills.length;i++){ for(var i=0;i<player.skills.length;i++){
if(tuteng.contains(player.skills[i])){ if(tuteng.includes(player.skills[i])){
rand.push(player.skills[i]); rand.push(player.skills[i]);
} }
} }
@ -8627,7 +8629,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
event.current=event.list.shift(); event.current=event.list.shift();
event.current.animate('target'); event.current.addTempClass('target');
var next=event.current.chooseToRespond({name:'sha'}); var next=event.current.chooseToRespond({name:'sha'});
next.ai=function(card){ next.ai=function(card){
if(get.damageEffect(event.current,player,event.current,'thunder')>=0) return 0; if(get.damageEffect(event.current,player,event.current,'thunder')>=0) return 0;

File diff suppressed because it is too large Load Diff

View File

@ -233,7 +233,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('juechen'),function(card,player,target){ player.chooseTarget(get.prompt('juechen'),function(card,player,target){
return player!=target&&!trigger.targets.contains(target)&&target.countCards('he')>0; return player!=target&&!trigger.targets.includes(target)&&target.countCards('he')>0;
}).set('autodelay',true).ai=function(target){ }).set('autodelay',true).ai=function(target){
return -get.attitude(player,target); return -get.attitude(player,target);
} }
@ -418,7 +418,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var dialog=ui.create.dialog('将三张牌中的锦囊牌或装备牌交给一名角色','hidden'); var dialog=ui.create.dialog('将三张牌中的锦囊牌或装备牌交给一名角色','hidden');
dialog.add(event.cards); dialog.add(event.cards);
for(var i=0;i<dialog.buttons.length;i++){ for(var i=0;i<dialog.buttons.length;i++){
if(event.cards2.contains(dialog.buttons[i].link)){ if(event.cards2.includes(dialog.buttons[i].link)){
dialog.buttons[i].style.opacity=1; dialog.buttons[i].style.opacity=1;
} }
else{ else{

View File

@ -158,7 +158,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onremove:true, onremove:true,
filter:function(event,player){ filter:function(event,player){
if(event.name=='die'){ if(event.name=='die'){
return player==event.player||player.getStorage('jsrgqingzi_clear').contains(event.player); return player==event.player||player.getStorage('jsrgqingzi_clear').includes(event.player);
} }
return player.getStorage('jsrgqingzi_clear').length>0; return player.getStorage('jsrgqingzi_clear').length>0;
}, },
@ -178,7 +178,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
var target=targets.shift(); var target=targets.shift();
var storage=player.getStorage('jsrgqingzi_clear'); var storage=player.getStorage('jsrgqingzi_clear');
if(storage.contains(target)){ if(storage.includes(target)){
storage.remove(target); storage.remove(target);
target.removeAdditionalSkill(`jsrgqingzi_${player.playerid}`); target.removeAdditionalSkill(`jsrgqingzi_${player.playerid}`);
} }
@ -678,13 +678,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
jsrgninghan:{ jsrgninghan:{
audio:2, audio:2,
init:(player)=>{
game.addGlobalSkill('jsrgninghan_frozen');
},
onremove:(player)=>{
if(!game.hasPlayer(current=>current.hasSkill('jsrgninghan'),true)) game.removeGlobalSkill('jsrgninghan_frozen');
},
trigger:{global:'damageEnd'}, trigger:{global:'damageEnd'},
filter:function(event,player){ filter:function(event,player){
if(!event.hasNature('ice')) return false; if(!event.hasNature('ice')) return false;
return event.cards&&event.cards.filterInD().length; return event.cards&&event.cards.filterInD().length;
}, },
forced:true, forced:true,
global:'jsrgninghan_frozen',
content:function(){ content:function(){
var cards=trigger.cards.filterInD(); var cards=trigger.cards.filterInD();
player.addToExpansion(cards,'gain2').gaintag.add('jsrgshacheng'); player.addToExpansion(cards,'gain2').gaintag.add('jsrgshacheng');
@ -701,6 +706,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(lg) return num+0.15*Math.sign(get.attitude(player,lg)); if(lg) return num+0.15*Math.sign(get.attitude(player,lg));
} }
} }
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>!current.hasSkill('jsrgninghan'),true);
},
silent:true,
forceDie:true,
content:()=>{
game.removeGlobalSkill('jsrgninghan_frozen');
} }
}, },
}, },
@ -1112,6 +1126,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},player,evt); },player,evt);
}, },
check:function(button){ check:function(button){
if(button.link[2]==='tao'){
let dying=_status.event.getParent(2).dying;
if(dying) return get.effect(dying,{
name:'tao',
isCard:true,
storage:{jsrgfenjian:true},
},_status.event.player);
}
return _status.event.player.getUseValue({ return _status.event.player.getUseValue({
name:button.link[2], name:button.link[2],
isCard:true, isCard:true,
@ -1153,7 +1175,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:function(item,player){ order:function(item,player){
return Math.max(get.order({name:'juedou'}),get.order({name:'tao'}))+0.2; return Math.max(get.order({name:'juedou'}),get.order({name:'tao'}))+0.2;
}, },
result:{player:1}, result:{
player:(player)=>{
if(_status.event.dying) return 2*get.sgnAttitude(player,_status.event.dying);
return 1;
}
}
}, },
subSkill:{ subSkill:{
effect:{ effect:{
@ -1563,10 +1590,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
prompt2:`${undamaged.length?'选择一张牌弃置并选择一名未对你造成过伤害的角色你对其造成1点伤害':''}${undamaged.length&&damaged.length?'<br>或':''}${damaged.length?'仅选择一名对你造成过伤害的角色,你令其摸两张牌':''}`, prompt2:`${undamaged.length?'选择一张牌弃置并选择一名未对你造成过伤害的角色你对其造成1点伤害':''}${undamaged.length&&damaged.length?'<br>或':''}${damaged.length?'仅选择一名对你造成过伤害的角色,你令其摸两张牌':''}`,
damaged:damaged, damaged:damaged,
aiTarget:(()=>{ aiTarget:(()=>{
if(!undamaged.some(i=>{
if(get.attitude(player,i)>0) return true;
if(i.getHp(true)+i.hujia<2) return true;
return false;
})&&(player.hp>2||get.damageEffect(player,player,player)>=0)) return player;
var info=game.filterPlayer().map(current=>{ var info=game.filterPlayer().map(current=>{
var damage=undamaged.includes(current); let damage=undamaged.includes(current),card={name:damage?'damage':'draw'};
var card={name:damage?'damage':'wuzhong'}; return [current,get.effect(current,card,player,player)*(damage?0.7:2)];
return [current,get.effect(current,card,player,player)/(damage?1.5:1)];
}).sort((a,b)=>b[1]-a[1])[0]; }).sort((a,b)=>b[1]-a[1])[0];
if(info[1]>0) return info[0]; if(info[1]>0) return info[0];
return null; return null;
@ -1626,12 +1657,46 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
trigger.num++; trigger.num++;
}, },
ai:{
damageBonus:true,
skillTagFilter:(player,tag,arg)=>{
if(tag==='damageBonus'&&arg&&arg.target){
const history=_status.globalHistory;
for(let i=history.length-1;i>=0;i--){
let evts=history[i]['useCard'];
for(let j=evts.length-1;j>=0;j--){
var evt=evts[j];
let card=evt.card,targets=evt.targets;
if(!get.tag(card,'damage')||!targets.includes(player)) continue;
return arg.target===evt.player;
}
}
return false;
}
},
effect:{
player:(card,player,target)=>{
if(get.tag(card,'damage')&&target&&lib.skill.jsrghuchou.ai.skillTagFilter(player,'damageBonus',{
card:card,
target:target
})&&!target.hasSkillTag('filterDamage',null,{
player:player,
card:card
})) return [1,0,2,0];
}
}
}
}, },
jsrgjiemeng:{ jsrgjiemeng:{
audio:2, audio:2,
zhuSkill:true, zhuSkill:true,
forced:true, forced:true,
global:'jsrgjiemeng_effect', init:()=>{
game.addGlobalSkill('jsrgjiemeng_effect');
},
onremove:()=>{
if(!game.hasPlayer(i=>i.hasSkill('jsrgjiemeng'),true)) game.removeGlobalSkill('jsrgjiemeng_effect');
},
subSkill:{ subSkill:{
effect:{ effect:{
mod:{ mod:{
@ -1641,6 +1706,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return distance-game.countPlayer(current=>current.group=='qun'); return distance-game.countPlayer(current=>current.group=='qun');
}, },
}, },
trigger:{player:'dieAfter'},
filter:()=>{
return !game.hasPlayer(i=>i.hasSkill('jsrgjiemeng'),true);
},
silent:true,
forceDie:true,
content:()=>{
game.removeGlobalSkill('jsrgjiemeng_effect');
}
}, },
}, },
}, },
@ -2183,7 +2257,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
var source=_status.event.getParent().player; var source=_status.event.getParent().player;
if(target!=source&&!ui.selected.targets.contains(source)) return false; if(target!=source&&!ui.selected.targets.includes(source)) return false;
card=get.autoViewAs({name:'juedou'},[card]); card=get.autoViewAs({name:'juedou'},[card]);
return lib.filter.filterTarget.apply(this,arguments); return lib.filter.filterTarget.apply(this,arguments);
}, },
@ -2231,7 +2305,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
groupSkill:true, groupSkill:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.countCards('h')>=player.countCards('h')) return false; if(target.countCards('h')>=player.countCards('h')) return false;
return !player.getStorage('jsrgqingxi_used').contains(target); return !player.getStorage('jsrgqingxi_used').includes(target);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -2307,7 +2381,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{ result:{
target:function(player,target){ target:function(player,target){
var eff=get.effect(target,{name:'sha',nature:'fire'},player,target)/30; var eff=get.effect(target,{name:'sha',nature:'fire'},player,target)/30;
if(!target.mayHaveShan()) eff*=2; if(!target.mayHaveShan(player,'use')) eff*=2;
var del=target.countCards('h')-player.countCards('h')+1.5; var del=target.countCards('h')-player.countCards('h')+1.5;
eff*=Math.sqrt(del); eff*=Math.sqrt(del);
return eff; return eff;
@ -2374,7 +2448,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
source:'damageBegin1', source:'damageBegin1',
}, },
filter:function(event,player){ filter:function(event,player){
if(!event.card||!['sha','juedou'].contains(event.card.name)||event.getParent().type!='card') return false; if(!event.card||!['sha','juedou'].includes(event.card.name)||event.getParent().type!='card') return false;
return event.player.group==player.group; return event.player.group==player.group;
}, },
forced:true, forced:true,
@ -2733,7 +2807,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player:['useCard','respond'], player:['useCard','respond'],
}, },
filter:function(event,player){ filter:function(event,player){
return lib.suit.contains(get.suit(event.card)); return lib.suit.includes(get.suit(event.card));
}, },
forced:true, forced:true,
content:function(){ content:function(){
@ -2751,13 +2825,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
mod:{ mod:{
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(player.getStorage('jsrgguanjue_ban').contains(get.suit(card))) return false; if(player.getStorage('jsrgguanjue_ban').includes(get.suit(card))) return false;
}, },
cardRespondable:function(card,player){ cardRespondable:function(card,player){
if(player.getStorage('jsrgguanjue_ban').contains(get.suit(card))) return false; if(player.getStorage('jsrgguanjue_ban').includes(get.suit(card))) return false;
}, },
cardSavable:function(card,player){ cardSavable:function(card,player){
if(player.getStorage('jsrgguanjue_ban').contains(get.suit(card))) return false; if(player.getStorage('jsrgguanjue_ban').includes(get.suit(card))) return false;
}, },
}, },
mark:true, mark:true,
@ -2810,7 +2884,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(button){ check:function(button){
if(_status.event.getParent().type!='phase') return 1; if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player; var player=_status.event.player;
if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].contains(button.link[2])) return 0; if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].includes(button.link[2])) return 0;
return player.getUseValue({ return player.getUseValue({
name:button.link[2], name:button.link[2],
nature:button.link[3], nature:button.link[3],
@ -2842,7 +2916,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
hiddenCard:function(player,name){ hiddenCard:function(player,name){
if(!lib.inpile.contains(name)) return false; if(!lib.inpile.includes(name)) return false;
var type=get.type2(name); var type=get.type2(name);
return type=='basic'&&player.countCards('hes')>0&&!player.hasSkill('jsrgnianen_blocker'); return type=='basic'&&player.countCards('hes')>0&&!player.hasSkill('jsrgnianen_blocker');
}, },
@ -3001,7 +3075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=[]; var list=[];
for(var target of targets){ for(var target of targets){
var weapons=target.getEquips(1); var weapons=target.getEquips(1);
weapons=weapons.filter(i=>links.contains(i)); weapons=weapons.filter(i=>links.includes(i));
if(weapons.length){ if(weapons.length){
list.push([target,weapons]); list.push([target,weapons]);
} }
@ -3052,7 +3126,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.countCards('he')) return false; if(!player.countCards('he')) return false;
for(var name of lib.inpile){ for(var name of lib.inpile){
if(get.type(name)!='basic') continue; if(get.type(name)!='basic') continue;
if(player.getStorage('jsrgjixiang_used').contains(name)) continue; if(player.getStorage('jsrgjixiang_used').includes(name)) continue;
var card={name:name}; var card={name:name};
if(event.filterCard(card,event.player,event)) return true; if(event.filterCard(card,event.player,event)) return true;
if(name=='sha'){ if(name=='sha'){
@ -3076,7 +3150,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
var listx=[]; var listx=[];
for(var name of list){ for(var name of list){
if(player.getStorage('jsrgjixiang_used').contains(name)) continue; if(player.getStorage('jsrgjixiang_used').includes(name)) continue;
listx.push([get.type2(name),'',name]); listx.push([get.type2(name),'',name]);
if(name=='sha'){ if(name=='sha'){
for(var nature of lib.inpile_nature){ for(var nature of lib.inpile_nature){
@ -3094,7 +3168,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
names=names.slice(0,names.length-1); names=names.slice(0,names.length-1);
var reason=(trigger.name=='chooseToUse'?'使用':'打出'); var reason=(trigger.name=='chooseToUse'?'使用':'打出');
var used=player.getStorage('jsrgjixiang_used').filter(name=>list.contains(name)); var used=player.getStorage('jsrgjixiang_used').filter(name=>list.includes(name));
var str=get.translation(trigger.player)+(evt.card?'因'+get.translation(evt.card):'')+'需要'+reason+'一张'+names+',是否弃置一张牌视为其'+reason+'之'+ var str=get.translation(trigger.player)+(evt.card?'因'+get.translation(evt.card):'')+'需要'+reason+'一张'+names+',是否弃置一张牌视为其'+reason+'之'+
(used.length?('(你不能以此法令其'+reason+get.translation(used)+''):'')+'?若如此做,你摸一张牌并令〖称贤〗此阶段可发动次数上限+1。'; (used.length?('(你不能以此法令其'+reason+get.translation(used)+''):'')+'?若如此做,你摸一张牌并令〖称贤〗此阶段可发动次数上限+1。';
event.str=str; event.str=str;
@ -3216,7 +3290,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(2+player.countMark('jsrgjixiang_add')<=0) return false; if(2+player.countMark('jsrgjixiang_add')<=0) return false;
for(var name of lib.inpile){ for(var name of lib.inpile){
if(get.type(name)!='trick') continue; if(get.type(name)!='trick') continue;
if(player.getStorage('jsrgchengxian_used').contains(name)) continue; if(player.getStorage('jsrgchengxian_used').includes(name)) continue;
if(event.filterCard({name:name},player,event)) return true; if(event.filterCard({name:name},player,event)) return true;
} }
return false; return false;
@ -3225,7 +3299,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dialog:function(event,player){ dialog:function(event,player){
var list=[]; var list=[];
for(var name of lib.inpile){ for(var name of lib.inpile){
if(player.getStorage('jsrgchengxian_used').contains(name)) continue; if(player.getStorage('jsrgchengxian_used').includes(name)) continue;
var info=get.info({name:name}); var info=get.info({name:name});
if(!info||info.type!='trick') continue; if(!info||info.type!='trick') continue;
if(info.notarget) continue; if(info.notarget) continue;
@ -3241,7 +3315,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(button){ check:function(button){
if(_status.event.getParent().type!='phase') return 1; if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player; var player=_status.event.player;
if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].contains(button.link[2])) return 0; if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].includes(button.link[2])) return 0;
return player.getUseValue({ return player.getUseValue({
name:button.link[2], name:button.link[2],
nature:button.link[3], nature:button.link[3],
@ -3334,7 +3408,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filterCard:lib.filter.cardRecastable, filterCard:lib.filter.cardRecastable,
check:function(card){ check:function(card){
var player=_status.event.player,val=5+['shan','tao'].contains(get.name(card))*1.5; var player=_status.event.player,val=5+['shan','tao'].includes(get.name(card))*1.5;
if(player.needsToDiscard()>2&&get.name(card)=='sha'&&player.countCards('hs','sha')>1) val+=0.5; if(player.needsToDiscard()>2&&get.name(card)=='sha'&&player.countCards('hs','sha')>1) val+=0.5;
return val-get.value(card); return val-get.value(card);
}, },
@ -3438,7 +3512,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
player:function(card,player,target){ player:function(card,player,target){
if(player!=target&&get.tag(card,'damage')&&target&&player.getStorage('jsrgtuwei_backfire').contains(target)&&!target.getHistory('damage').length) return [1,1,1,0]; if(player!=target&&get.tag(card,'damage')&&target&&player.getStorage('jsrgtuwei_backfire').includes(target)&&!target.getHistory('damage').length) return [1,1,1,0];
}, },
}, },
}, },
@ -3500,10 +3574,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
targetInRange:function(card,player,target){ targetInRange:function(card,player,target){
if(player.getStorage('jsrgbiaozhao_A').contains(target)) return true; if(player.getStorage('jsrgbiaozhao_A').includes(target)) return true;
}, },
cardUsableTarget:function(card,player,target){ cardUsableTarget:function(card,player,target){
if(player.getStorage('jsrgbiaozhao_A').contains(target)) return true; if(player.getStorage('jsrgbiaozhao_A').includes(target)) return true;
}, },
}, },
}, },
@ -3519,7 +3593,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
filter:function(event,player){ filter:function(event,player){
return event.card&&player.getStorage('jsrgbiaozhao_B').contains(event.player); return event.card&&player.getStorage('jsrgbiaozhao_B').includes(event.player);
}, },
content:function(){ content:function(){
trigger.num+=player.countMark('jsrgbiaozhao_B'+trigger.player.playerid)||1; trigger.num+=player.countMark('jsrgbiaozhao_B'+trigger.player.playerid)||1;
@ -3779,7 +3853,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeSkillBlocker('sbyingmen'); player.removeSkillBlocker('sbyingmen');
}, },
skillBlocker:function(skill,player){ skillBlocker:function(skill,player){
if(!player.invisibleSkills.contains(skill)||skill=='sbpingjian'||skill=='sbpingjian') return false; if(!player.invisibleSkills.includes(skill)||skill=='sbpingjian'||skill=='sbpingjian') return false;
return !player.hasSkill('sbpingjian'); return !player.hasSkill('sbpingjian');
}, },
marktext:'客', marktext:'客',
@ -3799,13 +3873,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
locked:false, locked:false,
filter:function(event,player){ filter:function(event,player){
var skill=event.sourceSkill||event.skill; var skill=event.sourceSkill||event.skill;
return player.invisibleSkills.contains(skill)&&lib.skill.sbyingmen.getSkills(player.getStorage('sbyingmen'),player).contains(skill); return player.invisibleSkills.includes(skill)&&lib.skill.sbyingmen.getSkills(player.getStorage('sbyingmen'),player).includes(skill);
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var visitors=player.getStorage('sbyingmen').slice(0); var visitors=player.getStorage('sbyingmen').slice(0);
var drawers=visitors.filter(function(name){ var drawers=visitors.filter(function(name){
return Array.isArray(lib.character[name])&&lib.character[name][3].contains(trigger.sourceSkill); return Array.isArray(lib.character[name])&&lib.character[name][3].includes(trigger.sourceSkill);
}); });
event.drawers=drawers; event.drawers=drawers;
if(visitors.length==1) event._result={bool:true,links:visitors}; if(visitors.length==1) event._result={bool:true,links:visitors};
@ -3819,7 +3893,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
lib.skill.sbyingmen.removeVisitors(result.links,player); lib.skill.sbyingmen.removeVisitors(result.links,player);
game.log(player,'移去了','#y'+get.translation(result.links[0])); game.log(player,'移去了','#y'+get.translation(result.links[0]));
if(event.drawers.contains(result.links[0])){ if(event.drawers.includes(result.links[0])){
player.addTempSkill('sbpingjian_draw'); player.addTempSkill('sbpingjian_draw');
player.storage.sbpingjian_draw.push(trigger.skill); player.storage.sbpingjian_draw.push(trigger.skill);
} }
@ -3837,7 +3911,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
popup:false, popup:false,
filter:function(event,player){ filter:function(event,player){
return player.getStorage('sbpingjian_draw').contains(event.skill); return player.getStorage('sbpingjian_draw').includes(event.skill);
}, },
content:function(){ content:function(){
player.storage.sbpingjian_draw.remove(trigger.skill); player.storage.sbpingjian_draw.remove(trigger.skill);
@ -3858,7 +3932,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(info.charlotte) return false; if(info.charlotte) return false;
var skills=lib.skill.sbyingmen.getSkills(player.getStorage('sbyingmen'),player); var skills=lib.skill.sbyingmen.getSkills(player.getStorage('sbyingmen'),player);
game.expandSkills(skills); game.expandSkills(skills);
return skills.contains(event.skill); return skills.includes(event.skill);
}, },
content:function(){ content:function(){
"step 0" "step 0"
@ -3992,8 +4066,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseToDiscard('h',2,get.prompt('jsrgfeiyang'),'弃置两张手牌并弃置判定区里的一张牌').set('logSkill','jsrgfeiyang').set('ai',function(card){ player.chooseToDiscard('h',2,get.prompt('jsrgfeiyang'),'弃置两张手牌并弃置判定区里的一张牌').set('logSkill','jsrgfeiyang').set('ai',function(card){
return 6-get.value(card); if(_status.event.goon) return 6-get.value(card);
}); return 0;
}).set('goon',(()=>{
if(player.hasSkillTag('rejudge')&&player.countCards('j')<2) return false;
return player.hasCard(function(card){
if(get.tag(card,'damage')&&get.damageEffect(player,player,_status.event.player,get.natureList(card))>=0) return false;
return get.effect(player,{
name:card.viewAs||card.name,
cards:[card],
},player,player)<0;
},'j');
})());
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.discardPlayerCard(player,'j',true); player.discardPlayerCard(player,'j',true);
@ -4481,7 +4565,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var name=_status.characterlist[i]; var name=_status.characterlist[i];
var skills=lib.character[name][3].slice(); var skills=lib.character[name][3].slice();
if(skills.some(skill=>{ if(skills.some(skill=>{
return lib.skill.jsrgyingmen.bannedList.contains(skill); return lib.skill.jsrgyingmen.bannedList.includes(skill);
})) continue; })) continue;
list.push(name); list.push(name);
_status.characterlist.remove(name); _status.characterlist.remove(name);
@ -4799,7 +4883,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
if(targets.length){ if(targets.length){
var next=player.chooseTarget(function(card,player,target){ var next=player.chooseTarget(function(card,player,target){
return _status.event.targets.contains(target); return _status.event.targets.includes(target);
}); });
next.set('from',target); next.set('from',target);
next.set('targets',targets); next.set('targets',targets);
@ -4947,7 +5031,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=history.length-1;i>=0;i--){ for(var i=history.length-1;i>=0;i--){
var evt=history[i]; var evt=history[i];
var cards2=evt.cards.filter(card=>{ var cards2=evt.cards.filter(card=>{
return cards.contains(card)&&get.suit(card,false)==suit; return cards.includes(card)&&get.suit(card,false)==suit;
}); });
if(cards2.length){ if(cards2.length){
gains.addArray(cards2); gains.addArray(cards2);
@ -4989,12 +5073,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!moveCard||!target.hasFriend()) return; if(!moveCard||!target.hasFriend()) return;
var num=1; var num=1;
if(get.attitude(player,target)>0){ if(get.attitude(player,target)>0){
if(player.needsToDiscard()){ if(player.needsToDiscard()) num=0.5;
num=0.5; else num=0.3;
}
else{
num=0.3;
}
} }
if(target.hp>=4) return [1,num*2]; if(target.hp>=4) return [1,num*2];
if(target.hp==3) return [1,num*1.5]; if(target.hp==3) return [1,num*1.5];
@ -5041,7 +5121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:1, order:1,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.skipList.contains('phaseDraw')||target.hasSkill('pingkou')) return 0; if(target.skipList.includes('phaseDraw')||target.hasSkill('pingkou')) return 0;
var hs=player.getCards('h').sort(function(a,b){ var hs=player.getCards('h').sort(function(a,b){
return b.number-a.number; return b.number-a.number;
}); });
@ -5153,7 +5233,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(_status.event.all) return 1; if(_status.event.all) return 1;
if(ui.selected.buttons.length) return 0; if(ui.selected.buttons.length) return 0;
return Math.random(); return Math.random();
}).set('all',!target.mayHaveShan()&&Math.random()<0.75).set('forceAuto',true); }).set('all',!target.mayHaveShan(player,'use')&&Math.random()<0.75).set('forceAuto',true);
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var cards=result.cards; var cards=result.cards;
@ -5212,7 +5292,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!cards||!target||!target.isIn()) return false; if(!cards||!target||!target.isIn()) return false;
var cardsx=target.getCards('h'); var cardsx=target.getCards('h');
cardsx.addArray(Array.from(ui.discardPile)); cardsx.addArray(Array.from(ui.discardPile));
return cards.some(i=>cardsx.contains(i)); return cards.some(i=>cardsx.includes(i));
//target.hasCard(card=>{ //target.hasCard(card=>{
// return card.hasGaintag('jsrgfendi_tag'); // return card.hasGaintag('jsrgfendi_tag');
//},'h'); //},'h');
@ -5222,7 +5302,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('jsrgfendi_gain',target); player.logSkill('jsrgfendi_gain',target);
var cardsx=target.getCards('h'); var cardsx=target.getCards('h');
cardsx.addArray(Array.from(ui.discardPile)); cardsx.addArray(Array.from(ui.discardPile));
var cards=trigger.card.storage.jsrgfendi.filter(i=>cardsx.contains(i)); var cards=trigger.card.storage.jsrgfendi.filter(i=>cardsx.includes(i));
player.gain(cards,'give'); player.gain(cards,'give');
} }
} }
@ -5238,7 +5318,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var evt=event.getParent('phaseDraw'); var evt=event.getParent('phaseDraw');
if(evt&&evt.name=='phaseDraw') return false; if(evt&&evt.name=='phaseDraw') return false;
var hs=player.getCards('h'); var hs=player.getCards('h');
var cards=event.getg(player).filter(i=>hs.contains(i)); var cards=event.getg(player).filter(i=>hs.includes(i));
if(!cards.length) return false; if(!cards.length) return false;
for(var card of cards){ for(var card of cards){
if(!lib.filter.cardDiscardable(card,player,'jsrgjuxiang')) return false; if(!lib.filter.cardDiscardable(card,player,'jsrgjuxiang')) return false;
@ -5253,7 +5333,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(target.getCardUsable({name:'sha'})>=target.countCards('hs','sha')) return false; if(target.getCardUsable({name:'sha'})>=target.countCards('hs','sha')) return false;
if(!target.hasValueTarget({name:'sha'})) return false; if(!target.hasValueTarget({name:'sha'})) return false;
var hs=player.getCards('h'); var hs=player.getCards('h');
var cards=event.getg(player).filter(i=>hs.contains(i)); var cards=event.getg(player).filter(i=>hs.includes(i));
var val=0; var val=0;
for(var i of cards) val+=get.value(i); for(var i of cards) val+=get.value(i);
if(val<10) return true; if(val<10) return true;
@ -5261,7 +5341,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
prompt2:function(event,player){ prompt2:function(event,player){
var hs=player.getCards('h'); var hs=player.getCards('h');
var cards=event.getg(player).filter(i=>hs.contains(i)); var cards=event.getg(player).filter(i=>hs.includes(i));
var target=_status.currentPhase; var target=_status.currentPhase;
var str='弃置'+get.translation(cards); var str='弃置'+get.translation(cards);
if(target&&target.isIn()){ if(target&&target.isIn()){
@ -5277,7 +5357,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
var hs=player.getCards('h'); var hs=player.getCards('h');
var cards=trigger.getg(player).filter(i=>hs.contains(i)); var cards=trigger.getg(player).filter(i=>hs.includes(i));
var list=[]; var list=[];
for(var card of cards){ for(var card of cards){
list.add(get.suit(card,player)); list.add(get.suit(card,player));
@ -5335,7 +5415,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onremove:true, onremove:true,
prompt2:'失去1点体力并防止此伤害然后你与其各摸一张牌', prompt2:'失去1点体力并防止此伤害然后你与其各摸一张牌',
check:function(event,player){ check:function(event,player){
return get.damageEffect(event.player,event.source,player,event.nature)*Math.sqrt(event.num)<=get.effect(player,{name:'losehp'},player,player); return get.damageEffect(event.player,event.source,_status.event.player,event.nature)*event.num <
get.effect(player,{name:'losehp'},player,_status.event.player)+get.effect(player,{name:'draw'},player,_status.event.player)+get.effect(event.player,{name:'draw'},player,_status.event.player)/2;
}, },
group:'jsrgjishan_recover', group:'jsrgjishan_recover',
content:function(){ content:function(){
@ -5359,7 +5440,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageSource'}, trigger:{source:'damageSource'},
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(current=>{ return game.hasPlayer(current=>{
return current.isMinHp()&&player.getStorage('jsrgjishan').contains(current); return current.isMinHp()&&player.getStorage('jsrgjishan').includes(current);
}); });
}, },
usable:1, usable:1,
@ -5367,7 +5448,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('jsrgjishan_recover'),'令一名体力值最小且你对其发动过〖积善①〗的角色回复1点体力',(card,player,target)=>{ player.chooseTarget(get.prompt('jsrgjishan_recover'),'令一名体力值最小且你对其发动过〖积善①〗的角色回复1点体力',(card,player,target)=>{
return target.isMinHp()&&player.getStorage('jsrgjishan').contains(target); return target.isMinHp()&&player.getStorage('jsrgjishan').includes(target);
}).set('ai',target=>{ }).set('ai',target=>{
return get.recoverEffect(target,_status.event.player,_status.event.player); return get.recoverEffect(target,_status.event.player,_status.event.player);
}); });
@ -5395,23 +5476,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
// trigger.getParent().triggeredTargets4=trigger.getParent().triggeredTargets4.concat(trigger.targets); // trigger.getParent().triggeredTargets4=trigger.getParent().triggeredTargets4.concat(trigger.targets);
trigger.getParent().effectCount++; trigger.getParent().effectCount++;
}, },
ai:{
effect:{
target:function(card,player,target){
if(player._jsrgzhenqiao_aiChecking) return;
if(target==player&&get.subtype(card)=='equip1'&&!player.getEquip(1)){
player._jsrgzhenqiao_aiChecking=true;
var eff=get.effect(target,card,player,player);
delete player._jsrgzhenqiao_aiChecking;
if(eff<3) return 'zerotarget';
}
}
}
},
mod:{ mod:{
attackRange:function(player,num){ attackRange:function(player,num){
return num+1; return num+1;
}, },
aiOrder:(player,card,num)=>{
if(num>0&&get.itemtype(card)==='card'&&get.subtype(card)==='equip1'&&!player.getEquip(1)){
if(card.name!=='zhuge'||player.getCardUsable('sha')||!player.needsToDiscard()||player.countCards('hs',i=>{
return get.name(i)==='sha'&&lib.filter.cardEnabled(i,target);
})<2) return 0;
}
},
aiValue:(player,card,num)=>{
if(num>0&&get.itemtype(card)==='card'&&card.name!=='zhuge'&&get.subtype(card)==='equip1'&&!player.getEquip(1)) return 0.01*num;
},
aiUseful:()=>{
return lib.skill.jsrgzhenqiao.mod.aiValue.apply(this,arguments);
}
} }
}, },
//王允 //王允
@ -5461,19 +5542,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
trigger:{global:'chooseToDebateAfter'}, trigger:{global:'chooseToDebateAfter'},
filter:function(event,player){ filter:function(event,player){
if(!event.targets.contains(player)) return false; if(!event.targets.includes(player)) return false;
if(event.red.map(i=>i[0]).contains(player)) return event.black.length; if(event.red.map(i=>i[0]).includes(player)) return event.black.length;
if(event.black.map(i=>i[0]).contains(player)) return event.red.length; if(event.black.map(i=>i[0]).includes(player)) return event.red.length;
return false; return false;
}, },
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
var targets=[]; var targets=[];
if(trigger.red.map(i=>i[0]).contains(player)) targets=trigger.black; if(trigger.red.map(i=>i[0]).includes(player)) targets=trigger.black;
if(trigger.black.map(i=>i[0]).contains(player)) targets=trigger.red; if(trigger.black.map(i=>i[0]).includes(player)) targets=trigger.red;
player.chooseTarget(get.prompt('jsrgfayi'),'对一名与你意见不同的角色造成1点伤害',(card,player,target)=>{ player.chooseTarget(get.prompt('jsrgfayi'),'对一名与你意见不同的角色造成1点伤害',(card,player,target)=>{
return _status.event.targets.contains(target); return _status.event.targets.includes(target);
}).set('targets',targets.map(i=>i[0])).set('ai',target=>{ }).set('targets',targets.map(i=>i[0])).set('ai',target=>{
var player=_status.event.player; var player=_status.event.player;
return get.damageEffect(target,player,player); return get.damageEffect(target,player,player);
@ -5578,7 +5659,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onremove:true, onremove:true,
mod:{ mod:{
playerEnabled:function(card,player,target){ playerEnabled:function(card,player,target){
if(player.getStorage('jsrgtongjue_blocker').contains(target)) return false; if(player.getStorage('jsrgtongjue_blocker').includes(target)) return false;
}, },
}, },
mark:true, mark:true,
@ -5758,7 +5839,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
player.logSkill('jsrgshoushu',target); player.logSkill('jsrgshoushu',target);
if(!lib.inpile.contains('taipingyaoshu')){ if(!lib.inpile.includes('taipingyaoshu')){
lib.inpile.push('taipingyaoshu'); lib.inpile.push('taipingyaoshu');
} }
event.card=game.createCard2('taipingyaoshu','heart',3); event.card=game.createCard2('taipingyaoshu','heart',3);

File diff suppressed because it is too large Load Diff

View File

@ -72,7 +72,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'dieAfter'}, trigger:{global:'dieAfter'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return !event.player.isMin()&&![player.name,player.name1,player.name2].contains(event.player.name); return !event.player.isMin()&&![player.name,player.name1,player.name2].includes(event.player.name);
}, },
content:function(){ content:function(){
var skills=lib.character[trigger.player.name][3].slice(0); var skills=lib.character[trigger.player.name][3].slice(0);

View File

@ -170,7 +170,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
d1=true; d1=true;
if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false; if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false;
for(var target of trigger.targets){ for(var target of trigger.targets){
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{ if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
target:target, target:target,
card:trigger.card, card:trigger.card,
},true)){ },true)){
@ -251,7 +251,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
onremove:true, onremove:true,
filter:function(event,player){ filter:function(event,player){
return event.card&&event.card.name=='sha'&&event.card.storage&&event.card.storage.vtbguisha_targets&&event.card.storage.vtbguisha_targets.contains(event.player); return event.card&&event.card.name=='sha'&&event.card.storage&&event.card.storage.vtbguisha_targets&&event.card.storage.vtbguisha_targets.includes(event.player);
}, },
content:function(){ content:function(){
trigger.num++; trigger.num++;
@ -266,7 +266,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
usable:2, usable:2,
filter:function(event,player){ filter:function(event,player){
return event.source!=player&&event.card&&event.card.name=='sha'&&event.source.isIn(); return event.source&&event.source!=player&&event.card&&event.card.name=='sha'&&event.source.isIn();
}, },
check:function(event,player){ check:function(event,player){
return get.attitude(player,event.source)>=0||get.attitude(player,event.source)>=-4 return get.attitude(player,event.source)>=0||get.attitude(player,event.source)>=-4
@ -299,7 +299,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var effect=0; var effect=0;
for(var target of trigger.targets){ for(var target of trigger.targets){
var eff=get.effect(target,trigger.card,trigger.player,player); var eff=get.effect(target,trigger.card,trigger.player,player);
if(!target.mayHaveShan()||trigger.player.hasSkillTag('directHit_ai',true,{ if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{
target:target, target:target,
card:trigger.card, card:trigger.card,
},true)){ },true)){
@ -373,7 +373,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
targets.sortBySeat(); targets.sortBySeat();
player.logSkill('vtbtaoyan',targets); player.logSkill('vtbtaoyan',targets);
game.broadcastAll(function(){ game.broadcastAll(function(){
if(!lib.inpile.contains('tao')){ if(!lib.inpile.includes('tao')){
lib.inpile.add('tao'); lib.inpile.add('tao');
} }
}); });
@ -407,13 +407,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(typeof _status.vtbtaoyan_count!='number') return false; if(typeof _status.vtbtaoyan_count!='number') return false;
var cards=event.getd(); var cards=event.getd();
return cards.some(card=>{ return cards.some(card=>{
return _status.vtbtaoyan_cards.contains(card.cardid); return _status.vtbtaoyan_cards.includes(card.cardid);
}); });
}, },
content:function(){ content:function(){
var cards=trigger.getd(),remove=[]; var cards=trigger.getd(),remove=[];
for(var card of cards){ for(var card of cards){
if(_status.vtbtaoyan_cards.contains(card.cardid)){ if(_status.vtbtaoyan_cards.includes(card.cardid)){
_status.vtbtaoyan_cards.remove(card.cardid); _status.vtbtaoyan_cards.remove(card.cardid);
remove.push(card); remove.push(card);
} }
@ -552,10 +552,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.directHit.addArray(game.filterPlayer()); trigger.directHit.addArray(game.filterPlayer());
var num=player.countMark('vtbyaoli_effect'); var num=player.countMark('vtbyaoli_effect');
if(!game.hasPlayer(current=>{ if(!game.hasPlayer(current=>{
return !trigger.targets.contains(current)&&lib.filter.targetEnabled2(trigger.card,player,current); return !trigger.targets.includes(current)&&lib.filter.targetEnabled2(trigger.card,player,current);
})) event.finish(); })) event.finish();
else player.chooseTarget('媱丽:是否为'+get.translation(trigger.card)+'额外指定'+(num>1?'至多':'')+get.cnNumber(num)+'个目标?',num==1?1:[1,num],(card,player,target)=>{ else player.chooseTarget('媱丽:是否为'+get.translation(trigger.card)+'额外指定'+(num>1?'至多':'')+get.cnNumber(num)+'个目标?',num==1?1:[1,num],(card,player,target)=>{
return !_status.event.sourcex.contains(target)&&player.canUse(_status.event.card,target); return !_status.event.sourcex.includes(target)&&player.canUse(_status.event.card,target);
}).set('sourcex',trigger.targets).set('ai',target=>{ }).set('sourcex',trigger.targets).set('ai',target=>{
var player=_status.event.player; var player=_status.event.player;
return get.effect(target,_status.event.card,player,player); return get.effect(target,_status.event.card,player,player);
@ -676,7 +676,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
links:[cards[0]], links:[cards[0]],
} }
else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){ else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){
return _status.event.cards.contains(button.link); return _status.event.cards.includes(button.link);
}).set('cards',cards) }).set('cards',cards)
} }
else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){ else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){
@ -758,6 +758,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
intro:{ intro:{
content:'受到的伤害+1且改为雷属性', content:'受到的伤害+1且改为雷属性',
}, },
ai:{
effect:{
target:(card,player,target)=>{
if(!get.tag(card,'damage')) return;
if(target.hasSkillTag('nodamage')||target.hasSkillTag('nothunder')) return 'zeroplayertarget';
if(target.hasSkillTag('filterDamage',null,{
player:player,
card:new lib.element.VCard({
name:card.name,
nature:'thunder'
},[card])
})) return;
return 2;
}
}
}
}, },
init:{ init:{
audio:'psshouli', audio:'psshouli',
@ -828,12 +844,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(!_status.psshouli_equips||!_status.psshouli_equips.length) return false; if(!_status.psshouli_equips||!_status.psshouli_equips.length) return false;
var cards=event.getd(); var cards=event.getd();
return cards.filter(i=>_status.psshouli_equips.contains(i.cardid)).length; return cards.filter(i=>_status.psshouli_equips.includes(i.cardid)).length;
}, },
content:function(){ content:function(){
var cards=trigger.getd(),remove=[]; var cards=trigger.getd(),remove=[];
for(var card of cards){ for(var card of cards){
if(_status.psshouli_equips.contains(card.cardid)){ if(_status.psshouli_equips.includes(card.cardid)){
_status.psshouli_equips.remove(card.cardid); _status.psshouli_equips.remove(card.cardid);
remove.push(card); remove.push(card);
} }
@ -886,7 +902,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(_status.event.goon) return 12-get.value(card); if(_status.event.goon) return 12-get.value(card);
if(player.countCards('h')>50) return 0; if(player.countCards('h')>50) return 0;
if(player==_status.currentPhase){ if(player==_status.currentPhase){
if(['shan','caochuan','tao','wuxie'].contains(card.name)) return 8-get.value(card); if(['shan','caochuan','tao','wuxie'].includes(card.name)) return 8-get.value(card);
return 6-get.value(card); return 6-get.value(card);
} }
return 5.5-get.value(card); return 5.5-get.value(card);
@ -900,6 +916,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
threaten:100, threaten:100,
reverseEquip:true, reverseEquip:true,
effect:{
player:(card,player,target)=>{
if(typeof card!=='object') return;
let suit=get.suit(card);
if(!lib.suit.includes(suit)||player.hasCard(function(i){
return get.suit(i,player)==suit;
},'h')) return;
return [1,game.countPlayer(current=>{
return current.countCards('e',card=>{
return get.suit(card,current)==suit;
});
})];
},
target:(card,player,target)=>{
if(card.name==='sha'&&!player.hasSkillTag('directHit_ai',true,{
target:target,
card:card
},true)&&game.hasPlayer(current=>{
return current.hasCard(cardx=>{
return get.subtype(cardx)==='equip3';
},'e');
})) return [0, -0.5];
}
}
} }
}, },
//战役篇田丰 //战役篇田丰
@ -1060,7 +1100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(button){ check:function(button){
if(_status.event.getParent().type!='phase') return 1; if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player; var player=_status.event.player;
if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].contains(button.link[2])) return 0; if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].includes(button.link[2])) return 0;
return player.getUseValue({ return player.getUseValue({
name:button.link[2], name:button.link[2],
nature:button.link[3], nature:button.link[3],
@ -1084,7 +1124,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
hiddenCard:function(player,name){ hiddenCard:function(player,name){
if(!lib.inpile.contains(name)) return false; if(!lib.inpile.includes(name)) return false;
var type=get.type(name); var type=get.type(name);
return (type=='basic'||type=='trick')&&player.countMark('pkwuku')>0&&!player.hasSkill('pkmiewu2'); return (type=='basic'||type=='trick')&&player.countMark('pkwuku')>0&&!player.hasSkill('pkmiewu2');
}, },
@ -1203,7 +1243,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return get.type2(event.card)=='trick'&&event.player!=player&&event.targets&&event.targets.contains(player)&&event.cards.filterInD('odj').length&&player.countCards('h'); return get.type2(event.card)=='trick'&&event.player!=player&&event.targets&&event.targets.includes(player)&&event.cards.filterInD('odj').length&&player.countCards('h');
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -1307,7 +1347,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
enable:['chooseToUse','chooseToRespond'], enable:['chooseToUse','chooseToRespond'],
hiddenCard:function(player,name){ hiddenCard:function(player,name){
if(player!=_status.currentPhase&&!player.hasSkill('psqichu_used')&&get.type(name)=='basic'&&lib.inpile.contains(name)) return true; if(player!=_status.currentPhase&&!player.hasSkill('psqichu_used')&&get.type(name)=='basic'&&lib.inpile.includes(name)) return true;
}, },
filter:function(event,player){ filter:function(event,player){
if(event.responded||player==_status.currentPhase||player.hasSkill('psqichu_used')) return false; if(event.responded||player==_status.currentPhase||player.hasSkill('psqichu_used')) return false;
@ -1327,7 +1367,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
var aozhan=player.hasSkill('aozhan'); var aozhan=player.hasSkill('aozhan');
player.chooseButton(['七出:选择要'+(evt.name=='chooseToUse'?'使用':'打出')+'的牌',cards]).set('filterButton',function(button){ player.chooseButton(['七出:选择要'+(evt.name=='chooseToUse'?'使用':'打出')+'的牌',cards]).set('filterButton',function(button){
return _status.event.cards.contains(button.link); return _status.event.cards.includes(button.link);
}).set('cards',cards.filter(function(card){ }).set('cards',cards.filter(function(card){
if(get.type(card)!='basic') return false; if(get.type(card)!='basic') return false;
if(aozhan&&card.name=='tao'){ if(aozhan&&card.name=='tao'){
@ -1676,21 +1716,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.suits=suits; event.suits=suits;
} }
'step 2' 'step 2'
if(event.suits.contains('heart')){ if(event.suits.includes('heart')){
if(targets[1].countGainableCards('hej',targets[0])>0){ if(targets[1].countGainableCards('hej',targets[0])>0){
targets[0].gainPlayerCard(targets[1],'hej',true); targets[0].gainPlayerCard(targets[1],'hej',true);
} }
} }
'step 3' 'step 3'
if(event.suits.contains('diamond')){ if(event.suits.includes('diamond')){
targets[1].damage(targets[0]); targets[1].damage(targets[0]);
} }
'step 4' 'step 4'
if(event.suits.contains('spade')){ if(event.suits.includes('spade')){
targets[0].loseHp(); targets[0].loseHp();
} }
'step 5' 'step 5'
if(event.suits.contains('club')){ if(event.suits.includes('club')){
if(targets[0].countDiscardableCards(targets[0],'he')){ if(targets[0].countDiscardableCards(targets[0],'he')){
targets[0].chooseToDiscard(2,true,'he'); targets[0].chooseToDiscard(2,true,'he');
} }
@ -1810,7 +1850,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
prevent:{ prevent:{
trigger:{source:'damageBegin2'}, trigger:{source:'damageBegin2'},
filter:function(event,player){ filter:function(event,player){
return player.getStorage('psliushang_prevent').contains(event.player); return player.getStorage('psliushang_prevent').includes(event.player);
}, },
forced:true, forced:true,
onremove:true, onremove:true,
@ -1822,7 +1862,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function (card,player,target,current){ target:function (card,player,target,current){
if(player.getStorage('psliushang_prevent').contains(target)&&get.tag(card,'damage')){ if(player.getStorage('psliushang_prevent').includes(target)&&get.tag(card,'damage')){
return 'zeroplayertarget'; return 'zeroplayertarget';
} }
}, },
@ -2145,7 +2185,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(button){ check:function(button){
if(_status.event.getParent().type!='phase') return 1; if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player; var player=_status.event.player;
if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].contains(button.link[2])) return 0; if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].includes(button.link[2])) return 0;
return player.getUseValue({ return player.getUseValue({
name:button.link[2], name:button.link[2],
nature:button.link[3], nature:button.link[3],
@ -2201,7 +2241,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
hiddenCard:function(player,name){ hiddenCard:function(player,name){
if(!lib.inpile.contains(name)) return false; if(!lib.inpile.includes(name)) return false;
var type=get.type(name); var type=get.type(name);
return (type=='basic'||type=='trick')&&player.countCards('she')>0&&!player.hasSkill('pslongyin_used'); return (type=='basic'||type=='trick')&&player.countCards('she')>0&&!player.hasSkill('pslongyin_used');
}, },
@ -2504,13 +2544,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
return event.card.storage&&event.card.storage.pssheji&&event.player.hasCard(card=>{ return event.card.storage&&event.card.storage.pssheji&&event.player.hasCard(card=>{
if(!lib.filter.canBeGained(card,player,event.player)) return false; if(!lib.filter.canBeGained(card,player,event.player)) return false;
return ['equip1','equip3','equip4','equip6'].contains(get.subtype(card)); return ['equip1','equip3','equip4','equip6'].includes(get.subtype(card));
},'e'); },'e');
}, },
content:function(){ content:function(){
var cards=trigger.player.getCards('e',card=>{ var cards=trigger.player.getCards('e',card=>{
if(!lib.filter.canBeGained(card,player,trigger.player)) return false; if(!lib.filter.canBeGained(card,player,trigger.player)) return false;
return ['equip1','equip3','equip4','equip6'].contains(get.subtype(card)); return ['equip1','equip3','equip4','equip6'].includes(get.subtype(card));
}); });
if(cards.length) player.gain(cards,'giveAuto',trigger.player); if(cards.length) player.gain(cards,'giveAuto',trigger.player);
} }
@ -2631,8 +2671,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
logTarget:'player', logTarget:'player',
content:function(){ content:function(){
var list=[],target=trigger.player; var list=[],target=trigger.player;
if(target.name1&&!target.isUnseen(0)&&target.name1.indexOf('gz_shibing')!=0&&_status.characterlist.contains(target.name1)) list.push(target.name1); if(target.name1&&!target.isUnseen(0)&&target.name1.indexOf('gz_shibing')!=0&&_status.characterlist.includes(target.name1)) list.push(target.name1);
if(target.name2&&!target.isUnseen(1)&&target.name2.indexOf('gz_shibing')!=0&&_status.characterlist.contains(target.name1)) list.push(target.name2); if(target.name2&&!target.isUnseen(1)&&target.name2.indexOf('gz_shibing')!=0&&_status.characterlist.includes(target.name1)) list.push(target.name2);
_status.characterlist.removeArray(list); _status.characterlist.removeArray(list);
if(player==trigger.source) list.addArray(_status.characterlist.randomRemove(1)); if(player==trigger.source) list.addArray(_status.characterlist.randomRemove(1));
if(list.length){ if(list.length){
@ -2910,7 +2950,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.getHistory('lose',function(evt2){ return player.getHistory('lose',function(evt2){
if(evt2.getParent()!=evt) return false; if(evt2.getParent()!=evt) return false;
for(var i in evt2.gaintag_map){ for(var i in evt2.gaintag_map){
if(evt2.gaintag_map[i].contains('liangfan')) return true; if(evt2.gaintag_map[i].includes('liangfan')) return true;
} }
return false; return false;
}).length>0; }).length>0;
@ -3046,7 +3086,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseTarget(get.prompt('zylianji'),'令一名角色摸一张牌').set('ai',target=>{ player.chooseTarget(get.prompt('zylianji'),'令一名角色摸一张牌').set('ai',target=>{
var player=_status.event.player; var player=_status.event.player;
if(target==player&&player.needsToDiscard(1)) return 1; if(target==player&&player.needsToDiscard(1)) return 1;
return get.effect(target,{name:'wuzhong'},player,player); return get.effect(target,{name:'draw'},player,player);
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -3385,14 +3425,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(event.name=='lose'){ if(event.name=='lose'){
for(var i in event.gaintag_map){ for(var i in event.gaintag_map){
if(event.gaintag_map[i].contains('yjshicai_clear')) return true; if(event.gaintag_map[i].includes('yjshicai_clear')) return true;
} }
return false; return false;
} }
return player.hasHistory('lose',function(evt){ return player.hasHistory('lose',function(evt){
if(evt.getParent()!=event) return false; if(evt.getParent()!=event) return false;
for(var i in evt.gaintag_map){ for(var i in evt.gaintag_map){
if(evt.gaintag_map[i].contains('yjshicai_clear')) return true; if(evt.gaintag_map[i].includes('yjshicai_clear')) return true;
} }
}); });
}, },
@ -3497,7 +3537,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'耀令:对'+get.translation(targets[1])+'使用一张杀,或令'+get.translation(player)+'弃置你的一张牌').set('targetRequired',true).set('filterTarget',function(card,player,target){ },'耀令:对'+get.translation(targets[1])+'使用一张杀,或令'+get.translation(player)+'弃置你的一张牌').set('targetRequired',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.filterTarget.apply(this,arguments); return lib.filter.filterTarget.apply(this,arguments);
}).set('sourcex',targets[1]); }).set('sourcex',targets[1]);
} }
@ -3620,7 +3660,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
filter:function (event,player){ filter:function (event,player){
if(player.hp<1||!player.countDiscardableCards(player,'h')) return false; if(player.hp<1||!player.countDiscardableCards(player,'h')) return false;
if(['damage','loseHp','recover'].contains(event.name)) return true; if(['damage','loseHp','recover'].includes(event.name)) return true;
var evt=event.getl(player); var evt=event.getl(player);
if(event.name=='equip'&&event.player==player) return !evt||evt.cards.length!=1; if(event.name=='equip'&&event.player==player) return !evt||evt.cards.length!=1;
if(!evt||!evt.es.length) return false; if(!evt||!evt.es.length) return false;
@ -3689,7 +3729,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
yjdumou:{ yjdumou:{
audio:2, audio:2,
forced:true, forced:true,
global:'yjdumou_du',
mod:{ mod:{
cardname:function(card,player,name){ cardname:function(card,player,name){
if(player==_status.currentPhase&&card.name=='du') return 'guohe'; if(player==_status.currentPhase&&card.name=='du') return 'guohe';
@ -3698,6 +3737,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card.name=='du') return get.value({name:'guohe'}); if(card.name=='du') return get.value({name:'guohe'});
}, },
}, },
init:()=>{
game.addGlobalSkill('yjdumou_du');
},
onremove:()=>{
if(!game.hasPlayer(i=>i.hasSkill('yjdumou'),true)) game.removeGlobalSkill('yjdumou_du');
},
subSkill:{ subSkill:{
du:{ du:{
mod:{ mod:{
@ -3707,6 +3752,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
aiValue:function(player,card,num){ aiValue:function(player,card,num){
if(get.name(card)=='du'&&card.name!='du') return get.value({name:card.name}); if(get.name(card)=='du'&&card.name!='du') return get.value({name:card.name});
}, },
},
trigger:{player:'dieAfter'},
filter:()=>{
return !game.hasPlayer(i=>i.hasSkill('yjdumou'),true);
},
silent:true,
forceDie:true,
content:()=>{
game.removeGlobalSkill('yjdumou_du');
} }
} }
}, },
@ -3844,13 +3898,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onremove:true, onremove:true,
mod:{ mod:{
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(player.getStorage('yjxiandao_block').contains(get.suit(card))) return false; if(player.getStorage('yjxiandao_block').includes(get.suit(card))) return false;
}, },
cardRespondable:function(card,player){ cardRespondable:function(card,player){
if(player.getStorage('yjxiandao_block').contains(get.suit(card))) return false; if(player.getStorage('yjxiandao_block').includes(get.suit(card))) return false;
}, },
cardSavable:function(card,player){ cardSavable:function(card,player){
if(player.getStorage('yjxiandao_block').contains(get.suit(card))) return false; if(player.getStorage('yjxiandao_block').includes(get.suit(card))) return false;
}, },
}, },
mark:true, mark:true,
@ -3902,7 +3956,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.getParent('yjyibing').player==player) return false; if(event.getParent('yjyibing').player==player) return false;
var evt=event.getParent('phaseDraw'),hs=player.getCards('h'),cards=event.getg(player); var evt=event.getParent('phaseDraw'),hs=player.getCards('h'),cards=event.getg(player);
return cards.length>0&&(!evt||evt.player!=player)&&cards.filter(function(card){ return cards.length>0&&(!evt||evt.player!=player)&&cards.filter(function(card){
return hs.contains(card)&&game.checkMod(card,player,'unchanged','cardEnabled2',player)!==false; return hs.includes(card)&&game.checkMod(card,player,'unchanged','cardEnabled2',player)!==false;
}).length==cards.length&&player.hasUseTarget({ }).length==cards.length&&player.hasUseTarget({
name:'sha', name:'sha',
cards:event.cards, cards:event.cards,
@ -4238,7 +4292,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'是否对'+get.translation(player)+'使用一张杀?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'是否对'+get.translation(player)+'使用一张杀?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.filterTarget.apply(this,arguments); return lib.filter.filterTarget.apply(this,arguments);
}).set('sourcex',player); }).set('sourcex',player);
}, },
@ -4411,7 +4465,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
var evt=event.getParent(); var evt=event.getParent();
if(evt.name!='orderingDiscard'||!evt.relatedEvent||evt.relatedEvent.player!=player||!['useCard','respond'].contains(evt.relatedEvent.name)) return false; if(evt.name!='orderingDiscard'||!evt.relatedEvent||evt.relatedEvent.player!=player||!['useCard','respond'].includes(evt.relatedEvent.name)) return false;
return event.cards.filterInD('d').length>0; return event.cards.filterInD('d').length>0;
} }
}, },
@ -4434,7 +4488,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dialog.push(cards2); dialog.push(cards2);
} }
player.chooseButton(dialog,true,cards.length).set('filterButton',function(button){ player.chooseButton(dialog,true,cards.length).set('filterButton',function(button){
return _status.event.cards.contains(button.link); return _status.event.cards.includes(button.link);
}).set('cards',cards); }).set('cards',cards);
} }
'step 2' 'step 2'
@ -4852,7 +4906,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
//护驾 //护驾
else if(!player.hasShan()&&game.hasPlayer(function(current){ else if(!player.hasShan()&&game.hasPlayer(function(current){
return current!=player&&current.group=='wei'&&current.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; return current!=player&&current.group=='wei'&&current.mayHaveShan(player,'respond')&&get.attitude(player,current)>0&&get.attitude(current,player)>0;
})) return 1; })) return 1;
return -1; return -1;
}); });
@ -4886,7 +4940,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
//护驾 //护驾
else if(!player.hasShan()&&game.hasPlayer(function(current){ else if(!player.hasShan()&&game.hasPlayer(function(current){
return current!=player&&current.group=='wei'&&current.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; return current!=player&&current.group=='wei'&&current.mayHaveShan(player,'respond')&&get.attitude(player,current)>0&&get.attitude(current,player)>0;
})) return 'hujia'; })) return 'hujia';
}); });
} }
@ -4914,7 +4968,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 0" "step 0"
player.chooseTarget(get.prompt('sphuangen'), player.chooseTarget(get.prompt('sphuangen'),
[1,Math.min(player.hp,trigger.targets.length)],function(card,player,target){ [1,Math.min(player.hp,trigger.targets.length)],function(card,player,target){
return _status.event.targets.contains(target); return _status.event.targets.includes(target);
}).set('ai',function(target){ }).set('ai',function(target){
return -get.effect(target,trigger.card,trigger.player,_status.event.player); return -get.effect(target,trigger.card,trigger.player,_status.event.player);
}).set('targets',trigger.targets); }).set('targets',trigger.targets);
@ -5271,13 +5325,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
var hs=player.getCards('h'); var hs=player.getCards('h');
return event.type!='xinmanjuan'&&event.getg(player).filter(function(card){ return event.type!='xinmanjuan'&&event.getg(player).filter(function(card){
return hs.contains(card); return hs.includes(card);
}).length>0; }).length>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"
var hs=player.getCards('h'),cards=trigger.getg(player).filter(function(card){ var hs=player.getCards('h'),cards=trigger.getg(player).filter(function(card){
return hs.contains(card); return hs.includes(card);
}); });
event.cards=cards; event.cards=cards;
event.rawCards=cards.slice(0); event.rawCards=cards.slice(0);
@ -5289,7 +5343,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var number=get.number(event.card); var number=get.number(event.card);
for(var i=0;i<ui.discardPile.childNodes.length;i++){ for(var i=0;i<ui.discardPile.childNodes.length;i++){
var current=ui.discardPile.childNodes[i]; var current=ui.discardPile.childNodes[i];
if((!event.rawCards.contains(current))&&get.number(current)==number) event.togain.push(current); if((!event.rawCards.includes(current))&&get.number(current)==number) event.togain.push(current);
} }
if(!event.togain.length) event.goto(4); if(!event.togain.length) event.goto(4);
"step 2" "step 2"

View File

@ -281,7 +281,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(!player.countCards('he')) return false; if(!player.countCards('he')) return false;
if(!event.source||event.source==player||!event.source.isIn()) return false; if(!event.source||event.source==player||!event.source.isIn()) return false;
if(player.storage.oldhuisheng&&player.storage.oldhuisheng.contains(event.source)) return false; if(player.storage.oldhuisheng&&player.storage.oldhuisheng.includes(event.source)) return false;
return true; return true;
}, },
init:function(player){ init:function(player){
@ -363,7 +363,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audioname:['re_liubiao'], audioname:['re_liubiao'],
trigger:{player:'phaseDrawBegin2'}, trigger:{player:'phaseDrawBegin2'},
check:function(event,player){ check:function(event,player){
return (player.countCards('h')<=2&&player.getDamagedHp()>=2)||player.skipList.contains('phaseUse'); return (player.countCards('h')<=2&&player.getDamagedHp()>=2)||player.skipList.includes('phaseUse');
}, },
filter:function(event,player){ filter:function(event,player){
return !event.numFixed&&player.isDamaged(); return !event.numFixed&&player.isDamaged();
@ -419,7 +419,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},get.prompt2('oldjiefan')).set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },get.prompt2('oldjiefan')).set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.currentPhase&&!ui.selected.targets.contains(_status.currentPhase)) return false; if(target!=_status.currentPhase&&!ui.selected.targets.includes(_status.currentPhase)) return false;
return lib.filter.filterTarget.apply(this,arguments); return lib.filter.filterTarget.apply(this,arguments);
}).set('logSkill','oldjiefan').set('oncard',function(){ }).set('logSkill','oldjiefan').set('oncard',function(){
_status.event.player.addTempSkill('oldjiefan_recover'); _status.event.player.addTempSkill('oldjiefan_recover');
@ -521,7 +521,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
enable:['chooseToUse','chooseToRespond'], enable:['chooseToUse','chooseToRespond'],
hiddenCard:function(player,name){ hiddenCard:function(player,name){
return (lib.inpile.contains(name)&&player.countCards('hs')>0); return (lib.inpile.includes(name)&&player.countCards('hs')>0);
}, },
filter:function(event,player){ filter:function(event,player){
if(!player.countCards('hs')) return false; if(!player.countCards('hs')) return false;
@ -571,11 +571,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(typeof savable=='function') savable=savable(card,player,player); if(typeof savable=='function') savable=savable(card,player,player);
return savable; return savable;
},'hs')){ },'hs')){
if(!player.getStorage('old_guhuo_cheated').contains(card.name+card.nature)&&Math.random()<0.4) return 1; if(!player.getStorage('old_guhuo_cheated').includes(card.name+card.nature)&&Math.random()<0.4) return 1;
return 0; return 0;
} }
var val=_status.event.getParent().type=='phase'?player.getUseValue(card):1; var val=_status.event.getParent().type=='phase'?player.getUseValue(card):1;
if(player.getStorage('old_guhuo_cheated').contains(card.name+card.nature)&&!player.hasCard(function(cardx){ if(player.getStorage('old_guhuo_cheated').includes(card.name+card.nature)&&!player.hasCard(function(cardx){
if(card.name==cardx.name){ if(card.name==cardx.name){
if(card.name!='sha') return true; if(card.name!='sha') return true;
return get.is.sameNature(card,cardx); return get.is.sameNature(card,cardx);
@ -627,7 +627,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
var cardx=lib.skill.old_guhuo_backup.viewAs; var cardx=lib.skill.old_guhuo_backup.viewAs;
if(enemyNum){ if(enemyNum){
if(card.name==cardx.name&&(card.name!='sha'||get.is.sameNature(card,cardx))||player.getStorage('old_guhuo_cheated').contains(card.name+card.nature)) return (get.suit(card)=='heart'?8:4)+Math.random()*3; if(card.name==cardx.name&&(card.name!='sha'||get.is.sameNature(card,cardx))||player.getStorage('old_guhuo_cheated').includes(card.name+card.nature)) return (get.suit(card)=='heart'?8:4)+Math.random()*3;
else if(lib.skill.old_guhuo_backup.aiUse<0.5&&!player.isDying()) return 0; else if(lib.skill.old_guhuo_backup.aiUse<0.5&&!player.isDying()) return 0;
} }
return get.value(cardx)-get.value(card); return get.value(cardx)-get.value(card);
@ -777,7 +777,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(eff<-7) return (Math.random()+Math.pow(-(eff+7)/8,2))/Math.sqrt(evt.betrayers.length+1)+(player.hp-3)*0.05+Math.max(0,4-evt.player.hp)*0.05-(player.hp==1&&!get.tag(card,'damage')?0.2:0); if(eff<-7) return (Math.random()+Math.pow(-(eff+7)/8,2))/Math.sqrt(evt.betrayers.length+1)+(player.hp-3)*0.05+Math.max(0,4-evt.player.hp)*0.05-(player.hp==1&&!get.tag(card,'damage')?0.2:0);
return Math.pow((get.value(card,evt.player,'raw')-4)/(eff==0?3.1:10),2)/Math.sqrt(evt.betrayers.length||1)+(player.hp-3)*0.05+Math.max(0,4-evt.player.hp)*0.05; return Math.pow((get.value(card,evt.player,'raw')-4)/(eff==0?3.1:10),2)/Math.sqrt(evt.betrayers.length||1)+(player.hp-3)*0.05+Math.max(0,4-evt.player.hp)*0.05;
} }
if(evt.player.getStorage('old_guhuo_cheated').contains(card.name+card.nature)) return Math.random()+0.3; if(evt.player.getStorage('old_guhuo_cheated').includes(card.name+card.nature)) return Math.random()+0.3;
} }
return Math.random(); return Math.random();
}); });
@ -921,7 +921,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
var winners=player.getFriends(); var winners=player.getFriends();
game.over(player==game.me||winners.contains(game.me)); game.over(player==game.me||winners.includes(game.me));
}, },
}, },
oldanxu:{ oldanxu:{

View File

@ -5,13 +5,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
connect:true, connect:true,
character:{ character:{
ol_sb_jiangwei:['male','shu',4,['olsbzhuri','olsbranji']], ol_sb_jiangwei:['male','shu',4,['olsbzhuri','olsbranji']],
ol_caozhang:['male','wei',4,['oljiangchi']], ol_caozhang:['male','wei',4,['oljiangchi'],['die_audio:xin_caozhang']],
ol_jianyong:['male','shu',3,['olqiaoshui','jyzongshi'],['tempname:re_jianyong','die_audio:re_jianyong']], ol_jianyong:['male','shu',3,['olqiaoshui','jyzongshi'],['tempname:re_jianyong','die_audio:re_jianyong']],
ol_lingtong:['male','wu',4,['olxuanfeng'],['die_audio:re_lingtong']], ol_lingtong:['male','wu',4,['olxuanfeng'],['die_audio:re_lingtong']],
}, },
characterSort:{ characterSort:{
onlyOL:{ onlyOL:{
onlyOL_yijiang1:['ol_caozhang','ol_jianyong','ol_lingtong'], onlyOL_yijiang1:['ol_jianyong','ol_lingtong'],
onlyOL_yijiang2:['ol_caozhang'],
onlyOL_sb:['ol_sb_jiangwei'], onlyOL_sb:['ol_sb_jiangwei'],
}, },
}, },
@ -139,7 +140,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
]).set('ai',()=>{ ]).set('ai',()=>{
var player=_status.event.player; var player=_status.event.player;
var list=_status.event.list; var list=_status.event.list;
var num1=get.effect(player,{name:'wuzhong'},player,player)/2; var num1=get.effect(player,{name:'draw'},player,player);
var num2=get.recoverEffect(player,player,player); var num2=get.recoverEffect(player,player,player);
return num1*list[0]>num2*list[1]?0:1; return num1*list[0]>num2*list[1]?0:1;
}).set('list',[-num1,player.getDamagedHp()]); }).set('list',[-num1,player.getDamagedHp()]);
@ -185,7 +186,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
//界曹彰 //界曹彰
oljiangchi:{ oljiangchi:{
audio:2, audio:'rejiangchi',
trigger:{player:'phaseDrawEnd'}, trigger:{player:'phaseDrawEnd'},
direct:true, direct:true,
content:function*(event,map){ content:function*(event,map){
@ -355,6 +356,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
kunfenx_info:'结束阶段开始时你可以失去1点体力然后摸两张牌。', kunfenx_info:'结束阶段开始时你可以失去1点体力然后摸两张牌。',
onlyOL_yijiang1:'OL专属·将1', onlyOL_yijiang1:'OL专属·将1',
onlyOL_yijiang2:'OL专属·将2',
onlyOL_sb:'OL专属·上兵伐谋', onlyOL_sb:'OL专属·上兵伐谋',
}, },
}; };

View File

@ -106,7 +106,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
delete player.storage.woliu2; delete player.storage.woliu2;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
var current=game.players[i]; var current=game.players[i];
if(Array.isArray(current.storage.woliu2)&&current.storage.woliu2.contains(player)){ if(Array.isArray(current.storage.woliu2)&&current.storage.woliu2.includes(player)){
current.storage.woliu2.remove(player); current.storage.woliu2.remove(player);
current.updateMarks(); current.updateMarks();
} }
@ -114,11 +114,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filter:function(event,player){ filter:function(event,player){
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
if(!event.targets.contains(player)) return false; if(!event.targets.includes(player)) return false;
if(!player.storage.woliu2) return false; if(!player.storage.woliu2) return false;
for(var i=0;i<player.storage.woliu2.length;i++){ for(var i=0;i<player.storage.woliu2.length;i++){
var current=player.storage.woliu2[i]; var current=player.storage.woliu2[i];
if(current.isIn()&&event.player!=current&&!event.targets.contains(current)){ if(current.isIn()&&event.player!=current&&!event.targets.includes(current)){
return true; return true;
} }
} }
@ -131,7 +131,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=[]; var list=[];
for(var i=0;i<player.storage.woliu2.length;i++){ for(var i=0;i<player.storage.woliu2.length;i++){
var current=player.storage.woliu2[i]; var current=player.storage.woliu2[i];
if(current.isIn()&&trigger.player!=current&&!trigger.targets.contains(current)){ if(current.isIn()&&trigger.player!=current&&!trigger.targets.includes(current)){
list.push(current); list.push(current);
} }
} }
@ -155,7 +155,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card.name=='sha'&&target.storage.woliu2){ if(card.name=='sha'&&target.storage.woliu2){
_status.woliu2_temp=true; _status.woliu2_temp=true;
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
if(current!=player&&current!=target&&target.storage.woliu2.contains(current)){ if(current!=player&&current!=target&&target.storage.woliu2.includes(current)){
return get.sgn(get.effect(current,card,player,target)); return get.sgn(get.effect(current,card,player,target));
} }
}); });
@ -1260,7 +1260,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCard'}, trigger:{player:'useCard'},
check:function(event,player){ check:function(event,player){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(event.targets.contains(current)==false&&current!=player&& if(event.targets.includes(current)==false&&current!=player&&
lib.filter.targetEnabled(event.card,player,current)){ lib.filter.targetEnabled(event.card,player,current)){
return get.effect(current,event.card,player,player); return get.effect(current,event.card,player,player);
} }
@ -1269,13 +1269,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return (event.targets.contains(current)==false&&current!=player&& return (event.targets.includes(current)==false&&current!=player&&
lib.filter.targetEnabled(event.card,player,current)); lib.filter.targetEnabled(event.card,player,current));
}); });
}, },
content:function(){ content:function(){
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return (trigger.targets.contains(current)==false&&current!=player&& return (trigger.targets.includes(current)==false&&current!=player&&
lib.filter.targetEnabled(trigger.card,player,current)); lib.filter.targetEnabled(trigger.card,player,current));
}); });
if(list.length){ if(list.length){
@ -1306,7 +1306,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
tiandan:{ tiandan:{
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
filter:function(event,player){ filter:function(event,player){
return Math.min(5,player.hp)>player.countCards('h')&&!player.skipList.contains('phaseUse')&&!player.skipList.contains('phaseDiscard'); return Math.min(5,player.hp)>player.countCards('h')&&!player.skipList.includes('phaseUse')&&!player.skipList.includes('phaseDiscard');
}, },
check:function(event,player){ check:function(event,player){
var nh=player.countCards('h'); var nh=player.countCards('h');
@ -1638,7 +1638,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.attitude(player,min[i])>0) return 0; if(get.attitude(player,min[i])>0) return 0;
if(min[i].countCards('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0; if(min[i].countCards('h')<=1&&get.distance(player,min[i],'attack')<=1) return 0;
} }
if(min.contains(target)) return -1; if(min.includes(target)) return -1;
return 0; return 0;
} }
} }
@ -1767,7 +1767,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
targetInRange:function(card,player,target){ targetInRange:function(card,player,target){
if(target.hasSkill('juji3')&&Array.isArray(target.storage.juji3)&&target.storage.juji3.contains(player)){ if(target.hasSkill('juji3')&&Array.isArray(target.storage.juji3)&&target.storage.juji3.includes(player)){
return true; return true;
} }
} }
@ -1783,7 +1783,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
targetInRange:function(card,player,target){ targetInRange:function(card,player,target){
if(Array.isArray(player.storage.juji3)&&player.storage.juji3.contains(target)){ if(Array.isArray(player.storage.juji3)&&player.storage.juji3.includes(target)){
return true; return true;
} }
} }

View File

@ -126,6 +126,9 @@ window.noname_character_rank={
'jsrg_pangtong', 'jsrg_pangtong',
'star_caoren', 'star_caoren',
'clan_xunyou', 'clan_xunyou',
'caoxian',
'sb_guanyu',
'mb_chengui',
], ],
a:[ a:[
'diy_zaozhirenjun', 'diy_zaozhirenjun',
@ -644,6 +647,7 @@ window.noname_character_rank={
'dc_dongzhao', 'dc_dongzhao',
'zhugeruoxue', 'zhugeruoxue',
'dc_sb_lusu', 'dc_sb_lusu',
'mb_huban',
], ],
bp:[ bp:[
'chess_diaochan', 'chess_diaochan',
@ -1810,8 +1814,10 @@ window.noname_character_rank={
'shichangshi', 'shichangshi',
'dc_guansuo', 'dc_guansuo',
'dc_xujing', 'dc_xujing',
'caoxian',
], ],
epic:[ epic:[
'mb_chengui',
'ol_pengyang', 'ol_pengyang',
'ol_luyusheng', 'ol_luyusheng',
'clan_xunchen', 'clan_xunchen',
@ -2081,6 +2087,8 @@ window.noname_character_rank={
'dc_sb_zhouyu', 'dc_sb_zhouyu',
], ],
rare:[ rare:[
'mb_huban',
'sp_jianggan',
'ol_caozhang', 'ol_caozhang',
'ol_lingtong', 'ol_lingtong',
'luoxian', 'luoxian',

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
name:'sb', name:'sb',
connect:true, connect:true,
character:{ character:{
sb_guanyu:['male','shu',4,['sbwusheng','sbyijue']],
sb_huangyueying:['female','shu',3,['sbjizhi','sbqicai']], sb_huangyueying:['female','shu',3,['sbjizhi','sbqicai']],
sb_sp_zhugeliang:['male','shu',3,['sbhuoji','sbkanpo']], sb_sp_zhugeliang:['male','shu',3,['sbhuoji','sbkanpo']],
sb_zhugeliang:['male','shu',3,['sbguanxing','sbkongcheng'],['unseen']], sb_zhugeliang:['male','shu',3,['sbguanxing','sbkongcheng']],
sb_zhanghe:['male','wei',4,['sbqiaobian']], sb_zhanghe:['male','wei',4,['sbqiaobian']],
sb_yujin:['male','wei',4,['sbxiayuan','sbjieyue']], sb_yujin:['male','wei',4,['sbxiayuan','sbjieyue']],
sb_huaxiong:['male','qun','3/4/1',['new_reyaowu','sbyangwei']], sb_huaxiong:['male','qun','3/4/1',['new_reyaowu','sbyangwei']],
@ -46,7 +47,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
characterSort:{ characterSort:{
sb:{ sb:{
sb_zhi:['sb_sunquan','sb_zhouyu','sb_zhangjiao','sb_caocao','sb_zhenji','sb_liubei','sb_daqiao','sb_liubiao','sb_sp_zhugeliang'], sb_zhi:['sb_sunquan','sb_zhouyu','sb_zhangjiao','sb_caocao','sb_zhenji','sb_liubei','sb_daqiao','sb_liubiao','sb_sp_zhugeliang','sb_zhugeliang'],
sb_shi:['sb_xuhuang','sb_machao','sb_fazheng','sb_chengong','sb_diaochan','sb_pangtong','sb_zhanghe'], sb_shi:['sb_xuhuang','sb_machao','sb_fazheng','sb_chengong','sb_diaochan','sb_pangtong','sb_zhanghe'],
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'],
@ -54,6 +55,186 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
skill:{ skill:{
//关羽
//矢
sbwusheng:{
audio:3,
trigger:{player:'phaseUseBegin'},
filter:function(event,player){
return game.hasPlayer(target=>target!=player&&!target.isZhu2());
},
direct:true,
content:function*(event,map){
var player=map.player;
var result=yield player.chooseTarget(get.prompt('sbwusheng'),'选择一名非主公的其他角色,本阶段对其使用【杀】无距离和次数限制,使用【杀】指定其为目标后摸一张牌,对其使用五张【杀】后不能对其使用【杀】',(card,player,target)=>{
return target!=player&&!target.isZhu2();
}).set('ai',target=>{
var player=_status.event.player;
return get.effect(target,{name:'sha'},player,player);
});
if(result.bool){
var target=result.targets[0];
player.logSkill('sbwusheng',target);
player.addTempSkill('sbwusheng_effect',{player:'phaseUseAfter'});
player.storage.sbwusheng_effect[target.playerid]=0;
}
},
group:'sbwusheng_wusheng',
subSkill:{
wusheng:{
audio:'sbwusheng',
enable:['chooseToUse','chooseToRespond'],
hiddenCard:function(player,name){
return name=='sha'&&player.countCards('hs');
},
filter:function(event,player){
return event.filterCard({name:'sha'},player,event)||lib.inpile_nature.some(nature=>event.filterCard({name:'sha',nature:nature},player,event));
},
chooseButton:{
dialog:function(event,player){
var list=[];
if(event.filterCard({name:'sha'},player,event)) list.push(['基本','','sha']);
for(var j of lib.inpile_nature){
if(event.filterCard({name:'sha',nature:j},player,event)) list.push(['基本','','sha',j]);
}
var dialog=ui.create.dialog('武圣',[list,'vcard'],'hidden');
dialog.direct=true;
return dialog;
},
check:function(button){
var player=_status.event.player;
var card={name:button.link[2],nature:button.link[3]};
if(_status.event.getParent().type=='phase'&&game.hasPlayer(function(current){
return player.canUse(card,current)&&get.effect(current,card,player,player)>0;
})){
switch (button.link[2]){
case 'sha':
if(button.link[3]=='fire') return 2.95;
else if(button.link[3]=='thunder'||button.link[3]=='ice') return 2.92;
else return 2.9;
}
}
return 1+Math.random();
},
backup:function(links,player){
return {
audio:'sbwusheng',
filterCard:true,
check:function(card){
return 6-get.value(card);
},
viewAs:{name:links[0][2],nature:links[0][3]},
position:'hs',
popname:true,
}
},
prompt:function(links,player){
return '将一张手牌当作'+get.translation(links[0][3]||'')+'【'+get.translation(links[0][2])+'】'+(_status.event.name=='chooseToUse'?'使用':'打出');
},
},
ai:{
respondSha:true,
fireAttack:true,
skillTagFilter:function(player,tag){
if(!player.countCards('hs')) return false;
},
order:function(item,player){
if(player&&_status.event.type=='phase'){
var max=0;
if(lib.inpile_nature.some(i=>player.getUseValue({name:'sha',nature:i})>0)){
var temp=get.order({name:'sha'});
if(temp>max) max=temp;
}
if(max>0) max+=0.3;
return max;
}
return 4;
},
result:{player:1},
},
},
effect:{
charlotte:true,
onremove:true,
init:function(player){
if(!player.storage.sbwusheng_effect) player.storage.sbwusheng_effect={};
},
mod:{
targetInRange:function(card,player,target){
if(card.name=='sha'&&typeof player.storage.sbwusheng_effect[target.playerid]=='number') return true;
},
cardUsableTarget:function(card,player,target){
if(card.name=='sha'&&typeof player.storage.sbwusheng_effect[target.playerid]=='number') return true;
},
playerEnabled:function(card,player,target){
if(card.name!='sha'||typeof player.storage.sbwusheng_effect[target.playerid]!='number') return;
if(player.storage.sbwusheng_effect[target.playerid]>=5) return false;
},
},
audio:'sbwusheng',
trigger:{player:['useCardToPlayered','useCardAfter']},
filter:function(event,player){
if(event.card.name!='sha') return false;
if(event.name=='useCard') return event.targets.some(target=>typeof player.storage.sbwusheng_effect[target.playerid]=='number');
return typeof player.storage.sbwusheng_effect[event.target.playerid]=='number';
},
direct:true,
content:function(){
if(trigger.name=='useCard'){
var targets=trigger.targets.filter(target=>typeof player.storage.sbwusheng_effect[target.playerid]=='number');
targets.forEach(target=>player.storage.sbwusheng_effect[target.playerid]++);
}
else{
player.logSkill('sbwusheng_effect',trigger.target);
player.draw();
}
},
},
},
ai:{threaten:114514},
},
sbyijue:{
audio:2,
trigger:{source:'damageBegin3'},
filter:function(event,player){
return event.num>=event.player.hp&&!player.getStorage('sbyijue').includes(event.player);
},
forced:true,
logTarget:'player',
content:function(){
trigger.cancel();
player.addTempSkill('sbyijue_effect');
player.markAuto('sbyijue',[trigger.player]);
player.markAuto('sbyijue_effect',[trigger.player]);
},
marktext:'绝',
intro:{content:'已放$一马'},
subSkill:{
effect:{
charlotte:true,
onremove:true,
audio:'sbyijue',
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return player.getStorage('sbyijue_effect').includes(event.target);
},
forced:true,
logTarget:'target',
content:function(){
trigger.getParent().excluded.add(trigger.target);
},
ai:{
effect:{
player:function(card,player,target){
if(player.getStorage('sbyijue_effect').includes(target)) return 'zeroplayertarget';
},
},
},
marktext:'义',
intro:{content:'本回合放$一马'},
},
},
},
//黄月英 //黄月英
sbqicai:{ sbqicai:{
mod:{ mod:{
@ -274,44 +455,48 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
//诸葛亮 //诸葛亮
sbhuoji:{ sbhuoji:{
audio:2, audio:3,
enable:'phaseUse', dutySkill:true,
filterTarget:lib.filter.notMe, derivation:['sbguanxing','sbkongcheng'],
prompt:'选择一名其他角色对其与其势力相同的所有其他角色各造成1点火属性伤害', group:['sbhuoji_fire','sbhuoji_achieve','sbhuoji_fail','sbhuoji_mark'],
usable:1, subSkill:{
line:'fire', fire:{
content:function(){ audio:'sbhuoji1',
'step 0' enable:'phaseUse',
target.damage('fire'); filterTarget:lib.filter.notMe,
'step 1' prompt:'选择一名其他角色对其与其势力相同的所有其他角色各造成1点火属性伤害',
var targets=game.filterPlayer(current=>{ usable:1,
if(current==player||current==target) return false; line:'fire',
return current.group==target.group; content:function(){
}); 'step 0'
if(targets.length){ target.damage('fire');
game.delayx(); 'step 1'
player.line(targets,'fire'); var targets=game.filterPlayer(current=>{
targets.forEach(i=>i.damage('fire')); if(current==player||current==target) return false;
}
},
ai:{
order:7,
fireAttack:true,
result:{
target:function(player,target){
var att=get.attitude(player,target);
return get.sgn(att)*game.filterPlayer(current=>{
if(current==player) return false;
return current.group==target.group; return current.group==target.group;
}).reduce((num,current)=>num+get.damageEffect(current,player,player,'fire'),0); });
if(targets.length){
game.delayx();
player.line(targets,'fire');
targets.forEach(i=>i.damage('fire'));
}
},
ai:{
order:7,
fireAttack:true,
result:{
target:function(player,target){
var att=get.attitude(player,target);
return get.sgn(att)*game.filterPlayer(current=>{
if(current==player) return false;
return current.group==target.group;
}).reduce((num,current)=>num+get.damageEffect(current,player,player,'fire'),0);
},
},
}, },
}, },
},
derivation:['sbguanxing','sbkongcheng'],
group:['sbhuoji_achieve','sbhuoji_fail','sbhuoji_mark'],
subSkill:{
achieve:{ achieve:{
audio:'sbhuoji', audio:'sbhuoji2',
trigger:{player:'phaseZhunbeiBegin'}, trigger:{player:'phaseZhunbeiBegin'},
filter:function(event,player){ filter:function(event,player){
return player.getAllHistory('sourceDamage',evt=>evt.hasNature('fire')).reduce((num,evt)=>num+evt.num,0)>=game.players.length+game.dead.length; return player.getAllHistory('sourceDamage',evt=>evt.hasNature('fire')).reduce((num,evt)=>num+evt.num,0)>=game.players.length+game.dead.length;
@ -335,7 +520,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
fail:{ fail:{
audio:'sbhuoji', audio:'sbhuoji3',
trigger:{player:'dying'}, trigger:{player:'dying'},
forced:true, forced:true,
locked:false, locked:false,
@ -365,20 +550,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
}, },
sbhuoji1:{audio:true},
sbhuoji2:{audio:true},
sbhuoji3:{audio:true},
sbkanpo:{ sbkanpo:{
init:function(player){
if(!player.storage.sbkanpo){
player.storage.sbkanpo=[10,[],[]];
player.markSkill('sbkanpo');
}
},
audio:2, audio:2,
trigger:{global:'roundStart'}, trigger:{global:'roundStart'},
filter:function(event,player){
var storage=player.storage.sbkanpo;
return storage[0]||storage[1].length;
},
forced:true, forced:true,
locked:false, locked:false,
get getNumber(){
return 3;
},
content:function*(event,map){ content:function*(event,map){
var player=map.player; var player=map.player,storage=player.storage.sbkanpo;
var storage=player.getStorage('sbkanpo').slice(); var sum=storage[0];
if(storage.length){ storage[1]=[];
player.unmarkAuto('sbkanpo',storage); player.markSkill('sbkanpo');
} if(!sum) return;
const list=get.inpileVCardList(info=>{ const list=get.inpileVCardList(info=>{
if(info[2]=='sha'&&info[3]) return false; if(info[2]=='sha'&&info[3]) return false;
return info[0]!='equip'; return info[0]!='equip';
@ -411,7 +606,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}; };
if(event.isMine()) func(); if(event.isMine()) func();
else if(event.isOnline()) event.player.send(func); else if(event.isOnline()) event.player.send(func);
var result=yield player.chooseButton(['看破:是否记录三个牌名?',[list,'vcard']],[1,3],true).set('ai',function(button){ var result=yield player.chooseButton(['看破:是否记录至多'+get.cnNumber(sum)+'个牌名?',[list,'vcard']],[1,sum],true).set('ai',function(button){
if(ui.selected.buttons.length>=Math.max(3,game.countPlayer()/2)) return 0;
switch(button.link[2]){ switch(button.link[2]){
case 'wuxie':return 5+Math.random(); case 'wuxie':return 5+Math.random();
case 'sha':return 5+Math.random(); case 'sha':return 5+Math.random();
@ -427,7 +623,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}).set('filterButton',button=>{ }).set('filterButton',button=>{
return !_status.event.names.includes(button.link[2]); return !_status.event.names.includes(button.link[2]);
}).set('names',storage).set('custom',{ }).set('names',storage[2]).set('custom',{
add:{ add:{
confirm:function(bool){ confirm:function(bool){
if(bool!=true) return; if(bool!=true) return;
@ -481,24 +677,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
if(result.bool){ if(result.bool){
var names=result.links.map(link=>link[2]); var names=result.links.map(link=>link[2]);
player.setStorage('sbkanpo',names); storage[0]-=names.length;
player.markSkill('sbkanpo'); storage[1]=names;
storage[2]=names;
} }
else storage[2]=[];
player.markSkill('sbkanpo');
}, },
marktext:'破', marktext:'破',
intro:{ intro:{
markcount:function(storage,player){ markcount:function(storage,player){
if(player.isUnderControl(true)) return storage.length; if(player.isUnderControl(true)) return storage[1].length;
return '?'; return '?';
}, },
mark:function(dialog,content,player){ mark:function(dialog,content,player){
if(player.isUnderControl(true)){ if(player.isUnderControl(true)){
const storage=player.getStorage('sbkanpo'); const storage=player.getStorage('sbkanpo');
dialog.addText('已记录牌名:'); const sum=storage[0];
dialog.addSmall([storage,'vcard']); const names=storage[1];
} dialog.addText('剩余可记录'+sum+'次牌名');
else{ if(names.length){
return `${get.translation(player)}记录了一些牌名`; dialog.addText('已记录牌名:');
dialog.addSmall([names,'vcard']);
}
} }
}, },
}, },
@ -535,9 +736,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
logTarget:'player', logTarget:'player',
content:function(){ content:function(){
player.unmarkAuto('sbkanpo',[trigger.card.name]); player.storage.sbkanpo[1].remove(trigger.card.name);
player.markSkill('sbkanpo');
trigger.targets.length=0; trigger.targets.length=0;
trigger.all_excluded=true; trigger.all_excluded=true;
player.draw();
}, },
}, },
}, },
@ -546,7 +749,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
trigger:{player:['phaseZhunbeiBegin','phaseJieshuBegin']}, trigger:{player:['phaseZhunbeiBegin','phaseJieshuBegin']},
filter:function(event,player){ filter:function(event,player){
return event.name=='phaseZhunbei'||(player.hasSkill('sbguanxing_on')&&player.countCards('s',card=>card.hasGaintag('sbguanxing'))); var bool=player.hasCard(card=>card.hasGaintag('sbguanxing'),'s');
if(event.name=='phaseZhunbei'){
var num=player.countMark('sbguanxingx');
return bool||num<=3;
}
return bool&&player.hasSkill('sbguanxing_on');
}, },
forced:true, forced:true,
locked:false, locked:false,
@ -556,16 +764,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.goto(2); event.goto(2);
return; return;
} }
player.addMark('sbguanxingx',1,false);
var cards=player.getCards('s',card=>card.hasGaintag('sbguanxing')); var cards=player.getCards('s',card=>card.hasGaintag('sbguanxing'));
if(cards.length) player.loseToDiscardpile(cards); if(cards.length) player.loseToDiscardpile(cards);
var bool=player.getAllHistory('useSkill',evt=>evt.skill=='sbguanxing').length>1; var num=player.countMark('sbguanxingx')-1;
event.num=Math.min(7,bool?cards.length+1:7); event.num=Math.max(0,7-2*num);
'step 1' 'step 1'
var cards2=get.cards(num); if(num){
player.$gain2(cards2,false); var cards2=get.cards(num);
game.log(player,'将',cards2,'置于了武将牌上'); player.$gain2(cards2,false);
player.loseToSpecial(cards2,'sbguanxing').visible=true; game.log(player,'将',cards2,'置于了武将牌上');
player.markSkill('sbguanxing'); player.loseToSpecial(cards2,'sbguanxing').visible=true;
player.markSkill('sbguanxing');
}
'step 2' 'step 2'
var cards=player.getCards('s',card=>card.hasGaintag('sbguanxing')); var cards=player.getCards('s',card=>card.hasGaintag('sbguanxing'));
if(cards.length){ if(cards.length){
@ -676,7 +887,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
marktext:'☯', marktext:'☯',
intro:{ intro:{
content:function(storage,player){ content:function(storage,player){
if(storage) return '你的回合外,一名角色使用或打出牌结算完成后,若此牌与“任”类别相同,则你可以令一名角色摸张牌。'; if(storage) return '你的回合外,一名角色使用或打出牌结算完成后,若此牌与“任”类别相同,则你可以令一名角色摸张牌。';
return '出牌阶段限一次你可以弃置一张与“任”颜色相同的牌并对攻击范围内的一名角色造成1点伤害。'; return '出牌阶段限一次你可以弃置一张与“任”颜色相同的牌并对攻击范围内的一名角色造成1点伤害。';
}, },
}, },
@ -706,7 +917,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(card){ check:function(card){
return 6.5-get.value(card); return 6.5-get.value(card);
}, },
prompt:'弃置与攻击范围内的一名角色体力值之差至少为1张与“任”颜色相同的牌对其造成1点伤害', prompt:'弃置与攻击范围内的一名角色体力值之差至少为1张与“任”颜色相同的牌对其造成1点伤害',
content:function(){ content:function(){
player.changeZhuanhuanji('sbzhenliang'); player.changeZhuanhuanji('sbzhenliang');
target.damage('nocard'); target.damage('nocard');
@ -732,7 +943,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('sbzhenliang'),'令一名角色摸张牌').set('ai',function(target){ player.chooseTarget(get.prompt('sbzhenliang'),'令一名角色摸张牌').set('ai',function(target){
if(target.hasSkillTag('nogain')) return 0.1; if(target.hasSkillTag('nogain')) return 0.1;
var att=get.attitude(player,target); var att=get.attitude(player,target);
return att*(Math.max(5-target.countCards('h'),2)+3); return att*(Math.max(5-target.countCards('h'),2)+3);
@ -742,7 +953,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0]; var target=result.targets[0];
player.changeZhuanhuanji('sbzhenliang'); player.changeZhuanhuanji('sbzhenliang');
player.logSkill('sbzhenliang',target); player.logSkill('sbzhenliang',target);
target.draw(); target.draw(2);
} }
}, },
}, },
@ -804,7 +1015,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.removeSkill(skills); target.removeSkill(skills);
num+=skills.length; num+=skills.length;
}); });
if(get.mode()=='versus'&&_status.mode=='two') num+=2; if(get.mode()=='versus'&&_status.mode=='two') num+=3;
player.draw(num); player.draw(num);
}, },
}, },
@ -829,11 +1040,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('sbtianxiang',target); player.logSkill('sbtianxiang',target);
var skills=target.getSkills().filter(skill=>skill.indexOf('sbtianxiang_')==0); var skills=target.getSkills().filter(skill=>skill.indexOf('sbtianxiang_')==0);
target.removeSkill(skills); target.removeSkill(skills);
if(skills.contains('sbtianxiang_heart')){ if(skills.includes('sbtianxiang_heart')){
target.damage(trigger.source?trigger.source:'nosource'); target.damage(trigger.source?trigger.source:'nosource');
trigger.cancel(); trigger.cancel();
} }
if(skills.contains('sbtianxiang_diamond')){ if(skills.includes('sbtianxiang_diamond')){
var cards=target.getCards('he'); var cards=target.getCards('he');
if(!cards.length) event.finish(); if(!cards.length) event.finish();
else if(cards.length<=2) event._result={bool:true,cards:cards}; else if(cards.length<=2) event._result={bool:true,cards:cards};
@ -1123,7 +1334,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'useCardAfter'}, trigger:{global:'useCardAfter'},
filter:function(event,player){ filter:function(event,player){
return event.card.name=='sha'&&event.card.storage&&event.card.storage.sblieren&&event.card.storage.sblieren[0]==player&&game.hasPlayer(current=>{ return event.card.name=='sha'&&event.card.storage&&event.card.storage.sblieren&&event.card.storage.sblieren[0]==player&&game.hasPlayer(current=>{
return !event.card.storage.sblieren.contains(current); return !event.card.storage.sblieren.includes(current);
}); });
}, },
direct:true, direct:true,
@ -1163,7 +1374,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
{name:'nanman',number:7,suit:'club'}, {name:'nanman',number:7,suit:'club'},
]; ];
game.broadcastAll(function(){ game.broadcastAll(function(){
if(!lib.inpile.contains('nanman')) lib.inpile.add('nanman'); if(!lib.inpile.includes('nanman')) lib.inpile.add('nanman');
}); });
} }
player.chooseTarget(get.prompt('sbjuxiang'),'将游戏外的随机一张【南蛮入侵】交给一名角色(剩余'+get.cnNumber(_status.sbjuxiang_nanman.length)+'张)').set('ai',target=>{ player.chooseTarget(get.prompt('sbjuxiang'),'将游戏外的随机一张【南蛮入侵】交给一名角色(剩余'+get.cnNumber(_status.sbjuxiang_nanman.length)+'张)').set('ai',target=>{
@ -1253,7 +1464,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(info.allowMultiple==false) return false; if(info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){ if(event.targets&&!info.multitarget){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current); return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current);
})){ })){
return true; return true;
} }
@ -1265,7 +1476,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var prompt2='为'+get.translation(trigger.card)+'额外指定一个目标然后失去1点体力'; var prompt2='为'+get.translation(trigger.card)+'额外指定一个目标然后失去1点体力';
player.chooseTarget(get.prompt('sbjiang_add'),function(card,player,target){ player.chooseTarget(get.prompt('sbjiang_add'),function(card,player,target){
var player=_status.event.player; var player=_status.event.player;
if(_status.event.targets.contains(target)) return false; if(_status.event.targets.includes(target)) return false;
return lib.filter.targetEnabled2(_status.event.card,player,target); return lib.filter.targetEnabled2(_status.event.card,player,target);
}).set('prompt2',prompt2).set('ai',function(target){ }).set('prompt2',prompt2).set('ai',function(target){
var trigger=_status.event.getTrigger(); var trigger=_status.event.getTrigger();
@ -1545,7 +1756,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
filter:function(event,player){ filter:function(event,player){
if(!event.source||!event.source.isIn()) return false; if(!event.source||!event.source.isIn()) return false;
return !player.getStorage('sbzongshi').contains(event.source); return !player.getStorage('sbzongshi').includes(event.source);
}, },
forced:true, forced:true,
onremove:true, onremove:true,
@ -1603,7 +1814,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
return 0; return 0;
}, },
selectTargetAi:function(event,player){ selectTargetAi:(event,player)=>{
let cache=_status.event.getTempCache('sblijian','targets'); let cache=_status.event.getTempCache('sblijian','targets');
if(Array.isArray(cache)) return cache.length; if(Array.isArray(cache)) return cache.length;
let targets=[],cards=[0],sbbiyue=player.hasSkill('sbbiyue')?Math.max(0,3-game.countPlayer2(current=>{ let targets=[],cards=[0],sbbiyue=player.hasSkill('sbbiyue')?Math.max(0,3-game.countPlayer2(current=>{
@ -1611,7 +1822,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})):0,alter=[null,1,1],temp; })):0,alter=[null,1,1],temp;
for(let i of game.players){ for(let i of game.players){
if(player===i) continue; if(player===i) continue;
temp=get.effect(i,new lib.element.VCard({name:'juedou',isCard:true}),get.copy(i),i); let vplayer=new lib.element.Player(i);
temp=get.effect(i,new lib.element.VCard({name:'juedou',isCard:true}),vplayer,i);
vplayer.remove();
if(temp){ if(temp){
let att=get.attitude(event.player,i); let att=get.attitude(event.player,i);
if(!att&&sbbiyue||att*temp>0) targets.push([i,temp,att]); if(!att&&sbbiyue||att*temp>0) targets.push([i,temp,att]);
@ -2012,14 +2225,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCard2'}, trigger:{player:'useCard2'},
filter:function(event,player){ filter:function(event,player){
return event.card.name=='tiesuo'&&player.storage.sblianhuan&&game.hasPlayer(current=>{ return event.card.name=='tiesuo'&&player.storage.sblianhuan&&game.hasPlayer(current=>{
return !event.targets.contains(current)&&player.canUse(event.card,current); return !event.targets.includes(current)&&player.canUse(event.card,current);
}); });
}, },
direct:true, direct:true,
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('sblianhuan_add'),'为'+get.translation(trigger.card)+'额外指定任意个目标',[1,Infinity],function(card,player,target){ player.chooseTarget(get.prompt('sblianhuan_add'),'为'+get.translation(trigger.card)+'额外指定任意个目标',[1,Infinity],function(card,player,target){
return !_status.event.sourcex.contains(target)&&player.canUse(_status.event.card,target); return !_status.event.sourcex.includes(target)&&player.canUse(_status.event.card,target);
}).set('sourcex',trigger.targets).set('ai',function(target){ }).set('sourcex',trigger.targets).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
return get.effect(target,_status.event.card,player,player); return get.effect(target,_status.event.card,player,player);
@ -2303,7 +2516,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'挑衅:对'+get.translation(player)+'使用一张杀,或交给其一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'挑衅:对'+get.translation(player)+'使用一张杀,或交给其一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',player); }).set('sourcex',player);
'step 1' 'step 1'
@ -2408,7 +2621,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
playerEnabled:function(card,player,target){ playerEnabled:function(card,player,target){
if(player!=target&&!player.getStorage('sbzhiji_beifa').contains(target)) return false; if(player!=target&&!player.getStorage('sbzhiji_beifa').includes(target)) return false;
} }
} }
}, },
@ -2594,7 +2807,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true; return true;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player.getStorage('sbrende_given').contains(target)) return false; if(player.getStorage('sbrende_given').includes(target)) return false;
return player!=target; return player!=target;
}, },
prompt:function(event){ prompt:function(event){
@ -2680,7 +2893,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target==player) return false; if(target==player) return false;
return player.getStorage('sbrende_givenx').contains(target); return player.getStorage('sbrende_givenx').includes(target);
}, },
selectTarget:[-1,-2], selectTarget:[-1,-2],
multiline:true, multiline:true,
@ -3204,8 +3417,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return _status.event.choice; return _status.event.choice;
}).set('choice',(function(){ }).set('choice',(function(){
var eff=0,eff2=0; var eff=0,eff2=0;
if(!list.contains('选项一')) eff=Infinity; if(!list.includes('选项一')) eff=Infinity;
if(!list.contains('选项二')) eff2=Infinity; if(!list.includes('选项二')) eff2=Infinity;
game.countPlayer(current=>{ game.countPlayer(current=>{
if(current.hp<player.hp){ if(current.hp<player.hp){
var effx=get.attitude(player,current)/Math.sqrt(Math.max(0.1,2*current.hp+current.countCards('h'))); var effx=get.attitude(player,current)/Math.sqrt(Math.max(0.1,2*current.hp+current.countCards('h')));
@ -3264,7 +3477,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 6' 'step 6'
player.chooseCardTarget({ player.chooseCardTarget({
filterCard:function(card,player,target){ filterCard:function(card,player,target){
return _status.event.getParent().cards.contains(card); return _status.event.getParent().cards.includes(card);
}, },
filterTarget:lib.filter.notMe, filterTarget:lib.filter.notMe,
selectCard:[1,event.cards.length], selectCard:[1,event.cards.length],
@ -3333,7 +3546,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(!arg||arg.isLink||!arg.card||arg.card.name!='sha') return false; if(!arg||arg.isLink||!arg.card||arg.card.name!='sha') return false;
if(!arg.target||get.attitude(player,arg.target)>=0) return false; if(!arg.target||get.attitude(player,arg.target)>=0) return false;
if(!arg.skill||!lib.skill[arg.skill]||lib.skill[arg.skill].charlotte||get.is.locked(arg.skill)||!arg.target.getSkills(true,false).contains(arg.skill)) return false; if(!arg.skill||!lib.skill[arg.skill]||lib.skill[arg.skill].charlotte||get.is.locked(arg.skill)||!arg.target.getSkills(true,false).includes(arg.skill)) return false;
}, },
directHit_ai:true, directHit_ai:true,
}, },
@ -3370,7 +3583,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
target.chooseControl(event.list).set('prompt','奇袭:猜测'+get.translation(player)+'手牌中最多的花色').set('ai',()=>{ target.chooseControl(event.list).set('prompt','奇袭:猜测'+get.translation(player)+'手牌中最多的花色').set('ai',()=>{
var player=_status.event.getParent().player,controls=_status.event.controls; var player=_status.event.getParent().player,controls=_status.event.controls;
if(player.countCards('h')<=3&&controls.contains('diamond')&&Math.random()<0.3) return 'diamond'; if(player.countCards('h')<=3&&controls.includes('diamond')&&Math.random()<0.3) return 'diamond';
return controls.randomGet(); return controls.randomGet();
}); });
'step 2' 'step 2'
@ -3380,7 +3593,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!event.isMine()&&!event.isOnline()) game.delayx(); if(!event.isMine()&&!event.isOnline()) game.delayx();
'step 3' 'step 3'
var control=result.control; var control=result.control;
if(!event.suits.contains(control)){ if(!event.suits.includes(control)){
player.chat('猜错了!'); player.chat('猜错了!');
game.log(target,'猜测','#y错误'); game.log(target,'猜测','#y错误');
event.num++; event.num++;
@ -3693,7 +3906,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(button.classList.contains('selectable')==false) return; if(button.classList.contains('selectable')==false) return;
var cards=_status.event.player.getCards('h',{suit:button.link[2].slice(6)}); var cards=_status.event.player.getCards('h',{suit:button.link[2].slice(6)});
if(cards.length){ if(cards.length){
var chosen=cards.filter(i=>ui.selected.cards.contains(i)).length==cards.length; var chosen=cards.filter(i=>ui.selected.cards.includes(i)).length==cards.length;
if(chosen){ if(chosen){
ui.selected.cards.removeArray(cards); ui.selected.cards.removeArray(cards);
cards.forEach(card=>{ cards.forEach(card=>{
@ -3734,7 +3947,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var cards=result.cards; var cards=result.cards;
if(!cards.length){ if(!cards.length){
var suits=result.links.map(i=>i[2].slice(6)); var suits=result.links.map(i=>i[2].slice(6));
cards=player.getCards('h',card=>suits.contains(get.suit(card,player))); cards=player.getCards('h',card=>suits.includes(get.suit(card,player)));
} }
event.cards=cards; event.cards=cards;
if(!cards.length) event.finish(); if(!cards.length) event.finish();
@ -3917,7 +4130,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.hasZhuSkill('sbhuangtian')) return false; if(!player.hasZhuSkill('sbhuangtian')) return false;
return !game.hasPlayer(function(current){ return !game.hasPlayer(function(current){
return current.countCards('hej','taipingyaoshu'); return current.countCards('hej','taipingyaoshu');
})&&!Array.from(ui.cardPile.childNodes).concat(Array.from(ui.discardPile.childNodes)).concat(Array.from(ui.ordering.childNodes)).map(i=>i.name).contains('taipingyaoshu'); })&&!Array.from(ui.cardPile.childNodes).concat(Array.from(ui.discardPile.childNodes)).concat(Array.from(ui.ordering.childNodes)).map(i=>i.name).includes('taipingyaoshu');
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -3964,7 +4177,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
trigger.source.chooseBool('樵拾:是否令'+get.translation(player)+'回复'+trigger.num+'点体力,然后你摸两张牌?').set('ai',()=>{ trigger.source.chooseBool('樵拾:是否令'+get.translation(player)+'回复'+trigger.num+'点体力,然后你摸两张牌?').set('ai',()=>{
return _status.event.bool; return _status.event.bool;
}).set('bool',get.recoverEffect(player,trigger.source,trigger.source)+get.effect(trigger.source,{name:'wuzhong'},trigger.source)>5); }).set('bool',get.recoverEffect(player,trigger.source,trigger.source)+2*get.effect(trigger.source,{name:'draw'},trigger.source)>5);
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('sbqiaoshi'); player.logSkill('sbqiaoshi');
@ -4019,7 +4232,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).length; }).length;
player.chooseTarget(get.prompt('sbyanyu'),'令一名其他角色摸'+get.cnNumber(event.num)+'张牌',lib.filter.notMe).set('ai',target=>{ player.chooseTarget(get.prompt('sbyanyu'),'令一名其他角色摸'+get.cnNumber(event.num)+'张牌',lib.filter.notMe).set('ai',target=>{
var player=_status.event.player; var player=_status.event.player;
return get.effect(target,{name:'wuzhong'},player,player); return get.effect(target,{name:'draw'},player,player);
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -4208,14 +4421,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
check:function(event,player){ check:function(event,player){
var suits=lib.suit.slice(); var suits=lib.suit.slice();
suits=suits.filter(suit=>!player.getStorage('sbfanjian_guessed').contains(suit)); suits=suits.filter(suit=>!player.getStorage('sbfanjian_guessed').includes(suit));
return suits.randomGet(); return suits.randomGet();
}, },
backup:function(result,player){ backup:function(result,player){
return { return {
audio:'sbfanjian', audio:'sbfanjian',
filterCard:function(card,player){ filterCard:function(card,player){
return !player.getStorage('sbfanjian_guessed').contains(get.suit(card,player)); return !player.getStorage('sbfanjian_guessed').includes(get.suit(card,player));
}, },
suit:result.control, suit:result.control,
position:'h', position:'h',
@ -4240,7 +4453,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player,user=_status.event.getParent().player,claim=_status.event.getParent().claimSuit,suit=_status.event.getParent().cardSuit; var player=_status.event.player,user=_status.event.getParent().player,claim=_status.event.getParent().claimSuit,suit=_status.event.getParent().cardSuit;
if(player.isTurnedOver()) return 2; if(player.isTurnedOver()) return 2;
var lose=get.effect(player,{name:'losehp'},user,player); var lose=get.effect(player,{name:'losehp'},user,player);
if(user.getStorage('sbfanjian_guessed').contains(claim)&&claim==suit) return lose<=0?0:1; if(user.getStorage('sbfanjian_guessed').includes(claim)&&claim==suit) return lose<=0?0:1;
if(get.attitude(player,user)>0) return 0; if(get.attitude(player,user)>0) return 0;
var list=[0,1]; var list=[0,1];
if(player.hp<=1&&player.getFriends().length>0) list.push(2); if(player.hp<=1&&player.getFriends().length>0) list.push(2);
@ -4340,7 +4553,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('sbkurou',target); player.logSkill('sbkurou',target);
if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.15); if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.15);
player.give(card,target); player.give(card,target);
player.loseHp(['tao','jiu'].contains(get.name(card,target))?2:1); player.loseHp(['tao','jiu'].includes(get.name(card,target))?2:1);
} }
}, },
ai:{ ai:{
@ -4486,7 +4699,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var hs=player.getCards('h'); var hs=player.getCards('h');
if(!hs.length) event.num=0; if(!hs.length) event.num=0;
for(var i=0; i<hs.length; i++){ for(var i=0; i<hs.length; i++){
if(!cards.contains(hs[i])){ if(!cards.includes(hs[i])){
event.num=0; break; event.num=0; break;
} }
} }
@ -4814,7 +5027,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player:function(player){ player:function(player){
var num=0,targets=game.filterPlayer(current=>current.hasMark('sbjieyin_mark')); var num=0,targets=game.filterPlayer(current=>current.hasMark('sbjieyin_mark'));
for(var current of targets){ for(var current of targets){
num+=get.effect(current,{name:'wuzhong'},player,player); num+=2*get.effect(current,{name:'draw'},player,player);
} }
if(num>0) return 3; if(num>0) return 3;
return 1; return 1;
@ -5150,7 +5363,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var storage=player.getStorage('sbliegong'); var storage=player.getStorage('sbliegong');
if(storage.length>=4) return true; if(storage.length>=4) return true;
if(storage.length<3) return false; if(storage.length<3) return false;
if(target.hasShan()) return storage.contains('heart')&&storage.contains('diamond'); if(target.hasShan()) return storage.includes('heart')&&storage.includes('diamond');
return true; return true;
}, },
content:function(){ content:function(){
@ -5163,7 +5376,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.showCards(cards.slice(0),get.translation(player)+'发动了【烈弓】'); player.showCards(cards.slice(0),get.translation(player)+'发动了【烈弓】');
while(cards.length>0){ while(cards.length>0){
var card=cards.pop(); var card=cards.pop();
if(storage.contains(get.suit(card,false))) evt.baseDamage++; if(storage.includes(get.suit(card,false))) evt.baseDamage++;
ui.cardPile.insertBefore(card,ui.cardPile.firstChild); ui.cardPile.insertBefore(card,ui.cardPile.firstChild);
} }
game.updateRoundNumber(); game.updateRoundNumber();
@ -5190,7 +5403,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(arg&&arg.card&&arg.card.name=='sha'){ if(arg&&arg.card&&arg.card.name=='sha'){
var storage=player.getStorage('sbliegong'); var storage=player.getStorage('sbliegong');
if(storage.length<3||!storage.contains('heart')||!storage.contains('diamond')) return false; if(storage.length<3||!storage.includes('heart')||!storage.includes('diamond')) return false;
var target=arg.target; var target=arg.target;
if(target.hasSkill('bagua_skill')||target.hasSkill('bazhen')||target.hasSkill('rw_bagua_skill')) return false; if(target.hasSkill('bagua_skill')||target.hasSkill('bazhen')||target.hasSkill('rw_bagua_skill')) return false;
return true; return true;
@ -5225,7 +5438,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var evt=_status.event; var evt=_status.event;
if(evt.name!='chooseToUse') evt=evt.getParent('chooseToUse'); if(evt.name!='chooseToUse') evt=evt.getParent('chooseToUse');
if(!evt||!evt.respondTo||evt.respondTo[1].name!='sha') return; if(!evt||!evt.respondTo||evt.respondTo[1].name!='sha') return;
if(player.storage.sbliegong_blocker.contains(suit)) return false; if(player.storage.sbliegong_blocker.includes(suit)) return false;
}, },
}, },
trigger:{ trigger:{
@ -5267,8 +5480,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player,name){ filter:function(event,player,name){
if(name!='useCard'&&player==event.player) return false; if(name!='useCard'&&player==event.player) return false;
var suit=get.suit(event.card); var suit=get.suit(event.card);
if(!lib.suit.contains(suit)) return false; if(!lib.suit.includes(suit)) return false;
if(player.storage.sbliegong&&player.storage.sbliegong.contains(suit)) return false; if(player.storage.sbliegong&&player.storage.sbliegong.includes(suit)) return false;
return true; return true;
}, },
content:function(){ content:function(){
@ -5351,7 +5564,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){ filter:function(event,player){
var list=player.getStorage('spmingxuan'); var list=player.getStorage('spmingxuan');
return player.countCards('h')>0&&game.hasPlayer(function(current){ return player.countCards('h')>0&&game.hasPlayer(function(current){
return current!=player&&!list.contains(current); return current!=player&&!list.includes(current);
}); });
}, },
content:function(){ content:function(){
@ -5359,7 +5572,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var suits=[],hs=player.getCards('h'); var suits=[],hs=player.getCards('h');
for(var i of hs) suits.add(get.suit(i,player)); for(var i of hs) suits.add(get.suit(i,player));
var list=player.getStorage('spmingxuan'),num=Math.min(suits.length,game.countPlayer(function(current){ var list=player.getStorage('spmingxuan'),num=Math.min(suits.length,game.countPlayer(function(current){
return current!=player&&!list.contains(current); return current!=player&&!list.includes(current);
})); }));
player.chooseCard('h',true,[1,num],'瞑昡:请选择至多'+get.cnNumber(num)+'张花色各不相同的手牌',function(card,player){ player.chooseCard('h',true,[1,num],'瞑昡:请选择至多'+get.cnNumber(num)+'张花色各不相同的手牌',function(card,player){
if(!ui.selected.cards.length) return true; if(!ui.selected.cards.length) return true;
@ -5372,7 +5585,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var list=player.getStorage('spmingxuan'),cards=result.cards.randomSort(); var list=player.getStorage('spmingxuan'),cards=result.cards.randomSort();
var targets=game.filterPlayer((current)=>(current!=player&&!list.contains(current))).randomGets(cards.length).sortBySeat(); var targets=game.filterPlayer((current)=>(current!=player&&!list.includes(current))).randomGets(cards.length).sortBySeat();
player.line(targets,'green'); player.line(targets,'green');
var map=[]; var map=[];
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
@ -5401,7 +5614,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'对'+get.translation(player)+'使用一张杀,否则交给其一张牌,且其摸一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'对'+get.translation(player)+'使用一张杀,否则交给其一张牌,且其摸一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',player).set('addCount',false); }).set('sourcex',player).set('addCount',false);
} }
@ -5502,7 +5715,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.countMark('sbjiang')) str+='X次。你可以将所有手牌当【决斗】使用X为场上其他吴势力角色数+1。'; if(player.countMark('sbjiang')) str+='X次。你可以将所有手牌当【决斗】使用X为场上其他吴势力角色数+1。';
else str+='一次。你可以将所有手牌当【决斗】使用。'; else str+='一次。你可以将所有手牌当【决斗】使用。';
return str; return str;
} },
sbzhenliang:function(player){
var storage=player.storage.sbzhenliang;
var str='转换技。';
if(!storage) str+='<span class="bluetext">';
str+='阴出牌阶段限一次你可以弃置X张与“任”颜色相同的牌并对攻击范围内的一名角色造成1点伤害X为你与其体力值值差且X至少为1。';
if(!storage) str+='</span>';
if(storage) str+='<span class="bluetext">';
str+='阳:你的回合外,一名角色使用或打出牌结算完成后,若此牌与“任”类别相同,则你可以令一名角色摸两张牌。';
if(storage) str+='</span>';
return str;
},
}, },
translate:{ translate:{
sb_zhanghe_prefix:'谋', sb_zhanghe_prefix:'谋',
@ -5714,24 +5938,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sb_yl_luzhi:'谋卢植', sb_yl_luzhi:'谋卢植',
sb_yl_luzhi_prefix:'谋', sb_yl_luzhi_prefix:'谋',
sbzhenliang:'贞良', sbzhenliang:'贞良',
sbzhenliang_info:'转换技。阴出牌阶段限一次你可以弃置X张与“任”颜色相同的牌并对攻击范围内的一名角色造成1点伤害X为你与其体力值值差且X至少为1。阳你的回合外一名角色使用或打出牌结算完成后若此牌与“任”类别相同则你可以令一名角色摸张牌。', sbzhenliang_info:'转换技。阴出牌阶段限一次你可以弃置X张与“任”颜色相同的牌并对攻击范围内的一名角色造成1点伤害X为你与其体力值值差且X至少为1。阳你的回合外一名角色使用或打出牌结算完成后若此牌与“任”类别相同则你可以令一名角色摸张牌。',
sb_xiaoqiao:'谋小乔', sb_xiaoqiao:'谋小乔',
sb_xiaoqiao_prefix:'谋', sb_xiaoqiao_prefix:'谋',
sbtianxiang:'天香', sbtianxiang:'天香',
sbtianxiang_info:'①出牌阶段限三次你可以交给一名没有“天香”标记的其他角色一张红色牌然后令其获得此牌花色的“天香”标记。②当你受到伤害时你可以移去一名角色的“天香”标记若此“天香”标记为红桃你防止此伤害其受到伤害来源对其造成的1点伤害若没有伤害来源则改为无来源伤害方片其交给你两张牌。③准备阶段你移去场上所有的“天香”标记然后摸等量的牌。', sbtianxiang_info:'①出牌阶段限三次你可以交给一名没有“天香”标记的其他角色一张红色牌然后令其获得此牌花色的“天香”标记。②当你受到伤害时你可以移去一名角色的“天香”标记若此“天香”标记为红桃你防止此伤害其受到伤害来源对其造成的1点伤害若没有伤害来源则改为无来源伤害方片其交给你两张牌。③准备阶段你移去场上所有的“天香”标记然后摸等量的牌。',
sbtianxiang_info_versus_two:'①出牌阶段限三次你可以交给一名没有“天香”标记的其他角色一张红色牌然后令其获得此牌花色的“天香”标记。②当你受到伤害时你可以移去一名角色的“天香”标记若此“天香”标记为红桃你防止此伤害其受到伤害来源对其造成的1点伤害若没有伤害来源则改为无来源伤害方片其交给你两张牌。③准备阶段你移去场上所有的“天香”标记然后摸X张牌X为移去的“天香”标记数+2)。', sbtianxiang_info_versus_two:'①出牌阶段限三次你可以交给一名没有“天香”标记的其他角色一张红色牌然后令其获得此牌花色的“天香”标记。②当你受到伤害时你可以移去一名角色的“天香”标记若此“天香”标记为红桃你防止此伤害其受到伤害来源对其造成的1点伤害若没有伤害来源则改为无来源伤害方片其交给你两张牌。③准备阶段你移去场上所有的“天香”标记然后摸X张牌X为移去的“天香”标记数+3)。',
sb_sp_zhugeliang:'谋诸葛亮', sb_sp_zhugeliang:'谋卧龙',
sb_sp_zhugeliang_prefix:'谋', sb_sp_zhugeliang_prefix:'谋',
sb_zhugeliang:'谋诸葛亮', sb_zhugeliang:'谋诸葛亮',
sb_zhugeliang_prefix:'谋', sb_zhugeliang_prefix:'谋',
sbhuoji:'火计', sbhuoji:'火计',
sbhuoji_info:'使命技。①使命出牌阶段限一次。你可以对一名其他角色造成1点火焰伤害然后你对所有与其势力相同的不为其的其他角色各造成1点火焰伤害。②成功准备阶段若你本局游戏已造成的火焰伤害不小于本局游戏总角色数则你失去〖火计〗和〖看破〗然后获得〖观星〗和〖空城〗。③失败使命成功前进入濒死状态。', sbhuoji_info:'使命技。①使命出牌阶段限一次。你可以对一名其他角色造成1点火焰伤害然后你对所有与其势力相同的不为其的其他角色各造成1点火焰伤害。②成功准备阶段若你本局游戏已造成的火焰伤害不小于本局游戏总角色数则你失去〖火计〗和〖看破〗然后获得〖观星〗和〖空城〗。③失败使命成功前进入濒死状态。',
sbkanpo:'看破', sbkanpo:'看破',
sbkanpo_info:'①一轮游戏开始时,你清除〖看破①〗记录的牌名,然后你可以依次记录共计三个未于本次清除过的非装备牌牌名(对其他角色不可见)。②其他角色使用你〖看破①〗记录过的牌名的牌时,你可以移去一个〖看破①〗中的此牌名的记录令此牌无效。', sbkanpo_info:'①一轮游戏开始时,你清除〖看破①〗记录的牌名,然后你可以依次记录任意个未于上次发动〖看破①〗记录清除过的非装备牌牌名(对其他角色不可见每局游戏至多记录10个牌名)。②其他角色使用你〖看破①〗记录过的牌名的牌时,你可以移去一个〖看破①〗中的此牌名的记录令此牌无效,然后你摸一张牌。',
sbguanxing:'观星', sbguanxing:'观星',
sbguanxing_info:'①准备阶段你将所有“星”置入弃牌堆将牌堆顶的X张牌置于你的武将牌上称为“星”。然后你可以将任意张“星”置于牌堆顶X为你此次移去的“星”数+1且至多为7若你此前未发动过〖观星①〗则X为7。②结束阶段,若你未于本回合的准备阶段将“星”置于过牌堆顶,你可以将任意张“星”置于牌堆顶。③你可以如手牌般使用或打出“星”。', sbguanxing_info:'①准备阶段你将所有“星”置入弃牌堆将牌堆顶的X张牌置于你的武将牌上称为“星”X为7-此前发动〖观星①〗次数的两倍且X至少为0。然后你可以将任意张“星”置于牌堆顶。②结束阶段,若你未于本回合的准备阶段将“星”置于过牌堆顶,你可以将任意张“星”置于牌堆顶。③你可以如手牌般使用或打出“星”。',
sbkongcheng:'空城', sbkongcheng:'空城',
sbkongcheng_info:'锁定技。当你受到伤害时,若你有〖观星〗,且若你:有“星”,你判定,若结果点数不大于你的“星”数,此伤害-1没有“星”此伤害+1。', sbkongcheng_info:'锁定技。当你受到伤害时,若你技能〖观星〗,且若你:有“星”,你判定,若结果点数不大于你的“星”数,此伤害-1没有“星”此伤害+1。',
sb_huangyueying:'谋黄月英', sb_huangyueying:'谋黄月英',
sb_huangyueying_prefix:'谋', sb_huangyueying_prefix:'谋',
sbqicai:'奇才', sbqicai:'奇才',
@ -5739,6 +5963,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sbqicai_info:'①出牌阶段限一次。你可以将手牌中或弃牌堆中的一张防具牌置于一名其他角色的防具栏,然后其获得如下效果:当其得到普通锦囊牌后,其将此牌交给你(限三张)。②你使用锦囊牌无距离限制。', sbqicai_info:'①出牌阶段限一次。你可以将手牌中或弃牌堆中的一张防具牌置于一名其他角色的防具栏,然后其获得如下效果:当其得到普通锦囊牌后,其将此牌交给你(限三张)。②你使用锦囊牌无距离限制。',
sbjizhi:'集智', sbjizhi:'集智',
sbjizhi_info:'锁定技,当你使用一张普通锦囊牌时,你摸一张牌,且此牌本回合不计入你的手牌上限。', sbjizhi_info:'锁定技,当你使用一张普通锦囊牌时,你摸一张牌,且此牌本回合不计入你的手牌上限。',
sb_guanyu:'谋关羽',
sb_guanyu_prefix:'谋',
sbwusheng:'武圣',
sbwusheng_wusheng_backup:'武圣',
sbwusheng_info:'你可以将一张手牌当作任意【杀】使用或打出。出牌阶段开始时,你可以选择一名非主公的其他角色,本阶段对其使用【杀】无距离和次数限制,使用【杀】指定其为目标后摸一张牌,对其使用五张【杀】后不能对其使用【杀】。',
sbyijue:'义绝',
sbyijue_info:'锁定技,每名角色每局游戏限一次,当你对一名角色造成大于等于其体力值的伤害时,你防止此伤害,且本回合你使用牌指定其为目标后,取消之。',
sb_zhi:'谋攻篇·知', sb_zhi:'谋攻篇·知',
sb_shi:'谋攻篇·识', sb_shi:'谋攻篇·识',

View File

@ -233,7 +233,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
preHidden:true, preHidden:true,
check:function(event,player){ check:function(event,player){
if(player.hasSkill('dcwanglie2',null,null,false)) return true; if(player.hasSkill('dcwanglie2',null,null,false)) return true;
if(['wuzhong','kaihua','dongzhuxianji'].contains(event.card.name)) return false; if(['wuzhong','kaihua','dongzhuxianji'].includes(event.card.name)) return false;
player._wanglie_temp=true; player._wanglie_temp=true;
var eff=0; var eff=0;
for(var i of event.targets){ for(var i of event.targets){
@ -291,10 +291,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player._wanglie_temp) return false; if(player._wanglie_temp) return false;
player._wanglie_temp=true; player._wanglie_temp=true;
var bool=function(){ var bool=function(){
if(['wuzhong','kaihua','dongzhuxianji'].contains(arg.card.name)) return false; if(['wuzhong','kaihua','dongzhuxianji'].includes(arg.card.name)) return false;
if(get.attitude(player,arg.target)>0||!player.isPhaseUsing()) return false; if(get.attitude(player,arg.target)>0||!player.isPhaseUsing()) return false;
var cards=player.getCards('h',function(card){ var cards=player.getCards('h',function(card){
return card!=arg.card&&(!arg.card.cards||!arg.card.cards.contains(card)); return card!=arg.card&&(!arg.card.cards||!arg.card.cards.includes(card));
}); });
var sha=player.getCardUsable('sha'); var sha=player.getCardUsable('sha');
if(arg.card.name=='sha') sha--; if(arg.card.name=='sha') sha--;
@ -373,8 +373,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseControl(choices).set('choiceList',choiceList).set('prompt','良姻:是否令一名角色回复体力?').set('ai',function(){ player.chooseControl(choices).set('choiceList',choiceList).set('prompt','良姻:是否令一名角色回复体力?').set('ai',function(){
var player=_status.event.player,target=_status.event.getParent().target; var player=_status.event.player,target=_status.event.getParent().target;
var list=_status.event.controls.slice(0),eff1=0,eff2=0; var list=_status.event.controls.slice(0),eff1=0,eff2=0;
if(list.contains('选项一')) eff1=get.recoverEffect(player,player,player); if(list.includes('选项一')) eff1=get.recoverEffect(player,player,player);
if(list.contains('选项二')) eff2=get.recoverEffect(target,player,player); if(list.includes('选项二')) eff2=get.recoverEffect(target,player,player);
if(eff1>Math.max(0,eff2)) return '选项一'; if(eff1>Math.max(0,eff2)) return '选项一';
if(eff2>0) return '选项二'; if(eff2>0) return '选项二';
return 'cancel2'; return 'cancel2';
@ -459,8 +459,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseControl(choices).set('choiceList',choiceList).set('prompt','良姻:是否令一名角色回复体力?').set('ai',function(){ player.chooseControl(choices).set('choiceList',choiceList).set('prompt','良姻:是否令一名角色回复体力?').set('ai',function(){
var player=_status.event.player,target=_status.event.getParent().target; var player=_status.event.player,target=_status.event.getParent().target;
var list=_status.event.controls.slice(0),eff1=0,eff2=0; var list=_status.event.controls.slice(0),eff1=0,eff2=0;
if(list.contains('选项一')) eff1=get.recoverEffect(player,player,player); if(list.includes('选项一')) eff1=get.recoverEffect(player,player,player);
if(list.contains('选项二')) eff2=get.recoverEffect(target,player,player); if(list.includes('选项二')) eff2=get.recoverEffect(target,player,player);
if(eff1>Math.max(0,eff2)) return '选项一'; if(eff1>Math.max(0,eff2)) return '选项一';
if(eff2>0) return '选项二'; if(eff2>0) return '选项二';
return 'cancel2'; return 'cancel2';
@ -489,7 +489,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(current.isHealthy()||get.recoverEffect(current,player,player)<=0) return false; if(current.isHealthy()||get.recoverEffect(current,player,player)<=0) return false;
var num2=current.countCards('h',function(card){ var num2=current.countCards('h',function(card){
if(current!=player) return true; if(current!=player) return true;
return !ui.selected.cards.contains(card); return !ui.selected.cards.includes(card);
})+1; })+1;
return num==num2; return num==num2;
})) return 0; })) return 0;
@ -575,16 +575,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:'drlt_zhenrong', audio:'drlt_zhenrong',
filter:function(event,player){ filter:function(event,player){
if(!event.isFirstTarget) return false; if(!event.isFirstTarget) return false;
if(!['basic','trick'].contains(get.type(event.card))) return false; if(!['basic','trick'].includes(get.type(event.card))) return false;
if(get.tag(event.card,'damage')) return game.hasPlayer(function(current){ if(get.tag(event.card,'damage')) return game.hasPlayer(function(current){
return event.targets.contains(current)&&current.countCards('h')>=player.countCards('h')&&current.countCards('he')>0; return event.targets.includes(current)&&current.countCards('h')>=player.countCards('h')&&current.countCards('he')>0;
}); });
return false; return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('zhengrong'),'将一名手牌数不小于你的目标角色的一张牌置于你的武将牌上,成为「荣」',function(card,player,target){ player.chooseTarget(get.prompt('zhengrong'),'将一名手牌数不小于你的目标角色的一张牌置于你的武将牌上,成为「荣」',function(card,player,target){
return _status.event.targets.contains(target)&&target.countCards('h')>=player.countCards('h')&&target.countCards('he')>0; return _status.event.targets.includes(target)&&target.countCards('h')>=player.countCards('h')&&target.countCards('he')>0;
}).set('ai',function(target){ }).set('ai',function(target){
return (1-get.attitude(_status.event.player,target))/target.countCards('he'); return (1-get.attitude(_status.event.player,target))/target.countCards('he');
}).set('targets',trigger.targets); }).set('targets',trigger.targets);
@ -845,11 +845,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt2('drlt_zhenggu'),function(card,player,target){ player.chooseTarget(get.prompt2('drlt_zhenggu'),function(card,player,target){
//if(target.storage.drlt_zhenggu_mark&&target.storage.drlt_zhenggu_mark.contains(player)) return false; //if(target.storage.drlt_zhenggu_mark&&target.storage.drlt_zhenggu_mark.includes(player)) return false;
return target!=player; return target!=player;
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
//if(target.storage.drlt_zhenggu_mark&&target.storage.drlt_zhenggu_mark.contains(player)) return 0; //if(target.storage.drlt_zhenggu_mark&&target.storage.drlt_zhenggu_mark.includes(player)) return 0;
var num=(Math.min(5,player.countCards('h'))-target.countCards('h')); var num=(Math.min(5,player.countCards('h'))-target.countCards('h'));
var att=get.attitude(player,target); var att=get.attitude(player,target);
return num*att; return num*att;
@ -883,10 +883,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
logTarget:"player", logTarget:"player",
filter:function(event,player){ filter:function(event,player){
return event.player.storage.drlt_zhenggu_mark&&event.player.storage.drlt_zhenggu_mark.contains(player); return event.player.storage.drlt_zhenggu_mark&&event.player.storage.drlt_zhenggu_mark.includes(player);
}, },
content:function(){ content:function(){
while(trigger.player.storage.drlt_zhenggu_mark.contains(player)){ while(trigger.player.storage.drlt_zhenggu_mark.includes(player)){
trigger.player.storage.drlt_zhenggu_mark.remove(player); trigger.player.storage.drlt_zhenggu_mark.remove(player);
} }
if(trigger.player.storage.drlt_zhenggu_mark.length==0) trigger.player.unmarkSkill('drlt_zhenggu_mark'); if(trigger.player.storage.drlt_zhenggu_mark.length==0) trigger.player.unmarkSkill('drlt_zhenggu_mark');
@ -1025,7 +1025,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.card.name!='sha'&&event.card.name!='juedou') return false; if(event.card.name!='sha'&&event.card.name!='juedou') return false;
return !game.hasPlayer2(function(current){ return !game.hasPlayer2(function(current){
return current.getHistory('useCard',function(evt){ return current.getHistory('useCard',function(evt){
return evt!=event.getParent()&&evt.card&&['sha','juedou'].contains(evt.card.name)&&evt.targets.contains(player); return evt!=event.getParent()&&evt.card&&['sha','juedou'].includes(evt.card.name)&&evt.targets.includes(player);
}).length>0; }).length>0;
}); });
}, },
@ -1105,11 +1105,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseToDisable(true).set('ai',function(event,player,list){ player.chooseToDisable(true).set('ai',function(event,player,list){
if(list.contains('equip2')) return 'equip2'; if(list.includes('equip2')) return 'equip2';
if(list.contains('equip1')&&(player.countCards('h',function(card){ if(list.includes('equip1')&&(player.countCards('h',function(card){
return get.name(card,player)=='sha'&&player.hasUseTarget(card); return get.name(card,player)=='sha'&&player.hasUseTarget(card);
})-player.getCardUsable('sha'))>1) return 'equip1'; })-player.getCardUsable('sha'))>1) return 'equip1';
if(list.contains('equip5')&&player.countCards('h',function(card){ if(list.includes('equip5')&&player.countCards('h',function(card){
return get.type2(card,player)=='trick'&&player.hasUseTarget(card); return get.type2(card,player)=='trick'&&player.hasUseTarget(card);
})>1) return 'equip5'; })>1) return 'equip5';
}); });
@ -1317,7 +1317,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player; var player=_status.event.player;
var value=get.value(card,player,'raw'); var value=get.value(card,player,'raw');
if(game.hasPlayer(function(target){ if(game.hasPlayer(function(target){
return (target!=player&&target.group=='qun'&&!ui.selected.targets.contains(target))&&(get.sgn(value)==get.sgn(get.attitude(player,target))) return (target!=player&&target.group=='qun'&&!ui.selected.targets.includes(target))&&(get.sgn(value)==get.sgn(get.attitude(player,target)))
})) return 1/Math.max(1,get.useful(card)); })) return 1/Math.max(1,get.useful(card));
return -1; return -1;
}, },
@ -1456,7 +1456,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
selectCard:1, selectCard:1,
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&_status.event.targets.contains(target); return player!=target&&_status.event.targets.includes(target);
}, },
ai1:function(card){ ai1:function(card){
if(card.name=='du') return 20; if(card.name=='du') return 20;
@ -1509,7 +1509,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
preHidden:true, preHidden:true,
check:function(event,player){ check:function(event,player){
if(['wuzhong','kaihua','dongzhuxianji'].contains(event.card.name)) return false; if(['wuzhong','kaihua','dongzhuxianji'].includes(event.card.name)) return false;
player._wanglie_temp=true; player._wanglie_temp=true;
var eff=0; var eff=0;
for(var i of event.targets){ for(var i of event.targets){
@ -1541,10 +1541,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player._wanglie_temp) return false; if(player._wanglie_temp) return false;
player._wanglie_temp=true; player._wanglie_temp=true;
var bool=function(){ var bool=function(){
if(['wuzhong','kaihua','dongzhuxianji'].contains(arg.card.name)) return false; if(['wuzhong','kaihua','dongzhuxianji'].includes(arg.card.name)) return false;
if(get.attitude(player,arg.target)>0||!player.isPhaseUsing()) return false; if(get.attitude(player,arg.target)>0||!player.isPhaseUsing()) return false;
var cards=player.getCards('h',function(card){ var cards=player.getCards('h',function(card){
return card!=arg.card&&(!arg.card.cards||!arg.card.cards.contains(card)); return card!=arg.card&&(!arg.card.cards||!arg.card.cards.includes(card));
}); });
var sha=player.getCardUsable('sha'); var sha=player.getCardUsable('sha');
if(arg.card.name=='sha') sha--; if(arg.card.name=='sha') sha--;
@ -1825,7 +1825,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
event.target=result.targets[0]; event.target=result.targets[0];
var list=player.getStorage('nzry_feijun'); var list=player.getStorage('nzry_feijun');
if(!list.contains(event.target)){ if(!list.includes(event.target)){
event._nzry_binglve=true; event._nzry_binglve=true;
player.markAuto('nzry_feijun',[event.target]); player.markAuto('nzry_feijun',[event.target]);
} }
@ -1853,7 +1853,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{ result:{
player:function(player){ player:function(player){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return (current.countCards('h')>player.countCards('h')||current.countCards('e')>player.countCards('e'))&&get.attitude(player,current)<0&&player.getStorage('nzry_feijun').contains(current); return (current.countCards('h')>player.countCards('h')||current.countCards('e')>player.countCards('e'))&&get.attitude(player,current)<0&&player.getStorage('nzry_feijun').includes(current);
})||game.hasPlayer(function(current){ })||game.hasPlayer(function(current){
return current.countCards('h')>player.countCards('h')&&get.attitude(player,current)<0; return current.countCards('h')>player.countCards('h')&&get.attitude(player,current)<0;
})||(player.countCards('h')>=2&&game.hasPlayer(function(current){ })||(player.countCards('h')>=2&&game.hasPlayer(function(current){
@ -1979,7 +1979,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return !player.hasMark('nzry_huaiju'); return !player.hasMark('nzry_huaiju');
}, },
check:function(event,player){ check:function(event,player){
return player.countCards('h')>=2||player.skipList.contains('phaseUse'); return player.countCards('h')>=2||player.skipList.includes('phaseUse');
}, },
content:function(){ content:function(){
trigger.cancel(); trigger.cancel();
@ -2409,7 +2409,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=[]; var list=[];
player.countCards('h',function(cardx){ player.countCards('h',function(cardx){
if(cardx!=card||get.color(cardx)!=color) return false; if(cardx!=card||get.color(cardx)!=color) return false;
if(list.contains(cardx.name)) return false; if(list.includes(cardx.name)) return false;
list.push(cardx.name); list.push(cardx.name);
switch(cardx.name){ switch(cardx.name){
case 'wuxie':num+=(game.countPlayer()/2.2);break; case 'wuxie':num+=(game.countPlayer()/2.2);break;
@ -2650,7 +2650,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
var pl=player.storage.nzry_shenshi2; var pl=player.storage.nzry_shenshi2;
var card=player.storage.nzry_shenshi1; var card=player.storage.nzry_shenshi1;
if(player.getCards('he').contains(card)&&4-pl.countCards('h')>0){ if(player.getCards('he').includes(card)&&4-pl.countCards('h')>0){
pl.draw(4-pl.countCards('h')); pl.draw(4-pl.countCards('h'));
pl.logSkill('nzry_shenshi'); pl.logSkill('nzry_shenshi');
} }
@ -2990,7 +2990,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
viewAs:{name:'wanjian'}, viewAs:{name:'wanjian'},
filterCard:function(card,player){ filterCard:function(card,player){
if(!player.storage.reluanji) return true; if(!player.storage.reluanji) return true;
return !player.storage.reluanji.contains(get.suit(card)); return !player.storage.reluanji.includes(get.suit(card));
}, },
position:'hs', position:'hs',
selectCard:2, selectCard:2,
@ -3260,7 +3260,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
directHit_ai:true, directHit_ai:true,
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(get.attitude(player,arg.target)<=0&&arg.card.name=='sha'&&player.countCards('h',function(card){ if(get.attitude(player,arg.target)<=0&&arg.card.name=='sha'&&player.countCards('h',function(card){
return card!=arg.card&&(!arg.card.cards||!arg.card.cards.contains(card)); return card!=arg.card&&(!arg.card.cards||!arg.card.cards.includes(card));
})>=arg.target.countCards('h')) return true; })>=arg.target.countCards('h')) return true;
return false; return false;
}, },
@ -3283,7 +3283,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'挑衅:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'挑衅:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.filterTarget.apply(this,arguments); return lib.filter.filterTarget.apply(this,arguments);
}).set('sourcex',player); }).set('sourcex',player);
"step 1" "step 1"
@ -3439,11 +3439,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 2" "step 2"
if(result.bool){ if(result.bool){
player.chooseTarget(true,'请选择进行额外回合的目标角色',lib.filter.notMe).ai=function(target){ player.chooseTarget(true,'请选择进行额外回合的目标角色',lib.filter.notMe).ai=function(target){
if(target.hasJudge('lebu')) return -1; if(target.hasJudge('lebu')||get.attitude(player,target)<=0) return -1;
if(get.attitude(player,target)>4){ if(target.isTurnedOver()) return 0.18;
return get.threaten(target)/Math.sqrt(target.hp+1)/Math.sqrt(target.countCards('h')+1); return get.threaten(target)/Math.sqrt(target.hp+1)/Math.sqrt(target.countCards('h')+1);
}
return -1;
}; };
} }
else event.finish(); else event.finish();
@ -3538,7 +3536,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.countCards('h')>player.hp+1){ if(player.countCards('h')>player.hp+1){
check=false; check=false;
} }
else if(player.countCards('h',{name:['wuzhong']})){ else if(player.countCards('h',{name:'wuzhong'})){
check=false; check=false;
} }
else{ else{
@ -3665,6 +3663,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(typeof card==='object'&&get.name(card)==='sha'&&target.mayHaveShan(player,'use')) return [0.6,0.75];
if(!target.hasFriend()&&!player.hasUnknown()) return; if(!target.hasFriend()&&!player.hasUnknown()) return;
if(_status.currentPhase==target) return; if(_status.currentPhase==target) return;
if(card.name!='shuiyanqijunx'&&get.tag(card,'loseCard')&&target.countCards('he')){ if(card.name!='shuiyanqijunx'&&get.tag(card,'loseCard')&&target.countCards('he')){
@ -4036,7 +4035,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
]).set('filterButton',function(button){ ]).set('filterButton',function(button){
var type=typeof button.link; var type=typeof button.link;
if(ui.selected.buttons.length&&type==typeof ui.selected.buttons[0].link) return false; if(ui.selected.buttons.length&&type==typeof ui.selected.buttons[0].link) return false;
return type=='string'||_status.event.allowed.contains(button.link); return type=='string'||_status.event.allowed.includes(button.link);
}).set('allowed',cards2).set('check',lib.skill.guzheng.checkx(trigger,player,cards,cards2)).set('ai',function(button){ }).set('allowed',cards2).set('check',lib.skill.guzheng.checkx(trigger,player,cards,cards2)).set('ai',function(button){
if(typeof button.link=='string'){ if(typeof button.link=='string'){
return button.link=='获得剩余的牌'?1:0; return button.link=='获得剩余的牌'?1:0;
@ -4147,6 +4146,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
logTarget:'source', logTarget:'source',
ai:{ ai:{
maixie_defend:true,
threaten:function(player,target){ threaten:function(player,target){
if(target.hp==1) return 0.2; if(target.hp==1) return 0.2;
return 1.5; return 1.5;
@ -4154,7 +4154,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-2]; if(target.hp<=1&&get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return 3;
return [1,0,0,-3*get.threaten(player)];
}
} }
} }
} }
@ -4280,7 +4283,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
_status.imchoosing=false; _status.imchoosing=false;
var skill=skills[0],character; var skill=skills[0],character;
for(var i in player.storage.huashen.owned){ for(var i in player.storage.huashen.owned){
if(player.storage.huashen.owned[i].contains(skill)){ if(player.storage.huashen.owned[i].includes(skill)){
character=i; break; character=i; break;
} }
} }
@ -4351,7 +4354,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
_status.imchoosing=false; _status.imchoosing=false;
var skill=skills[0],character; var skill=skills[0],character;
for(var i in player.storage.huashen.owned){ for(var i in player.storage.huashen.owned){
if(player.storage.huashen.owned[i].contains(skill)){ if(player.storage.huashen.owned[i].includes(skill)){
character=i; break; character=i; break;
} }
} }
@ -4367,7 +4370,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.control=ui.create.control(); event.control=ui.create.control();
event.control.replacex=function(){ event.control.replacex=function(){
var args=Array.from(arguments)[0]; var args=Array.from(arguments)[0];
if(args.contains('cancel2')&&forced){ if(args.includes('cancel2')&&forced){
args.remove('cancel2'); args.remove('cancel2');
this.style.opacity=''; this.style.opacity='';
} }
@ -4442,7 +4445,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.changeGroup(lib.character[character][1]); player.changeGroup(lib.character[character][1]);
} }
player.storage.huashen.current2=skill; player.storage.huashen.current2=skill;
if(!player.additionalSkills.huashen||!player.additionalSkills.huashen.contains(skill)){ if(!player.additionalSkills.huashen||!player.additionalSkills.huashen.includes(skill)){
player.addAdditionalSkill('huashen',skill); player.addAdditionalSkill('huashen',skill);
player.flashAvatar('huashen',character); player.flashAvatar('huashen',character);
game.log(player,'获得了技能','#g【'+get.translation(skill)+'】'); game.log(player,'获得了技能','#g【'+get.translation(skill)+'】');
@ -4611,7 +4614,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audioname:['boss_lvbu3','ol_zhurong'], audioname:['boss_lvbu3','ol_zhurong'],
trigger:{source:'damageSource'}, trigger:{source:'damageSource'},
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.includes(event.player)) return false;
return (event.card&&event.card.name=='sha'&&event.getParent().name=='sha'&& return (event.card&&event.card.name=='sha'&&event.getParent().name=='sha'&&
event.player.isIn()&& event.player.isIn()&&
player.canCompare(event.player)); player.canCompare(event.player));
@ -4823,12 +4826,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
threaten:2, threaten:2,
ai:{ noh:true,
noh:true, skillTagFilter:function(player,tag){
skillTagFilter:function(player,tag){ if(tag=='noh'){
if(tag=='noh'){ if(player.countCards('h')!=2) return false;
if(player.countCards('h')!=2) return false;
}
} }
} }
} }
@ -5277,7 +5278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.currented=[]; event.currented=[];
"step 1" "step 1"
event.currented.push(event.current); event.currented.push(event.current);
event.current.animate('target'); event.current.addTempClass('target');
event.current.chooseToUse('乱武使用一张杀或失去1点体力',function(card){ event.current.chooseToUse('乱武使用一张杀或失去1点体力',function(card){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.cardEnabled.apply(this,arguments) return lib.filter.cardEnabled.apply(this,arguments)
@ -5298,7 +5299,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 2" "step 2"
if(result.bool==false) event.current.loseHp(); if(result.bool==false) event.current.loseHp();
event.current=event.current.next; event.current=event.current.next;
if(event.current!=player&&!event.currented.contains(event.current)){ if(event.current!=player&&!event.currented.includes(event.current)){
game.delay(0.5); game.delay(0.5);
event.goto(1); event.goto(1);
} }
@ -5351,15 +5352,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
wansha2:{ wansha2:{
mod:{ mod:{
cardSavable:function(card,player){ cardSavable:function(card,player){
if(!_status.currentPhase) return; if(card.name=='tao'&&_status.currentPhase&&_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){
if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ if(!player.isDying()) return false;
if(card.name=='tao'&&!player.isDying()) return false;
} }
}, },
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(!_status.currentPhase) return; if(card.name=='tao'&&_status.currentPhase&&_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){
if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ if(!player.isDying()) return false;
if(card.name=='tao'&&!player.isDying()) return false;
} }
} }
} }
@ -5445,7 +5444,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (get.name(b)=='wuxie'?1:2)-(get.name(a)=='wuxie'?1:2); return (get.name(b)=='wuxie'?1:2)-(get.name(a)=='wuxie'?1:2);
}); });
var geti=function(){ var geti=function(){
if(cards.contains(card)){ if(cards.includes(card)){
return cards.indexOf(card); return cards.indexOf(card);
} }
return cards.length; return cards.length;
@ -6248,11 +6247,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var check= player.countCards('h')>2;
player.chooseTarget(get.prompt("shensu"),"跳过判定阶段和摸牌阶段,视为对一名其他角色使用一张【杀】",function(card,player,target){ player.chooseTarget(get.prompt("shensu"),"跳过判定阶段和摸牌阶段,视为对一名其他角色使用一张【杀】",function(card,player,target){
if(player==target) return false; if(player==target) return false;
return player.canUse({name:'sha'},target,false); return player.canUse({name:'sha'},target,false);
}).set('check',check).set('ai',function(target){ }).set('check',player.countCards('h')>2).set('ai',function(target){
if(!_status.event.check) return 0; if(!_status.event.check) return 0;
return get.effect(target,{name:'sha'},_status.event.player); return get.effect(target,{name:'sha'},_status.event.player);
}).setHiddenSkill('shensu1'); }).setHiddenSkill('shensu1');
@ -6281,7 +6279,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
"step 0" "step 0"
var check=player.needsToDiscard();
player.chooseCardTarget({ player.chooseCardTarget({
prompt:get.prompt('shensu'), prompt:get.prompt('shensu'),
prompt2:"弃置一张装备牌并跳过出牌阶段,视为对一名其他角色使用一张【杀】", prompt2:"弃置一张装备牌并跳过出牌阶段,视为对一名其他角色使用一张【杀】",
@ -6301,7 +6298,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(_status.event.check) return 0; if(_status.event.check) return 0;
return get.effect(target,{name:'sha'},_status.event.player); return get.effect(target,{name:'sha'},_status.event.player);
}, },
check:check check:player.countCards('hs',i=>{
return player.hasValueTarget(i,null,true);
})>player.hp-1
}).setHiddenSkill('shensu2'); }).setHiddenSkill('shensu2');
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -6911,7 +6910,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var nums=[]; var nums=[];
var cards=player.getExpansions('gzbuqu'); var cards=player.getExpansions('gzbuqu');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(nums.contains(get.number(cards[i]))){ if(nums.includes(get.number(cards[i]))){
return false; return false;
} }
else{ else{
@ -6942,7 +6941,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<buttons.length;i++){ for(var i=0;i<buttons.length;i++){
if(buttons[i]!=button&& if(buttons[i]!=button&&
get.number(buttons[i].link)==get.number(button.link)&& get.number(buttons[i].link)==get.number(button.link)&&
!ui.selected.buttons.contains(buttons[i])){ !ui.selected.buttons.includes(buttons[i])){
return 1; return 1;
} }
} }
@ -6960,7 +6959,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var evt=event,histories=[evt]; var evt=event,histories=[evt];
while(true){ while(true){
evt=event.getParent('dying'); evt=event.getParent('dying');
if(!evt||evt.name!='dying'||histories.contains(evt)) break; if(!evt||evt.name!='dying'||histories.includes(evt)) break;
histories.push(evt); histories.push(evt);
if(evt.player==player) evt.nodying=true; if(evt.player==player) evt.nodying=true;
} }
@ -7053,7 +7052,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(current==event.player) return false; if(current==event.player) return false;
var hs=event.getl(current).hs; var hs=event.getl(current).hs;
for(var i of hs){ for(var i of hs){
if(cards.contains(i)) return true; if(cards.includes(i)) return true;
} }
return false; return false;
}); });
@ -7065,7 +7064,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(current==event.player) return false; if(current==event.player) return false;
var cards=event.getg(current); var cards=event.getg(current);
for(var i of cards){ for(var i of cards){
if(hs.contains(i)) return true; if(hs.includes(i)) return true;
} }
}); });
} }
@ -7086,7 +7085,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(current==trigger.player) return false; if(current==trigger.player) return false;
var hs=trigger.getl(current).hs; var hs=trigger.getl(current).hs;
for(var i of hs){ for(var i of hs){
if(cards.contains(i)) return true; if(cards.includes(i)) return true;
} }
return false; return false;
})); }));
@ -7387,7 +7386,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
derivation:['chanyuan'], derivation:['chanyuan'],
enable:['chooseToUse','chooseToRespond'], enable:['chooseToUse','chooseToRespond'],
hiddenCard:function(player,name){ hiddenCard:function(player,name){
return (lib.inpile.contains(name)&&player.countCards('hs')>0&&!player.hasSkill('guhuo_phase')); return (lib.inpile.includes(name)&&player.countCards('hs')>0&&!player.hasSkill('guhuo_phase'));
}, },
filter:function(event,player){ filter:function(event,player){
if(player.hasSkill('guhuo_phase')) return false; if(player.hasSkill('guhuo_phase')) return false;

View File

@ -364,7 +364,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.list=list; event.list=list;
var num1=0,num2=0,num3=0; var num1=0,num2=0,num3=0;
for(var target of list){ for(var target of list){
num1+=get.effect(target,{name:'wuzhong'},player,player); num1+=2*get.effect(target,{name:'draw'},player,player);
num2+=get.recoverEffect(target,player,player); num2+=get.recoverEffect(target,player,player);
} }
trigger.player.chooseControl('摸两张牌','回复体力','cancel2').set('prompt','整肃奖励:请选择'+get.translation(list)+'的整肃奖励').set('ai',function(){ trigger.player.chooseControl('摸两张牌','回复体力','cancel2').set('prompt','整肃奖励:请选择'+get.translation(list)+'的整肃奖励').set('ai',function(){
@ -437,13 +437,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.control=='cancel2'){event.finish();return;} if(result.control=='cancel2'){event.finish();return;}
player.chooseTarget('整军是否令一名其他角色也回复1点体力或摸两张牌',lib.filter.notMe).set('ai',function(target){ player.chooseTarget('整军是否令一名其他角色也回复1点体力或摸两张牌',lib.filter.notMe).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
return Math.max(get.effect(target,{name:'wuzhong'},target,player),get.recoverEffect(target,target,player)); return Math.max(2*get.effect(target,{name:'draw'},target,player),get.recoverEffect(target,target,player));
}); });
'step 2' 'step 2'
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
var num1=get.effect(target,{name:'wuzhong'},target,player); var num1=2*get.effect(target,{name:'draw'},target,player);
var num2=get.recoverEffect(target,target,player); var num2=get.recoverEffect(target,target,player);
player.line(target); player.line(target);
if(target.isHealthy()) result.index=0; if(target.isHealthy()) result.index=0;
@ -865,7 +865,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
return (event.card.name=='sha'||get.type(event.card,false)=='delay')&& return (event.card.name=='sha'||get.type(event.card,false)=='delay')&&
event.player!=player&&!event.targets.contains(player)&&player.inRange(event.target); event.player!=player&&!event.targets.includes(player)&&player.inRange(event.target);
}, },
logTarget:'target', logTarget:'target',
check:function(event,player){ check:function(event,player){
@ -963,7 +963,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var next=player.chooseToDiscard('h','抵诽:弃置一张手牌或摸一张牌'); var next=player.chooseToDiscard('h','抵诽:弃置一张手牌或摸一张牌');
if(trigger.card){ if(trigger.card){
var suit=get.suit(trigger.card,false); var suit=get.suit(trigger.card,false);
if(lib.suit.contains(suit)){ if(lib.suit.includes(suit)){
next.set('suit',suit); next.set('suit',suit);
next.set('prompt2','然后若没有'+get.translation(suit)+'手牌则回复1点体力'); next.set('prompt2','然后若没有'+get.translation(suit)+'手牌则回复1点体力');
next.set('ai',function(card){ next.set('ai',function(card){
@ -985,7 +985,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.showHandcards(); player.showHandcards();
if(trigger.card){ if(trigger.card){
var suit=get.suit(trigger.card,false); var suit=get.suit(trigger.card,false);
if(!lib.suit.contains(suit)||!player.countCards('h',{suit:suit})) player.recover(); if(!lib.suit.includes(suit)||!player.countCards('h',{suit:suit})) player.recover();
} }
}, },
}, },
@ -1079,7 +1079,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var hs=player.getCards('h'); var hs=player.getCards('h');
return hs.length>0&&!player.hasSkillTag('noCompareSource')&&player.hasHistory('gain',function(evt){ return hs.length>0&&!player.hasSkillTag('noCompareSource')&&player.hasHistory('gain',function(evt){
for(var i of evt.cards){ for(var i of evt.cards){
if(hs.contains(i)) return true; if(hs.includes(i)) return true;
} }
return false; return false;
})&&game.hasPlayer(function(current){ })&&game.hasPlayer(function(current){
@ -1093,14 +1093,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
cards.addArray(evt.cards); cards.addArray(evt.cards);
}); });
cards=cards.filter(function(i){ cards=cards.filter(function(i){
return hs.contains(i); return hs.includes(i);
}); });
player.chooseCardTarget({ player.chooseCardTarget({
prompt:get.prompt('spyajun'), prompt:get.prompt('spyajun'),
prompt2:'操作提示:选择一张本回合新得到的牌作为拼点牌,然后选择一名拼点目标', prompt2:'操作提示:选择一张本回合新得到的牌作为拼点牌,然后选择一名拼点目标',
cards:cards, cards:cards,
filterCard:function(card){ filterCard:function(card){
return _status.event.cards.contains(card); return _status.event.cards.includes(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player.canCompare(target); return player.canCompare(target);
@ -1291,7 +1291,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
player.addTempSkill('spxizhan_spfangzong'); player.addTempSkill('spxizhan_spfangzong');
var target=trigger.player,card=result.cards[0],suit=get.suit(card,player); var target=trigger.player,card=result.cards[0],suit=get.suit(card,player);
if(!lib.suit.contains(suit)||(!target||!target.isIn())&&suit!='heart') return; if(!lib.suit.includes(suit)||(!target||!target.isIn())&&suit!='heart') return;
game.broadcastAll(function(suit){ game.broadcastAll(function(suit){
if(lib.config.background_speak) game.playAudio('skill','spxizhan'+(4-lib.suit.indexOf(suit))); if(lib.config.background_speak) game.playAudio('skill','spxizhan'+(4-lib.suit.indexOf(suit)));
},suit); },suit);
@ -1500,7 +1500,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
var target=trigger.source,hs=player.getCards('h'); var target=trigger.source,hs=player.getCards('h');
if(target&&target.isIn()&&hs.length>=cards.length&&cards.filter(function(i){ if(target&&target.isIn()&&hs.length>=cards.length&&cards.filter(function(i){
return hs.contains(i); return hs.includes(i);
}).length==cards.length&&player.canUse({name:'sha',cards:cards},target,false)){ }).length==cards.length&&player.canUse({name:'sha',cards:cards},target,false)){
var next=player.useCard({name:'sha'},cards,target,false); var next=player.useCard({name:'sha'},cards,target,false);
if(!target.getEquips(1).length) next.baseDamage=2; if(!target.getEquips(1).length) next.baseDamage=2;
@ -1548,7 +1548,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else event.finish(); else event.finish();
} }
'step 1' 'step 1'
if(player.getCards('h').contains(card)&&get.type(card,player)=='equip'&&player.hasUseTarget(card)) player.chooseUseTarget(card,true,'nopopup'); if(player.getCards('h').includes(card)&&get.type(card,player)=='equip'&&player.hasUseTarget(card)) player.chooseUseTarget(card,true,'nopopup');
'step 2' 'step 2'
var hs=target.getCards('h',function(card){ var hs=target.getCards('h',function(card){
return target.canUse(get.autoViewAs({name:'sha'},[card]),player,false); return target.canUse(get.autoViewAs({name:'sha'},[card]),player,false);
@ -1556,7 +1556,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(hs.length){ if(hs.length){
if(hs.length==1) event._result={bool:true,cards:hs}; if(hs.length==1) event._result={bool:true,cards:hs};
else target.chooseCard('h',true,'将一张牌当做【杀】对'+get.translation(player)+'使用',function(card){ else target.chooseCard('h',true,'将一张牌当做【杀】对'+get.translation(player)+'使用',function(card){
return _status.event.cards.contains(card); return _status.event.cards.includes(card);
}).set('cards',hs).set('ai',function(card){ }).set('cards',hs).set('ai',function(card){
return get.effect(_status.event.getParent().player,get.autoViewAs({name:'sha',},[card]),_status.event.player) return get.effect(_status.event.getParent().player,get.autoViewAs({name:'sha',},[card]),_status.event.player)
}) })
@ -1804,7 +1804,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'对'+get.translation(target2)+'使用一张杀,否则交给其两张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'对'+get.translation(target2)+'使用一张杀,否则交给其两张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',target2).set('addCount',false); }).set('sourcex',target2).set('addCount',false);
'step 4' 'step 4'
@ -1885,7 +1885,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.isDamaged()){ if(player.isDamaged()){
list.push('选项二'); list.push('选项二');
} }
if(list.contains('选项一')) list.push('背水!') if(list.includes('选项一')) list.push('背水!')
list.push('cancel2'); list.push('cancel2');
player.chooseControl(list).set('choiceList',list2).set('ai',function(target){ player.chooseControl(list).set('choiceList',list2).set('ai',function(target){
if(player.isDamaged()&&(player.hp<=2||!target.countCards('e',function(card){ if(player.isDamaged()&&(player.hp<=2||!target.countCards('e',function(card){
@ -1960,7 +1960,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=get.number(card); var num=get.number(card);
if(typeof num!='number') return false; if(typeof num!='number') return false;
var bs=player.getCards('h',function(cardx){ var bs=player.getCards('h',function(cardx){
return (get.number(cardx)>num&&!['','',''].contains(cardx.name)); return (get.number(cardx)>num&&!['','',''].includes(cardx.name));
}); });
if(bs.length<2) return 0; if(bs.length<2) return 0;
if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return; if(player.hasSkill('jiu')||player.hasSkill('tianxianjiu')) return;
@ -2221,7 +2221,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.discard(card); target.discard(card);
for(var i=0;i<ui.cardPile.childNodes.length;i++){ for(var i=0;i<ui.cardPile.childNodes.length;i++){
var type=get.type2(ui.cardPile.childNodes[i],false); var type=get.type2(ui.cardPile.childNodes[i],false);
if(!list.contains(type)){ if(!list.includes(type)){
list.push(type); list.push(type);
cards.push(ui.cardPile.childNodes[i]) cards.push(ui.cardPile.childNodes[i])
} }
@ -2626,7 +2626,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
locked:false, locked:false,
filter:function(event,player){ filter:function(event,player){
return get.type(event.card,false)!='delay'&&!player.getStorage('xingqi').contains(event.card.name); return get.type(event.card,false)!='delay'&&!player.getStorage('xingqi').includes(event.card.name);
}, },
content:function(){ content:function(){
player.markAuto('xingqi',[trigger.card.name]); player.markAuto('xingqi',[trigger.card.name]);
@ -2926,7 +2926,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forceDie:true, forceDie:true,
filter:function(event,player){ filter:function(event,player){
if(event.name=='die'&&player==event.player) return true; if(event.name=='die'&&player==event.player) return true;
return player.storage.mouli2.contains(event.player); return player.storage.mouli2.includes(event.player);
}, },
content:function(){ content:function(){
if(trigger.name=='die'&&player==trigger.player){ if(trigger.name=='die'&&player==trigger.player){
@ -2936,7 +2936,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return; return;
} }
player.storage.mouli2.remove(trigger.player); player.storage.mouli2.remove(trigger.player);
while(player.storage.mouli3.contains(trigger.player)) player.storage.mouli3.remove(trigger.player); while(player.storage.mouli3.includes(trigger.player)) player.storage.mouli3.remove(trigger.player);
if(!player.storage.mouli2.length) player.removeSkill('mouli_effect'); if(!player.storage.mouli2.length) player.removeSkill('mouli_effect');
}, },
}, },
@ -2947,7 +2947,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'dieAfter'}, trigger:{global:'dieAfter'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return event.player.storage.mouli2&&event.player.storage.mouli2.contains(player); return event.player.storage.mouli2&&event.player.storage.mouli2.includes(player);
}, },
content:function(){ content:function(){
player.loseMaxHp(2); player.loseMaxHp(2);
@ -3047,10 +3047,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card.cards&&card.cards.length) cards.addArray(card.cards); if(card.cards&&card.cards.length) cards.addArray(card.cards);
if(ui.selected.cards.length) cards.addArray(ui.selected.cards); if(ui.selected.cards.length) cards.addArray(ui.selected.cards);
if(!player.countCards('he',function(card){ if(!player.countCards('he',function(card){
return !cards.contains(card); return !cards.includes(card);
})) return; })) return;
if(!player.countCards('h',function(card){ if(!player.countCards('h',function(card){
return !cards.contains(card)&&get.color(card)=='black'&&get.value(card,player)<6; return !cards.includes(card)&&get.color(card)=='black'&&get.value(card,player)<6;
})) return 'zerotarget'; })) return 'zerotarget';
return 0.5; return 0.5;
} }
@ -3222,7 +3222,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.mingfa&&player.countCards('h')>0&&player.getCards('he').contains(player.storage.mingfa) return player.storage.mingfa&&player.countCards('h')>0&&player.getCards('he').includes(player.storage.mingfa)
&&!player.hasSkillTag('noCompareSource')&&game.hasPlayer(function(current){ &&!player.hasSkillTag('noCompareSource')&&game.hasPlayer(function(current){
return current!=player&&player.canCompare(current); return current!=player&&player.canCompare(current);
}); });
@ -3324,7 +3324,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
silent:true, silent:true,
firstDo:true, firstDo:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.mingfa&&event.cards.contains(player.storage.mingfa)&&player.getCards('h').contains(player.storage.mingfa); return player.storage.mingfa&&event.cards.includes(player.storage.mingfa)&&player.getCards('h').includes(player.storage.mingfa);
}, },
content:function(){ content:function(){
player.addGaintag(player.storage.mingfa,'mingfa'); player.addGaintag(player.storage.mingfa,'mingfa');
@ -3423,7 +3423,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.storage.yizhu&&player.storage.yizhu.length&& return player.storage.yizhu&&player.storage.yizhu.length&&
event.player!=player&&event.targets.length==1&& event.player!=player&&event.targets.length==1&&
event.cards.filter(function(i){ event.cards.filter(function(i){
return player.storage.yizhu.contains(i); return player.storage.yizhu.includes(i);
}).length>0; }).length>0;
}, },
logTarget:'player', logTarget:'player',
@ -3438,7 +3438,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.targets.length=0; trigger.targets.length=0;
trigger.getParent().triggeredTargets1.length=0; trigger.getParent().triggeredTargets1.length=0;
var list=trigger.cards.filter(function(i){ var list=trigger.cards.filter(function(i){
return player.storage.yizhu.contains(i); return player.storage.yizhu.includes(i);
}); });
player.unmarkAuto('yizhu',list); player.unmarkAuto('yizhu',list);
game.delayx(); game.delayx();
@ -3662,7 +3662,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
playerEnabled:function(card,player,target){ playerEnabled:function(card,player,target){
var info=get.info(card); var info=get.info(card);
if(info&&info.singleCard&&ui.selected.cards.length) return; if(info&&info.singleCard&&ui.selected.cards.length) return;
if(!player.getStorage('yinlang_block').contains(target)) return false; if(!player.getStorage('yinlang_block').includes(target)) return false;
}, },
}, },
onremove:true, onremove:true,
@ -4096,7 +4096,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:true, filterCard:true,
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return _status.event.list.contains(target); return _status.event.list.includes(target);
}, },
list:list, list:list,
selectTarget:list.length>1?1:-1, selectTarget:list.length>1?1:-1,
@ -4160,7 +4160,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:true, filterCard:true,
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return _status.event.list.contains(target); return _status.event.list.includes(target);
}, },
list:list, list:list,
selectTarget:list.length>1?1:-1, selectTarget:list.length>1?1:-1,
@ -4299,7 +4299,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
prompt2:'从游戏外或牌堆中获得一张【调剂盐梅】', prompt2:'从游戏外或牌堆中获得一张【调剂盐梅】',
content:function(){ content:function(){
if(!_status.tiaojiyanmei_suits||_status.tiaojiyanmei_suits.length>0){ if(!_status.tiaojiyanmei_suits||_status.tiaojiyanmei_suits.length>0){
if(!lib.inpile.contains('tiaojiyanmei')) lib.inpile.add('tiaojiyanmei'); if(!lib.inpile.includes('tiaojiyanmei')) lib.inpile.add('tiaojiyanmei');
if(!_status.tiaojiyanmei_suits) _status.tiaojiyanmei_suits=lib.suit.slice(0); if(!_status.tiaojiyanmei_suits) _status.tiaojiyanmei_suits=lib.suit.slice(0);
player.gain(game.createCard2('tiaojiyanmei',_status.tiaojiyanmei_suits.randomRemove(),6),'gain2'); player.gain(game.createCard2('tiaojiyanmei',_status.tiaojiyanmei_suits.randomRemove(),6),'gain2');
} }
@ -4612,7 +4612,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target:function(player,target){ target:function(player,target){
if(!ui.selected.cards.length) return 0; if(!ui.selected.cards.length) return 0;
var card=ui.selected.cards[0]; var card=ui.selected.cards[0];
if(player.hasSkill('ejian')&&!player.getStorage('ejian').contains(target)){ if(player.hasSkill('ejian')&&!player.getStorage('ejian').includes(target)){
var dam=get.damageEffect(target,player,target); var dam=get.damageEffect(target,player,target);
if(dam>0) return dam; if(dam>0) return dam;
var type=get.type(card,target),ts=target.getCards('he',function(card){ var type=get.type(card,target),ts=target.getCards('he',function(card){
@ -4651,9 +4651,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
var evt=event.getParent(),target=event.player; var evt=event.getParent(),target=event.player;
if(evt.name!='boming'||evt.player!=player||player.getStorage('ejian').contains(target)||!target.isIn()) return false; if(evt.name!='boming'||evt.player!=player||player.getStorage('ejian').includes(target)||!target.isIn()) return false;
var he=target.getCards('he'),card=event.cards[0]; var he=target.getCards('he'),card=event.cards[0];
if(!he.contains(card)) return false; if(!he.includes(card)) return false;
var type=get.type2(card); var type=get.type2(card);
for(var i of he){ for(var i of he){
if(i!=card&&get.type2(i)==type) return true; if(i!=card&&get.type2(i)==type) return true;
@ -4710,12 +4710,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return player.countCards('h')>0&&(!player.storage.hxrenshi2||game.hasPlayer(function(current){ return player.countCards('h')>0&&(!player.storage.hxrenshi2||game.hasPlayer(function(current){
return !player.storage.hxrenshi2.contains(current); return !player.storage.hxrenshi2.includes(current);
})) }))
}, },
filterCard:true, filterCard:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !player.storage.hxrenshi2||!player.storage.hxrenshi2.contains(target); return !player.storage.hxrenshi2||!player.storage.hxrenshi2.includes(target);
}, },
position:'h', position:'h',
discard:false, discard:false,
@ -4874,7 +4874,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else player.gain(card,'gain2'); else player.gain(card,'gain2');
'step 3' 'step 3'
if(player.isIn()&&player.getCards('h').contains(card)&&get.type(card,player)=='equip') player.chooseUseTarget(card,true,'nopopup'); if(player.isIn()&&player.getCards('h').includes(card)&&get.type(card,player)=='equip') player.chooseUseTarget(card,true,'nopopup');
}, },
onremove:true, onremove:true,
intro:{content:'已发动过#次'}, intro:{content:'已发动过#次'},
@ -5017,7 +5017,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
list.add(get.type2(evt.card,false)); list.add(get.type2(evt.card,false));
}); });
for(var i=0;i<ui.cardPile.childNodes.length;i++){ for(var i=0;i<ui.cardPile.childNodes.length;i++){
if(!list.contains(get.type2(ui.cardPile.childNodes[i],false))) return true; if(!list.includes(get.type2(ui.cardPile.childNodes[i],false))) return true;
} }
return false; return false;
}, },
@ -5028,7 +5028,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
for(var i=0;i<ui.cardPile.childNodes.length;i++){ for(var i=0;i<ui.cardPile.childNodes.length;i++){
var type=get.type2(ui.cardPile.childNodes[i],false); var type=get.type2(ui.cardPile.childNodes[i],false);
if(!list.contains(type)){ if(!list.includes(type)){
list.push(type); list.push(type);
cards.push(ui.cardPile.childNodes[i]) cards.push(ui.cardPile.childNodes[i])
} }
@ -5071,7 +5071,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
filter:function(event,player){ filter:function(event,player){
var list=[player,player.storage.xunyi2]; var list=[player,player.storage.xunyi2];
return list.contains(event.source)&&!list.contains(event.player); return list.includes(event.source)&&!list.includes(event.player);
}, },
logTarget:function(event,player){ logTarget:function(event,player){
return player.storage.xunyi2; return player.storage.xunyi2;
@ -5090,7 +5090,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
charlotte:true, charlotte:true,
filter:function(event,player){ filter:function(event,player){
var list=[player,player.storage.xunyi2]; var list=[player,player.storage.xunyi2];
return list.contains(event.player)&&!list.contains(event.source)&& return list.includes(event.player)&&!list.includes(event.source)&&
(player==event.player?player.storage.xunyi2:player).countCards('he')>0; (player==event.player?player.storage.xunyi2:player).countCards('he')>0;
}, },
logTarget:function(event,player){ logTarget:function(event,player){
@ -5140,7 +5140,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'equipAfter'}, trigger:{global:'equipAfter'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player==event.player||!event.player.getStorage('reduoji').length||!event.player.getCards('e').contains(event.card)) return false; if(player==event.player||!event.player.getStorage('reduoji').length||!event.player.getCards('e').includes(event.card)) return false;
var evt=event.getParent(2); var evt=event.getParent(2);
return evt.name=='useCard'&&evt.player==event.player; return evt.name=='useCard'&&evt.player==event.player;
}, },
@ -5191,7 +5191,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.name(card)!='sha') return false; if(get.name(card)!='sha') return false;
return lib.filter.filterCard.apply(this,arguments); return lib.filter.filterCard.apply(this,arguments);
},'引裾:对'+get.translation(player)+'使用一张杀,或跳过下回合的出牌阶段和弃牌阶段').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ },'引裾:对'+get.translation(player)+'使用一张杀,或跳过下回合的出牌阶段和弃牌阶段').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',player); }).set('sourcex',player);
"step 1" "step 1"
@ -5367,7 +5367,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(name!='sha'&&name!='juedou') return false; if(name!='sha'&&name!='juedou') return false;
return lib.filter.cardEnabled.apply(this,arguments); return lib.filter.cardEnabled.apply(this,arguments);
},'合击:是否对'+get.translation(trigger.targets[0])+'使用一张【杀】或【决斗】?').set('logSkill','heji').set('complexSelect',true).set('filterTarget',function(card,player,target){ },'合击:是否对'+get.translation(trigger.targets[0])+'使用一张【杀】或【决斗】?').set('logSkill','heji').set('complexSelect',true).set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',trigger.targets[0]).set('addCount',false); }).set('sourcex',trigger.targets[0]).set('addCount',false);
}, },
@ -5808,7 +5808,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(button){ check:function(button){
if(_status.event.getParent().type!='phase') return 1; if(_status.event.getParent().type!='phase') return 1;
var player=_status.event.player; var player=_status.event.player;
if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].contains(button.link[2])) return 0; if(['wugu','zhulu_card','yiyi','lulitongxin','lianjunshengyan','diaohulishan'].includes(button.link[2])) return 0;
return player.getUseValue({ return player.getUseValue({
name:button.link[2], name:button.link[2],
nature:button.link[3], nature:button.link[3],
@ -5835,7 +5835,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
hiddenCard:function(player,name){ hiddenCard:function(player,name){
if(!lib.inpile.contains(name)) return false; if(!lib.inpile.includes(name)) return false;
var type=get.type2(name); var type=get.type2(name);
return (type=='basic'||type=='trick')&&player.countMark('spwuku')>0&&player.countCards('she')>0&&!player.hasSkill('spmiewu2'); return (type=='basic'||type=='trick')&&player.countMark('spwuku')>0&&player.countCards('she')>0&&!player.hasSkill('spmiewu2');
}, },
@ -5888,13 +5888,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(num%5==0){ if(num%5==0){
var card=get.cardPile2(function(card){ var card=get.cardPile2(function(card){
return ['tao','jiu','zong','xionghuangjiu'].contains(card.name); return ['tao','jiu','zong','xionghuangjiu'].includes(card.name);
}); });
if(card) cards.push(card); if(card) cards.push(card);
} }
if(num%8==0){ if(num%8==0){
var card=get.cardPile2(function(card){ var card=get.cardPile2(function(card){
return ['juedou','wuzhong','zengbin','sadouchengbing','dongzhuxianji','tongzhougongji'].contains(card.name); return ['juedou','wuzhong','zengbin','sadouchengbing','dongzhuxianji','tongzhougongji'].includes(card.name);
}); });
if(card) cards.push(card); if(card) cards.push(card);
} }
@ -5994,7 +5994,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('spshanxi_bj'); game.addGlobalSkill('spshanxi_bj');
}, },
onremove:function(player){ onremove:function(player){
game.removeGlobalSkill('spshanxi_bj'); if(!game.hasPlayer(current=>current.hasSkill('spshanxi'),true)) game.removeGlobalSkill('spshanxi_bj');
}, },
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
direct:true, direct:true,
@ -6455,7 +6455,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var cards=[card]; var cards=[card];
if(card.cards) cards.addArray(card.cards); if(card.cards) cards.addArray(card.cards);
var fh=function(card){ var fh=function(card){
return !cards.contains(card); return !cards.includes(card);
}; };
if(!targets.length){ if(!targets.length){
if(get.attitude(player,target)<0){ if(get.attitude(player,target)<0){
@ -6478,7 +6478,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
var average=0; var average=0;
for(var i of targets) average+=i.countCards('h',fh); for(var i of targets) average+=i.countCards('h',fh);
if(!targets.contains(target)){ if(!targets.includes(target)){
var th=target.countCards('h',fh); var th=target.countCards('h',fh);
average+=th; average+=th;
average/=(targets.length+1); average/=(targets.length+1);

Some files were not shown because too many files have changed in this diff Show More