This commit is contained in:
parent
54e99bd8e8
commit
dc5e57afdb
|
@ -576,7 +576,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(event.triggername=='phaseBegin'){
|
||||
player.storage.lieqi=target;
|
||||
}
|
||||
var hs=target.get('h').randomSort();
|
||||
var hs=target.getCards('h').randomSort();
|
||||
if(hs.length){
|
||||
var list2=[];
|
||||
for(var i=0;i<hs.length;i++){
|
||||
|
@ -599,8 +599,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.chooseCardButton(true,'猜测哪张牌为'+get.translation(target)+'的手牌',
|
||||
[card,game.createCard(list.randomRemove()),game.createCard(list.randomRemove())].randomSort()).ai=function(button){
|
||||
if(get.value(button.link)<0) return -10;
|
||||
if(!_status.event.rand) _status.event.rand=Math.random();
|
||||
if(_status.event.rand<0.7){
|
||||
if(_status.event.getRand()<0.7){
|
||||
return button.link==card?1:-1;
|
||||
}
|
||||
else{
|
||||
|
@ -665,7 +664,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
check:function(button){
|
||||
var player=_status.event.player;
|
||||
var card={name:button.link[2],nature:button.link[3]};
|
||||
if(!_status.event.rand) _status.event.rand=Math.random();
|
||||
if(game.hasPlayer(function(current){
|
||||
return player.canUse(card,current)&&get.effect(current,card,player,player)>0;
|
||||
})){
|
||||
|
@ -678,7 +676,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
else if(button.link[3]=='fire') return 2.92;
|
||||
else return 2.9;
|
||||
break;
|
||||
default:return 2+_status.event.rand*2;
|
||||
default:return 2+_status.event.getRand()*2;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -770,7 +768,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.addSkill('qianfu2');
|
||||
player.hp=1;
|
||||
player.update();
|
||||
player.discard(player.get('he'));
|
||||
player.discard(player.getCards('he'));
|
||||
player.setAvatar('hs_selajin','hs_selajin2');
|
||||
},
|
||||
ai:{
|
||||
|
@ -1147,7 +1145,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
forced:true,
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.discard(player.get('hej'));
|
||||
player.discard(player.getCards('hej'));
|
||||
'step 1'
|
||||
player.link(false);
|
||||
'step 2'
|
||||
|
|
|
@ -7571,13 +7571,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.addSkill('duwu3');
|
||||
target.damage();
|
||||
if(target.hp>1){
|
||||
event.finish();
|
||||
}
|
||||
"step 1"
|
||||
if(!player.hasSkill('duwu3')){
|
||||
player.addSkill('duwu2');
|
||||
player.loseHp();
|
||||
}
|
||||
else{
|
||||
player.removeSkill('duwu3');
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
order:2,
|
||||
|
@ -7599,6 +7602,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.removeSkill('duwu2');
|
||||
}
|
||||
},
|
||||
duwu3:{
|
||||
trigger:{global:'dying'},
|
||||
priority:15,
|
||||
forced:true,
|
||||
popup:false,
|
||||
silent:true,
|
||||
filter:function(event,player){
|
||||
return event.reason&&event.reason.getParent().name=='duwu';
|
||||
},
|
||||
content:function(){
|
||||
player.removeSkill('duwu3');
|
||||
}
|
||||
},
|
||||
yicong:{
|
||||
mod:{
|
||||
globalFrom:function(from,to,current){
|
||||
|
|
|
@ -4878,7 +4878,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
alter:true,
|
||||
group:['kunlunjing1','kunlunjing2'],
|
||||
video:function(player,data){
|
||||
if(data){
|
||||
for(var i in data){
|
||||
var current=game.playerMap[i];
|
||||
current.node.handcards1.innerHTML='';
|
||||
|
@ -4895,23 +4894,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
current.node.judges.appendChild(js[j]);
|
||||
}
|
||||
}
|
||||
ui.window.classList.remove('zoomout3');
|
||||
ui.window.classList.add('zoomin3');
|
||||
document.body.appendChild(ui.window);
|
||||
setTimeout(function(){
|
||||
ui.window.show();
|
||||
ui.window.classList.remove('zoomin3');
|
||||
setTimeout(function(){
|
||||
ui.window.style.transition='';
|
||||
},500);
|
||||
},100);
|
||||
}
|
||||
else{
|
||||
ui.window.style.transition='all 0.5s';
|
||||
ui.window.classList.add('zoomout3');
|
||||
ui.window.delete();
|
||||
ui.window.hide();
|
||||
}
|
||||
},
|
||||
},
|
||||
kunlunjing1:{
|
||||
|
@ -4944,27 +4926,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
"step 0"
|
||||
game.delay(0.5);
|
||||
"step 1"
|
||||
ui.window.style.transition='all 0.5s';
|
||||
ui.window.classList.add('zoomout3');
|
||||
ui.window.delete();
|
||||
ui.window.hide();
|
||||
game.delay(0,500);
|
||||
game.addVideo('skill',event.player,'kunlunjing');
|
||||
game.animate.window(1);
|
||||
"step 2"
|
||||
var storage=event.player.storage.kunlunjing;
|
||||
for(var i=0;i<storage.length;i++){
|
||||
var player=storage[i].player;
|
||||
if(player.isIn()){
|
||||
player.lose(player.getCards('hej'))._triggered=null;
|
||||
if(player.isAlive()){
|
||||
var cards=player.getCards('hej');
|
||||
for(var j=0;j<cards.length;j++){
|
||||
cards[j].discard();
|
||||
}
|
||||
player.removeEquipTrigger();
|
||||
}
|
||||
}
|
||||
"step 3"
|
||||
var storage=event.player.storage.kunlunjing;
|
||||
var player,frag;
|
||||
var player;
|
||||
var i,j;
|
||||
for(i=0;i<storage.length;i++){
|
||||
player=storage[i].player;
|
||||
if(player.isIn()){
|
||||
if(player.isAlive()){
|
||||
for(j=0;j<storage[i].handcards1.length;j++){
|
||||
if(storage[i].handcards1[j].parentNode==ui.discardPile||
|
||||
storage[i].handcards1[j].parentNode==ui.cardPile){
|
||||
|
@ -5008,10 +4989,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.update();
|
||||
}
|
||||
}
|
||||
game.delay(0,100);
|
||||
ui.window.classList.remove('zoomout3');
|
||||
ui.window.classList.add('zoomin3');
|
||||
document.body.appendChild(ui.window);
|
||||
var data={};
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
data[game.players[i].dataset.position]={
|
||||
|
@ -5021,16 +4998,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
game.addVideo('skill',event.player,['kunlunjing',data]);
|
||||
"step 4"
|
||||
ui.window.show();
|
||||
ui.window.classList.remove('zoomin3');
|
||||
setTimeout(function(){
|
||||
ui.window.style.transition='';
|
||||
game.resume();
|
||||
},500);
|
||||
game.pause();
|
||||
'step 5'
|
||||
game.animate.window(2);
|
||||
ui.updatehl();
|
||||
"step 4"
|
||||
if(get.is.altered('kunlunjing')){
|
||||
player.loseHp();
|
||||
}
|
||||
|
@ -7746,7 +7716,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return !target.hasJudge(button.link[2]);
|
||||
};
|
||||
"step 1"
|
||||
// console.log(result.links[0][2]);
|
||||
target.addJudge(result.links[0][2],cards);
|
||||
},
|
||||
ai:{
|
||||
|
|
|
@ -39,8 +39,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
pal_xia:['female','shu',3,['zongyu','fanling']],
|
||||
pal_jiangcheng:['male','qun',4,['yanzhan','fenshi']],
|
||||
|
||||
pal_yuejinzhao:['male','qun',4,[]],
|
||||
pal_yueqi:['female','qun',4,[]],
|
||||
pal_yuejinzhao:['male','wei',4,['ywuhun','yingfeng']],
|
||||
pal_yueqi:['female','wei',4,[]],
|
||||
pal_mingxiu:['female','qun',4,[]],
|
||||
pal_xianqing:['male','qun',4,[]],
|
||||
pal_luozhaoyan:['female','qun',4,[]],
|
||||
|
@ -84,6 +84,301 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
pal_jiangcheng:'折剑山庄庄主欧阳英的得意门生,但因其蚩尤后人魔族的身份,令他无法被容于人界;再加上人界半魔同族饱受人类迫害,故最终成为净天教教主魔君“姜世离”,毅然肩负起保护同族的重任。',
|
||||
},
|
||||
skill:{
|
||||
yingfeng:{
|
||||
trigger:{player:'useCardAfter'},
|
||||
filter:function(event,player){
|
||||
if(event.card.name!='sha') return false;
|
||||
if(event.parent.name=='yingfeng') return false;
|
||||
var enemies=player.getEnemies();
|
||||
return game.hasPlayer(function(current){
|
||||
return enemies.contains(current)&&!event.targets.contains(current)&&player.canUse('sha',current,false);
|
||||
});
|
||||
},
|
||||
forced:true,
|
||||
content:function(){
|
||||
var enemies=player.getEnemies();
|
||||
enemies.remove(trigger.targets);
|
||||
if(enemies.length){
|
||||
player.useCard({name:'sha'},enemies.randomGet().addExpose(0.2));
|
||||
}
|
||||
},
|
||||
},
|
||||
ywuhun:{
|
||||
trigger:{player:'phaseBefore'},
|
||||
forced:true,
|
||||
filter:function(event){
|
||||
return event.parent.name!='ywuhun';
|
||||
},
|
||||
intro:{
|
||||
content:'回合结束后,场上及牌堆中的牌将恢复到回合前的状态'
|
||||
},
|
||||
video:function(player,data){
|
||||
for(var i in data){
|
||||
var current=game.playerMap[i];
|
||||
current.node.handcards1.innerHTML='';
|
||||
current.node.handcards2.innerHTML='';
|
||||
current.node.equips.innerHTML='';
|
||||
current.node.judges.innerHTML='';
|
||||
current.directgain(get.infoCards(data[i].h));
|
||||
var es=get.infoCards(data[i].e);
|
||||
for(var j=0;j<es.length;j++){
|
||||
current.$equip(es[j]);
|
||||
}
|
||||
var js=get.infoCards(data[i].j);
|
||||
for(var j=0;j<js.length;j++){
|
||||
current.node.judges.appendChild(js[j]);
|
||||
}
|
||||
}
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
var handcards1,handcards2,judges,equips,viewAs,i,j;
|
||||
event.data=[];
|
||||
event.cardPile=[];
|
||||
|
||||
for(i=0;i<game.players.length;i++){
|
||||
viewAs=[];
|
||||
handcards1=[];
|
||||
handcards2=[];
|
||||
judges=[];
|
||||
equips=[];
|
||||
|
||||
for(j=0;j<game.players[i].node.handcards1.childNodes.length;j++)
|
||||
handcards1.push(game.players[i].node.handcards1.childNodes[j]);
|
||||
|
||||
for(j=0;j<game.players[i].node.handcards2.childNodes.length;j++)
|
||||
handcards2.push(game.players[i].node.handcards2.childNodes[j]);
|
||||
|
||||
for(j=0;j<game.players[i].node.judges.childNodes.length;j++){
|
||||
viewAs.push(game.players[i].node.judges.childNodes[j].viewAs);
|
||||
judges.push(game.players[i].node.judges.childNodes[j]);
|
||||
}
|
||||
|
||||
for(j=0;j<game.players[i].node.equips.childNodes.length;j++)
|
||||
equips.push(game.players[i].node.equips.childNodes[j]);
|
||||
|
||||
event.data.push({
|
||||
player:game.players[i],
|
||||
handcards1:handcards1,
|
||||
handcards2:handcards2,
|
||||
judges:judges,
|
||||
equips:equips,
|
||||
viewAs:viewAs,
|
||||
value:handcards1.length+handcards2.length+equips.length-judges.length
|
||||
});
|
||||
}
|
||||
for(var i=0;i<ui.cardPile.childElementCount;i++){
|
||||
event.cardPile.push(ui.cardPile.childNodes[i]);
|
||||
}
|
||||
'step 1'
|
||||
player.markSkill('ywuhun');
|
||||
player.phase();
|
||||
'step 2'
|
||||
game.delay(0.5);
|
||||
'step 3'
|
||||
game.animate.window(1);
|
||||
'step 4'
|
||||
player.unmarkSkill('ywuhun');
|
||||
var storage=event.data;
|
||||
for(var i=0;i<storage.length;i++){
|
||||
var current=storage[i].player;
|
||||
if(current.isAlive()){
|
||||
var cards=current.getCards('hej');
|
||||
for(var j=0;j<cards.length;j++){
|
||||
cards[j].discard();
|
||||
}
|
||||
current.removeEquipTrigger();
|
||||
}
|
||||
}
|
||||
'step 5'
|
||||
var storage=event.data;
|
||||
var current;
|
||||
var i,j;
|
||||
for(i=0;i<storage.length;i++){
|
||||
current=storage[i].player;
|
||||
if(current.isAlive()){
|
||||
for(j=0;j<storage[i].handcards1.length;j++){
|
||||
if(storage[i].handcards1[j].parentNode==ui.discardPile||
|
||||
storage[i].handcards1[j].parentNode==ui.cardPile){
|
||||
current.node.handcards1.appendChild(storage[i].handcards1[j]);
|
||||
}
|
||||
else{
|
||||
current.node.handcards1.appendChild(game.createCard(storage[i].handcards1[j]));
|
||||
}
|
||||
}
|
||||
for(j=0;j<storage[i].handcards2.length;j++){
|
||||
if(storage[i].handcards2[j].parentNode==ui.discardPile||
|
||||
storage[i].handcards2[j].parentNode==ui.cardPile){
|
||||
current.node.handcards2.appendChild(storage[i].handcards2[j]);
|
||||
}
|
||||
else{
|
||||
current.node.handcards2.appendChild(game.createCard(storage[i].handcards2[j]));
|
||||
}
|
||||
}
|
||||
for(j=0;j<storage[i].equips.length;j++){
|
||||
if(storage[i].equips[j].parentNode==ui.discardPile||
|
||||
storage[i].equips[j].parentNode==ui.cardPile){
|
||||
storage[i].equips[j].style.transform='';
|
||||
current.$equip(storage[i].equips[j]);
|
||||
}
|
||||
else{
|
||||
current.$equip(game.createCard(storage[i].equips[j]));
|
||||
}
|
||||
}
|
||||
for(j=0;j<storage[i].judges.length;j++){
|
||||
if(storage[i].judges[j].parentNode==ui.discardPile||
|
||||
storage[i].judges[j].parentNode==ui.cardPile){
|
||||
storage[i].judges[j].style.transform='';
|
||||
storage[i].judges[j].viewAs=storage[i].viewAs[j];
|
||||
if(storage[i].judges[j].viewAs&&storage[i].judges[j].viewAs!=storage[i].judges[j].name&&storage[i].judges[j].classList.contains('fullskin')){
|
||||
storage[i].judges[j].classList.add('fakejudge');
|
||||
storage[i].judges[j].node.background.innerHTML=lib.translate[storage[i].judges[j].viewAs+'_bg']||get.translation(storage[i].judges[j].viewAs)[0]
|
||||
}
|
||||
current.node.judges.appendChild(storage[i].judges[j]);
|
||||
}
|
||||
}
|
||||
current.update();
|
||||
}
|
||||
}
|
||||
var data={};
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
data[game.players[i].dataset.position]={
|
||||
h:get.cardsInfo(game.players[i].getCards('h')),
|
||||
e:get.cardsInfo(game.players[i].getCards('e')),
|
||||
j:get.cardsInfo(game.players[i].getCards('j'))
|
||||
}
|
||||
}
|
||||
game.addVideo('skill',event.player,['ywuhun',data]);
|
||||
game.animate.window(2);
|
||||
while(ui.cardPile.childElementCount){
|
||||
ui.discardPile.appendChild(ui.cardPile.firstChild);
|
||||
}
|
||||
for(var i=0;i<event.cardPile.length;i++){
|
||||
if(event.cardPile[i].parentNode==ui.discardPile){
|
||||
ui.cardPile.appendChild(event.cardPile[i]);
|
||||
}
|
||||
else{
|
||||
ui.cardPile.appendChild(game.createCard(event.cardPile[i]));
|
||||
}
|
||||
}
|
||||
ui.updatehl();
|
||||
}
|
||||
},
|
||||
cuikong:{
|
||||
trigger:{player:'phaseUseBefore'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
var hs=player.getCards('h');
|
||||
return game.hasPlayer(function(current){
|
||||
if(current!=player){
|
||||
for(var i=0;i<hs.length;i++){
|
||||
if(get.info(hs[i]).multitarget) continue;
|
||||
if(lib.filter.targetEnabled2(hs[i],player,current)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
var hs=player.getCards('h');
|
||||
player.chooseTarget(get.prompt('cuikong'),function(card,player,target){
|
||||
if(player==target) return false;
|
||||
for(var i=0;i<hs.length;i++){
|
||||
if(get.info(hs[i]).multitarget) continue;
|
||||
if(lib.filter.targetEnabled2(hs[i],player,target)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).ai=function(target){
|
||||
var num=0,eff=0,damaged=false;
|
||||
for(var i=0;i<hs.length;i++){
|
||||
if(get.info(hs[i]).multitarget) continue;
|
||||
var hef;
|
||||
if(get.tag(hs[i],'damage')&&damaged){
|
||||
hef=-1;
|
||||
}
|
||||
else{
|
||||
hef=ai.get.effect(target,hs[i],player,player);
|
||||
}
|
||||
if(lib.filter.targetEnabled2(hs[i],player,target)&&hef>0){
|
||||
num++;
|
||||
if(get.attitude(player,target)>0){
|
||||
hef/=1.5;
|
||||
if(get.tag(hs[i],'damage')){
|
||||
damaged=true;
|
||||
}
|
||||
}
|
||||
eff+=hef;
|
||||
}
|
||||
}
|
||||
if(!player.needsToDiscard(-num)){
|
||||
return eff;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
event.target=result.targets[0];
|
||||
var num=0;
|
||||
player.chooseCard([1,Infinity],'按顺序选择对'+get.translation(result.targets)+'使用的牌',function(card){
|
||||
return lib.filter.targetEnabled2(card,player,event.target);
|
||||
}).ai=function(card){
|
||||
if(ai.get.effect(event.target,card,player,player)>0){
|
||||
if(get.attitude(player,event.target)>0&&get.tag(card,'damage')){
|
||||
for(var i=0;i<ui.selected.cards.length;i++){
|
||||
if(get.tag(ui.selected.cards[i]),'damage'){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ai.get.order(card);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
'step 2'
|
||||
if(result.bool){
|
||||
player.logSkill('cuikong',event.target);
|
||||
player.addTempSkill('cuikong_draw','phaseUseCancelled');
|
||||
player.storage.cuikong_draw=event.target;
|
||||
trigger.untrigger();
|
||||
trigger.finish();
|
||||
event.cards=result.cards.slice(0);
|
||||
player.lose(event.cards,ui.special);
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
'step 3'
|
||||
if(event.cards.length){
|
||||
player.useCard(event.cards.shift(),event.target);
|
||||
event.redo();
|
||||
}
|
||||
},
|
||||
subSkill:{
|
||||
draw:{
|
||||
trigger:{global:'damageEnd'},
|
||||
forced:true,
|
||||
popup:false,
|
||||
filter:function(event,player){
|
||||
return event.player==player.storage.cuikong_draw;
|
||||
},
|
||||
onremove:true,
|
||||
content:function(){
|
||||
player.draw(trigger.num);
|
||||
}
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
threaten:1.3
|
||||
}
|
||||
},
|
||||
zongyu:{
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
|
@ -391,7 +686,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return ai.get.effect(current,{name:'yuansuhuimie'},player,player);
|
||||
}
|
||||
});
|
||||
console.log(num1,num2);
|
||||
if(num1>0&&num2>0) return 3;
|
||||
}
|
||||
if(player.storage.husha>1){
|
||||
|
@ -2891,6 +3185,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
pal_mingxiu:'明绣',
|
||||
pal_jushifang:'居十方',
|
||||
|
||||
ywuhun:'雾魂',
|
||||
ywuhun_info:'锁定技,回合开始前,你获得一个额外的回合,并在此回合结束后将场上及牌堆的所有牌恢复至回合前的状态',
|
||||
feichen:'飞尘',
|
||||
feichen_info:'',
|
||||
yingfeng:'影锋',
|
||||
yingfeng_info:'锁定技,每当你使用一张杀结算完毕后,你随机对一名不是此杀目标的敌方角色使用一张杀',
|
||||
cuikong:'摧空',
|
||||
cuikong_info:'你可以放弃出牌阶段,改为指定一名其他角色并选择任意张手牌,依次对该角色使用,若如此做,此阶段内该角色每受到一点伤害,你摸一张牌',
|
||||
zongyu:'纵雨',
|
||||
zongyu_info:'出牌阶段限一次,你可以弃置一张黑色牌,视为使用一张飞镖,随机指定两名敌方角色为目标',
|
||||
fanling:'返灵',
|
||||
|
|
78
game/game.js
78
game/game.js
|
@ -5664,7 +5664,7 @@
|
|||
position=[];
|
||||
for(var i=0;i<arguments.length;i++) position.push(arguments[i]);
|
||||
}
|
||||
else if(arguments.length==1&&get.objtype(arguments[0])=='array'&&arguments[0].length==4){
|
||||
else if(arguments.length==1&&Array.isArray(arguments[0])&&arguments[0].length==4){
|
||||
position=arguments[0];
|
||||
}
|
||||
else{
|
||||
|
@ -5740,7 +5740,7 @@
|
|||
return this;
|
||||
};
|
||||
Array.prototype.remove=function(item){
|
||||
if(get.objtype(item)=='array'){
|
||||
if(Array.isArray(item)){
|
||||
for(var i=0;i<item.length;i++) this.remove(item[i]);
|
||||
return;
|
||||
}
|
||||
|
@ -7085,7 +7085,7 @@
|
|||
if(i=='onreinit') continue;
|
||||
if(i=='start') continue;
|
||||
if(i=='startBefore') continue;
|
||||
if(lib[i]==undefined) lib[i]=(get.objtype(mode[lib.config.mode][i])=='array')?[]:{};
|
||||
if(lib[i]==undefined) lib[i]=(Array.isArray(mode[lib.config.mode][i]))?[]:{};
|
||||
for(j in mode[lib.config.mode][i]){
|
||||
lib[i][j]=mode[lib.config.mode][i][j];
|
||||
}
|
||||
|
@ -8093,7 +8093,7 @@
|
|||
for(var i=0;i<cards.length;i++){
|
||||
var card=target.getEquip(cards[i]);
|
||||
if(card){
|
||||
ui.discardPile.appendChild(card);
|
||||
card.discard();
|
||||
target.removeEquipTrigger(card);
|
||||
}
|
||||
target.$equip(cards[i]);
|
||||
|
@ -8445,7 +8445,7 @@
|
|||
var player=game.players[num];
|
||||
var cards=player.getCards('hej');
|
||||
for(var i=0;i<cards.length;i++){
|
||||
ui.discardPile.appendChild(cards[i]);
|
||||
cards[i].discard();
|
||||
}
|
||||
player.update();
|
||||
},
|
||||
|
@ -8661,7 +8661,7 @@
|
|||
}
|
||||
var hs=game.me.getCards('h');
|
||||
for(var i=0;i<hs.length;i++){
|
||||
ui.discardPile.appendChild(hs[i]);
|
||||
hs[i].discard(false);
|
||||
}
|
||||
game.me.directgain(get.cards(hs.length));
|
||||
event.goto(2);
|
||||
|
@ -9109,7 +9109,7 @@
|
|||
if(result&&result.bool){
|
||||
var hs=game.me.getCards('h')
|
||||
for(var i=0;i<hs.length;i++){
|
||||
ui.discardPile.appendChild(hs[i]);
|
||||
hs[i].discard(false);
|
||||
}
|
||||
game.me.directgain(get.cards(hs.length));
|
||||
}
|
||||
|
@ -9125,7 +9125,7 @@
|
|||
var hs=player.getCards('h')
|
||||
game.broadcastAll(function(player,hs){
|
||||
for(var i=0;i<hs.length;i++){
|
||||
ui.discardPile.appendChild(hs[i]);
|
||||
hs[i].discard(false);
|
||||
}
|
||||
},player,hs);
|
||||
player.directgain(get.cards(hs.length));
|
||||
|
@ -9612,10 +9612,10 @@
|
|||
event.dialog.addText(event.prompt2);
|
||||
}
|
||||
if(Array.isArray(event.selectCard)){
|
||||
event.promptbar=event.dialog.add('0/'+get.numStr(event.selectCard[1]));
|
||||
event.promptbar=event.dialog.add('0/'+get.numStr(event.selectCard[1],'card'));
|
||||
event.custom.add.card=function(){
|
||||
_status.event.promptbar.innerHTML=
|
||||
ui.selected.cards.length+'/'+get.numStr(_status.event.selectCard[1]);
|
||||
ui.selected.cards.length+'/'+get.numStr(_status.event.selectCard[1],'card');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10138,10 +10138,10 @@
|
|||
str+='牌';
|
||||
}
|
||||
event.dialog=ui.create.dialog(str);
|
||||
event.dialog.add('0/'+get.numStr(event.selectCard[1]));
|
||||
event.dialog.add('0/'+get.numStr(event.selectCard[1],'card'));
|
||||
event.custom.add.card=function(){
|
||||
_status.event.dialog.content.childNodes[1].innerHTML=
|
||||
ui.selected.cards.length+'/'+get.numStr(_status.event.selectCard[1]);
|
||||
ui.selected.cards.length+'/'+get.numStr(_status.event.selectCard[1],'card');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10194,10 +10194,10 @@
|
|||
str+='个目标';
|
||||
}
|
||||
event.dialog=ui.create.dialog(str);
|
||||
event.dialog.add('0/'+get.numStr(get.select(event.selectTarget)[1]));
|
||||
event.dialog.add('0/'+get.numStr(get.select(event.selectTarget)[1],'target'));
|
||||
event.custom.add.target=function(){
|
||||
_status.event.dialog.content.childNodes[1].innerHTML=
|
||||
ui.selected.targets.length+'/'+get.numStr(get.select(event.selectTarget)[1]);
|
||||
ui.selected.targets.length+'/'+get.numStr(get.select(event.selectTarget)[1],'target');
|
||||
}
|
||||
}
|
||||
else if(get.itemtype(event.dialog)=='dialog'){
|
||||
|
@ -12195,7 +12195,7 @@
|
|||
"step 2"
|
||||
if(player.isMin()){
|
||||
event.finish();
|
||||
ui.discardPile.appendChild(card);
|
||||
card.discard();
|
||||
delete player.equiping;
|
||||
return;
|
||||
}
|
||||
|
@ -12253,7 +12253,7 @@
|
|||
delete cards[0]._transform;
|
||||
var viewAs=typeof card=='string'?card:card.name;
|
||||
if(!lib.card[viewAs]||!lib.card[viewAs].effect){
|
||||
ui.discardPile.appendChild(cards[0]);
|
||||
cards[0].discard();
|
||||
}
|
||||
else{
|
||||
cards[0].style.transform='';
|
||||
|
@ -14002,7 +14002,7 @@
|
|||
next.controls.push(arguments[i]);
|
||||
}
|
||||
}
|
||||
else if(get.objtype(arguments[i])=='array'){
|
||||
else if(Array.isArray(arguments[i])){
|
||||
next.controls=next.controls.concat(arguments[i]);
|
||||
}
|
||||
else if(typeof arguments[i]=='function'){
|
||||
|
@ -14918,7 +14918,7 @@
|
|||
target=target.next;
|
||||
}
|
||||
if(target==this){
|
||||
ui.discardPile.appendChild(card);
|
||||
card.discard();
|
||||
}
|
||||
else{
|
||||
if(card.name!=name){
|
||||
|
@ -15339,7 +15339,7 @@
|
|||
if(get.itemtype(this.storage[name])=='cards'){
|
||||
this.$throw(this.storage[name]);
|
||||
while(this.storage[name].length){
|
||||
ui.discardPile.appendChild(this.storage[name].shift());
|
||||
this.storage[name].shift().discard();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15583,7 +15583,7 @@
|
|||
return this;
|
||||
},
|
||||
addSkill:function(skill,checkConflict,nobroadcast){
|
||||
if(get.objtype(skill)=='array'){
|
||||
if(Array.isArray(skill)){
|
||||
for(var i=0;i<skill.length;i++){
|
||||
this.addSkill(skill[i]);
|
||||
}
|
||||
|
@ -15855,7 +15855,7 @@
|
|||
}
|
||||
if(this.onremove=='discard'||this.onremove=='lose'){
|
||||
for(var i=0;i<cards.length;i++){
|
||||
ui.discardPile.appendChild(cards[i]);
|
||||
cards[i].discard();
|
||||
}
|
||||
delete this.storage[skill];
|
||||
}
|
||||
|
@ -18106,6 +18106,11 @@
|
|||
if(skill) this.storage.uncheck.remove(skill);
|
||||
else this.storage.uncheck.length=0;
|
||||
if(this.storage.uncheck.length==0) this.classList.remove('uncheck');
|
||||
},
|
||||
discard:function(){
|
||||
ui.discardPile.appendChild(this);
|
||||
this.fix();
|
||||
this.classList.remove('glow');
|
||||
}
|
||||
},
|
||||
button:{
|
||||
|
@ -18211,8 +18216,8 @@
|
|||
return this.getParent()._trigger;
|
||||
},
|
||||
getRand:function(){
|
||||
if(!this.rand) this.rand=Math.random();
|
||||
return this.rand;
|
||||
if(!this._rand) this._rand=Math.random();
|
||||
return this._rand;
|
||||
},
|
||||
backup:function(skill){
|
||||
this._backup={
|
||||
|
@ -18630,7 +18635,7 @@
|
|||
|
||||
while(this.childNodes.length) this.firstChild.remove();
|
||||
var i,controls;
|
||||
if(get.objtype(arguments[0])=='array') controls=arguments[0];
|
||||
if(Array.isArray(arguments[0])) controls=arguments[0];
|
||||
else controls=arguments;
|
||||
delete this.custom;
|
||||
for(i=0;i<controls.length;i++){
|
||||
|
@ -19211,6 +19216,9 @@
|
|||
else{
|
||||
player.phaseSkipped=false;
|
||||
}
|
||||
if(player==_status.roundStart&&!trigger.skill){
|
||||
game.roundNumber++;
|
||||
}
|
||||
},
|
||||
},
|
||||
_phasebegin:{
|
||||
|
@ -19239,9 +19247,6 @@
|
|||
}
|
||||
_status.currentPhase=player;
|
||||
game.phaseNumber++;
|
||||
if(player==_status.roundStart&&!trigger.skill){
|
||||
game.roundNumber++;
|
||||
}
|
||||
game.syncState();
|
||||
game.addVideo('phaseChange',player);
|
||||
if(game.phaseNumber==1&&lib.configOL.observe){
|
||||
|
@ -19455,7 +19460,7 @@
|
|||
}
|
||||
"step 1"
|
||||
for(var i=0;i<cards.length;i++){
|
||||
ui.discardPile.appendChild(cards[i]);
|
||||
cards[i].discard();
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
|
@ -25039,7 +25044,7 @@
|
|||
if(i=='config') continue;
|
||||
if(i=='start') continue;
|
||||
if(i=='startBefore') continue;
|
||||
if(lib[i]==undefined) lib[i]=(get.objtype(mode[lib.config.mode][i])=='array')?[]:{};
|
||||
if(lib[i]==undefined) lib[i]=(Array.isArray(mode[lib.config.mode][i]))?[]:{};
|
||||
for(j in mode[lib.config.mode][i]){
|
||||
lib[i][j]=mode[lib.config.mode][i][j];
|
||||
}
|
||||
|
@ -34548,7 +34553,7 @@
|
|||
// }
|
||||
var i,controls;
|
||||
var nozoom=false;
|
||||
if(get.objtype(arguments[0])=='array') controls=arguments[0];
|
||||
if(Array.isArray(arguments[0])) controls=arguments[0];
|
||||
else controls=arguments;
|
||||
var control=ui.create.div('.control');
|
||||
ui.control.insertBefore(control,_status.createControl||ui.confirm);
|
||||
|
@ -40288,8 +40293,12 @@
|
|||
}
|
||||
return str2;
|
||||
},
|
||||
numStr:function(num){
|
||||
if(num==Infinity) return '∞';
|
||||
numStr:function(num,method){
|
||||
if(num==Infinity){
|
||||
if(method=='card') return get.selectableCards().length;
|
||||
if(method=='target') return get.selectableTargets().length;
|
||||
return '∞';
|
||||
}
|
||||
return num.toString();
|
||||
},
|
||||
slimName:function(str){
|
||||
|
@ -40333,8 +40342,7 @@
|
|||
}
|
||||
if(lib.nature.contains(obj)) return 'nature';
|
||||
}
|
||||
if(get.objtype(obj)=='array'&&obj.length){
|
||||
|
||||
if(Array.isArray(obj)&&obj.length){
|
||||
var isPlayers=true;
|
||||
for(i=0;i<obj.length;i++){
|
||||
if(get.itemtype(obj[i])!='player') {isPlayers=false;break;}
|
||||
|
@ -42028,7 +42036,7 @@
|
|||
return value(card,player,geti());
|
||||
}
|
||||
if(typeof value=='number') return value;
|
||||
if(get.objtype(value)=='array'){
|
||||
if(Array.isArray(value)){
|
||||
if(method=='raw') return value[0];
|
||||
var num=geti();
|
||||
if(num<value.length) return value[num];
|
||||
|
|
13
mode/boss.js
13
mode/boss.js
|
@ -1079,7 +1079,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].side) continue;
|
||||
game.players[i].removeEquipTrigger();
|
||||
var hej=game.players[i].get('hej');
|
||||
var hej=game.players[i].getCards('hej');
|
||||
for(var j=0;j<hej.length;j++){
|
||||
ui.discardPile.appendChild(hej[j]);
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].side) continue;
|
||||
game.players[i].removeEquipTrigger();
|
||||
var hej=game.players[i].get('hej');
|
||||
var hej=game.players[i].getCards('hej');
|
||||
for(var j=0;j<hej.length;j++){
|
||||
ui.discardPile.appendChild(hej[j]);
|
||||
}
|
||||
|
@ -1249,7 +1249,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].side) continue;
|
||||
game.players[i].removeEquipTrigger();
|
||||
var hej=game.players[i].get('hej');
|
||||
var hej=game.players[i].getCards('hej');
|
||||
for(var j=0;j<hej.length;j++){
|
||||
ui.discardPile.appendChild(hej[j]);
|
||||
}
|
||||
|
@ -1326,7 +1326,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i].side) continue;
|
||||
game.players[i].removeEquipTrigger();
|
||||
var hej=game.players[i].get('hej');
|
||||
var hej=game.players[i].getCards('hej');
|
||||
for(var j=0;j<hej.length;j++){
|
||||
ui.discardPile.appendChild(hej[j]);
|
||||
}
|
||||
|
@ -1716,10 +1716,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(player.hp<=3&&game.hasPlayer(function(current){
|
||||
return current.name=='boss_shujing'&¤t.hp==1;
|
||||
})){
|
||||
if(!_status.event.rand){
|
||||
_status.event.rand=Math.random();
|
||||
}
|
||||
if(_status.event.rand<0.4){
|
||||
if(_status.event.getRand()<0.4){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue