refresh
This commit is contained in:
parent
a0dbc01f98
commit
18442f0d7c
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"extends": "eslint:recommended",
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"es6": true,
|
||||
"worker": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-unused-vars": 0,
|
||||
"no-undef": 0,
|
||||
"no-redeclare": 0
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
|
@ -460,9 +460,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(player.hasSkillTag('unequip',false,card)) return;
|
||||
if(card.name=='nanman'||card.name=='wanjian') return 'zerotarget';
|
||||
if(card.name=='sha'){
|
||||
var equip1=player.getEquip(1);
|
||||
if(equip1&&equip1.name=='zhuque') return 2;
|
||||
if(equip1&&equip1.name=='qinggang') return 1;
|
||||
var equip1=player.getEquip(1);
|
||||
if(equip1&&equip1.name=='zhuque') return 2;
|
||||
if(equip1&&equip1.name=='qinggang') return 1;
|
||||
if(!card.nature) return 'zerotarget';
|
||||
}
|
||||
}
|
||||
|
|
2579
card/gujian.js
2579
card/gujian.js
File diff suppressed because it is too large
Load Diff
|
@ -11,7 +11,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip1',
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
global:'g_feilongduofeng_ai',
|
||||
distance:{attackFrom:-1},
|
||||
skills:['feilongduofeng','feilongduofeng2'],
|
||||
|
@ -37,7 +37,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip2',
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
global:['g_taipingyaoshu','g_taipingyaoshu_ai'],
|
||||
skills:['taipingyaoshu'],
|
||||
ai:{
|
||||
|
|
300
card/gwent.js
300
card/gwent.js
|
@ -451,23 +451,23 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
list.push(i);
|
||||
}
|
||||
}
|
||||
var players=game.players.concat(game.dead);
|
||||
for(var i=0;i<players.length;i++){
|
||||
list.remove(players[i].name);
|
||||
list.remove(players[i].name1);
|
||||
list.remove(players[i].name2);
|
||||
}
|
||||
var dialog=ui.create.dialog('选择一张武将牌','hidden');
|
||||
dialog.add([list.randomGets(12),'character']);
|
||||
player.chooseButton(dialog,true).ai=function(button){
|
||||
var players=game.players.concat(game.dead);
|
||||
for(var i=0;i<players.length;i++){
|
||||
list.remove(players[i].name);
|
||||
list.remove(players[i].name1);
|
||||
list.remove(players[i].name2);
|
||||
}
|
||||
var dialog=ui.create.dialog('选择一张武将牌','hidden');
|
||||
dialog.add([list.randomGets(12),'character']);
|
||||
player.chooseButton(dialog,true).ai=function(button){
|
||||
if(get.attitude(player,event.aitarget)>0){
|
||||
return get.rank(button.link,true);
|
||||
}
|
||||
else{
|
||||
return -get.rank(button.link,true);
|
||||
}
|
||||
};
|
||||
'step 1'
|
||||
};
|
||||
'step 1'
|
||||
event.nametarget=result.links[0];
|
||||
player.chooseTarget(true,'使用'+get.translation(event.nametarget)+'替换一名角色的武将牌',function(card,player,target){
|
||||
return !target.isUnseen()&&!target.isMin();
|
||||
|
@ -482,9 +482,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
'step 2'
|
||||
var target=result.targets[0];
|
||||
var hp=target.hp;
|
||||
target.reinit(target.name,event.nametarget);
|
||||
target.hp=Math.min(hp+1,target.maxHp);
|
||||
target.update();
|
||||
target.reinit(target.name,event.nametarget);
|
||||
target.hp=Math.min(hp+1,target.maxHp);
|
||||
target.update();
|
||||
player.line(target,'green');
|
||||
'step 3'
|
||||
game.triggerEnter(target);
|
||||
|
@ -847,9 +847,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return true;
|
||||
}
|
||||
});
|
||||
if(!list.length){
|
||||
list=[cardname];
|
||||
}
|
||||
if(!list.length){
|
||||
list=[cardname];
|
||||
}
|
||||
hs2.push(game.createCard(list.randomGet()));
|
||||
}
|
||||
var list=get.libCard(function(info){
|
||||
|
@ -872,9 +872,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return true;
|
||||
}
|
||||
});
|
||||
if(!list.length){
|
||||
list=[cardname];
|
||||
}
|
||||
if(!list.length){
|
||||
list=[cardname];
|
||||
}
|
||||
es2.push(game.createCard(list.randomGet()));
|
||||
}
|
||||
if(es2.length){
|
||||
|
@ -1039,42 +1039,42 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
// },
|
||||
content:function(){
|
||||
'step 0'
|
||||
var list=[];
|
||||
for(var i in lib.card){
|
||||
if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue;
|
||||
var list=[];
|
||||
for(var i in lib.card){
|
||||
if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue;
|
||||
if(lib.card[i].vanish) continue;
|
||||
if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]);
|
||||
}
|
||||
var dialog=ui.create.dialog('卜天术',[list,'vcard']);
|
||||
if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]);
|
||||
}
|
||||
var dialog=ui.create.dialog('卜天术',[list,'vcard']);
|
||||
var bing=target.countCards('h')<=1;
|
||||
player.chooseButton(dialog,true,function(button){
|
||||
if(get.effect(target,{name:button.link[2]},player,player)>0){
|
||||
player.chooseButton(dialog,true,function(button){
|
||||
if(get.effect(target,{name:button.link[2]},player,player)>0){
|
||||
if(button.link[2]=='bingliang'){
|
||||
if(bing) return 2;
|
||||
return 0.7;
|
||||
}
|
||||
if(button.link[2]=='lebu'){
|
||||
return 1;
|
||||
}
|
||||
if(button.link[2]=='guiyoujie'){
|
||||
return 0.5;
|
||||
}
|
||||
if(button.link[2]=='caomu'){
|
||||
return 0.3;
|
||||
}
|
||||
return 0.2;
|
||||
}
|
||||
return 0;
|
||||
}).filterButton=function(button){
|
||||
return !target.hasJudge(button.link[2]);
|
||||
};
|
||||
'step 1'
|
||||
if(bing) return 2;
|
||||
return 0.7;
|
||||
}
|
||||
if(button.link[2]=='lebu'){
|
||||
return 1;
|
||||
}
|
||||
if(button.link[2]=='guiyoujie'){
|
||||
return 0.5;
|
||||
}
|
||||
if(button.link[2]=='caomu'){
|
||||
return 0.3;
|
||||
}
|
||||
return 0.2;
|
||||
}
|
||||
return 0;
|
||||
}).filterButton=function(button){
|
||||
return !target.hasJudge(button.link[2]);
|
||||
};
|
||||
'step 1'
|
||||
var card=game.createCard(result.links[0][2]);
|
||||
event.judgecard=card;
|
||||
target.$draw(card);
|
||||
game.delay(0.7);
|
||||
'step 2'
|
||||
target.addJudge(event.judgecard);
|
||||
target.addJudge(event.judgecard);
|
||||
},
|
||||
ai:{
|
||||
value:8,
|
||||
|
@ -1111,7 +1111,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
// game.delay(2);
|
||||
// },
|
||||
content:function(){
|
||||
var list=[];
|
||||
var list=[];
|
||||
list.push(get.cardPile2('juedou'));
|
||||
list.push(get.cardPile2('huogong'));
|
||||
list.push(get.cardPile2('nanman'));
|
||||
|
@ -1195,11 +1195,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
// },
|
||||
content:function(){
|
||||
'step 0'
|
||||
var list=[];
|
||||
for(var i in lib.card){
|
||||
var list=[];
|
||||
for(var i in lib.card){
|
||||
if(lib.card[i].subtype=='spell_bronze') list.push([cards[0].suit,cards[0].number,i]);
|
||||
}
|
||||
var dialog=ui.create.dialog('自然馈赠',[list,'vcard']);
|
||||
}
|
||||
var dialog=ui.create.dialog('自然馈赠',[list,'vcard']);
|
||||
var rand=get.rand();
|
||||
var aozu=game.hasPlayer(function(current){
|
||||
return player.canUse('gw_aozuzhilei',current)&¤t.hp<=3&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0;
|
||||
|
@ -1228,7 +1228,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
var yanzi=game.hasPlayer(function(current){
|
||||
return get.attitude(player,current)>0&¤t.isMinHandcard();
|
||||
});
|
||||
player.chooseButton(dialog,true,function(button){
|
||||
player.chooseButton(dialog,true,function(button){
|
||||
var name=button.link[2];
|
||||
switch(name){
|
||||
case 'gw_ciguhanshuang':
|
||||
|
@ -1254,17 +1254,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
})){
|
||||
return Math.random();
|
||||
}
|
||||
return 0;
|
||||
}).filterButton=function(button){
|
||||
return 0;
|
||||
}).filterButton=function(button){
|
||||
var name=button.link[2];
|
||||
if(!lib.card[name].notarget){
|
||||
return game.hasPlayer(function(current){
|
||||
return player.canUse(name,current);
|
||||
})
|
||||
}
|
||||
return true;
|
||||
};
|
||||
'step 1'
|
||||
return true;
|
||||
};
|
||||
'step 1'
|
||||
player.chooseUseTarget(game.createCard(result.links[0][2],get.suit(card),get.number(card)));
|
||||
},
|
||||
ai:{
|
||||
|
@ -1396,10 +1396,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
filterTarget:function(card,player,target){
|
||||
return !target.hasSkill('gw_qinpendayu');
|
||||
},
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
},
|
||||
content:function(){
|
||||
target.addSkill('gw_qinpendayu');
|
||||
|
@ -1409,17 +1409,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
useful:[3,1],
|
||||
result:{
|
||||
player:function(player,target){
|
||||
return game.countPlayer(function(current){
|
||||
return game.countPlayer(function(current){
|
||||
if(current.hasSkill('gw_qinpendayu')) return 0;
|
||||
if(current==target||(get.distance(target,current,'pure')==1)){
|
||||
var num=-get.sgn(get.attitude(player,current));
|
||||
if(current==target||(get.distance(target,current,'pure')==1)){
|
||||
var num=-get.sgn(get.attitude(player,current));
|
||||
if(current.needsToDiscard()) return num;
|
||||
if(current.needsToDiscard(1)) return 0.7*num;
|
||||
if(current.needsToDiscard(2)) return 0.4*num;
|
||||
return 0.1*num;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
order:1.2,
|
||||
}
|
||||
|
@ -1432,10 +1432,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
filterTarget:function(card,player,target){
|
||||
return !target.hasSkill('gw_birinongwu');
|
||||
},
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
},
|
||||
content:function(){
|
||||
target.addSkill('gw_birinongwu');
|
||||
|
@ -1445,13 +1445,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
useful:[3,1],
|
||||
result:{
|
||||
player:function(player,target){
|
||||
return game.countPlayer(function(current){
|
||||
return game.countPlayer(function(current){
|
||||
if(current.hasSkill('gw_birinongwu')) return 0;
|
||||
if(current==target||(get.distance(target,current,'pure')==1)){
|
||||
return -get.sgn(get.attitude(player,current));
|
||||
}
|
||||
});
|
||||
}
|
||||
if(current==target||(get.distance(target,current,'pure')==1)){
|
||||
return -get.sgn(get.attitude(player,current));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
order:1.2,
|
||||
}
|
||||
|
@ -1464,10 +1464,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
filterTarget:function(card,player,target){
|
||||
return !target.hasSkill('gw_ciguhanshuang');
|
||||
},
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
},
|
||||
content:function(){
|
||||
target.addSkill('gw_ciguhanshuang');
|
||||
|
@ -1477,13 +1477,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
useful:[3,1],
|
||||
result:{
|
||||
player:function(player,target){
|
||||
return game.countPlayer(function(current){
|
||||
return game.countPlayer(function(current){
|
||||
if(current.hasSkill('gw_ciguhanshuang')) return 0;
|
||||
if(current==target||(get.distance(target,current,'pure')==1)){
|
||||
return -get.sgn(get.attitude(player,current));
|
||||
}
|
||||
});
|
||||
}
|
||||
if(current==target||(get.distance(target,current,'pure')==1)){
|
||||
return -get.sgn(get.attitude(player,current));
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
order:1.2,
|
||||
}
|
||||
|
@ -1927,20 +1927,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
gw_baobaoshu:{
|
||||
mark:true,
|
||||
nopop:true,
|
||||
intro:{
|
||||
content:'每使用一张基本牌或锦囊牌,需弃置一张牌'
|
||||
},
|
||||
intro:{
|
||||
content:'每使用一张基本牌或锦囊牌,需弃置一张牌'
|
||||
},
|
||||
trigger:{player:'useCard'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(player.countCards('he')==0) return false;
|
||||
var type=get.type(event.card,'trick');
|
||||
return type=='basic'||type=='trick';
|
||||
},
|
||||
content:function(){
|
||||
if(!event.isMine()) game.delay(0.5);
|
||||
player.chooseToDiscard(true,'he');
|
||||
},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(player.countCards('he')==0) return false;
|
||||
var type=get.type(event.card,'trick');
|
||||
return type=='basic'||type=='trick';
|
||||
},
|
||||
content:function(){
|
||||
if(!event.isMine()) game.delay(0.5);
|
||||
player.chooseToDiscard(true,'he');
|
||||
},
|
||||
ai:{
|
||||
weather:true,
|
||||
effect:{
|
||||
|
@ -1978,41 +1978,41 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
gw_youer:{
|
||||
trigger:{global:'phaseEnd',player:'dieBegin'},
|
||||
forced:true,
|
||||
audio:false,
|
||||
mark:true,
|
||||
intro:{
|
||||
content:'cards'
|
||||
},
|
||||
content:function(){
|
||||
if(player.storage.gw_youer){
|
||||
trigger:{global:'phaseEnd',player:'dieBegin'},
|
||||
forced:true,
|
||||
audio:false,
|
||||
mark:true,
|
||||
intro:{
|
||||
content:'cards'
|
||||
},
|
||||
content:function(){
|
||||
if(player.storage.gw_youer){
|
||||
if(trigger.name=='phase'){
|
||||
player.gain(player.storage.gw_youer);
|
||||
}
|
||||
else{
|
||||
else{
|
||||
player.$throw(player.storage.gw_youer,1000);
|
||||
for(var i=0;i<player.storage.gw_youer.length;i++){
|
||||
player.storage.gw_youer[i].discard();
|
||||
}
|
||||
game.log(player,'弃置了',player.storage.gw_youer);
|
||||
for(var i=0;i<player.storage.gw_youer.length;i++){
|
||||
player.storage.gw_youer[i].discard();
|
||||
}
|
||||
game.log(player,'弃置了',player.storage.gw_youer);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete player.storage.gw_youer;
|
||||
player.removeSkill('gw_youer');
|
||||
},
|
||||
},
|
||||
player.removeSkill('gw_youer');
|
||||
},
|
||||
},
|
||||
gw_qinpendayu:{
|
||||
mark:true,
|
||||
mark:true,
|
||||
nopop:true,
|
||||
intro:{
|
||||
content:'手牌上限-1直到下一个弃牌阶段结束'
|
||||
},
|
||||
mod:{
|
||||
maxHandcard:function(player,num){
|
||||
return num-1;
|
||||
}
|
||||
},
|
||||
intro:{
|
||||
content:'手牌上限-1直到下一个弃牌阶段结束'
|
||||
},
|
||||
mod:{
|
||||
maxHandcard:function(player,num){
|
||||
return num-1;
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
weather:true
|
||||
},
|
||||
|
@ -2026,18 +2026,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
gw_birinongwu:{
|
||||
mark:true,
|
||||
nopop:true,
|
||||
intro:{
|
||||
content:'不能使用杀直到下一个出牌阶段结束'
|
||||
},
|
||||
mod:{
|
||||
cardEnabled:function(card){
|
||||
if(card.name=='sha') return false;
|
||||
}
|
||||
},
|
||||
intro:{
|
||||
content:'不能使用杀直到下一个出牌阶段结束'
|
||||
},
|
||||
mod:{
|
||||
cardEnabled:function(card){
|
||||
if(card.name=='sha') return false;
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
weather:true
|
||||
},
|
||||
|
@ -2054,19 +2054,19 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
gw_ciguhanshuang:{
|
||||
trigger:{player:'phaseDrawBegin'},
|
||||
forced:true,
|
||||
mark:true,
|
||||
forced:true,
|
||||
mark:true,
|
||||
nopop:true,
|
||||
intro:{
|
||||
content:'下个摸牌阶段摸牌数-1'
|
||||
},
|
||||
filter:function(event){
|
||||
return event.num>0;
|
||||
},
|
||||
content:function(){
|
||||
trigger.num--;
|
||||
player.removeSkill('gw_ciguhanshuang');
|
||||
},
|
||||
intro:{
|
||||
content:'下个摸牌阶段摸牌数-1'
|
||||
},
|
||||
filter:function(event){
|
||||
return event.num>0;
|
||||
},
|
||||
content:function(){
|
||||
trigger.num--;
|
||||
player.removeSkill('gw_ciguhanshuang');
|
||||
},
|
||||
ai:{
|
||||
weather:true
|
||||
}
|
||||
|
|
|
@ -566,7 +566,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
zhiliaobo:{
|
||||
fullskin:true,
|
||||
enable:true,
|
||||
|
|
53
card/sp.js
53
card/sp.js
|
@ -294,15 +294,15 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
selectTarget:-1
|
||||
},
|
||||
shengdong:{
|
||||
fullskin:true,
|
||||
enable:function(){
|
||||
fullskin:true,
|
||||
enable:function(){
|
||||
return game.countPlayer()>2;
|
||||
},
|
||||
chongzhu:function(){
|
||||
return game.countPlayer()<=2;
|
||||
},
|
||||
singleCard:true,
|
||||
type:'trick',
|
||||
type:'trick',
|
||||
selectTarget:2,
|
||||
multitarget:true,
|
||||
targetprompt:['给一张牌','得两张牌'],
|
||||
|
@ -361,19 +361,22 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
if(!ok) return 0;
|
||||
if(ui.selected.targets.length==1) return 2;
|
||||
if(ui.selected.targets.length==1){
|
||||
if(target.hasSkillTag('nogain')) return 0;
|
||||
return 2;
|
||||
}
|
||||
if(target.countCards('he')==0) return 0;
|
||||
if(player.hasFriend()) return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
zengbin:{
|
||||
fullskin:true,
|
||||
enable:true,
|
||||
type:'trick',
|
||||
filterTarget:true,
|
||||
},
|
||||
zengbin:{
|
||||
fullskin:true,
|
||||
enable:true,
|
||||
type:'trick',
|
||||
filterTarget:true,
|
||||
content:function(){
|
||||
'step 0'
|
||||
target.draw(3);
|
||||
|
@ -411,11 +414,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
caomu:{
|
||||
fullskin:true,
|
||||
enable:true,
|
||||
type:'delay',
|
||||
},
|
||||
caomu:{
|
||||
fullskin:true,
|
||||
enable:true,
|
||||
type:'delay',
|
||||
filterTarget:function(card,player,target){
|
||||
return (lib.filter.judge(card,player,target)&&player!=target);
|
||||
},
|
||||
|
@ -460,7 +463,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
skill:{
|
||||
lanyinjia:{
|
||||
|
@ -974,22 +977,22 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。',
|
||||
du:'毒',
|
||||
du_info:'当你因使用、打出或弃置而失去此牌时,你失去一点体力',
|
||||
shengdong:'声东击西',
|
||||
shengdong:'声东击西',
|
||||
shengdong_info:'出牌阶段,对一名其他角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色(不足则全给,存活角色不超过2时可重铸)',
|
||||
zengbin:'增兵减灶',
|
||||
zengbin_info:'出牌阶段,对一名角色使用。目标角色摸三张牌,然后选择一项:1.弃置一张非基本牌;2.弃置两张牌',
|
||||
caomu:'草木皆兵',
|
||||
caomu_info:'出牌阶段,对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里,若判定结果不为梅花:摸牌阶段,目标角色少摸一张牌;摸牌阶段结束时,与其距离为1的角色各摸一张牌',
|
||||
zengbin:'增兵减灶',
|
||||
zengbin_info:'出牌阶段,对一名角色使用。目标角色摸三张牌,然后选择一项:1.弃置一张非基本牌;2.弃置两张牌',
|
||||
caomu:'草木皆兵',
|
||||
caomu_info:'出牌阶段,对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里,若判定结果不为梅花:摸牌阶段,目标角色少摸一张牌;摸牌阶段结束时,与其距离为1的角色各摸一张牌',
|
||||
},
|
||||
list:[
|
||||
['spade',1,'caomu'],
|
||||
['club',3,'caomu'],
|
||||
['heart',12,'shengdong',],
|
||||
['club',9,'shengdong'],
|
||||
['club',9,'shengdong'],
|
||||
['spade',9,'shengdong'],
|
||||
['diamond',4,'zengbin'],
|
||||
['heart',6,'zengbin'],
|
||||
['spade',7,'zengbin'],
|
||||
['diamond',4,'zengbin'],
|
||||
['heart',6,'zengbin'],
|
||||
['spade',7,'zengbin'],
|
||||
['spade',3,'du'],
|
||||
['spade',9,'du'],
|
||||
['club',3,'du'],
|
||||
|
|
28
card/swd.js
28
card/swd.js
|
@ -556,8 +556,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
target:1
|
||||
},
|
||||
order:function(){
|
||||
return get.order({name:'sha'})+0.1;
|
||||
},
|
||||
return get.order({name:'sha'})+0.1;
|
||||
},
|
||||
}
|
||||
},
|
||||
xuejibingbao:{
|
||||
|
@ -733,7 +733,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip5',
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
skills:['donghuangzhong'],
|
||||
ai:{
|
||||
equipValue:7
|
||||
|
@ -745,7 +745,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip1',
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
skills:['xuanyuanjian','xuanyuanjian2','xuanyuanjian3'],
|
||||
enable:function(card,player){
|
||||
return player.hasSkill('xuanyuan')||player.hp>2;
|
||||
|
@ -770,7 +770,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['pangufu'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
distance:{attackFrom:-3},
|
||||
ai:{
|
||||
equipValue:8
|
||||
|
@ -784,7 +784,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
loseDelay:false,
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
onEquip:function(){
|
||||
player.markSkill('lianyaohu_skill');
|
||||
},
|
||||
|
@ -804,7 +804,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['haotianta'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:7
|
||||
}
|
||||
|
@ -816,7 +816,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['kongxin'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:6
|
||||
}
|
||||
|
@ -828,7 +828,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['shennongding'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:6
|
||||
}
|
||||
|
@ -840,7 +840,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['kongdongyin'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hp==2) return 7;
|
||||
|
@ -859,7 +859,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['kunlunjingc'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:6
|
||||
}
|
||||
|
@ -871,7 +871,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['nvwashi'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:5
|
||||
}
|
||||
|
@ -2545,8 +2545,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
ai:{
|
||||
order:function(){
|
||||
return get.order({name:'sha'})+0.11;
|
||||
},
|
||||
return get.order({name:'sha'})+0.11;
|
||||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
return get.effect(target,{name:'sha'},player,target);
|
||||
|
|
872
character/diy.js
872
character/diy.js
File diff suppressed because it is too large
Load Diff
|
@ -117,6 +117,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
forced:true,
|
||||
mark:true,
|
||||
audio:2,
|
||||
unique:true,
|
||||
filter:function(event){
|
||||
return event.num>0;
|
||||
},
|
||||
|
|
|
@ -38,7 +38,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
zuiji:{
|
||||
enable:'phaseUse',
|
||||
filterCard:true,
|
||||
position:'he',
|
||||
position:'he',
|
||||
viewAs:{name:'jiu'},
|
||||
viewAsFilter:function(player){
|
||||
if(!player.countCards('he')) return false;
|
||||
|
@ -451,7 +451,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
result:{
|
||||
target:function(player,target){
|
||||
return get.equipResult(player,target,name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1540,8 +1540,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
gjqt_xiayize:'夏夷则',
|
||||
gjqt_aruan:'阿阮',
|
||||
|
||||
zuiji:'醉饮',
|
||||
zuiji_info:'出牌阶段,你可以将一张手牌或装备牌当作酒使用',
|
||||
zuiji:'醉饮',
|
||||
zuiji_info:'出牌阶段,你可以将一张手牌或装备牌当作酒使用',
|
||||
manwu:'曼舞',
|
||||
manwu_info:'在一名角色的结束阶段,若其手牌数为全场最少或之一,你可以令其摸一张牌',
|
||||
xfanghua:'芳华',
|
||||
|
|
|
@ -163,9 +163,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
content:function(){
|
||||
'step 0'
|
||||
var list=[];
|
||||
for(var i in lib.card){
|
||||
for(var i in lib.card){
|
||||
if(lib.card[i].subtype=='spell_bronze') list.push(i);
|
||||
}
|
||||
}
|
||||
for(var i=0;i<list.length;i++){
|
||||
if(!player.hasUseTarget(list[i])){
|
||||
list.splice(i--,1);
|
||||
|
@ -229,8 +229,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})){
|
||||
return Math.random();
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
player.logSkill('gwhuanshuang');
|
||||
|
@ -755,11 +755,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
gain:{
|
||||
trigger:{player:'damageZero'},
|
||||
filter:function(event){
|
||||
return event.hujia;
|
||||
},
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.storage.gwweitu++;
|
||||
return event.hujia;
|
||||
},
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.storage.gwweitu++;
|
||||
if(player.storage.gwweitu>=3){
|
||||
player.storage.gwweitu-=3;
|
||||
player.unmarkSkill('gwweitu');
|
||||
|
@ -771,7 +771,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
else{
|
||||
player.markSkill('gwweitu',true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
|
@ -1068,8 +1068,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
// changeTarget:function(player,targets){
|
||||
// if(!player.getStat('damage')){
|
||||
// game.filterPlayer(function(current){
|
||||
// return get.distance(targets[0],current,'pure')==1;
|
||||
// },targets);
|
||||
// return get.distance(targets[0],current,'pure')==1;
|
||||
// },targets);
|
||||
// }
|
||||
// },
|
||||
selectTarget:function(){
|
||||
|
@ -1318,36 +1318,36 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
gwfusheng:{
|
||||
enable:'chooseToUse',
|
||||
filter:function(event,player){
|
||||
return event.type=='dying'&&event.dying&&!event.dying.isTurnedOver();
|
||||
},
|
||||
filterTarget:function(card,player,target){
|
||||
return target==_status.event.dying;
|
||||
},
|
||||
selectTarget:-1,
|
||||
content:function(){
|
||||
enable:'chooseToUse',
|
||||
filter:function(event,player){
|
||||
return event.type=='dying'&&event.dying&&!event.dying.isTurnedOver();
|
||||
},
|
||||
filterTarget:function(card,player,target){
|
||||
return target==_status.event.dying;
|
||||
},
|
||||
selectTarget:-1,
|
||||
content:function(){
|
||||
target.turnOver();
|
||||
target.recover();
|
||||
target.recover();
|
||||
if(player!=target){
|
||||
game.asyncDraw([player,target]);
|
||||
}
|
||||
else{
|
||||
else{
|
||||
player.draw(2);
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
order:0.1,
|
||||
skillTagFilter:function(player){
|
||||
if(!_status.event.dying||_status.event.dying.isTurnedOver()) return false;
|
||||
},
|
||||
save:true,
|
||||
result:{
|
||||
target:3
|
||||
},
|
||||
threaten:1.6
|
||||
},
|
||||
},
|
||||
},
|
||||
ai:{
|
||||
order:0.1,
|
||||
skillTagFilter:function(player){
|
||||
if(!_status.event.dying||_status.event.dying.isTurnedOver()) return false;
|
||||
},
|
||||
save:true,
|
||||
result:{
|
||||
target:3
|
||||
},
|
||||
threaten:1.6
|
||||
},
|
||||
},
|
||||
gwqinwu:{
|
||||
trigger:{player:'useCard'},
|
||||
filter:function(event,player){
|
||||
|
@ -1471,9 +1471,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return player.storage.gwjieyin.length<3;
|
||||
},
|
||||
chooseButton:{
|
||||
dialog:function(event,player){
|
||||
return ui.create.dialog('结印',[[['','','gw_wenyi'],['','','gw_yanziyaoshui'],['','','gw_kunenfayin']],'vcard'],'hidden');
|
||||
},
|
||||
dialog:function(event,player){
|
||||
return ui.create.dialog('结印',[[['','','gw_wenyi'],['','','gw_yanziyaoshui'],['','','gw_kunenfayin']],'vcard'],'hidden');
|
||||
},
|
||||
filter:function(button,player){
|
||||
if(player.storage.gwjieyin.contains(button.link[2])){
|
||||
return false;
|
||||
|
@ -1516,22 +1516,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return 1;
|
||||
}
|
||||
},
|
||||
backup:function(links,player){
|
||||
return {
|
||||
filterCard:function(){return false},
|
||||
selectCard:-1,
|
||||
viewAs:{name:links[0][2]},
|
||||
popname:true,
|
||||
onuse:function(result,player){
|
||||
backup:function(links,player){
|
||||
return {
|
||||
filterCard:function(){return false},
|
||||
selectCard:-1,
|
||||
viewAs:{name:links[0][2]},
|
||||
popname:true,
|
||||
onuse:function(result,player){
|
||||
player.logSkill('gwjieyin');
|
||||
player.storage.gwjieyin.add(result.card.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
prompt:function(links,player){
|
||||
return '选择'+get.translation(links[0][2])+'的目标';
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
prompt:function(links,player){
|
||||
return '选择'+get.translation(links[0][2])+'的目标';
|
||||
}
|
||||
},
|
||||
subSkill:{
|
||||
reset:{
|
||||
trigger:{player:'phaseBegin'},
|
||||
|
@ -1593,11 +1593,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
draw:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
frequent:true,
|
||||
frequent:true,
|
||||
filter:function(event,player){
|
||||
return player.storage.zhengjun.length>=1;
|
||||
},
|
||||
content:function(){
|
||||
content:function(){
|
||||
'step 0'
|
||||
if(player.storage.zhengjun.length==1){
|
||||
player.draw();
|
||||
|
@ -1615,11 +1615,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
player.gain(card,'draw');
|
||||
event.cards.remove(card);
|
||||
}
|
||||
'step 2'
|
||||
'step 2'
|
||||
while(event.cards.length){
|
||||
ui.cardPile.insertBefore(event.cards.pop(),ui.cardPile.firstChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1794,58 +1794,58 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
forced:true,
|
||||
content:function(){
|
||||
'step 0'
|
||||
var list=get.gainableSkills(function(info){
|
||||
var list=get.gainableSkills(function(info){
|
||||
if(typeof info.enable=='string') return info.enable=='phaseUse';
|
||||
if(Array.isArray(info.enable)) return info.enable.contains('phaseUse');
|
||||
},player);
|
||||
list.remove(player.getSkills());
|
||||
list=list.randomGets(3);
|
||||
event.skillai=function(){
|
||||
return get.max(list,get.skillRank,'item');
|
||||
};
|
||||
if(event.isMine()){
|
||||
var dialog=ui.create.dialog('forcebutton');
|
||||
dialog.add('风驰:选择获得一项技能');
|
||||
var clickItem=function(){
|
||||
_status.event._result=this.link;
|
||||
dialog.close();
|
||||
game.resume();
|
||||
};
|
||||
for(var i=0;i<list.length;i++){
|
||||
if(lib.translate[list[i]+'_info']){
|
||||
var translation=get.translation(list[i]);
|
||||
if(translation[0]=='新'&&translation.length==3){
|
||||
translation=translation.slice(1,3);
|
||||
}
|
||||
else{
|
||||
translation=translation.slice(0,2);
|
||||
}
|
||||
var item=dialog.add('<div class="popup pointerdiv" style="width:80%;display:inline-block"><div class="skill">【'+
|
||||
translation+'】</div><div>'+lib.translate[list[i]+'_info']+'</div></div>');
|
||||
item.firstChild.addEventListener('click',clickItem);
|
||||
item.firstChild.link=list[i];
|
||||
}
|
||||
}
|
||||
dialog.add(ui.create.div('.placeholder'));
|
||||
event.switchToAuto=function(){
|
||||
event._result=event.skillai();
|
||||
dialog.close();
|
||||
game.resume();
|
||||
};
|
||||
_status.imchoosing=true;
|
||||
game.pause();
|
||||
}
|
||||
else{
|
||||
event._result=event.skillai();
|
||||
}
|
||||
'step 1'
|
||||
_status.imchoosing=false;
|
||||
var link=result;
|
||||
player.addTempSkill(link,'phaseUseAfter');
|
||||
player.popup(link);
|
||||
list.remove(player.getSkills());
|
||||
list=list.randomGets(3);
|
||||
event.skillai=function(){
|
||||
return get.max(list,get.skillRank,'item');
|
||||
};
|
||||
if(event.isMine()){
|
||||
var dialog=ui.create.dialog('forcebutton');
|
||||
dialog.add('风驰:选择获得一项技能');
|
||||
var clickItem=function(){
|
||||
_status.event._result=this.link;
|
||||
dialog.close();
|
||||
game.resume();
|
||||
};
|
||||
for(var i=0;i<list.length;i++){
|
||||
if(lib.translate[list[i]+'_info']){
|
||||
var translation=get.translation(list[i]);
|
||||
if(translation[0]=='新'&&translation.length==3){
|
||||
translation=translation.slice(1,3);
|
||||
}
|
||||
else{
|
||||
translation=translation.slice(0,2);
|
||||
}
|
||||
var item=dialog.add('<div class="popup pointerdiv" style="width:80%;display:inline-block"><div class="skill">【'+
|
||||
translation+'】</div><div>'+lib.translate[list[i]+'_info']+'</div></div>');
|
||||
item.firstChild.addEventListener('click',clickItem);
|
||||
item.firstChild.link=list[i];
|
||||
}
|
||||
}
|
||||
dialog.add(ui.create.div('.placeholder'));
|
||||
event.switchToAuto=function(){
|
||||
event._result=event.skillai();
|
||||
dialog.close();
|
||||
game.resume();
|
||||
};
|
||||
_status.imchoosing=true;
|
||||
game.pause();
|
||||
}
|
||||
else{
|
||||
event._result=event.skillai();
|
||||
}
|
||||
'step 1'
|
||||
_status.imchoosing=false;
|
||||
var link=result;
|
||||
player.addTempSkill(link,'phaseUseAfter');
|
||||
player.popup(link);
|
||||
player.flashAvatar('gwfengchi',link);
|
||||
game.log(player,'获得了技能','【'+get.translation(link)+'】');
|
||||
game.delay();
|
||||
game.log(player,'获得了技能','【'+get.translation(link)+'】');
|
||||
game.delay();
|
||||
}
|
||||
},
|
||||
lingji:{
|
||||
|
@ -1892,14 +1892,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
gwjinyan:{
|
||||
trigger:{player:['damageBefore']},
|
||||
forced:true,
|
||||
mark:true,
|
||||
filter:function(event,player){
|
||||
forced:true,
|
||||
mark:true,
|
||||
filter:function(event,player){
|
||||
return game.roundNumber%3!=0;
|
||||
},
|
||||
content:function(){
|
||||
},
|
||||
content:function(){
|
||||
trigger.cancel();
|
||||
},
|
||||
},
|
||||
group:['gwjinyan_gain'],
|
||||
subSkill:{
|
||||
gain:{
|
||||
|
@ -1916,7 +1916,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
ai:{
|
||||
threaten:function(){
|
||||
if(game.roundNumber%3==0) return 1.6;
|
||||
return 0.8;
|
||||
|
@ -1927,14 +1927,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
skillTagFilter:function(){
|
||||
if(game.roundNumber%3==0) return false;
|
||||
},
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
if(game.roundNumber%3!=0&&get.tag(card,'damage')){
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
if(game.roundNumber%3!=0&&get.tag(card,'damage')){
|
||||
return [0,0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
gwshenyu:{
|
||||
trigger:{player:'phaseBegin'},
|
||||
|
@ -1980,8 +1980,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return num*att;
|
||||
};
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
player.logSkill('gwshenyu',result.targets);
|
||||
if(result.bool){
|
||||
player.logSkill('gwshenyu',result.targets);
|
||||
event.target=result.targets[0];
|
||||
if(!event.list.length){
|
||||
event.target.recover();
|
||||
|
@ -1999,7 +1999,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
'回复一点体力','从弃牌堆中获得一张非金法术'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
|
@ -2167,20 +2167,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
hupeng2:{
|
||||
mod:{
|
||||
cardDiscardable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardEnabled:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardUsable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardRespondable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardSavable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardEnabled:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardUsable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardRespondable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
cardSavable:function(card,player){
|
||||
if(card.name=='gw_dudayuanshuai2') return false;
|
||||
},
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
|
@ -2363,33 +2363,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
yinzhang:{
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
filterCard:true,
|
||||
position:'he',
|
||||
check:function(card){
|
||||
return 8-get.value(card)
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
filterCard:true,
|
||||
position:'he',
|
||||
check:function(card){
|
||||
return 8-get.value(card)
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
var list=get.typeCard('spell_silver').randomGets(3);
|
||||
if(!list.length){
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
var dialog=ui.create.dialog('选择一张加入你的手牌',[list,'vcard'],'hidden');
|
||||
player.chooseButton(dialog,true);
|
||||
'step 1'
|
||||
player.gain(game.createCard(result.links[0][2]),'draw');
|
||||
},
|
||||
ai:{
|
||||
order:8,
|
||||
player.chooseButton(dialog,true);
|
||||
'step 1'
|
||||
player.gain(game.createCard(result.links[0][2]),'draw');
|
||||
},
|
||||
ai:{
|
||||
order:8,
|
||||
threaten:1.3,
|
||||
result:{
|
||||
player:1
|
||||
},
|
||||
}
|
||||
},
|
||||
result:{
|
||||
player:1
|
||||
},
|
||||
}
|
||||
},
|
||||
gwtianbian:{
|
||||
trigger:{player:'phaseUseBegin'},
|
||||
direct:true,
|
||||
|
@ -2575,17 +2575,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
nuhou:{
|
||||
trigger:{player:'damageEnd'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
return player.countCards('he')>0;
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.chooseToDiscard(get.prompt2('nuhou'),'he').set('ai',function(card){
|
||||
return 8-get.useful(card);
|
||||
}).set('logSkill','nuhou');
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
return player.countCards('he')>0;
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.chooseToDiscard(get.prompt2('nuhou'),'he').set('ai',function(card){
|
||||
return 8-get.useful(card);
|
||||
}).set('logSkill','nuhou');
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
var targets=player.getEnemies();
|
||||
if(targets.length){
|
||||
var target=targets.randomGet();
|
||||
|
@ -2593,10 +2593,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
target.damage();
|
||||
target.randomDiscard();
|
||||
}
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
threaten:0.8,
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
threaten:0.8,
|
||||
maixie:true,
|
||||
maixie_hp:true,
|
||||
maixie_defend:true,
|
||||
|
@ -2610,7 +2610,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
shewu:{
|
||||
enable:'phaseUse',
|
||||
|
@ -3892,10 +3892,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
!target.hasSkill('gw_qinpendayu')||
|
||||
!target.hasSkill('gw_birinongwu');
|
||||
},
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
changeTarget:function(player,targets){
|
||||
game.filterPlayer(function(current){
|
||||
return get.distance(targets[0],current,'pure')==1;
|
||||
},targets);
|
||||
},
|
||||
contentAfter:function(){
|
||||
var evt=_status.event.getParent('phaseUse');
|
||||
|
@ -4180,9 +4180,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
},
|
||||
cardType:{
|
||||
gwmaoxian:0.5
|
||||
},
|
||||
cardType:{
|
||||
gwmaoxian:0.5
|
||||
},
|
||||
translate:{
|
||||
gw_huoge:'霍格',
|
||||
gw_aisinie:'埃丝涅',
|
||||
|
|
16776
character/hearth.js
16776
character/hearth.js
File diff suppressed because it is too large
Load Diff
1062
character/jiange.js
1062
character/jiange.js
File diff suppressed because it is too large
Load Diff
|
@ -2,14 +2,14 @@
|
|||
game.import('character',function(lib,game,ui,get,ai,_status){
|
||||
return {
|
||||
name:'mtg',
|
||||
character:{
|
||||
character:{
|
||||
mtg_jiding:['male','qun',4,['mbaizhan','msilian']],
|
||||
// mtg_qianzhuo:['female','shu',3,[]],
|
||||
mtg_jiesi:['male','wei',3,['mtongnian','msuoling','mhuanyi']],
|
||||
mtg_lilianna:['female','qun',3,['lingyong','mduohun']],
|
||||
// mtg_nisha:['female','wu',3,[]],
|
||||
// mtg_ayeni:['male','qun',4,[]],
|
||||
},
|
||||
},
|
||||
characterIntro:{
|
||||
mtg_jiding:'这名白色魔法的使用者极其注重忠诚,正义和荣誉。他曾全力追捕茜卓纳拉,如今已不可思议地与这位火焰法师成为伙伴。',
|
||||
mtg_qianzhuo:'茜卓纳拉是使用红色法术力的旅法师。她擅长使用火焰:除了火焰,还是火焰。茜卓性格冲动、易怒、富有激情,不断增长的火焰法术能力随时都准备爆发。她的火花在还很年轻时便已点燃,如今已是相当有经验的烈焰术士和旅法师。',
|
||||
|
@ -18,7 +18,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
mtg_nisha:'赞迪卡妖精部落玖瑞加的一名战士,做事倾尽全力,与大地有密切的联系,还擅使元素魔法。她能够引导时空的魔法生机地脉,为土地赋予生命。',
|
||||
mtg_ayeni:'金鬃阿耶尼是使用白色法术的鹏洛客。他长于净化身体与心灵的法术:用咒语来治疗、强化盟友,以及唤醒他人内在的心灵精华。',
|
||||
},
|
||||
skill:{
|
||||
skill:{
|
||||
mduohun:{
|
||||
trigger:{player:'dyingAfter'},
|
||||
forced:true,
|
||||
|
@ -30,17 +30,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger.source.loseHp();
|
||||
},
|
||||
ai:{
|
||||
threaten:function(player,target){
|
||||
if(target.hp==1) return 0.6;
|
||||
threaten:function(player,target){
|
||||
if(target.hp==1) return 0.6;
|
||||
return 1;
|
||||
},
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(!target.hasFriend()) return;
|
||||
if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(!target.hasFriend()) return;
|
||||
if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
lingyong:{
|
||||
enable:'phaseUse',
|
||||
|
@ -463,9 +463,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
translate:{
|
||||
mtg_jiding:'基定',
|
||||
},
|
||||
translate:{
|
||||
mtg_jiding:'基定',
|
||||
mtg_qianzhuo:'茜卓',
|
||||
mtg_jiesi:'杰斯',
|
||||
mtg_lilianna:'莉莲娜',
|
||||
|
@ -490,6 +490,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
msuoling_old_info:'出牌阶段限一次,若你手牌中有替身牌且手牌数不超过5,你可以展示手牌,若其中的非替身手牌能通过四则运算得到你的替身牌的点数,你将替身牌转化为非替身牌,然后获得一张新的替身牌(此技能托管无效)',
|
||||
mhuanyi:'幻逸',
|
||||
mhuanyi_info:'每两轮限一次,结束阶段,你可以选择一名其他角色和一种卡牌类型(选择结果对其他角色不可见),直到下一回合开始,当你首次成为该类型卡牌的惟一目标时,你将目标转移给你指定的角色(目标须合法)',
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
454
character/old.js
454
character/old.js
|
@ -2,44 +2,44 @@
|
|||
game.import('character',function(lib,game,ui,get,ai,_status){
|
||||
return {
|
||||
name:'old',
|
||||
character:{
|
||||
zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu']],
|
||||
character:{
|
||||
zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu']],
|
||||
masu:['male','shu',3,['xinzhan','huilei']],
|
||||
xushu:['male','shu',3,['wuyan','jujian']],
|
||||
fazheng:['male','shu',3,['enyuan','xuanhuo']],
|
||||
liru:['male','qun',3,['juece','mieji','fencheng']],
|
||||
yujin:['male','wei',4,['yizhong']],
|
||||
yujin:['male','wei',4,['yizhong']],
|
||||
lusu:['male','wu',3,['haoshi','dimeng']],
|
||||
yuanshao:['male','qun',4,['luanji','xueyi'],['zhu']],
|
||||
old_zhonghui:['male','wei',3,['zzhenggong','zquanji','zbaijiang']],
|
||||
old_xusheng:['male','wu',4,['pojun']],
|
||||
old_zhuran:['male','wu',4,['olddanshou']],
|
||||
old_lingtong:['male','wu',4,['oldxuanfeng']],
|
||||
old_madai:['male','shu',4,['mashu','oldqianxi']],
|
||||
old_caoxiu:['male','wei',4,['taoxi']],
|
||||
old_huaxiong:['male','qun',6,['shiyong']],
|
||||
old_wangyi:['female','wei',3,['oldzhenlie','oldmiji']],
|
||||
old_caozhen:['male','wei',4,['sidi']],
|
||||
old_quancong:['male','wu',4,['zhenshan']],
|
||||
old_xusheng:['male','wu',4,['pojun']],
|
||||
old_zhuran:['male','wu',4,['olddanshou']],
|
||||
old_lingtong:['male','wu',4,['oldxuanfeng']],
|
||||
old_madai:['male','shu',4,['mashu','oldqianxi']],
|
||||
old_caoxiu:['male','wei',4,['taoxi']],
|
||||
old_huaxiong:['male','qun',6,['shiyong']],
|
||||
old_wangyi:['female','wei',3,['oldzhenlie','oldmiji']],
|
||||
old_caozhen:['male','wei',4,['sidi']],
|
||||
old_quancong:['male','wu',4,['zhenshan']],
|
||||
old_yuanshu:['male','qun',4,['yongsi','weidi']],
|
||||
old_lingju:['female','qun',3,['jieyuan','fenxin_old']],
|
||||
},
|
||||
old_lingju:['female','qun',3,['jieyuan','fenxin_old']],
|
||||
},
|
||||
characterFilter:{
|
||||
old_lingju:function(mode){
|
||||
return mode=='identity';
|
||||
}
|
||||
},
|
||||
skill:{
|
||||
zhenshan:{
|
||||
skill:{
|
||||
zhenshan:{
|
||||
trigger:{player:'chooseToRespondBegin'},
|
||||
filter:function(event,player){
|
||||
if(event.responded) return false;
|
||||
if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false;
|
||||
if(player.hasSkill('zhenshan2')) return false;
|
||||
var nh=player.countCards('h');
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h')<nh;
|
||||
});
|
||||
var nh=player.countCards('h');
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h')<nh;
|
||||
});
|
||||
},
|
||||
direct:true,
|
||||
content:function(){
|
||||
|
@ -53,33 +53,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(result.bool){
|
||||
trigger.untrigger();
|
||||
trigger.responded=true;
|
||||
if(trigger.filterCard({name:'shan'})){
|
||||
trigger.result={bool:true,card:{name:'shan'}}
|
||||
}
|
||||
else{
|
||||
trigger.result={bool:true,card:{name:'sha'}}
|
||||
}
|
||||
if(trigger.filterCard({name:'shan'})){
|
||||
trigger.result={bool:true,card:{name:'shan'}}
|
||||
}
|
||||
else{
|
||||
trigger.result={bool:true,card:{name:'sha'}}
|
||||
}
|
||||
player.logSkill('zhenshan',result.targets);
|
||||
player.addTempSkill('zhenshan2');
|
||||
player.swapHandcards(result.targets[0]);
|
||||
player.swapHandcards(result.targets[0]);
|
||||
}
|
||||
},
|
||||
group:'zhenshan_use'
|
||||
},
|
||||
zhenshan2:{},
|
||||
zhenshan_use:{
|
||||
zhenshan_use:{
|
||||
enable:'chooseToUse',
|
||||
filter:function(event,player){
|
||||
if(player.hasSkill('zhenshan2')) return false;
|
||||
var nh=player.countCards('h');
|
||||
if(!game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h')<nh;
|
||||
})){
|
||||
return false;
|
||||
}
|
||||
return event.filterCard({name:'sha'},player,event)||
|
||||
event.filterCard({name:'jiu'},player,event)||
|
||||
event.filterCard({name:'tao'},player,event);
|
||||
if(player.hasSkill('zhenshan2')) return false;
|
||||
var nh=player.countCards('h');
|
||||
if(!game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h')<nh;
|
||||
})){
|
||||
return false;
|
||||
}
|
||||
return event.filterCard({name:'sha'},player,event)||
|
||||
event.filterCard({name:'jiu'},player,event)||
|
||||
event.filterCard({name:'tao'},player,event);
|
||||
},
|
||||
chooseButton:{
|
||||
dialog:function(event,player){
|
||||
|
@ -100,18 +100,18 @@ 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(card.name=='jiu') return 0;
|
||||
if(card.name=='jiu') return 0;
|
||||
if(game.hasPlayer(function(current){
|
||||
return player.canUse(card,current)&&get.effect(current,card,player,player)>0;
|
||||
})){
|
||||
if(card.name=='sha'){
|
||||
if(card.nature=='fire') return 2.95;
|
||||
else if(card.nature=='fire') return 2.92;
|
||||
else return 2.9;
|
||||
}
|
||||
else if(card.name=='tao'){
|
||||
return 4;
|
||||
}
|
||||
if(card.name=='sha'){
|
||||
if(card.nature=='fire') return 2.95;
|
||||
else if(card.nature=='fire') return 2.92;
|
||||
else return 2.9;
|
||||
}
|
||||
else if(card.name=='tao'){
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
|
@ -119,22 +119,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return {
|
||||
filterCard:function(){return false},
|
||||
viewAs:{name:links[0][2],nature:links[0][3]},
|
||||
selectCard:-1,
|
||||
selectCard:-1,
|
||||
popname:true,
|
||||
log:false,
|
||||
log:false,
|
||||
precontent:function(){
|
||||
'step 0'
|
||||
player.chooseTarget('选择交换手牌的目标',function(card,player,target){
|
||||
return target.countCards('h')<player.countCards('h')
|
||||
},true).ai=function(target){
|
||||
return get.attitude(player,target);
|
||||
}
|
||||
player.addTempSkill('zhenshan2');
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
player.logSkill('zhenshan',result.targets);
|
||||
player.swapHandcards(result.targets[0]);
|
||||
}
|
||||
'step 0'
|
||||
player.chooseTarget('选择交换手牌的目标',function(card,player,target){
|
||||
return target.countCards('h')<player.countCards('h')
|
||||
},true).ai=function(target){
|
||||
return get.attitude(player,target);
|
||||
}
|
||||
player.addTempSkill('zhenshan2');
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
player.logSkill('zhenshan',result.targets);
|
||||
player.swapHandcards(result.targets[0]);
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -146,34 +146,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
order:function(){
|
||||
var player=_status.event.player;
|
||||
var event=_status.event;
|
||||
var nh=player.countCards('h');
|
||||
if(game.hasPlayer(function(current){
|
||||
return get.attitude(player,current)>0&¤t.countCards('h')<nh;
|
||||
})){
|
||||
if(event.type=='dying'){
|
||||
if(event.filterCard({name:'tao'},player,event)){
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(event.filterCard({name:'tao'},player,event)){
|
||||
return 4;
|
||||
}
|
||||
if(event.filterCard({name:'sha'},player,event)){
|
||||
return 2.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
var nh=player.countCards('h');
|
||||
if(game.hasPlayer(function(current){
|
||||
return get.attitude(player,current)>0&¤t.countCards('h')<nh;
|
||||
})){
|
||||
if(event.type=='dying'){
|
||||
if(event.filterCard({name:'tao'},player,event)){
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(event.filterCard({name:'tao'},player,event)){
|
||||
return 4;
|
||||
}
|
||||
if(event.filterCard({name:'sha'},player,event)){
|
||||
return 2.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
save:true,
|
||||
respondSha:true,
|
||||
skillTagFilter:function(player,tag,arg){
|
||||
if(player.hasSkill('zhenshan2')) return false;
|
||||
var nh=player.countCards('h');
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h')<nh;
|
||||
});
|
||||
if(player.hasSkill('zhenshan2')) return false;
|
||||
var nh=player.countCards('h');
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h')<nh;
|
||||
});
|
||||
},
|
||||
result:{
|
||||
player:function(player){
|
||||
|
@ -187,16 +187,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
},
|
||||
oldzhenlie:{
|
||||
oldzhenlie:{
|
||||
audio:'zhenlie',
|
||||
trigger:{player:'judge'},
|
||||
check:function(event,player){
|
||||
return event.judge(player.judging[0])<0;
|
||||
},
|
||||
return event.judge(player.judging[0])<0;
|
||||
},
|
||||
content:function(){
|
||||
var card=get.cards()[0];
|
||||
var card=get.cards()[0];
|
||||
player.$throw(card);
|
||||
card.clone.classList.add('thrownhighlight');
|
||||
card.clone.classList.add('thrownhighlight');
|
||||
if(trigger.player.judging[0].clone){
|
||||
trigger.player.judging[0].clone.classList.remove('thrownhighlight');
|
||||
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
|
||||
|
@ -208,144 +208,144 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
game.delay(2);
|
||||
},
|
||||
},
|
||||
oldmiji:{
|
||||
trigger:{player:['phaseBegin','phaseEnd']},
|
||||
filter:function(event,player){
|
||||
return player.isDamaged();
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.judge(function(card){
|
||||
return get.color(card)=='black'?1:-1;
|
||||
});
|
||||
'step 1'
|
||||
if(result.bool&&player.maxHp>player.hp){
|
||||
var cards=get.cards(player.maxHp-player.hp);
|
||||
event.cards=cards;
|
||||
var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden');
|
||||
dialog.classList.add('noselect');
|
||||
player.chooseTarget(true,dialog).ai=function(target){
|
||||
return get.attitude(player,target)/Math.sqrt(1+target.countCards('h'));
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
'step 2'
|
||||
player.line(result.targets);
|
||||
result.targets[0].gain(event.cards,'draw');
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
oldmiji:{
|
||||
trigger:{player:['phaseBegin','phaseEnd']},
|
||||
filter:function(event,player){
|
||||
return player.isDamaged();
|
||||
},
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.judge(function(card){
|
||||
return get.color(card)=='black'?1:-1;
|
||||
});
|
||||
'step 1'
|
||||
if(result.bool&&player.maxHp>player.hp){
|
||||
var cards=get.cards(player.maxHp-player.hp);
|
||||
event.cards=cards;
|
||||
var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden');
|
||||
dialog.classList.add('noselect');
|
||||
player.chooseTarget(true,dialog).ai=function(target){
|
||||
return get.attitude(player,target)/Math.sqrt(1+target.countCards('h'));
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
'step 2'
|
||||
player.line(result.targets);
|
||||
result.targets[0].gain(event.cards,'draw');
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
if(get.tag(card,'recover')&&target.hp==target.maxHp-1) return [0,0];
|
||||
if(target.hasFriend()){
|
||||
if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp==target.maxHp) return [0,1];
|
||||
}
|
||||
if(target.hasFriend()){
|
||||
if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp==target.maxHp) return [0,1];
|
||||
}
|
||||
}
|
||||
},
|
||||
threaten:function(player,target){
|
||||
if(target.hp==1) return 3;
|
||||
if(target.hp==2) return 2;
|
||||
return 1;
|
||||
return 1;
|
||||
},
|
||||
}
|
||||
},
|
||||
shiyong:{
|
||||
audio:2,
|
||||
trigger:{player:'damageEnd'},
|
||||
forced:true,
|
||||
check:function(){
|
||||
return false;
|
||||
},
|
||||
filter:function(event,player){
|
||||
return event.card&&event.card.name=='sha'&&(get.color(event.card)=='red'||event.source.hasSkill('jiu'));
|
||||
},
|
||||
content:function(){
|
||||
player.loseMaxHp();
|
||||
}
|
||||
},
|
||||
oldqianxi:{
|
||||
trigger:{source:'damageBefore'},
|
||||
check:function(event,player){
|
||||
var att=get.attitude(player,event.player);
|
||||
if(event.player.hp==event.player.maxHp) return att<0;
|
||||
if(event.player.hp==event.player.maxHp-1&&
|
||||
(event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0;
|
||||
return att>0;
|
||||
},
|
||||
filter:function(event,player){
|
||||
return event.card&&event.card.name=='sha'&&get.distance(player,event.player)<=1;
|
||||
},
|
||||
logTarget:'player',
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.judge(function(card){
|
||||
return get.suit(card)!='heart'?1:-1;
|
||||
});
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
trigger.cancel();
|
||||
trigger.player.loseMaxHp(true);
|
||||
}
|
||||
}
|
||||
},
|
||||
oldxuanfeng:{
|
||||
}
|
||||
},
|
||||
shiyong:{
|
||||
audio:2,
|
||||
trigger:{player:'damageEnd'},
|
||||
forced:true,
|
||||
check:function(){
|
||||
return false;
|
||||
},
|
||||
filter:function(event,player){
|
||||
return event.card&&event.card.name=='sha'&&(get.color(event.card)=='red'||event.source.hasSkill('jiu'));
|
||||
},
|
||||
content:function(){
|
||||
player.loseMaxHp();
|
||||
}
|
||||
},
|
||||
oldqianxi:{
|
||||
trigger:{source:'damageBefore'},
|
||||
check:function(event,player){
|
||||
var att=get.attitude(player,event.player);
|
||||
if(event.player.hp==event.player.maxHp) return att<0;
|
||||
if(event.player.hp==event.player.maxHp-1&&
|
||||
(event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0;
|
||||
return att>0;
|
||||
},
|
||||
filter:function(event,player){
|
||||
return event.card&&event.card.name=='sha'&&get.distance(player,event.player)<=1;
|
||||
},
|
||||
logTarget:'player',
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.judge(function(card){
|
||||
return get.suit(card)!='heart'?1:-1;
|
||||
});
|
||||
'step 1'
|
||||
if(result.bool){
|
||||
trigger.cancel();
|
||||
trigger.player.loseMaxHp(true);
|
||||
}
|
||||
}
|
||||
},
|
||||
oldxuanfeng:{
|
||||
audio:'xuanfeng',
|
||||
trigger:{player:'loseEnd'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
for(var i=0;i<event.cards.length;i++){
|
||||
if(event.cards[i].original=='e') return true;
|
||||
}
|
||||
for(var i=0;i<event.cards.length;i++){
|
||||
if(event.cards[i].original=='e') return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.chooseTarget(get.prompt('xuanfeng'),function(card,player,target){
|
||||
if(target==player) return false;
|
||||
return get.distance(player,target)<=1||player.canUse('sha',target,false);
|
||||
if(target==player) return false;
|
||||
return get.distance(player,target)<=1||player.canUse('sha',target,false);
|
||||
}).set('ai',function(target){
|
||||
if(get.distance(player,target)<=1){
|
||||
return get.damageEffect(target,player,player)*2;
|
||||
}
|
||||
else{
|
||||
return get.effect(target,{name:'sha'},player,player);
|
||||
}
|
||||
if(get.distance(player,target)<=1){
|
||||
return get.damageEffect(target,player,player)*2;
|
||||
}
|
||||
else{
|
||||
return get.effect(target,{name:'sha'},player,player);
|
||||
}
|
||||
});
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.logSkill('xuanfeng',result.targets);
|
||||
var target=result.targets[0];
|
||||
var distance=get.distance(player,target);
|
||||
if(distance<=1&&player.canUse('sha',target,false)){
|
||||
player.chooseControl('出杀','造成伤害').ai=function(){
|
||||
return '造成伤害';
|
||||
}
|
||||
event.target=target;
|
||||
}
|
||||
else if(distance<=1){
|
||||
target.damage();
|
||||
event.finish();
|
||||
}
|
||||
else{
|
||||
player.useCard({name:'sha'},target,false).animate=false;
|
||||
game.delay();
|
||||
event.finish();
|
||||
}
|
||||
var target=result.targets[0];
|
||||
var distance=get.distance(player,target);
|
||||
if(distance<=1&&player.canUse('sha',target,false)){
|
||||
player.chooseControl('出杀','造成伤害').ai=function(){
|
||||
return '造成伤害';
|
||||
}
|
||||
event.target=target;
|
||||
}
|
||||
else if(distance<=1){
|
||||
target.damage();
|
||||
event.finish();
|
||||
}
|
||||
else{
|
||||
player.useCard({name:'sha'},target,false).animate=false;
|
||||
game.delay();
|
||||
event.finish();
|
||||
}
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
"step 2"
|
||||
var target=event.target;
|
||||
var target=event.target;
|
||||
if(result.control=='出杀'){
|
||||
player.useCard({name:'sha'},target,false).animate=false;
|
||||
game.delay();
|
||||
}
|
||||
else{
|
||||
target.damage();
|
||||
}
|
||||
player.useCard({name:'sha'},target,false).animate=false;
|
||||
game.delay();
|
||||
}
|
||||
else{
|
||||
target.damage();
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
|
@ -357,35 +357,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
noe:true
|
||||
}
|
||||
},
|
||||
},
|
||||
translate:{
|
||||
old_yuanshu:'旧袁术',
|
||||
old_xusheng:'旧徐盛',
|
||||
old_lingtong:'旧凌统',
|
||||
old_zhuran:'旧朱然',
|
||||
old_madai:'旧马岱',
|
||||
old_caoxiu:'旧曹休',
|
||||
old_huaxiong:'旧华雄',
|
||||
old_wangyi:'旧王异',
|
||||
old_caozhen:'旧曹真',
|
||||
},
|
||||
translate:{
|
||||
old_yuanshu:'旧袁术',
|
||||
old_xusheng:'旧徐盛',
|
||||
old_lingtong:'旧凌统',
|
||||
old_zhuran:'旧朱然',
|
||||
old_madai:'旧马岱',
|
||||
old_caoxiu:'旧曹休',
|
||||
old_huaxiong:'旧华雄',
|
||||
old_wangyi:'旧王异',
|
||||
old_caozhen:'旧曹真',
|
||||
old_quancong:'旧全琮',
|
||||
old_lingju:'旧灵雎',
|
||||
old_lingju:'旧灵雎',
|
||||
|
||||
zhenshan:'振赡',
|
||||
zhenshan_use:'振赡',
|
||||
zhenshan_use_backup:'振赡',
|
||||
zhenshan_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
|
||||
zhenshan_use_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
|
||||
oldzhenlie:'贞烈',
|
||||
oldzhenlie_info:'在你的判定牌生效前,你可以亮出牌堆顶的一张牌代替之',
|
||||
oldmiji:'秘计',
|
||||
oldmiji_info:'准备/结束阶段开始时,若你已受伤,你可以判定,若判定结果为黑色,你观看牌堆顶的X张牌(X为你已损失的体力值),然后将这些牌交给一名角色',
|
||||
shiyong:'恃勇',
|
||||
shiyong_info:'锁定技,当你受到一次红色【杀】或【酒】【杀】造成的伤害后,须减1点体力上限',
|
||||
oldqianxi:'潜袭',
|
||||
oldqianxi_info:'当你使用【杀】对距离为1的目标角色造成伤害时,你可以进行一次判定,若判定结果不为红桃,你防止此伤害,令其减1点体力上限',
|
||||
oldxuanfeng:'旋风',
|
||||
oldxuanfeng_info:'每当你失去一次装备区里的牌时,你可以执行下列两项中的一项:1.视为对任意一名其他角色使用一张【杀】(此【杀】不计入每回合的使用限制);2.对与你距离1以内的一名其他角色造成一点伤害',
|
||||
}
|
||||
zhenshan:'振赡',
|
||||
zhenshan_use:'振赡',
|
||||
zhenshan_use_backup:'振赡',
|
||||
zhenshan_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
|
||||
zhenshan_use_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
|
||||
oldzhenlie:'贞烈',
|
||||
oldzhenlie_info:'在你的判定牌生效前,你可以亮出牌堆顶的一张牌代替之',
|
||||
oldmiji:'秘计',
|
||||
oldmiji_info:'准备/结束阶段开始时,若你已受伤,你可以判定,若判定结果为黑色,你观看牌堆顶的X张牌(X为你已损失的体力值),然后将这些牌交给一名角色',
|
||||
shiyong:'恃勇',
|
||||
shiyong_info:'锁定技,当你受到一次红色【杀】或【酒】【杀】造成的伤害后,须减1点体力上限',
|
||||
oldqianxi:'潜袭',
|
||||
oldqianxi_info:'当你使用【杀】对距离为1的目标角色造成伤害时,你可以进行一次判定,若判定结果不为红桃,你防止此伤害,令其减1点体力上限',
|
||||
oldxuanfeng:'旋风',
|
||||
oldxuanfeng_info:'每当你失去一次装备区里的牌时,你可以执行下列两项中的一项:1.视为对任意一名其他角色使用一张【杀】(此【杀】不计入每回合的使用限制);2.对与你距离1以内的一名其他角色造成一点伤害',
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
5861
character/ow.js
5861
character/ow.js
File diff suppressed because it is too large
Load Diff
1272
character/rank.js
1272
character/rank.js
File diff suppressed because it is too large
Load Diff
|
@ -168,6 +168,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
if(target.hasSkillTag('nogain')) return 0;
|
||||
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
|
||||
if(target.hasSkillTag('nodu')) return 0;
|
||||
return -10;
|
||||
|
@ -210,7 +211,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{source:'damageEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.countCards('he')>0;
|
||||
},
|
||||
check:function(){
|
||||
|
@ -1124,7 +1125,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{source:'damageEnd'},
|
||||
direct:true,
|
||||
filter:function(event){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return event.card&&event.card.name=='sha'&&event.cards&&
|
||||
get.color(event.cards)=='black'&&event.player.countCards('e');
|
||||
},
|
||||
|
@ -1451,7 +1452,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
trigger:{player:'damageEnd',source:'damageEnd'},
|
||||
filter:function(event){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return event.num&&event.source&&event.player&&
|
||||
event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player;
|
||||
},
|
||||
|
|
9192
character/shenhua.js
9192
character/shenhua.js
File diff suppressed because it is too large
Load Diff
20102
character/sp.js
20102
character/sp.js
File diff suppressed because it is too large
Load Diff
|
@ -375,13 +375,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
"step 1"
|
||||
if(event.cards.length>1){
|
||||
player.chooseCardButton('将“遗计”牌分配给任意角色',true,event.cards,[1,event.cards.length]).set('ai',function(button){
|
||||
if(ui.selected.buttons.length==0) return 1;
|
||||
return 0;
|
||||
if(ui.selected.buttons.length==0) return 1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
else if(event.cards.length==1){
|
||||
event._result={links:event.cards.slice(0),bool:true};
|
||||
}
|
||||
else if(event.cards.length==1){
|
||||
event._result={links:event.cards.slice(0),bool:true};
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
|
@ -392,23 +392,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
event.togive=result.links.slice(0);
|
||||
player.chooseTarget('将'+get.translation(result.links)+'交给一名角色',true).set('ai',function(target){
|
||||
var att=get.attitude(_status.event.player,target);
|
||||
var att=get.attitude(_status.event.player,target);
|
||||
if(_status.event.enemy){
|
||||
return -att;
|
||||
}
|
||||
else if(att>0){
|
||||
return att/(1+target.countCards('h'));
|
||||
}
|
||||
else{
|
||||
return att/100;
|
||||
}
|
||||
return -att;
|
||||
}
|
||||
else if(att>0){
|
||||
return att/(1+target.countCards('h'));
|
||||
}
|
||||
else{
|
||||
return att/100;
|
||||
}
|
||||
}).set('enemy',get.value(event.togive[0])<0);
|
||||
}
|
||||
"step 3"
|
||||
if(result.targets.length){
|
||||
result.targets[0].gain(event.togive,'draw');
|
||||
player.line(result.targets[0],'green');
|
||||
game.log(result.targets[0],'获得了'+get.cnNumber(event.togive.length)+'张牌');
|
||||
game.log(result.targets[0],'获得了'+get.cnNumber(event.togive.length)+'张牌');
|
||||
event.goto(1);
|
||||
}
|
||||
},
|
||||
|
@ -564,6 +564,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
result:{
|
||||
target:function(player,target){
|
||||
if(target.hasSkillTag('nogain')) return 0;
|
||||
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
|
||||
if(target.hasSkillTag('nodu')) return 0;
|
||||
return -10;
|
||||
|
@ -1139,8 +1140,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(!player.countCards('h','shan')) return false;
|
||||
},
|
||||
order:function(){
|
||||
return get.order({name:'sha'})+0.1;
|
||||
},
|
||||
return get.order({name:'sha'})+0.1;
|
||||
},
|
||||
useful:-1,
|
||||
value:-1
|
||||
}
|
||||
|
|
20334
character/swd.js
20334
character/swd.js
File diff suppressed because it is too large
Load Diff
|
@ -2,124 +2,124 @@
|
|||
game.import('character',function(lib,game,ui,get,ai,_status){
|
||||
return {
|
||||
name:'xiake',
|
||||
character:{
|
||||
character:{
|
||||
// xk_dongfangweiming:['male','shu',4,[]],
|
||||
xk_guyuexuan:['male','qun',4,['rouquan','gzhenji']],
|
||||
xk_jinji:['male','shu',4,['zhongzhan','lianpo']],
|
||||
// xk_shenxiangyun:['female','wei',3,['zhenjiu']],
|
||||
// xk_shenxiangyun:['female','wei',3,['zhenjiu']],
|
||||
xk_fujianhan:['male','qun',4,['zuijian','zitong']],
|
||||
},
|
||||
skill:{
|
||||
zhongzhan:{
|
||||
trigger:{source:'damageBegin'},
|
||||
logTarget:'player',
|
||||
check:function(event,player){
|
||||
if(get.damageEffect(event.player,player,player)>0&&
|
||||
get.attitude(player,event.player)<0){
|
||||
return player.hp>event.player.hp&&player.hp>=2;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
player.loseHp();
|
||||
trigger.num++;
|
||||
}
|
||||
},
|
||||
rouquan:{
|
||||
mod:{
|
||||
},
|
||||
skill:{
|
||||
zhongzhan:{
|
||||
trigger:{source:'damageBegin'},
|
||||
logTarget:'player',
|
||||
check:function(event,player){
|
||||
if(get.damageEffect(event.player,player,player)>0&&
|
||||
get.attitude(player,event.player)<0){
|
||||
return player.hp>event.player.hp&&player.hp>=2;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
player.loseHp();
|
||||
trigger.num++;
|
||||
}
|
||||
},
|
||||
rouquan:{
|
||||
mod:{
|
||||
selectTarget:function(card,player,range){
|
||||
if(card.name=='sha'&&!player.getEquip(1)&&range[1]!=-1) range[1]=Infinity;
|
||||
}
|
||||
},
|
||||
enable:'phaseUse',
|
||||
position:'e',
|
||||
filter:function(event,player){
|
||||
return player.countCards('e')>0;
|
||||
},
|
||||
filterCard:true,
|
||||
prompt:'将要重铸的牌置入弃牌堆并摸一张牌',
|
||||
discard:false,
|
||||
delay:0.5,
|
||||
check:function(card,player){
|
||||
var val=get.equipValue(card);
|
||||
var player=_status.event.player;
|
||||
var cards=player.getCards('h',{subtype:get.subtype(card)});
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(get.equipValue(cards[i])>=val){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
prepare:function(cards,player){
|
||||
player.$throw(cards,1000);
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.draw();
|
||||
"step 1"
|
||||
for(var i=0;i<cards.length;i++){
|
||||
cards[i].discard();
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
order:9.5,
|
||||
result:{
|
||||
player:1
|
||||
}
|
||||
}
|
||||
},
|
||||
gzhenji:{
|
||||
trigger:{source:'damageEnd'},
|
||||
frequent:true,
|
||||
filter:function(event,player){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return _status.currentPhase==player&&event.card&&event.card.name=='sha';
|
||||
},
|
||||
content:function(){
|
||||
player.draw();
|
||||
player.addTempSkill('gzhenji3');
|
||||
}
|
||||
},
|
||||
gzhenji3:{
|
||||
mod:{
|
||||
enable:'phaseUse',
|
||||
position:'e',
|
||||
filter:function(event,player){
|
||||
return player.countCards('e')>0;
|
||||
},
|
||||
filterCard:true,
|
||||
prompt:'将要重铸的牌置入弃牌堆并摸一张牌',
|
||||
discard:false,
|
||||
delay:0.5,
|
||||
check:function(card,player){
|
||||
var val=get.equipValue(card);
|
||||
var player=_status.event.player;
|
||||
var cards=player.getCards('h',{subtype:get.subtype(card)});
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(get.equipValue(cards[i])>=val){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
prepare:function(cards,player){
|
||||
player.$throw(cards,1000);
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.draw();
|
||||
"step 1"
|
||||
for(var i=0;i<cards.length;i++){
|
||||
cards[i].discard();
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
order:9.5,
|
||||
result:{
|
||||
player:1
|
||||
}
|
||||
}
|
||||
},
|
||||
gzhenji:{
|
||||
trigger:{source:'damageEnd'},
|
||||
frequent:true,
|
||||
filter:function(event,player){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return _status.currentPhase==player&&event.card&&event.card.name=='sha';
|
||||
},
|
||||
content:function(){
|
||||
player.draw();
|
||||
player.addTempSkill('gzhenji3');
|
||||
}
|
||||
},
|
||||
gzhenji3:{
|
||||
mod:{
|
||||
cardUsable:function(card,player,num){
|
||||
if(card.name=='sha') return num+1;
|
||||
}
|
||||
},
|
||||
},
|
||||
zitong:{
|
||||
trigger:{player:'useCard'},
|
||||
frequent:true,
|
||||
filter:function(event,player){
|
||||
return _status.currentPhase==player&&player.countUsed()==3;
|
||||
},
|
||||
content:function(){
|
||||
var card=get.cardPile('chuansongmen');
|
||||
if(!card){
|
||||
card=game.createCard('chuansongmen');
|
||||
}
|
||||
player.gain(card,'gain2');
|
||||
},
|
||||
ai:{
|
||||
threaten:1.2
|
||||
}
|
||||
}
|
||||
},
|
||||
translate:{
|
||||
xk_dongfangweiming:'东方未明',
|
||||
},
|
||||
zitong:{
|
||||
trigger:{player:'useCard'},
|
||||
frequent:true,
|
||||
filter:function(event,player){
|
||||
return _status.currentPhase==player&&player.countUsed()==3;
|
||||
},
|
||||
content:function(){
|
||||
var card=get.cardPile('chuansongmen');
|
||||
if(!card){
|
||||
card=game.createCard('chuansongmen');
|
||||
}
|
||||
player.gain(card,'gain2');
|
||||
},
|
||||
ai:{
|
||||
threaten:1.2
|
||||
}
|
||||
}
|
||||
},
|
||||
translate:{
|
||||
xk_dongfangweiming:'东方未明',
|
||||
xk_guyuexuan:'谷月轩',
|
||||
xk_jinji:'荆棘',
|
||||
xk_shenxiangyun:'沈湘芸',
|
||||
xk_fujianhan:'傅剑寒',
|
||||
zhongzhan:'重斩',
|
||||
zhongzhan_info:'每当你即将造成伤害,你可流失一点体力令伤害+1',
|
||||
gzhenji:'震击',
|
||||
gzhenji_info:'你使用杀造成伤害后,可以摸一张牌,并且本回合内可以额外使用一张杀',
|
||||
rouquan:'柔拳',
|
||||
rouquan_info:'你可以重铸装备区内的牌;当你没有武器牌时,你的杀可以指定任意个目标',
|
||||
zitong:'通悟',
|
||||
zitong_info:'当你于自己的回合内使用第三张牌时,你可以将一张传送门置于你的手牌',
|
||||
},
|
||||
xk_shenxiangyun:'沈湘芸',
|
||||
xk_fujianhan:'傅剑寒',
|
||||
zhongzhan:'重斩',
|
||||
zhongzhan_info:'每当你即将造成伤害,你可流失一点体力令伤害+1',
|
||||
gzhenji:'震击',
|
||||
gzhenji_info:'你使用杀造成伤害后,可以摸一张牌,并且本回合内可以额外使用一张杀',
|
||||
rouquan:'柔拳',
|
||||
rouquan_info:'你可以重铸装备区内的牌;当你没有武器牌时,你的杀可以指定任意个目标',
|
||||
zitong:'通悟',
|
||||
zitong_info:'当你于自己的回合内使用第三张牌时,你可以将一张传送门置于你的手牌',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
File diff suppressed because it is too large
Load Diff
18946
character/yijiang.js
18946
character/yijiang.js
File diff suppressed because it is too large
Load Diff
|
@ -92,21 +92,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
skill:{
|
||||
guimian:{
|
||||
trigger:{source:'damageEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return event.card&&event.card.name=='sha'&&_status.currentPhase==player;
|
||||
},
|
||||
content:function(){
|
||||
player.getStat().card.sha--;
|
||||
}
|
||||
},
|
||||
trigger:{source:'damageEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return event.card&&event.card.name=='sha'&&_status.currentPhase==player;
|
||||
},
|
||||
content:function(){
|
||||
player.getStat().card.sha--;
|
||||
}
|
||||
},
|
||||
lyuxue:{
|
||||
trigger:{source:'damageEnd'},
|
||||
forced:true,
|
||||
logTarget:'player',
|
||||
filter:function(event,player){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return event.player.isIn()&&!event.player.hasSkill('lyuxue2');
|
||||
},
|
||||
content:function(){
|
||||
|
@ -614,11 +614,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
content:function(){
|
||||
trigger.directHit=true;
|
||||
},
|
||||
mod:{
|
||||
targetInRange:function(card){
|
||||
if(card.name=='sha') return true;
|
||||
},
|
||||
},
|
||||
mod:{
|
||||
targetInRange:function(card){
|
||||
if(card.name=='sha') return true;
|
||||
},
|
||||
},
|
||||
},
|
||||
lguiyin:{
|
||||
unique:true,
|
||||
|
@ -863,7 +863,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{source:'damageEnd'},
|
||||
frequent:true,
|
||||
filter:function(event){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return event.player.isAlive()&&event.parent.name=='yanyi'&&event.player.hp<event.player.maxHp;
|
||||
},
|
||||
content:function(){
|
||||
|
@ -1338,7 +1338,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger:{source:'damageEnd'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event.player.isDead()) return false;
|
||||
var nh=event.player.countCards('h');
|
||||
if(nh==0) return false;
|
||||
|
|
|
@ -2,52 +2,52 @@
|
|||
game.import('character',function(lib,game,ui,get,ai,_status){
|
||||
return {
|
||||
name:'zhuogui',
|
||||
character:{
|
||||
character:{
|
||||
nianshou:['male','shu',4,['nianrui','qixiang']],
|
||||
mamian:['male','qun',4,['lianyu','guiji']],
|
||||
niutou:['male','shu',4,['manjia','xiaoshou']],
|
||||
baiwuchang:['male','qun',3,['qiangzheng','moukui']],
|
||||
heiwuchang:['male','qun',3,['suoling','xixing']],
|
||||
},
|
||||
skill:{
|
||||
qixiang:{
|
||||
group:['qixiang1','qixiang2'],
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(card.name=='lebu'&&card.name=='bingliang') return 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
qixiang1:{
|
||||
},
|
||||
skill:{
|
||||
qixiang:{
|
||||
group:['qixiang1','qixiang2'],
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(card.name=='lebu'&&card.name=='bingliang') return 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
qixiang1:{
|
||||
trigger:{player:'judge'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(event.card){
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='lebu';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='lebu';
|
||||
}
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='lebu';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='lebu';
|
||||
}
|
||||
}
|
||||
},
|
||||
content:function(){
|
||||
player.addTempSkill('qixiang3','phaseJudgeAfter');
|
||||
}
|
||||
},
|
||||
qixiang2:{
|
||||
qixiang2:{
|
||||
trigger:{player:'judge'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(event.card){
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='bingliang';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='bingliang';
|
||||
}
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='bingliang';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='bingliang';
|
||||
}
|
||||
}
|
||||
},
|
||||
content:function(){
|
||||
|
@ -68,19 +68,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
},
|
||||
nianrui:{
|
||||
trigger:{player:['phaseBegin','phaseEnd']},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.judge(function(card){
|
||||
return get.color(card)=='red'?1:0;
|
||||
});
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.draw();
|
||||
}
|
||||
}
|
||||
},
|
||||
nianrui:{
|
||||
trigger:{player:['phaseBegin','phaseEnd']},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.judge(function(card){
|
||||
return get.color(card)=='red'?1:0;
|
||||
});
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.draw();
|
||||
}
|
||||
}
|
||||
},
|
||||
lianyu:{
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
|
@ -88,7 +88,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
check:function(card){return 6-get.value(card)},
|
||||
filterTarget:true,
|
||||
selectTarget:-1,
|
||||
line:'fire',
|
||||
line:'fire',
|
||||
content:function(){
|
||||
target.damage('fire');
|
||||
},
|
||||
|
@ -104,18 +104,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return eff;
|
||||
}
|
||||
},
|
||||
expose:0.1
|
||||
expose:0.1
|
||||
}
|
||||
},
|
||||
manjia:{
|
||||
group:['manjia1','manjia2']
|
||||
},
|
||||
manjia1:{
|
||||
trigger:{target:'useCardToBefore'},
|
||||
manjia1:{
|
||||
trigger:{target:'useCardToBefore'},
|
||||
forced:true,
|
||||
priority:6,
|
||||
filter:function(event,player){
|
||||
if(player.getEquip(2)) return false;
|
||||
if(player.getEquip(2)) return false;
|
||||
return lib.skill.tengjia1.filter(event,player);
|
||||
},
|
||||
content:function(){
|
||||
|
@ -124,187 +124,187 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(target.getEquip(2)) return;
|
||||
if(target.getEquip(2)) return;
|
||||
return lib.skill.tengjia1.ai.effect.target.apply(this,arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
manjia2:{
|
||||
trigger:{player:'damageBegin'},
|
||||
trigger:{player:'damageBegin'},
|
||||
filter:function(event,player){
|
||||
if(player.getEquip(2)) return false;
|
||||
if(player.getEquip(2)) return false;
|
||||
if(event.nature=='fire') return true;
|
||||
},
|
||||
forced:true,
|
||||
check:function(){
|
||||
return false;
|
||||
},
|
||||
check:function(){
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
trigger.num++;
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(target.getEquip(2)) return;
|
||||
if(target.getEquip(2)) return;
|
||||
return lib.skill.tengjia2.ai.effect.target.apply(this,arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
xiaoshou:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
filter:function(event,player){
|
||||
var players=game.players.slice(0);
|
||||
xiaoshou:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
filter:function(event,player){
|
||||
var players=game.players.slice(0);
|
||||
players.sort(function(a,b){
|
||||
return b.hp-a.hp;
|
||||
});
|
||||
return players[0].hp>players[1].hp&&players[0]!=player;
|
||||
},
|
||||
check:function(event,player){
|
||||
var players=game.players.slice(0);
|
||||
},
|
||||
check:function(event,player){
|
||||
var players=game.players.slice(0);
|
||||
players.sort(function(a,b){
|
||||
return b.hp-a.hp;
|
||||
});
|
||||
return get.damageEffect(players[0],player,player,'fire')>0;
|
||||
},
|
||||
prompt:function(){
|
||||
var players=game.players.slice(0);
|
||||
},
|
||||
prompt:function(){
|
||||
var players=game.players.slice(0);
|
||||
players.sort(function(a,b){
|
||||
return b.hp-a.hp;
|
||||
});
|
||||
return '枭首:是否对'+get.translation(players[0])+'造成一点火焰伤害?';
|
||||
},
|
||||
content:function(){
|
||||
var players=game.players.slice(0);
|
||||
return '枭首:是否对'+get.translation(players[0])+'造成一点火焰伤害?';
|
||||
},
|
||||
content:function(){
|
||||
var players=game.players.slice(0);
|
||||
players.sort(function(a,b){
|
||||
return b.hp-a.hp;
|
||||
});
|
||||
if(players[0].hp>players[1].hp&&players[0]!=player){
|
||||
players[0].damage('fire');
|
||||
player.line(players[0],'fire');
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
expose:0.2
|
||||
}
|
||||
},
|
||||
guiji:{
|
||||
trigger:{player:'phaseJudgeBegin'},
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.discard(player.getCards('j').randomGet());
|
||||
},
|
||||
filter:function(event ,player){
|
||||
return player.countCards('j')>0;
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
qiangzheng:{
|
||||
audio:2,
|
||||
trigger:{player:'phaseEnd'},
|
||||
direct:true,
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i]!=player&&game.players[i].countCards('h')) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){
|
||||
return player!=target&&target.countCards('h')>0;
|
||||
}).ai=function(target){
|
||||
return -get.attitude(player,target);
|
||||
};
|
||||
"step 1"
|
||||
if(result.targets&&result.targets.length){
|
||||
player.logSkill('qiangzheng',result.targets);
|
||||
player.gain(result.targets[0].getCards('h').randomGet(),result.targets[0]);
|
||||
result.targets[0].$give(1,player);
|
||||
game.delay();
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
threaten:1.7
|
||||
}
|
||||
},
|
||||
suoling:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(player.isLinked()) return true;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i]!=player&&!game.players[i].isLinked()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
event.targets=game.players.slice(0);
|
||||
event.targets.remove(player);
|
||||
event.targets.sort(lib.sort.seat);
|
||||
if(player.isLinked()) player.link();
|
||||
"step 1"
|
||||
if(event.targets.length){
|
||||
var target=event.targets.shift();
|
||||
if(!target.isLinked()){
|
||||
target.link();
|
||||
}
|
||||
event.redo();
|
||||
}
|
||||
}
|
||||
},
|
||||
xixing:{
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
filterCard:function(card){
|
||||
var type=get.type(card);
|
||||
for(var i=0;i<ui.selected.cards.length;i++){
|
||||
if(get.type(ui.selected.cards[i])==type) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
complexCard:true,
|
||||
selectCard:3,
|
||||
position:'he',
|
||||
filterTarget:function(card,player,target){
|
||||
return player!=target;
|
||||
},
|
||||
check:function(card){
|
||||
if(_status.event.player.hp==_status.event.player.maxHp){
|
||||
return 5-get.value(card);
|
||||
}
|
||||
return 10-get.value(card);
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
target.damage();
|
||||
"step 1"
|
||||
player.recover();
|
||||
},
|
||||
ai:{
|
||||
order:9.5,
|
||||
result:{
|
||||
target:function(player,target){
|
||||
return get.damageEffect(target,player);
|
||||
}
|
||||
},
|
||||
expose:0.2
|
||||
}
|
||||
}
|
||||
},
|
||||
translate:{
|
||||
nianshou:'年兽',
|
||||
if(players[0].hp>players[1].hp&&players[0]!=player){
|
||||
players[0].damage('fire');
|
||||
player.line(players[0],'fire');
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
expose:0.2
|
||||
}
|
||||
},
|
||||
guiji:{
|
||||
trigger:{player:'phaseJudgeBegin'},
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.discard(player.getCards('j').randomGet());
|
||||
},
|
||||
filter:function(event ,player){
|
||||
return player.countCards('j')>0;
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
qiangzheng:{
|
||||
audio:2,
|
||||
trigger:{player:'phaseEnd'},
|
||||
direct:true,
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i]!=player&&game.players[i].countCards('h')) return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){
|
||||
return player!=target&&target.countCards('h')>0;
|
||||
}).ai=function(target){
|
||||
return -get.attitude(player,target);
|
||||
};
|
||||
"step 1"
|
||||
if(result.targets&&result.targets.length){
|
||||
player.logSkill('qiangzheng',result.targets);
|
||||
player.gain(result.targets[0].getCards('h').randomGet(),result.targets[0]);
|
||||
result.targets[0].$give(1,player);
|
||||
game.delay();
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
threaten:1.7
|
||||
}
|
||||
},
|
||||
suoling:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(player.isLinked()) return true;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(game.players[i]!=player&&!game.players[i].isLinked()){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
event.targets=game.players.slice(0);
|
||||
event.targets.remove(player);
|
||||
event.targets.sort(lib.sort.seat);
|
||||
if(player.isLinked()) player.link();
|
||||
"step 1"
|
||||
if(event.targets.length){
|
||||
var target=event.targets.shift();
|
||||
if(!target.isLinked()){
|
||||
target.link();
|
||||
}
|
||||
event.redo();
|
||||
}
|
||||
}
|
||||
},
|
||||
xixing:{
|
||||
enable:'phaseUse',
|
||||
usable:1,
|
||||
filterCard:function(card){
|
||||
var type=get.type(card);
|
||||
for(var i=0;i<ui.selected.cards.length;i++){
|
||||
if(get.type(ui.selected.cards[i])==type) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
complexCard:true,
|
||||
selectCard:3,
|
||||
position:'he',
|
||||
filterTarget:function(card,player,target){
|
||||
return player!=target;
|
||||
},
|
||||
check:function(card){
|
||||
if(_status.event.player.hp==_status.event.player.maxHp){
|
||||
return 5-get.value(card);
|
||||
}
|
||||
return 10-get.value(card);
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
target.damage();
|
||||
"step 1"
|
||||
player.recover();
|
||||
},
|
||||
ai:{
|
||||
order:9.5,
|
||||
result:{
|
||||
target:function(player,target){
|
||||
return get.damageEffect(target,player);
|
||||
}
|
||||
},
|
||||
expose:0.2
|
||||
}
|
||||
}
|
||||
},
|
||||
translate:{
|
||||
nianshou:'年兽',
|
||||
nianrui:'年瑞',
|
||||
qixiang:'祺祥',
|
||||
qixiang1:'祺祥',
|
||||
|
@ -323,20 +323,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
manjia_info:'锁定技,若你的装备区内没有防具牌,则你视为装备了[藤甲]',
|
||||
xiaoshou:'枭首',
|
||||
xiaoshou_info:'结束阶段,若场上体力值最多的角色只有一个,你可以对其造成一点火焰伤害',
|
||||
guiji:'诡计',
|
||||
guiji_info:'锁定技,准备阶段结束时,若你的判定区内有牌,你随机弃置其中一张牌',
|
||||
guiji:'诡计',
|
||||
guiji_info:'锁定技,准备阶段结束时,若你的判定区内有牌,你随机弃置其中一张牌',
|
||||
|
||||
baiwuchang:'白无常',
|
||||
qiangzheng:'强征',
|
||||
qiangzheng_info:'锁定技,结束阶段,你获得一名其他角色的一张手牌',
|
||||
zuijiu:'醉酒',
|
||||
zuijiu_info:'锁定技,你的黑杀造成的伤害+1,造成伤害后须弃置一张手牌',
|
||||
baiwuchang:'白无常',
|
||||
qiangzheng:'强征',
|
||||
qiangzheng_info:'锁定技,结束阶段,你获得一名其他角色的一张手牌',
|
||||
zuijiu:'醉酒',
|
||||
zuijiu_info:'锁定技,你的黑杀造成的伤害+1,造成伤害后须弃置一张手牌',
|
||||
|
||||
heiwuchang:'黑无常',
|
||||
suoling:'索令',
|
||||
suoling_info:'锁定技,结束阶段,你解除横置状态,除你之外的所有角色进入横置状态',
|
||||
xixing:'吸星',
|
||||
xixing_info:'出牌阶段限一次,你可以弃置三张不同类别的牌,对一名其他角色造成一点伤害,然后回复一点体力',
|
||||
},
|
||||
heiwuchang:'黑无常',
|
||||
suoling:'索令',
|
||||
suoling_info:'锁定技,结束阶段,你解除横置状态,除你之外的所有角色进入横置状态',
|
||||
xixing:'吸星',
|
||||
xixing_info:'出牌阶段限一次,你可以弃置三张不同类别的牌,对一名其他角色造成一点伤害,然后回复一点体力',
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
@ -3,95 +3,95 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
return {
|
||||
name:'cardpile',
|
||||
arenaReady:function(){
|
||||
var data={
|
||||
total:160,
|
||||
sha:{
|
||||
diamond:6,
|
||||
club:14,
|
||||
heart:3,
|
||||
spade:7,
|
||||
},
|
||||
huosha:{
|
||||
diamond:2,
|
||||
heart:3
|
||||
},
|
||||
leisha:{
|
||||
spade:5,
|
||||
club:4
|
||||
},
|
||||
shan:{
|
||||
heart:6,
|
||||
diamond:18
|
||||
},
|
||||
jiu:{
|
||||
diamond:1,
|
||||
spade:2,
|
||||
club:2
|
||||
},
|
||||
tao:{
|
||||
heart:9,
|
||||
diamond:3,
|
||||
},
|
||||
wanjian:{
|
||||
heart:1,
|
||||
},
|
||||
nanman:{
|
||||
spade:2,
|
||||
club:1,
|
||||
},
|
||||
guohe:{
|
||||
spade:3,
|
||||
club:2,
|
||||
heart:1
|
||||
},
|
||||
shunshou:{
|
||||
spade:3,
|
||||
diamond:2
|
||||
},
|
||||
wuxie:{
|
||||
heart:2,
|
||||
diamond:1,
|
||||
spade:2,
|
||||
club:2
|
||||
},
|
||||
tiesuo:{
|
||||
spade:2,
|
||||
club:4
|
||||
}
|
||||
}
|
||||
var rand=function(){
|
||||
return Math.ceil(Math.random()*13);
|
||||
};
|
||||
var data={
|
||||
total:160,
|
||||
sha:{
|
||||
diamond:6,
|
||||
club:14,
|
||||
heart:3,
|
||||
spade:7,
|
||||
},
|
||||
huosha:{
|
||||
diamond:2,
|
||||
heart:3
|
||||
},
|
||||
leisha:{
|
||||
spade:5,
|
||||
club:4
|
||||
},
|
||||
shan:{
|
||||
heart:6,
|
||||
diamond:18
|
||||
},
|
||||
jiu:{
|
||||
diamond:1,
|
||||
spade:2,
|
||||
club:2
|
||||
},
|
||||
tao:{
|
||||
heart:9,
|
||||
diamond:3,
|
||||
},
|
||||
wanjian:{
|
||||
heart:1,
|
||||
},
|
||||
nanman:{
|
||||
spade:2,
|
||||
club:1,
|
||||
},
|
||||
guohe:{
|
||||
spade:3,
|
||||
club:2,
|
||||
heart:1
|
||||
},
|
||||
shunshou:{
|
||||
spade:3,
|
||||
diamond:2
|
||||
},
|
||||
wuxie:{
|
||||
heart:2,
|
||||
diamond:1,
|
||||
spade:2,
|
||||
club:2
|
||||
},
|
||||
tiesuo:{
|
||||
spade:2,
|
||||
club:4
|
||||
}
|
||||
}
|
||||
var rand=function(){
|
||||
return Math.ceil(Math.random()*13);
|
||||
};
|
||||
var getn=function(i,j){
|
||||
return Math.round(data[i][j]*parseFloat(lib.config['cardpile_'+i+'_playpackconfig']));
|
||||
};
|
||||
var num=0;
|
||||
for(var i in data){
|
||||
for(var j in data[i]){
|
||||
num+=getn(i,j);
|
||||
}
|
||||
}
|
||||
var dn=num*(lib.card.list.length-data.total)/(data.total-num);
|
||||
if(dn>1000) dn=1000;
|
||||
if(dn>0){
|
||||
var p=0;
|
||||
for(var i in data){
|
||||
for(var j in data[i]){
|
||||
var n=Math.round(dn*getn(i,j)/num);
|
||||
while(n--){
|
||||
if(i=='huosha'){
|
||||
lib.card.list.push([j,rand(),'sha','fire']);
|
||||
}
|
||||
var num=0;
|
||||
for(var i in data){
|
||||
for(var j in data[i]){
|
||||
num+=getn(i,j);
|
||||
}
|
||||
}
|
||||
var dn=num*(lib.card.list.length-data.total)/(data.total-num);
|
||||
if(dn>1000) dn=1000;
|
||||
if(dn>0){
|
||||
var p=0;
|
||||
for(var i in data){
|
||||
for(var j in data[i]){
|
||||
var n=Math.round(dn*getn(i,j)/num);
|
||||
while(n--){
|
||||
if(i=='huosha'){
|
||||
lib.card.list.push([j,rand(),'sha','fire']);
|
||||
}
|
||||
else if(i=='leisha'){
|
||||
lib.card.list.push([j,rand(),'sha','thunder']);
|
||||
}
|
||||
else{
|
||||
lib.card.list.push([j,rand(),i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
lib.card.list.push([j,rand(),i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
arenaReady:function(){
|
||||
if(_status.video||_status.connectMode) return;
|
||||
if(_status.video||_status.connectMode) return;
|
||||
if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){
|
||||
var str;
|
||||
if(lib.config.coin_display_playpackconfig=='text'){
|
||||
|
@ -106,7 +106,7 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
return uiintro;
|
||||
},220,400);
|
||||
}
|
||||
},
|
||||
},
|
||||
game:{
|
||||
changeCoin:function(num){
|
||||
if(typeof num=='number'&&ui.coin){
|
||||
|
@ -299,21 +299,21 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
//******************************************************
|
||||
// Yet Another Particle Engine
|
||||
var cos = Math.cos,
|
||||
sin = Math.sin,
|
||||
sqrt = Math.sqrt,
|
||||
abs = Math.abs,
|
||||
atan2 = Math.atan2,
|
||||
log = Math.log,
|
||||
random = Math.random,
|
||||
PI = Math.PI,
|
||||
sqr = function(v){return v*v;},
|
||||
particles = [],
|
||||
drawScale = 1,
|
||||
emitters = [],
|
||||
forces = [],
|
||||
collidedMass = 0,
|
||||
maxParticles = 100,
|
||||
emissionRate = 1,
|
||||
sin = Math.sin,
|
||||
sqrt = Math.sqrt,
|
||||
abs = Math.abs,
|
||||
atan2 = Math.atan2,
|
||||
log = Math.log,
|
||||
random = Math.random,
|
||||
PI = Math.PI,
|
||||
sqr = function(v){return v*v;},
|
||||
particles = [],
|
||||
drawScale = 1,
|
||||
emitters = [],
|
||||
forces = [],
|
||||
collidedMass = 0,
|
||||
maxParticles = 100,
|
||||
emissionRate = 1,
|
||||
minParticleSize = 2;
|
||||
|
||||
//-------------------------------------------------------
|
||||
|
@ -325,65 +325,65 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
Vector.prototype = {
|
||||
add : function(vector) {
|
||||
this.x += vector.x;
|
||||
this.y += vector.y;
|
||||
this.z += vector.z;
|
||||
return this;
|
||||
this.x += vector.x;
|
||||
this.y += vector.y;
|
||||
this.z += vector.z;
|
||||
return this;
|
||||
},
|
||||
subtract : function(vector) {
|
||||
this.x -= vector.x;
|
||||
this.y -= vector.y;
|
||||
this.z -= vector.z;
|
||||
return this;
|
||||
this.x -= vector.x;
|
||||
this.y -= vector.y;
|
||||
this.z -= vector.z;
|
||||
return this;
|
||||
},
|
||||
multiply : function(another) {
|
||||
this.x /= another.x;
|
||||
this.y /= another.y;
|
||||
this.z /= another.z;
|
||||
return this;
|
||||
this.x /= another.x;
|
||||
this.y /= another.y;
|
||||
this.z /= another.z;
|
||||
return this;
|
||||
},
|
||||
divide : function(another) {
|
||||
this.x /= another.x;
|
||||
this.y /= another.y;
|
||||
this.z /= another.z;
|
||||
return this;
|
||||
this.x /= another.x;
|
||||
this.y /= another.y;
|
||||
this.z /= another.z;
|
||||
return this;
|
||||
},
|
||||
scale : function(factor) {
|
||||
this.x *= factor;
|
||||
this.y *= factor;
|
||||
this.z *= factor;
|
||||
return this;
|
||||
this.x *= factor;
|
||||
this.y *= factor;
|
||||
this.z *= factor;
|
||||
return this;
|
||||
},
|
||||
magnitude : function () {
|
||||
return sqrt(sqr(this.x + this.y));
|
||||
return sqrt(sqr(this.x + this.y));
|
||||
},
|
||||
distance : function (another) {
|
||||
return abs(sqrt(sqr(this.x - another.x) + sqr(this.y - another.y)));
|
||||
return abs(sqrt(sqr(this.x - another.x) + sqr(this.y - another.y)));
|
||||
},
|
||||
angle : function (angle, magnitude) {
|
||||
if(angle && magnitude)
|
||||
return Vector.fromAngle(angle, magnitude);
|
||||
return atan2(this.y, this.x);
|
||||
if(angle && magnitude)
|
||||
return Vector.fromAngle(angle, magnitude);
|
||||
return atan2(this.y, this.x);
|
||||
},
|
||||
clone : function() {
|
||||
return new Vector(this.x, this.y, this.z);
|
||||
return new Vector(this.x, this.y, this.z);
|
||||
},
|
||||
equals : function(another) {
|
||||
return this.x === another.x&&
|
||||
return this.x === another.x&&
|
||||
this.y === another.y&&
|
||||
this.z === another.z;
|
||||
},
|
||||
random : function(r) {
|
||||
this.x += (random() * r * 2) - r;
|
||||
this.y += (random() * r * 2) - r;
|
||||
return this;
|
||||
this.x += (random() * r * 2) - r;
|
||||
this.y += (random() * r * 2) - r;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
Vector.fromAngle = function (angle, magnitude) {
|
||||
return new Vector(
|
||||
magnitude * cos(angle),
|
||||
magnitude * sin(angle),
|
||||
magnitude * sin(angle));
|
||||
magnitude * cos(angle),
|
||||
magnitude * sin(angle),
|
||||
magnitude * sin(angle));
|
||||
};
|
||||
|
||||
//******************************************************
|
||||
|
@ -404,41 +404,41 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
var totalAccelerationY = 0;
|
||||
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
var field = fields[i];
|
||||
var vectorX = field.pos.x - this.pos.x;
|
||||
var vectorY = field.pos.y - this.pos.y;
|
||||
var distance = this.pos.distance(field.pos);
|
||||
if(distance < 1) field.grow(this);
|
||||
if(distance < 100) this.doubleSize = true;
|
||||
var force = G(this.forceBetween(field, distance));
|
||||
totalAccelerationX += vectorX * force;
|
||||
totalAccelerationY += vectorY * force;
|
||||
var field = fields[i];
|
||||
var vectorX = field.pos.x - this.pos.x;
|
||||
var vectorY = field.pos.y - this.pos.y;
|
||||
var distance = this.pos.distance(field.pos);
|
||||
if(distance < 1) field.grow(this);
|
||||
if(distance < 100) this.doubleSize = true;
|
||||
var force = G(this.forceBetween(field, distance));
|
||||
totalAccelerationX += vectorX * force;
|
||||
totalAccelerationY += vectorY * force;
|
||||
}
|
||||
this.ac = new Vector(totalAccelerationX, totalAccelerationY);
|
||||
|
||||
totalAccelerationX = 0;
|
||||
totalAccelerationY = 0;
|
||||
for (var i = 0; i < particles.length; i++) {
|
||||
var field = particles[i];
|
||||
if(field === this || !field.alive) continue;
|
||||
var vectorX = field.pos.x - this.pos.x;
|
||||
var vectorY = field.pos.y - this.pos.y;
|
||||
var distance = this.pos.distance(field.pos);
|
||||
if(distance < 1) {
|
||||
if(this.mass >= field.mass) {
|
||||
var massRatio = this.mass / field.mass;
|
||||
if(particles.length <= maxParticles && this.mass>40) {
|
||||
this.alive = false;
|
||||
this.nova = true;
|
||||
collidedMass += this.mass;
|
||||
} else this.grow(field);
|
||||
} else this.alive = false;
|
||||
}
|
||||
if(this.alive) {
|
||||
var force = G(this.forceBetween(field, distance));
|
||||
totalAccelerationX += vectorX * G(force);
|
||||
totalAccelerationY += vectorY * G(force);
|
||||
}
|
||||
var field = particles[i];
|
||||
if(field === this || !field.alive) continue;
|
||||
var vectorX = field.pos.x - this.pos.x;
|
||||
var vectorY = field.pos.y - this.pos.y;
|
||||
var distance = this.pos.distance(field.pos);
|
||||
if(distance < 1) {
|
||||
if(this.mass >= field.mass) {
|
||||
var massRatio = this.mass / field.mass;
|
||||
if(particles.length <= maxParticles && this.mass>40) {
|
||||
this.alive = false;
|
||||
this.nova = true;
|
||||
collidedMass += this.mass;
|
||||
} else this.grow(field);
|
||||
} else this.alive = false;
|
||||
}
|
||||
if(this.alive) {
|
||||
var force = G(this.forceBetween(field, distance));
|
||||
totalAccelerationX += vectorX * G(force);
|
||||
totalAccelerationY += vectorY * G(force);
|
||||
}
|
||||
}
|
||||
|
||||
var travelDist = this.pos.distance(this.lastPos ? this.lastPos : this.pos);
|
||||
|
@ -471,12 +471,12 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
var remainingMass = this.mass;
|
||||
var num = 0;
|
||||
while(remainingMass > 0) {
|
||||
var np = new Particle(this.pos.clone().random(this.mass), new Vector(0,0));
|
||||
np.mass = 1 + Math.random() * (remainingMass - 1);
|
||||
if(num>=maxParts-1) np.mass = remainingMass;
|
||||
np.mass = np.mass < minMass ? minMass : np.mass;
|
||||
remainingMass -= np.mass;
|
||||
num++;
|
||||
var np = new Particle(this.pos.clone().random(this.mass), new Vector(0,0));
|
||||
np.mass = 1 + Math.random() * (remainingMass - 1);
|
||||
if(num>=maxParts-1) np.mass = remainingMass;
|
||||
np.mass = np.mass < minMass ? minMass : np.mass;
|
||||
remainingMass -= np.mass;
|
||||
num++;
|
||||
}
|
||||
this.nova = true;
|
||||
delete this.size;
|
||||
|
@ -498,14 +498,14 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
ParticleEmitter.prototype.emit = function() {
|
||||
var angle = this.vc.angle() +
|
||||
this.ang - (Math.random() * this.ang * 2);
|
||||
this.ang - (Math.random() * this.ang * 2);
|
||||
var magnitude = this.vc.magnitude();
|
||||
var position = this.pos.clone();
|
||||
position.add(
|
||||
new Vector(
|
||||
~~((Math.random() * 100) - 50) * drawScale,
|
||||
~~((Math.random() * 100) - 50) * drawScale
|
||||
));
|
||||
position.add(
|
||||
new Vector(
|
||||
~~((Math.random() * 100) - 50) * drawScale,
|
||||
~~((Math.random() * 100) - 50) * drawScale
|
||||
));
|
||||
var velocity = Vector.fromAngle(angle, magnitude);
|
||||
return new Particle(position,velocity);
|
||||
};
|
||||
|
@ -546,11 +546,11 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
});
|
||||
|
||||
var renderToCanvas = function (width, height, renderFunction) {
|
||||
var buffer = document.createElement('canvas');
|
||||
buffer.width = width;
|
||||
buffer.height = height;
|
||||
renderFunction(buffer.getContext('2d'));
|
||||
return buffer;
|
||||
var buffer = document.createElement('canvas');
|
||||
buffer.width = width;
|
||||
buffer.height = height;
|
||||
renderFunction(buffer.getContext('2d'));
|
||||
return buffer;
|
||||
};
|
||||
|
||||
maxParticles = 500;
|
||||
|
@ -560,12 +560,12 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
emitters = [
|
||||
//br
|
||||
new ParticleEmitter(
|
||||
new Vector(
|
||||
canvasWidth / 2 * drawScale + 400,
|
||||
canvasHeight / 2 * drawScale
|
||||
),
|
||||
Vector.fromAngle(2, 5),
|
||||
1
|
||||
new Vector(
|
||||
canvasWidth / 2 * drawScale + 400,
|
||||
canvasHeight / 2 * drawScale
|
||||
),
|
||||
Vector.fromAngle(2, 5),
|
||||
1
|
||||
),
|
||||
// // bl
|
||||
// new ParticleEmitter(
|
||||
|
@ -576,14 +576,14 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
// Vector.fromAngle(1.5, 1),
|
||||
// 1
|
||||
// ),
|
||||
// tl
|
||||
// tl
|
||||
new ParticleEmitter(
|
||||
new Vector(
|
||||
canvasWidth / 2 * drawScale - 400,
|
||||
canvasHeight / 2 * drawScale
|
||||
),
|
||||
Vector.fromAngle(5, 5),
|
||||
1
|
||||
new Vector(
|
||||
canvasWidth / 2 * drawScale - 400,
|
||||
canvasHeight / 2 * drawScale
|
||||
),
|
||||
Vector.fromAngle(5, 5),
|
||||
1
|
||||
),
|
||||
// // tr
|
||||
// new ParticleEmitter(
|
||||
|
@ -597,8 +597,8 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
];
|
||||
forces = [
|
||||
new Force(
|
||||
new Vector((canvasWidth / 2 * drawScale) ,
|
||||
(canvasHeight / 2 * drawScale)), 1800)
|
||||
new Vector((canvasWidth / 2 * drawScale) ,
|
||||
(canvasHeight / 2 * drawScale)), 1800)
|
||||
];
|
||||
|
||||
var loop=function() {
|
||||
|
@ -635,35 +635,35 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
var c2 = 'rgba(255,64,32,';
|
||||
var addNewParticles=function() {
|
||||
var _emit = function() {
|
||||
var ret = 0;
|
||||
for (var i = 0; i < emitters.length; i++) {
|
||||
for (var j = 0; j < emissionRate; j++) {
|
||||
var p = emitters[i].emit();
|
||||
p.color = ( ctr % 10 === 0 )?
|
||||
var ret = 0;
|
||||
for (var i = 0; i < emitters.length; i++) {
|
||||
for (var j = 0; j < emissionRate; j++) {
|
||||
var p = emitters[i].emit();
|
||||
p.color = ( ctr % 10 === 0 )?
|
||||
( Math.random() * 5 <= 1 ? c2 : rndc() )
|
||||
: rndc();
|
||||
p.mass = ~~(Math.random() * 5);
|
||||
particles.push(p);
|
||||
ret += p.mass;
|
||||
ctr++;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
: rndc();
|
||||
p.mass = ~~(Math.random() * 5);
|
||||
particles.push(p);
|
||||
ret += p.mass;
|
||||
ctr++;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
if(collidedMass !== 0) {
|
||||
while(collidedMass !== 0) {
|
||||
collidedMass -= _emit();
|
||||
collidedMass = collidedMass<0 ? 0 :collidedMass;
|
||||
}
|
||||
while(collidedMass !== 0) {
|
||||
collidedMass -= _emit();
|
||||
collidedMass = collidedMass<0 ? 0 :collidedMass;
|
||||
}
|
||||
}
|
||||
if (particles.length > maxParticles)
|
||||
return;
|
||||
return;
|
||||
_emit();
|
||||
}
|
||||
|
||||
var CLIPOFFSCREEN = 1,
|
||||
BUFFEROFFSCREEN = 2,
|
||||
LOOPSCREEN = 3;
|
||||
BUFFEROFFSCREEN = 2,
|
||||
LOOPSCREEN = 3;
|
||||
|
||||
var isPositionAliveAndAdjust=function(particle,check) {
|
||||
return true;
|
||||
|
@ -693,77 +693,77 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
var plotParticles=function(boundsX, boundsY) {
|
||||
var currentParticles = [];
|
||||
for (var i = 0; i < particles.length; i++) {
|
||||
var particle = particles[i];
|
||||
particle.reactToForces(forces);
|
||||
if(!isPositionAliveAndAdjust(particle))
|
||||
continue;
|
||||
particle.move();
|
||||
currentParticles.push(particle);
|
||||
var particle = particles[i];
|
||||
particle.reactToForces(forces);
|
||||
if(!isPositionAliveAndAdjust(particle))
|
||||
continue;
|
||||
particle.move();
|
||||
currentParticles.push(particle);
|
||||
}
|
||||
}
|
||||
|
||||
var offscreenCache = {};
|
||||
var renderParticle=function(p) {
|
||||
var position = p.pos;
|
||||
if(!p.size) p.size = Math.floor(p.mass / 100);
|
||||
var position = p.pos;
|
||||
if(!p.size) p.size = Math.floor(p.mass / 100);
|
||||
|
||||
|
||||
if(!p.opacity) p.opacity = 0.05;
|
||||
if(p.velocity > 0) {
|
||||
if(p.opacity<=0.18)
|
||||
p.opacity += 0.04;
|
||||
}
|
||||
if(p.opacity>0.08)
|
||||
p.opacity -= 0.02;
|
||||
if(!p.opacity) p.opacity = 0.05;
|
||||
if(p.velocity > 0) {
|
||||
if(p.opacity<=0.18)
|
||||
p.opacity += 0.04;
|
||||
}
|
||||
if(p.opacity>0.08)
|
||||
p.opacity -= 0.02;
|
||||
|
||||
var actualSize = p.size / drawScale;
|
||||
actualSize = actualSize < minParticleSize ? minParticleSize : actualSize;
|
||||
if(p.mass>8) actualSize *= 2;
|
||||
if(p.nova) {
|
||||
actualSize *= 4;
|
||||
p.nova = false;
|
||||
}
|
||||
if(p.doubleSize) {
|
||||
p.doubleSize = false;
|
||||
actualSize *= 2;
|
||||
}
|
||||
// if(p.supernova) {
|
||||
// actualSize *= 6;
|
||||
// opacity = 0.15;
|
||||
// p.supernovaDur = p.supernovaDur - 1;
|
||||
// if(p.supernovaDur === 0)
|
||||
// p.supernova = false;
|
||||
// }
|
||||
var cacheKey = actualSize + '_' + p.opacity + '_' + p.color;
|
||||
var cacheValue = offscreenCache[cacheKey];
|
||||
if(!cacheValue) {
|
||||
cacheValue = renderToCanvas(actualSize * 32, actualSize * 32, function(ofsContext) {
|
||||
var opacity = p.opacity;
|
||||
var fills = [
|
||||
{size:actualSize/2, opacity:1},
|
||||
{size:actualSize, opacity:opacity},
|
||||
{size:actualSize * 2, opacity:opacity / 2},
|
||||
{size:actualSize * 4, opacity:opacity / 3},
|
||||
{size:actualSize * 8, opacity:opacity / 5},
|
||||
{size:actualSize * 16, opacity:opacity / 16}
|
||||
];
|
||||
ofsContext.beginPath();
|
||||
for(var f in fills) {
|
||||
f = fills[f];
|
||||
ofsContext.fillStyle = p.color + f.opacity + ')';
|
||||
ofsContext.arc(
|
||||
actualSize * 16,
|
||||
actualSize * 16,
|
||||
f.size , 0, Math.PI*2, true);
|
||||
ofsContext.fill();
|
||||
}
|
||||
ofsContext.closePath();
|
||||
});
|
||||
offscreenCache[cacheKey] = cacheValue;
|
||||
}
|
||||
var posX = p.pos.x / drawScale;
|
||||
var posY = p.pos.y / drawScale;
|
||||
ctx.drawImage(cacheValue, posX, posY);
|
||||
var actualSize = p.size / drawScale;
|
||||
actualSize = actualSize < minParticleSize ? minParticleSize : actualSize;
|
||||
if(p.mass>8) actualSize *= 2;
|
||||
if(p.nova) {
|
||||
actualSize *= 4;
|
||||
p.nova = false;
|
||||
}
|
||||
if(p.doubleSize) {
|
||||
p.doubleSize = false;
|
||||
actualSize *= 2;
|
||||
}
|
||||
// if(p.supernova) {
|
||||
// actualSize *= 6;
|
||||
// opacity = 0.15;
|
||||
// p.supernovaDur = p.supernovaDur - 1;
|
||||
// if(p.supernovaDur === 0)
|
||||
// p.supernova = false;
|
||||
// }
|
||||
var cacheKey = actualSize + '_' + p.opacity + '_' + p.color;
|
||||
var cacheValue = offscreenCache[cacheKey];
|
||||
if(!cacheValue) {
|
||||
cacheValue = renderToCanvas(actualSize * 32, actualSize * 32, function(ofsContext) {
|
||||
var opacity = p.opacity;
|
||||
var fills = [
|
||||
{size:actualSize/2, opacity:1},
|
||||
{size:actualSize, opacity:opacity},
|
||||
{size:actualSize * 2, opacity:opacity / 2},
|
||||
{size:actualSize * 4, opacity:opacity / 3},
|
||||
{size:actualSize * 8, opacity:opacity / 5},
|
||||
{size:actualSize * 16, opacity:opacity / 16}
|
||||
];
|
||||
ofsContext.beginPath();
|
||||
for(var f in fills) {
|
||||
f = fills[f];
|
||||
ofsContext.fillStyle = p.color + f.opacity + ')';
|
||||
ofsContext.arc(
|
||||
actualSize * 16,
|
||||
actualSize * 16,
|
||||
f.size , 0, Math.PI*2, true);
|
||||
ofsContext.fill();
|
||||
}
|
||||
ofsContext.closePath();
|
||||
});
|
||||
offscreenCache[cacheKey] = cacheValue;
|
||||
}
|
||||
var posX = p.pos.x / drawScale;
|
||||
var posY = p.pos.y / drawScale;
|
||||
ctx.drawImage(cacheValue, posX, posY);
|
||||
}
|
||||
|
||||
var fills = [
|
||||
|
@ -773,27 +773,27 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
|
||||
var renderScene=function(ofsContext) {
|
||||
for (var i = 0; i < forces.length; i++) {
|
||||
var p = forces[i];
|
||||
var position = p.pos;
|
||||
var opacity = 1;
|
||||
var p = forces[i];
|
||||
var position = p.pos;
|
||||
var opacity = 1;
|
||||
|
||||
ofsContext.beginPath();
|
||||
for(var f in fills) {
|
||||
f = fills[f];
|
||||
var o = p.burp === true ? 1 : f.opacity;
|
||||
p.burp = false;
|
||||
// ofsContext.fillStyle = 'rgba(255,255,255,' + o + ')';
|
||||
// ofsContext.arc(position.x / drawScale,
|
||||
// position.y / drawScale,
|
||||
// f.size / drawScale, 0, Math.PI*2, true);
|
||||
// ofsContext.fill();
|
||||
}
|
||||
ofsContext.closePath();
|
||||
ofsContext.beginPath();
|
||||
for(var f in fills) {
|
||||
f = fills[f];
|
||||
var o = p.burp === true ? 1 : f.opacity;
|
||||
p.burp = false;
|
||||
// ofsContext.fillStyle = 'rgba(255,255,255,' + o + ')';
|
||||
// ofsContext.arc(position.x / drawScale,
|
||||
// position.y / drawScale,
|
||||
// f.size / drawScale, 0, Math.PI*2, true);
|
||||
// ofsContext.fill();
|
||||
}
|
||||
ofsContext.closePath();
|
||||
}
|
||||
|
||||
for (var i = 0; i < particles.length; i++) {
|
||||
var p = particles[i];
|
||||
renderParticle(p);
|
||||
var p = particles[i];
|
||||
renderParticle(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -933,7 +933,7 @@ game.import('play',function(lib,game,ui,get,ai,_status){
|
|||
|
||||
flakeMove.prototype.update = function() {
|
||||
var x = this.x,
|
||||
y = this.y;
|
||||
y = this.y;
|
||||
|
||||
// 左右摆动(余弦)
|
||||
this.velX *= 0.98;
|
||||
|
|
124
game/asset.js
124
game/asset.js
|
@ -1,66 +1,66 @@
|
|||
(function(){
|
||||
if(typeof require !== 'function'||typeof document !== 'undefined') return;
|
||||
global.window=global;
|
||||
require(__dirname+'/update.js');
|
||||
var fs=require('fs');
|
||||
var path=require('path');
|
||||
fs.readFile('game/asset.js','utf-8',function(err, current){
|
||||
var assetlist='\t\''+window.noname_update.version+'\'';
|
||||
var skinlist='\nwindow.noname_skin_list={\n';
|
||||
var get = function(dir,callback){
|
||||
fs.readdir(dir,function(err,list){
|
||||
var shift=function(){
|
||||
if(list.length){
|
||||
var filename=list.shift();
|
||||
var delay=false;
|
||||
if(!/\.|~|_/.test(filename[0])){
|
||||
var url=dir+'/'+filename;
|
||||
var stat=fs.statSync(url);
|
||||
if(stat.isFile()){
|
||||
if(['.jpg','.png','.mp3','.ttf'].indexOf(path.extname(url))!=-1){
|
||||
assetlist+=',\n\t\''+path.relative(path.dirname(__dirname),url)+'\'';
|
||||
}
|
||||
}
|
||||
else if(stat.isDirectory()){
|
||||
if(dir==path.dirname(__dirname)+'/image/skin'){
|
||||
fs.readdir(url,function(err,list){
|
||||
var num=0;
|
||||
for(var i=0;i<list.length;i++){
|
||||
var url2=url+'/'+list[i];
|
||||
var stat=fs.statSync(url2);
|
||||
if(stat.isFile()&&path.extname(url2)=='.jpg'){
|
||||
num++;
|
||||
}
|
||||
}
|
||||
skinlist+='\t'+filename+':'+num+',\n';
|
||||
shift();
|
||||
});
|
||||
delay=true;
|
||||
}
|
||||
else{
|
||||
get(url,shift);
|
||||
delay=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!delay){
|
||||
shift();
|
||||
}
|
||||
}
|
||||
else{
|
||||
callback();
|
||||
}
|
||||
}
|
||||
shift();
|
||||
});
|
||||
};
|
||||
get(path.dirname(__dirname),function(){
|
||||
current=current.slice(0,current.lastIndexOf('window.noname_asset_list=[')+26);
|
||||
fs.writeFile('game/asset.js',current+'\n'+assetlist+'\n];'+skinlist.slice(0,skinlist.length-2)+'\n};','utf-8',function(){
|
||||
console.log('done');
|
||||
});
|
||||
});
|
||||
});
|
||||
if(typeof require !== 'function'||typeof document !== 'undefined') return;
|
||||
global.window=global;
|
||||
require(__dirname+'/update.js');
|
||||
var fs=require('fs');
|
||||
var path=require('path');
|
||||
fs.readFile('game/asset.js','utf-8',function(err, current){
|
||||
var assetlist='\t\''+window.noname_update.version+'\'';
|
||||
var skinlist='\nwindow.noname_skin_list={\n';
|
||||
var get = function(dir,callback){
|
||||
fs.readdir(dir,function(err,list){
|
||||
var shift=function(){
|
||||
if(list.length){
|
||||
var filename=list.shift();
|
||||
var delay=false;
|
||||
if(!/\.|~|_/.test(filename[0])){
|
||||
var url=dir+'/'+filename;
|
||||
var stat=fs.statSync(url);
|
||||
if(stat.isFile()){
|
||||
if(['.jpg','.png','.mp3','.ttf'].indexOf(path.extname(url))!=-1){
|
||||
assetlist+=',\n\t\''+path.relative(path.dirname(__dirname),url)+'\'';
|
||||
}
|
||||
}
|
||||
else if(stat.isDirectory()){
|
||||
if(dir==path.dirname(__dirname)+'/image/skin'){
|
||||
fs.readdir(url,function(err,list){
|
||||
var num=0;
|
||||
for(var i=0;i<list.length;i++){
|
||||
var url2=url+'/'+list[i];
|
||||
var stat=fs.statSync(url2);
|
||||
if(stat.isFile()&&path.extname(url2)=='.jpg'){
|
||||
num++;
|
||||
}
|
||||
}
|
||||
skinlist+='\t'+filename+':'+num+',\n';
|
||||
shift();
|
||||
});
|
||||
delay=true;
|
||||
}
|
||||
else{
|
||||
get(url,shift);
|
||||
delay=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!delay){
|
||||
shift();
|
||||
}
|
||||
}
|
||||
else{
|
||||
callback();
|
||||
}
|
||||
}
|
||||
shift();
|
||||
});
|
||||
};
|
||||
get(path.dirname(__dirname),function(){
|
||||
current=current.slice(0,current.lastIndexOf('window.noname_asset_list=[')+26);
|
||||
fs.writeFile('game/asset.js',current+'\n'+assetlist+'\n];'+skinlist.slice(0,skinlist.length-2)+'\n};','utf-8',function(){
|
||||
console.log('done');
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
window.noname_asset_list=[
|
||||
|
|
18
game/game.js
18
game/game.js
|
@ -6534,7 +6534,9 @@
|
|||
game.saveConfigValue('brokenFile');
|
||||
if(!lib.node.http) lib.node.http=require('http');
|
||||
if(!lib.node.https) lib.node.https=require('https');
|
||||
var request = (url.indexOf('https')==0?lib.node.https:lib.node.http).get(encodeURI(url), function(response) {
|
||||
var opts = require('url').parse(encodeURI(url));
|
||||
opts.headers={'User-Agent': navigator.userAgent};
|
||||
var request = (url.indexOf('https')==0?lib.node.https:lib.node.http).get(opts, function(response) {
|
||||
var stream=response.pipe(file);
|
||||
stream.on('finish',function(){
|
||||
lib.config.brokenFile.remove(folder);
|
||||
|
@ -28630,6 +28632,13 @@
|
|||
}
|
||||
return;
|
||||
}
|
||||
if(info.available&&info.available(mode)==false){
|
||||
lib.skill[i]={};
|
||||
if(lib.translate[i+'_info']){
|
||||
lib.translate[i+'_info']='此模式下不可用';
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(info.viewAs){
|
||||
if(typeof info.viewAs=='string'){
|
||||
info.viewAs={name:info.viewAs};
|
||||
|
@ -35873,7 +35882,7 @@
|
|||
else{
|
||||
updatep1.style.display='';
|
||||
updatep2.style.display='';
|
||||
updatep3.style.display='none'; // coding
|
||||
// updatep3.style.display='none'; // coding
|
||||
updatepx.style.display='none';
|
||||
updatep4.innerHTML='更新';
|
||||
}
|
||||
|
@ -35897,7 +35906,7 @@
|
|||
|
||||
var button6=document.createElement('button');
|
||||
button6.innerHTML='设为国内镜像';
|
||||
button6.style.display='none';// coding
|
||||
// button6.style.display='none';// coding
|
||||
// button6.style.marginLeft='5px';
|
||||
button6.onclick=function(){
|
||||
game.saveConfig('updateURL',lib.mirrorURL);
|
||||
|
@ -44129,6 +44138,9 @@
|
|||
if(method=='trick'&&lib.card[obj.name].type=='delay') return 'trick';
|
||||
return lib.card[obj.name].type;
|
||||
},
|
||||
type2:function(card){
|
||||
return get.type(card,'trick');
|
||||
},
|
||||
subtype:function(obj){
|
||||
if(typeof obj=='string') obj={name:obj};
|
||||
if(typeof obj!='object') return;
|
||||
|
|
156
game/http.js
156
game/http.js
|
@ -3,85 +3,85 @@ var fs = require('fs');
|
|||
var server = new http.Server();
|
||||
server.listen(80);
|
||||
server.on('request', function(request, response) {
|
||||
var url = require('url').parse(request.url);
|
||||
switch(url.pathname) {
|
||||
case ''||'/' :
|
||||
fs.readFile('./index.html', function(err, content){
|
||||
if(err) {
|
||||
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' });
|
||||
response.write(err.message);
|
||||
response.end();
|
||||
} else {
|
||||
response.writeHead(200, { 'Content-Type' : 'text/html; charset=UTF-8' });
|
||||
response.write(content);
|
||||
response.end();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '/test/delay':
|
||||
var delay = parseInt(url.query) || 2000;
|
||||
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'});
|
||||
response.write('Sleeping for' + delay + ' milliseconds...');
|
||||
setTimeout(function(){
|
||||
response.write('done.');
|
||||
response.end();
|
||||
}, delay);
|
||||
break;
|
||||
case '/test/mirror':
|
||||
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'});
|
||||
response.write(request.mothod + ' ' + request.url + ' HTTP/' + request.httpVersion + '\r\n');
|
||||
for (var h in request.headers) {
|
||||
response.write(h + ':' + request.headers[h] + '\r\n');
|
||||
}
|
||||
response.write('\r\n');
|
||||
request.on('data', function(chunk) { response.write(chunk); });
|
||||
request.on('end', function(chunk){ response.end(); });
|
||||
break;
|
||||
case '/json' :
|
||||
response.writeHead(200, {'Content-type':'application/json; charset=UTF-8'});
|
||||
response.write(JSON.stringify({test:'success'}));
|
||||
response.end();
|
||||
break;
|
||||
default:
|
||||
var filename = url.pathname.substring(1);
|
||||
var type = getType(filename.substring(filename.lastIndexOf('.')+1));
|
||||
fs.readFile(filename, function(err, content){
|
||||
if(err) {
|
||||
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' });
|
||||
response.write(err.message);
|
||||
response.end();
|
||||
} else {
|
||||
response.writeHead(200, { 'Content-Type' : type });
|
||||
response.write(content);
|
||||
response.end();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
var url = require('url').parse(request.url);
|
||||
switch(url.pathname) {
|
||||
case ''||'/' :
|
||||
fs.readFile('./index.html', function(err, content){
|
||||
if(err) {
|
||||
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' });
|
||||
response.write(err.message);
|
||||
response.end();
|
||||
} else {
|
||||
response.writeHead(200, { 'Content-Type' : 'text/html; charset=UTF-8' });
|
||||
response.write(content);
|
||||
response.end();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case '/test/delay':
|
||||
var delay = parseInt(url.query) || 2000;
|
||||
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'});
|
||||
response.write('Sleeping for' + delay + ' milliseconds...');
|
||||
setTimeout(function(){
|
||||
response.write('done.');
|
||||
response.end();
|
||||
}, delay);
|
||||
break;
|
||||
case '/test/mirror':
|
||||
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'});
|
||||
response.write(request.mothod + ' ' + request.url + ' HTTP/' + request.httpVersion + '\r\n');
|
||||
for (var h in request.headers) {
|
||||
response.write(h + ':' + request.headers[h] + '\r\n');
|
||||
}
|
||||
response.write('\r\n');
|
||||
request.on('data', function(chunk) { response.write(chunk); });
|
||||
request.on('end', function(chunk){ response.end(); });
|
||||
break;
|
||||
case '/json' :
|
||||
response.writeHead(200, {'Content-type':'application/json; charset=UTF-8'});
|
||||
response.write(JSON.stringify({test:'success'}));
|
||||
response.end();
|
||||
break;
|
||||
default:
|
||||
var filename = url.pathname.substring(1);
|
||||
var type = getType(filename.substring(filename.lastIndexOf('.')+1));
|
||||
fs.readFile(filename, function(err, content){
|
||||
if(err) {
|
||||
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' });
|
||||
response.write(err.message);
|
||||
response.end();
|
||||
} else {
|
||||
response.writeHead(200, { 'Content-Type' : type });
|
||||
response.write(content);
|
||||
response.end();
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
});
|
||||
function getType(endTag){
|
||||
var type=null;
|
||||
switch(endTag){
|
||||
case 'html' :
|
||||
case 'htm' :
|
||||
type = 'text/html; charset=UTF-8';
|
||||
break;
|
||||
case 'js' :
|
||||
type = 'application/javascript; charset="UTF-8"';
|
||||
break;
|
||||
case 'css' :
|
||||
type = 'text/css; charset="UTF-8"';
|
||||
break;
|
||||
case 'txt' :
|
||||
type = 'text/plain; charset="UTF-8"';
|
||||
break;
|
||||
case 'manifest' :
|
||||
type = 'text/cache-manifest; charset="UTF-8"';
|
||||
break;
|
||||
default :
|
||||
type = 'application/octet-stream';
|
||||
break;
|
||||
}
|
||||
return type;
|
||||
var type=null;
|
||||
switch(endTag){
|
||||
case 'html' :
|
||||
case 'htm' :
|
||||
type = 'text/html; charset=UTF-8';
|
||||
break;
|
||||
case 'js' :
|
||||
type = 'application/javascript; charset="UTF-8"';
|
||||
break;
|
||||
case 'css' :
|
||||
type = 'text/css; charset="UTF-8"';
|
||||
break;
|
||||
case 'txt' :
|
||||
type = 'text/plain; charset="UTF-8"';
|
||||
break;
|
||||
case 'manifest' :
|
||||
type = 'text/cache-manifest; charset="UTF-8"';
|
||||
break;
|
||||
default :
|
||||
type = 'application/octet-stream';
|
||||
break;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
|
146
game/package.js
146
game/package.js
|
@ -1,75 +1,75 @@
|
|||
window.noname_package={
|
||||
character:{
|
||||
standard:'标准',
|
||||
shenhua:'神话再临',
|
||||
refresh:'界限突破',
|
||||
yijiang:'一将成名',
|
||||
sp:'SP',
|
||||
extra:'神将',
|
||||
old:'怀旧',
|
||||
diy:'DIY',
|
||||
yxs:'英雄杀',
|
||||
hearth:'炉石传说',
|
||||
gwent:'昆特牌',
|
||||
mtg:'万智牌',
|
||||
ow:'守望先锋',
|
||||
swd:'轩辕剑',
|
||||
gujian:'古剑奇谭',
|
||||
xianjian:'仙剑',
|
||||
},
|
||||
card:{
|
||||
standard:'标准',
|
||||
extra:'军争',
|
||||
sp:'SP',
|
||||
guozhan:'国战',
|
||||
zhenfa:'阵法',
|
||||
yunchou:'运筹帷幄',
|
||||
swd:'轩辕剑',
|
||||
gujian:'古剑奇谭',
|
||||
hearth:'炉石传说',
|
||||
gwent:'昆特牌',
|
||||
},
|
||||
play:{
|
||||
boss:'诸神降临',
|
||||
cardpile:'牌堆补充',
|
||||
wuxing:'五行生克',
|
||||
coin:'富甲天下',
|
||||
},
|
||||
mode:{
|
||||
identity:'身份',
|
||||
guozhan:'国战',
|
||||
versus:'对决',
|
||||
connect:'联机',
|
||||
boss:'挑战',
|
||||
chess:'战棋',
|
||||
tafang:'塔防',
|
||||
stone:'炉石',
|
||||
brawl:'乱斗',
|
||||
},
|
||||
background:{
|
||||
ol_bg:'龙纹',
|
||||
zhulin_bg:'竹林',
|
||||
shengshi_bg:'盛世',
|
||||
taoyuan_bg:'桃园',
|
||||
zhanhuo_bg:'战火',
|
||||
huangtian_bg:'黄天',
|
||||
september_bg:'九月',
|
||||
yinxiang_bg:'印象',
|
||||
},
|
||||
music:{
|
||||
music_diaochan:'貂蝉',
|
||||
music_shezhan:'舌战',
|
||||
music_danji:'单骑',
|
||||
},
|
||||
font:{
|
||||
xiaozhuan:'小篆',
|
||||
xinwei:'新魏',
|
||||
huangcao:'黄草',
|
||||
lishu:'隶书',
|
||||
},
|
||||
theme:{
|
||||
woodden:'木纹',
|
||||
music:'音乐',
|
||||
simple:'简约'
|
||||
}
|
||||
character:{
|
||||
standard:'标准',
|
||||
shenhua:'神话再临',
|
||||
refresh:'界限突破',
|
||||
yijiang:'一将成名',
|
||||
sp:'SP',
|
||||
extra:'神将',
|
||||
old:'怀旧',
|
||||
diy:'DIY',
|
||||
yxs:'英雄杀',
|
||||
hearth:'炉石传说',
|
||||
gwent:'昆特牌',
|
||||
mtg:'万智牌',
|
||||
ow:'守望先锋',
|
||||
swd:'轩辕剑',
|
||||
gujian:'古剑奇谭',
|
||||
xianjian:'仙剑',
|
||||
},
|
||||
card:{
|
||||
standard:'标准',
|
||||
extra:'军争',
|
||||
sp:'SP',
|
||||
guozhan:'国战',
|
||||
zhenfa:'阵法',
|
||||
yunchou:'运筹帷幄',
|
||||
swd:'轩辕剑',
|
||||
gujian:'古剑奇谭',
|
||||
hearth:'炉石传说',
|
||||
gwent:'昆特牌',
|
||||
},
|
||||
play:{
|
||||
boss:'诸神降临',
|
||||
cardpile:'牌堆补充',
|
||||
wuxing:'五行生克',
|
||||
coin:'富甲天下',
|
||||
},
|
||||
mode:{
|
||||
identity:'身份',
|
||||
guozhan:'国战',
|
||||
versus:'对决',
|
||||
connect:'联机',
|
||||
boss:'挑战',
|
||||
chess:'战棋',
|
||||
tafang:'塔防',
|
||||
stone:'炉石',
|
||||
brawl:'乱斗',
|
||||
},
|
||||
background:{
|
||||
ol_bg:'龙纹',
|
||||
zhulin_bg:'竹林',
|
||||
shengshi_bg:'盛世',
|
||||
taoyuan_bg:'桃园',
|
||||
zhanhuo_bg:'战火',
|
||||
huangtian_bg:'黄天',
|
||||
september_bg:'九月',
|
||||
yinxiang_bg:'印象',
|
||||
},
|
||||
music:{
|
||||
music_diaochan:'貂蝉',
|
||||
music_shezhan:'舌战',
|
||||
music_danji:'单骑',
|
||||
},
|
||||
font:{
|
||||
xiaozhuan:'小篆',
|
||||
xinwei:'新魏',
|
||||
huangcao:'黄草',
|
||||
lishu:'隶书',
|
||||
},
|
||||
theme:{
|
||||
woodden:'木纹',
|
||||
music:'音乐',
|
||||
simple:'简约'
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
var fs = require('fs');
|
||||
var webpage = require('webpage')
|
||||
var load = function(id){
|
||||
var page = webpage.create();
|
||||
page.settings.userAgent = 'SpecialAgent';
|
||||
page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) {
|
||||
if(status !== 'success') {
|
||||
console.log(fs.workingDirectory);
|
||||
console.log('Unable to access network');
|
||||
}
|
||||
setInterval(function(){
|
||||
if(page.evaluate(function(){
|
||||
if(!lib.node||!lib.node.clients||!lib.node.clients.length){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
})){
|
||||
page.close();
|
||||
load(id);
|
||||
}
|
||||
},600000);
|
||||
});
|
||||
var page = webpage.create();
|
||||
page.settings.userAgent = 'SpecialAgent';
|
||||
page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) {
|
||||
if(status !== 'success') {
|
||||
console.log(fs.workingDirectory);
|
||||
console.log('Unable to access network');
|
||||
}
|
||||
setInterval(function(){
|
||||
if(page.evaluate(function(){
|
||||
if(!lib.node||!lib.node.clients||!lib.node.clients.length){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
})){
|
||||
page.close();
|
||||
load(id);
|
||||
}
|
||||
},600000);
|
||||
});
|
||||
}
|
||||
|
||||
load(1);
|
||||
|
|
648
game/server.js
648
game/server.js
|
@ -1,327 +1,327 @@
|
|||
(function(){
|
||||
var WebSocketServer=require('ws').Server;
|
||||
var wss=new WebSocketServer({port:8080});
|
||||
var WebSocketServer=require('ws').Server;
|
||||
var wss=new WebSocketServer({port:8080});
|
||||
|
||||
var rooms=[{},{},{},{},{},{}];
|
||||
var events=[];
|
||||
var clients={};
|
||||
var messages={
|
||||
enter:function(index,nickname,avatar,config,mode){
|
||||
this.nickname=nickname;
|
||||
this.avatar=avatar;
|
||||
var room=rooms[index];
|
||||
if(!room){
|
||||
index=0;
|
||||
room=rooms[0];
|
||||
}
|
||||
this.room=room;
|
||||
delete this.status;
|
||||
if(room.owner){
|
||||
if(room.servermode&&!room.owner._onconfig&&config&&mode){
|
||||
room.owner.sendl('createroom',index,config,mode);
|
||||
room.owner._onconfig=this;
|
||||
room.owner.nickname=nickname;
|
||||
room.owner.avatar=avatar;
|
||||
}
|
||||
else if(!room.config){
|
||||
this.sendl('enterroomfailed');
|
||||
}
|
||||
else{
|
||||
this.owner=room.owner;
|
||||
this.owner.sendl('onconnection',this.wsid);
|
||||
}
|
||||
util.updaterooms();
|
||||
}
|
||||
else{
|
||||
room.owner=this;
|
||||
this.sendl('createroom',index);
|
||||
}
|
||||
},
|
||||
changeAvatar:function(nickname,avatar){
|
||||
this.nickname=nickname;
|
||||
this.avatar=avatar;
|
||||
util.updateclients();
|
||||
},
|
||||
server:function(cfg){
|
||||
if(cfg){
|
||||
this.servermode=true;
|
||||
var room=rooms[cfg[0]];
|
||||
if(!room||room.owner){
|
||||
this.sendl('reloadroom',true);
|
||||
}
|
||||
else{
|
||||
room.owner=this;
|
||||
this.room=room;
|
||||
this.nickname=cfg[1];
|
||||
this.avatar=cfg[2];
|
||||
this.sendl('createroom',cfg[0],{},'auto')
|
||||
}
|
||||
}
|
||||
else{
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(!rooms[i].owner){
|
||||
rooms[i].owner=this;
|
||||
rooms[i].servermode=true;
|
||||
this.room=rooms[i];
|
||||
this.servermode=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
util.updaterooms();
|
||||
}
|
||||
},
|
||||
events:function(cfg,id,type){
|
||||
var changed=false;
|
||||
var time=(new Date()).getTime();
|
||||
if(cfg&&id){
|
||||
if(typeof cfg=='string'){
|
||||
for(var i=0;i<events.length;i++){
|
||||
if(events[i].id==cfg){
|
||||
if(type=='join'){
|
||||
if(events[i].members.indexOf(id)==-1){
|
||||
events[i].members.push(id);
|
||||
}
|
||||
changed=true;
|
||||
}
|
||||
else if(type=='leave'){
|
||||
var index=events[i].members.indexOf(id);
|
||||
if(index!=-1){
|
||||
events[i].members.splice(index,1);
|
||||
if(events[i].members.length==0){
|
||||
events.splice(i--,1);
|
||||
}
|
||||
}
|
||||
changed=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(cfg.hasOwnProperty('utc')&&
|
||||
cfg.hasOwnProperty('day')&&
|
||||
cfg.hasOwnProperty('hour')&&
|
||||
cfg.hasOwnProperty('content')){
|
||||
if(events.length>=20){
|
||||
this.sendl('eventsdenied','total');
|
||||
}
|
||||
else if(cfg.utc<=time){
|
||||
this.sendl('eventsdenied','time');
|
||||
}
|
||||
else{
|
||||
cfg.nickname=cfg.nickname||'无名玩家';
|
||||
cfg.avatar=cfg.nickname||'caocao';
|
||||
cfg.creator=id;
|
||||
cfg.id=util.getid();
|
||||
cfg.members=[id];
|
||||
events.unshift(cfg);
|
||||
changed=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(changed){
|
||||
util.updateevents();
|
||||
}
|
||||
},
|
||||
config:function(config){
|
||||
var room=this.room;
|
||||
if(room&&room.owner==this){
|
||||
if(room.servermode){
|
||||
room.servermode=false;
|
||||
if(this._onconfig){
|
||||
if(clients[this._onconfig.wsid]){
|
||||
this._onconfig.owner=this;
|
||||
this.sendl('onconnection',this._onconfig.wsid);
|
||||
}
|
||||
delete this._onconfig;
|
||||
}
|
||||
}
|
||||
room.config=config;
|
||||
}
|
||||
util.updaterooms();
|
||||
},
|
||||
status:function(str){
|
||||
if(typeof str=='string'){
|
||||
this.status=str;
|
||||
}
|
||||
else{
|
||||
delete this.status;
|
||||
}
|
||||
util.updateclients();
|
||||
},
|
||||
send:function(id,message){
|
||||
if(clients[id]&&clients[id].owner==this){
|
||||
try{
|
||||
clients[id].send(message);
|
||||
}
|
||||
catch(e){
|
||||
clients[id].close();
|
||||
}
|
||||
}
|
||||
},
|
||||
close:function(id){
|
||||
if(clients[id]&&clients[id].owner==this){
|
||||
clients[id].close();
|
||||
}
|
||||
},
|
||||
};
|
||||
var util={
|
||||
sendl:function(){
|
||||
var args=[];
|
||||
for(var i=0;i<arguments.length;i++){
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
try{
|
||||
this.send(JSON.stringify(args));
|
||||
}
|
||||
catch(e){
|
||||
this.close();
|
||||
}
|
||||
},
|
||||
getid:function(){
|
||||
return (Math.floor(1000000000+9000000000*Math.random())).toString();
|
||||
},
|
||||
getroomlist:function(){
|
||||
var roomlist=[];
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
rooms[i]._num=0;
|
||||
}
|
||||
for(var i in clients){
|
||||
if(clients[i].room&&!clients[i].servermode){
|
||||
clients[i].room._num++;
|
||||
}
|
||||
}
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(rooms[i].servermode){
|
||||
roomlist[i]='server';
|
||||
}
|
||||
else if(rooms[i].owner&&rooms[i].config){
|
||||
if(rooms[i]._num==0){
|
||||
rooms[i].owner.sendl('reloadroom');
|
||||
}
|
||||
roomlist[i]=[rooms[i].owner.nickname,rooms[i].owner.avatar,
|
||||
rooms[i].config,rooms[i]._num];
|
||||
}
|
||||
else{
|
||||
roomlist[i]=null;
|
||||
}
|
||||
delete rooms[i]._num;
|
||||
}
|
||||
return roomlist;
|
||||
},
|
||||
getclientlist:function(){
|
||||
var clientlist=[];
|
||||
for(var i in clients){
|
||||
clientlist.push([clients[i].nickname,clients[i].avatar,!clients[i].room,clients[i].status,clients[i].wsid]);
|
||||
}
|
||||
return clientlist;
|
||||
},
|
||||
updaterooms:function(){
|
||||
var roomlist=util.getroomlist();
|
||||
var clientlist=util.getclientlist();
|
||||
for(var i in clients){
|
||||
if(!clients[i].room){
|
||||
clients[i].sendl('updaterooms',roomlist,clientlist);
|
||||
}
|
||||
}
|
||||
},
|
||||
updateclients:function(){
|
||||
var clientlist=util.getclientlist();
|
||||
for(var i in clients){
|
||||
if(!clients[i].room){
|
||||
clients[i].sendl('updateclients',clientlist);
|
||||
}
|
||||
}
|
||||
},
|
||||
checkevents:function(){
|
||||
if(events.length){
|
||||
var time=(new Date()).getTime();
|
||||
for(var i=0;i<events.length;i++){
|
||||
if(events[i].utc<=time){
|
||||
events.splice(i--,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return events;
|
||||
},
|
||||
updateevents:function(){
|
||||
util.checkevents();
|
||||
for(var i in clients){
|
||||
if(!clients[i].room){
|
||||
clients[i].sendl('updateevents',events);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
wss.on('connection',function(ws){
|
||||
ws.sendl=util.sendl;
|
||||
ws.wsid=util.getid();
|
||||
clients[ws.wsid]=ws;
|
||||
ws.sendl('roomlist',util.getroomlist(),util.checkevents(),util.getclientlist(ws),ws.wsid);
|
||||
ws.heartbeat=setInterval(function(){
|
||||
if(ws.beat){
|
||||
ws.close();
|
||||
clearInterval(ws.heartbeat);
|
||||
}
|
||||
else{
|
||||
ws.beat=true;
|
||||
try{
|
||||
ws.send('heartbeat');
|
||||
}
|
||||
catch(e){
|
||||
ws.close();
|
||||
}
|
||||
}
|
||||
},60000);
|
||||
ws.on('message',function(message){
|
||||
if(!clients[this.wsid]) return;
|
||||
if(message=='heartbeat'){
|
||||
this.beat=false;
|
||||
}
|
||||
else if(this.owner){
|
||||
this.owner.sendl('onmessage',this.wsid,message);
|
||||
}
|
||||
else{
|
||||
var arr;
|
||||
try{
|
||||
arr=JSON.parse(message);
|
||||
if(!Array.isArray(arr)){
|
||||
throw('err');
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
this.sendl('denied','banned');
|
||||
return;
|
||||
}
|
||||
if(arr.shift()=='server'){
|
||||
var type=arr.shift();
|
||||
if(messages[type]){
|
||||
messages[type].apply(this,arr);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
ws.on('close',function(){
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(rooms[i].owner==this){
|
||||
rooms[i].owner=null;
|
||||
rooms[i].config=null;
|
||||
rooms[i].servermode=false;
|
||||
for(var j in clients){
|
||||
if(clients[j].room==rooms[i]&&clients[j]!=this){
|
||||
clients[j].sendl('selfclose');
|
||||
// clients[j].close();
|
||||
// delete clients[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(clients[this.wsid]){
|
||||
if(this.owner){
|
||||
this.owner.sendl('onclose',this.wsid);
|
||||
}
|
||||
delete clients[this.wsid];
|
||||
}
|
||||
if(this.room) util.updaterooms();
|
||||
else util.updateclients();
|
||||
});
|
||||
});
|
||||
var rooms=[{},{},{},{},{},{}];
|
||||
var events=[];
|
||||
var clients={};
|
||||
var messages={
|
||||
enter:function(index,nickname,avatar,config,mode){
|
||||
this.nickname=nickname;
|
||||
this.avatar=avatar;
|
||||
var room=rooms[index];
|
||||
if(!room){
|
||||
index=0;
|
||||
room=rooms[0];
|
||||
}
|
||||
this.room=room;
|
||||
delete this.status;
|
||||
if(room.owner){
|
||||
if(room.servermode&&!room.owner._onconfig&&config&&mode){
|
||||
room.owner.sendl('createroom',index,config,mode);
|
||||
room.owner._onconfig=this;
|
||||
room.owner.nickname=nickname;
|
||||
room.owner.avatar=avatar;
|
||||
}
|
||||
else if(!room.config){
|
||||
this.sendl('enterroomfailed');
|
||||
}
|
||||
else{
|
||||
this.owner=room.owner;
|
||||
this.owner.sendl('onconnection',this.wsid);
|
||||
}
|
||||
util.updaterooms();
|
||||
}
|
||||
else{
|
||||
room.owner=this;
|
||||
this.sendl('createroom',index);
|
||||
}
|
||||
},
|
||||
changeAvatar:function(nickname,avatar){
|
||||
this.nickname=nickname;
|
||||
this.avatar=avatar;
|
||||
util.updateclients();
|
||||
},
|
||||
server:function(cfg){
|
||||
if(cfg){
|
||||
this.servermode=true;
|
||||
var room=rooms[cfg[0]];
|
||||
if(!room||room.owner){
|
||||
this.sendl('reloadroom',true);
|
||||
}
|
||||
else{
|
||||
room.owner=this;
|
||||
this.room=room;
|
||||
this.nickname=cfg[1];
|
||||
this.avatar=cfg[2];
|
||||
this.sendl('createroom',cfg[0],{},'auto')
|
||||
}
|
||||
}
|
||||
else{
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(!rooms[i].owner){
|
||||
rooms[i].owner=this;
|
||||
rooms[i].servermode=true;
|
||||
this.room=rooms[i];
|
||||
this.servermode=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
util.updaterooms();
|
||||
}
|
||||
},
|
||||
events:function(cfg,id,type){
|
||||
var changed=false;
|
||||
var time=(new Date()).getTime();
|
||||
if(cfg&&id){
|
||||
if(typeof cfg=='string'){
|
||||
for(var i=0;i<events.length;i++){
|
||||
if(events[i].id==cfg){
|
||||
if(type=='join'){
|
||||
if(events[i].members.indexOf(id)==-1){
|
||||
events[i].members.push(id);
|
||||
}
|
||||
changed=true;
|
||||
}
|
||||
else if(type=='leave'){
|
||||
var index=events[i].members.indexOf(id);
|
||||
if(index!=-1){
|
||||
events[i].members.splice(index,1);
|
||||
if(events[i].members.length==0){
|
||||
events.splice(i--,1);
|
||||
}
|
||||
}
|
||||
changed=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(cfg.hasOwnProperty('utc')&&
|
||||
cfg.hasOwnProperty('day')&&
|
||||
cfg.hasOwnProperty('hour')&&
|
||||
cfg.hasOwnProperty('content')){
|
||||
if(events.length>=20){
|
||||
this.sendl('eventsdenied','total');
|
||||
}
|
||||
else if(cfg.utc<=time){
|
||||
this.sendl('eventsdenied','time');
|
||||
}
|
||||
else{
|
||||
cfg.nickname=cfg.nickname||'无名玩家';
|
||||
cfg.avatar=cfg.nickname||'caocao';
|
||||
cfg.creator=id;
|
||||
cfg.id=util.getid();
|
||||
cfg.members=[id];
|
||||
events.unshift(cfg);
|
||||
changed=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(changed){
|
||||
util.updateevents();
|
||||
}
|
||||
},
|
||||
config:function(config){
|
||||
var room=this.room;
|
||||
if(room&&room.owner==this){
|
||||
if(room.servermode){
|
||||
room.servermode=false;
|
||||
if(this._onconfig){
|
||||
if(clients[this._onconfig.wsid]){
|
||||
this._onconfig.owner=this;
|
||||
this.sendl('onconnection',this._onconfig.wsid);
|
||||
}
|
||||
delete this._onconfig;
|
||||
}
|
||||
}
|
||||
room.config=config;
|
||||
}
|
||||
util.updaterooms();
|
||||
},
|
||||
status:function(str){
|
||||
if(typeof str=='string'){
|
||||
this.status=str;
|
||||
}
|
||||
else{
|
||||
delete this.status;
|
||||
}
|
||||
util.updateclients();
|
||||
},
|
||||
send:function(id,message){
|
||||
if(clients[id]&&clients[id].owner==this){
|
||||
try{
|
||||
clients[id].send(message);
|
||||
}
|
||||
catch(e){
|
||||
clients[id].close();
|
||||
}
|
||||
}
|
||||
},
|
||||
close:function(id){
|
||||
if(clients[id]&&clients[id].owner==this){
|
||||
clients[id].close();
|
||||
}
|
||||
},
|
||||
};
|
||||
var util={
|
||||
sendl:function(){
|
||||
var args=[];
|
||||
for(var i=0;i<arguments.length;i++){
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
try{
|
||||
this.send(JSON.stringify(args));
|
||||
}
|
||||
catch(e){
|
||||
this.close();
|
||||
}
|
||||
},
|
||||
getid:function(){
|
||||
return (Math.floor(1000000000+9000000000*Math.random())).toString();
|
||||
},
|
||||
getroomlist:function(){
|
||||
var roomlist=[];
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
rooms[i]._num=0;
|
||||
}
|
||||
for(var i in clients){
|
||||
if(clients[i].room&&!clients[i].servermode){
|
||||
clients[i].room._num++;
|
||||
}
|
||||
}
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(rooms[i].servermode){
|
||||
roomlist[i]='server';
|
||||
}
|
||||
else if(rooms[i].owner&&rooms[i].config){
|
||||
if(rooms[i]._num==0){
|
||||
rooms[i].owner.sendl('reloadroom');
|
||||
}
|
||||
roomlist[i]=[rooms[i].owner.nickname,rooms[i].owner.avatar,
|
||||
rooms[i].config,rooms[i]._num];
|
||||
}
|
||||
else{
|
||||
roomlist[i]=null;
|
||||
}
|
||||
delete rooms[i]._num;
|
||||
}
|
||||
return roomlist;
|
||||
},
|
||||
getclientlist:function(){
|
||||
var clientlist=[];
|
||||
for(var i in clients){
|
||||
clientlist.push([clients[i].nickname,clients[i].avatar,!clients[i].room,clients[i].status,clients[i].wsid]);
|
||||
}
|
||||
return clientlist;
|
||||
},
|
||||
updaterooms:function(){
|
||||
var roomlist=util.getroomlist();
|
||||
var clientlist=util.getclientlist();
|
||||
for(var i in clients){
|
||||
if(!clients[i].room){
|
||||
clients[i].sendl('updaterooms',roomlist,clientlist);
|
||||
}
|
||||
}
|
||||
},
|
||||
updateclients:function(){
|
||||
var clientlist=util.getclientlist();
|
||||
for(var i in clients){
|
||||
if(!clients[i].room){
|
||||
clients[i].sendl('updateclients',clientlist);
|
||||
}
|
||||
}
|
||||
},
|
||||
checkevents:function(){
|
||||
if(events.length){
|
||||
var time=(new Date()).getTime();
|
||||
for(var i=0;i<events.length;i++){
|
||||
if(events[i].utc<=time){
|
||||
events.splice(i--,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return events;
|
||||
},
|
||||
updateevents:function(){
|
||||
util.checkevents();
|
||||
for(var i in clients){
|
||||
if(!clients[i].room){
|
||||
clients[i].sendl('updateevents',events);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
wss.on('connection',function(ws){
|
||||
ws.sendl=util.sendl;
|
||||
ws.wsid=util.getid();
|
||||
clients[ws.wsid]=ws;
|
||||
ws.sendl('roomlist',util.getroomlist(),util.checkevents(),util.getclientlist(ws),ws.wsid);
|
||||
ws.heartbeat=setInterval(function(){
|
||||
if(ws.beat){
|
||||
ws.close();
|
||||
clearInterval(ws.heartbeat);
|
||||
}
|
||||
else{
|
||||
ws.beat=true;
|
||||
try{
|
||||
ws.send('heartbeat');
|
||||
}
|
||||
catch(e){
|
||||
ws.close();
|
||||
}
|
||||
}
|
||||
},60000);
|
||||
ws.on('message',function(message){
|
||||
if(!clients[this.wsid]) return;
|
||||
if(message=='heartbeat'){
|
||||
this.beat=false;
|
||||
}
|
||||
else if(this.owner){
|
||||
this.owner.sendl('onmessage',this.wsid,message);
|
||||
}
|
||||
else{
|
||||
var arr;
|
||||
try{
|
||||
arr=JSON.parse(message);
|
||||
if(!Array.isArray(arr)){
|
||||
throw('err');
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
this.sendl('denied','banned');
|
||||
return;
|
||||
}
|
||||
if(arr.shift()=='server'){
|
||||
var type=arr.shift();
|
||||
if(messages[type]){
|
||||
messages[type].apply(this,arr);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
ws.on('close',function(){
|
||||
for(var i=0;i<rooms.length;i++){
|
||||
if(rooms[i].owner==this){
|
||||
rooms[i].owner=null;
|
||||
rooms[i].config=null;
|
||||
rooms[i].servermode=false;
|
||||
for(var j in clients){
|
||||
if(clients[j].room==rooms[i]&&clients[j]!=this){
|
||||
clients[j].sendl('selfclose');
|
||||
// clients[j].close();
|
||||
// delete clients[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(clients[this.wsid]){
|
||||
if(this.owner){
|
||||
this.owner.sendl('onclose',this.wsid);
|
||||
}
|
||||
delete clients[this.wsid];
|
||||
}
|
||||
if(this.room) util.updaterooms();
|
||||
else util.updateclients();
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
|
318
game/source.js
318
game/source.js
|
@ -1,161 +1,161 @@
|
|||
window.noname_source_list=[
|
||||
'card/extra.js',
|
||||
'card/gujian.js',
|
||||
'card/guozhan.js',
|
||||
'card/gwent.js',
|
||||
'card/hearth.js',
|
||||
'card/sp.js',
|
||||
'card/standard.js',
|
||||
'card/swd.js',
|
||||
'card/yunchou.js',
|
||||
'card/zhenfa.js',
|
||||
'character/diy.js',
|
||||
'character/extra.js',
|
||||
'character/gujian.js',
|
||||
'character/gwent.js',
|
||||
'character/hearth.js',
|
||||
'character/mtg.js',
|
||||
'character/old.js',
|
||||
'character/ow.js',
|
||||
'character/rank.js',
|
||||
'character/refresh.js',
|
||||
'character/shenhua.js',
|
||||
'character/sp.js',
|
||||
'character/standard.js',
|
||||
'character/swd.js',
|
||||
'character/xianjian.js',
|
||||
'character/yijiang.js',
|
||||
'character/yxs.js',
|
||||
'game/asset.js',
|
||||
'game/codemirror.js',
|
||||
'game/config.js',
|
||||
'game/game.js',
|
||||
'game/http.js',
|
||||
'game/jszip.js',
|
||||
'game/package.js',
|
||||
'game/phantom.js',
|
||||
'game/pressure.js',
|
||||
'game/server.js',
|
||||
'game/source.js',
|
||||
'game/update.js',
|
||||
'layout/default/codemirror.css',
|
||||
'layout/default/layout.css',
|
||||
'layout/default/menu.css',
|
||||
'layout/default/phone.css',
|
||||
'layout/long/layout.css',
|
||||
'layout/long2/layout.css',
|
||||
'layout/mobile/equip.css',
|
||||
'layout/mobile/layout.css',
|
||||
'layout/mode/boss.css',
|
||||
'layout/mode/chess.css',
|
||||
'layout/mode/stone.css',
|
||||
'layout/mode/tafang.css',
|
||||
'layout/newlayout/equip.css',
|
||||
'layout/newlayout/global.css',
|
||||
'layout/newlayout/layout.css',
|
||||
'mode/boss.js',
|
||||
'mode/chess.js',
|
||||
'mode/guozhan.js',
|
||||
'mode/identity.js',
|
||||
'mode/tafang.js',
|
||||
'mode/stone.js',
|
||||
'mode/brawl.js',
|
||||
'mode/versus.js',
|
||||
'mode/connect.js',
|
||||
'extension/boss/extension.js',
|
||||
'extension/cardpile/extension.js',
|
||||
'extension/coin/extension.js',
|
||||
'extension/wuxing/extension.js',
|
||||
'theme/music/grid.png',
|
||||
'theme/music/style.css',
|
||||
'theme/music/wood.png',
|
||||
'theme/music/wood3.png',
|
||||
'theme/simple/card.png',
|
||||
'theme/simple/grid.png',
|
||||
'theme/simple/style.css',
|
||||
'theme/simple/unknown.png',
|
||||
'theme/simple/wood.png',
|
||||
'theme/simple/wood3.png',
|
||||
'theme/woodden/grid.png',
|
||||
'theme/woodden/style.css',
|
||||
'theme/woodden/wood.jpg',
|
||||
'theme/woodden/wood.png',
|
||||
'theme/woodden/wood2.jpg',
|
||||
'theme/woodden/wood2.png',
|
||||
'theme/style/card/custom.css',
|
||||
'theme/style/card/default.css',
|
||||
'theme/style/card/music.css',
|
||||
'theme/style/card/simple.css',
|
||||
'theme/style/card/wood.css',
|
||||
'theme/style/card/new.css',
|
||||
'theme/style/card/ol.css',
|
||||
'theme/style/card/image/new.png',
|
||||
'theme/style/card/image/ol.png',
|
||||
'theme/style/cardback/custom.css',
|
||||
'theme/style/cardback/default.css',
|
||||
'theme/style/cardback/feicheng.css',
|
||||
'theme/style/cardback/liusha.css',
|
||||
'theme/style/cardback/music.css',
|
||||
'theme/style/cardback/new.css',
|
||||
'theme/style/cardback/ol.css',
|
||||
'theme/style/cardback/official.css',
|
||||
'theme/style/cardback/wood.css',
|
||||
'theme/style/cardback/image/feicheng.png',
|
||||
'theme/style/cardback/image/feicheng2.png',
|
||||
'theme/style/cardback/image/liusha.png',
|
||||
'theme/style/cardback/image/liusha2.png',
|
||||
'theme/style/cardback/image/new.png',
|
||||
'theme/style/cardback/image/new2.png',
|
||||
'theme/style/cardback/image/official.png',
|
||||
'theme/style/cardback/image/official2.png',
|
||||
'theme/style/cardback/image/ol.png',
|
||||
'theme/style/cardback/image/ol2.png',
|
||||
'theme/style/hp/custom.css',
|
||||
'theme/style/hp/default.css',
|
||||
'theme/style/hp/emotion.css',
|
||||
'theme/style/hp/glass.css',
|
||||
'theme/style/hp/official.css',
|
||||
'theme/style/hp/ol.css',
|
||||
'theme/style/hp/round.css',
|
||||
'theme/style/hp/image/emotion1.png',
|
||||
'theme/style/hp/image/emotion2.png',
|
||||
'theme/style/hp/image/emotion3.png',
|
||||
'theme/style/hp/image/emotion4.png',
|
||||
'theme/style/hp/image/glass1.png',
|
||||
'theme/style/hp/image/glass2.png',
|
||||
'theme/style/hp/image/glass3.png',
|
||||
'theme/style/hp/image/glass4.png',
|
||||
'theme/style/hp/image/official1.png',
|
||||
'theme/style/hp/image/official2.png',
|
||||
'theme/style/hp/image/official3.png',
|
||||
'theme/style/hp/image/official4.png',
|
||||
'theme/style/hp/image/ol1.png',
|
||||
'theme/style/hp/image/ol2.png',
|
||||
'theme/style/hp/image/ol3.png',
|
||||
'theme/style/hp/image/ol4.png',
|
||||
'theme/style/hp/image/round1.png',
|
||||
'theme/style/hp/image/round2.png',
|
||||
'theme/style/hp/image/round3.png',
|
||||
'theme/style/hp/image/round4.png',
|
||||
'node_modules/ws/index.js',
|
||||
'node_modules/ws/package.json',
|
||||
'node_modules/ws/lib/BufferPool.js',
|
||||
'node_modules/ws/lib/BufferUtil.fallback.js',
|
||||
'node_modules/ws/lib/BufferUtil.js',
|
||||
'node_modules/ws/lib/ErrorCodes.js',
|
||||
'node_modules/ws/lib/Extensions.js',
|
||||
'node_modules/ws/lib/PerMessageDeflate.js',
|
||||
'node_modules/ws/lib/Receiver.hixie.js',
|
||||
'node_modules/ws/lib/Receiver.js',
|
||||
'node_modules/ws/lib/Sender.hixie.js',
|
||||
'node_modules/ws/lib/Sender.js',
|
||||
'node_modules/ws/lib/Validation.fallback.js',
|
||||
'node_modules/ws/lib/Validation.js',
|
||||
'node_modules/ws/lib/WebSocket.js',
|
||||
'node_modules/ws/lib/WebSocketServer.js',
|
||||
'node_modules/ultron/index.js',
|
||||
'node_modules/ultron/package.json',
|
||||
'node_modules/ultron/test.js',
|
||||
'node_modules/options/package.json',
|
||||
'node_modules/options/lib/options.js',
|
||||
'card/extra.js',
|
||||
'card/gujian.js',
|
||||
'card/guozhan.js',
|
||||
'card/gwent.js',
|
||||
'card/hearth.js',
|
||||
'card/sp.js',
|
||||
'card/standard.js',
|
||||
'card/swd.js',
|
||||
'card/yunchou.js',
|
||||
'card/zhenfa.js',
|
||||
'character/diy.js',
|
||||
'character/extra.js',
|
||||
'character/gujian.js',
|
||||
'character/gwent.js',
|
||||
'character/hearth.js',
|
||||
'character/mtg.js',
|
||||
'character/old.js',
|
||||
'character/ow.js',
|
||||
'character/rank.js',
|
||||
'character/refresh.js',
|
||||
'character/shenhua.js',
|
||||
'character/sp.js',
|
||||
'character/standard.js',
|
||||
'character/swd.js',
|
||||
'character/xianjian.js',
|
||||
'character/yijiang.js',
|
||||
'character/yxs.js',
|
||||
'game/asset.js',
|
||||
'game/codemirror.js',
|
||||
'game/config.js',
|
||||
'game/game.js',
|
||||
'game/http.js',
|
||||
'game/jszip.js',
|
||||
'game/package.js',
|
||||
'game/phantom.js',
|
||||
'game/pressure.js',
|
||||
'game/server.js',
|
||||
'game/source.js',
|
||||
'game/update.js',
|
||||
'layout/default/codemirror.css',
|
||||
'layout/default/layout.css',
|
||||
'layout/default/menu.css',
|
||||
'layout/default/phone.css',
|
||||
'layout/long/layout.css',
|
||||
'layout/long2/layout.css',
|
||||
'layout/mobile/equip.css',
|
||||
'layout/mobile/layout.css',
|
||||
'layout/mode/boss.css',
|
||||
'layout/mode/chess.css',
|
||||
'layout/mode/stone.css',
|
||||
'layout/mode/tafang.css',
|
||||
'layout/newlayout/equip.css',
|
||||
'layout/newlayout/global.css',
|
||||
'layout/newlayout/layout.css',
|
||||
'mode/boss.js',
|
||||
'mode/chess.js',
|
||||
'mode/guozhan.js',
|
||||
'mode/identity.js',
|
||||
'mode/tafang.js',
|
||||
'mode/stone.js',
|
||||
'mode/brawl.js',
|
||||
'mode/versus.js',
|
||||
'mode/connect.js',
|
||||
'extension/boss/extension.js',
|
||||
'extension/cardpile/extension.js',
|
||||
'extension/coin/extension.js',
|
||||
'extension/wuxing/extension.js',
|
||||
'theme/music/grid.png',
|
||||
'theme/music/style.css',
|
||||
'theme/music/wood.png',
|
||||
'theme/music/wood3.png',
|
||||
'theme/simple/card.png',
|
||||
'theme/simple/grid.png',
|
||||
'theme/simple/style.css',
|
||||
'theme/simple/unknown.png',
|
||||
'theme/simple/wood.png',
|
||||
'theme/simple/wood3.png',
|
||||
'theme/woodden/grid.png',
|
||||
'theme/woodden/style.css',
|
||||
'theme/woodden/wood.jpg',
|
||||
'theme/woodden/wood.png',
|
||||
'theme/woodden/wood2.jpg',
|
||||
'theme/woodden/wood2.png',
|
||||
'theme/style/card/custom.css',
|
||||
'theme/style/card/default.css',
|
||||
'theme/style/card/music.css',
|
||||
'theme/style/card/simple.css',
|
||||
'theme/style/card/wood.css',
|
||||
'theme/style/card/new.css',
|
||||
'theme/style/card/ol.css',
|
||||
'theme/style/card/image/new.png',
|
||||
'theme/style/card/image/ol.png',
|
||||
'theme/style/cardback/custom.css',
|
||||
'theme/style/cardback/default.css',
|
||||
'theme/style/cardback/feicheng.css',
|
||||
'theme/style/cardback/liusha.css',
|
||||
'theme/style/cardback/music.css',
|
||||
'theme/style/cardback/new.css',
|
||||
'theme/style/cardback/ol.css',
|
||||
'theme/style/cardback/official.css',
|
||||
'theme/style/cardback/wood.css',
|
||||
'theme/style/cardback/image/feicheng.png',
|
||||
'theme/style/cardback/image/feicheng2.png',
|
||||
'theme/style/cardback/image/liusha.png',
|
||||
'theme/style/cardback/image/liusha2.png',
|
||||
'theme/style/cardback/image/new.png',
|
||||
'theme/style/cardback/image/new2.png',
|
||||
'theme/style/cardback/image/official.png',
|
||||
'theme/style/cardback/image/official2.png',
|
||||
'theme/style/cardback/image/ol.png',
|
||||
'theme/style/cardback/image/ol2.png',
|
||||
'theme/style/hp/custom.css',
|
||||
'theme/style/hp/default.css',
|
||||
'theme/style/hp/emotion.css',
|
||||
'theme/style/hp/glass.css',
|
||||
'theme/style/hp/official.css',
|
||||
'theme/style/hp/ol.css',
|
||||
'theme/style/hp/round.css',
|
||||
'theme/style/hp/image/emotion1.png',
|
||||
'theme/style/hp/image/emotion2.png',
|
||||
'theme/style/hp/image/emotion3.png',
|
||||
'theme/style/hp/image/emotion4.png',
|
||||
'theme/style/hp/image/glass1.png',
|
||||
'theme/style/hp/image/glass2.png',
|
||||
'theme/style/hp/image/glass3.png',
|
||||
'theme/style/hp/image/glass4.png',
|
||||
'theme/style/hp/image/official1.png',
|
||||
'theme/style/hp/image/official2.png',
|
||||
'theme/style/hp/image/official3.png',
|
||||
'theme/style/hp/image/official4.png',
|
||||
'theme/style/hp/image/ol1.png',
|
||||
'theme/style/hp/image/ol2.png',
|
||||
'theme/style/hp/image/ol3.png',
|
||||
'theme/style/hp/image/ol4.png',
|
||||
'theme/style/hp/image/round1.png',
|
||||
'theme/style/hp/image/round2.png',
|
||||
'theme/style/hp/image/round3.png',
|
||||
'theme/style/hp/image/round4.png',
|
||||
'node_modules/ws/index.js',
|
||||
'node_modules/ws/package.json',
|
||||
'node_modules/ws/lib/BufferPool.js',
|
||||
'node_modules/ws/lib/BufferUtil.fallback.js',
|
||||
'node_modules/ws/lib/BufferUtil.js',
|
||||
'node_modules/ws/lib/ErrorCodes.js',
|
||||
'node_modules/ws/lib/Extensions.js',
|
||||
'node_modules/ws/lib/PerMessageDeflate.js',
|
||||
'node_modules/ws/lib/Receiver.hixie.js',
|
||||
'node_modules/ws/lib/Receiver.js',
|
||||
'node_modules/ws/lib/Sender.hixie.js',
|
||||
'node_modules/ws/lib/Sender.js',
|
||||
'node_modules/ws/lib/Validation.fallback.js',
|
||||
'node_modules/ws/lib/Validation.js',
|
||||
'node_modules/ws/lib/WebSocket.js',
|
||||
'node_modules/ws/lib/WebSocketServer.js',
|
||||
'node_modules/ultron/index.js',
|
||||
'node_modules/ultron/package.json',
|
||||
'node_modules/ultron/test.js',
|
||||
'node_modules/options/package.json',
|
||||
'node_modules/options/lib/options.js',
|
||||
];
|
||||
|
|
110
game/update.js
110
game/update.js
|
@ -1,55 +1,59 @@
|
|||
window.noname_update={
|
||||
version:'1.9.48.1',
|
||||
update:'1.9.48',
|
||||
changeLog:[
|
||||
'bug修复'
|
||||
],
|
||||
files:[
|
||||
'game/game.js',
|
||||
// 'game/package.js',
|
||||
// 'game/config.js',
|
||||
// 'game/source.js',
|
||||
// 'game/pressure.js',
|
||||
// 'game/asset.js',
|
||||
// 'card/*',
|
||||
// 'card/extra.js',
|
||||
// 'card/yunchou.js',
|
||||
// 'card/swd.js',
|
||||
// 'card/gwent.js',
|
||||
// 'card/standard.js',
|
||||
// 'character/*',
|
||||
// 'character/hearth.js',
|
||||
// 'character/gwent.js',
|
||||
// 'character/diy.js',
|
||||
// 'character/standard.js',
|
||||
'character/shenhua.js',
|
||||
// 'character/refresh.js',
|
||||
// 'character/yijiang.js',
|
||||
// 'character/yxs.js',
|
||||
// 'character/swd.js',
|
||||
// 'character/sp.js',
|
||||
// 'character/rank.js',
|
||||
// 'mode/identity.js',
|
||||
// 'mode/boss.js',
|
||||
// 'mode/guozhan.js',
|
||||
// 'mode/versus.js',
|
||||
// 'mode/connect.js',
|
||||
// 'mode/chess.js',
|
||||
// 'mode/tafang.js',
|
||||
// 'mode/guozhan.js',
|
||||
// 'mode/stone.js',
|
||||
// 'theme/music/style.css',
|
||||
// 'theme/woodden/style.css',
|
||||
// 'theme/simple/style.css',
|
||||
// 'layout/default/layout.css',
|
||||
// 'layout/default/phone.css',
|
||||
// 'layout/default/menu.css',
|
||||
// 'theme/style/cardback/*',
|
||||
// 'layout/long/layout.css',
|
||||
// 'layout/long2/layout.css',
|
||||
// 'layout/mobile/layout.css',
|
||||
// 'layout/newlayout/global.css',
|
||||
// 'layout/mode/chess.css',
|
||||
// 'extension/boss/extension.js',
|
||||
]
|
||||
version:'1.9.49',
|
||||
// update:'1.9.48',
|
||||
changeLog:[
|
||||
// '祭天祀地模式(在 选项-开始-身份 中开启)',
|
||||
'修复国内镜像更新问题',
|
||||
'武将修改',
|
||||
'毛玻璃主题(仅Safari可用)',
|
||||
'players://["chenqun","lifeng","maliang","huanghao"]'
|
||||
],
|
||||
files:[
|
||||
// 'game/game.js',
|
||||
// 'game/package.js',
|
||||
// 'game/config.js',
|
||||
// 'game/source.js',
|
||||
// 'game/pressure.js',
|
||||
// 'game/asset.js',
|
||||
// 'card/*',
|
||||
// 'card/extra.js',
|
||||
// 'card/yunchou.js',
|
||||
// 'card/swd.js',
|
||||
// 'card/gwent.js',
|
||||
// 'card/standard.js',
|
||||
// 'character/*',
|
||||
// 'character/hearth.js',
|
||||
// 'character/gwent.js',
|
||||
// 'character/diy.js',
|
||||
// 'character/standard.js',
|
||||
// 'character/shenhua.js',
|
||||
// 'character/refresh.js',
|
||||
// 'character/yijiang.js',
|
||||
// 'character/yxs.js',
|
||||
// 'character/swd.js',
|
||||
// 'character/sp.js',
|
||||
// 'character/rank.js',
|
||||
// 'mode/identity.js',
|
||||
// 'mode/boss.js',
|
||||
// 'mode/guozhan.js',
|
||||
// 'mode/versus.js',
|
||||
// 'mode/connect.js',
|
||||
// 'mode/chess.js',
|
||||
// 'mode/tafang.js',
|
||||
// 'mode/guozhan.js',
|
||||
// 'mode/stone.js',
|
||||
// 'theme/music/style.css',
|
||||
// 'theme/woodden/style.css',
|
||||
// 'theme/simple/style.css',
|
||||
// 'layout/default/layout.css',
|
||||
// 'layout/default/phone.css',
|
||||
// 'layout/default/menu.css',
|
||||
// 'theme/style/cardback/*',
|
||||
// 'layout/long/layout.css',
|
||||
// 'layout/long2/layout.css',
|
||||
// 'layout/mobile/layout.css',
|
||||
// 'layout/newlayout/global.css',
|
||||
// 'layout/mode/chess.css',
|
||||
// 'extension/boss/extension.js',
|
||||
]
|
||||
}
|
||||
|
|
378
mode/boss.js
378
mode/boss.js
|
@ -580,7 +580,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['guilongzhanyuedao'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:9
|
||||
}
|
||||
|
@ -591,7 +591,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip2',
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
skills:['guofengyupao'],
|
||||
ai:{
|
||||
equipValue:9
|
||||
|
@ -604,7 +604,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['qimenbagua'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:9
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['chixueqingfeng'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:9
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['chiyanzhenhunqin'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:5
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['juechenjinge'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:9
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['xiuluolianyuji'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:9
|
||||
}
|
||||
|
@ -667,7 +667,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
skills:['xuwangzhimian'],
|
||||
nomod:true,
|
||||
nopower:true,
|
||||
unique:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:9
|
||||
}
|
||||
|
@ -1087,7 +1087,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
game.uncheck();
|
||||
game.check();
|
||||
if(ui.cheat){
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.animate('controlpressdownx',500);
|
||||
ui.cheat.classList.remove('disabled');
|
||||
}
|
||||
if(_status.bosschoice){
|
||||
|
@ -1623,9 +1623,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
mod:{
|
||||
targetEnabled:function(card,player,target,now){
|
||||
if(target.isEnemyOf(player)){
|
||||
if(target.isEnemyOf(player)){
|
||||
var type=get.type(card,'trick');
|
||||
if(type=='trick'){
|
||||
if(type=='trick'){
|
||||
if(game.hasPlayer(function(current){
|
||||
return current.name=='boss_shuishenxuanming';
|
||||
})){
|
||||
|
@ -1639,8 +1639,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
boss_lingqu:{
|
||||
|
@ -2076,21 +2076,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
boss_futai2:{
|
||||
mod:{
|
||||
cardSavable:function(card,player){
|
||||
cardSavable:function(card,player){
|
||||
if(card.name=='tao'&&game.hasPlayer(function(current){
|
||||
return current!=player&¤t.hasSkill('boss_futai')&&_status.currentPhase!=current;
|
||||
})){
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
cardEnabled:function(card,player){
|
||||
if(card.name=='tao'&&game.hasPlayer(function(current){
|
||||
return current!=player&¤t.hasSkill('boss_futai')&&_status.currentPhase!=current;
|
||||
})){
|
||||
return false;
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
boss_luanchang:{
|
||||
group:['boss_luanchang_begin','boss_luanchang_end'],
|
||||
|
@ -2357,41 +2357,41 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
qimenbagua:{
|
||||
trigger:{target:'shaBefore'},
|
||||
forced:true,
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(event.player.hasSkillTag('unequip',false,event.card)) return false;
|
||||
return true;
|
||||
},
|
||||
content:function(){
|
||||
trigger.cancel();
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
content:function(){
|
||||
trigger.cancel();
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target){
|
||||
if(player.hasSkillTag('unequip',false,card)) return;
|
||||
if(card.name=='sha') return 'zerotarget';
|
||||
}
|
||||
}
|
||||
}
|
||||
if(card.name=='sha') return 'zerotarget';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
guilongzhanyuedao:{
|
||||
trigger:{player:'shaBegin'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return event.card&&get.color(event.card)=='red';
|
||||
},
|
||||
content:function(){
|
||||
trigger.directHit=true;
|
||||
}
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return event.card&&get.color(event.card)=='red';
|
||||
},
|
||||
content:function(){
|
||||
trigger.directHit=true;
|
||||
}
|
||||
},
|
||||
guofengyupao:{
|
||||
mod:{
|
||||
targetEnabled:function(card,player,target,now){
|
||||
if(player!=target){
|
||||
if(get.type(card)=='trick') return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
targetEnabled:function(card,player,target,now){
|
||||
if(player!=target){
|
||||
if(get.type(card)=='trick') return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
boss_chiyan:{
|
||||
trigger:{global:'gameStart'},
|
||||
|
@ -3276,10 +3276,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
global:'boss_huihuo2',
|
||||
unique:true,
|
||||
mod:{
|
||||
cardUsable:function(card,player,num){
|
||||
if(card.name=='sha') return num+1;
|
||||
}
|
||||
},
|
||||
cardUsable:function(card,player,num){
|
||||
if(card.name=='sha') return num+1;
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
revertsave:true,
|
||||
effect:{
|
||||
|
@ -3522,7 +3522,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
forced:true,
|
||||
unique:true,
|
||||
filter:function(event,player){
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
if(event._notrigger.contains(event.player)) return false;
|
||||
return event.player.isIn()&&event.player.isEnemyOf(player)&&!event.player.hasSkill('boss_zhongdu');
|
||||
},
|
||||
logTarget:'player',
|
||||
|
@ -4121,10 +4121,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
fengqi2:{
|
||||
mod:{
|
||||
wuxieRespondable:function(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
wuxieRespondable:function(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
gaiming:{
|
||||
trigger:{player:'judgeBefore'},
|
||||
|
@ -4691,43 +4691,43 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
boss_qixiang:{
|
||||
group:['boss_qixiang1','boss_qixiang2'],
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(card.name=='lebu'&&card.name=='bingliang') return 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
boss_qixiang1:{
|
||||
group:['boss_qixiang1','boss_qixiang2'],
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(card.name=='lebu'&&card.name=='bingliang') return 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
boss_qixiang1:{
|
||||
trigger:{player:'judge'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(event.card){
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='lebu';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='lebu';
|
||||
}
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='lebu';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='lebu';
|
||||
}
|
||||
}
|
||||
},
|
||||
content:function(){
|
||||
player.addTempSkill('boss_qixiang3','judgeAfter');
|
||||
}
|
||||
},
|
||||
boss_qixiang2:{
|
||||
boss_qixiang2:{
|
||||
trigger:{player:'judge'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(event.card){
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='bingliang';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='bingliang';
|
||||
}
|
||||
if(event.card.viewAs){
|
||||
return event.card.viewAs=='bingliang';
|
||||
}
|
||||
else{
|
||||
return event.card.name=='bingliang';
|
||||
}
|
||||
}
|
||||
},
|
||||
content:function(){
|
||||
|
@ -4959,38 +4959,38 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
boss_suoming:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&&!current.isLinked();
|
||||
});
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
var num=game.countPlayer(function(current){
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
var num=game.countPlayer(function(current){
|
||||
return current!=player&&!current.isLinked();
|
||||
});
|
||||
player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){
|
||||
return !target.isLinked()&&player!=target;
|
||||
}).ai=function(target){
|
||||
return -get.attitude(player,target);
|
||||
}
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.logSkill('boss_suoming',result.targets);
|
||||
event.targets=result.targets;
|
||||
event.num=0;
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
"step 2"
|
||||
if(event.num<event.targets.length){
|
||||
event.targets[event.num].link();
|
||||
event.num++;
|
||||
event.redo();
|
||||
}
|
||||
},
|
||||
player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){
|
||||
return !target.isLinked()&&player!=target;
|
||||
}).ai=function(target){
|
||||
return -get.attitude(player,target);
|
||||
}
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.logSkill('boss_suoming',result.targets);
|
||||
event.targets=result.targets;
|
||||
event.num=0;
|
||||
}
|
||||
else{
|
||||
event.finish();
|
||||
}
|
||||
"step 2"
|
||||
if(event.num<event.targets.length){
|
||||
event.targets[event.num].link();
|
||||
event.num++;
|
||||
event.redo();
|
||||
}
|
||||
},
|
||||
},
|
||||
boss_taiping:{
|
||||
trigger:{player:'phaseDrawBegin'},
|
||||
|
@ -5026,12 +5026,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
boss_manjia:{
|
||||
group:['boss_manjia1','boss_manjia2']
|
||||
},
|
||||
boss_manjia1:{
|
||||
boss_manjia1:{
|
||||
trigger:{target:'useCardToBefore'},
|
||||
forced:true,
|
||||
priority:6,
|
||||
filter:function(event,player){
|
||||
if(player.getEquip(2)) return false;
|
||||
if(player.getEquip(2)) return false;
|
||||
return lib.skill.tengjia1.filter(event,player);
|
||||
},
|
||||
content:function(){
|
||||
|
@ -5040,7 +5040,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(target.getEquip(2)) return;
|
||||
if(target.getEquip(2)) return;
|
||||
return lib.skill.tengjia1.ai.effect.target.apply(this,arguments);
|
||||
}
|
||||
}
|
||||
|
@ -5049,20 +5049,20 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
boss_manjia2:{
|
||||
trigger:{player:'damageBegin'},
|
||||
filter:function(event,player){
|
||||
if(player.getEquip(2)) return false;
|
||||
if(player.getEquip(2)) return false;
|
||||
if(event.nature=='fire') return true;
|
||||
},
|
||||
forced:true,
|
||||
check:function(){
|
||||
return false;
|
||||
},
|
||||
check:function(){
|
||||
return false;
|
||||
},
|
||||
content:function(){
|
||||
trigger.num++;
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(target.getEquip(2)) return;
|
||||
if(target.getEquip(2)) return;
|
||||
return lib.skill.tengjia2.ai.effect.target.apply(this,arguments);
|
||||
}
|
||||
}
|
||||
|
@ -5090,20 +5090,20 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
boss_guiji:{
|
||||
trigger:{player:'phaseJudgeBegin'},
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.discard(player.getCards('j').randomGet());
|
||||
},
|
||||
filter:function(event ,player){
|
||||
return player.countCards('j')>0;
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
forced:true,
|
||||
content:function(){
|
||||
player.discard(player.getCards('j').randomGet());
|
||||
},
|
||||
filter:function(event ,player){
|
||||
return player.countCards('j')>0;
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
boss_minbao:{
|
||||
global:'boss_minbao2'
|
||||
|
@ -5400,15 +5400,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
boss_qiangzheng:{
|
||||
audio:2,
|
||||
trigger:{player:'phaseEnd'},
|
||||
forced:true,
|
||||
forced:true,
|
||||
unique:true,
|
||||
filter:function(event,player){
|
||||
filter:function(event,player){
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&¤t.countCards('h');
|
||||
});
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
var players=get.players(player);
|
||||
players.remove(player);
|
||||
event.players=players;
|
||||
|
@ -5424,7 +5424,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
event.redo();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
guizhen:{
|
||||
audio:2,
|
||||
|
@ -5887,29 +5887,29 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
boss_tianyu:{
|
||||
audio:true,
|
||||
trigger:{player:'phaseEnd'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(player.isLinked()) return true;
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
if(player.isLinked()) return true;
|
||||
return game.hasPlayer(function(current){
|
||||
return current!=player&&!current.isLinked();
|
||||
});
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
event.targets=game.filterPlayer();
|
||||
event.targets.remove(player);
|
||||
event.targets.sort(lib.sort.seat);
|
||||
if(player.isLinked()) player.link();
|
||||
"step 1"
|
||||
if(event.targets.length){
|
||||
var target=event.targets.shift();
|
||||
if(!target.isLinked()){
|
||||
target.link();
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
event.targets=game.filterPlayer();
|
||||
event.targets.remove(player);
|
||||
event.targets.sort(lib.sort.seat);
|
||||
if(player.isLinked()) player.link();
|
||||
"step 1"
|
||||
if(event.targets.length){
|
||||
var target=event.targets.shift();
|
||||
if(!target.isLinked()){
|
||||
target.link();
|
||||
player.line(target,'green');
|
||||
}
|
||||
event.redo();
|
||||
}
|
||||
}
|
||||
}
|
||||
event.redo();
|
||||
}
|
||||
}
|
||||
},
|
||||
boss_jizhi:{
|
||||
audio:2,
|
||||
|
@ -6236,48 +6236,48 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
qiwu:{
|
||||
audio:true,
|
||||
trigger:{player:'useCard'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return get.suit(event.card)=='club'&&player.hp<player.maxHp;
|
||||
},
|
||||
content:function(){
|
||||
player.recover();
|
||||
}
|
||||
},
|
||||
audio:true,
|
||||
trigger:{player:'useCard'},
|
||||
forced:true,
|
||||
filter:function(event,player){
|
||||
return get.suit(event.card)=='club'&&player.hp<player.maxHp;
|
||||
},
|
||||
content:function(){
|
||||
player.recover();
|
||||
}
|
||||
},
|
||||
jizhen:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
trigger:{player:'phaseEnd'},
|
||||
direct:true,
|
||||
filter:function(event,player){
|
||||
return game.hasPlayer(function(current){
|
||||
return current.isDamaged()&¤t!=player;
|
||||
});
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
var num=0;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(!game.players[i].isLinked()&&player!=game.players[i]){
|
||||
num++;
|
||||
}
|
||||
}
|
||||
player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){
|
||||
return target.hp<target.maxHp&&player!=target;
|
||||
}).ai=function(target){
|
||||
return get.attitude(player,target);
|
||||
}
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.logSkill('jizhen',result.targets);
|
||||
game.asyncDraw(result.targets);
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
expose:0.3,
|
||||
threaten:1.3
|
||||
}
|
||||
},
|
||||
},
|
||||
content:function(){
|
||||
"step 0"
|
||||
var num=0;
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(!game.players[i].isLinked()&&player!=game.players[i]){
|
||||
num++;
|
||||
}
|
||||
}
|
||||
player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){
|
||||
return target.hp<target.maxHp&&player!=target;
|
||||
}).ai=function(target){
|
||||
return get.attitude(player,target);
|
||||
}
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.logSkill('jizhen',result.targets);
|
||||
game.asyncDraw(result.targets);
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
expose:0.3,
|
||||
threaten:1.3
|
||||
}
|
||||
},
|
||||
shenqu:{
|
||||
group:'shenqu2',
|
||||
trigger:{global:'phaseBegin'},
|
||||
|
@ -6626,10 +6626,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
boss_qixiang2:'祺祥',
|
||||
boss_qixiang_info:'乐不思蜀判定时,你的方块判定牌视为红桃;兵粮寸断判定时,你的黑桃判定牌视为草花',
|
||||
|
||||
qiwu:'栖梧',
|
||||
qiwu_info:'锁定技。每当你使用一张梅花牌,你回复一点体力',
|
||||
jizhen:'激阵',
|
||||
jizhen_info:'结束阶段,你可以令所至多两名已受伤角色摸一张牌',
|
||||
qiwu:'栖梧',
|
||||
qiwu_info:'锁定技。每当你使用一张梅花牌,你回复一点体力',
|
||||
jizhen:'激阵',
|
||||
jizhen_info:'结束阶段,你可以令所至多两名已受伤角色摸一张牌',
|
||||
|
||||
boss_yushou:'驭兽',
|
||||
boss_yushou_info:'出牌阶段开始时,你可以对所有敌方角色使用一张南蛮入侵',
|
||||
|
|
4370
mode/brawl.js
4370
mode/brawl.js
File diff suppressed because it is too large
Load Diff
12328
mode/chess.js
12328
mode/chess.js
File diff suppressed because it is too large
Load Diff
258
mode/connect.js
258
mode/connect.js
|
@ -2,156 +2,156 @@
|
|||
game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||
return {
|
||||
name:'connect',
|
||||
start:function(){
|
||||
var directstartmode=lib.config.directstartmode;
|
||||
ui.create.menu(true);
|
||||
start:function(){
|
||||
var directstartmode=lib.config.directstartmode;
|
||||
ui.create.menu(true);
|
||||
event.textnode=ui.create.div('','输入联机地址');
|
||||
var createNode=function(){
|
||||
if(event.created) return;
|
||||
if(directstartmode&&lib.node){
|
||||
ui.exitroom=ui.create.system('退出房间',function(){
|
||||
game.saveConfig('directstartmode');
|
||||
game.reload();
|
||||
},true);
|
||||
game.switchMode(directstartmode);
|
||||
return;
|
||||
}
|
||||
if(lib.node&&window.require){
|
||||
ui.startServer=ui.create.system('启动服务器',function(e){
|
||||
e.stopPropagation();
|
||||
ui.click.connectMenu();
|
||||
},true);
|
||||
}
|
||||
var createNode=function(){
|
||||
if(event.created) return;
|
||||
if(directstartmode&&lib.node){
|
||||
ui.exitroom=ui.create.system('退出房间',function(){
|
||||
game.saveConfig('directstartmode');
|
||||
game.reload();
|
||||
},true);
|
||||
game.switchMode(directstartmode);
|
||||
return;
|
||||
}
|
||||
if(lib.node&&window.require){
|
||||
ui.startServer=ui.create.system('启动服务器',function(e){
|
||||
e.stopPropagation();
|
||||
ui.click.connectMenu();
|
||||
},true);
|
||||
}
|
||||
|
||||
event.created=true;
|
||||
var node=ui.create.div('.shadowed');
|
||||
node.style.width='400px';
|
||||
node.style.height='30px';
|
||||
node.style.lineHeight='30px';
|
||||
node.style.fontFamily='xinwei';
|
||||
node.style.fontSize='30px';
|
||||
node.style.padding='10px';
|
||||
node.style.left='calc(50% - 210px)';
|
||||
node.style.top='calc(50% - 20px)';
|
||||
node.style.whiteSpace='nowrap';
|
||||
node.innerHTML=lib.config.last_ip||lib.hallURL;
|
||||
node.contentEditable=true;
|
||||
node.style.webkitUserSelect='text';
|
||||
node.style.textAlign='center';
|
||||
event.created=true;
|
||||
var node=ui.create.div('.shadowed');
|
||||
node.style.width='400px';
|
||||
node.style.height='30px';
|
||||
node.style.lineHeight='30px';
|
||||
node.style.fontFamily='xinwei';
|
||||
node.style.fontSize='30px';
|
||||
node.style.padding='10px';
|
||||
node.style.left='calc(50% - 210px)';
|
||||
node.style.top='calc(50% - 20px)';
|
||||
node.style.whiteSpace='nowrap';
|
||||
node.innerHTML=lib.config.last_ip||lib.hallURL;
|
||||
node.contentEditable=true;
|
||||
node.style.webkitUserSelect='text';
|
||||
node.style.textAlign='center';
|
||||
|
||||
var connect=function(e){
|
||||
var connect=function(e){
|
||||
event.textnode.innerHTML='正在连接...';
|
||||
clearTimeout(event.timeout);
|
||||
if(e) e.preventDefault();
|
||||
game.saveConfig('last_ip',node.innerHTML);
|
||||
game.connect(node.innerHTML,function(success){
|
||||
clearTimeout(event.timeout);
|
||||
if(e) e.preventDefault();
|
||||
game.saveConfig('last_ip',node.innerHTML);
|
||||
game.connect(node.innerHTML,function(success){
|
||||
if(!success&&event.textnode){
|
||||
alert('连接失败');
|
||||
event.textnode.innerHTML='输入联机地址';
|
||||
}
|
||||
});
|
||||
};
|
||||
node.addEventListener('keydown',function(e){
|
||||
if(e.keyCode==13){
|
||||
connect(e);
|
||||
}
|
||||
});
|
||||
ui.window.appendChild(node);
|
||||
ui.ipnode=node;
|
||||
};
|
||||
node.addEventListener('keydown',function(e){
|
||||
if(e.keyCode==13){
|
||||
connect(e);
|
||||
}
|
||||
});
|
||||
ui.window.appendChild(node);
|
||||
ui.ipnode=node;
|
||||
|
||||
var text=event.textnode;
|
||||
text.style.width='400px';
|
||||
text.style.height='30px';
|
||||
text.style.lineHeight='30px';
|
||||
text.style.fontFamily='xinwei';
|
||||
text.style.fontSize='30px';
|
||||
text.style.padding='10px';
|
||||
text.style.left='calc(50% - 200px)';
|
||||
text.style.top='calc(50% - 80px)';
|
||||
text.style.textAlign='center';
|
||||
ui.window.appendChild(text);
|
||||
ui.iptext=text;
|
||||
var text=event.textnode;
|
||||
text.style.width='400px';
|
||||
text.style.height='30px';
|
||||
text.style.lineHeight='30px';
|
||||
text.style.fontFamily='xinwei';
|
||||
text.style.fontSize='30px';
|
||||
text.style.padding='10px';
|
||||
text.style.left='calc(50% - 200px)';
|
||||
text.style.top='calc(50% - 80px)';
|
||||
text.style.textAlign='center';
|
||||
ui.window.appendChild(text);
|
||||
ui.iptext=text;
|
||||
|
||||
var button=ui.create.div('.menubutton.highlight.large.pointerdiv','连接',connect);
|
||||
button.style.width='70px';
|
||||
button.style.left='calc(50% - 35px)';
|
||||
button.style.top='calc(50% + 60px)';
|
||||
ui.window.appendChild(button);
|
||||
ui.ipbutton=button;
|
||||
var button=ui.create.div('.menubutton.highlight.large.pointerdiv','连接',connect);
|
||||
button.style.width='70px';
|
||||
button.style.left='calc(50% - 35px)';
|
||||
button.style.top='calc(50% + 60px)';
|
||||
ui.window.appendChild(button);
|
||||
ui.ipbutton=button;
|
||||
|
||||
ui.hall_button=ui.create.system('联机大厅',function(){
|
||||
node.innerHTML=get.config('hall_ip')||lib.hallURL;
|
||||
connect();
|
||||
},true);
|
||||
if(!get.config('hall_button')){
|
||||
ui.hall_button.style.display='none';
|
||||
}
|
||||
ui.recentIP=ui.create.system('最近连接',null,true);
|
||||
var clickLink=function(){
|
||||
node.innerHTML=this.innerHTML;
|
||||
connect();
|
||||
};
|
||||
lib.setPopped(ui.recentIP,function(){
|
||||
if(!lib.config.recentIP.length) return;
|
||||
var uiintro=ui.create.dialog('hidden');
|
||||
ui.hall_button=ui.create.system('联机大厅',function(){
|
||||
node.innerHTML=get.config('hall_ip')||lib.hallURL;
|
||||
connect();
|
||||
},true);
|
||||
if(!get.config('hall_button')){
|
||||
ui.hall_button.style.display='none';
|
||||
}
|
||||
ui.recentIP=ui.create.system('最近连接',null,true);
|
||||
var clickLink=function(){
|
||||
node.innerHTML=this.innerHTML;
|
||||
connect();
|
||||
};
|
||||
lib.setPopped(ui.recentIP,function(){
|
||||
if(!lib.config.recentIP.length) return;
|
||||
var uiintro=ui.create.dialog('hidden');
|
||||
uiintro.listen(function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
var list=ui.create.div('.caption');
|
||||
for(var i=0;i<lib.config.recentIP.length;i++){
|
||||
ui.create.div('.text.textlink',list,clickLink).innerHTML=get.trimip(lib.config.recentIP[i]);
|
||||
}
|
||||
uiintro.add(list);
|
||||
var clear=uiintro.add('<div class="text center">清除</div>');
|
||||
clear.style.paddingTop=0;
|
||||
clear.style.paddingBottom='3px';
|
||||
clear.listen(function(){
|
||||
lib.config.recentIP.length=0;
|
||||
game.saveConfig('recentIP',[]);
|
||||
uiintro.delete();
|
||||
});
|
||||
return uiintro;
|
||||
},220);
|
||||
lib.init.onfree();
|
||||
}
|
||||
if(window.isNonameServer){
|
||||
game.connect(window.isNonameServerIp||'localhost');
|
||||
}
|
||||
else if(lib.config.reconnect_info){
|
||||
var info=lib.config.reconnect_info;
|
||||
game.onlineID=info[1];
|
||||
game.roomId=info[2];
|
||||
var list=ui.create.div('.caption');
|
||||
for(var i=0;i<lib.config.recentIP.length;i++){
|
||||
ui.create.div('.text.textlink',list,clickLink).innerHTML=get.trimip(lib.config.recentIP[i]);
|
||||
}
|
||||
uiintro.add(list);
|
||||
var clear=uiintro.add('<div class="text center">清除</div>');
|
||||
clear.style.paddingTop=0;
|
||||
clear.style.paddingBottom='3px';
|
||||
clear.listen(function(){
|
||||
lib.config.recentIP.length=0;
|
||||
game.saveConfig('recentIP',[]);
|
||||
uiintro.delete();
|
||||
});
|
||||
return uiintro;
|
||||
},220);
|
||||
lib.init.onfree();
|
||||
}
|
||||
if(window.isNonameServer){
|
||||
game.connect(window.isNonameServerIp||'localhost');
|
||||
}
|
||||
else if(lib.config.reconnect_info){
|
||||
var info=lib.config.reconnect_info;
|
||||
game.onlineID=info[1];
|
||||
game.roomId=info[2];
|
||||
if(typeof game.roomId=='number'){
|
||||
game.roomIdServer=true;
|
||||
}
|
||||
var n=5;
|
||||
var connect=function(){
|
||||
var n=5;
|
||||
var connect=function(){
|
||||
event.textnode.innerHTML='正在连接...';
|
||||
game.connect(info[0],function(success){
|
||||
if(!success&&n--){
|
||||
createNode();
|
||||
event.timeout=setTimeout(connect,1000);
|
||||
}
|
||||
game.connect(info[0],function(success){
|
||||
if(!success&&n--){
|
||||
createNode();
|
||||
event.timeout=setTimeout(connect,1000);
|
||||
}
|
||||
else{
|
||||
event.textnode.innerHTML='输入联机地址';
|
||||
}
|
||||
});
|
||||
};
|
||||
event.timeout=setTimeout(connect,500);
|
||||
_status.createNodeTimeout=setTimeout(createNode,2000);
|
||||
}
|
||||
else{
|
||||
createNode();
|
||||
}
|
||||
_status.connectDenied=createNode;
|
||||
for(var i in lib.element.event){
|
||||
event.parent[i]=lib.element.event[i];
|
||||
}
|
||||
event.parent.custom={
|
||||
add:{},
|
||||
replace:{}
|
||||
};
|
||||
setTimeout(lib.init.onfree,1000);
|
||||
}
|
||||
});
|
||||
};
|
||||
event.timeout=setTimeout(connect,500);
|
||||
_status.createNodeTimeout=setTimeout(createNode,2000);
|
||||
}
|
||||
else{
|
||||
createNode();
|
||||
}
|
||||
_status.connectDenied=createNode;
|
||||
for(var i in lib.element.event){
|
||||
event.parent[i]=lib.element.event[i];
|
||||
}
|
||||
event.parent.custom={
|
||||
add:{},
|
||||
replace:{}
|
||||
};
|
||||
setTimeout(lib.init.onfree,1000);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||
return {
|
||||
name:'realtime',
|
||||
start:function(){
|
||||
start:function(){
|
||||
|
||||
},
|
||||
game:{
|
||||
},
|
||||
game:{
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
20148
mode/stone.js
20148
mode/stone.js
File diff suppressed because it is too large
Load Diff
272
mode/tafang.js
272
mode/tafang.js
|
@ -17,8 +17,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
ui.roundmenu.style.display='';
|
||||
}
|
||||
if(lib.config.player_border=='normal'&&(lib.config.layout=='long'||lib.config.layout=='long2')){
|
||||
ui.arena.classList.add('lslim_player');
|
||||
}
|
||||
ui.arena.classList.add('lslim_player');
|
||||
}
|
||||
for(var i in result.element){
|
||||
for(var j in result.element[i]){
|
||||
if(j!='dieAfter'){
|
||||
|
@ -50,27 +50,27 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
}
|
||||
// if(!localStorage.getItem(lib.configprefix+'playback')){
|
||||
// game.loadMap();
|
||||
// }
|
||||
// if(!localStorage.getItem(lib.configprefix+'playback')){
|
||||
// game.loadMap();
|
||||
// }
|
||||
"step 2"
|
||||
var result='basic_medium';
|
||||
_status.map=lib.tafang.map[result];
|
||||
_status.mapname=result;
|
||||
_status.mapname=result;
|
||||
ui.chesssheet=document.createElement('style');
|
||||
document.head.appendChild(ui.chesssheet);
|
||||
var playback=localStorage.getItem(lib.configprefix+'playback');
|
||||
lib.mechlist=[];
|
||||
for(var i in lib.characterPack.mode_tafang){
|
||||
if(i.indexOf('tafang_mech_')==0){
|
||||
for(var i in lib.characterPack.mode_tafang){
|
||||
if(i.indexOf('tafang_mech_')==0){
|
||||
lib.characterPack.mode_tafang[i][3].push(i+'_skill');
|
||||
lib.mechlist.push(i);
|
||||
}
|
||||
lib.character[i]=lib.characterPack.mode_tafang[i];
|
||||
if(!lib.character[i][4]){
|
||||
lib.character[i][4]=[];
|
||||
}
|
||||
}
|
||||
lib.mechlist.push(i);
|
||||
}
|
||||
lib.character[i]=lib.characterPack.mode_tafang[i];
|
||||
if(!lib.character[i][4]){
|
||||
lib.character[i][4]=[];
|
||||
}
|
||||
}
|
||||
ui.create.cardsAsync();
|
||||
game.finishCards();
|
||||
game.addGlobalSkill('autoswap');
|
||||
|
@ -105,7 +105,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
_status.mylist=[];
|
||||
_status.enemylist=[];
|
||||
_status.enemylist=[];
|
||||
"step 3"
|
||||
ui.arena.classList.add('chess');
|
||||
if(event.video){
|
||||
|
@ -115,7 +115,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
break;
|
||||
}
|
||||
}
|
||||
_status.map=lib.tafang.map[_status.mapname];
|
||||
_status.map=lib.tafang.map[_status.mapname];
|
||||
game.playerMap=lib.posmap;
|
||||
}
|
||||
ui.chesswidth=_status.map.size[0];
|
||||
|
@ -239,7 +239,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
}
|
||||
lib.init.onfree();
|
||||
event.trigger('gameStart');
|
||||
event.trigger('gameStart');
|
||||
game.phaseLoopTafang();
|
||||
},
|
||||
element:{
|
||||
|
@ -295,19 +295,19 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
tafang:{
|
||||
map:{
|
||||
basic_small:{
|
||||
name:'小型战场',
|
||||
basic_small:{
|
||||
name:'小型战场',
|
||||
size:[6,11],
|
||||
obstacle:[]
|
||||
},
|
||||
basic_medium:{
|
||||
name:'中型战场',
|
||||
},
|
||||
basic_medium:{
|
||||
name:'中型战场',
|
||||
size:[9,11],
|
||||
},
|
||||
basic_large:{
|
||||
name:'大型战场',
|
||||
},
|
||||
basic_large:{
|
||||
name:'大型战场',
|
||||
size:[12,11],
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
game:{
|
||||
|
@ -777,8 +777,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
});
|
||||
},
|
||||
loadMap:function(){
|
||||
var next=game.createEvent('loadMap');
|
||||
next.setContent(function(){
|
||||
var next=game.createEvent('loadMap');
|
||||
next.setContent(function(){
|
||||
if(!lib.storage.map){
|
||||
lib.storage.map=['basic_small','basic_medium','basic_large'];
|
||||
}
|
||||
|
@ -790,10 +790,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
sceneview._scrollspeed=30;
|
||||
sceneview._scrollnum=10;
|
||||
sceneview.onmousewheel=function(){
|
||||
if(!this.classList.contains('lockscroll')){
|
||||
ui.click.mousewheel.apply(this,arguments);
|
||||
}
|
||||
};
|
||||
if(!this.classList.contains('lockscroll')){
|
||||
ui.click.mousewheel.apply(this,arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
lib.setScroll(sceneview);
|
||||
var switchScene=function(){
|
||||
|
@ -801,125 +801,125 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
sceneview.delete();
|
||||
setTimeout(game.resume,300);
|
||||
}
|
||||
var clickScene=function(e){
|
||||
if(this.classList.contains('unselectable')) return;
|
||||
if(this._clicking) return;
|
||||
if(e&&e.stopPropagation) e.stopPropagation();
|
||||
if(this.classList.contains('flipped')){
|
||||
return;
|
||||
}
|
||||
var clickScene=function(e){
|
||||
if(this.classList.contains('unselectable')) return;
|
||||
if(this._clicking) return;
|
||||
if(e&&e.stopPropagation) e.stopPropagation();
|
||||
if(this.classList.contains('flipped')){
|
||||
return;
|
||||
}
|
||||
if(this.classList.contains('glow3')){
|
||||
this.classList.remove('glow3');
|
||||
lib.storage.newmap.remove(this.name);
|
||||
game.save('newmap',lib.storage.newmap);
|
||||
}
|
||||
var sceneNode=this.parentNode;
|
||||
var current=document.querySelector('.flipped.scene');
|
||||
if(current){
|
||||
restoreScene(current,true);
|
||||
}
|
||||
this.content.innerHTML='';
|
||||
var sceneNode=this.parentNode;
|
||||
var current=document.querySelector('.flipped.scene');
|
||||
if(current){
|
||||
restoreScene(current,true);
|
||||
}
|
||||
this.content.innerHTML='';
|
||||
ui.create.div('.menubutton.large.enter','进入',this.content,switchScene).link=this.name;
|
||||
sceneNode.classList.add('lockscroll');
|
||||
var node=this;
|
||||
node._clicking=true;
|
||||
setTimeout(function(){
|
||||
node._clicking=false;
|
||||
},700);
|
||||
sceneNode.dx=ui.window.offsetWidth/2-(-sceneNode.scrollLeft+this.offsetLeft+this.offsetWidth/2);
|
||||
if(Math.abs(sceneNode.dx)<20){
|
||||
sceneNode.dx=0;
|
||||
}
|
||||
if(!sceneNode.sceneInterval&&sceneNode.dx){
|
||||
sceneNode.sceneInterval=setInterval(function(){
|
||||
var dx=sceneNode.dx;
|
||||
if(Math.abs(dx)<=2){
|
||||
sceneNode.scrollLeft-=dx;
|
||||
clearInterval(sceneNode.sceneInterval);
|
||||
delete sceneNode.sceneInterval;
|
||||
}
|
||||
else{
|
||||
var ddx=dx/Math.sqrt(Math.abs(dx))*1.5;
|
||||
sceneNode.scrollLeft-=ddx;
|
||||
sceneNode.dx-=ddx;
|
||||
}
|
||||
},16);
|
||||
}
|
||||
node.style.transition='all ease-in 0.2s';
|
||||
sceneNode.classList.add('lockscroll');
|
||||
var node=this;
|
||||
node._clicking=true;
|
||||
setTimeout(function(){
|
||||
node._clicking=false;
|
||||
},700);
|
||||
sceneNode.dx=ui.window.offsetWidth/2-(-sceneNode.scrollLeft+this.offsetLeft+this.offsetWidth/2);
|
||||
if(Math.abs(sceneNode.dx)<20){
|
||||
sceneNode.dx=0;
|
||||
}
|
||||
if(!sceneNode.sceneInterval&&sceneNode.dx){
|
||||
sceneNode.sceneInterval=setInterval(function(){
|
||||
var dx=sceneNode.dx;
|
||||
if(Math.abs(dx)<=2){
|
||||
sceneNode.scrollLeft-=dx;
|
||||
clearInterval(sceneNode.sceneInterval);
|
||||
delete sceneNode.sceneInterval;
|
||||
}
|
||||
else{
|
||||
var ddx=dx/Math.sqrt(Math.abs(dx))*1.5;
|
||||
sceneNode.scrollLeft-=ddx;
|
||||
sceneNode.dx-=ddx;
|
||||
}
|
||||
},16);
|
||||
}
|
||||
node.style.transition='all ease-in 0.2s';
|
||||
node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)';
|
||||
var onEnd=function(){
|
||||
node.removeEventListener('webkitTransitionEnd',onEnd);
|
||||
node.classList.add('flipped');
|
||||
sceneNode.classList.add('lockscroll');
|
||||
node.style.transition='all ease-out 0.4s';
|
||||
node.removeEventListener('webkitTransitionEnd',onEnd);
|
||||
node.classList.add('flipped');
|
||||
sceneNode.classList.add('lockscroll');
|
||||
node.style.transition='all ease-out 0.4s';
|
||||
node.style.transform='perspective(1600px) rotateY(180deg) scale(1)'
|
||||
};
|
||||
node.listenTransition(onEnd);
|
||||
}
|
||||
ui.click.scene=clickScene;
|
||||
var restoreScene=function(node,forced){
|
||||
if(node._clicking&&!forced) return;
|
||||
if(node.transformInterval){
|
||||
clearInterval(node.transformInterval);
|
||||
delete node.transformInterval;
|
||||
}
|
||||
var sceneNode=node.parentNode;
|
||||
node._clicking=true;
|
||||
setTimeout(function(){
|
||||
node._clicking=false;
|
||||
},700);
|
||||
node.style.transition='all ease-in 0.2s';
|
||||
}
|
||||
ui.click.scene=clickScene;
|
||||
var restoreScene=function(node,forced){
|
||||
if(node._clicking&&!forced) return;
|
||||
if(node.transformInterval){
|
||||
clearInterval(node.transformInterval);
|
||||
delete node.transformInterval;
|
||||
}
|
||||
var sceneNode=node.parentNode;
|
||||
node._clicking=true;
|
||||
setTimeout(function(){
|
||||
node._clicking=false;
|
||||
},700);
|
||||
node.style.transition='all ease-in 0.2s';
|
||||
node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)';
|
||||
var onEnd=function(){
|
||||
node.removeEventListener('webkitTransitionEnd',onEnd);
|
||||
node.classList.remove('flipped');
|
||||
if(!sceneNode.querySelector('.flipped')){
|
||||
sceneNode.classList.remove('lockscroll');
|
||||
}
|
||||
node.style.transition='all ease-out 0.4s';
|
||||
node.removeEventListener('webkitTransitionEnd',onEnd);
|
||||
node.classList.remove('flipped');
|
||||
if(!sceneNode.querySelector('.flipped')){
|
||||
sceneNode.classList.remove('lockscroll');
|
||||
}
|
||||
node.style.transition='all ease-out 0.4s';
|
||||
node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)'
|
||||
};
|
||||
node.listenTransition(onEnd);
|
||||
}
|
||||
ui.click.scene2=restoreScene;
|
||||
var createScene=function(name){
|
||||
var scene=lib.tafang.map[name];
|
||||
var node=ui.create.div('.scene',clickScene);
|
||||
node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)';
|
||||
node.name=name;
|
||||
node.bgnode=ui.create.div('.background.player',node);
|
||||
node.info=scene;
|
||||
ui.create.div('.avatar.menu',node.bgnode);
|
||||
node.namenode=ui.create.div('.name',node,(scene.name));
|
||||
if(lib.storage.map.contains(name)){
|
||||
if(lib.storage.newmap.contains(name)){
|
||||
node.classList.add('glow3');
|
||||
}
|
||||
node.namenode.dataset.nature='soilm';
|
||||
}
|
||||
else{
|
||||
node.classList.add('unselectable');
|
||||
node.namenode.innerHTML=('未开启');
|
||||
}
|
||||
var content=ui.create.div('.menu',node);
|
||||
lib.setScroll(content);
|
||||
node.content=content;
|
||||
sceneview.appendChild(node);
|
||||
return node;
|
||||
}
|
||||
event.custom.add.window=function(){
|
||||
var current=document.querySelector('.flipped.scene');
|
||||
if(current){
|
||||
restoreScene(current);
|
||||
}
|
||||
}
|
||||
for(var i in lib.tafang.map){
|
||||
createScene(i);
|
||||
}
|
||||
ui.window.appendChild(sceneview.animate('start'));
|
||||
game.pause();
|
||||
});
|
||||
},
|
||||
}
|
||||
ui.click.scene2=restoreScene;
|
||||
var createScene=function(name){
|
||||
var scene=lib.tafang.map[name];
|
||||
var node=ui.create.div('.scene',clickScene);
|
||||
node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)';
|
||||
node.name=name;
|
||||
node.bgnode=ui.create.div('.background.player',node);
|
||||
node.info=scene;
|
||||
ui.create.div('.avatar.menu',node.bgnode);
|
||||
node.namenode=ui.create.div('.name',node,(scene.name));
|
||||
if(lib.storage.map.contains(name)){
|
||||
if(lib.storage.newmap.contains(name)){
|
||||
node.classList.add('glow3');
|
||||
}
|
||||
node.namenode.dataset.nature='soilm';
|
||||
}
|
||||
else{
|
||||
node.classList.add('unselectable');
|
||||
node.namenode.innerHTML=('未开启');
|
||||
}
|
||||
var content=ui.create.div('.menu',node);
|
||||
lib.setScroll(content);
|
||||
node.content=content;
|
||||
sceneview.appendChild(node);
|
||||
return node;
|
||||
}
|
||||
event.custom.add.window=function(){
|
||||
var current=document.querySelector('.flipped.scene');
|
||||
if(current){
|
||||
restoreScene(current);
|
||||
}
|
||||
}
|
||||
for(var i in lib.tafang.map){
|
||||
createScene(i);
|
||||
}
|
||||
ui.window.appendChild(sceneview.animate('start'));
|
||||
game.pause();
|
||||
});
|
||||
},
|
||||
},
|
||||
skill:{
|
||||
tafang_mech_weixingxianjing_skill:{
|
||||
|
|
11662
mode/versus.js
11662
mode/versus.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue