This commit is contained in:
libccy 2017-11-23 17:25:15 +08:00
parent 0f254ee711
commit 39bdf1c5ec
26 changed files with 424 additions and 109 deletions

View File

@ -126,7 +126,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
player.line(target); player.line(target);
target.removeEquipTrigger(); target.removeEquipTrigger();
for(var i=0;i<ej.length;i++){ for(var i=0;i<ej.length;i++){
ui.discardPile.appendChild(game.createCard(ej[i])); game.createCard(ej[i]).discard();
ej[i].init([ej[i].suit,ej[i].number,'gw_dieyi_'+(get.subtype(ej[i])||'judge')]); ej[i].init([ej[i].suit,ej[i].number,'gw_dieyi_'+(get.subtype(ej[i])||'judge')]);
} }
event.redo(); event.redo();
@ -1933,7 +1933,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
else{ else{
player.$throw(player.storage.gw_youer,1000); player.$throw(player.storage.gw_youer,1000);
for(var i=0;i<player.storage.gw_youer.length;i++){ for(var i=0;i<player.storage.gw_youer.length;i++){
ui.discardPile.appendChild(player.storage.gw_youer[i]); player.storage.gw_youer[i].discard();
} }
game.log(player,'弃置了',player.storage.gw_youer); game.log(player,'弃置了',player.storage.gw_youer);
} }

View File

@ -398,7 +398,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
else{ else{
if(cards[0]){ if(cards[0]){
ui.discardPile.appendChild(cards[0]); cards[0].discard();
} }
event.finish(); event.finish();
} }
@ -413,7 +413,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
target.gain(cards,'gain2'); target.gain(cards,'gain2');
} }
else{ else{
ui.discardPile.appendChild(cards[0]); cards[0].discard();
} }
}, },
ai:{ ai:{

View File

@ -249,7 +249,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
while(card.cards.length){ while(card.cards.length){
var card2=card.cards.shift(); var card2=card.cards.shift();
if(card2.parentNode.id=='special'){ if(card2.parentNode.id=='special'){
ui.discardPile.appendChild(card2); card2.discard();
} }
} }
} }
@ -665,7 +665,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var muniu=player.getEquip(5); var muniu=player.getEquip(5);
if(!muniu||!cards.length){ if(!muniu||!cards.length){
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
event.finish(); event.finish();
return; return;

View File

@ -1158,7 +1158,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
time+=200; time+=200;
setTimeout((function(card,name,last){ setTimeout((function(card,name,last){
return function(){ return function(){
ui.discardPile.appendChild(game.createCard(card)); game.createCard(card).discard();
card.init([card.suit,card.number,name,card.nature]); card.init([card.suit,card.number,name,card.nature]);
card.style.transform='scale(1.1)'; card.style.transform='scale(1.1)';
card.classList.add('glow'); card.classList.add('glow');
@ -2936,7 +2936,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
game.log(player,'弃置了',result.links); game.log(player,'弃置了',result.links);
for(var i=0;i<result.links.length;i++){ for(var i=0;i<result.links.length;i++){
event.hu.storage.shouna.remove(result.links[i]); event.hu.storage.shouna.remove(result.links[i]);
ui.discardPile.appendChild(result.links[i]); result.links[i].discard();
type.add(get.type(result.links[i],'trick')); type.add(get.type(result.links[i],'trick'));
} }
for(var i=0;i<ui.cardPile.childNodes.length;i++){ for(var i=0;i<ui.cardPile.childNodes.length;i++){
@ -3272,7 +3272,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
event.dialog.videoId=event.videoId; event.dialog.videoId=event.videoId;
game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]); game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
for(var i=0;i<event.cards.length;i++) ui.discardPile.appendChild(event.cards[i]); for(var i=0;i<event.cards.length;i++) event.cards[i].discard();
// var node=card.copy('thrown','center',ui.arena).animate('start'); // var node=card.copy('thrown','center',ui.arena).animate('start');
var node; var node;
if(game.chess){ if(game.chess){
@ -4212,7 +4212,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
var name=lib.skill.lingjianduanzao.process(cards); var name=lib.skill.lingjianduanzao.process(cards);
var card=game.createCard(name); var card=game.createCard(name);

View File

@ -131,7 +131,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
game.log(player,'将'+get.cnNumber(result.links.length)+'张牌置于牌堆顶'); game.log(player,'将'+get.cnNumber(result.links.length)+'张牌置于牌堆顶');
} }
for(var i=0;i<event.dialog.buttons.length;i++){ for(var i=0;i<event.dialog.buttons.length;i++){
ui.discardPile.appendChild(event.dialog.buttons[i].link); event.dialog.buttons[i].link.discard();
} }
'step 2' 'step 2'
var dialog=event.dialog; var dialog=event.dialog;

View File

@ -49,8 +49,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ns_yuji:['male','qun',3,['nsyaowang','nshuanhuo']], ns_yuji:['male','qun',3,['nsyaowang','nshuanhuo']],
ns_xinxianying:['female','wei',3,['nsdongcha','nscaijian','nsgongjian']], ns_xinxianying:['female','wei',3,['nsdongcha','nscaijian','nsgongjian']],
// ns_guanlu:['male','wei',3,[]], // ns_guanlu:['male','wei',3,[]],
// ns_simazhao:['male','wei',3,[]], ns_simazhao:['male','wei',3,['nszhaoxin','nsxiuxin','nsshijun']],
// ns_sunjian:['male','wei',3,[]], ns_sunjian:['male','wu',4,['nswulie','nshunyou','nscangxi']],
}, },
characterIntro:{ characterIntro:{
diy_feishi:'字公举,生卒年不详,益州犍为郡南安县(今四川省乐山市)人。刘璋占据益州时,以费诗为绵竹县县令。刘备进攻刘璋夺取益州,费诗举城而降,后受拜督军从事,转任牂牁郡太守,再为州前部司马。', diy_feishi:'字公举,生卒年不详,益州犍为郡南安县(今四川省乐山市)人。刘璋占据益州时,以费诗为绵竹县县令。刘备进攻刘璋夺取益州,费诗举城而降,后受拜督军从事,转任牂牁郡太守,再为州前部司马。',
@ -80,11 +80,277 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ns_wangyue:'#p废城君', ns_wangyue:'#p废城君',
ns_sunjian:'#b兔子两只2', ns_sunjian:'#b兔子两只2',
ns_yuji:'#g蔚屿凉音', ns_yuji:'#g蔚屿凉音',
ns_simazhao:'#r一纸载春秋',
}, },
perfectPair:{ perfectPair:{
yuji:['zuoci'] yuji:['zuoci']
}, },
skill:{ skill:{
nszhaoxin:{
mark:true,
intro:{
mark:function(dialog,content,player){
var hs=player.getCards('h');
if(hs.length){
dialog.addSmall();
}
else{
dialog.addText('无手牌');
}
},
content:function(content,player){
var hs=player.getCards('h');
if(hs.length){
return get.translation(hs);
}
else{
return '无手牌';
}
}
},
},
nsxiuxin:{
mod:{
targetEnabled:function(card,player,target){
var suit=get.suit(card);
if(suit&&!target.countCards('h',{suit:suit})){
return false;
}
}
}
},
nscangxi:{
unique:true,
global:'nscangxi2',
zhuSkill:true,
init:function(player){
player.storage.nscangxi=0;
},
intro:{
content:'手牌上限+#'
},
mod:{
maxHandcard:function(player,num){
return num+player.storage.nscangxi;
}
}
},
nscangxi2:{
trigger:{player:'phaseDiscardEnd'},
filter:function(event,player){
if(!event.cards||event.cards.length<=1) return false;
if(player.group!='wu') return false;
return game.hasPlayer(function(target){
return player!=target&&target.hasZhuSkill('nscangxi',player);
});
},
direct:true,
content:function(){
'step 0'
var list=game.filterPlayer(function(current){
return current!=player&&current.hasZhuSkill('nscangxi',player);
});
list.sortBySeat();
event.list=list;
'step 1'
if(event.list.length){
var current=event.list.shift();
event.current=current;
player.chooseBool(get.prompt('nscangxi',current)).set('choice',get.attitude(player,current)>0);
}
else{
event.finish();
}
'step 2'
if(result.bool){
player.logSkill('nscangxi',event.current);
player.judge(function(card){
return _status.event.att*(get.color(card)=='black'?1:0);
}).set('att',get.sgnAttitude(player,event.current));
}
else{
event.goto(1);
}
'step 3'
if(result.color=='black'){
var name=get.translation(event.current.name);
var att=0;
if(event.current.needsToDiscard()){
att=1;
}
player.chooseControlList(['令'+name+'摸一张牌展示','令'+name+'手牌上永久+1','弃置一张牌并令'+name+'获得一张本回进入弃牌堆的牌'],function(){
return _status.event.att;
}).set('att',att);
}
else{
event.goto(1);
}
'step 4'
switch(result.index){
case 0: event.current.draw('visible');break;
case 1: {
if(typeof event.current.storage.nscangxi!='number'){
event.current.storage.nscangxi=0;
}
event.current.storage.nscangxi++;
event.current.syncStorage('nscangxi');
event.current.markSkill('nscangxi');
break;
}
case 2: {
player.chooseToDiscard(true,'he');
break;
}
}
if(result.index!=2){
event.goto(1);
}
'step 5'
if(result.bool){
var discarded=get.discarded();
if(discarded.length){
event.current.chooseCardButton('选择一张获得之',discarded,true).set('ai',function(button){
return get.value(button.link);
});
}
else{
event.goto(1);
}
}
else{
event.goto(1);
}
'step 6'
if(result.bool&&result.links&&result.links.length){
event.current.gain(result.links,'gain2');
}
event.goto(1);
}
},
nswulie:{
trigger:{player:'phaseBegin'},
skillAnimation:true,
animationColor:'metal',
unique:true,
check:function(){
return false;
},
filter:function(event,player){
return ui.discardPile.childElementCount>0;
},
content:function(){
'step 0'
player.awakenSkill('nswulie');
player.loseMaxHp();
'step 1'
player.chooseCardButton(Array.from(ui.discardPile.childNodes),'将至多3张任意顺置于牌堆顶先选择的在上',true,[1,3]);
'step 2'
if(result.bool){
var cards=result.links.slice(0);
while(cards.length){
ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild);
}
player.addTempSkill('nswulie_end');
}
},
subSkill:{
end:{
trigger:{player:'phaseEnd'},
check:function(){
return false;
},
filter:function(event,player){
return ui.discardPile.childElementCount>0;
},
content:function(){
'step 0'
player.loseMaxHp();
'step 1'
player.chooseCardButton(Array.from(ui.discardPile.childNodes),'将至多3张任意顺置于牌堆顶先选择的在上',true,[1,3]);
'step 2'
if(result.bool){
var cards=result.links.slice(0);
while(cards.length){
ui.cardPile.insertBefore(cards.pop(),ui.cardPile.firstChild);
}
}
}
}
}
},
nshunyou:{
enable:'phaseUse',
usable:1,
filterCard:{type:'basic'},
filter:function(event,player){
return player.countCards('h',{type:'basic'});
},
content:function(){
'step 0'
var equip=null, trick=null;
for(var i=0;i<ui.discardPile.childElementCount;i++){
var type=get.type(ui.discardPile.childNodes[i],'trick');
if(type=='trick'){
trick=ui.discardPile.childNodes[i];
}
else if(type=='equip'){
equip=ui.discardPile.childNodes[i];
}
if(trick&&equip){
break;
}
}
var list=[];
if(trick) list.push(trick);
if(equip) list.push(equip);
if(!list.length){
player.draw(Math.min(3,1+player.maxHp-player.hp));
}
else{
player.gain(list,'gain2');
event.equip=equip;
}
'step 1'
if(event.equip&&get.owner(event.equip)==player){
player.chooseTarget('是否将'+get.translation(event.equip)+'装备给一其角色?',function(card,player,target){
return target!=player
}).set('ai',function(target){
var att=get.attitude(_status.event.player,target);
if(att>1){
if(!target.getEquip(_status.event.subtype)) return att;
}
return 0;
}).set('subtype',get.subtype(event.equip));
}
else{
event.finish();
}
'step 2'
if(result.bool){
player.line(result.targets,'green');
player.$give(event.equip,result.targets[0]);
player.lose(event.equip,ui.special);
}
else{
event.finish();
}
'step 3'
game.delay(0.5);
'step 4'
result.targets[0].equip(event.equip);
'step 5'
game.delay();
},
check:function(card){
return 7-get.value(card);
},
ai:{
order:7,
result:{
player:1
}
}
},
nsgongjian:{ nsgongjian:{
trigger:{player:'phaseDiscardEnd'}, trigger:{player:'phaseDiscardEnd'},
forced:true, forced:true,
@ -1604,7 +1870,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.$throw(links); player.$throw(links);
game.log(player, '被移去了', links); game.log(player, '被移去了', links);
for (var i = 0; i < links.length; i++) { for (var i = 0; i < links.length; i++) {
ui.discardPile.appendChild(links[i]); links[i].discard();
} }
} }
'step 2' 'step 2'
@ -2197,7 +2463,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('zhucheng',_status.currentPhase); player.logSkill('zhucheng',_status.currentPhase);
player.$throw(result.links[0]); player.$throw(result.links[0]);
player.storage.zhucheng.remove(result.links[0]); player.storage.zhucheng.remove(result.links[0]);
ui.discardPile.appendChild(result.links[0]); result.links[0].discard();
player.syncStorage('zhucheng'); player.syncStorage('zhucheng');
if(player.storage.zhucheng.length==0){ if(player.storage.zhucheng.length==0){
player.unmarkSkill('zhucheng'); player.unmarkSkill('zhucheng');
@ -2338,7 +2604,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(get.suit(event.cards[i])=='heart'){ if(get.suit(event.cards[i])=='heart'){
num++; num++;
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
event.cards.splice(i--,1); event.cards.splice(i--,1);
} }
} }
@ -2705,7 +2971,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 1" "step 1"
if(result.bool){ if(result.bool){
var card=get.cards()[0]; var card=get.cards()[0];
ui.discardPile.appendChild(card); card.discard();
player.showCards(card); player.showCards(card);
event.bool=get.color(card)=='red'; event.bool=get.color(card)=='red';
event.target=result.targets[0]; event.target=result.targets[0];
@ -3035,13 +3301,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ns_caocaosp:'sp曹操', ns_caocaosp:'sp曹操',
ns_xinxianying:'辛宪英', ns_xinxianying:'辛宪英',
ns_sunjian:'孙坚', ns_sunjian:'孙坚',
ns_simazhao:'司马昭',
ns_guanlu:'管辂',
nszhaoxin:'昭心',
nszhaoxin_info:'锁定技,你始终展示手牌',
nsxiuxin:'修心',
nsxiuxin_info:'锁定技,若你没有某种花色的手牌,你不能成为这种花色的牌的目标',
nsshijun:'弑君',
nsshijun_info:'锁定技,你造成伤害后,你失去一点体力,令此伤害+1',
nshunyou:'魂佑', nshunyou:'魂佑',
nshunyou_info:'每回合一次弃置一张基本牌获得弃牌堆底的一张装备牌和一张锦囊牌然后你可以将那张装备牌装备给任意角色允许替换。如果弃牌堆没有装备以及锦囊牌则改为摸X张牌X为损失的体力加一最多3张', nshunyou_info:'出阶段限一次,你可以弃置一张基本牌,获得弃牌堆底的一张装备牌和一张锦囊牌,然后你可以将那张装备牌装备给一名角色允许替换。如果弃牌堆没有装备以及锦囊牌则改为摸X张牌X为损失的体力加一最多3张',
nswulie:'武烈', nswulie:'武烈',
nswulie_info:'限定回合开始你可以失去1体力上限从弃牌堆选择最多三张牌以任意顺序放置于牌堆顶。如此此回合的结束阶段你可以失去一体力上限也可以如此做', nswulie_info:'限定准备阶段你可以失去1点体力上限从弃牌堆选择最多三张牌以任意顺序放置于牌堆顶。若如此做此回合的结束阶段你可以重复此操作',
nscangxi:'藏玺', nscangxi:'藏玺',
nscangxi_info:'主公技其他吴势力的弃牌阶段结束时若弃置了至少X张牌X为主公以外的错过的吴势力角色其可以选择判定若是黑色则其选择一项1令主公摸一张并且展示直到主公的回合开始或者进入濒死以前主公不可以使用打出此花色的牌2主公手牌上限永久加一每名角色只能使得主公手牌上限增加一。3额外弃置一张牌令主公获得本回合进入弃牌堆的一张牌', nscangxi2:'藏玺',
nscangxi_info:'主公技其他吴势力角色的弃牌阶段结束时若其弃置了至少两张牌则可以选择判定若是黑色则其选择一项1令主公摸一张并且展示2主公手牌上限永久加一3额外弃置一张牌令主公获得本回合进入弃牌堆的一张牌',
nsdongcha:'洞察', nsdongcha:'洞察',
nsdongcha_info:'锁定技,单体锦囊牌无法对你造成伤害。其它角色于其回合内第二次使用锦囊牌指定你为目标时,取消之', nsdongcha_info:'锁定技,单体锦囊牌无法对你造成伤害。其它角色于其回合内第二次使用锦囊牌指定你为目标时,取消之',
nscaijian:'才鉴', nscaijian:'才鉴',

View File

@ -339,7 +339,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.player.judging[0].clone.delete(); trigger.player.judging[0].clone.delete();
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
ui.discardPile.appendChild(trigger.player.judging[0]); trigger.player.judging[0].discard();
trigger.player.judging[0]=result.cards[0]; trigger.player.judging[0]=result.cards[0];
trigger.position.appendChild(result.cards[0]); trigger.position.appendChild(result.cards[0]);
game.log(trigger.player,'的判定牌改为',result.cards[0]); game.log(trigger.player,'的判定牌改为',result.cards[0]);
@ -1066,7 +1066,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(cards2,'log'); player.gain(cards2,'log');
if(cards2.length) player.$gain2(cards2); if(cards2.length) player.$gain2(cards2);
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
game.delay(2); game.delay(2);
}, },

View File

@ -2689,7 +2689,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.cardPile.childNodes.length<num){ if(ui.cardPile.childNodes.length<num){
var discardcards=get.cards(num); var discardcards=get.cards(num);
for(var i=0;i<discardcards.length;i++){ for(var i=0;i<discardcards.length;i++){
ui.discardPile.appendChild(discardcards[i]); discardcards[i].discard();
} }
} }
for(var i=0;i<num;i++){ for(var i=0;i<num;i++){

View File

@ -1253,7 +1253,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(get.type(list[i])=='basic'){ if(get.type(list[i])=='basic'){
ui.discardPile.appendChild(list[i]); list[i].discard();
list2.push(list[i]); list2.push(list[i]);
} }
} }
@ -3895,7 +3895,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(result.links,'draw'); player.gain(result.links,'draw');
event.cards.remove(result.links[0]); event.cards.remove(result.links[0]);
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
} }
}, },
ai:{ ai:{
@ -6075,7 +6075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeSkill('bingjia2'); player.removeSkill('bingjia2');
game.addVideo('storage',player,['bingjia',null]); game.addVideo('storage',player,['bingjia',null]);
'step 1' 'step 1'
ui.discardPile.appendChild(player.storage.bingjia); player.storage.bingjia.discard();
delete player.storage.bingjia; delete player.storage.bingjia;
player.changeHujia(); player.changeHujia();
player.addTempSkill('mianyi'); player.addTempSkill('mianyi');
@ -6178,7 +6178,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mark:'card', mark:'card',
content:function(){ content:function(){
"step 0" "step 0"
ui.discardPile.appendChild(player.storage.mdzhoufu2); player.storage.mdzhoufu2.discard();
player.$throw(player.storage.mdzhoufu2); player.$throw(player.storage.mdzhoufu2);
if(player.storage.mdzhoufu2.clone){ if(player.storage.mdzhoufu2.clone){
player.storage.mdzhoufu2.clone.classList.add('thrownhighlight'); player.storage.mdzhoufu2.clone.classList.add('thrownhighlight');
@ -6190,7 +6190,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.storage.mdzhoufu3.$gain2(player.judging[0]); player.storage.mdzhoufu3.$gain2(player.judging[0]);
} }
else{ else{
ui.discardPile.appendChild(player.judging[0]); player.judging[0].discard();
game.delay(1.5); game.delay(1.5);
} }
player.removeSkill('mdzhoufu2'); player.removeSkill('mdzhoufu2');

View File

@ -195,7 +195,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.player.judging[0].clone.classList.remove('thrownhighlight'); trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
ui.discardPile.appendChild(trigger.player.judging[0]); trigger.player.judging[0].discard();
trigger.player.judging[0]=card; trigger.player.judging[0]=card;
trigger.position.appendChild(card); trigger.position.appendChild(card);
game.log(trigger.player,'的判定牌改为',card); game.log(trigger.player,'的判定牌改为',card);

View File

@ -1094,7 +1094,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.showCards([player.storage.shoujia],get.translation(player)+'发动了【兽夹】'); player.showCards([player.storage.shoujia],get.translation(player)+'发动了【兽夹】');
'step 1' 'step 1'
ui.discardPile.appendChild(player.storage.shoujia); player.storage.shoujia.discard();
delete player.storage.shoujia; delete player.storage.shoujia;
delete player.storage.shoujia2; delete player.storage.shoujia2;
player.removeSkill('shoujia2'); player.removeSkill('shoujia2');
@ -1127,7 +1127,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.player==player.storage.shoujia2; return event.player==player.storage.shoujia2;
}, },
content:function(){ content:function(){
ui.discardPile.appendChild(player.storage.shoujia); player.storage.shoujia.discard();
player.$throw(player.storage.shoujia); player.$throw(player.storage.shoujia);
game.log(player.storage.shoujia,'被置入弃牌堆') game.log(player.storage.shoujia,'被置入弃牌堆')
delete player.storage.shoujia; delete player.storage.shoujia;
@ -1595,7 +1595,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
player.showCards([player.storage.dulei],get.translation(player)+'发动了【诡雷】'); player.showCards([player.storage.dulei],get.translation(player)+'发动了【诡雷】');
'step 1' 'step 1'
ui.discardPile.appendChild(player.storage.dulei); player.storage.dulei.discard();
delete player.storage.dulei; delete player.storage.dulei;
player.removeSkill('dulei2'); player.removeSkill('dulei2');
game.addVideo('storage',player,['dulei',null]); game.addVideo('storage',player,['dulei',null]);
@ -3319,7 +3319,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeEquipTrigger(); player.removeEquipTrigger();
var cards=player.getCards('he'); var cards=player.getCards('he');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
player.directgain(player.storage.shanxian_h); player.directgain(player.storage.shanxian_h);
for(var i=0;i<player.storage.shanxian_e.length;i++){ for(var i=0;i<player.storage.shanxian_e.length;i++){

View File

@ -332,7 +332,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},trigger.player.judging[0]); },trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
ui.discardPile.appendChild(trigger.player.judging[0]); trigger.player.judging[0].discard();
trigger.player.judging[0]=result.cards[0]; trigger.player.judging[0]=result.cards[0];
if(!get.owner(result.cards[0],'judge')){ if(!get.owner(result.cards[0],'judge')){
trigger.position.appendChild(result.cards[0]); trigger.position.appendChild(result.cards[0]);
@ -387,7 +387,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(get.type(cards[i])!='basic'&&cards[i].name!='juedou'&& if(get.type(cards[i])!='basic'&&cards[i].name!='juedou'&&
(get.type(cards[i])!='equip'||get.subtype(cards[i])!='equip1')){ (get.type(cards[i])!='equip'||get.subtype(cards[i])!='equip1')){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
cards.splice(i--,1); cards.splice(i--,1);
} }
} }
@ -797,7 +797,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
game.log(player,'展示并弃掉了',event.card); game.log(player,'展示并弃掉了',event.card);
ui.discardPile.appendChild(event.card); event.card.discard();
} }
game.addVideo('deletenode',player,[get.cardInfo(event.node)]); game.addVideo('deletenode',player,[get.cardInfo(event.node)]);
event.node.delete(); event.node.delete();
@ -822,7 +822,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
game.log(player,'展示并弃掉了',event.card); game.log(player,'展示并弃掉了',event.card);
ui.discardPile.appendChild(event.card); event.card.discard();
game.addVideo('deletenode',player,[get.cardInfo(event.node)]); game.addVideo('deletenode',player,[get.cardInfo(event.node)]);
event.node.delete(); event.node.delete();
game.broadcast(function(card){ game.broadcast(function(card){
@ -1282,7 +1282,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(result.targets,'green'); player.line(result.targets,'green');
result.targets[0].$gain2(event.card); result.targets[0].$gain2(event.card);
for(var i=0;i<cards.length-1;i++){ for(var i=0;i<cards.length-1;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
game.delay(0,1000); game.delay(0,1000);
"step 3" "step 3"

View File

@ -1793,7 +1793,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(get.suit(event.cards[i])=='heart'){ if(get.suit(event.cards[i])=='heart'){
num++; num++;
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
event.cards.splice(i--,1); event.cards.splice(i--,1);
} }
} }
@ -1980,6 +1980,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=game.filterPlayer(function(current){ var list=game.filterPlayer(function(current){
return current!=player&&current.hasZhuSkill('songwei',player); return current!=player&&current.hasZhuSkill('songwei',player);
}); });
list.sortBySeat();
event.list=list; event.list=list;
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
@ -2456,6 +2457,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var list=game.filterPlayer(function(target){ var list=game.filterPlayer(function(target){
return player!=target&&target.hp<target.maxHp&&target.hasZhuSkill('baonue',player); return player!=target&&target.hp<target.maxHp&&target.hasZhuSkill('baonue',player);
}); });
list.sortBySeat();
event.list=list; event.list=list;
'step 1' 'step 1'
if(event.list.length){ if(event.list.length){
@ -3890,7 +3892,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.hp=1-player.storage.gzbuqu.length; player.hp=1-player.storage.gzbuqu.length;
game.log(player,'移去了不屈牌',player.storage.gzbuqu); game.log(player,'移去了不屈牌',player.storage.gzbuqu);
while(player.storage.gzbuqu.length){ while(player.storage.gzbuqu.length){
ui.discardPile.appendChild(player.storage.gzbuqu.shift()); player.storage.gzbuqu.shift().discard();
} }
player.unmarkSkill('gzbuqu'); player.unmarkSkill('gzbuqu');
player.dying({}); player.dying({});
@ -3930,7 +3932,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.hp-=player.storage.gzbuqu.length-1; player.hp-=player.storage.gzbuqu.length-1;
player.update(); player.update();
while(player.storage.gzbuqu.length){ while(player.storage.gzbuqu.length){
ui.discardPile.appendChild(player.storage.gzbuqu.shift()); player.storage.gzbuqu.shift().discard();
} }
player.unmarkSkill('gzbuqu'); player.unmarkSkill('gzbuqu');
delete player.nodying; delete player.nodying;
@ -3953,7 +3955,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
'step 1' 'step 1'
for(var i=0;i<result.links.length;i++){ for(var i=0;i<result.links.length;i++){
ui.discardPile.appendChild(result.links[i]); result.links[i].discard();
player.storage.gzbuqu.remove(result.links[i]); player.storage.gzbuqu.remove(result.links[i]);
} }
player.$throw(result.links); player.$throw(result.links);
@ -4010,7 +4012,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(storage&&storage.length){ if(storage&&storage.length){
player.$throw(storage); player.$throw(storage);
for(var i=0;i<storage.length;i++){ for(var i=0;i<storage.length;i++){
ui.discardPile.appendChild(storage[i]); storage[i].discard();
} }
delete player.storage.buqu; delete player.storage.buqu;
} }

View File

@ -2953,14 +2953,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(get.type(event.cards[i])=='basic'){ if(get.type(event.cards[i])=='basic'){
if(event.cards[i].name=='tao'){ if(event.cards[i].name=='tao'){
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
} }
else{ else{
event.basic.push(event.cards[i]); event.basic.push(event.cards[i]);
} }
} }
else{ else{
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
event.nonbasic.push(event.cards[i]); event.nonbasic.push(event.cards[i]);
} }
} }
@ -3020,7 +3020,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
for(var i=0;i<event.basic.length;i++){ for(var i=0;i<event.basic.length;i++){
ui.discardPile.appendChild(event.basic[i]); event.basic[i].discard();
} }
} }
delete player.storage.zhaolie; delete player.storage.zhaolie;
@ -3276,7 +3276,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.$throw(player.storage.tuifeng.slice(0),1000); player.$throw(player.storage.tuifeng.slice(0),1000);
player.storage.tuifeng3=player.storage.tuifeng.length; player.storage.tuifeng3=player.storage.tuifeng.length;
while(player.storage.tuifeng.length){ while(player.storage.tuifeng.length){
ui.discardPile.appendChild(player.storage.tuifeng.shift()); player.storage.tuifeng.shift().discard();
} }
player.unmarkSkill('tuifeng') player.unmarkSkill('tuifeng')
} }
@ -3726,7 +3726,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var index=player.storage.shefu2.indexOf(trigger.card.name); var index=player.storage.shefu2.indexOf(trigger.card.name);
if(index!=-1){ if(index!=-1){
var card=player.storage.shefu[index]; var card=player.storage.shefu[index];
ui.discardPile.appendChild(card); card.discard();
player.$throw(card); player.$throw(card);
player.storage.shefu.splice(index,1); player.storage.shefu.splice(index,1);
player.storage.shefu2.splice(index,1); player.storage.shefu2.splice(index,1);
@ -4203,7 +4203,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
gained.push(event.cards[i]); gained.push(event.cards[i]);
} }
else{ else{
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
} }
} }
player.gain(gained,'gain2'); player.gain(gained,'gain2');
@ -4600,7 +4600,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var cards=event.cards||result.links; var cards=event.cards||result.links;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
player.storage.yinling.remove(cards[i]); player.storage.yinling.remove(cards[i]);
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
player.$throw(cards); player.$throw(cards);
player.syncStorage('yinling'); player.syncStorage('yinling');
@ -4971,7 +4971,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.xingwu.length==3){ if(player.storage.xingwu.length==3){
player.$throw(player.storage.xingwu); player.$throw(player.storage.xingwu);
while(player.storage.xingwu.length){ while(player.storage.xingwu.length){
ui.discardPile.appendChild(player.storage.xingwu.shift()); player.storage.xingwu.shift().discard();
} }
player.unmarkSkill('xingwu'); player.unmarkSkill('xingwu');
player.chooseTarget(function(card,player,target){ player.chooseTarget(function(card,player,target){
@ -5041,7 +5041,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onunmark:function(storage,player){ onunmark:function(storage,player){
if(storage&&storage.length){ if(storage&&storage.length){
for(var i=0;i<storage.length;i++){ for(var i=0;i<storage.length;i++){
ui.discardPile.appendChild(storage[i]); storage[i].discard();
} }
player.$throw(storage); player.$throw(storage);
delete player.storage.yinbing; delete player.storage.yinbing;
@ -5075,7 +5075,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
var card=result.links[0]; var card=result.links[0];
player.storage.yinbing.remove(card); player.storage.yinbing.remove(card);
ui.discardPile.appendChild(card); card.discard();
player.$throw(card); player.$throw(card);
game.log(player,'将',card,'置入弃牌堆'); game.log(player,'将',card,'置入弃牌堆');
player.syncStorage('yinbing'); player.syncStorage('yinbing');
@ -5133,7 +5133,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var num=player.maxHp-player.countCards('h'); var num=player.maxHp-player.countCards('h');
if(num>0) player.draw(num); if(num>0) player.draw(num);
while(player.storage.yinbing.length){ while(player.storage.yinbing.length){
ui.discardPile.appendChild(player.storage.yinbing.shift()); player.storage.yinbing.shift().discard();
} }
player.syncStorage('yinbing'); player.syncStorage('yinbing');
player.unmarkSkill('yinbing'); player.unmarkSkill('yinbing');
@ -5392,7 +5392,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.$throw(result.links); player.$throw(result.links);
for(var i=0;i<result.links.length;i++){ for(var i=0;i<result.links.length;i++){
player.storage.fentian.remove(result.links[i]); player.storage.fentian.remove(result.links[i]);
ui.discardPile.appendChild(result.links[i]); result.links[i].discard();
} }
player.syncStorage('fentian'); player.syncStorage('fentian');
target.loseHp(); target.loseHp();
@ -5522,7 +5522,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('shuliang',trigger.player); player.logSkill('shuliang',trigger.player);
player.storage.tunchu.remove(result.links[0]); player.storage.tunchu.remove(result.links[0]);
player.$throw(result.links); player.$throw(result.links);
ui.discardPile.appendChild(result.links[0]); result.links[0].discard();
player.syncStorage('tunchu'); player.syncStorage('tunchu');
if(player.storage.tunchu.length==0){ if(player.storage.tunchu.length==0){
player.unmarkSkill('tunchu'); player.unmarkSkill('tunchu');
@ -6311,7 +6311,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.source.judge(ui.special); trigger.source.judge(ui.special);
"step 1" "step 1"
if(result.color=='black'){ if(result.color=='black'){
result.card.goto(ui.discardPile); result.card.discard();
trigger.num++; trigger.num++;
} }
else{ else{
@ -6741,7 +6741,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
for(var i=0;i<player.storage.zuixiang.length;i++){ for(var i=0;i<player.storage.zuixiang.length;i++){
ui.discardPile.appendChild(player.storage.zuixiang[i]); player.storage.zuixiang[i].discard();
} }
player.storage.zuixiang=get.cards(3); player.storage.zuixiang=get.cards(3);
player.showCards(player.storage.zuixiang); player.showCards(player.storage.zuixiang);
@ -7330,7 +7330,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
} }
event.finish(); event.finish();
} }
@ -7346,7 +7346,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
else{ else{
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
ui.discardPile.appendChild(event.cards[i]); event.cards[i].discard();
} }
event.finish(); event.finish();
} }
@ -8417,7 +8417,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.cardPile.childNodes.length<2){ if(ui.cardPile.childNodes.length<2){
var discardcards=get.cards(2); var discardcards=get.cards(2);
for(var i=0;i<discardcards.length;i++){ for(var i=0;i<discardcards.length;i++){
ui.discardPile.appendChild(discardcards[i]); discardcards[i].discard();
} }
} }
for(var i=0;i<2;i++){ for(var i=0;i<2;i++){
@ -8456,7 +8456,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.cardPile.childNodes.length<2){ if(ui.cardPile.childNodes.length<2){
var discardcards=get.cards(2); var discardcards=get.cards(2);
for(var i=0;i<discardcards.length;i++){ for(var i=0;i<discardcards.length;i++){
ui.discardPile.appendChild(discardcards[i]); discardcards[i].discard();
} }
} }
for(var i=0;i<2;i++){ for(var i=0;i<2;i++){
@ -8614,7 +8614,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},trigger.player.judging[0]); },trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
ui.discardPile.appendChild(trigger.player.judging[0]); trigger.player.judging[0].discard();
trigger.player.judging[0]=event.card; trigger.player.judging[0]=event.card;
if(!get.owner(event.card,'judge')){ if(!get.owner(event.card,'judge')){
trigger.position.appendChild(event.card); trigger.position.appendChild(event.card);
@ -8836,7 +8836,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(player.storage.bifa[0],'draw2','log'); player.gain(player.storage.bifa[0],'draw2','log');
} }
else{ else{
ui.discardPile.appendChild(player.storage.bifa[0]); player.storage.bifa[0].discard();
game.log(player.storage.bifa[0],'进入弃牌堆'); game.log(player.storage.bifa[0],'进入弃牌堆');
player.$throw(player.storage.bifa[0],1000); player.$throw(player.storage.bifa[0],1000);
player.loseHp(); player.loseHp();

View File

@ -216,7 +216,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},trigger.player.judging[0]); },trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
ui.discardPile.appendChild(trigger.player.judging[0]); trigger.player.judging[0].discard();
trigger.player.judging[0]=result.cards[0]; trigger.player.judging[0]=result.cards[0];
if(!get.owner(result.cards[0],'judge')){ if(!get.owner(result.cards[0],'judge')){
trigger.position.appendChild(result.cards[0]); trigger.position.appendChild(result.cards[0]);

View File

@ -538,7 +538,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card){ if(card){
player.showCards(card,get.translation(player)+'发动了【陷阱】'); player.showCards(card,get.translation(player)+'发动了【陷阱】');
player.storage.sxianjing.remove(card); player.storage.sxianjing.remove(card);
ui.discardPile.appendChild(card); card.discard();
player.syncStorage('sxianjing'); player.syncStorage('sxianjing');
if(player.storage.sxianjing.length){ if(player.storage.sxianjing.length){
player.updateMarks(); player.updateMarks();
@ -599,7 +599,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.suits=suits; event.suits=suits;
for(var i=0;i<event.list.length;i++){ for(var i=0;i<event.list.length;i++){
suits.add(get.suit(event.list[i])); suits.add(get.suit(event.list[i]));
ui.discardPile.appendChild(event.list[i]); event.list[i].discard();
} }
'step 2' 'step 2'
if(event.suits.contains('diamond')){ if(event.suits.contains('diamond')){
@ -1827,7 +1827,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.cardPile.childNodes.length<3){ if(ui.cardPile.childNodes.length<3){
var discardcards=get.cards(3); var discardcards=get.cards(3);
for(var i=0;i<discardcards.length;i++){ for(var i=0;i<discardcards.length;i++){
ui.discardPile.appendChild(discardcards[i]); discardcards[i].discard();
} }
} }
for(var i=0;i<3;i++){ for(var i=0;i<3;i++){
@ -2492,7 +2492,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
trigger.num--; trigger.num--;
player.removeSkill('fuyan2'); player.removeSkill('fuyan2');
ui.discardPile.appendChild(player.storage.fuyan2); player.storage.fuyan2.discard();
delete player.storage.fuyan2; delete player.storage.fuyan2;
}, },
intro:{ intro:{
@ -3256,7 +3256,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.cardPile.childNodes.length<num){ if(ui.cardPile.childNodes.length<num){
var discardcards=get.cards(num); var discardcards=get.cards(num);
for(var i=0;i<discardcards.length;i++){ for(var i=0;i<discardcards.length;i++){
ui.discardPile.appendChild(discardcards[i]); discardcards[i].discard();
} }
} }
for(var i=0;i<num;i++){ for(var i=0;i<num;i++){
@ -5852,7 +5852,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 1" "step 1"
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(get.suit(event.cards[i])!='heart'){ if(get.suit(event.cards[i])!='heart'){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
event.cards.splice(i--,1); event.cards.splice(i--,1);
} }
} }
@ -7760,7 +7760,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 2" "step 2"
if(event.card){ if(event.card){
player.logSkill('tianlun',trigger.player); player.logSkill('tianlun',trigger.player);
ui.discardPile.appendChild(trigger.player.judging[0]); trigger.player.judging[0].discard();
trigger.player.judging[0]=event.card; trigger.player.judging[0]=event.card;
trigger.position.appendChild(event.card); trigger.position.appendChild(event.card);
game.log(trigger.player,'的判定牌改为',event.card); game.log(trigger.player,'的判定牌改为',event.card);

View File

@ -59,7 +59,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(); player.draw();
"step 1" "step 1"
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
}, },
ai:{ ai:{

View File

@ -1184,7 +1184,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addVideo('skill',event.player,['ywuhun',data]); game.addVideo('skill',event.player,['ywuhun',data]);
game.animate.window(2); game.animate.window(2);
while(ui.cardPile.childElementCount){ while(ui.cardPile.childElementCount){
ui.discardPile.appendChild(ui.cardPile.firstChild); ui.cardPile.firstChild.discard();
} }
for(var i=0;i<event.cardPile.length;i++){ for(var i=0;i<event.cardPile.length;i++){
if(event.cardPile[i].parentNode==ui.discardPile){ if(event.cardPile[i].parentNode==ui.discardPile){
@ -2974,7 +2974,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
"step 2" "step 2"
player.$throw(player.storage.ctianfu2); player.$throw(player.storage.ctianfu2);
ui.discardPile.appendChild(player.storage.ctianfu2); player.storage.ctianfu2.discard();
delete player.storage.ctianfu2; delete player.storage.ctianfu2;
delete player.storage.ctianfu3; delete player.storage.ctianfu3;
player.removeSkill('ctianfu2'); player.removeSkill('ctianfu2');
@ -2989,7 +2989,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
popup:false, popup:false,
content:function(){ content:function(){
ui.discardPile.appendChild(player.storage.ctianfu2); player.storage.ctianfu2.discard();
delete player.storage.ctianfu2; delete player.storage.ctianfu2;
delete player.storage.ctianfu3; delete player.storage.ctianfu3;
player.removeSkill('ctianfu2'); player.removeSkill('ctianfu2');
@ -3050,7 +3050,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onunmark:function(storage,player){ onunmark:function(storage,player){
if(storage&&storage.length){ if(storage&&storage.length){
for(var i=0;i<storage.length;i++){ for(var i=0;i<storage.length;i++){
ui.discardPile.appendChild(storage[i]); storage[i].discard();
} }
player.$throw(storage); player.$throw(storage);
delete player.storage.shuiyun; delete player.storage.shuiyun;
@ -3099,7 +3099,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.unmarkSkill('shuiyun'); player.unmarkSkill('shuiyun');
} }
player.$throw(result.links); player.$throw(result.links);
ui.discardPile.appendChild(result.links[0]); result.links[0].discard();
target.recover(); target.recover();
if(typeof player.storage.shuiyun_count=='number'){ if(typeof player.storage.shuiyun_count=='number'){
player.storage.shuiyun_count++; player.storage.shuiyun_count++;
@ -3407,7 +3407,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
if(player.storage.xshuangren){ if(player.storage.xshuangren){
ui.discardPile.appendChild(player.storage.xshuangren); player.storage.xshuangren.discard();
player.$throw(player.storage.xshuangren); player.$throw(player.storage.xshuangren);
} }
} }
@ -3921,7 +3921,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var player=event.players[event.num]; var player=event.players[event.num];
if(player.storage.zhimeng2){ if(player.storage.zhimeng2){
if(trigger.name=='die'&&player==trigger.player){ if(trigger.name=='die'&&player==trigger.player){
ui.discardPile.appendChild(player.storage.zhimeng2); player.storage.zhimeng2.discard();
} }
else{ else{
game.log(player,'发动织梦,获得了',player.storage.zhimeng2); game.log(player,'发动织梦,获得了',player.storage.zhimeng2);

View File

@ -344,7 +344,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
content:function(){ content:function(){
var cards=get.cards(); var cards=get.cards();
ui.discardPile.appendChild(cards[0]); cards[0].discard();
cards[0].vanishtag.add('tianbian'); cards[0].vanishtag.add('tianbian');
trigger.directresult=cards; trigger.directresult=cards;
trigger.untrigger(); trigger.untrigger();
@ -1098,7 +1098,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
if(event.togain.length){ if(event.togain.length){
for(var i=0;i<dialog.buttons.length;i++){ for(var i=0;i<dialog.buttons.length;i++){
ui.discardPile.appendChild(event.togain[i]); event.togain[i].discard();
} }
} }
game.broadcast(function(id){ game.broadcast(function(id){
@ -2838,7 +2838,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.cards2.push(cards[i]); event.cards2.push(cards[i]);
} }
else{ else{
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
} }
} }
@ -3429,7 +3429,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('chunlao'); player.logSkill('chunlao');
player.$throw(result.links); player.$throw(result.links);
player.storage.chunlao.remove(result.links[0]); player.storage.chunlao.remove(result.links[0]);
ui.discardPile.appendChild(result.links[0]); result.links[0].discard();
player.syncStorage('chunlao'); player.syncStorage('chunlao');
target.useCard({name:'jiu'},target); target.useCard({name:'jiu'},target);
if(!player.storage.chunlao.length){ if(!player.storage.chunlao.length){
@ -3471,7 +3471,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('chunlao',trigger.player); player.logSkill('chunlao',trigger.player);
player.$throw(result.links); player.$throw(result.links);
player.storage.chunlao.remove(result.links[0]); player.storage.chunlao.remove(result.links[0]);
ui.discardPile.appendChild(result.links[0]); result.links[0].discard();
player.syncStorage('chunlao'); player.syncStorage('chunlao');
trigger.player.useCard({name:'jiu'},trigger.player); trigger.player.useCard({name:'jiu'},trigger.player);
if(!player.storage.chunlao.length){ if(!player.storage.chunlao.length){
@ -3719,7 +3719,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.$throw([button]); player.$throw([button]);
player.line(trigger.player,'green'); player.line(trigger.player,'green');
game.log(player,'将',button,'置于弃牌堆'); game.log(player,'将',button,'置于弃牌堆');
ui.discardPile.appendChild(button); button.discard();
trigger.player.addTempSkill('sidi3'); trigger.player.addTempSkill('sidi3');
player.storage.sidi.remove(button); player.storage.sidi.remove(button);
player.syncStorage('sidi'); player.syncStorage('sidi');
@ -5363,7 +5363,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
player.$throw(player.storage.xinpojun2,1000); player.$throw(player.storage.xinpojun2,1000);
for(var i=0;i<player.storage.xinpojun2.length;i++){ for(var i=0;i<player.storage.xinpojun2.length;i++){
ui.discardPile.appendChild(player.storage.xinpojun2[i]); player.storage.xinpojun2[i].discard();
} }
game.log(player,'弃置了',player.storage.xinpojun2); game.log(player,'弃置了',player.storage.xinpojun2);
delete player.storage.xinpojun2; delete player.storage.xinpojun2;
@ -5405,7 +5405,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.draw(); player.draw();
"step 1" "step 1"
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
}, },
ai:{ ai:{
@ -8416,7 +8416,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
cards.remove(result.links[i]); cards.remove(result.links[i]);
} }
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); cards[i].discard();
} }
event.cards2=cards2; event.cards2=cards2;
} }
@ -8584,7 +8584,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
onunmark:function(storage,player){ onunmark:function(storage,player){
if(storage&&storage.length){ if(storage&&storage.length){
for(var i=0;i<storage.length;i++){ for(var i=0;i<storage.length;i++){
ui.discardPile.appendChild(storage[i]); storage[i].discard();
} }
player.$throw(storage); player.$throw(storage);
player.storage.xiansi.length=0; player.storage.xiansi.length=0;
@ -8670,7 +8670,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.target.$throw(links); event.target.$throw(links);
game.log(event.target,'被移去了',links); game.log(event.target,'被移去了',links);
for(var i=0;i<links.length;i++){ for(var i=0;i<links.length;i++){
ui.discardPile.appendChild(links[i]); links[i].discard();
} }
player.useCard({name:'sha'},event.target); player.useCard({name:'sha'},event.target);
} }

View File

@ -1982,7 +1982,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.cardPile.childNodes.length<4){ if(ui.cardPile.childNodes.length<4){
var discardcards=get.cards(4); var discardcards=get.cards(4);
for(var i=0;i<discardcards.length;i++){ for(var i=0;i<discardcards.length;i++){
ui.discardPile.appendChild(discardcards[i]); discardcards[i].discard();
} }
} }
player.chooseControl('heart2','diamond2','club2','spade2','cancel').ai=function(event){ player.chooseControl('heart2','diamond2','club2','spade2','cancel').ai=function(event){
@ -2017,7 +2017,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 2" "step 2"
if(event.cards&&event.cards.length){ if(event.cards&&event.cards.length){
if(get.suit(event.cards[event.cards.length-1])==event.suit){ if(get.suit(event.cards[event.cards.length-1])==event.suit){
ui.discardPile.appendChild(event.cards.pop()); event.cards.pop().discard();
} }
if(event.cards.length){ if(event.cards.length){
player.gain(event.cards,'draw2'); player.gain(event.cards,'draw2');

View File

@ -12533,6 +12533,9 @@
if(lib.config.reverse_sort) sort=-sort; if(lib.config.reverse_sort) sort=-sort;
cards[num].fix(); cards[num].fix();
cards[num].style.transform=''; cards[num].style.transform='';
if(_status.discarded){
_status.discarded.remove(cards[num]);
}
// cards[num].vanishtag.length=0; // cards[num].vanishtag.length=0;
for(var num2=0;num2<cards[num].vanishtag.length;num2++){ for(var num2=0;num2<cards[num].vanishtag.length;num2++){
if(cards[num].vanishtag[num2][0]!='_'){ if(cards[num].vanishtag[num2][0]!='_'){
@ -12641,6 +12644,14 @@
cards[i].destroyed=info.destroy||cards[i]._destroy; cards[i].destroyed=info.destroy||cards[i]._destroy;
} }
else if(event.position){ else if(event.position){
if(_status.discarded){
if(event.position==ui.discardPile){
_status.discarded.add(cards[i]);
}
else{
_status.discarded.remove(cards[i]);
}
}
cards[i].goto(event.position); cards[i].goto(event.position);
} }
else{ else{
@ -13071,7 +13082,7 @@
_status.dying.remove(player); _status.dying.remove(player);
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].goto(ui.discardPile); cards[i].discard();
} }
if(game.online&&player==game.me&&!_status.over&&!game.controlOver&&!ui.exit){ if(game.online&&player==game.me&&!_status.over&&!game.controlOver&&!ui.exit){
if(lib.mode[lib.configOL.mode].config.dierestart){ if(lib.mode[lib.configOL.mode].config.dierestart){
@ -13253,6 +13264,9 @@
cards[0].style.transform=''; cards[0].style.transform='';
cards[0].classList.add('drawinghidden'); cards[0].classList.add('drawinghidden');
player.node.judges.insertBefore(cards[0],player.node.judges.firstChild); player.node.judges.insertBefore(cards[0],player.node.judges.firstChild);
if(_status.discarded){
_status.discarded.remove(cards[0]);
}
ui.updatej(player); ui.updatej(player);
game.broadcast(function(player,card,viewAs){ game.broadcast(function(player,card,viewAs){
card.fix(); card.fix();
@ -19000,6 +19014,9 @@
} }
if(!equipped){ if(!equipped){
player.node.equips.appendChild(card); player.node.equips.appendChild(card);
if(_status.discarded){
_status.discarded.remove(card);
}
} }
var info=get.info(card); var info=get.info(card);
if(info.skills){ if(info.skills){
@ -19957,12 +19974,20 @@
else this._uncheck.length=0; else this._uncheck.length=0;
if(this._uncheck.length==0) this.classList.remove('uncheck'); if(this._uncheck.length==0) this.classList.remove('uncheck');
}, },
discard:function(){ discard:function(bool){
if(!this.destroyed){ if(!this.destroyed){
ui.discardPile.appendChild(this); ui.discardPile.appendChild(this);
} }
this.fix(); this.fix();
this.classList.remove('glow'); this.classList.remove('glow');
if(bool===false){
ui.cardPile.insertBefore(this,ui.cardPile.childNodes[Math.floor(Math.random()*ui.cardPile.childNodes.length)]);
}
else{
if(_status.discarded){
_status.discarded.add(this);
}
}
}, },
hasPosition:function(){ hasPosition:function(){
return ['h','e','j'].contains(get.position(this)); return ['h','e','j'].contains(get.position(this));
@ -21290,6 +21315,7 @@
},player); },player);
} }
_status.currentPhase=player; _status.currentPhase=player;
_status.discarded=[];
game.phaseNumber++; game.phaseNumber++;
game.syncState(); game.syncState();
game.addVideo('phaseChange',player); game.addVideo('phaseChange',player);
@ -24392,7 +24418,7 @@
} }
var cards=player.getCards('hej'); var cards=player.getCards('hej');
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].goto(ui.discardPile); cards[i].discard();
} }
while(player.node.marks.childNodes.length>1){ while(player.node.marks.childNodes.length>1){
player.node.marks.lastChild.remove(); player.node.marks.lastChild.remove();
@ -39317,7 +39343,7 @@
if(ui.discardPile.childNodes.length){ if(ui.discardPile.childNodes.length){
var list=[]; var list=[];
for(var i=0;i<ui.discardPile.childNodes.length;i++){ for(var i=0;i<ui.discardPile.childNodes.length;i++){
list.push(ui.discardPile.childNodes[i]); list.unshift(ui.discardPile.childNodes[i]);
} }
uiintro.addSmall([list,'card']); uiintro.addSmall([list,'card']);
} }
@ -42423,6 +42449,15 @@
return false; return false;
}, },
}, },
discarded:function(){
var list=_status.discarded.slice(0);
for(var i=0;i<list.length;i++){
if(list[i].parentNode!=ui.discardPile){
list.splice(i--,1);
}
}
return list;
},
colorspan:function(str){ colorspan:function(str){
if(str[0]=='#'){ if(str[0]=='#'){
var color; var color;
@ -43540,6 +43575,9 @@
for(var i=0;i<lib.onwash.length;i++){ for(var i=0;i<lib.onwash.length;i++){
lib.onwash[i](); lib.onwash[i]();
} }
if(_status.discarded){
_status.discarded.length=0;
}
for(i=0;i<ui.discardPile.childNodes.length;i++){ for(i=0;i<ui.discardPile.childNodes.length;i++){
var currentcard=ui.discardPile.childNodes[i]; var currentcard=ui.discardPile.childNodes[i];
currentcard.vanishtag.length=0; currentcard.vanishtag.length=0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 393 KiB

View File

@ -2466,7 +2466,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -2543,7 +2543,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -2637,7 +2637,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -2714,7 +2714,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -2807,7 +2807,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -2897,7 +2897,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -2991,7 +2991,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -3082,7 +3082,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.players[i].removeEquipTrigger(); game.players[i].removeEquipTrigger();
var hej=game.players[i].getCards('hej'); var hej=game.players[i].getCards('hej');
for(var j=0;j<hej.length;j++){ for(var j=0;j<hej.length;j++){
ui.discardPile.appendChild(hej[j]); hej[j].discard(false);
} }
game.players[i].hp=game.players[i].maxHp; game.players[i].hp=game.players[i].maxHp;
game.players[i].hujia=0; game.players[i].hujia=0;
@ -4136,7 +4136,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
event.dialog.videoId=event.videoId; event.dialog.videoId=event.videoId;
game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]); game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]);
for(var i=0;i<event.cards.length;i++) ui.discardPile.appendChild(event.cards[i]); for(var i=0;i<event.cards.length;i++) event.cards[i].discard();
// var node=card.copy('thrown','center',ui.arena).animate('start'); // var node=card.copy('thrown','center',ui.arena).animate('start');
var node; var node;
if(game.chess){ if(game.chess){

View File

@ -422,7 +422,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var card=result.links[0]; var card=result.links[0];
ui.discardPile.appendChild(card); card.discard();
player.storage.huangjintianbingfu.remove(card); player.storage.huangjintianbingfu.remove(card);
player.$throw(card,1000); player.$throw(card,1000);
player.updateMarks('huangjintianbingfu'); player.updateMarks('huangjintianbingfu');

View File

@ -519,7 +519,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
var hs=game.me.getCards('h'); var hs=game.me.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); hs[i].discard(false);
} }
if(_status.mode=='deck'){ if(_status.mode=='deck'){
game.me.drawDeck(1,false); game.me.drawDeck(1,false);

View File

@ -441,7 +441,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(event.replaceCard&&result.bool){ if(event.replaceCard&&result.bool){
var hs=game.me.getCards('h'); var hs=game.me.getCards('h');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
ui.discardPile.appendChild(hs[i]); hs[i].discard(false);
} }
game.me.directgain(get.cards(hs.length)); game.me.directgain(get.cards(hs.length));
} }