调整缩进、修复描述、ai修复和优化

This commit is contained in:
157 2024-02-24 11:52:42 +08:00
parent a5b4c54bf0
commit 077a8a595d
17 changed files with 201 additions and 77 deletions

View File

@ -308,12 +308,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
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; 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:7.3,
if(player.hasCard(card=>{
return get.tag(card,'damage')&&game.hasNature(card)&&player.hasValueTarget(card);
},'hs')) return 7.3;
return 4.1;
},
useful:1.2, useful:1.2,
value:4 value:4
}, },

View File

@ -317,7 +317,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hasSkill('gzzongyu')) return 9; if(player.hasSkill('gzzongyu')) return 9;
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current.hasSkill('gzzongyu')&&get.attitude(player,current)<=0; return current.hasSkill('gzzongyu')&&get.attitude(player,current)<=0;
})) return 1; })) return 1;
return 7.2; return 7.2;
}, },
basic:{ basic:{

View File

@ -155,7 +155,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
next.set('useShan',(()=>{ next.set('useShan',(()=>{
if(target.hasSkillTag('noShan',null,event)) return false; if(target.hasSkillTag('noShan',null,event)) return false;
if(target.hasSkillTag('useShan',null,event)) return true; 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.baseDamage+event.extraDamage<=0 || target.isLink()&&game.hasNature(event.card)&&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.shanRequired>1&&target.mayHaveShan(target,'use',null,'count')<event.shanRequired-(event.shanIgnored||0)) return false;
if(event.baseDamage+event.extraDamage>=target.hp+ if(event.baseDamage+event.extraDamage>=target.hp+
((player.hasSkillTag('jueqing',false,target)||target.hasSkill('gangzhi'))?target.hujia:0)) return true; ((player.hasSkillTag('jueqing',false,target)||target.hasSkill('gangzhi'))?target.hujia:0)) return true;
@ -1271,33 +1271,39 @@ game.import('card',function(lib,game,ui,get,ai,_status){
value:5.5 value:5.5
}, },
result:{ result:{
target:-1.5, player(player, target, card) {
player:function(player,target,card){ if (player.hasSkillTag('directHit_ai', true, {
if(player.hasSkillTag('directHit_ai',true,{ target: target,
target:target, card: card
card:card, }, true)) return 0;
},true)){ if (get.damageEffect(target, player, target) >= 0) return 0;
return 0; let pd = get.damageEffect(player, target, player), att = get.attitude(player, target);
} if (att > 0 && get.damageEffect(target, player, player) > pd) return 0;
if(get.damageEffect(target,player,target)>0&&get.attitude(player,target)>0&&get.attitude(target,player)>0){ let ts = target.mayHaveSha(player, 'respond', null, 'count'), ps = player.mayHaveSha(player, 'respond', null, 'count');
return 0; if (ts < 1 && ts << 3 < Math.pow(player.hp, 2)) return 0;
} if (att > 0) {
var hs1=target.getCards('h','sha'); if (ts < 1) return 0;
var hs2=player.getCards('h','sha');
if(hs1.length>hs2.length+1){
return -2; return -2;
} }
var hsx=target.getCards('h'); if (ts - ps + Math.exp(0.8 - player.hp) < 1) return -ts;
if(hsx.length>2&&hs2.length==0&&hsx[0].number<6){ if (pd >= 0) return pd / get.attitude(player, player);
return -2; return -2 - ts;
} },
if(hsx.length>3&&hs2.length==0){ target(player, target, card) {
return -2; if (player.hasSkillTag('directHit_ai', true, {
} target: target,
if(hs1.length>hs2.length&&(!hs2.length||hs1[0].number>hs2[0].number)){ card: card
return -2; }, true)) return -2;
} let td = get.damageEffect(target, player, target);
return -0.5; if (td >= 0) return td / get.attitude(target, target);
let pd = get.damageEffect(player, target, player), att = get.attitude(player, target);
if (att > 0 && get.damageEffect(target, player, player) > pd) return -2;
let ts = target.mayHaveSha(player, 'respond', null, 'count'), ps = player.mayHaveSha(player, 'respond', null, 'count');
if (ts < 1) return -1.5;
if (att > 0) return -2;
if (ts - ps < 1) return -2 - ts;
if (pd >= 0) return -1;
return -ts;
} }
}, },
tag:{ tag:{

View File

@ -5870,7 +5870,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter(event,player){ filter(event,player){
var list=['wei','shu','wu','qun','key','jin']; var list=['wei','shu','wu','qun','key','jin'];
for(var i in list){ for(var i in list){
if(player.hasMark('kotori_yumo_'+list[i])) return true; if(player.hasMark('kotori_yumo_'+list[i])) return true;
} }
return false; return false;
}, },
@ -5879,7 +5879,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=['wei','shu','wu','qun','key','jin']; var list=['wei','shu','wu','qun','key','jin'];
var list2=[]; var list2=[];
for(var i of list){ for(var i of list){
if(player.hasMark('kotori_yumo_'+i)) list2.push('kotori_skill_'+i); if(player.hasMark('kotori_yumo_'+i)) list2.push('kotori_skill_'+i);
} }
list2.push('cancel2'); list2.push('cancel2');
player.chooseControl(list2).set('prompt','###是否发动【驭魔】?###弃置对应的标记并获得下列技能中的一个,或点取消,不获得技能').set('choice',function(){ player.chooseControl(list2).set('prompt','###是否发动【驭魔】?###弃置对应的标记并获得下列技能中的一个,或点取消,不获得技能').set('choice',function(){
@ -6090,7 +6090,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=['wei','shu','wu','qun','key','jin']; var list=['wei','shu','wu','qun','key','jin'];
var list2=[]; var list2=[];
for(var i of list){ for(var i of list){
if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').includes('kotori_yumo_'+i)) list2.push('kotori_yumo_'+i); if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').includes('kotori_yumo_'+i)) list2.push('kotori_yumo_'+i);
} }
list2.push('cancel2'); list2.push('cancel2');
return list2; return list2;
@ -6100,7 +6100,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=['wei','shu','wu','qun','key','jin']; var list=['wei','shu','wu','qun','key','jin'];
var list2=[]; var list2=[];
for(var i of list){ for(var i of list){
if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').includes('kotori_yumo_'+i)) list2.push('kotori_yumo_'+i); if(player.hasMark('kotori_yumo_'+i)&&!player.getStorage('kotori_huazhan2').includes('kotori_yumo_'+i)) list2.push('kotori_yumo_'+i);
} }
if(list2.includes('kotori_yumo_wei')) return 'kotori_yumo_wei'; if(list2.includes('kotori_yumo_wei')) return 'kotori_yumo_wei';
if(list2.includes('kotori_yumo_wu')) return 'kotori_yumo_wu'; if(list2.includes('kotori_yumo_wu')) return 'kotori_yumo_wu';

View File

@ -7454,6 +7454,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
jsrgtushe:{ jsrgtushe:{
audio:'xinfu_tushe', audio:'xinfu_tushe',
mod: {
aiOrder(player, card, num) {
if (get.tag(card, 'multitarget')) {
if (player.countCards('h', { type: 'basic' })) return num / 10;
return num * 10;
}
if (get.type(card) === 'basic') return num + 10;
},
aiValue(player, card, num) {
if (card.name === 'zhangba') {
let fact = (n) => {
if (n > 1) return n * fact(n - 1);
return 1;
}, basic = 0;
return fact(Math.min(player.countCards('hs', i => {
if (get.tag(i, 'multitarget')) return 2;
if (!['shan', 'tao', 'jiu'].includes(card.name)) return 1;
basic++;
}) / (1 + basic), player.getCardUsable('sha')));
}
if (['shan', 'tao', 'jiu'].includes(card.name)) {
if (player.getEquip('zhangba') && player.countCards('hs') > 1) return 0.01;
return num / 2;
}
if (get.tag(card, 'multitarget')) return num + game.players.length;
},
aiUseful(player, card, num) {
if (get.name(card, player) === 'shan') {
if (player.countCards('hs', i => {
if (card === i || card.cards && card.cards.includes(i)) return false;
return get.name(i, player) === 'shan';
})) return -1;
return num / Math.pow(Math.max(1, player.hp), 2);
}
}
},
trigger:{ trigger:{
player:'useCardToPlayered', player:'useCardToPlayered',
}, },
@ -7465,6 +7501,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(event,player){ check:function(event,player){
return !player.countCards('h',{type:'basic'}); return !player.countCards('h',{type:'basic'});
}, },
locked: false,
content:function (){ content:function (){
'step 0' 'step 0'
player.showHandcards(); player.showHandcards();
@ -7480,7 +7517,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
presha:true, presha:true,
pretao:true, pretao:true,
threaten:1.8, threaten:1.8,
}, effect: {
player(card, player, target) {
if (typeof card === 'object' && card.name !== 'shan' && get.type(card) !== 'equip' && !player.countCards('h', i => {
if (card === i || card.cards && card.cards.includes(i)) return false;
return get.type(i) === 'basic';
})) {
let targets = [], evt = _status.event.getParent('useCard');
targets.addArray(ui.selected.targets);
if (evt && evt.card == card) targets.addArray(evt.targets);
if (targets.length) return [1, targets.length];
if (get.tag(card, 'multitarget')) return [1, game.players.length - 1];
return [1, 1];
}
}
}
}
}, },
jsrgtongjue:{ jsrgtongjue:{
audio:2, audio:2,

View File

@ -13908,7 +13908,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
return false; return false;
} }
})) return -att; })) return -att;
} }
return 0; return 0;
} }
@ -13964,7 +13964,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 4' 'step 4'
if(result.bool&&result.links.length){ if(result.bool&&result.links.length){
var link=result.links[0]; var link=result.links[0];
if(get.position(link)=='e') event.targets[1].equip(link); if(get.position(link)=='e') event.targets[1].equip(link);
else if(link.viewAs) event.targets[1].addJudge({name:link.viewAs},[link]); else if(link.viewAs) event.targets[1].addJudge({name:link.viewAs},[link]);
else event.targets[1].addJudge(link); else event.targets[1].addJudge(link);
event.targets[0].$give(link,event.targets[1],false) event.targets[0].$give(link,event.targets[1],false)

View File

@ -8347,7 +8347,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.value(button.link,_status.event.getTrigger().target); return get.value(button.link,_status.event.getTrigger().target);
}); });
} }
if(draw) event.draw=true; if(draw) event.draw=true;
'step 3' 'step 3'
if(event.equip&&result.links&&result.links.length){ if(event.equip&&result.links&&result.links.length){
trigger.target.loseToDiscardpile(result.links); trigger.target.loseToDiscardpile(result.links);
@ -8523,7 +8523,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.discardPlayerCard(trigger.target,get.prompt('rejianchu',trigger.target)).set('ai',function(button){ player.discardPlayerCard(trigger.target,get.prompt('rejianchu',trigger.target)).set('ai',function(button){
if(!_status.event.att) return 0; if(!_status.event.att) return 0;
if(get.position(button.link)=='e'){ if(get.position(button.link)=='e'){
if(get.subtype(button.link)=='equip2') return 2*get.value(button.link); if(get.subtype(button.link)=='equip2') return 2*get.value(button.link);
return get.value(button.link); return get.value(button.link);
} }
return 1; return 1;

View File

@ -904,7 +904,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card.name=='sha'&&typeof player.storage.sbwusheng_effect[target.playerid]=='number') return true; if(card.name=='sha'&&typeof player.storage.sbwusheng_effect[target.playerid]=='number') return true;
}, },
cardUsableTarget:function(card,player,target){ cardUsableTarget:function(card,player,target){
if(card.name=='sha'&&typeof player.storage.sbwusheng_effect[target.playerid]=='number') return true; if(card.name!=='sha'||typeof player.storage.sbwusheng_effect[target.playerid]!=='number') return;
return player.storage.sbwusheng_effect[target.playerid]<3;
}, },
playerEnabled:function(card,player,target){ playerEnabled:function(card,player,target){
if(card.name!='sha'||typeof player.storage.sbwusheng_effect[target.playerid]!='number') return; if(card.name!='sha'||typeof player.storage.sbwusheng_effect[target.playerid]!='number') return;

View File

@ -2762,7 +2762,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.discardPlayerCard(trigger.target,get.prompt('jianchu',trigger.target),true).set('ai',function(button){ player.discardPlayerCard(trigger.target,get.prompt('jianchu',trigger.target),true).set('ai',function(button){
if(!_status.event.att) return 0; if(!_status.event.att) return 0;
if(get.position(button.link)=='e'){ if(get.position(button.link)=='e'){
if(get.subtype(button.link)=='equip2') return 2*get.value(button.link); if(get.subtype(button.link)=='equip2') return 2*get.value(button.link);
return get.value(button.link); return get.value(button.link);
} }
return 1; return 1;

View File

@ -4986,7 +4986,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=Math.max(1,player.hp),target=trigger.player; var num=Math.max(1,player.hp),target=trigger.player;
player.chooseCard('he',get.prompt('sheyi',target),'交给其至少'+get.cnNumber(num)+'张牌,防止即将受到的伤害('+trigger.num+'点)',[num,player.countCards('he')]).set('goon',function(){ player.chooseCard('he',get.prompt('sheyi',target),'交给其至少'+get.cnNumber(num)+'张牌,防止即将受到的伤害('+trigger.num+'点)',[num,player.countCards('he')]).set('goon',function(){
if(get.attitude(player,target)<0) return false; if(get.attitude(player,target)<0) return false;
if(trigger.num<target.hp&&get.damageEffect(target,trigger.source,player,trigger.nature)>=0) return false; if(trigger.num<target.hp&&get.damageEffect(target,trigger.source,player,trigger.nature)>=0) return false;
if(trigger.num<2&&target.hp>trigger.num) return 6/Math.sqrt(num); if(trigger.num<2&&target.hp>trigger.num) return 6/Math.sqrt(num);
if(target==get.zhu(player)) return 9; if(target==get.zhu(player)) return 9;
return 8/Math.sqrt(num); return 8/Math.sqrt(num);

View File

@ -9768,7 +9768,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
gxianyin_info:'出牌阶段限一次,你可以选择一种花色,将你的手牌中该花色的牌移至弃牌堆,然后选择另一种花色,从牌堆中获得等量的该花色的牌。', gxianyin_info:'出牌阶段限一次,你可以选择一种花色,将你的手牌中该花色的牌移至弃牌堆,然后选择另一种花色,从牌堆中获得等量的该花色的牌。',
// gxianyin_info_alter:'', // gxianyin_info_alter:'',
cyxianjiang:'仙匠', cyxianjiang:'仙匠',
cyxianjiang_info:'每当你使用一张牌指定一目标时,你可以复制对方装备区内的一张你没有的牌,并置入你的装备区,每回合对一名角色最多发动一次。', cyxianjiang_info:'每当你使用一张牌指定一目标时,你可以复制对方装备区内的一张你没有的牌,并置入你的装备区,每回合对一名角色最多发动一次。',
cyqiaoxie:'巧械', cyqiaoxie:'巧械',
cyqiaoxie_info:'每当你失去一张装备牌(使用除外),你可以随机观看三张机关牌,并使用其中一张。', cyqiaoxie_info:'每当你失去一张装备牌(使用除外),你可以随机观看三张机关牌,并使用其中一张。',
cyqiaoxie_info_alter:'每当你装备一件装备若你的手牌数不大于体力值你可以摸一张牌每当你失去一件装备牌你可以随机观看2张机关牌并使用其中一张。', cyqiaoxie_info_alter:'每当你装备一件装备若你的手牌数不大于体力值你可以摸一张牌每当你失去一件装备牌你可以随机观看2张机关牌并使用其中一张。',
@ -9923,7 +9923,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
pingshen2:'凭神', pingshen2:'凭神',
pingshen_info:'锁定技,受到过你的伤害的角色可在回合内对你发动一次【离魂】(每局限发动一次)。', pingshen_info:'锁定技,受到过你的伤害的角色可在回合内对你发动一次【离魂】(每局限发动一次)。',
xingzhui:'星坠', xingzhui:'星坠',
xingzhui_info:'出牌阶段限一次,你可以弃置一张牌,并令一名有牌的其他角色弃置一张类别相同的牌,则受到1点伤害。', xingzhui_info:'出牌阶段限一次,你可以弃置一张牌,并令一名有牌的其他角色弃置一张类别相同的牌,则受到1点伤害。',
lingxian:'凌仙', lingxian:'凌仙',
lingxian_info:'每当你于回合外使用或打出一张手牌,你可以选择攻击范围外的一名其他角色与你各摸一张牌。', lingxian_info:'每当你于回合外使用或打出一张手牌,你可以选择攻击范围外的一名其他角色与你各摸一张牌。',
shouyin:'守印', shouyin:'守印',
@ -9965,7 +9965,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
xiaomoyu:'魔愈', xiaomoyu:'魔愈',
xiaomoyu_info:'锁定技每当你于一个回合内首次造成伤害你回复1点体力若你没有受伤则改为摸一张牌。', xiaomoyu_info:'锁定技每当你于一个回合内首次造成伤害你回复1点体力若你没有受伤则改为摸一张牌。',
yihua:'移花', yihua:'移花',
yihua_info:'每当你成为其他角色的某张卡牌的一目标时,你可以弃置两张手牌,将使用者与目标对调。', yihua_info:'每当你成为其他角色的某张卡牌的一目标时,你可以弃置两张手牌,将使用者与目标对调。',
youyin:'游吟', youyin:'游吟',
youyin_info:'每当有其他角色弃置卡牌时若其中有非基本牌且你的手牌数不超过5你可以摸一张牌。', youyin_info:'每当有其他角色弃置卡牌时若其中有非基本牌且你的手牌数不超过5你可以摸一张牌。',
rexue:'热血', rexue:'热血',

View File

@ -3374,7 +3374,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var choices=['选项二']; var choices=['选项二'];
var choiceList=[ var choiceList=[
'令'+get.translation(target)+'回复1点体力', '令'+get.translation(target)+'回复1点体力',
'你'+get.translation(target)+'各摸一张牌' '你'+get.translation(target)+'各摸一张牌'
]; ];
if(target.isDamaged()) choices.unshift('选项一'); if(target.isDamaged()) choices.unshift('选项一');
else choiceList[0]='<span style="opacity:0.5">'+choiceList[0]+'</span>'; else choiceList[0]='<span style="opacity:0.5">'+choiceList[0]+'</span>';

View File

@ -4194,8 +4194,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
chengxin2_bg:'心', chengxin2_bg:'心',
chengxin_info:'每四轮限一次当一名角色进入濒死状态时你可以令其将体力值回复至1然后该角色防止一切伤害直到下一回合结束。', chengxin_info:'每四轮限一次当一名角色进入濒死状态时你可以令其将体力值回复至1然后该角色防止一切伤害直到下一回合结束。',
tianwu:'天舞', tianwu:'天舞',
tianwu_info:'每当你使用卡牌指定一名敌方角色为一目标,你可以对其施加一个随机的负面效果。', tianwu_info:'每当你使用卡牌指定一名敌方角色为一目标,你可以对其施加一个随机的负面效果。',
tianwu_info_alter:'每当你使用卡牌指定一名敌方角色为一目标,你可以对其施加一个随机的负面效果,每回合限发动一次。', tianwu_info_alter:'每当你使用卡牌指定一名敌方角色为一目标,你可以对其施加一个随机的负面效果,每回合限发动一次。',
liguang:'离光', liguang:'离光',
liguang_info:'结束阶段,你可以弃置一张手牌并将场上的一张牌移动到另一个合理的位置。', liguang_info:'结束阶段,你可以弃置一张手牌并将场上的一张牌移动到另一个合理的位置。',
shiying:'逝影', shiying:'逝影',

View File

@ -1490,9 +1490,46 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
"xinfu_tushe":{ "xinfu_tushe":{
audio:2, audio:2,
mod: {
aiOrder(player, card, num) {
if (get.tag(card, 'multitarget')) {
if (player.countCards('h', { type: 'basic' })) return num / 10;
return num * 10;
}
if (get.type(card) === 'basic') return num + 10;
},
aiValue(player, card, num) {
if (card.name === 'zhangba') {
let fact = (n) => {
if (n > 1) return n * fact(n - 1);
return 1;
}, basic = 0;
return fact(Math.min(player.countCards('hs', i => {
if (get.tag(i, 'multitarget')) return 2;
if (!['shan', 'tao', 'jiu'].includes(card.name)) return 1;
basic++;
}) / (1 + basic), player.getCardUsable('sha')));
}
if (['shan', 'tao', 'jiu'].includes(card.name)) {
if (player.getEquip('zhangba') && player.countCards('hs') > 1) return 0.01;
return num / 2;
}
if (get.tag(card, 'multitarget')) return num + game.players.length;
},
aiUseful(player, card, num) {
if (get.name(card, player) === 'shan') {
if (player.countCards('hs', i => {
if (card === i || card.cards && card.cards.includes(i)) return false;
return get.name(i, player) === 'shan';
})) return -1;
return num / Math.pow(Math.max(1, player.hp), 2);
}
}
},
trigger:{ trigger:{
player:"useCardToPlayered", player:"useCardToPlayered",
}, },
locked: false,
frequent:true, frequent:true,
filter:function (event,player){ filter:function (event,player){
if(get.type(event.card)=='equip') return false; if(get.type(event.card)=='equip') return false;
@ -1506,7 +1543,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
presha:true, presha:true,
pretao:true, pretao:true,
threaten:1.8, threaten:1.8,
}, effect: {
player(card, player, target) {
if (typeof card === 'object' && card.name !== 'shan' && get.type(card) !== 'equip' && !player.countCards('h', i => {
if (card === i || card.cards && card.cards.includes(i)) return false;
return get.type(i) === 'basic';
})) {
let targets = [], evt = _status.event.getParent('useCard');
targets.addArray(ui.selected.targets);
if (evt && evt.card == card) targets.addArray(evt.targets);
if (targets.length) return [1, targets.length];
if (get.tag(card, 'multitarget')) return [1, game.players.length - 1];
return [1, 1];
}
}
}
}
}, },
"xinfu_limu":{ "xinfu_limu":{
mod:{ mod:{
@ -1518,11 +1570,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
cardUsableTarget:function(card,player,target){ cardUsableTarget:function(card,player,target){
if(player.countCards('j')&&player.inRange(target)) return true; if(player.countCards('j')&&player.inRange(target)) return true;
}, },
aiValue:function(player,card,num){ aiOrder(player, card, num) {
if(card.name=='zhangba') return 15; if (get.type(card, 'delay') && player.canUse(card, player) && player.canAddJudge(card)) return 15;
if(player.getEquip('zhangba')&&player.countCards('hs')>1&&['shan','tao'].includes(card.name)) return 0; }
if(card.name=='shan'||card.name=='tao') return num/2;
},
}, },
locked:false, locked:false,
audio:2, audio:2,
@ -1542,21 +1592,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterTarget:function (card,player,target){ filterTarget:function (card,player,target){
return player==target; return player==target;
}, },
check:function(card){ check(card) {
var player=_status.event.player; var player = _status.event.player;
if(!player.getEquip('zhangba')&&player.countCards('hs','sha')<2){ if (!player.getEquip('zhangba')) {
if(player.countCards('h',function(cardx){ let damaged = player.maxHp - player.hp - 1;
return cardx!=card&&cardx.name=='shan'; if (player.countCards('h', function (cardx) {
})>0) return 0; if (cardx == card) return false;
var damaged=player.maxHp-player.hp-1; if (cardx.name == 'tao') {
var ts=player.countCards('h',function(cardx){ if (damaged < 1) return true;
return cardx!=card&&cardx.name=='tao'; damaged--;
}); }
if(ts>0&&ts>damaged) return 0; return ['shan', 'jiu'].includes(cardx.name);
}) > 0) return 0;
} }
if(card.name=='shan') return 15; if (card.name == 'shan') return 15;
if(card.name=='tao') return 10; if (card.name == 'tao' || card.name == 'jiu') return 10;
return 9-get.value(card); return 9 - get.value(card);
}, },
onuse:function (links,player){ onuse:function (links,player){
var next=game.createEvent('limu_recover',false,_status.event.getParent()); var next=game.createEvent('limu_recover',false,_status.event.getParent());
@ -1564,10 +1615,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){
next.setContent(function(){player.recover()}); next.setContent(function(){player.recover()});
}, },
ai:{ ai:{
result:{ result: {
target:1, target(player, target) {
let res = lib.card.lebu.ai.result.target(player, target);
if (target.isDamaged()) return res + 2 * Math.abs(get.recoverEffect(target, player, target));
return res;
},
ignoreStatus: true
}, },
order:12, order(item, player) {
if (player.hp > 1 && player.countCards('j')) return 0;
return 12;
},
effect: {
target(card, player, target) {
if (target.isPhaseUsing() && typeof card === 'object' && get.type(card, target) === 'delay' && !target.countCards('j')) {
let shas = target.getCards('hs', i => {
if (card === i || card.cards && card.cards.includes(i)) return false;
return get.name(i, target) === 'sha' && target.getUseValue(i) > 0;
}) - target.getCardUsable('sha');
if (shas > 0) return [1, 1.5 * shas];
}
}
}
}, },
}, },
}, },

View File

@ -571,7 +571,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(list.length==3) break; if(list.length==3) break;
} }
if(!list.length){event.finish();return;} if(!list.length){event.finish();return;}
if(player.storage._lingli>0) list.push('刷新'); if(player.storage._lingli>0) list.push('刷新');
event.list=list; event.list=list;
var dialog=game.getSkillDialog(event.list,'选择获得一个技能'); var dialog=game.getSkillDialog(event.list,'选择获得一个技能');
player.chooseControl(event.list).set('ai',function(){ player.chooseControl(event.list).set('ai',function(){

View File

@ -1666,7 +1666,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var cards=[]; var cards=[];
//因为是线下武将 所以同一张牌重复进入只算一张 //因为是线下武将 所以同一张牌重复进入只算一张
game.getGlobalHistory('cardMove',function(evt){ game.getGlobalHistory('cardMove',function(evt){
if(evt.name=='cardsDiscard'||(evt.name=='lose'&&evt.position==ui.discardPile)) cards.addArray(evt.cards); if(evt.name=='cardsDiscard'||(evt.name=='lose'&&evt.position==ui.discardPile)) cards.addArray(evt.cards);
}); });
return cards.length; return cards.length;
}, },

View File

@ -2752,7 +2752,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.countPlayer(function(current){ game.countPlayer(function(current){
var identity=current.identity.slice(1); var identity=current.identity.slice(1);
if(identity!='Zhu'){ if(identity!='Zhu'){
if(current.identity.indexOf('r')==0) red.push(current); if(current.identity.indexOf('r')==0) red.push(current);
else blue.push(current); else blue.push(current);
} }
}); });