diff --git a/character/ddd.js b/character/ddd.js index 515e2ee68..b437eb13f 100644 --- a/character/ddd.js +++ b/character/ddd.js @@ -2031,7 +2031,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(trigger.targets&&trigger.targets.length){ let result=yield player.chooseControl(['额外结算','摸一张牌']).set('prompt','实荐:请选择一项').set('prompt2',`令${get.translation(trigger.card)}额外结算一次,或摸一张牌`).set('ai',()=>{ return get.event('choice'); - }).set('choice',['basic','trick'].includes(get.type(trigger.card))&&trigger.targets.map(i=>get.effect(i,trigger.card,target,player)).reduce((p,c)=>p+c,0)>=5?0:1); + }).set('choice',function(){ + if(trigger.card.name==='tiesuo'||!['basic','trick'].includes(get.type(trigger.card))) return 1; + if(trigger.targets.reduce((p,c)=>{ + return p+get.effect(c,trigger.card,target,_status.event.player); + },0)>=get.effect(player,{name:'draw'},player,_status.event.player)) return 0; + return 1; + }()); if(result.index==0){ trigger.getParent().effectCount++; game.log(player,'令',trigger.card,'额外结算一次'); diff --git a/character/diy.js b/character/diy.js index 3efeaaff6..9c060b60e 100755 --- a/character/diy.js +++ b/character/diy.js @@ -14594,7 +14594,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.current.needsToDiscard()){ att=1; } - player.chooseControlList(['令'+name+'摸一张牌展示','令'+name+'手牌上永久+1','弃置一张牌并令'+name+'获得一张本回进入弃牌堆的牌'],function(){ + player.chooseControlList(['令'+name+'摸一张牌展示','令'+name+'手牌上永久+1','弃置一张牌并令'+name+'获得一张本回合进入弃牌堆的牌'],function(){ return _status.event.att; }).set('att',att); } diff --git a/character/huicui.js b/character/huicui.js index 307c9dae0..783493b81 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -1830,7 +1830,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ let result; if(_status.connectMode) game.broadcastAll(()=>{_status.noclearcountdown=true}); if(choices.length==1) result={control:choices[0]}; - else result=yield player.chooseControl(choices,'cancel2').set('choiceList',choiceList).set('prompt',get.prompt('dcxunjie')).set('ai',()=>{ + else result=yield player.chooseControl(choices,'cancel2').set('choiceList',choiceList).set('prompt',get.prompt('dcxunjie')).set('ai',()=>{ return get.event('choice'); }).set('choice',(()=>{ const getValue=(index,target)=>{ diff --git a/character/mobile.js b/character/mobile.js index 53a3a3fce..d9b5283ae 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -5733,7 +5733,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var num=0; for(var i of cards) num+=get.number(i,player); num=num%13; - if(num==0) num=13; + if(num==0) num=13; var card=get.cardPile2(function(card){ return get.number(card,false)==num; }); @@ -14293,34 +14293,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(event,player){ if(!player.storage.yizan&&player.countCards('hes')<2) return false; - if(!player.hasCard(function(card){ - return get.type(card)=='basic'; - },'hs')) return false; - for(var name of lib.inpile){ - if(get.type(name)!='basic') continue; - if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true; - if(name=='sha'){ - for(var nature of lib.inpile_nature){ - if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) return true; - } - } - } + if(!player.hasCard(function(card){ + return get.type(card)=='basic'; + },'hs')) return false; + for(var name of lib.inpile){ + if(get.type(name)!='basic') continue; + if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true; + if(name=='sha'){ + for(var nature of lib.inpile_nature){ + if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) return true; + } + } + } return false; }, chooseButton:{ dialog:function(event,player){ var list=[]; - for(var name of lib.inpile){ - if(get.type(name)!='basic') continue; - if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)){ - list.push(['基本','',name]); - } - if(name=='sha'){ - for(var nature of lib.inpile_nature){ - if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]); - } - } - } + for(var name of lib.inpile){ + if(get.type(name)!='basic') continue; + if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)){ + list.push(['基本','',name]); + } + if(name=='sha'){ + for(var nature of lib.inpile_nature){ + if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]); + } + } + } return ui.create.dialog('翊赞',[list,'vcard'],'hidden'); }, check:function(button){ @@ -15664,7 +15664,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sunru:['dc_sunru','sunru'], liuye:['dc_liuye','liuye'], zhaotongzhaoguang:['dc_zhaotongzhaoguang','zhaotongzhaoguang'], - yangbiao:['yangbiao','dc_yangbiao','jsrg_yangbiao'], + yangbiao:['yangbiao','dc_yangbiao','jsrg_yangbiao'], qiaozhou:['yj_qiaozhou','qiaozhou'], sunhanhua:['dc_sunhanhua','sunhanhua'], zhoubuyi:['zhoubuyi','yj_zhoubuyi'], diff --git a/character/sb.js b/character/sb.js index 4223c5cf9..0927c735a 100644 --- a/character/sb.js +++ b/character/sb.js @@ -1141,7 +1141,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(!target){ event.finish(); - return; + return; } event.target=target; player.logSkill('sbqicai_gain',target); diff --git a/character/shenhua.js b/character/shenhua.js index 7372f033a..65daf1e5a 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -7640,7 +7640,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 3' game.delayx(); game.broadcastAll(function(onEnd){ - _status.event.onEnd01=onEnd; + _status.event.onEnd01=onEnd; if(_status.guhuoNode) _status.guhuoNode.listenTransition(onEnd,300); },event.onEnd01); 'step 4' diff --git a/character/tw.js b/character/tw.js index 72611083c..eed5598ab 100644 --- a/character/tw.js +++ b/character/tw.js @@ -15889,7 +15889,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ twkujian_info:'出牌阶段限一次。你可以将至多三张手牌交给一名其他角色,称为“谏”,你获得以下效果:当其他角色使用或打出牌后,若其中有“谏”,你与其各摸一张牌;当其他角色不因使用或打出而失去牌后,若其中有“谏”,你与其各弃置一张牌。', twruilian:'睿敛', twruilian2:'睿敛', - twruilian_info:'一轮游戏开始时,你可以选择一名角色。其下回合结束时,若其本回弃置过至少两张其的牌,你可以选择其本回合弃置过的一种类别,你与其各从弃牌堆中获得一张此类别的牌。', + twruilian_info:'一轮游戏开始时,你可以选择一名角色。其下回合结束时,若其本回合弃置过至少两张牌,你可以选择其本回合弃置过的一种类别,你与其各从弃牌堆中获得一张此类别的牌。', tw_xiahouen:'夏侯恩', twfujian:'负剑', twfujian_info:'锁定技。①游戏开始时或准备阶段,若你的装备区里没有武器牌,你随机将牌堆中的一张武器牌置入装备区。②当你于回合外失去武器牌后,你失去1点体力。', diff --git a/character/xianding.js b/character/xianding.js index cba10ea68..fe99eac88 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -154,10 +154,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ order:9, result:{ - player:1, + player:function(player,target){ + if(player.storage.dcsbquanmou) return 1; + return 1+game.countPlayer(i=>player!==i&&target!==i&&!i.hasSkill('false_mark')&&get.attitude(player,i)<0); + }, target:function(player,target){ - if(!player.storage.dcsbquanmou) return 1.2; - return -0.2; + let res=target.hasSkillTag('noh')?0:-1; + if(player.storage.dcsbquanmou) return res+0.6; + return res; }, }, }, @@ -218,6 +222,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ threaten:2.5, + effect:{ + target(card,player,target){ + if(get.tag(card,'damage')&&player&&player.hasSkill('dcsbquanmou_true')){ + let tars=game.countPlayer(i=>player!==i&&target!==i&&get.damageEffect(i,player,player)>0); + return [1,0,1,6*Math.min(3,tars)/(3+Math.pow(target.countCards('h'),2))]; + } + } + } }, }, false:{ @@ -253,10 +265,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, ai:{ - filterDamage:true, + nodamage:true, + nofire:true, + nothunder:true, skillTagFilter(player,tag,arg){ return (arg&&arg.player&&arg.player.hasSkill('dcsbquanmou_false')); }, + effect:{ + target(card,player,target){ + if(get.tag(card,'damage')&&player&&player.hasSkill('dcsbquanmou_false')) return 'zeroplayertarget'; + } + } }, }, }, @@ -13416,8 +13435,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.draw(); 'step 1' var next=player.chooseTarget().set('ai',function(target){ - var player=_status.event.player; - return get.damageEffect(target,player,player) + let player=_status.event.player; + if(target.hasSkillTag('filterDamage',null,{ + player:player + },true)) return get.damageEffect(target,player,player); + return 2*get.damageEffect(target,player,player); }); if(!['identity','guozhan'].includes(get.mode())){ next.set('prompt','选择一名体力值最大的敌方角色,对其造成2点伤害'); @@ -13445,9 +13467,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ result:{ target:function(player,target){ - if(!['identity','guozhan'].includes(get.mode())) return 1; - var target=game.filterPlayer(i=>i!=player).sort((a,b)=>b.hp-a.hp)[0]; - return target&&get.damageEffect(target,player,player)>0?1:0; + let es; + if(['identity','guozhan'].includes(get.mode())) es=game.hasPlayer(i=>{ + return i!=player&&!game.hasPlayer(j=>{ + return player!==j&&j.hp>i.hp; + })&&get.attitude(player,i)<0; + }); + else es=game.hasPlayer(i=>{ + return i.isEnemyOf(player)&&!game.hasPlayer(j=>{ + return j.hp>i.hp&&j.isEnemyOf(player); + })&&get.attitude(player,i)<0; + }); + if(es) return 2; + return -1.5; }, }, order:12, @@ -13456,26 +13488,38 @@ game.import('character',function(lib,game,ui,get,ai,_status){ subSkill:{ dying:{ trigger:{global:'dying'}, - forced:true, - popup:false, filter:function(event,player){ - var evt=event.getParent(2); - if(!evt||evt.name!='kuiji_content'||evt.player!=player) return false; - var list=game.filterPlayer(function(current){ - return current.isFriendOf(player); - }).sort(function(a,b){ - return a.hp-b.hp; - }); - return (list.length==1||list[0].hp{ + return current!==trigger.player&&!game.hasPlayer(i=>{ + return trigger.player!==i&&i.hpi.isDamaged()); + else list=game.filterPlayer(current=>{ + return current.isFriendOf(player)&&!game.hasPlayer(i=>{ + return i.hpi.isDamaged()); + if(list.length>1) player.chooseTarget('溃击:选择一名角色回复1点体力',(card,player,target)=>{ + return _status.event.list.includes(target); + },true).set('list',list).set('ai',target=>{ + return get.recoverEffect(target,player,_status.event.player); + }); + else if(list.length) event._result={bool:true,targets:list}; + else event._result={bool:false}; + 'step 1' + if(result.bool){ + let target=result.targets[0]; + player.logSkill('kuiji',target); + target.recover(); + } }, }, }, diff --git a/character/xianjian.js b/character/xianjian.js index b4889de9c..e4aca3408 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -4342,8 +4342,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ longxi2:'龙息', longxi_info:'锁定技,在回合外每当你需要使用或打出一张卡牌时,若牌堆顶的前两张中有可使用或打出的牌,你立即获得之。', zhuyue:'逐月', - zhuyue_info:'出牌阶段限一次,你可以弃置一张非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回使用的杀须指定选中角色为目标。', - zhuyue_info_alter:'出牌阶段限一次,你可以弃置一张黑色非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回使用的杀须指定选中角色为目标。', + zhuyue_info:'出牌阶段限一次,你可以弃置一张非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回合使用的杀须指定选中角色为目标。', + zhuyue_info_alter:'出牌阶段限一次,你可以弃置一张黑色非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回合使用的杀须指定选中角色为目标。', guanri:'贯日', guanri_info:'限制技,你可以弃置两张红色手牌并失去1点体力,然后对一名体力值不少于你的其他角色造成2点火焰伤害并弃置其所有装备牌。', tianxian:'天弦', diff --git a/character/yijiang.js b/character/yijiang.js index ec53d0cb3..83c9ca693 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -13963,7 +13963,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ chengong:['chengong','re_chengong','sb_chengong'], xunyou:['xunyou','re_xunyou'], xuezong:['xuezong','tw_xuezong'], - huanghao:['huanghao','dc_huanghao','old_huanghao'], + huanghao:['huanghao','dc_huanghao','old_huanghao'], caorui:['caorui','re_caorui','old_caorui'], sunziliufang:['sunziliufang','dc_sunziliufang'], liyan:['liyan','old_liyan'], diff --git a/mode/guozhan.js b/mode/guozhan.js index 65688b013..9b0e6e035 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -10587,10 +10587,10 @@ return event.junling=='junling5'?1:0;}); if(huoshao&&player.inline(target.getNext())) return -3; if(target.isUnseen()) return 0; if(player.isMajor()) return 0; - if(!player.isMajor()&&huoshao&&player.getNext().isMajor()) return -2; - if(!player.isMajor()&&huoshao&&player.getNext().isMajor()&&player.getNext().getNext().isMajor()) return -3; - if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()&&target.getNext().getNext().isMajor()) return 3; - if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()) return 1.5; + if(!player.isMajor()&&huoshao&&player.getNext().isMajor()) return -2; + if(!player.isMajor()&&huoshao&&player.getNext().isMajor()&&player.getNext().getNext().isMajor()) return -3; + if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()&&target.getNext().getNext().isMajor()) return 3; + if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()) return 1.5; return 1; }, target:function(player,target){ diff --git a/mode/identity.js b/mode/identity.js index fe6fd96bd..9e1e30cc2 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -580,7 +580,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ case 'fan':list[i]='反贼';break; case 'zhong':list[i]='忠臣';break; case 'nei':list[i]='内奸';break; - case 'commoner':list[i]='平民'; break; + case 'commoner':list[i]='平民'; break; case 'zhu':list[i]='主公';break; case 'enemy':list[i]='敌方';break; case 'friend':list[i]='友方';break; @@ -737,7 +737,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ switch(me.identity){ case 'fan':game.over(false);break; case 'zhong':game.over(true);break; - case 'commoner':game.over(true); break; + case 'commoner':game.over(true); break; default:game.over();break; } } @@ -745,7 +745,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ switch(me.identity){ case 'fan':game.over(true);break; case 'zhong':game.over(false);break; - case 'commoner':game.over(true); break; + case 'commoner':game.over(true); break; default:game.over();break; } } @@ -765,7 +765,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } else if(me.identity=='nei'){ - if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&me.isAlive()){ + if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&me.isAlive()){ game.over(true); } else{ @@ -781,8 +781,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.over(false); } } - else if(me.identity=='commoner'){ - game.over(true); + else if(me.identity=='commoner'){ + game.over(true); } }, checkOnlineResult:function(player){ @@ -794,7 +794,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(game.zhu.isAlive()){ return (player.identity=='zhu'||player.identity=='zhong'||player.identity=='mingzhong'||player.identity=='commoner'&&player.isAlive()); } - else if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&game.players[0].identity=='nei'||game.players[0].identity=='commoner'){ + else if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&game.players[0].identity=='nei'||game.players[0].identity=='commoner'){ return player.isAlive(); } else{ @@ -1568,9 +1568,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ link=['zhu','zhong','nei','fan','mingzhong'].randomGet(); } else{ - var listi=['zhu','zhong','nei','fan']; - if(get.config('enable_commoner')&&!event.stratagemMode) listi.push('commoner'); - link=listi.randomGet(); + var listi=['zhu','zhong','nei','fan']; + if(get.config('enable_commoner')&&!event.stratagemMode) listi.push('commoner'); + link=listi.randomGet(); } for(var i=0;i