This commit is contained in:
libccy 2017-02-05 16:48:28 +08:00
parent 9dcfb6ce68
commit 5c6cc52172
16 changed files with 161 additions and 111 deletions

View File

@ -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'],

View File

@ -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:'负仇',

View File

@ -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]);
}

View File

@ -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]);
}

View File

@ -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);

View File

@ -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',

View File

@ -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);

BIN
image/card/bingliang.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
image/card/hualiu.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

BIN
image/card/huogong.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
image/card/tengjia.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
image/card/tiesuo.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

BIN
image/card/yihuajiemu.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 112 KiB

BIN
image/card/zhuque.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
image/card/zixin.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 26 KiB