138
card/yunchou.js
|
@ -1,5 +1,139 @@
|
|||
card.yunchou={
|
||||
card:{
|
||||
diaobingqianjiang:{
|
||||
fullskin:true,
|
||||
type:'trick',
|
||||
enable:true,
|
||||
selectTarget:-1,
|
||||
filterTarget:true,
|
||||
contentBefore:function(){
|
||||
"step 0"
|
||||
game.delay();
|
||||
player.draw();
|
||||
"step 1"
|
||||
ui.clear();
|
||||
var cards=get.cards(Math.floor(game.players.length/2));
|
||||
var dialog=ui.create.dialog('调兵遣将',cards,true);
|
||||
_status.dieClose.push(dialog);
|
||||
dialog.videoId=lib.status.videoId++;
|
||||
game.addVideo('cardDialog',null,['调兵遣将',get.cardsInfo(cards),dialog.videoId]);
|
||||
event.getParent().preResult=dialog.videoId;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
for(var i=0;i<ui.dialogs.length;i++){
|
||||
if(ui.dialogs[i].videoId==event.preResult){
|
||||
event.dialog=ui.dialogs[i];break;
|
||||
}
|
||||
}
|
||||
if(!event.dialog||!target.num('h')){
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
var minValue=20;
|
||||
var hs=target.get('h');
|
||||
for(var i=0;i<hs.length;i++){
|
||||
minValue=Math.min(minValue,ai.get.value(hs[i]));
|
||||
}
|
||||
if(target.isUnderControl(true)){
|
||||
event.dialog.setCaption('选择一张牌并用一张手牌替换之');
|
||||
}
|
||||
var next=target.chooseButton(function(button){
|
||||
return ai.get.value(button.link,_status.event.player)-minValue;
|
||||
});
|
||||
next.set('dialog',event.preResult);
|
||||
next.set('closeDialog',false);
|
||||
next.set('dialogdisplay',true);
|
||||
"step 1"
|
||||
event.dialog.setCaption('调兵遣将');
|
||||
if(result.bool){
|
||||
event.button=result.buttons[0];
|
||||
target.chooseCard('用一张牌牌替换'+get.translation(result.links),true).ai=function(card){
|
||||
return -ai.get.value(card);
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
"step 2"
|
||||
if(result.bool){
|
||||
target.lose(result.cards,ui.special);
|
||||
target.$throw(result.cards);
|
||||
|
||||
game.log(target,'用',result.cards,'替换了',event.button.link);
|
||||
target.gain(event.button.link);
|
||||
target.$gain2(event.button.link);
|
||||
event.dialog.buttons.remove(event.button);
|
||||
event.dialog.buttons.push(ui.create.button(result.cards[0],'card',event.button.parentNode));
|
||||
event.button.remove();
|
||||
}
|
||||
"step 3"
|
||||
game.delay(2);
|
||||
},
|
||||
contentAfter:function(){
|
||||
'step 0'
|
||||
event.dialog=get.idDialog(event.preResult);
|
||||
if(!event.dialog){
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
var att=ai.get.attitude(player,player.nextSeat);
|
||||
if(player.isUnderControl(true)&&!_status.auto){
|
||||
event.dialog.setCaption('将任意张牌以任意顺序置于牌堆顶(先选择的在上)');
|
||||
}
|
||||
var next=player.chooseButton([1,event.dialog.buttons.length],event.dialog);
|
||||
next.ai=function(button){
|
||||
if(att>0){
|
||||
return ai.get.value(button.link,player.nextSeat)-5;
|
||||
}
|
||||
else{
|
||||
return 5-ai.get.value(button.link,player.nextSeat);
|
||||
}
|
||||
}
|
||||
next.set('closeDialog',false);
|
||||
next.set('dialogdisplay',true);
|
||||
'step 1'
|
||||
if(result&&result.bool&&result.links&&result.links.length){
|
||||
for(var i=0;i<result.buttons.length;i++){
|
||||
event.dialog.buttons.remove(result.buttons[i]);
|
||||
}
|
||||
var cards=result.links.slice(0);
|
||||
while(cards.length){
|
||||
ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild);
|
||||
}
|
||||
game.log(player,'将'+get.cnNumber(result.links.length)+'张牌置于牌堆顶');
|
||||
}
|
||||
for(var i=0;i<event.dialog.buttons.length;i++){
|
||||
ui.discardPile.appendChild(event.dialog.buttons[i].link);
|
||||
}
|
||||
'step 2'
|
||||
var dialog=event.dialog;
|
||||
dialog.close();
|
||||
_status.dieClose.remove(dialog);
|
||||
game.addVideo('cardDialog',null,event.preResult);
|
||||
},
|
||||
ai:{
|
||||
wuxie:function(){
|
||||
return 0;
|
||||
},
|
||||
basic:{
|
||||
order:2,
|
||||
useful:[3,1],
|
||||
value:[5,1]
|
||||
},
|
||||
result:{
|
||||
player:1,
|
||||
target:function(player,target){
|
||||
if(target.num('h')==0) return 0;
|
||||
return (Math.sqrt(target.num('h'))-get.distance(player,target,'absolute')/game.players.length/3)/2;
|
||||
}
|
||||
},
|
||||
tag:{
|
||||
loseCard:1,
|
||||
multitarget:1
|
||||
}
|
||||
}
|
||||
},
|
||||
caochuanjiejian:{
|
||||
fullskin:true,
|
||||
type:'trick',
|
||||
|
@ -1053,6 +1187,8 @@ card.yunchou={
|
|||
},
|
||||
},
|
||||
translate:{
|
||||
diaobingqianjiang:'调兵遣将',
|
||||
diaobingqianjiang_info:'出牌阶段,对所有角色使用。你摸一张牌,然后亮出牌堆顶的X张牌(X为存活角色数的一半,向下取整),目标可以用一张手牌替换其中的一张牌。结算后,你可以将剩余的牌中的任意张以任意顺序置于牌堆顶',
|
||||
caochuanjiejian:'草船借箭',
|
||||
caochuanjiejian_info:'出牌阶段对一名有手牌的其他角色使用,目标选择一项:将手牌中的所有杀(至少1张)交给你,并视为对你使用一张杀;或展示手牌并令你弃置任意张',
|
||||
xiaolicangdao:'笑里藏刀',
|
||||
|
@ -1134,6 +1270,8 @@ card.yunchou={
|
|||
['spade',6,'geanguanhuo'],
|
||||
['heart',4,'shezhanqunru'],
|
||||
['club',8,'shezhanqunru'],
|
||||
['diamond',1,'diaobingqianjiang'],
|
||||
['spade',2,'diaobingqianjiang'],
|
||||
['heart',12,'youdishenru'],
|
||||
['club',2,'youdishenru'],
|
||||
['spade',9,'youdishenru'],
|
||||
|
|
121
character/diy.js
|
@ -32,120 +32,27 @@ character.diy={
|
|||
choudu:{
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
filterTarget:true,
|
||||
filterCard:true,
|
||||
position:'he',
|
||||
filterTarget:function(card,player,target){
|
||||
return lib.filter.cardEnabled({name:'diaobingqianjiang'},target);
|
||||
},
|
||||
check:function(card){
|
||||
return 5-ai.get.value(card);
|
||||
return 6-ai.get.value(card);
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
event.list=game.players.slice(0);
|
||||
get.sortSeat(event.list,target);
|
||||
var cards=get.cards(Math.floor(game.players.length)/2);
|
||||
var dialog=ui.create.dialog('筹度',cards,true);
|
||||
_status.dieClose.push(dialog);
|
||||
dialog.videoId=lib.status.videoId++;
|
||||
game.addVideo('cardDialog',null,['筹度',get.cardsInfo(cards),dialog.videoId]);
|
||||
event.dialog=dialog;
|
||||
game.delay();
|
||||
game.log(player,'亮出了',cards);
|
||||
'step 1'
|
||||
if(event.list.length){
|
||||
event.current=event.list.shift();
|
||||
if(event.current.isAlive()&&event.current.num('h')){
|
||||
if(event.current.isUnderControl(true)){
|
||||
event.dialog.setCaption('选择一张亮出的牌并用一张手牌替换之');
|
||||
}
|
||||
var maxValue=0;
|
||||
for(var i=0;i<event.dialog.buttons.length;i++){
|
||||
maxValue=Math.max(maxValue,ai.get.value(event.dialog.buttons[i].link));
|
||||
}
|
||||
var next=event.current.chooseButton(event.dialog);
|
||||
next.ai=function(button){
|
||||
return maxValue-ai.get.value(button.link);
|
||||
};
|
||||
next.set('closeDialog',false);
|
||||
next.set('dialogdisplay',true);
|
||||
}
|
||||
else{
|
||||
event.redo();
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.goto(5);
|
||||
}
|
||||
'step 2'
|
||||
event.dialog.setCaption('筹度');
|
||||
if(result.bool){
|
||||
event.currentButton=result.buttons[0];
|
||||
event.current.chooseCard('用一张牌牌替换'+get.translation(result.links),true).ai=function(card){
|
||||
return -ai.get.value(card);
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.goto(1);
|
||||
}
|
||||
'step 3'
|
||||
if(result.bool){
|
||||
event.current.lose(result.cards,ui.special);
|
||||
event.current.$throw(result.cards);
|
||||
|
||||
game.log(event.current,'用',result.cards,'替换了',event.currentButton.link);
|
||||
event.current.gain(event.currentButton.link,'gain2');
|
||||
event.dialog.buttons.remove(event.currentButton);
|
||||
event.dialog.buttons.push(ui.create.button(result.cards[0],'card',event.currentButton.parentNode));
|
||||
event.currentButton.remove();
|
||||
}
|
||||
'step 4'
|
||||
game.delay();
|
||||
event.goto(1);
|
||||
'step 5'
|
||||
var att=ai.get.attitude(player,player.nextSeat);
|
||||
event.dialog.setCaption('将任意张牌以任意顺序置于牌堆顶(先选择的在上)');
|
||||
player.chooseButton([1,event.dialog.buttons.length],event.dialog).ai=function(button){
|
||||
if(player!=target&&ui.selected.buttons.length==0){
|
||||
return ai.get.value(button.link,player.nextSeat)-5;
|
||||
}
|
||||
else{
|
||||
if(att>0){
|
||||
return ai.get.value(button.link,player.nextSeat)-5;
|
||||
}
|
||||
else{
|
||||
return 5-ai.get.value(button.link,player.nextSeat);
|
||||
}
|
||||
}
|
||||
}
|
||||
'step 6'
|
||||
if(result&&result.bool&&result.links&&result.links.length){
|
||||
for(var i=0;i<result.buttons.length;i++){
|
||||
event.dialog.buttons.remove(result.buttons[i]);
|
||||
}
|
||||
var cards=result.links.slice(0);
|
||||
while(cards.length){
|
||||
ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild);
|
||||
}
|
||||
game.log(player,'将'+get.cnNumber(result.links.length)+'张牌置于牌堆顶');
|
||||
}
|
||||
for(var i=0;i<event.dialog.buttons.length;i++){
|
||||
ui.discardPile.appendChild(event.dialog.buttons[i].link);
|
||||
}
|
||||
'step 7'
|
||||
var dialog=event.dialog;
|
||||
dialog.close();
|
||||
_status.dieClose.remove(dialog);
|
||||
game.addVideo('cardDialog',null,dialog.videoId);
|
||||
if(player!=target){
|
||||
player.draw();
|
||||
}
|
||||
var list=game.players.slice(0);
|
||||
get.sortSeat(list,target);
|
||||
target.useCard({name:'diaobingqianjiang'},list);
|
||||
},
|
||||
ai:{
|
||||
order:2,
|
||||
order:1,
|
||||
result:{
|
||||
target:function(player,target){
|
||||
var num=Math.sqrt(target.num('h'));
|
||||
if(target==player){
|
||||
num/=2;
|
||||
player:function(player,target){
|
||||
if(ai.get.attitude(player,target)<=1) return 0;
|
||||
var num=0;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
num+=ai.get.effect(game.players[i],{name:'diaobingqianjiang'},target,player);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
@ -1217,7 +1124,7 @@ character.diy={
|
|||
diy_zhenji:'甄宓',
|
||||
|
||||
choudu:'筹度',
|
||||
choudu_info:'出牌阶段限一次,你可以弃置一张牌,并亮出等同于存活角色数一半(向下取整)的牌,你选择一名角色,从该角色开始,每名角色可以用一张手牌替换其中的一张牌;结算后你可以将剩余的牌中的任意张以任意顺序置于牌堆顶;若你选择的角色不是你,你在结算后摸一张牌',
|
||||
choudu_info:'出牌阶段限一次,你可以弃置一张牌,并指定一名角色视为其使用一张调兵遣将',
|
||||
liduan:'立断',
|
||||
liduan_info:'当一名其他角色于其回合外获得牌后,若其此次获得的牌数为1且为装备牌(无论是否可见),你可以令该角色选择一项:1.使用此牌;2.将一张手牌交给你',
|
||||
fuchou:'负仇',
|
||||
|
|
|
@ -1066,7 +1066,7 @@ character.extra={
|
|||
cards.remove(result.buttons[i].link);
|
||||
}
|
||||
player.gain(cards2);
|
||||
if(cards2.length) player.$gain(cards2);
|
||||
if(cards2.length) player.$gain2(cards2,true);
|
||||
for(var i=0;i<cards.length;i++){
|
||||
ui.discardPile.appendChild(cards[i]);
|
||||
}
|
||||
|
|
|
@ -1253,7 +1253,8 @@ character.refresh={
|
|||
return target.sex=='male';
|
||||
});
|
||||
"step 2"
|
||||
result.targets[0].$gain(event.card);
|
||||
player.line(result.targets,'green');
|
||||
result.targets[0].$gain2(event.card,true);
|
||||
for(var i=0;i<cards.length-1;i++){
|
||||
ui.discardPile.appendChild(cards[i]);
|
||||
}
|
||||
|
|
|
@ -5135,7 +5135,7 @@ character.swd={
|
|||
}
|
||||
else{
|
||||
game.delay(0,1000);
|
||||
player.$gain(event.cards);
|
||||
player.$gain2(event.cards,true);
|
||||
}
|
||||
"step 2"
|
||||
player.gain(event.cards);
|
||||
|
|
|
@ -27,6 +27,7 @@ window.noname_asset_list=[
|
|||
'image/card/cixiong.png',
|
||||
'image/card/daihuofenglun.png',
|
||||
'image/card/dawan.png',
|
||||
'image/card/diaobingqianjiang.png',
|
||||
'image/card/dilu.png',
|
||||
'image/card/diaohulishan.png',
|
||||
'image/card/donghuangzhong.png',
|
||||
|
|
|
@ -13757,7 +13757,10 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
$gain2:function(cards){
|
||||
$gain2:function(cards,log){
|
||||
if(log===true){
|
||||
game.log(this,'获得了',cards);
|
||||
}
|
||||
game.broadcast(function(player,cards){
|
||||
player.$gain2(cards);
|
||||
},this,cards);
|
||||
|
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 26 KiB |