gongxin
This commit is contained in:
parent
9da667f10b
commit
a336b61b17
|
@ -1077,71 +1077,70 @@ character.extra={
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
if(event.isMine()){
|
event.videoId=lib.status.videoId++;
|
||||||
var dialog=ui.create.dialog('攻心',target.get('h'));
|
var cards=target.get('h');
|
||||||
for(var i=0;i<dialog.buttons.length;i++){
|
if(player.isOnline2()){
|
||||||
if(get.suit(dialog.buttons[i].link)=='heart')
|
player.send(function(cards,id){
|
||||||
dialog.buttons[i].classList.add('selectable');
|
ui.create.dialog('攻心',cards).videoId=id;
|
||||||
}
|
},cards,event.videoId);
|
||||||
event.custom.replace.button=function(button){
|
}
|
||||||
if(get.suit(button.link)!='heart') return;
|
event.dialog=ui.create.dialog('攻心',cards);
|
||||||
if(button==ui.selected.buttons[0]){
|
event.dialog.videoId=event.videoId;
|
||||||
button.classList.remove('selected');
|
if(!event.isMine()){
|
||||||
ui.selected.buttons.remove(button);
|
event.dialog.style.display='none';
|
||||||
}
|
}
|
||||||
else{
|
player.chooseButton().set('filterButton',function(button){
|
||||||
if(ui.selected.buttons.length){
|
return get.suit(button.link)=='heart';
|
||||||
ui.selected.buttons[0].classList.remove('selected')
|
}).set('dialog',event.videoId);
|
||||||
ui.selected.buttons.length=0;
|
"step 1"
|
||||||
|
if(result.bool){
|
||||||
|
event.card=result.links[0];
|
||||||
|
var func=function(card,id){
|
||||||
|
var dialog=get.idDialog(id);
|
||||||
|
if(dialog){
|
||||||
|
for(var i=0;i<dialog.buttons.length;i++){
|
||||||
|
if(dialog.buttons[i].link==card){
|
||||||
|
dialog.buttons[i].classList.add('selectedx');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
dialog.buttons[i].classList.add('unselectable');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
button.classList.add('selected');
|
|
||||||
ui.selected.buttons.push(button);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.control=ui.create.control('gongxin_discard','gongxin_top','cancel',function(link){
|
if(player.isOnline2()){
|
||||||
if(link!='cancel'&&ui.selected.buttons.length==0) return;
|
player.send(func,event.card,event.videoId);
|
||||||
event._result={};
|
}
|
||||||
if(link=='gongxin_top'){
|
else if(event.isMine()){
|
||||||
event._result.top=true;
|
func(event.card,event.videoId);
|
||||||
}
|
}
|
||||||
if(link!='cancel'){
|
player.chooseControl('gongxin_discard','gongxin_top');
|
||||||
event._result.buttons=ui.selected.buttons.slice(0);
|
|
||||||
}
|
|
||||||
event.control.close();
|
|
||||||
dialog.close();
|
|
||||||
game.resume();
|
|
||||||
})
|
|
||||||
game.pause();
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var dialog=ui.create.dialog(target.get('h'));
|
if(player.isOnline2()){
|
||||||
player.chooseButton(dialog).ai=function(button){
|
player.send('closeDialog',event.videoId);
|
||||||
return get.suit(button.link)=='heart';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"step 1"
|
|
||||||
if(result.buttons&&result.buttons.length){
|
|
||||||
var card=result.buttons[0].link;
|
|
||||||
if(result.top){
|
|
||||||
target.lose(card);
|
|
||||||
event.dialog=ui.create.dialog('置于牌堆顶',[card]);
|
|
||||||
event.insert=true;
|
|
||||||
event.card=card;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
target.discard(card);
|
|
||||||
}
|
}
|
||||||
|
event.dialog.close();
|
||||||
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 2"
|
"step 2"
|
||||||
if(event.insert){
|
if(player.isOnline2()){
|
||||||
event.card.fix();
|
player.send('closeDialog',event.videoId);
|
||||||
ui.cardPile.insertBefore(event.card,ui.cardPile.firstChild);
|
}
|
||||||
game.log(player,'将',event.card,'置于牌堆顶');
|
event.dialog.close();
|
||||||
game.delay(2);
|
var card=event.card;
|
||||||
|
if(result.control=='gongxin_top'){
|
||||||
|
target.lose(card);
|
||||||
|
player.showCards(card,'置于牌堆顶');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
target.discard(card);
|
||||||
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 3"
|
"step 3"
|
||||||
ui.selected.buttons.length=0;
|
event.card.fix();
|
||||||
if(event.dialog) event.dialog.close();
|
ui.cardPile.insertBefore(event.card,ui.cardPile.firstChild);
|
||||||
|
game.log(player,'将',event.card,'置于牌堆顶');
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
threaten:1.5,
|
threaten:1.5,
|
||||||
|
|
|
@ -28,10 +28,13 @@ character.refresh={
|
||||||
liyu:{
|
liyu:{
|
||||||
audio:2,
|
audio:2,
|
||||||
trigger:{source:'damageEnd'},
|
trigger:{source:'damageEnd'},
|
||||||
direct:true,
|
forced:true,
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.num('he')>0;
|
return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.num('he')>0;
|
||||||
},
|
},
|
||||||
|
check:function(){
|
||||||
|
return false;
|
||||||
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
'step 0'
|
'step 0'
|
||||||
trigger.player.chooseTarget(function(card,player,target){
|
trigger.player.chooseTarget(function(card,player,target){
|
||||||
|
@ -44,7 +47,6 @@ character.refresh={
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.gainPlayerCard(trigger.player,'he',true);
|
player.gainPlayerCard(trigger.player,'he',true);
|
||||||
player.logSkill('liyu');
|
|
||||||
event.target=result.targets[0];
|
event.target=result.targets[0];
|
||||||
trigger.player.line(player,'green');
|
trigger.player.line(player,'green');
|
||||||
}
|
}
|
||||||
|
|
|
@ -11413,7 +11413,7 @@
|
||||||
}
|
}
|
||||||
if(game.online||game.onlineroom){
|
if(game.online||game.onlineroom){
|
||||||
if(game.servermode&&_status.over){
|
if(game.servermode&&_status.over){
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
localStorage.setItem(lib.configprefix+'directstart',true);
|
localStorage.setItem(lib.configprefix+'directstart',true);
|
||||||
|
|
Loading…
Reference in New Issue