Merge branch 'libccy:PR-Branch' into PR-Branch
This commit is contained in:
commit
f3ff8d8554
|
@ -41,16 +41,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
filter:function(event,player){
|
||||
if(player.getStorage('clanbaichu').contains(event.card.name)) return true;
|
||||
if(get.suit(event.card)=='none') return false;
|
||||
var str=(get.suit(event.card)+'、'+get.type2(event.card));
|
||||
var str=(get.suit(event.card)+'+'+get.type2(event.card));
|
||||
if(!player.getStorage('clanbaichu').contains(str)) return true;
|
||||
return !player.hasSkill('qice');
|
||||
},
|
||||
forced:true,
|
||||
content:function(){
|
||||
'step 0'
|
||||
if(player.getStorage('clanbaichu').contains(trigger.card.name)){
|
||||
event.draw=true;
|
||||
}
|
||||
if(get.suit(trigger.card)!='none'){
|
||||
var str=(get.suit(trigger.card)+'+'+get.type2(trigger.card));
|
||||
if(player.getStorage('clanbaichu').contains(str)){
|
||||
|
@ -68,6 +65,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var dialog=['请选择【百出】记录的普通锦囊牌牌名',[list,'vcard']];
|
||||
player.chooseButton(dialog,true).set('ai',function(button){
|
||||
var player=_status.event.player,name=button.link[2];
|
||||
if(name==_status.event.getTrigger().card.name) return 1919810;
|
||||
if(name=='wuxie') return 114514;
|
||||
return get.effect(player,{name:name},player,player)*(1+player.countCards('hs',name));
|
||||
});
|
||||
|
@ -85,7 +83,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
game.delayx();
|
||||
}
|
||||
'step 2'
|
||||
if(event.draw) player.chooseDrawRecover(true);
|
||||
if(player.getStorage('clanbaichu').contains(trigger.card.name)) player.chooseDrawRecover(true);
|
||||
},
|
||||
intro:{
|
||||
markcount:()=>0,
|
||||
|
@ -233,7 +231,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(result.bool){
|
||||
var card={
|
||||
name:result.links[0][2],
|
||||
nature:result.links[0][2],
|
||||
nature:result.links[0][3],
|
||||
};
|
||||
player.useCard(card,target,false);
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}).join('、')}`,
|
||||
},
|
||||
$createButton:function(item,type,position,noclick,node){
|
||||
node=ui.create.identityCard(item,position,null,noclick);
|
||||
node=ui.create.identityCard(item,position,noclick);
|
||||
node.link=item;
|
||||
return node;
|
||||
},
|
||||
|
@ -176,7 +176,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
[list,function(item,type,position,noclick,node){
|
||||
return lib.skill.jxlianpo.$createButton(item,type,position,noclick,node);
|
||||
}],
|
||||
])
|
||||
],true);
|
||||
'step 1'
|
||||
var choice=result.links[0],mark=`jxlianpo_mark_${choice}`;
|
||||
player.when({global:'roundStart'})
|
||||
|
@ -192,13 +192,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
});
|
||||
player.addMark(mark,1,false);
|
||||
var videoId=lib.status.videoId++;
|
||||
event.videoId=lib.status.videoId++;
|
||||
var createDialog=function(player,identity,id){
|
||||
var dialog=ui.create.dialog(`${get.translation(player)}展示了“${get.translation(identity+'2')}”的身份牌<br>`,'forcebutton');
|
||||
dialog.videoId=id;
|
||||
ui.create.spinningIdentityCard(identity,dialog);
|
||||
};
|
||||
game.broadcastAll(createDialog,player,choice,videoId);
|
||||
game.broadcastAll(createDialog,player,choice,event.videoId);
|
||||
var color='';
|
||||
if(choice=='zhong') color='#y';
|
||||
else if(choice=='fan') color='#g';
|
||||
|
@ -206,7 +206,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
game.log(player,'展示了',`${color}${get.translation(choice+'2')}`,'的身份牌');
|
||||
game.delay(3);
|
||||
'step 2'
|
||||
game.broadcastAll('closeDialog',videoId);
|
||||
game.broadcastAll('closeDialog',event.videoId);
|
||||
}
|
||||
},
|
||||
global:{
|
||||
|
|
|
@ -32,7 +32,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
baoxin:['male','qun',4,['mutao','yimou'],['character:tw_baoxin','die_audio:tw_baoxin']],
|
||||
jiangji:['male','wei',3,['twjichou','jilun'],['character:tw_jiangji','die_audio:tw_jiangji']],
|
||||
liwei:['male','shu',4,['jiaohua'],['character:tw_liwei','die:tw_liwei']],
|
||||
laimin:['male','shu',3,['laishou','luanqun']],
|
||||
laimin:['male','shu',3,['laishou','luanqun'],['unseen']],
|
||||
yj_zhoubuyi:['male','wei',3,['mbhuiyao','mbquesong']],
|
||||
xin_guozhao:['female','wei',3,['yichong','wufei']],
|
||||
xin_zhangyi:['male','shu',4,['xinwurong','shizhi']],
|
||||
|
@ -970,83 +970,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
// filterTarget:lib.filter.notMe,
|
||||
filterTarget:lib.filter.notMe,
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.damage('nosource');
|
||||
'step 1'
|
||||
if(game.countPlayer()<2) event.finish();
|
||||
if(game.countPlayer()==2) event._result={bool:true,targets:[game.findPlayer(i=>i!=player),player]};
|
||||
else player.chooseTarget(`慧夭:请选择两名角色`,`令不为你的第一名角色视为对第二名角色造成过1点伤害。`,(card,player,target)=>{
|
||||
if(!ui.selected.targets.length) return player!=target;
|
||||
return true;
|
||||
},2,true).set('multitarget',true).set('targetprompt',['伤害来源','受伤角色']).set('ai',target=>{
|
||||
return target==get.event('aiTargets')[ui.selected.targets.length]?10:0;
|
||||
}).set('aiTargets',lib.skill.mbhuiyao.getUnrealDamageTargets(player,[game.filterPlayer(i=>i!=player),game.filterPlayer()],true));
|
||||
'step 2'
|
||||
if(result.bool){
|
||||
var targets=result.targets;
|
||||
player.line2(targets,'green');
|
||||
game.delaye();
|
||||
targets[1].damage(targets[0],'unreal');
|
||||
}
|
||||
},
|
||||
getUnrealDamageTargets:(player,lists,forced)=>{
|
||||
const targets=[null,null];
|
||||
let sourceList,targetList;
|
||||
if(lists.length==2&&lists.every(l=>Array.isArray(l))){
|
||||
sourceList=lists[0]; targetList=lists[1];
|
||||
}
|
||||
else{
|
||||
sourceList=lists.slice(); targetList=lists.slice();
|
||||
}
|
||||
const list=targetList.map(current=>{
|
||||
const _hp=current.hp,_maxhp=current.maxHp;
|
||||
current.hp=100; current.maxHp=100;
|
||||
const att=-get.sgnAttitude(player,current);
|
||||
let val=get.damageEffect(current,player,current)*att;
|
||||
current.getSkills(null,false,false).forEach(skill=>{
|
||||
const info=get.info(skill);
|
||||
if(info&&info.ai&&(info.ai.maixie||info.ai.maixie_hp||info.ai.maixie_defend)) val=Math[val>0?'max':'min'](val>0?0.1:-0.1,val+2*att);
|
||||
});
|
||||
const eff=100/val+15;
|
||||
current.hp=_hp; current.maxHp=_maxhp;
|
||||
return [current,eff];
|
||||
}).sort((a,b)=>b[1]-a[1])[0];
|
||||
if(list[1]<0&&!forced) return targets;
|
||||
const targetx=list[0];
|
||||
targets[1]=targetx;
|
||||
const list2=sourceList.filter(i=>i!=targetx).map(current=>{
|
||||
const _hp=targetx.hp,_maxhp=targetx.maxHp;
|
||||
targetx.hp=100; targetx.maxHp=100;
|
||||
const att=-get.sgnAttitude(player,current);
|
||||
const eff=get.damageEffect(targetx,current,current)*att;
|
||||
targetx.hp=_hp; targetx.maxHp=_maxhp;
|
||||
return [current,eff];
|
||||
}).sort((a,b)=>b[1]-a[1])[0];
|
||||
if(!list2) return targets;
|
||||
targets[0]=list2[0];
|
||||
return targets;
|
||||
target.damage('unreal');
|
||||
},
|
||||
ai:{
|
||||
order:6,
|
||||
result:{
|
||||
player:function(player){
|
||||
if(player.getHp()+player.countCards('hs',card=>player.canSaveCard(card,player))<=1) return 0;
|
||||
var limit=25;
|
||||
var quesong=player.hasSkill('mbquesong')&&!player.getStat().damaged;
|
||||
if(quesong){
|
||||
limit-=7.5;
|
||||
}
|
||||
if(quesong&&game.hasPlayer(target=>{
|
||||
var att=get.attitude(player,target);
|
||||
if(att<0) return false;
|
||||
return att*Math.sqrt(Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)))>=10||target.getHp()<=2;
|
||||
})) return 1;
|
||||
if(!quesong&&game.hasPlayer(target=>{
|
||||
if(target==player) return false;
|
||||
target:function(player,target){
|
||||
if(player.getHp()+player.countCards('hs',card=>player.canSaveCard(card,player))<1) return 0;
|
||||
var _hp=target.hp,_maxhp=target.maxHp;
|
||||
target.hp=100; target.maxHp=100;
|
||||
target.hp=10; target.maxHp=10;
|
||||
var att=-get.sgnAttitude(player,target);
|
||||
var val=get.damageEffect(target,player,target)*att;
|
||||
target.getSkills(null,false,false).forEach(skill=>{
|
||||
|
@ -1055,10 +990,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
});
|
||||
var eff=100/val;
|
||||
target.hp=_hp; target.maxHp=_maxhp;
|
||||
if(eff<limit) return false;
|
||||
return true;
|
||||
})) return 1;
|
||||
return 0;
|
||||
var limit=17.5;
|
||||
if(player.hasSkill('mbquesong')){
|
||||
if(!player.getStat().damaged) limit+=7.5;
|
||||
}
|
||||
if(eff<limit) return 0;
|
||||
return eff/30;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1075,7 +1012,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.chooseTarget(get.prompt2('mbquesong')).set('ai',target=>{
|
||||
var player=_status.event.player;
|
||||
if(get.attitude(player,target)<=0) return 0;
|
||||
var len=Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)),hp=target.getHp();
|
||||
var len=[1,2,3,4,5].reduce((p,c)=>p+target.countEmptySlot(c),0);hp=target.getHp();
|
||||
return len+target.isTurnedOver()*2+1.5*Math.min(4,target.getDamagedHp())/(hp+1);
|
||||
});
|
||||
'step 1'
|
||||
|
@ -1083,17 +1020,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var target=result.targets[0];
|
||||
event.target=target;
|
||||
player.logSkill('mbquesong',target);
|
||||
var len=Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)),hp=target.getHp();
|
||||
if(hp==0||target.countCards('h')<hp) event._result={bool:false};
|
||||
var len=[1,2,3,4,5].reduce((p,c)=>p+target.countEmptySlot(c),0);hp=target.getHp();
|
||||
var forced=false;
|
||||
if(len==0) forced=true;
|
||||
if(hp==0||target.countCards('h')<hp){
|
||||
if(forced) event.finish();
|
||||
else event._result={bool:false};
|
||||
}
|
||||
else{
|
||||
var str=`是否弃置${get.cnNumber(hp)}张手牌并回复1点体力?或点击“取消”摸${get.cnNumber(len)}张牌并复原武将牌。`;
|
||||
target.chooseToDiscard(get.translation(player)+'对你发动了【雀颂】',str,'h',hp).set('ai',card=>{
|
||||
if(!get.event('goon')) return 0;
|
||||
var str=`${forced?'请':'是否'}弃置${get.cnNumber(hp)}张手牌并回复1点体力${forced?'':'?或点击“取消”摸'+get.cnNumber(len)+'张牌并复原武将牌'}。`;
|
||||
target.chooseToDiscard(get.translation(player)+'对你发动了【雀颂】',str,forced,'h',hp).set('ai',card=>{
|
||||
if(!_status.event.goon) return 0;
|
||||
return 6-get.value(card);
|
||||
}).set('goon',function(){
|
||||
var _hp=hp+target.isTurnedOver()*1.5;
|
||||
if(_hp+player.countCards('hs',card=>get.tag(card,'recover'))<=2-len/4) return true;
|
||||
return len<=_hp;
|
||||
if(forced||_hp+player.countCards('hs',card=>get.tag(card,'recover'))<=2-len/4) return true;
|
||||
return len>_hp;
|
||||
}());
|
||||
}
|
||||
}
|
||||
|
@ -1104,12 +1046,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event.finish();
|
||||
}
|
||||
else{
|
||||
target.draw(Math.max(1,[1,2,3,4].reduce((p,c)=>p+target.countEmptySlot(c),0)));
|
||||
target.draw([1,2,3,4,5].reduce((p,c)=>p+target.countEmptySlot(c),0));
|
||||
}
|
||||
'step 3'
|
||||
target.link(false);
|
||||
player.link(false);
|
||||
'step 4'
|
||||
target.turnOver(false);
|
||||
player.turnOver(false);
|
||||
},
|
||||
ai:{
|
||||
expose:0.2,
|
||||
|
@ -11287,11 +11229,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
content:function(){
|
||||
'step 0'
|
||||
player.chooseTarget(get.prompt('zhongzuo'),'令一名角色摸两张牌。若其已受伤,则你摸一张牌。').set('ai',function(target){
|
||||
if(target.hasSkillTag('nogain')) return target.isDamaged()?0:1;
|
||||
let att=get.attitude(_status.event.player,target);
|
||||
if(att<=0) return 0;
|
||||
if(target.isDamaged()) return 1+att/5;
|
||||
return att/5;
|
||||
if(target.hasSkillTag('nogain')&&target!=_status.currentPhase) return target.isDamaged()?0:1;
|
||||
var att=get.attitude(_status.event.player,target);
|
||||
if(target.isDamaged()) att=att*1.2;
|
||||
return att;
|
||||
});
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
|
@ -12605,7 +12546,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
'step 3'
|
||||
if(result.bool){
|
||||
trigger.player.gain(event.card,'give',player,'bySelf');
|
||||
player.chooseBool('是否对'+get.translation(trigger.player)+'造成1点伤害?').ai=function(){
|
||||
player.chooseBool('是否对'+get.translation(trigger.player)+'造成一点伤害?').ai=function(){
|
||||
return get.damageEffect(trigger.player,player,player)>0
|
||||
};
|
||||
}
|
||||
|
@ -12951,7 +12892,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event.ingame=game.hasPlayer(function(current){
|
||||
return ['re_xushu','xin_xushu','xushu','dc_xushu'].contains(current.name)||['re_xushu','xin_xushu','xushu','dc_xushu'].contains(current.name2);
|
||||
})?true:false;
|
||||
var prompt='请选择一名角色,令其回复1点体力并摸一张牌';
|
||||
var prompt='请选择一名角色,令其回复一点体力并摸一张牌';
|
||||
prompt+=event.ingame?',然后你摸一张牌。':'。';
|
||||
player.chooseTarget(prompt).set('ai',function(target){
|
||||
var player=_status.event.player;
|
||||
|
@ -15510,9 +15451,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
yj_zhoubuyi:'☆周不疑',
|
||||
yj_zhoubuyi_prefix:'☆',
|
||||
mbhuiyao:'慧夭',
|
||||
mbhuiyao_info:'出牌阶段限一次。你可以受到1点无来源伤害,然后你选择一名其他角色,令其视为对另一名角色造成过1点伤害。',
|
||||
mbhuiyao_info:'出牌阶段限一次。你可以受到1点无来源伤害,视为对一名其他角色造成过1点伤害。',
|
||||
mbquesong:'雀颂',
|
||||
mbquesong_info:'一名角色的结束阶段,若你于本回合受到过伤害,你可以令一名角色选择一项:1.摸等同于其装备区中非宝物栏中空栏的数量的牌并复原武将牌(至少摸一张牌);2.弃置等同于其体力值的手牌并回复1点体力。',
|
||||
mbquesong_info:'一名角色的结束阶段,若你于本回合受到过伤害,你可以令一名角色选择一项:1.摸等同于其装备区中空栏的数量的牌并复原武将牌;2.弃置等同于其体力值的手牌并回复1点体力。',
|
||||
xin_yuanshao:'手杀界袁绍',
|
||||
xin_yuanshao_prefix:'手杀界',
|
||||
re_baosanniang:'手杀鲍三娘',
|
||||
|
|
|
@ -38,8 +38,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
sb_liubiao:['male','qun',3,['sbzishou','sbzongshi']],
|
||||
sb_zhurong:['female','shu',4,['sblieren','sbjuxiang']],
|
||||
sb_menghuo:['male','shu',4,['sbhuoshou','sbzaiqi']],
|
||||
sb_yl_luzhi:['male','qun',3,['nzry_mingren','sbzhenliang']],
|
||||
sb_xiaoqiao:['female','wu',3,['sbtianxiang','xinhongyan']],
|
||||
sb_yl_luzhi:['male','qun',3,['nzry_mingren','sbzhenliang'],['unseen']],
|
||||
sb_xiaoqiao:['female','wu',3,['sbtianxiang','xinhongyan'],['unseen']],
|
||||
},
|
||||
characterSort:{
|
||||
sb:{
|
||||
|
|
|
@ -43336,8 +43336,8 @@
|
|||
},
|
||||
create:{
|
||||
//创建身份牌实例
|
||||
identityCard:function(identity,position,info,noclick){
|
||||
const card=ui.create.card(position,info,noclick);
|
||||
identityCard:function(identity,position,noclick){
|
||||
const card=ui.create.card(position,'noclick',noclick);
|
||||
card.classList.add('button');
|
||||
card._customintro=uiintro=>uiintro.add(`${get.translation(`${identity}${2}`)}的身份牌`);
|
||||
const fileName=`image/card/identity_${identity}.jpg`;
|
||||
|
|
Loading…
Reference in New Issue