Merge pull request #781 from mengxinzxz/PR-Branch
OL曹宇,phase针对翻面机制的history判定添加
This commit is contained in:
commit
d9d84b1495
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
230
character/sp.js
230
character/sp.js
|
@ -18,7 +18,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
sp_zhongdan:["cuiyan","huangfusong"],
|
||||
sp_guozhan2:["sp_dongzhuo","liqueguosi","zhangren"],
|
||||
sp_others:["hanba","caiyang"],
|
||||
sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_dingshangwan','ol_liwan','ol_liuyan'],
|
||||
sp_waitforsort:['ol_luyusheng','ol_pengyang','ol_tw_zhangji','ol_dingshangwan','ol_liwan','ol_liuyan','caoyu'],
|
||||
},
|
||||
},
|
||||
characterFilter:{
|
||||
|
@ -30,6 +30,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
},
|
||||
character:{
|
||||
caoyu:['male','wei',3,['olgongjie','olxiangxv','olxiangzuo']],
|
||||
ol_liwan:['female','wei',3,['ollianju','olsilv']],
|
||||
ol_dingshangwan:['female','wei',3,['olfudao','olfengyan']],
|
||||
zhangyan:['male','qun',4,['olsuji','ollangdao']],
|
||||
|
@ -201,6 +202,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
luzhi:['male','wei',3,['qingzhong','weijing']]
|
||||
},
|
||||
characterIntro:{
|
||||
caoyu:'曹宇(?-278年),字彭祖,沛国谯县(今安徽亳州)人。三国时期魏国宗室,魏武帝曹操与环夫人之子,邓哀王曹冲同母兄弟。太和六年,封为燕王。魏明帝病危,欲以大将军辅政,不果。其子常道乡公曹奂,是魏国末代皇帝,史称魏元帝。晋朝建立后,降封燕公。咸宁四年(278年),曹宇去世。',
|
||||
zhangyan:'张燕,本姓褚,生卒年不详,常山真定(今河北正定南)人,东汉末年黑山军首领。张燕剽捍,敏捷过人,军中称为“飞燕”。官渡之战时投降曹操,被任命为平北将军,封安国亭侯。死后其子张方袭爵。',
|
||||
lushi:'卢氏,五斗米教主张衡妻,张鲁母,擅长驻颜之术,常年令自己保持少女的容颜。常拜访刘焉,与其交好。',
|
||||
lvboshe:'吕伯奢,东汉成皋(今河南荥阳)人,曹操父亲曹嵩的故友。曹操与陈宫在逃离董卓避祸,返回乡里的途中借宿于吕伯奢家,未伤其人,有贼八人欲捉曹操,曹操杀之,明罗贯中在历史小说《三国演义》中将这段历史进行了丑化加工,也成为小说中曹操名言“宁教我负天下人,休教天下人负我”的出处。',
|
||||
|
@ -703,6 +705,113 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
},
|
||||
skill:{
|
||||
//曹宇
|
||||
olgongjie:{
|
||||
audio:2,
|
||||
trigger:{global:'phaseBegin'},
|
||||
filter(event,player){
|
||||
if(!player.countCards('he')) return false;
|
||||
return !game.hasPlayer(current=>{
|
||||
var history=current.actionHistory;
|
||||
for(var num=history.length-1;num>=0;num--){
|
||||
if(history[num].isRound) break;
|
||||
if(history[num].isSkipped) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
var num=player.countCards('he'),draws=[];
|
||||
var {result:{bool,targets}}=await player.chooseTarget(get.prompt2('olgongjie'),[1,num],lib.filter.notMe).set('ai',target=>get.attitude(_status.event.player,target));
|
||||
if(!bool) return;
|
||||
targets=targets.sortBySeat();
|
||||
player.logSkill('gongjie',targets);
|
||||
for(var target of targets){
|
||||
var {result:{bool,cards}}=await target.gainPlayerCard(player,true,'he');
|
||||
if(bool) draws.add(get.suit(cards[0],player));
|
||||
}
|
||||
player.draw(draws.length);
|
||||
},
|
||||
},
|
||||
olxiangxv:{
|
||||
audio:2,
|
||||
trigger:{
|
||||
player:'loseAfter',
|
||||
global:['gainAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
|
||||
},
|
||||
filter(event,player){
|
||||
if(!_status.currentPhase||!_status.currentPhase.isIn()) return false;
|
||||
if(!player.isMinHandcard()) return false;
|
||||
var evt=event.getl(player);
|
||||
if(evt&&evt.player==player&&evt.hs&&evt.hs.length>0) return true;
|
||||
if(event.getg) return game.hasPlayer(current=>{
|
||||
var cards=event.getg(current);
|
||||
if(!cards.length) return false;
|
||||
return current.countCards('h')>=player.countCards('h')&¤t.countCards('h')-cards.length<player.countCards('h');
|
||||
});
|
||||
return false;
|
||||
},
|
||||
check(event,player){
|
||||
var target=_status.currentPhase;
|
||||
var cards=target.getCards('h');
|
||||
if(target.isPhaseUsing()){
|
||||
var cardx=cards.filter(card=>get.name(card)=='sha');
|
||||
cardx.sort((a,b)=>target.getUseValue(b)-target.getUseValue(a));
|
||||
cardx=cardx.slice(Math.min(cardx.length,target.getCardUsable('sha')),cardx.length);
|
||||
cards.removeArray(cardx);
|
||||
}
|
||||
return cards.length-player.countCards('h')>0;
|
||||
},
|
||||
logTarget:()=>_status.currentPhase,
|
||||
async content(event,trigger,player){
|
||||
player.tempBanSkill('olxiangxv',null,false);
|
||||
player.when({global:'phaseEnd'}).then(()=>{
|
||||
if(target&&target.isIn()){
|
||||
var num=target.countCards('h')!=player.countCards('h');
|
||||
if(num){
|
||||
if(num>0){
|
||||
if(player.countCards('h')<5) player.draw(Math.min(5-player.countCards('h'),num));
|
||||
}
|
||||
else player.chooseToDiscard(-num,'h',true);
|
||||
}
|
||||
}
|
||||
}).vars({target:_status.currentPhase});
|
||||
},
|
||||
},
|
||||
olxiangzuo:{
|
||||
audio:2,
|
||||
trigger:{player:'dying'},
|
||||
filter(event,player){
|
||||
if(!_status.currentPhase||!_status.currentPhase.isIn()) return false;
|
||||
return player.countCards('he');
|
||||
},
|
||||
direct:true,
|
||||
async content(event,trigger,player){
|
||||
var target=_status.currentPhase,num=player.countCards('he');
|
||||
var {result:{bool,cards}}=await player.chooseToGive(get.prompt2('olxiangzuo',target),[1,num],'he').set('ai',card=>{
|
||||
var player=_status.event.player,target=_status.event.target;
|
||||
if(player.getHistory('useSkill',evt=>{
|
||||
return (evt.skill=='olgongjie'||evt.skill=='olxiangxv')&&evt.targets.includes(target);
|
||||
}).length){
|
||||
if(get.attitude(player,target)>0) return 1;
|
||||
if(player.canSaveCard(card,player)) return 0;
|
||||
if(ui.selected.cards.length+player.hp==player.maxHp) return 0;
|
||||
return 20-get.value(card);
|
||||
}
|
||||
else{
|
||||
if(get.attitude(player,target)>0&&!player.countCards('he',cardx=>player.canSaveCard(cardx,player))) return 1;
|
||||
return 0;
|
||||
}
|
||||
}).set('target',target).set('complexCard',true).set('logSkill',['olxiangzuo',target]);
|
||||
if(!bool) return;
|
||||
player.awakenSkill('olxiangzuo');
|
||||
if(player.getHistory('useSkill',evt=>{
|
||||
return (evt.skill=='olgongjie'||evt.skill=='olxiangxv')&&evt.targets.includes(target);
|
||||
}).length) player.recover(cards.length);
|
||||
},
|
||||
},
|
||||
//OL飞扬
|
||||
olfeiyang:{
|
||||
trigger:{player:'phaseZhunbeiBegin'},
|
||||
|
@ -877,12 +986,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
var num=player.countCards('h');
|
||||
if(num>0){
|
||||
player.chooseCardTarget({
|
||||
prompt:'抚悼:将至多三手张牌交给一名其他角色',
|
||||
prompt:'抚悼:将至多三张手张牌交给一名其他角色',
|
||||
selectCard:[1,3],
|
||||
filterCard:true,
|
||||
filterTarget:lib.filter.notMe,
|
||||
position:'h',
|
||||
forced:true,
|
||||
ai1:function(card){
|
||||
if(card.name=='du') return 10;
|
||||
else if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
|
||||
|
@ -952,22 +1060,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
content:function(){
|
||||
'step 0'
|
||||
var target=lib.skill.olfengyan.logTarget(trigger,player);
|
||||
if(trigger.name=='damage'){
|
||||
event.target=target;
|
||||
var str=get.translation(target);event.target=target;
|
||||
player.chooseControl().set('choiceList',[
|
||||
'摸一张牌,然后交给'+str+'一张牌',
|
||||
'令'+str+'摸一张牌,然后'+str+'弃置两张牌',
|
||||
]).set('ai',()=>_status.event.att>0?0:1).set('att',get.attitude(player,target));
|
||||
'step 1'
|
||||
if(result.index==0){
|
||||
player.draw();
|
||||
player.chooseToGive(target,'he',true);
|
||||
}
|
||||
else{
|
||||
target.draw();
|
||||
target.chooseToDiscard(2,'he',true);
|
||||
event.finish();
|
||||
}
|
||||
'step 1'
|
||||
var num=player.countCards('he');
|
||||
if(!num) event.finish();
|
||||
else if(num==1) event._result={bool:true,cards:player.getCards('he')};
|
||||
else player.chooseCard('he',true,'交给'+get.translation(target)+'一张牌');
|
||||
'step 2'
|
||||
if(result.bool) target.gain(result.cards,player,'giveAuto');
|
||||
},
|
||||
},
|
||||
//张燕
|
||||
|
@ -2273,10 +2379,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
enable:'chooseToUse',
|
||||
hiddenCard:function(player,name){
|
||||
if(name!='wuxie'&&lib.inpile.includes(name)) return true;
|
||||
if(name!='wuxie'&&lib.inpile.includes(name)&&lib.skill.olqifan.getNum()) return true;
|
||||
},
|
||||
getNum:()=>game.getGlobalHistory('useCard').reduce((list,evt)=>list.add(get.type2(evt.card)),[]).length,
|
||||
filter:function(event,player){
|
||||
if(event.responded||event.type=='wuxie'||event.olqifan) return false;
|
||||
if(event.responded||event.type=='wuxie'||event.olqifan||!lib.skill.olqifan.getNum()) return false;
|
||||
for(var i of lib.inpile){
|
||||
if(i!='wuxie'&&event.filterCard({name:i},player,event)) return true;
|
||||
}
|
||||
|
@ -2287,7 +2394,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
'step 0'
|
||||
var evt=event.getParent(2);
|
||||
evt.set('olqifan',true);
|
||||
var cards=get.bottomCards(1+player.getStorage('olqifan').length,true);
|
||||
var cards=get.bottomCards(lib.skill.olqifan.getNum(),true);
|
||||
var aozhan=player.hasSkill('aozhan');
|
||||
player.chooseButton(['器翻:选择要使用的牌',cards]).set('filterButton',function(button){
|
||||
return _status.event.cards.includes(button.link);
|
||||
|
@ -2349,27 +2456,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
},
|
||||
onremove:true,
|
||||
intro:{
|
||||
content:'已使用过$牌',
|
||||
},
|
||||
subSkill:{
|
||||
discard:{
|
||||
trigger:{player:'chooseToUseAfter'},
|
||||
forced:true,
|
||||
charlotte:true,
|
||||
filter:(player)=>{
|
||||
var num=player.getStorage('olqifan').length,pos=('jeh').slice(0,num);
|
||||
return num>0&&player.countCards(pos)>0;
|
||||
},
|
||||
content:function(){
|
||||
var pos=('jeh')[event.num],hs=player.countCards(pos);
|
||||
if(hs>0) player.chooseToDiscard(hs,pos,true);
|
||||
event.num++;
|
||||
if(event.num<event.maxNum) event.redo();
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
olqifan_backup:{
|
||||
sourceSkill:'olqifan',
|
||||
|
@ -2381,21 +2467,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(rcard.name==name) card=get.autoViewAs(rcard);
|
||||
else card=get.autoViewAs({name,isCard:true});
|
||||
event.result.card=card;
|
||||
player.markAuto('olqifan',[get.type2(card,false)]);
|
||||
var id=get.id();
|
||||
player.when('chooseToUseAfter')
|
||||
.filter((evt)=>evt==event.getParent())
|
||||
.then(()=>{
|
||||
if(!lib.skill.olqifan_discard.filter(player)){
|
||||
event.finish();
|
||||
}
|
||||
else{
|
||||
event.maxNum=Math.min(3,player.getStorage('olqifan').length);
|
||||
event.num=0;
|
||||
}
|
||||
})
|
||||
.then(lib.skill.olqifan_discard.content)
|
||||
.translation('器翻');
|
||||
player.when('chooseToUseAfter').filter((evt)=>evt==event.getParent()).then(()=>{
|
||||
var num=lib.skill.olqifan.getNum(),pos=('jeh').slice(0,num);
|
||||
if(num>0&&player.countCards(pos)>0){
|
||||
event.maxNum=Math.min(3,lib.skill.olqifan.getNum());
|
||||
event.num=0;
|
||||
}
|
||||
else event.finish();
|
||||
}).then(()=>{
|
||||
var pos=('jeh')[event.num],hs=player.countCards(pos);
|
||||
if(hs>0) player.chooseToDiscard(hs,pos,true);
|
||||
event.num++;
|
||||
if(event.num<event.maxNum) event.redo();
|
||||
}).translation('器翻');
|
||||
},
|
||||
filterCard:function(){return false},
|
||||
selectCard:-1,
|
||||
|
@ -2428,24 +2513,36 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return order;
|
||||
},
|
||||
},
|
||||
trigger:{player:'useCardAfter'},
|
||||
forced:true,
|
||||
trigger:{player:'useCard'},
|
||||
filter:function(event){
|
||||
const num=get.number(event.card);
|
||||
return [1,11,12,13].includes(num);
|
||||
return [1,11,12,13].includes(get.number(event.card));
|
||||
},
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.draw(2);
|
||||
'step 0'
|
||||
trigger.targets.length=0;
|
||||
trigger.all_excluded=true;
|
||||
game.log(trigger.card,'被无效了');
|
||||
'step 1'
|
||||
player.draw();
|
||||
player.addSkill('oltuishi_unlimit');
|
||||
},
|
||||
subSkill:{
|
||||
unlimit:{
|
||||
charlotte:true,
|
||||
mod:{
|
||||
cardUsable:()=>Infinity,
|
||||
targetInRange:()=>true,
|
||||
cardUsableTarget:(card,player,target)=>{
|
||||
if(target.countCards('h')<player.countCards('h')) return true;
|
||||
},
|
||||
targetInRange:(card,player,target)=>{
|
||||
if(target.countCards('h')<player.countCards('h')) return true;
|
||||
},
|
||||
},
|
||||
trigger:{player:'useCard1'},
|
||||
filter:function(event,player){
|
||||
if(!event.targets||!event.targets.length) return false;
|
||||
return event.targets.some(target=>player.countCards('h')+event.cards.length>target.countCards('h'));
|
||||
},
|
||||
forced:true,
|
||||
popup:false,
|
||||
silent:true,
|
||||
|
@ -2461,7 +2558,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
mark:true,
|
||||
intro:{content:'使用的下一张牌无距离次数限制'},
|
||||
intro:{content:'对手牌数小于你的角色使用的下一张牌无距离次数限制'},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -26664,9 +26761,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ol_pengyang:'OL彭羕',
|
||||
ol_pengyang_prefix:'OL',
|
||||
olqifan:'器翻',
|
||||
olqifan_info:'当你需要使用不为【无懈可击】的牌时,你可以观看牌堆底的X+1张牌并使用其中的一张。此牌结算结束时,你依次弃置以下前X个区域中的所有牌:⒈判定区、⒉装备区、⒊手牌区(X为你因此技能使用过的牌中包含的类型数)。',
|
||||
olqifan_info:'当你需要使用不为【无懈可击】的牌时,你可以观看牌堆底的X张牌并使用其中的一张。此牌结算结束时,你依次弃置以下前X个区域中的所有牌:⒈判定区、⒉装备区、⒊手牌区(X为本回合使用过的牌中包含的类型数)。',
|
||||
oltuishi:'侻失',
|
||||
oltuishi_info:'锁定技。①你不能使用【无懈可击】。②当你使用点数为字母的牌后,你摸两张牌,且你使用的下一张牌无距离和次数限制。',
|
||||
oltuishi_info:'锁定技。①你不能使用【无懈可击】。②当你使用点数为字母的牌时,你令此牌无效并摸一张牌,且你对手牌数小于你的角色使用的下一张牌无距离和次数限制。',
|
||||
ol_tw_zhangji:'张既',
|
||||
skill_zhangji_A:'技能',
|
||||
skill_zhangji_A_info:'出牌阶段限X次(X为你的体力值),当你使用牌指定一名其他角色为目标后,你可以观看其手牌,然后你选择一项:<br>1.弃置其一张牌,然后若弃置的牌是能造成火焰伤害的牌,你摸一张牌。<br>2.重铸其手牌中的所有【杀】和【决斗】。<br>3.若其没有【闪】,你与其互相对对方造成1点伤害。',
|
||||
|
@ -26690,9 +26787,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ol_dingshangwan:'OL丁尚涴',
|
||||
ol_dingshangwan_prefix:'OL',
|
||||
olfudao:'抚悼',
|
||||
olfudao_info:'①游戏开始时,你摸三张牌并将至多三张手牌交给一名其他角色,然后弃置任意张手牌并记录你的手牌数。②一名角色的回合结束时,若其手牌数和你发动〖抚悼①〗记录的数值相同,则你可以与其各摸一张牌。',
|
||||
olfudao_info:'①游戏开始时,你摸三张牌,然后可以将至多三张手牌交给一名其他角色,然后可以弃置任意张手牌,最后记录你的手牌数。②一名角色的回合结束时,若其手牌数和你发动〖抚悼①〗记录的数值相同,则你可以与其各摸一张牌。',
|
||||
olfengyan:'讽言',
|
||||
olfengyan_info:'锁定技。①当你受到其他角色造成的伤害后,你摸一张牌,然后交给其一张牌。②当你响应其他角色使用的牌时,其摸一张牌,然后弃置两张牌。',
|
||||
olfengyan_info:'锁定技。当你受到其他角色造成的伤害后或响应其他角色使用的牌时,你选择一项:①摸一张牌,然后交给其一张牌。②令其摸一张牌,然后其弃置两张牌。',
|
||||
ol_liwan:'OL李婉',
|
||||
ol_liwan_prefix:'OL',
|
||||
ollianju:'联句',
|
||||
|
@ -26708,6 +26805,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
olfeiyang:'飞扬',
|
||||
//olfeiyang_info:'限定技。准备阶段,你可以弃置两张牌,然后弃置判定区的一张牌。',
|
||||
olfeiyang_info:'准备阶段,你可以弃置三张牌,然后弃置判定区的一张牌。',
|
||||
caoyu:'曹宇',
|
||||
olgongjie:'恭节',
|
||||
olgongjie_info:'每轮的首个回合开始时,你可以令任意名角色获得你的一张牌,然后你摸X张牌(X为你本次失去的花色数)。',
|
||||
olxiangxv:'相胥',
|
||||
olxiangxv_info:'当你的手牌数变为全场最少时,你可以获得以下效果:本回合结束时,将手牌数调整至与当前回合角色手牌数相同(至多摸至五张)。',
|
||||
olxiangzuo:'襄胙',
|
||||
olxiangzuo_info:'限定技,当你进入濒死状态时,你可以交给当前回合角色任意张牌,若如此做,若你本回合已对其发动过〖恭节〗或〖相胥〗,你回复等量的体力。',
|
||||
|
||||
sp_tianji:'天极·皇室宗亲',
|
||||
sp_sibi:'四弼·辅国文曲',
|
||||
|
|
|
@ -11189,10 +11189,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
starweilin:'威临',
|
||||
starweilin_info:'锁定技。当你于回合内对一名其他角色造成伤害时,若其本回合未受到过伤害,且你本回合使用的牌数大于等于其体力值,则此伤害+1。',
|
||||
starzhangrong:'掌戎',
|
||||
starzhangrong_info:'准备阶段,你可以选择令至多X名体力值大于等于你的角色各失去1点体力或令至多X名手牌数大于等于你的角色各弃置一张手牌。若如此做,你摸等同于选择角色数的牌,且本回合结束时,若这些角色中存在本回合未受到过伤害的角色,则你失去1点体力。',
|
||||
starzhangrong_info:'准备阶段,你可以选择令至多X名体力值大于等于你的角色各失去1点体力或令至多X名手牌数大于等于你的角色各弃置一张手牌(X为你的体力值)。若如此做,你摸等同于选择角色数的牌,且本回合结束时,若这些角色中存在本回合未受到过伤害的角色,则你失去1点体力。',
|
||||
starhaoshou:'豪首',
|
||||
//starhaoshou_info:'主公技。①其他群势力角色使用【酒】结算完毕后,其可以令你回复1点体力。②当你处于濒死状态时,其他群势力角色可以将【酒】当作【桃】对你使用。',
|
||||
starhaoshou_info:'主公技。其他群势力角色使用【酒】结算完毕后,其可以令你回复1点体力。。',
|
||||
starhaoshou_info:'主公技。其他群势力角色使用【酒】结算完毕后,其可以令你回复1点体力。',
|
||||
|
||||
sp_whlw:"文和乱武",
|
||||
sp_zlzy:"逐鹿中原",
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
|
@ -2484,6 +2484,12 @@ export const Content = {
|
|||
event.cancel();
|
||||
player.turnOver();
|
||||
player.phaseSkipped = true;
|
||||
var players = game.players.slice(0).concat(game.dead);
|
||||
for (var i = 0; i < players.length; i++) {
|
||||
var current = players[i];
|
||||
current.getHistory().isSkipped = true;
|
||||
current.getStat().isSkipped = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.phaseSkipped = false;
|
||||
|
|
Loading…
Reference in New Issue