Merge pull request #482 from mengxinzxz/PR-Branch

bugfix
This commit is contained in:
Spmario233 2023-10-08 14:37:17 +08:00 committed by GitHub
commit 5adfff3e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 114 additions and 29 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -188,6 +188,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
//族王浑
clanfuxun:{
mod:{
aiOrder:function(player,card,num){
if(player.isPhaseUsing()&&get.type(card)=='equip'&&get.equipValue(card,player)>0) return num+3;
},
},
locked:false,
audio:2,
enable:'phaseUse',
usable:1,
@ -206,6 +212,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!ui.selected.cards.length) return target.countGainableCards(player,'h')>0;
return true;
},
check:function(card){
var player=_status.event.player;
var evtx=_status.event.getParent('phaseUse');
var targets=game.filterPlayer(target=>target!=player&&lib.skill.clanfuxun.ai.result.target(player,target)!=0);
targets.sort((a,b)=>Math.abs(lib.skill.clanfuxun.ai.result.target(player,b))-Math.abs(lib.skill.clanfuxun.ai.result.target(player,a)));
if(evtx&&targets.length){
var target=targets[0];
if(!target.hasHistory('lose',evt=>{
return evt.getParent(3).name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards2.length;
})&&!target.hasHistory('gain',evt=>{
return evt.getParent().name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards.length;
})&&Math.abs(player.countCards('h')-target.countCards('h'))==2){
if(player.countCards('h')>target.countCards('h')) return 1/(get.value(card)||0.5);
return -1;
}
if(card.name=='du') return 20;
return -1;
}
if(card.name=='du') return 20;
return -1;
},
content:function(){
'step 0'
if(cards.length){
@ -261,9 +288,36 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
ai:{
order:2,
order:function(item,player){
var evtx=_status.event.getParent('phaseUse');
if(game.hasPlayer(current=>{
if(current==player||!evtx||get.attitude(player,current)==0) return false;
return !current.hasHistory('lose',evt=>{
return evt.getParent(3).name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards2.length;
})&&!current.hasHistory('gain',evt=>{
return evt.getParent().name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards.length;
})&&Math.abs(player.countCards('h')-current.countCards('h'))==2;
})) return 10;
return 2;
},
result:{
target:-1,
target:function(player,target){
var evtx=_status.event.getParent('phaseUse');
var num=get.sgn(get.attitude(player,target));
var targets=game.filterPlayer(current=>{
if(current==player||!evtx||get.attitude(player,current)==0) return false;
return !current.hasHistory('lose',evt=>{
return evt.getParent(3).name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards2.length;
})&&!current.hasHistory('gain',evt=>{
return evt.getParent().name!='clanfuxun'&&evt.getParent('phaseUse')==evtx&&evt.cards.length;
})&&Math.abs(player.countCards('h')-current.countCards('h'))==2;
});
if(targets.contains(target)){
if(player.countCards('h')<target.countCards('h')) return get.sgn(num+0.5)*Math.sqrt(2-num);
else return num*(2+num);
}
return get.sgn(num+0.5)*(1-num)*0.25;
},
},
},
subSkill:{
@ -272,9 +326,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.itemtype(card)=='card';
},
position:'hes',
filterTarget:lib.filter.targetEnabled,
filterTarget:lib.filter.filterTarget,
selectCard:1,
check:(card)=>6-get.value(card),
check:function(card){
var player=_status.event.player;
if(player.hasSkill('clanzhongliu')&&get.position(card)!='h') return 10-get.value(card);
return 5-get.value(card);
},
log:false,
precontent:function(){
delete event.result.skill;

View File

@ -227,7 +227,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.isOnline()){
player.storage.jsrgbashiing=true;
var list=['sha','shan'].filter(name=>trigger.filterCard({name:name},player,trigger));
var names=list.map(i=>'【'+i+'】').join('或');
var names=list.map(i=>'【'+get.translation(i)+'】').join('或');
var next=target.chooseToRespond('是否替'+get.translation(player)+'打出一张'+names+'',{name:list});
next.set('ai',function(){
var event=_status.event;

View File

@ -3156,13 +3156,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
xinkuanggu:{
trigger:{source:'damageSource'},
filter:function(event,player){
return get.distance(player,event.player)<=1&&event.num>0;
},
direct:true,
audio:'kuanggu',
audioname:['re_weiyan','ol_weiyan'],
trigger:{source:'damageSource'},
filter:function(event,player){
return event.kuangguCheck&&event.num>0;
},
direct:true,
preHidden:true,
content:function(){
'step 0'
@ -3177,7 +3177,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{
choice='draw_card';
}
var next=player.chooseDrawRecover(get.prompt(event.name)).set('logSkill',event.name).set('prompt2','摸一张牌或回复1点体力');
var next=player.chooseDrawRecover('###'+get.prompt(event.name)+'###摸一张牌或回复1点体力').set('logSkill',event.name);
next.set('choice',choice);
next.set('ai',function(){
return _status.event.getParent().choice;
@ -3190,7 +3190,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.goto(1);
}
}
}
},
group:'kuanggu_check',
},
xinliegong:{
shaRelated:true,
@ -6458,11 +6459,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageSource'},
forced:true,
filter:function(event,player){
return get.distance(player,event.player)<=1&&player.isDamaged();
return event.kuangguCheck&&player.isDamaged();
},
content:function(){
player.recover(trigger.num);
}
},
group:'kuanggu_check',
subSkill:{
check:{
charlotte:true,
trigger:{global:'damageBegin3'},
filter:function(event,player){
return event.source&&event.source==player&&get.distance(player,event.player)<=1;
},
firstDo:true,
priority:11+45+14,
forced:true,
popup:false,
content:function(){
trigger.kuangguCheck=true;
},
},
},
},
tianxiang:{
audio:2,
@ -8106,7 +8124,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
xinkuanggu:'狂骨',
gzbuqu:'不屈',
gzbuqu_info:'①当你扣减1点体力时若你的体力值小于1你可以将牌堆顶的一张牌置于你的武将牌上称为“创”。②当你回复1点体力时你移去一张“创”。③若你有“创”且点数均不相同则你不结算濒死流程。',
xinkuanggu_info:'当你对距离1以内的一名角色造成1点伤害后你可以回复1点体力或摸一张牌。',
xinkuanggu_info:'当你造成1点伤害后若受伤角色受到此伤害时你与其的距离不大于1你可以回复1点体力或摸一张牌。',
xinliegong_info:'①你使用【杀】可以选择你距离不大于此【杀】点数的角色为目标。②当你使用【杀】指定一个目标后你可以根据下列条件执行相应的效果1.其手牌数小于等于你的手牌数此【杀】不可被响应2.其体力值大于等于你的体力值,此【杀】伤害+1。',
jiewei_info:'当你的武将牌翻面后,你可以摸一张牌。然后你可以使用一张锦囊牌或装备牌,并可以在此牌结算后弃置场上一张同类型的牌',
releiji_info:'当你使用或打出一张【闪】时,你可令一名其他角色进行一次判定:若结果为梅花,其受到一点雷电伤害,然后你回复一点体力;若结果为黑桃,其受到两点雷电伤害。',
@ -8115,7 +8133,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jushou_info:'结束阶段你可以摸3张牌并将武将牌翻面。',
moon_jushou_info:'结束阶段,你可以摸一张牌,并将武将牌翻面。',
liegong_info:'当你使用【杀】时,若目标的手牌数大于等于你的体力值,或小于等于你的攻击范围,你可令此【杀】不能被响应。',
kuanggu_info:'锁定技,当你造成伤害后,若受伤角色与你的距离不大于1你回复X点体力X为伤害值。',
kuanggu_info:'锁定技,当你造成伤害后,若受伤角色受到此伤害时你与其的距离不大于1你回复X点体力X为伤害值。',
tianxiang_info:'当你即将受到伤害时你可以弃置一张♥手牌将伤害转移给一名其他角色然后该角色摸X张牌X为其已损失的体力值。',
hongyan_info:'锁定技,你区域内的黑桃牌和黑桃判定牌均视为红桃。',
buqu_info:'锁定技当你处于濒死状态时你亮出牌堆顶的一张牌并置于你的武将牌上称之为“创”。若此牌的点数与你武将牌上已有的“创”点数均不同则你回复至1体力。若点数相同则将此牌置入弃牌堆。只要你的武将牌上有“创”你的手牌上限便与“创”的数量相等。',

View File

@ -16325,10 +16325,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
yjixi:{
derivation:'rewangzun',
audio:'weidi',
trigger:{player:'phaseJieshuBegin'},
forced:true,
filter:function(event,player){
return player.countMark('yjixi')>=3;
if(player.phaseNumber<3) return false;
var num=0;
for(var i=player.actionHistory.length-1;i>=0;i--){
if(!player.actionHistory[i].isMe) continue;
if(_status.globalHistory[i].changeHp.some(evt=>evt.player==player&&evt.getParent().name=='loseHp')) return false;
else{
num++;
if(num>=3) break;
}
}
return true;
},
skillAnimation:true,
animationColor:'gray',
@ -16384,6 +16395,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
xinyongsi:{
audio:'yongsi1',
group:['xinyongsi1','xinyongsi2'],
locked:true,
},
@ -16397,7 +16409,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
player.draw(game.countGroup());
trigger.changeToZero();
}
},
},
xinyongsi2:{
audio:'yongsi2',
@ -16412,13 +16424,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 8-get.value(card);
};
'step 1'
if(!result.bool){
player.loseHp();
var num=player.countMark('yjixi');
if(num) player.removeMark('yjixi',num,false);
}
else player.addMark('yjixi',1,false);
}
if(!result.bool) player.loseHp();
},
},
lianzhu:{
audio:2,
@ -24828,7 +24835,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
refuhan:'扶汉',
refuhan_info:'限定技,回合开始时,你可以移去所有"梅影"标记并摸等量的牌然后从X张蜀势力武将牌中选择并获得至多两个技能限定技、觉醒技、隐匿技、使命技、主公技除外。若此时你是体力值最低的角色你回复1点体力X为场上角色数且X∈[4,+∞))。',
yjixi:'觊玺',
yjixi_info:'觉醒技,结束阶段,若你连续三回合没有因〖庸肆〗而失去过体力则你增加1点体力上限并回复1点体力然后选择一项获得技能〖妄尊〗摸两张牌并获得当前主公的主公技。',
yjixi_info:'觉醒技,结束阶段,若你已连续三个自己回合未失去过体力则你增加1点体力上限并回复1点体力然后选择一项获得技能〖妄尊〗摸两张牌并获得当前主公的主公技。',
xinyongsi:'庸肆',
xinyongsi1:'庸肆',
xinyongsi2:'庸肆',

View File

@ -4570,6 +4570,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
logTarget:'target',
init:function(player){
var target=_status.currentPhase;
if(!target||!target!=player) return;
if(!player.getStorage('twxiangyu_range').length){
var targets=game.filterPlayer(current=>{
return current.getHistory('lose').length;
@ -4591,7 +4593,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
mod:{
attackRange:function(player,num){
return num+player.getStorage('twxiangyu_range').length;
return num+Math.min(5,player.getStorage('twxiangyu_range').length);
},
},
subSkill:{
@ -4622,7 +4624,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
marktext:'羽',
intro:{
content:function(storage,player){
var num=storage?storage.length:0;
var num=Math.min(5,storage?storage.length:0);
return '攻击范围+'+num;
},
},

View File

@ -30819,7 +30819,7 @@
}
var fullskills=game.expandSkills(player.getSkills(false).concat(lib.skill.global));
var info=get.info(skill);
if((info.noHidden||get.mode()!='guozhan')&&!fullskills.contains(skill)){
if(((info&&info.noHidden)||get.mode()!='guozhan')&&!fullskills.contains(skill)){
return false;
}
if(!info.trigger) return false;