Merge pull request #744 from PZ157/PR-Branch

【振鞘】ai写反了
This commit is contained in:
Spmario233 2023-12-27 23:38:43 +08:00 committed by GitHub
commit 7c83ba1143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 216 additions and 95 deletions

View File

@ -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=[];
if(hs.length<2) return 0;
hs.forEach(i=>{
type.add(get.type2(i,target));
});
if(target.identity!=='qun'){
if(type.length>1) return 0;
return 1;
}
if(type.length<2||target.hp<3) return 1;
if(hs.length===2) return 0;
return 1;
});
'step 2' 'step 2'
if(result.index==0){ if(result.index==0){
var list=[],hs=target.getCards('h'); var list=[],hs=target.getCards('h');
@ -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)];
}
} }
} }
} }

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:{
@ -254,7 +264,7 @@ 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(typeof item==='object'&&item.hasNature('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&&current.isLinked()&&player.canUse(item,current,null,true)&&get.effect(current,item,player,player)>0&&lib.card.sha.ai.canLink(player,current,item);
})&&game.countPlayer(function(current){ })&&game.countPlayer(function(current){

View File

@ -1398,9 +1398,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 +1425,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();

View File

@ -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点体力';
@ -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){
@ -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);

View File

@ -1414,7 +1414,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;
switch(button.link){ switch(button.link){
case 'damage':return get.damageEffect(target,player,player); case 'damage':return get.damageEffect(target,player,player);
case 'draw':return get.effect(player,{name:'wuzhong'},player,player) case 'draw':return 2*get.effect(player,{name:'draw'},player,player)
case 'discard':return get.effect(target,{name:'guohe_copy2'},player,player)*Math.min(1.6,target.countCards('he')); case 'discard':return get.effect(target,{name:'guohe_copy2'},player,player)*Math.min(1.6,target.countCards('he'));
case 'use':return _status.event.getRand('minagi_peiquan')*4; case 'use':return _status.event.getRand('minagi_peiquan')*4;
} }
@ -1447,7 +1447,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return baseEffect+Math.max(...choices.map(choice=>{ return baseEffect+Math.max(...choices.map(choice=>{
switch(choice){ switch(choice){
case 'damage':return get.damageEffect(target,player,player); case 'damage':return get.damageEffect(target,player,player);
case 'draw':return get.effect(player,{name:'wuzhong'},player,player); case 'draw':return 2*get.effect(player,{name:'draw'},player,player);
case 'discard':return get.effect(target,{name:'guohe_copy2'},player,player)*Math.min(1.6,target.countCards('he')); case 'discard':return get.effect(target,{name:'guohe_copy2'},player,player)*Math.min(1.6,target.countCards('he'));
case 'use':return _status.event.getRand('minagi_peiquan')*4; case 'use':return _status.event.getRand('minagi_peiquan')*4;
} }
@ -2643,7 +2643,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;
var att=get.attitude(player,target); var att=get.attitude(player,target);
if(att>0||target.countCards('he')==0) return get.effect(target,{name:'wuzhong'},player,player)/2; if(att>0||target.countCards('he')==0) return get.effect(target,{name:'draw'},player,player);
return get.effect(target,{name:'guohe_copy2'},target,player); return get.effect(target,{name:'guohe_copy2'},target,player);
}); });
} }
@ -12458,7 +12458,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
choicex=choices.slice(0); choicex=choices.slice(0);
var getx=function(a){ var getx=function(a){
switch(a){ switch(a){
case 'draw':return get.effect(player,{name:'wuzhong'},player,player); case 'draw':return 2*get.effect(player,{name:'draw'},player,player);
case 'damage':return get.damageEffect(_status.event.getParent().target,player,player); case 'damage':return get.damageEffect(_status.event.getParent().target,player,player);
default:return 0; default:return 0;
} }

View File

@ -374,6 +374,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//神贾诩 //神贾诩
jxlianpo:{ jxlianpo:{
audio:2, audio:2,
init:()=>{
game.addGlobalSkill('jxlianpo_global');
},
onremove:()=>{
if(!game.hasPlayer(i=>i.hasSkill('jxlianpo'),true)) game.removeGlobalSkill('jxlianpo_global');
},
trigger:{global:'dieAfter'}, trigger:{global:'dieAfter'},
filter:function(event,player){ filter:function(event,player){
if(lib.skill.jxlianpo.getMax().length<=1) return false; if(lib.skill.jxlianpo.getMax().length<=1) return false;
@ -381,7 +387,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
forced:true, forced:true,
logTarget:'source', logTarget:'source',
global:'jxlianpo_global',
getMax:()=>{ getMax:()=>{
const map={ const map={
zhu:game.countPlayer(current=>{ zhu:game.countPlayer(current=>{
@ -521,20 +526,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
}, },
cardSavable:function(card,player,target){ cardSavable:function(card,player,target){
if(card.name=='tao'){ if(card.name=='tao'&&!player.hasSkill('jxlianpo')){
if(!lib.skill.jxlianpo.getMax().includes('zhu')) return; if(!lib.skill.jxlianpo.getMax().includes('zhu')) return;
if(player==target) return; if(player==target) return;
return false; return false;
} }
}, },
playerEnabled:function(card,player,target){ playerEnabled:function(card,player,target){
if(card.name=='tao'){ if(card.name=='tao'&&!player.hasSkill('jxlianpo')){
if(!lib.skill.jxlianpo.getMax().includes('zhu')) return; if(!lib.skill.jxlianpo.getMax().includes('zhu')) return;
if(player==target) return; if(player==target) return;
return false; return false;
} }
} }
}, },
trigger:{player:'dieAfter'},
filter:()=>{
return !game.hasPlayer(i=>i.hasSkill('jxlianpo'),true);
},
silent:true,
forceDie:true,
content:()=>{
game.removeGlobalSkill('jxlianpo_global');
}
}, },
}, },
}, },
@ -2193,6 +2207,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:lib.element.VCard({
name:card.name,
nature:'thunder'
},[card])
})) return;
return 2;
}
}
}
}, },
init:{ init:{
audio:'shouli', audio:'shouli',
@ -2286,6 +2316,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.suit(card,current)==suit; 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];
} }
} }
} }

View File

@ -6164,7 +6164,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
logTarget:'player', logTarget:'player',
check:function(event,player){ check:function(event,player){
var eff=get.effect(player,{name:'wuzhong'},player,player)/2; var eff=get.effect(player,{name:'draw'},player,player);
if(player.countCards('h')+1<=event.player.countCards('h')&&event.player.countCards('he')>0) eff+=get.effect(event.player,{name:'guohe_copy2'},player,player); if(player.countCards('h')+1<=event.player.countCards('h')&&event.player.countCards('he')>0) eff+=get.effect(event.player,{name:'guohe_copy2'},player,player);
return eff; return eff;
}, },
@ -7513,7 +7513,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{ result:{
player:function(player,target){ player:function(player,target){
var eff=get.recoverEffect(target,player,player); var eff=get.recoverEffect(target,player,player);
if(target.getDamagedHp()>1) eff+=get.effect(target,{name:'wuzhong'},player,player)/2; if(target.getDamagedHp()>1) eff+=get.effect(target,{name:'draw'},player,player);
return eff; return eff;
}, },
}, },

View File

@ -1583,8 +1583,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return false; return false;
})&&(player.hp>2||get.damageEffect(player,player,player)>=0)) return player; })&&(player.hp>2||get.damageEffect(player,player,player)>=0)) return player;
var info=game.filterPlayer().map(current=>{ var info=game.filterPlayer().map(current=>{
let damage=undamaged.includes(current),card={name:damage?'damage':'wuzhong'}; let damage=undamaged.includes(current),card={name:damage?'damage':'draw'};
return [current,get.effect(current,card,player,player)/(damage?1.5:1)]; return [current,get.effect(current,card,player,player)*(damage?0.7:2)];
}).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;
@ -5392,7 +5392,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(){
@ -5452,23 +5453,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)){
if(card.name!=='zhuge'||target.getCardUsable('sha')||!target.needsToDiscard()) return;
if(target.countCards('hs',i=>{
return get.name(i)==='sha'&&lib.filter.cardEnabled(i,target);
})>1) return 'zeroplayertarget';
}
}
}
},
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);
}
} }
}, },
//王允 //王允

View File

@ -1193,7 +1193,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
]).set('prompt','雀颂:请选择一项').set('ai',()=>{ ]).set('prompt','雀颂:请选择一项').set('ai',()=>{
var player=_status.event.player; var player=_status.event.player;
var len=_status.event.len; var len=_status.event.len;
return get.effect(player,{name:'wuzhong'},player,player)*len/2>=get.recoverEffect(player,player,player)?0:1; return get.effect(player,{name:'draw'},player,player)*len>=get.recoverEffect(player,player,player)?0:1;
}).set('len',len); }).set('len',len);
} }
} }
@ -3588,7 +3588,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var card of cards){ for(var card of cards){
var num=i+1; var num=i+1;
if(cards2.slice(0,num).contains(card)) continue; if(cards2.slice(0,num).contains(card)) continue;
if(get.tag(card,'damage')&&i>0) count+=get.effect(player,{name:'wuzhong'},player)/2; if(get.tag(card,'damage')&&i>0) count+=get.effect(player,{name:'draw'},player);
var targets2=targets.filter(current=>{ var targets2=targets.filter(current=>{
return player.canUse(card,current,false)&&get.distance(player,current)<=num&&get.effect(current,card,player,player)>0; return player.canUse(card,current,false)&&get.distance(player,current)<=num&&get.effect(current,card,player,player)>0;
}); });
@ -3827,7 +3827,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
getValue:function(player,mark,target){ getValue:function(player,mark,target){
let dis=Math.sqrt(get.distance(player,target,'absolute')); let dis=Math.sqrt(get.distance(player,target,'absolute'));
if(target.isTurnedOver()) dis++; if(target.isTurnedOver()) dis++;
let draw=get.effect(target,{name:'wuzhong'},target,target)/2; let draw=get.effect(target,{name:'draw'},target,target);
switch(mark.slice(6)){ switch(mark.slice(6)){
case 'wushi': case 'wushi':
if(target.hasJudge('bingliang')) return 12/(1+target.getCardUsable('sha',true)); if(target.hasJudge('bingliang')) return 12/(1+target.getCardUsable('sha',true));
@ -4486,7 +4486,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var att=get.attitude(player,target),eff=[0,0]; var att=get.attitude(player,target),eff=[0,0];
var hs=player.countCards('h'),ht=target.countCards('h'); var hs=player.countCards('h'),ht=target.countCards('h');
if(hs>=ht){ if(hs>=ht){
eff[0]=get.effect(target,{name:'wuzhong'},player,player)/2; eff[0]=get.effect(target,{name:'draw'},player,player);
if(player.storage.sbyaoming_status==0) eff[0]*=1.2; if(player.storage.sbyaoming_status==0) eff[0]*=1.2;
} }
if(hs<=ht){ if(hs<=ht){

View File

@ -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:lib.element.VCard({
name:card.name,
nature:'thunder'
},[card])
})) return;
return 2;
}
}
}
}, },
init:{ init:{
audio:'psshouli', audio:'psshouli',
@ -900,6 +916,32 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
threaten:100, threaten:100,
reverseEquip:true, reverseEquip:true,
ai:{
effect:{
player:(card,player,target)=>{
if(typeof card!=='object') return;
let suit=get.suit(card);
if(!lib.suit.contains(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];
}
}
}
} }
}, },
//战役篇田丰 //战役篇田丰
@ -3046,7 +3088,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){

View File

@ -139,7 +139,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()]);

View File

@ -3479,7 +3479,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
case 'diamond': case 'diamond':
if(target.isIn()){ if(target.isIn()){
str+=(',令'+strt+'摸两张牌'); str+=(',令'+strt+'摸两张牌');
goon=get.effect(target,{name:'wuzhong'},player,player); goon=2*get.effect(target,{name:'draw'},player,player);
} }
break; break;
case 'spade': case 'spade':
@ -11588,45 +11588,40 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
content:function (){ content:function (){
'step 0' 'step 0'
player.gainPlayerCard(get.prompt('new_liyu',trigger.player),trigger.player,'hej','visibleMove').set('ai',function(card){ player.gainPlayerCard(get.prompt('new_liyu',trigger.player),trigger.player,'hej','visibleMove').set('ai',function(button){
var player=_status.event.player; var player=_status.event.player,target=_status.event.target;
var evt=_status.event.target; if(get.attitude(player,target)>0&&get.position(button.link)==='j') return 4+get.value(button.link);
if(get.attitude(player,evt)>0&&get.position(card)=='j') return 4+get.value(card); if(get.type(button.link)==='equip') return _status.event.juedou;
if(get.type(card)=='equip'){
if(get.attitude(player,evt)>0&&game.hasPlayer(function(current){
return (player.canUse({name:'juedou'},current)&&current!=evt.target&&get.effect(current,{name:'juedou'},player,player)>2);
})){
return 5;
}
else if(game.hasPlayer(function(current){
return (player.canUse({name:'juedou'},current)&&current!=evt&&current!=player&&get.effect(current,{name:'juedou'},player,player)<0);
})){
return 1;
}
else return 4;
}
return 3; return 3;
}).set('logSkill',['new_liyu',trigger.player]); }).set('juedou',(()=>{
if(get.attitude(player,trigger.player)>0&&game.hasPlayer(function(current){
return (player.canUse({name:'juedou'},current)&&current!=trigger.player&&current!=player&&get.effect(current,{name:'juedou'},player,_status.event.player)>2);
})) return 5;
if(game.hasPlayer(function(current){
return (player.canUse({name:'juedou'},current)&&current!=trigger.player&&current!=player&&get.effect(current,{name:'juedou'},player,_status.event.player)<0);
})) return 1;
return 4;
})()).set('logSkill',['new_liyu',trigger.player]);
'step 1' 'step 1'
if(result.bool){ if(result.bool){
if(get.type(result.cards[0])!='equip'){ if(get.type(result.cards[0])!='equip'){
trigger.player.draw(); trigger.player.draw();
event.finish(); event.finish();
} }
else{ else{
if(!game.hasPlayer(function(current){ if(!game.hasPlayer(function(current){
return current!=player&&current!=trigger.player&&player.canUse('juedou',current); return current!=player&&current!=trigger.player&&player.canUse('juedou',current);
})){ })){
event.finish(); event.finish();
return; return;
} }
trigger.player.chooseTarget(true,function(card,player,target){ trigger.player.chooseTarget(true,function(card,player,target){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
return evt.player.canUse({name:'juedou'},target)&&target!=_status.event.player; return evt.player.canUse({name:'juedou'},target)&&target!=_status.event.player;
},'请选择一名角色,视为'+get.translation(player)+'对其使用【决斗】').set('ai',function(target){ },'请选择一名角色,视为'+get.translation(player)+'对其使用【决斗】').set('ai',function(target){
var evt=_status.event.getParent(); var evt=_status.event.getParent();
return get.effect(target,{name:'juedou'},evt.player,_status.event.player)-2; return get.effect(target,{name:'juedou'},evt.player,_status.event.player)-2;
}); });
} }
} }
else event.finish(); else event.finish();

View File

@ -3992,7 +3992,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');
@ -4047,7 +4047,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){
@ -4842,7 +4842,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;

View File

@ -3536,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{
@ -4146,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;

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;

View File

@ -3848,7 +3848,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var fn=function(control){ var fn=function(control){
switch(control){ switch(control){
case '选项一': case '选项一':
return player.getUseValue({name:'wuzhong'})/2; return player.getUseValue({name:'draw'});
case '选项二': case '选项二':
return Math.max.apply(Math,game.filterPlayer().map(current=>{ return Math.max.apply(Math,game.filterPlayer().map(current=>{
if(current.hasSkillTag('noh')) return -1; if(current.hasSkillTag('noh')) return -1;
@ -9252,7 +9252,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=_status.event.player,target=_status.event.getTrigger().player; var player=_status.event.player,target=_status.event.getTrigger().player;
if(target.hasCard(function(card){ if(target.hasCard(function(card){
return lib.filter.canBeDiscarded(card,player,target); return lib.filter.canBeDiscarded(card,player,target);
},'he')&&get.effect(target,{name:'guohe_copy2'},player,player)>get.effect(player,{name:'wuzhong'},player,player)/2) return 1; },'he')&&get.effect(target,{name:'guohe_copy2'},player,player)>get.effect(player,{name:'draw'},player,player)) return 1;
return 0; return 0;
}); });
'step 1' 'step 1'
@ -9640,7 +9640,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(num>0) max=Math.max(max,Math.sqrt(Math.min(2,num))*get.effect(target,{name:'guohe_copy2'},player,player)); if(num>0) max=Math.max(max,Math.sqrt(Math.min(2,num))*get.effect(target,{name:'guohe_copy2'},player,player));
}, },
选项四:function(target){ 选项四:function(target){
max=Math.max(max,get.effect(target,{name:'wuzhong'},player,player)); max=Math.max(max,2*get.effect(target,{name:'draw'},player,player));
}, },
}[choice]; }[choice];
game.countPlayer(function(current){ game.countPlayer(function(current){
@ -9671,7 +9671,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}], }],
['选择一名角色,令其摸两张牌',function(target){ ['选择一名角色,令其摸两张牌',function(target){
var player=_status.event.player; var player=_status.event.player;
return get.effect(target,{name:'wuzhong'},player,player); return 2*get.effect(target,{name:'draw'},player,player);
}] }]
][index]; ][index];
var targets=game.filterPlayer(function(current){ var targets=game.filterPlayer(function(current){

View File

@ -923,7 +923,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('ai',function(button){ }).set('ai',function(button){
var target=_status.event.target; var target=_status.event.target;
return [ return [
get.effect(target,{name:'wuzhong'},player,player)/2, get.effect(target,{name:'draw'},player,player),
get.effect(target,{name:'shunshou_copy2'},player,player), get.effect(target,{name:'shunshou_copy2'},player,player),
get.recoverEffect(target,player,player), get.recoverEffect(target,player,player),
][button.link]; ][button.link];
@ -8253,6 +8253,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
expose:0.5, expose:0.5,
maixie_defend:true
}, },
}, },
"yechou2":{ "yechou2":{

View File

@ -3151,7 +3151,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var eff=list.map(target=>{ var eff=list.map(target=>{
if(target==player) return 0; if(target==player) return 0;
return get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
}).reduce((p,c)=>p+c,0),eff2=list2.map(target=>get.effect(target,{name:'wuzhong'},player,player)).reduce((p,c)=>p+c,0); }).reduce((p,c)=>p+c,0),eff2=list2.map(target=>2*get.effect(target,{name:'draw'},player,player)).reduce((p,c)=>p+c,0);
if(_status.event.controls.contains('选项二')&&eff2>eff) return '选项二'; if(_status.event.controls.contains('选项二')&&eff2>eff) return '选项二';
if(eff>0) return 0; if(eff>0) return 0;
return 'cancel2'; return 'cancel2';
@ -3173,7 +3173,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return _status.event.getParent().list.contains(target); return _status.event.getParent().list.contains(target);
}).set('ai',function(target){ }).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.finish(); else event.finish();
} }
@ -12668,7 +12668,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!ui.selected.cards.length) return 0; if(!ui.selected.cards.length) return 0;
var sub=get.subtype(ui.selected.cards[0],false); var sub=get.subtype(ui.selected.cards[0],false);
var eff=get.effect(target,ui.selected.cards[0],player,target); var eff=get.effect(target,ui.selected.cards[0],player,target);
if(sub=='equip2') eff+=(get.effect(target,{name:'wuzhong'},target,target)/2); if(sub=='equip2') eff+=(get.effect(target,{name:'draw'},target,target));
if(target.isDamaged()&&(sub=='equip3'||sub=='equip4'||sub=='equip5')) eff+=get.recoverEffect(target,player,player); if(target.isDamaged()&&(sub=='equip3'||sub=='equip4'||sub=='equip5')) eff+=get.recoverEffect(target,player,player);
return eff; return eff;
}, },

View File

@ -5089,7 +5089,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
targetsx.removeArray(targets); targetsx.removeArray(targets);
return targetsx.reduce((p,c)=>{ return targetsx.reduce((p,c)=>{
return p+Math.max(0,get.effect(c,{name:'shunshou_copy2'},player,player)); return p+Math.max(0,get.effect(c,{name:'shunshou_copy2'},player,player));
},0)>get.effect(player,{name:'wuzhong'},player,player)/1.5?'选项一':'选项二'; },0)>get.effect(player,{name:'draw'},player,player)*1.3?'选项一':'选项二';
}()); }());
'step 1' 'step 1'
if(result.control=='cancel2'){ if(result.control=='cancel2'){
@ -8521,7 +8521,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
max=get.recoverEffect(current,player,player)*Math.min(evt.getParent().num,player.getDamagedHp()); max=get.recoverEffect(current,player,player)*Math.min(evt.getParent().num,player.getDamagedHp());
}, },
选项二:function(target){ 选项二:function(target){
max=get.effect(target,{name:'wuzhong'},player,player)/2*evt.getParent().num; max=get.effect(target,{name:'draw'},player,player)*evt.getParent().num;
}, },
选项三:function(target){ 选项三:function(target){
if(player.isTurnedOver()) max+=25; if(player.isTurnedOver()) max+=25;

View File

@ -995,7 +995,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var user=trigger.player,target=previous; var user=trigger.player,target=previous;
event.user=user;event.target=target; event.user=user;event.target=target;
if(user){ if(user){
user.chooseBool('是否对'+get.translation(target)+'发动【联对】?','令'+get.translation(target)+'摸两张牌').set('ai',()=>_status.event.bool).set('bool',get.effect(target,{name:'wuzhong'},user,user)>0); user.chooseBool('是否对'+get.translation(target)+'发动【联对】?','令'+get.translation(target)+'摸两张牌').set('ai',()=>_status.event.bool).set('bool',get.effect(target,{name:'draw'},user,user)>0);
} }
'step 1' 'step 1'
if(result.bool){ if(result.bool){
@ -2387,7 +2387,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('ai',function(target){ }).set('ai',function(target){
var player=_status.event.player; var player=_status.event.player;
var storage=player.getStorage('xinyaoming_kanon'); var storage=player.getStorage('xinyaoming_kanon');
if(get.attitude(player,target)>0&&!storage.contains('摸牌')&&target!=player) return get.effect(target,{name:'wuzhong'},player,player)/2; if(get.attitude(player,target)>0&&!storage.contains('摸牌')&&target!=player) return get.effect(target,{name:'draw'},player,player);
if(get.attitude(player,target)<0&&!storage.contains('弃牌')&&target!=player&&target.countCards('h')) return get.effect(target,{name:'guohe_copy2'},player,player); if(get.attitude(player,target)<0&&!storage.contains('弃牌')&&target!=player&&target.countCards('h')) return get.effect(target,{name:'guohe_copy2'},player,player);
if(get.attitude(player,target)>0&&!storage.contains('制衡')) return get.effect(target,{name:'kaihua'},player,player); if(get.attitude(player,target)>0&&!storage.contains('制衡')) return get.effect(target,{name:'kaihua'},player,player);
return 0; return 0;
@ -2424,7 +2424,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=_status.event.target; var target=_status.event.target;
var controls=_status.event.controls.slice(); var controls=_status.event.controls.slice();
var map={ var map={
'摸牌':get.effect(target,{name:'wuzhong'},player,player)/2, '摸牌':get.effect(target,{name:'draw'},player,player),
'弃牌':get.effect(target,{name:'guohe_copy2'},player,player), '弃牌':get.effect(target,{name:'guohe_copy2'},player,player),
'制衡':get.effect(target,{name:'kaihua'},player,player), '制衡':get.effect(target,{name:'kaihua'},player,player),
}; };

View File

@ -8366,6 +8366,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
}, },
boss_wuxin:{ boss_wuxin:{
audio:2,
mod:{
targetEnabled:function(card,player,target){
if(get.type(card)=='delay'&&player!=target) return false;
}
},
trigger:{player:'damageBefore'}, trigger:{player:'damageBefore'},
forced:true, forced:true,
priority:10, priority:10,
@ -8373,7 +8379,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
trigger.cancel(); trigger.cancel();
player.loseHp(); player.loseHp();
}, },
audio:2,
}, },
shenwei:{ shenwei:{
audio:2, audio:2,