Merge pull request #743 from PZ157/PR-Branch

bugfix
This commit is contained in:
Spmario233 2023-12-26 22:56:06 +08:00 committed by GitHub
commit 7e5419c0af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 290 additions and 177 deletions

View File

@ -230,10 +230,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
value:[3,1],
useful:1,
},
wuxie:function(target,card,player,viewer,state){
let att=get.attitude(viewer,target), eff=get.effect(target,card,player,target);
if(status*get.attitude(viewer,player)>0&&!player.isMad() || status*eff*att>=0) return 0;
if(get.attitude(viewer,player)>=0 || _status.event.getRand('huogong_wuxie')*4>player.countCards('h')) return 0;
wuxie:function(target,card,player,viewer,status){
if(get.attitude(viewer,player._trueMe||player)>0) return 0;
if(status*get.attitude(viewer,target)*get.effect(target,card,player,target)>=0) return 0;
if(_status.event.getRand('huogong_wuxie')*4>player.countCards('h')) return 0;
},
result:{
player:function(player){
@ -302,7 +302,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
recastable:true,
ai:{
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:{
order:(item,player)=>{

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);
}
},
tag:{
damage:0.25,
natureDamage:0.25,
thunderDamage:0.25,
}
}
},
qibaodao:{

View File

@ -138,25 +138,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
next.set('prompt2','(在此之后仍需弃置一张手牌)');
}
next.set('ai1',function(card){
var target=_status.event.player;
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);
}
if(_status.event.useShan) return get.order(card);
return 0;
}).set('shanRequired',event.shanRequired);
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) bool=false;
if(event.shanRequired>1&&target.countCards('h','shan')<event.shanRequired-(event.shanIgnored||0)) return false;
if(get.damageEffect(target,player,target,get.nature(event.card))>=0) return false;
return true;
})());
//next.autochoose=lib.filter.autoRespondShan;
}
"step 2"
@ -260,89 +253,42 @@ game.import('card',function(lib,game,ui,get,ai,_status){
value:[5,3,1],
},
order:function(item,player){
let res=3.2;
if(player.hasSkillTag('presha',true,null,true)) res=10;
if(get.itemtype(player)!=='player') return res;
/*let uv=player.getUseValue(item,true);
if(uv<=0) return res;*/
let ignore=get.copy(ui.selected.cards),used=player.getCardUsable('sha')-1.5,ph=player.getCards('hs');
ignore.add(item);
if(typeof item==='object'&&item.cards) ignore.addArray(item.cards);
let na=get.natureList(item),number,natures=['thunder','fire','ice','kami'],nb;
if(typeof item==='object') number=get.number(item);
else number=0;
for(let i of ph){
if(ignore.includes(i)||get.name(i)!=='sha'||!lib.filter.cardEnabled(i,player)) continue;
nb=get.natureList(i);
if(na.length===nb.length&&(!na.length||na[0]===nb[0])){
if(number>get.number(i)) return res-0.15;
continue;
if(player.hasSkillTag('presha',true,null,true)) return 10;
if(typeof item==='object'&&item.hasNature('linked')){
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);
})&&game.countPlayer(function(current){
return current.isLinked()&&get.damageEffect(current,player,player,get.nature(item))>0;
})>1) return 3.1;
return 3;
}
if(used*(na.length-nb.length)>0) return res-0.15;
if(na.length===nb.length){
if(used*(natures.indexOf(na[0])-natures.indexOf(nb[0]))>0) return res-0.15;
}
/*usev=player.getUseValue(i,true);
if(usev>0&&used*(uv-usev)>0) return res-0.15;*/
}
return res;
return 3.05;
},
result:{
target:(player,target,card,isLink)=>{
if(target._sha_result_temp) return -1.5;
target._sha_result_temp=true;
let basic=1,eff=-1.5,zhu=target.isZhu&&target.identityShown;
target:function(player,target,card,isLink){
var eff=function(){
if(!isLink&&player.hasSkill('jiu')){
if(!target.hasSkillTag('filterDamage',null,{
player:player,
card:card,
jiu:player.hasSkill('jiu'),
})&&(player.hasSkill('jiu')||player.hasSkillTag('damageBonus',true,{
target:target,
card:card
}))){
if(target.hp<2) basic=5;
else if(target.hp===2) basic=3;
else basic=2;
jiu:true,
})){
if(get.attitude(player,target)>0){
return -7;
}
else if(target.hp<2) basic*=3;
if(zhu) eff*=Math.max(1,9/target.hp/target.hp);
if(isLink){
let rate=_status.event.getTempCache('sha_result','mayShan');
if(rate&&rate.id===card.sha_ai_id) rate=rate.rate;
delete target._sha_result_temp;
if(typeof rate==='boolean'||typeof rate==='number'){
if(rate>=1) return eff;
return basic*eff*(1.3-0.9*rate);
else{
return -4;
}
delete _status.event._tempCache['sha_result']['mayShan'];
return basic*eff;
}
let mayShan;
if(player.hasSkillTag('directHit_ai',true,{
return -0.5;
}
return -1.5;
}();
if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
target:target,
card:card,
},true)||game.hasNature(card,'stab')&&target.countCards('he')<2&&!target.hasSkillTag('noh')) mayShan=false;
else{
let temp=target.getKnownCards(player);
if(temp.some(i=>{
let name=get.name(i,target);
if(name==='shan'||name==='hufu') return lib.filter.cardEnabled(i,target,'forceEnable');
return false;
})) mayShan=true;
else mayShan=1-Math.pow(0.7,(target.hasSkillTag('respondShan',true,'use',true)?1:0)+target.countCards('hs')-temp.length);
}
if(game.hasNature(card,'linked',player)){
if(!_status.sha_ai_id) _status.sha_ai_id=1;
else _status.sha_ai_id++;
card.sha_ai_id=_status.sha_ai_id;
_status.event.putTempCache('sha_result','mayShan',{
id:_status.sha_ai_id,
rate:mayShan
});
}
delete target._sha_result_temp;
if(mayShan>=1) return eff;
return basic*eff*(1.3-0.9*mayShan);
},true)) return eff/1.2;
return eff;
},
},
tag:{
@ -1275,10 +1221,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
event._result={};
},
ai:{
wuxie:function(target,card,player,viewer){
if(player==game.me&&get.attitude(viewer,player)>0){
return 0;
}
wuxie:function(target,card,player,viewer,status){
if(player===game.me&&get.attitude(viewer,player._trueMe||player)>0) return 0;
if(status*get.attitude(viewer,target)*get.effect(target,card,player,target)>=0) return 0;
},
basic:{
order:5,
@ -1342,9 +1287,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
},
ai:{
wuxie:function(target,card,player,viewer){
if(get.attitude(viewer,player)>0&&get.attitude(viewer,target)>0){
return 0;
}
if(get.attitude(viewer,player._trueMe||player)>0) return 0;
},
basic:{
order:7.5,
@ -1621,7 +1564,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
},
ai:{
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);
if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false;
return val>3+Math.min(5,target.hp);
@ -1871,9 +1814,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
},
ai:{
wuxie:function(target,card,player,viewer){
if(player==game.me&&get.attitude(viewer,player)>0){
return 0;
}
if(player==game.me&&get.attitude(viewer,player._trueMe||player)>0) return 0;
},
basic:{
order:8,
@ -2084,7 +2025,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
result:{
target:function(player,target){
var num=game.countPlayer(function(current){
var skills=current.getSkills();
//var skills=current.getSkills();
for(var j=0;j<current.skills.length;j++){
var rejudge=get.tag(current.skills[j],'rejudge',current);
if(rejudge!=undefined){
@ -2129,9 +2070,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}
},
tag:{
// damage:1,
// natureDamage:1,
// thunderDamage:1,
damage:0.16,
natureDamage:0.16,
thunderDamage:0.16,
}
}
},

View File

@ -28,7 +28,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
},
ai:{
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=>{
let val=get.value(i,target),subtypes=get.subtypes(i);
if(val<8&&target.hp<2&&!subtypes.includes('equip2')&&!subtypes.includes('equip5')) return false;

View File

@ -1992,6 +1992,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
},
ai:{
notemp:true,
maixie_defend:true,
effect:{
target:(card,player,target)=>{
if(!get.tag(card,'damage')||!target.hasFriend()) return;
let die=[],extra=[null,0],temp;
game.filterPlayer(i=>{
if(!i.hasMark('twwuhun')) return false;
temp=get.attitude(target,i);
if(temp<0) die.push(i);
else{
temp=Math.sqrt(att)*i.countMark('twwuhun');
if(!extra[0]||temp<extra[1]) extra=[i,temp];
}
});
if(extra[0]&&!die.length) die.push(extra[0]);
if(target.hp+target.hujia>1&&(!die.length||get.attitude(player,target)<=0)) die.add(player);
if(die.length) return [1,0,1,die.reduce((num,i)=>{
return num-=2*get.sgnAttitude(player,i);
},0)];
}
}
}
},
shouli:{
audio:2,
@ -2249,6 +2273,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
});
}));
},
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,0.8*game.countPlayer(current=>{
return current.countCards('e',card=>{
return get.suit(card,current)==suit;
});
})];
}
}
}
},
changandajian_equip5:{
equipSkill:true,
@ -3214,7 +3254,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
effect:{
target:function(card,player,target){
if(card&&card.name=='qizhengxiangsheng') return 'zerotarget';
if(card&&card.name=='qizhengxiangsheng') return 'zeroplayertarget';
},
}
},
@ -3293,18 +3333,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!map[id]) map[id]={};
map[id].qizheng_name=result.control;
map[id].qizheng_aibuff=get.attitude(player,target)>0;
},
}
},
},
},
lingce:{
audio:2,
init:(player)=>{
game.addGlobalSkill('lingce_global');
},
trigger:{global:'useCard'},
forced:true,
filter:function(event,player){
return (event.card.name=='qizhengxiangsheng'||get.zhinangs().contains(event.card.name)||player.getStorage('dinghan').contains(event.card.name))&&event.card.isCard&&event.cards.length==1;
},
content:function(){player.draw()},
content:function(){
player.draw();
},
subSkill:{
global:{
ai:{
effect:{
player:(card,player,target)=>{
let num=0,nohave=true;
game.countPlayer(i=>{
if(i.hasSkill('lingce')){
nohave=false;
if(i.isIn()&&lib.skill.lingce.filter({card:card},i)) num+=get.sgnAttitude(player,i);
}
},true);
if(nohave) game.removeGlobalSkill('lingce_global');
else return [1,0.8*num];
}
}
}
}
}
},
dinghan:{
audio:2,
@ -4710,8 +4774,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
group:'new_wuhun_die',
ai:{
threaten:0.01,
notemp:true,
effect:{
target:(card,player,target)=>{
if(!get.tag(card,'damage')||!target.hasFriend()) return;
if(player.hasSkillTag('jueqing',null,target)) return 1.7;
let die=[null,1],temp;
game.filterPlayer(i=>{
temp=i.countMark('new_wuhun');
if(i===player&&target.hp+target.hujia>1) temp++;
if(temp>=die[1]){
if(!die[0]) die=[i,temp];
else{
let att=get.attitude(player,i);
if(att<die[1]) die=[i,temp];
}
}
});
if(die[0]) return [1,0,1,-6*get.sgnAttitude(player,die[0])/Math.max(1,target.hp)];
}
}
},
marktext:'魇',
intro:{

View File

@ -7974,9 +7974,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
init:function(player){
game.addGlobalSkill('huguan_all');
},
onremove:function(player){
game.removeGlobalSkill('huguan_all');
},
trigger:{global:'useCard'},
direct:true,
filter:function(event,player){
@ -8052,7 +8049,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
let num = -157;
game.countPlayer(function (current){
if(current.hasSkill('huguan')) num = Math.max(num, get.attitude(_status.event.player, current));
});
}, true);
if(num === -157) game.removeGlobalSkill('huguan_all');
else if(num === 0) player.storage.huguan_all = 6;
else if(num > 0) player.storage.huguan_all = 9;
@ -9168,7 +9165,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('fengxiang_use');
},
onremove:function(player){
game.removeGlobalSkill('fengxiang_use');
if(!game.hasPlayer(current=>current.hasSkill('fengxiang'),true)) game.removeGlobalSkill('fengxiang_use');
},
trigger:{player:'damageEnd'},
forced:true,
@ -9210,10 +9207,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:function(event,player){
for(let i of game.players){
if(i.hasSkill('fengxiang')) return false;
}
return true;
return !game.hasPlayer(current=>current.hasSkill('fengxiang'),true);
},
silent:true,
forceDie:true,
@ -10830,10 +10824,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(val<min) min=val;
});
if(att>0&&min<=0) return target.hasSkillTag('noe')?3:1;
if(att<0&&max>0){
if(att<=0&&max>0){
if(target.hasSkillTag('noe')) return max>6?(-max/3):0;
return -max;
}
if(player===target&&!player.hasSha()){
let ph=player.countCards('h');
if(game.hasPlayer(i=>{
if(!player.canUse('sha',i,true,true)||get.effect(i,{name:'sha'},player,player)<=0) return false;
return !ph||!i.mayHaveShan(player,'use');
})) return 1;
}
return 0;
},
},

View File

@ -678,13 +678,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
jsrgninghan:{
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'},
filter:function(event,player){
if(!event.hasNature('ice')) return false;
return event.cards&&event.cards.filterInD().length;
},
forced:true,
global:'jsrgninghan_frozen',
content:function(){
var cards=trigger.cards.filterInD();
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));
}
}
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>!current.hasSkill('jsrgninghan'),true);
},
silent:true,
forceDie:true,
content:()=>{
game.removeGlobalSkill('jsrgninghan_frozen');
}
},
},
@ -4025,8 +4039,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
'step 0'
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'
if(result.bool){
player.discardPlayerCard(player,'j',true);

View File

@ -3453,8 +3453,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.card&&event.card.name=='sha'&&event.player.isIn()&&player.countCards('he')>0;
},
check:function(event,player){
if(event.player.hasSkill('xinleiji')) return get.attitude(player,event.player)>0;
return true;
let att=get.attitude(player,event.player);
if(event.player.hasSkill('xinleiji')) return att>0;
if(att>0||event.player.isHealthy()) return true;
if(!event.source) return true;
att=get.attitude(player,event.source);
return att<=0||event.source.isTurnedOver();
},
prompt2:'令其进行判定,然后你可根据判定结果,弃置一张牌并令其执行对应效果。',
content:function(){
@ -5828,7 +5832,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('relongyin_order');
},
onremove:(player)=>{
game.removeGlobalSkill('relongyin_order');
if(!game.hasPlayer(current=>current.hasSkill('relongyin'),true)) game.removeGlobalSkill('relongyin_order');
},
trigger:{global:'useCard'},
direct:true,
@ -5917,7 +5921,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>current.hasSkill('relongyin'));
return !game.hasPlayer(current=>current.hasSkill('relongyin'),true);
},
silent:true,
forceDie:true,
@ -10115,7 +10119,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
content:function(){
"step 0"
var fang=player.countMark('olfangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.hp+1;
var fang=player.countMark('olfangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.hp+2;
player.chooseBool(get.prompt2('olfangquan')).set('ai',function(){
if(!_status.event.fang) return false;
return game.hasPlayer(function(target){
@ -13309,21 +13313,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
ai:{
effect:function(card,player,target){
if(!target.hasFriend()) return;
if(player==target) return;
if(player==target||!target.hasFriend()) return;
var type=get.type(card);
var nh=target.countCards();
var nh=Math.min(target.countCards(),game.countPlayer(i=>get.attitude(target,i)>0));
if(type=='trick'){
if(!get.tag(card,'multitarget')||get.info(card).singleCard){
if(get.tag(card,'damage')){
if(nh<3||target.hp<=2) return 0.8;
}
if(get.tag(card,'damage')) return [1.5,nh-1];
return [1,nh];
}
}
else if(type=='delay'){
return [0.5,0.5];
}
else if(type=='delay') return [0.5,0.5];
},
}
},
@ -14298,7 +14297,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
content:function(){
"step 0"
var fang=player.countMark('fangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.hp+1;
var fang=player.countMark('fangquan2')==0&&player.hp>=2&&player.countCards('h')<=player.maxHp+1;
player.chooseBool(get.prompt2('refangquan')).set('ai',function(){
if(!_status.event.fang) return false;
return game.hasPlayer(function(target){

View File

@ -3439,11 +3439,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 2"
if(result.bool){
player.chooseTarget(true,'请选择进行额外回合的目标角色',lib.filter.notMe).ai=function(target){
if(target.hasJudge('lebu')) return -1;
if(get.attitude(player,target)>4){
if(target.hasJudge('lebu')||get.attitude(player,target)<=0) return -1;
if(target.isTurnedOver()) return 0.18;
return get.threaten(target)/Math.sqrt(target.hp+1)/Math.sqrt(target.countCards('h')+1);
}
return -1;
};
}
else event.finish();
@ -3665,6 +3663,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
effect:{
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(_status.currentPhase==target) return;
if(card.name!='shuiyanqijunx'&&get.tag(card,'loseCard')&&target.countCards('he')){
@ -4154,7 +4153,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
effect:{
target:function(card,player,target,current){
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)];
}
}
}
}

View File

@ -5994,7 +5994,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('spshanxi_bj');
},
onremove:function(player){
game.removeGlobalSkill('spshanxi_bj');
if(!game.hasPlayer(current=>current.hasSkill('spshanxi'),true)) game.removeGlobalSkill('spshanxi_bj');
},
trigger:{player:'phaseUseBegin'},
direct:true,

View File

@ -5427,7 +5427,41 @@ game.import('character',function(lib,game,ui,get,ai,_status){
effect:{
player:function(card,player,target){
if((!card.isCard||!card.cards)&&get.itemtype(card)!='card') return;
if(target&&player!=target&&player.countCards('h')>player.getHandcardLimit()) return [0,0,0,0.5];
let cs=0;
if(target&&player!=target&&player.countCards('h',i=>{
if(card===i||card.cards&&card.cards.includes(i)){
cs++;
return false;
}
return true;
})>player.getHandcardLimit()){
let targets=[],evt=_status.event.getParent('useCard');
targets.addArray(ui.selected.targets);
if(evt&&evt.card==card) targets.addArray(evt.targets);
if(targets.length){
if(targets.length>1||!targets.includes(target)) return 'zeroplayertarget';
return;
}
let info=get.info(card);
if(!info||info.notarget||!info.filterTarget) return;
let range,select=get.copy(info.selectTarget),filter;
if(select===undefined) range=[1,1];
else if(typeof select==='number') range=[select,select];
else if(get.itemtype(select)==='select') range=select;
else if(typeof select==='function') range=select(card,player);
if(info.singleCard) range=[1,1];
game.checkMod(card,player,range,'selectTarget',player);
if(range[1]<-1) range=[1, 1];
else if(range[0]<0){
if(info.filterTarget===true) filter=game.players.length;
else filter=game.countPlayer(current=>{
return info.filterTarget(card,player,current);
});
range=[filter,filter];
}
if(range&&range[0]>1&&range[1]>1) return 'zeroplayertarget';
return [0,0,0,1];
}
},
},
},

View File

@ -8238,8 +8238,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseTarget(get.prompt2('yechou'),function(card,player,target){
return player!=target&&target.getDamagedHp()>1
}).set('forceDie',true).set('ai',function(target){
var num=get.attitude(_status.event.player,target);
return -num;
let att=get.attitude(_status.event.player,target);
if(att>0) return 0;
att=Math.sqrt(0.01-att);
return att*(get.distance(_status.currentPhase,target,'absolute')||game.players.length);
});
"step 1"
if(result.bool){

View File

@ -11909,7 +11909,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('twzhian_ai');
},
onremove:function(player){
game.removeGlobalSkill('twzhian_ai');
if(!game.hasPlayer((current)=>current.hasSkill('twzhian'),true)) game.removeGlobalSkill('twzhian_ai');
},
usable:1,
trigger:{global:'useCardAfter'},

View File

@ -4714,16 +4714,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseButton([1,num]).set('createDialog',dialog).set('filterButton',button=>{
return lib.filter.canBeDiscarded(button.link,_status.event.player,get.owner(button.link));
}).set('ai',button=>{
var card=button.link;
var player=_status.event.player,target=get.owner(card);
if(target==player&&ui.cardPile.childNodes.length>80){
if(ui.selected.buttons.some(i=>get.owner(i.link)==player)) return 0;
if(get.value(card,player)<6) return 60-get.value(card,player);
var player=_status.event.player,
target=get.owner(button.link),
num=ui.selected.buttons.filter(i=>get.owner(i.link)==target).length;
if(num>1&&player.hp+player.hujia>2) return 0;
if(target==player){
if(num) return -get.value(button.link,target);
if(ui.cardPile.childNodes.length>80) return 6-get.value(card,player);
return 0;
}
var num=ui.selected.buttons.filter(i=>get.owner(i.link)==target).length;
var val=get.buttonValue(button);
if(num>2) val/=Math.sqrt(num);
if(num===2) val/=4;
if(get.attitude(player,target)>0) return -val;
return val;
//return -(get.position(card)!='h'?get.value(card,target):(4.5+Math.random()-0.2*(num>2?1:0)))*get.attitude(player,target);
@ -4772,7 +4773,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('dcaichen_hit');
},
onremove:function(player){
game.removeGlobalSkill('dcaichen_hit');
if(!game.hasPlayer(current=>current.hasSkill('dcaichen'),true)) game.removeGlobalSkill('dcaichen_hit');
},
trigger:{
player:['loseAfter','phaseDiscardBefore'],
@ -4802,7 +4803,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hit:{
trigger:{player:'dieAfter'},
filter:function(event,player){
return !game.hasPlayer(current=>current.hasSkill('dcaichen'));
return !game.hasPlayer(current=>current.hasSkill('dcaichen'),true);
},
silent:true,
forceDie:true,
@ -5515,7 +5516,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
all:{
trigger:{player:'dieAfter'},
filter:function(event,player){
return !game.hasPlayer(current=>current.hasSkill('dcwumei_wake'));
return !game.hasPlayer(current=>current.hasSkill('dcwumei_wake'),true);
},
silent:true,
forceDie:true,
@ -9173,7 +9174,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
'step 0'
player.chooseTarget(get.prompt2('juetao'),lib.filter.notMe).set('ai',function(target){
return -get.attitude(_status.event.player,target);
let att=-get.attitude(_status.event.player,target);
if(att<=0) return -att;
if(target.hasSkillTag('nodamage')) return 0.01*att;
if(target.getEquip('tengjia')||target.getEquip('renwang')) return 0.2*att;
if(target.getEquip('bugua')) return 0.3*att;
if(target.getEquip(2)) return att/2;
return 1.2*att;
});
'step 1'
if(result.bool){

View File

@ -7558,7 +7558,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('longyin_order');
},
onremove:(player)=>{
game.removeGlobalSkill('longyin_order');
if(!game.hasPlayer(current=>current.hasSkill('longyin'),true)) game.removeGlobalSkill('longyin_order');
},
trigger:{global:'useCard'},
direct:true,
@ -7647,7 +7647,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>current.hasSkill('longyin'));
return !game.hasPlayer(current=>current.hasSkill('longyin'),true);
},
silent:true,
forceDie:true,
@ -11907,16 +11907,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{target:'useCardToTargeted'},
content:function(){
"step 0"
if(get.attitude(player,trigger.player)<0&&trigger.player.countDiscardableCards(player,'he')) player.addTempSkill('zhenlie_lose');
player.loseHp();
"step 1"
player.removeSkill('zhenlie_lose');
trigger.getParent().excluded.add(player);
"step 2"
if(trigger.player.countCards('he')){
if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.12);
player.discardPlayerCard(trigger.player,'he',true);
}
},
subSkill:{
lose:{
charlotte:true
}
},
ai:{
expose:0.3
effect:{
target:(card,player,target)=>{
if(target.hp<=0&&target.hasSkill('zhenlie_lose')&&get.tag(card,'recover')) return [1,1.2];
}
}
}
},
//吾彦...

View File

@ -2256,12 +2256,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
player.chooseToDiscard('h',2,get.prompt('feiyang'),'弃置两张手牌,然后弃置判定区里的一张牌').set('logSkill','feiyang').set('ai',function(card){
if(_status.event.goon) return 6-get.value(card);
return 0;
}).set('goon',player.hasCard(function(card){
}).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'));
},'j');
})());
"step 1"
if(result.bool){
player.discardPlayerCard(player,'j',true);