细节优化

This commit is contained in:
157 2024-03-04 10:45:08 +08:00
parent a00ad6f772
commit ea34e08d4f
12 changed files with 88 additions and 63 deletions

View File

@ -2031,7 +2031,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(trigger.targets&&trigger.targets.length){
let result=yield player.chooseControl(['额外结算','摸一张牌']).set('prompt','实荐:请选择一项').set('prompt2',`${get.translation(trigger.card)}额外结算一次,或摸一张牌`).set('ai',()=>{
return get.event('choice');
}).set('choice',['basic','trick'].includes(get.type(trigger.card))&&trigger.targets.map(i=>get.effect(i,trigger.card,target,player)).reduce((p,c)=>p+c,0)>=5?0:1);
}).set('choice',function(){
if(trigger.card.name==='tiesuo'||!['basic','trick'].includes(get.type(trigger.card))) return 1;
if(trigger.targets.reduce((p,c)=>{
return p+get.effect(c,trigger.card,target,_status.event.player);
},0)>=get.effect(player,{name:'draw'},player,_status.event.player)) return 0;
return 1;
}());
if(result.index==0){
trigger.getParent().effectCount++;
game.log(player,'令',trigger.card,'额外结算一次');

View File

@ -14594,7 +14594,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.current.needsToDiscard()){
att=1;
}
player.chooseControlList(['令'+name+'摸一张牌展示','令'+name+'手牌上永久+1','弃置一张牌并令'+name+'获得一张本回进入弃牌堆的牌'],function(){
player.chooseControlList(['令'+name+'摸一张牌展示','令'+name+'手牌上永久+1','弃置一张牌并令'+name+'获得一张本回进入弃牌堆的牌'],function(){
return _status.event.att;
}).set('att',att);
}

View File

@ -1830,7 +1830,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
let result;
if(_status.connectMode) game.broadcastAll(()=>{_status.noclearcountdown=true});
if(choices.length==1) result={control:choices[0]};
else result=yield player.chooseControl(choices,'cancel2').set('choiceList',choiceList).set('prompt',get.prompt('dcxunjie')).set('ai',()=>{
else result=yield player.chooseControl(choices,'cancel2').set('choiceList',choiceList).set('prompt',get.prompt('dcxunjie')).set('ai',()=>{
return get.event('choice');
}).set('choice',(()=>{
const getValue=(index,target)=>{

View File

@ -5733,7 +5733,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=0;
for(var i of cards) num+=get.number(i,player);
num=num%13;
if(num==0) num=13;
if(num==0) num=13;
var card=get.cardPile2(function(card){
return get.number(card,false)==num;
});
@ -14293,34 +14293,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
filter:function(event,player){
if(!player.storage.yizan&&player.countCards('hes')<2) return false;
if(!player.hasCard(function(card){
return get.type(card)=='basic';
},'hs')) return false;
for(var name of lib.inpile){
if(get.type(name)!='basic') continue;
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true;
if(name=='sha'){
for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) return true;
}
}
}
if(!player.hasCard(function(card){
return get.type(card)=='basic';
},'hs')) return false;
for(var name of lib.inpile){
if(get.type(name)!='basic') continue;
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)) return true;
if(name=='sha'){
for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) return true;
}
}
}
return false;
},
chooseButton:{
dialog:function(event,player){
var list=[];
for(var name of lib.inpile){
if(get.type(name)!='basic') continue;
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)){
list.push(['基本','',name]);
}
if(name=='sha'){
for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]);
}
}
}
for(var name of lib.inpile){
if(get.type(name)!='basic') continue;
if(event.filterCard(get.autoViewAs({name},'unsure'),player,event)){
list.push(['基本','',name]);
}
if(name=='sha'){
for(var nature of lib.inpile_nature){
if(event.filterCard(get.autoViewAs({name,nature},'unsure'),player,event)) list.push(['基本','','sha',nature]);
}
}
}
return ui.create.dialog('翊赞',[list,'vcard'],'hidden');
},
check:function(button){
@ -15664,7 +15664,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
sunru:['dc_sunru','sunru'],
liuye:['dc_liuye','liuye'],
zhaotongzhaoguang:['dc_zhaotongzhaoguang','zhaotongzhaoguang'],
yangbiao:['yangbiao','dc_yangbiao','jsrg_yangbiao'],
yangbiao:['yangbiao','dc_yangbiao','jsrg_yangbiao'],
qiaozhou:['yj_qiaozhou','qiaozhou'],
sunhanhua:['dc_sunhanhua','sunhanhua'],
zhoubuyi:['zhoubuyi','yj_zhoubuyi'],

View File

@ -1141,7 +1141,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
});
if(!target){
event.finish();
return;
return;
}
event.target=target;
player.logSkill('sbqicai_gain',target);

View File

@ -7640,7 +7640,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 3'
game.delayx();
game.broadcastAll(function(onEnd){
_status.event.onEnd01=onEnd;
_status.event.onEnd01=onEnd;
if(_status.guhuoNode) _status.guhuoNode.listenTransition(onEnd,300);
},event.onEnd01);
'step 4'

View File

@ -15889,7 +15889,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
twkujian_info:'出牌阶段限一次。你可以将至多三张手牌交给一名其他角色,称为“谏”,你获得以下效果:当其他角色使用或打出牌后,若其中有“谏”,你与其各摸一张牌;当其他角色不因使用或打出而失去牌后,若其中有“谏”,你与其各弃置一张牌。',
twruilian:'睿敛',
twruilian2:'睿敛',
twruilian_info:'一轮游戏开始时,你可以选择一名角色。其下回合结束时,若其本回弃置过至少两张其的牌,你可以选择其本回合弃置过的一种类别,你与其各从弃牌堆中获得一张此类别的牌。',
twruilian_info:'一轮游戏开始时,你可以选择一名角色。其下回合结束时,若其本回弃置过至少两张牌,你可以选择其本回合弃置过的一种类别,你与其各从弃牌堆中获得一张此类别的牌。',
tw_xiahouen:'夏侯恩',
twfujian:'负剑',
twfujian_info:'锁定技。①游戏开始时或准备阶段若你的装备区里没有武器牌你随机将牌堆中的一张武器牌置入装备区。②当你于回合外失去武器牌后你失去1点体力。',

View File

@ -154,10 +154,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
order:9,
result:{
player:1,
player:function(player,target){
if(player.storage.dcsbquanmou) return 1;
return 1+game.countPlayer(i=>player!==i&&target!==i&&!i.hasSkill('false_mark')&&get.attitude(player,i)<0);
},
target:function(player,target){
if(!player.storage.dcsbquanmou) return 1.2;
return -0.2;
let res=target.hasSkillTag('noh')?0:-1;
if(player.storage.dcsbquanmou) return res+0.6;
return res;
},
},
},
@ -218,6 +222,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
ai:{
threaten:2.5,
effect:{
target(card,player,target){
if(get.tag(card,'damage')&&player&&player.hasSkill('dcsbquanmou_true')){
let tars=game.countPlayer(i=>player!==i&&target!==i&&get.damageEffect(i,player,player)>0);
return [1,0,1,6*Math.min(3,tars)/(3+Math.pow(target.countCards('h'),2))];
}
}
}
},
},
false:{
@ -253,10 +265,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
ai:{
filterDamage:true,
nodamage:true,
nofire:true,
nothunder:true,
skillTagFilter(player,tag,arg){
return (arg&&arg.player&&arg.player.hasSkill('dcsbquanmou_false'));
},
effect:{
target(card,player,target){
if(get.tag(card,'damage')&&player&&player.hasSkill('dcsbquanmou_false')) return 'zeroplayertarget';
}
}
},
},
},

View File

@ -4342,8 +4342,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
longxi2:'龙息',
longxi_info:'锁定技,在回合外每当你需要使用或打出一张卡牌时,若牌堆顶的前两张中有可使用或打出的牌,你立即获得之。',
zhuyue:'逐月',
zhuyue_info:'出牌阶段限一次,你可以弃置一张非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回使用的杀须指定选中角色为目标。',
zhuyue_info_alter:'出牌阶段限一次,你可以弃置一张黑色非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回使用的杀须指定选中角色为目标。',
zhuyue_info:'出牌阶段限一次,你可以弃置一张非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回使用的杀须指定选中角色为目标。',
zhuyue_info_alter:'出牌阶段限一次,你可以弃置一张黑色非基本牌并指定至多两个目标各随机弃置一张牌,若如此做,你本回使用的杀须指定选中角色为目标。',
guanri:'贯日',
guanri_info:'限制技你可以弃置两张红色手牌并失去1点体力然后对一名体力值不少于你的其他角色造成2点火焰伤害并弃置其所有装备牌。',
tianxian:'天弦',

View File

@ -13963,7 +13963,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
chengong:['chengong','re_chengong','sb_chengong'],
xunyou:['xunyou','re_xunyou'],
xuezong:['xuezong','tw_xuezong'],
huanghao:['huanghao','dc_huanghao','old_huanghao'],
huanghao:['huanghao','dc_huanghao','old_huanghao'],
caorui:['caorui','re_caorui','old_caorui'],
sunziliufang:['sunziliufang','dc_sunziliufang'],
liyan:['liyan','old_liyan'],

View File

@ -10587,10 +10587,10 @@ return event.junling=='junling5'?1:0;});
if(huoshao&&player.inline(target.getNext())) return -3;
if(target.isUnseen()) return 0;
if(player.isMajor()) return 0;
if(!player.isMajor()&&huoshao&&player.getNext().isMajor()) return -2;
if(!player.isMajor()&&huoshao&&player.getNext().isMajor()&&player.getNext().getNext().isMajor()) return -3;
if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()&&target.getNext().getNext().isMajor()) return 3;
if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()) return 1.5;
if(!player.isMajor()&&huoshao&&player.getNext().isMajor()) return -2;
if(!player.isMajor()&&huoshao&&player.getNext().isMajor()&&player.getNext().getNext().isMajor()) return -3;
if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()&&target.getNext().getNext().isMajor()) return 3;
if(!player.isMajor()&&huoshao&&!target.isMajor()&&target.getNext().isMajor()) return 1.5;
return 1;
},
target:function(player,target){

View File

@ -580,7 +580,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
case 'fan':list[i]='反贼';break;
case 'zhong':list[i]='忠臣';break;
case 'nei':list[i]='内奸';break;
case 'commoner':list[i]='平民'; break;
case 'commoner':list[i]='平民'; break;
case 'zhu':list[i]='主公';break;
case 'enemy':list[i]='敌方';break;
case 'friend':list[i]='友方';break;
@ -737,7 +737,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
switch(me.identity){
case 'fan':game.over(false);break;
case 'zhong':game.over(true);break;
case 'commoner':game.over(true); break;
case 'commoner':game.over(true); break;
default:game.over();break;
}
}
@ -745,7 +745,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
switch(me.identity){
case 'fan':game.over(true);break;
case 'zhong':game.over(false);break;
case 'commoner':game.over(true); break;
case 'commoner':game.over(true); break;
default:game.over();break;
}
}
@ -765,7 +765,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
}
else if(me.identity=='nei'){
if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&me.isAlive()){
if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&me.isAlive()){
game.over(true);
}
else{
@ -781,8 +781,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.over(false);
}
}
else if(me.identity=='commoner'){
game.over(true);
else if(me.identity=='commoner'){
game.over(true);
}
},
checkOnlineResult:function(player){
@ -794,7 +794,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(game.zhu.isAlive()){
return (player.identity=='zhu'||player.identity=='zhong'||player.identity=='mingzhong'||player.identity=='commoner'&&player.isAlive());
}
else if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&game.players[0].identity=='nei'||game.players[0].identity=='commoner'){
else if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&game.players[0].identity=='nei'||game.players[0].identity=='commoner'){
return player.isAlive();
}
else{
@ -1568,9 +1568,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
link=['zhu','zhong','nei','fan','mingzhong'].randomGet();
}
else{
var listi=['zhu','zhong','nei','fan'];
if(get.config('enable_commoner')&&!event.stratagemMode) listi.push('commoner');
link=listi.randomGet();
var listi=['zhu','zhong','nei','fan'];
if(get.config('enable_commoner')&&!event.stratagemMode) listi.push('commoner');
link=listi.randomGet();
}
for(var i=0;i<this.parentNode.childElementCount;i++){
if(this.parentNode.childNodes[i].link==link){
@ -2712,7 +2712,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}
}
if(this.identity=='fan'&&source) source.draw(3);
else if(this.identity=='commoner'&&source) source.draw(2);
else if(this.identity=='commoner'&&source) source.draw(2);
else if(this.identity=='mingzhong'&&source){
if(source.identity=='zhu'){
source.discard(source.getCards('he'));
@ -3506,11 +3506,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].ai.shown<1){
identity2='nei';break;
}
else if(game.players[i].identity=='commoner'&&
game.players[i].ai.identity_mark=='zhong'&&
game.players[i].ai.shown<1){
identity2='commoner'; break;
}
else if(game.players[i].identity=='commoner'&&
game.players[i].ai.identity_mark=='zhong'&&
game.players[i].ai.shown<1){
identity2='commoner'; break;
}
}
}
var zhongmode=false;
@ -3596,13 +3596,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6;
return Math.min(3,-situation);
case 'fan': return -8;
case 'commoner':
return Math.min(3,Math.max(-3,situation-0.2));
case 'commoner':
return Math.min(3,Math.max(-3,situation-0.2));
}
break;
case 'nei':
if(identity2=='zhu'&&game.players.length==2) return -10;
if(from!=to&&identity2!='zhu'&&identity2!='commoner'&&game.players.length==3) return -8;
if(from!=to&&identity2!='zhu'&&identity2!='commoner'&&game.players.length==3) return -8;
var strategy=get.aiStrategy();
if(strategy==4){
if(from==to) return 10;
@ -3706,8 +3706,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(game.zhu&&game.zhu.hp<=2) return -1;
return Math.min(3,situation);
case 'fan': return 5;
case 'commoner':
return 2*get.population('fan')-3;
case 'commoner':
return 2*get.population('fan')-3;
}
break;
case 'commoner':