This commit is contained in:
Congyue Cui 2018-04-17 15:32:43 +08:00
parent a0dbc01f98
commit 18442f0d7c
47 changed files with 75776 additions and 75504 deletions

15
.eslintrc.json Normal file
View File

@ -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
}
}

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

View File

@ -460,9 +460,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hasSkillTag('unequip',false,card)) return; if(player.hasSkillTag('unequip',false,card)) return;
if(card.name=='nanman'||card.name=='wanjian') return 'zerotarget'; if(card.name=='nanman'||card.name=='wanjian') return 'zerotarget';
if(card.name=='sha'){ if(card.name=='sha'){
var equip1=player.getEquip(1); var equip1=player.getEquip(1);
if(equip1&&equip1.name=='zhuque') return 2; if(equip1&&equip1.name=='zhuque') return 2;
if(equip1&&equip1.name=='qinggang') return 1; if(equip1&&equip1.name=='qinggang') return 1;
if(!card.nature) return 'zerotarget'; if(!card.nature) return 'zerotarget';
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip1', subtype:'equip1',
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
global:'g_feilongduofeng_ai', global:'g_feilongduofeng_ai',
distance:{attackFrom:-1}, distance:{attackFrom:-1},
skills:['feilongduofeng','feilongduofeng2'], skills:['feilongduofeng','feilongduofeng2'],
@ -37,7 +37,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip2', subtype:'equip2',
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
global:['g_taipingyaoshu','g_taipingyaoshu_ai'], global:['g_taipingyaoshu','g_taipingyaoshu_ai'],
skills:['taipingyaoshu'], skills:['taipingyaoshu'],
ai:{ ai:{

View File

@ -451,23 +451,23 @@ game.import('card',function(lib,game,ui,get,ai,_status){
list.push(i); list.push(i);
} }
} }
var players=game.players.concat(game.dead); var players=game.players.concat(game.dead);
for(var i=0;i<players.length;i++){ for(var i=0;i<players.length;i++){
list.remove(players[i].name); list.remove(players[i].name);
list.remove(players[i].name1); list.remove(players[i].name1);
list.remove(players[i].name2); list.remove(players[i].name2);
} }
var dialog=ui.create.dialog('选择一张武将牌','hidden'); var dialog=ui.create.dialog('选择一张武将牌','hidden');
dialog.add([list.randomGets(12),'character']); dialog.add([list.randomGets(12),'character']);
player.chooseButton(dialog,true).ai=function(button){ player.chooseButton(dialog,true).ai=function(button){
if(get.attitude(player,event.aitarget)>0){ if(get.attitude(player,event.aitarget)>0){
return get.rank(button.link,true); return get.rank(button.link,true);
} }
else{ else{
return -get.rank(button.link,true); return -get.rank(button.link,true);
} }
}; };
'step 1' 'step 1'
event.nametarget=result.links[0]; event.nametarget=result.links[0];
player.chooseTarget(true,'使用'+get.translation(event.nametarget)+'替换一名角色的武将牌',function(card,player,target){ player.chooseTarget(true,'使用'+get.translation(event.nametarget)+'替换一名角色的武将牌',function(card,player,target){
return !target.isUnseen()&&!target.isMin(); return !target.isUnseen()&&!target.isMin();
@ -482,9 +482,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
'step 2' 'step 2'
var target=result.targets[0]; var target=result.targets[0];
var hp=target.hp; var hp=target.hp;
target.reinit(target.name,event.nametarget); target.reinit(target.name,event.nametarget);
target.hp=Math.min(hp+1,target.maxHp); target.hp=Math.min(hp+1,target.maxHp);
target.update(); target.update();
player.line(target,'green'); player.line(target,'green');
'step 3' 'step 3'
game.triggerEnter(target); game.triggerEnter(target);
@ -847,9 +847,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return true; return true;
} }
}); });
if(!list.length){ if(!list.length){
list=[cardname]; list=[cardname];
} }
hs2.push(game.createCard(list.randomGet())); hs2.push(game.createCard(list.randomGet()));
} }
var list=get.libCard(function(info){ var list=get.libCard(function(info){
@ -872,9 +872,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return true; return true;
} }
}); });
if(!list.length){ if(!list.length){
list=[cardname]; list=[cardname];
} }
es2.push(game.createCard(list.randomGet())); es2.push(game.createCard(list.randomGet()));
} }
if(es2.length){ if(es2.length){
@ -1039,42 +1039,42 @@ game.import('card',function(lib,game,ui,get,ai,_status){
// }, // },
content:function(){ content:function(){
'step 0' 'step 0'
var list=[]; var list=[];
for(var i in lib.card){ 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].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue;
if(lib.card[i].vanish) continue; if(lib.card[i].vanish) continue;
if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]);
} }
var dialog=ui.create.dialog('卜天术',[list,'vcard']); var dialog=ui.create.dialog('卜天术',[list,'vcard']);
var bing=target.countCards('h')<=1; var bing=target.countCards('h')<=1;
player.chooseButton(dialog,true,function(button){ player.chooseButton(dialog,true,function(button){
if(get.effect(target,{name:button.link[2]},player,player)>0){ if(get.effect(target,{name:button.link[2]},player,player)>0){
if(button.link[2]=='bingliang'){ if(button.link[2]=='bingliang'){
if(bing) return 2; if(bing) return 2;
return 0.7; return 0.7;
} }
if(button.link[2]=='lebu'){ if(button.link[2]=='lebu'){
return 1; return 1;
} }
if(button.link[2]=='guiyoujie'){ if(button.link[2]=='guiyoujie'){
return 0.5; return 0.5;
} }
if(button.link[2]=='caomu'){ if(button.link[2]=='caomu'){
return 0.3; return 0.3;
} }
return 0.2; return 0.2;
} }
return 0; return 0;
}).filterButton=function(button){ }).filterButton=function(button){
return !target.hasJudge(button.link[2]); return !target.hasJudge(button.link[2]);
}; };
'step 1' 'step 1'
var card=game.createCard(result.links[0][2]); var card=game.createCard(result.links[0][2]);
event.judgecard=card; event.judgecard=card;
target.$draw(card); target.$draw(card);
game.delay(0.7); game.delay(0.7);
'step 2' 'step 2'
target.addJudge(event.judgecard); target.addJudge(event.judgecard);
}, },
ai:{ ai:{
value:8, value:8,
@ -1111,7 +1111,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
// game.delay(2); // game.delay(2);
// }, // },
content:function(){ content:function(){
var list=[]; var list=[];
list.push(get.cardPile2('juedou')); list.push(get.cardPile2('juedou'));
list.push(get.cardPile2('huogong')); list.push(get.cardPile2('huogong'));
list.push(get.cardPile2('nanman')); list.push(get.cardPile2('nanman'));
@ -1195,11 +1195,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
// }, // },
content:function(){ content:function(){
'step 0' 'step 0'
var list=[]; var list=[];
for(var i in lib.card){ for(var i in lib.card){
if(lib.card[i].subtype=='spell_bronze') list.push([cards[0].suit,cards[0].number,i]); 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 rand=get.rand();
var aozu=game.hasPlayer(function(current){ var aozu=game.hasPlayer(function(current){
return player.canUse('gw_aozuzhilei',current)&&current.hp<=3&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; return player.canUse('gw_aozuzhilei',current)&&current.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){ var yanzi=game.hasPlayer(function(current){
return get.attitude(player,current)>0&&current.isMinHandcard(); return get.attitude(player,current)>0&&current.isMinHandcard();
}); });
player.chooseButton(dialog,true,function(button){ player.chooseButton(dialog,true,function(button){
var name=button.link[2]; var name=button.link[2];
switch(name){ switch(name){
case 'gw_ciguhanshuang': case 'gw_ciguhanshuang':
@ -1254,17 +1254,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
})){ })){
return Math.random(); return Math.random();
} }
return 0; return 0;
}).filterButton=function(button){ }).filterButton=function(button){
var name=button.link[2]; var name=button.link[2];
if(!lib.card[name].notarget){ if(!lib.card[name].notarget){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return player.canUse(name,current); return player.canUse(name,current);
}) })
} }
return true; return true;
}; };
'step 1' 'step 1'
player.chooseUseTarget(game.createCard(result.links[0][2],get.suit(card),get.number(card))); player.chooseUseTarget(game.createCard(result.links[0][2],get.suit(card),get.number(card)));
}, },
ai:{ ai:{
@ -1396,10 +1396,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !target.hasSkill('gw_qinpendayu'); return !target.hasSkill('gw_qinpendayu');
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
game.filterPlayer(function(current){ game.filterPlayer(function(current){
return get.distance(targets[0],current,'pure')==1; return get.distance(targets[0],current,'pure')==1;
},targets); },targets);
}, },
content:function(){ content:function(){
target.addSkill('gw_qinpendayu'); target.addSkill('gw_qinpendayu');
@ -1409,17 +1409,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){
useful:[3,1], useful:[3,1],
result:{ result:{
player:function(player,target){ player:function(player,target){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current.hasSkill('gw_qinpendayu')) return 0; if(current.hasSkill('gw_qinpendayu')) return 0;
if(current==target||(get.distance(target,current,'pure')==1)){ if(current==target||(get.distance(target,current,'pure')==1)){
var num=-get.sgn(get.attitude(player,current)); var num=-get.sgn(get.attitude(player,current));
if(current.needsToDiscard()) return num; if(current.needsToDiscard()) return num;
if(current.needsToDiscard(1)) return 0.7*num; if(current.needsToDiscard(1)) return 0.7*num;
if(current.needsToDiscard(2)) return 0.4*num; if(current.needsToDiscard(2)) return 0.4*num;
return 0.1*num; return 0.1*num;
} }
}); });
} }
}, },
order:1.2, order:1.2,
} }
@ -1432,10 +1432,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !target.hasSkill('gw_birinongwu'); return !target.hasSkill('gw_birinongwu');
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
game.filterPlayer(function(current){ game.filterPlayer(function(current){
return get.distance(targets[0],current,'pure')==1; return get.distance(targets[0],current,'pure')==1;
},targets); },targets);
}, },
content:function(){ content:function(){
target.addSkill('gw_birinongwu'); target.addSkill('gw_birinongwu');
@ -1445,13 +1445,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
useful:[3,1], useful:[3,1],
result:{ result:{
player:function(player,target){ player:function(player,target){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current.hasSkill('gw_birinongwu')) return 0; if(current.hasSkill('gw_birinongwu')) return 0;
if(current==target||(get.distance(target,current,'pure')==1)){ if(current==target||(get.distance(target,current,'pure')==1)){
return -get.sgn(get.attitude(player,current)); return -get.sgn(get.attitude(player,current));
} }
}); });
} }
}, },
order:1.2, order:1.2,
} }
@ -1464,10 +1464,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !target.hasSkill('gw_ciguhanshuang'); return !target.hasSkill('gw_ciguhanshuang');
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
game.filterPlayer(function(current){ game.filterPlayer(function(current){
return get.distance(targets[0],current,'pure')==1; return get.distance(targets[0],current,'pure')==1;
},targets); },targets);
}, },
content:function(){ content:function(){
target.addSkill('gw_ciguhanshuang'); target.addSkill('gw_ciguhanshuang');
@ -1477,13 +1477,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
useful:[3,1], useful:[3,1],
result:{ result:{
player:function(player,target){ player:function(player,target){
return game.countPlayer(function(current){ return game.countPlayer(function(current){
if(current.hasSkill('gw_ciguhanshuang')) return 0; if(current.hasSkill('gw_ciguhanshuang')) return 0;
if(current==target||(get.distance(target,current,'pure')==1)){ if(current==target||(get.distance(target,current,'pure')==1)){
return -get.sgn(get.attitude(player,current)); return -get.sgn(get.attitude(player,current));
} }
}); });
} }
}, },
order:1.2, order:1.2,
} }
@ -1927,20 +1927,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){
gw_baobaoshu:{ gw_baobaoshu:{
mark:true, mark:true,
nopop:true, nopop:true,
intro:{ intro:{
content:'每使用一张基本牌或锦囊牌,需弃置一张牌' content:'每使用一张基本牌或锦囊牌,需弃置一张牌'
}, },
trigger:{player:'useCard'}, trigger:{player:'useCard'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.countCards('he')==0) return false; if(player.countCards('he')==0) return false;
var type=get.type(event.card,'trick'); var type=get.type(event.card,'trick');
return type=='basic'||type=='trick'; return type=='basic'||type=='trick';
}, },
content:function(){ content:function(){
if(!event.isMine()) game.delay(0.5); if(!event.isMine()) game.delay(0.5);
player.chooseToDiscard(true,'he'); player.chooseToDiscard(true,'he');
}, },
ai:{ ai:{
weather:true, weather:true,
effect:{ effect:{
@ -1978,41 +1978,41 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
}, },
gw_youer:{ gw_youer:{
trigger:{global:'phaseEnd',player:'dieBegin'}, trigger:{global:'phaseEnd',player:'dieBegin'},
forced:true, forced:true,
audio:false, audio:false,
mark:true, mark:true,
intro:{ intro:{
content:'cards' content:'cards'
}, },
content:function(){ content:function(){
if(player.storage.gw_youer){ if(player.storage.gw_youer){
if(trigger.name=='phase'){ if(trigger.name=='phase'){
player.gain(player.storage.gw_youer); player.gain(player.storage.gw_youer);
} }
else{ else{
player.$throw(player.storage.gw_youer,1000); player.$throw(player.storage.gw_youer,1000);
for(var i=0;i<player.storage.gw_youer.length;i++){ for(var i=0;i<player.storage.gw_youer.length;i++){
player.storage.gw_youer[i].discard(); player.storage.gw_youer[i].discard();
} }
game.log(player,'弃置了',player.storage.gw_youer); game.log(player,'弃置了',player.storage.gw_youer);
} }
} }
delete player.storage.gw_youer; delete player.storage.gw_youer;
player.removeSkill('gw_youer'); player.removeSkill('gw_youer');
}, },
}, },
gw_qinpendayu:{ gw_qinpendayu:{
mark:true, mark:true,
nopop:true, nopop:true,
intro:{ intro:{
content:'手牌上限-1直到下一个弃牌阶段结束' content:'手牌上限-1直到下一个弃牌阶段结束'
}, },
mod:{ mod:{
maxHandcard:function(player,num){ maxHandcard:function(player,num){
return num-1; return num-1;
} }
}, },
ai:{ ai:{
weather:true weather:true
}, },
@ -2026,18 +2026,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
} }
} }
}, },
gw_birinongwu:{ gw_birinongwu:{
mark:true, mark:true,
nopop:true, nopop:true,
intro:{ intro:{
content:'不能使用杀直到下一个出牌阶段结束' content:'不能使用杀直到下一个出牌阶段结束'
}, },
mod:{ mod:{
cardEnabled:function(card){ cardEnabled:function(card){
if(card.name=='sha') return false; if(card.name=='sha') return false;
} }
}, },
ai:{ ai:{
weather:true weather:true
}, },
@ -2054,19 +2054,19 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
gw_ciguhanshuang:{ gw_ciguhanshuang:{
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
forced:true, forced:true,
mark:true, mark:true,
nopop:true, nopop:true,
intro:{ intro:{
content:'下个摸牌阶段摸牌数-1' content:'下个摸牌阶段摸牌数-1'
}, },
filter:function(event){ filter:function(event){
return event.num>0; return event.num>0;
}, },
content:function(){ content:function(){
trigger.num--; trigger.num--;
player.removeSkill('gw_ciguhanshuang'); player.removeSkill('gw_ciguhanshuang');
}, },
ai:{ ai:{
weather:true weather:true
} }

View File

@ -566,7 +566,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
} }
} }
}, },
zhiliaobo:{ zhiliaobo:{
fullskin:true, fullskin:true,
enable:true, enable:true,

View File

@ -294,15 +294,15 @@ game.import('card',function(lib,game,ui,get,ai,_status){
selectTarget:-1 selectTarget:-1
}, },
shengdong:{ shengdong:{
fullskin:true, fullskin:true,
enable:function(){ enable:function(){
return game.countPlayer()>2; return game.countPlayer()>2;
}, },
chongzhu:function(){ chongzhu:function(){
return game.countPlayer()<=2; return game.countPlayer()<=2;
}, },
singleCard:true, singleCard:true,
type:'trick', type:'trick',
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
targetprompt:['给一张牌','得两张牌'], targetprompt:['给一张牌','得两张牌'],
@ -361,19 +361,22 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
} }
if(!ok) return 0; 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(target.countCards('he')==0) return 0;
if(player.hasFriend()) return -1; if(player.hasFriend()) return -1;
return 0; return 0;
} }
} }
} }
}, },
zengbin:{ zengbin:{
fullskin:true, fullskin:true,
enable:true, enable:true,
type:'trick', type:'trick',
filterTarget:true, filterTarget:true,
content:function(){ content:function(){
'step 0' 'step 0'
target.draw(3); target.draw(3);
@ -411,11 +414,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
} }
} }
} }
}, },
caomu:{ caomu:{
fullskin:true, fullskin:true,
enable:true, enable:true,
type:'delay', type:'delay',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&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:{ skill:{
lanyinjia:{ lanyinjia:{
@ -974,22 +977,22 @@ game.import('card',function(lib,game,ui,get,ai,_status){
muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。', muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。',
du:'毒', du:'毒',
du_info:'当你因使用、打出或弃置而失去此牌时,你失去一点体力', du_info:'当你因使用、打出或弃置而失去此牌时,你失去一点体力',
shengdong:'声东击西', shengdong:'声东击西',
shengdong_info:'出牌阶段对一名其他角色使用。你交给目标角色一张手牌若如此做其将两张牌交给另一名由你选择的其他角色不足则全给存活角色不超过2时可重铸', shengdong_info:'出牌阶段对一名其他角色使用。你交给目标角色一张手牌若如此做其将两张牌交给另一名由你选择的其他角色不足则全给存活角色不超过2时可重铸',
zengbin:'增兵减灶', zengbin:'增兵减灶',
zengbin_info:'出牌阶段对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌', zengbin_info:'出牌阶段对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌',
caomu:'草木皆兵', caomu:'草木皆兵',
caomu_info:'出牌阶段对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里若判定结果不为梅花摸牌阶段目标角色少摸一张牌摸牌阶段结束时与其距离为1的角色各摸一张牌', caomu_info:'出牌阶段对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里若判定结果不为梅花摸牌阶段目标角色少摸一张牌摸牌阶段结束时与其距离为1的角色各摸一张牌',
}, },
list:[ list:[
['spade',1,'caomu'], ['spade',1,'caomu'],
['club',3,'caomu'], ['club',3,'caomu'],
['heart',12,'shengdong',], ['heart',12,'shengdong',],
['club',9,'shengdong'], ['club',9,'shengdong'],
['spade',9,'shengdong'], ['spade',9,'shengdong'],
['diamond',4,'zengbin'], ['diamond',4,'zengbin'],
['heart',6,'zengbin'], ['heart',6,'zengbin'],
['spade',7,'zengbin'], ['spade',7,'zengbin'],
['spade',3,'du'], ['spade',3,'du'],
['spade',9,'du'], ['spade',9,'du'],
['club',3,'du'], ['club',3,'du'],

View File

@ -556,8 +556,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
target:1 target:1
}, },
order:function(){ order:function(){
return get.order({name:'sha'})+0.1; return get.order({name:'sha'})+0.1;
}, },
} }
}, },
xuejibingbao:{ xuejibingbao:{
@ -733,7 +733,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip5', subtype:'equip5',
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
skills:['donghuangzhong'], skills:['donghuangzhong'],
ai:{ ai:{
equipValue:7 equipValue:7
@ -745,7 +745,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip1', subtype:'equip1',
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
skills:['xuanyuanjian','xuanyuanjian2','xuanyuanjian3'], skills:['xuanyuanjian','xuanyuanjian2','xuanyuanjian3'],
enable:function(card,player){ enable:function(card,player){
return player.hasSkill('xuanyuan')||player.hp>2; return player.hasSkill('xuanyuan')||player.hp>2;
@ -770,7 +770,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['pangufu'], skills:['pangufu'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
distance:{attackFrom:-3}, distance:{attackFrom:-3},
ai:{ ai:{
equipValue:8 equipValue:8
@ -784,7 +784,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
loseDelay:false, loseDelay:false,
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
onEquip:function(){ onEquip:function(){
player.markSkill('lianyaohu_skill'); player.markSkill('lianyaohu_skill');
}, },
@ -804,7 +804,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['haotianta'], skills:['haotianta'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:7 equipValue:7
} }
@ -816,7 +816,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['kongxin'], skills:['kongxin'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:6 equipValue:6
} }
@ -828,7 +828,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['shennongding'], skills:['shennongding'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:6 equipValue:6
} }
@ -840,7 +840,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['kongdongyin'], skills:['kongdongyin'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hp==2) return 7; if(player.hp==2) return 7;
@ -859,7 +859,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['kunlunjingc'], skills:['kunlunjingc'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:6 equipValue:6
} }
@ -871,7 +871,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['nvwashi'], skills:['nvwashi'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:5 equipValue:5
} }
@ -2545,8 +2545,8 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
order:function(){ order:function(){
return get.order({name:'sha'})+0.11; return get.order({name:'sha'})+0.11;
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
return get.effect(target,{name:'sha'},player,target); return get.effect(target,{name:'sha'},player,target);

File diff suppressed because it is too large Load Diff

View File

@ -117,6 +117,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
mark:true, mark:true,
audio:2, audio:2,
unique:true,
filter:function(event){ filter:function(event){
return event.num>0; return event.num>0;
}, },

View File

@ -38,7 +38,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zuiji:{ zuiji:{
enable:'phaseUse', enable:'phaseUse',
filterCard:true, filterCard:true,
position:'he', position:'he',
viewAs:{name:'jiu'}, viewAs:{name:'jiu'},
viewAsFilter:function(player){ viewAsFilter:function(player){
if(!player.countCards('he')) return false; if(!player.countCards('he')) return false;
@ -451,7 +451,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
result:{ result:{
target:function(player,target){ target:function(player,target){
return get.equipResult(player,target,name); return get.equipResult(player,target,name);
} }
} }
} }
} }
@ -1540,8 +1540,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
gjqt_xiayize:'夏夷则', gjqt_xiayize:'夏夷则',
gjqt_aruan:'阿阮', gjqt_aruan:'阿阮',
zuiji:'醉饮', zuiji:'醉饮',
zuiji_info:'出牌阶段,你可以将一张手牌或装备牌当作酒使用', zuiji_info:'出牌阶段,你可以将一张手牌或装备牌当作酒使用',
manwu:'曼舞', manwu:'曼舞',
manwu_info:'在一名角色的结束阶段,若其手牌数为全场最少或之一,你可以令其摸一张牌', manwu_info:'在一名角色的结束阶段,若其手牌数为全场最少或之一,你可以令其摸一张牌',
xfanghua:'芳华', xfanghua:'芳华',

View File

@ -163,9 +163,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
'step 0' 'step 0'
var list=[]; var list=[];
for(var i in lib.card){ for(var i in lib.card){
if(lib.card[i].subtype=='spell_bronze') list.push(i); if(lib.card[i].subtype=='spell_bronze') list.push(i);
} }
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(!player.hasUseTarget(list[i])){ if(!player.hasUseTarget(list[i])){
list.splice(i--,1); list.splice(i--,1);
@ -229,8 +229,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})){ })){
return Math.random(); return Math.random();
} }
return 0; return 0;
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('gwhuanshuang'); player.logSkill('gwhuanshuang');
@ -755,11 +755,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
gain:{ gain:{
trigger:{player:'damageZero'}, trigger:{player:'damageZero'},
filter:function(event){ filter:function(event){
return event.hujia; return event.hujia;
}, },
forced:true, forced:true,
content:function(){ content:function(){
player.storage.gwweitu++; player.storage.gwweitu++;
if(player.storage.gwweitu>=3){ if(player.storage.gwweitu>=3){
player.storage.gwweitu-=3; player.storage.gwweitu-=3;
player.unmarkSkill('gwweitu'); player.unmarkSkill('gwweitu');
@ -771,7 +771,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
else{ else{
player.markSkill('gwweitu',true); player.markSkill('gwweitu',true);
} }
} }
} }
}, },
ai:{ ai:{
@ -1068,8 +1068,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
// changeTarget:function(player,targets){ // changeTarget:function(player,targets){
// if(!player.getStat('damage')){ // if(!player.getStat('damage')){
// game.filterPlayer(function(current){ // game.filterPlayer(function(current){
// return get.distance(targets[0],current,'pure')==1; // return get.distance(targets[0],current,'pure')==1;
// },targets); // },targets);
// } // }
// }, // },
selectTarget:function(){ selectTarget:function(){
@ -1318,36 +1318,36 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
gwfusheng:{ gwfusheng:{
enable:'chooseToUse', enable:'chooseToUse',
filter:function(event,player){ filter:function(event,player){
return event.type=='dying'&&event.dying&&!event.dying.isTurnedOver(); return event.type=='dying'&&event.dying&&!event.dying.isTurnedOver();
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target==_status.event.dying; return target==_status.event.dying;
}, },
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
target.turnOver(); target.turnOver();
target.recover(); target.recover();
if(player!=target){ if(player!=target){
game.asyncDraw([player,target]); game.asyncDraw([player,target]);
} }
else{ else{
player.draw(2); player.draw(2);
} }
}, },
ai:{ ai:{
order:0.1, order:0.1,
skillTagFilter:function(player){ skillTagFilter:function(player){
if(!_status.event.dying||_status.event.dying.isTurnedOver()) return false; if(!_status.event.dying||_status.event.dying.isTurnedOver()) return false;
}, },
save:true, save:true,
result:{ result:{
target:3 target:3
}, },
threaten:1.6 threaten:1.6
}, },
}, },
gwqinwu:{ gwqinwu:{
trigger:{player:'useCard'}, trigger:{player:'useCard'},
filter:function(event,player){ filter:function(event,player){
@ -1471,9 +1471,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.storage.gwjieyin.length<3; return player.storage.gwjieyin.length<3;
}, },
chooseButton:{ chooseButton:{
dialog:function(event,player){ dialog:function(event,player){
return ui.create.dialog('结印',[[['','','gw_wenyi'],['','','gw_yanziyaoshui'],['','','gw_kunenfayin']],'vcard'],'hidden'); return ui.create.dialog('结印',[[['','','gw_wenyi'],['','','gw_yanziyaoshui'],['','','gw_kunenfayin']],'vcard'],'hidden');
}, },
filter:function(button,player){ filter:function(button,player){
if(player.storage.gwjieyin.contains(button.link[2])){ if(player.storage.gwjieyin.contains(button.link[2])){
return false; return false;
@ -1516,22 +1516,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 1; return 1;
} }
}, },
backup:function(links,player){ backup:function(links,player){
return { return {
filterCard:function(){return false}, filterCard:function(){return false},
selectCard:-1, selectCard:-1,
viewAs:{name:links[0][2]}, viewAs:{name:links[0][2]},
popname:true, popname:true,
onuse:function(result,player){ onuse:function(result,player){
player.logSkill('gwjieyin'); player.logSkill('gwjieyin');
player.storage.gwjieyin.add(result.card.name); player.storage.gwjieyin.add(result.card.name);
} }
} }
}, },
prompt:function(links,player){ prompt:function(links,player){
return '选择'+get.translation(links[0][2])+'的目标'; return '选择'+get.translation(links[0][2])+'的目标';
} }
}, },
subSkill:{ subSkill:{
reset:{ reset:{
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
@ -1593,11 +1593,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
draw:{ draw:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
return player.storage.zhengjun.length>=1; return player.storage.zhengjun.length>=1;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
if(player.storage.zhengjun.length==1){ if(player.storage.zhengjun.length==1){
player.draw(); player.draw();
@ -1615,11 +1615,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.gain(card,'draw'); player.gain(card,'draw');
event.cards.remove(card); event.cards.remove(card);
} }
'step 2' 'step 2'
while(event.cards.length){ while(event.cards.length){
ui.cardPile.insertBefore(event.cards.pop(),ui.cardPile.firstChild); 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, forced:true,
content:function(){ content:function(){
'step 0' 'step 0'
var list=get.gainableSkills(function(info){ var list=get.gainableSkills(function(info){
if(typeof info.enable=='string') return info.enable=='phaseUse'; if(typeof info.enable=='string') return info.enable=='phaseUse';
if(Array.isArray(info.enable)) return info.enable.contains('phaseUse'); if(Array.isArray(info.enable)) return info.enable.contains('phaseUse');
},player); },player);
list.remove(player.getSkills()); list.remove(player.getSkills());
list=list.randomGets(3); list=list.randomGets(3);
event.skillai=function(){ event.skillai=function(){
return get.max(list,get.skillRank,'item'); return get.max(list,get.skillRank,'item');
}; };
if(event.isMine()){ if(event.isMine()){
var dialog=ui.create.dialog('forcebutton'); var dialog=ui.create.dialog('forcebutton');
dialog.add('风驰:选择获得一项技能'); dialog.add('风驰:选择获得一项技能');
var clickItem=function(){ var clickItem=function(){
_status.event._result=this.link; _status.event._result=this.link;
dialog.close(); dialog.close();
game.resume(); game.resume();
}; };
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(lib.translate[list[i]+'_info']){ if(lib.translate[list[i]+'_info']){
var translation=get.translation(list[i]); var translation=get.translation(list[i]);
if(translation[0]=='新'&&translation.length==3){ if(translation[0]=='新'&&translation.length==3){
translation=translation.slice(1,3); translation=translation.slice(1,3);
} }
else{ else{
translation=translation.slice(0,2); translation=translation.slice(0,2);
} }
var item=dialog.add('<div class="popup pointerdiv" style="width:80%;display:inline-block"><div class="skill">【'+ 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>'); translation+'】</div><div>'+lib.translate[list[i]+'_info']+'</div></div>');
item.firstChild.addEventListener('click',clickItem); item.firstChild.addEventListener('click',clickItem);
item.firstChild.link=list[i]; item.firstChild.link=list[i];
} }
} }
dialog.add(ui.create.div('.placeholder')); dialog.add(ui.create.div('.placeholder'));
event.switchToAuto=function(){ event.switchToAuto=function(){
event._result=event.skillai(); event._result=event.skillai();
dialog.close(); dialog.close();
game.resume(); game.resume();
}; };
_status.imchoosing=true; _status.imchoosing=true;
game.pause(); game.pause();
} }
else{ else{
event._result=event.skillai(); event._result=event.skillai();
} }
'step 1' 'step 1'
_status.imchoosing=false; _status.imchoosing=false;
var link=result; var link=result;
player.addTempSkill(link,'phaseUseAfter'); player.addTempSkill(link,'phaseUseAfter');
player.popup(link); player.popup(link);
player.flashAvatar('gwfengchi',link); player.flashAvatar('gwfengchi',link);
game.log(player,'获得了技能','【'+get.translation(link)+'】'); game.log(player,'获得了技能','【'+get.translation(link)+'】');
game.delay(); game.delay();
} }
}, },
lingji:{ lingji:{
@ -1892,14 +1892,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
gwjinyan:{ gwjinyan:{
trigger:{player:['damageBefore']}, trigger:{player:['damageBefore']},
forced:true, forced:true,
mark:true, mark:true,
filter:function(event,player){ filter:function(event,player){
return game.roundNumber%3!=0; return game.roundNumber%3!=0;
}, },
content:function(){ content:function(){
trigger.cancel(); trigger.cancel();
}, },
group:['gwjinyan_gain'], group:['gwjinyan_gain'],
subSkill:{ subSkill:{
gain:{ gain:{
@ -1916,7 +1916,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
}, },
ai:{ ai:{
threaten:function(){ threaten:function(){
if(game.roundNumber%3==0) return 1.6; if(game.roundNumber%3==0) return 1.6;
return 0.8; return 0.8;
@ -1927,14 +1927,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillTagFilter:function(){ skillTagFilter:function(){
if(game.roundNumber%3==0) return false; if(game.roundNumber%3==0) return false;
}, },
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(game.roundNumber%3!=0&&get.tag(card,'damage')){ if(game.roundNumber%3!=0&&get.tag(card,'damage')){
return [0,0]; return [0,0];
} }
} }
} }
} }
}, },
gwshenyu:{ gwshenyu:{
trigger:{player:'phaseBegin'}, trigger:{player:'phaseBegin'},
@ -1980,8 +1980,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return num*att; return num*att;
}; };
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('gwshenyu',result.targets); player.logSkill('gwshenyu',result.targets);
event.target=result.targets[0]; event.target=result.targets[0];
if(!event.list.length){ if(!event.list.length){
event.target.recover(); event.target.recover();
@ -1999,7 +1999,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'回复一点体力','从弃牌堆中获得一张非金法术' '回复一点体力','从弃牌堆中获得一张非金法术'
]); ]);
} }
} }
else{ else{
event.finish(); event.finish();
} }
@ -2167,20 +2167,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hupeng2:{ hupeng2:{
mod:{ mod:{
cardDiscardable:function(card,player){ cardDiscardable:function(card,player){
if(card.name=='gw_dudayuanshuai2') return false; if(card.name=='gw_dudayuanshuai2') return false;
}, },
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(card.name=='gw_dudayuanshuai2') return false; if(card.name=='gw_dudayuanshuai2') return false;
}, },
cardUsable:function(card,player){ cardUsable:function(card,player){
if(card.name=='gw_dudayuanshuai2') return false; if(card.name=='gw_dudayuanshuai2') return false;
}, },
cardRespondable:function(card,player){ cardRespondable:function(card,player){
if(card.name=='gw_dudayuanshuai2') return false; if(card.name=='gw_dudayuanshuai2') return false;
}, },
cardSavable:function(card,player){ cardSavable:function(card,player){
if(card.name=='gw_dudayuanshuai2') return false; if(card.name=='gw_dudayuanshuai2') return false;
}, },
}, },
ai:{ ai:{
effect:{ effect:{
@ -2363,33 +2363,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
yinzhang:{ yinzhang:{
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterCard:true, filterCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 8-get.value(card) return 8-get.value(card)
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var list=get.typeCard('spell_silver').randomGets(3); var list=get.typeCard('spell_silver').randomGets(3);
if(!list.length){ if(!list.length){
event.finish(); event.finish();
return; return;
} }
var dialog=ui.create.dialog('选择一张加入你的手牌',[list,'vcard'],'hidden'); var dialog=ui.create.dialog('选择一张加入你的手牌',[list,'vcard'],'hidden');
player.chooseButton(dialog,true); player.chooseButton(dialog,true);
'step 1' 'step 1'
player.gain(game.createCard(result.links[0][2]),'draw'); player.gain(game.createCard(result.links[0][2]),'draw');
}, },
ai:{ ai:{
order:8, order:8,
threaten:1.3, threaten:1.3,
result:{ result:{
player:1 player:1
}, },
} }
}, },
gwtianbian:{ gwtianbian:{
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
direct:true, direct:true,
@ -2575,17 +2575,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
nuhou:{ nuhou:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.countCards('he')>0; return player.countCards('he')>0;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseToDiscard(get.prompt2('nuhou'),'he').set('ai',function(card){ player.chooseToDiscard(get.prompt2('nuhou'),'he').set('ai',function(card){
return 8-get.useful(card); return 8-get.useful(card);
}).set('logSkill','nuhou'); }).set('logSkill','nuhou');
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var targets=player.getEnemies(); var targets=player.getEnemies();
if(targets.length){ if(targets.length){
var target=targets.randomGet(); var target=targets.randomGet();
@ -2593,10 +2593,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target.damage(); target.damage();
target.randomDiscard(); target.randomDiscard();
} }
} }
}, },
ai:{ ai:{
threaten:0.8, threaten:0.8,
maixie:true, maixie:true,
maixie_hp:true, maixie_hp:true,
maixie_defend:true, maixie_defend:true,
@ -2610,7 +2610,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
} }
} }
}, },
shewu:{ shewu:{
enable:'phaseUse', enable:'phaseUse',
@ -3892,10 +3892,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
!target.hasSkill('gw_qinpendayu')|| !target.hasSkill('gw_qinpendayu')||
!target.hasSkill('gw_birinongwu'); !target.hasSkill('gw_birinongwu');
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
game.filterPlayer(function(current){ game.filterPlayer(function(current){
return get.distance(targets[0],current,'pure')==1; return get.distance(targets[0],current,'pure')==1;
},targets); },targets);
}, },
contentAfter:function(){ contentAfter:function(){
var evt=_status.event.getParent('phaseUse'); var evt=_status.event.getParent('phaseUse');
@ -4180,9 +4180,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
}, },
cardType:{ cardType:{
gwmaoxian:0.5 gwmaoxian:0.5
}, },
translate:{ translate:{
gw_huoge:'霍格', gw_huoge:'霍格',
gw_aisinie:'埃丝涅', gw_aisinie:'埃丝涅',

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,14 +2,14 @@
game.import('character',function(lib,game,ui,get,ai,_status){ game.import('character',function(lib,game,ui,get,ai,_status){
return { return {
name:'mtg', name:'mtg',
character:{ character:{
mtg_jiding:['male','qun',4,['mbaizhan','msilian']], mtg_jiding:['male','qun',4,['mbaizhan','msilian']],
// mtg_qianzhuo:['female','shu',3,[]], // mtg_qianzhuo:['female','shu',3,[]],
mtg_jiesi:['male','wei',3,['mtongnian','msuoling','mhuanyi']], mtg_jiesi:['male','wei',3,['mtongnian','msuoling','mhuanyi']],
mtg_lilianna:['female','qun',3,['lingyong','mduohun']], mtg_lilianna:['female','qun',3,['lingyong','mduohun']],
// mtg_nisha:['female','wu',3,[]], // mtg_nisha:['female','wu',3,[]],
// mtg_ayeni:['male','qun',4,[]], // mtg_ayeni:['male','qun',4,[]],
}, },
characterIntro:{ characterIntro:{
mtg_jiding:'这名白色魔法的使用者极其注重忠诚,正义和荣誉。他曾全力追捕茜卓纳拉,如今已不可思议地与这位火焰法师成为伙伴。', mtg_jiding:'这名白色魔法的使用者极其注重忠诚,正义和荣誉。他曾全力追捕茜卓纳拉,如今已不可思议地与这位火焰法师成为伙伴。',
mtg_qianzhuo:'茜卓纳拉是使用红色法术力的旅法师。她擅长使用火焰:除了火焰,还是火焰。茜卓性格冲动、易怒、富有激情,不断增长的火焰法术能力随时都准备爆发。她的火花在还很年轻时便已点燃,如今已是相当有经验的烈焰术士和旅法师。', mtg_qianzhuo:'茜卓纳拉是使用红色法术力的旅法师。她擅长使用火焰:除了火焰,还是火焰。茜卓性格冲动、易怒、富有激情,不断增长的火焰法术能力随时都准备爆发。她的火花在还很年轻时便已点燃,如今已是相当有经验的烈焰术士和旅法师。',
@ -18,7 +18,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mtg_nisha:'赞迪卡妖精部落玖瑞加的一名战士,做事倾尽全力,与大地有密切的联系,还擅使元素魔法。她能够引导时空的魔法生机地脉,为土地赋予生命。', mtg_nisha:'赞迪卡妖精部落玖瑞加的一名战士,做事倾尽全力,与大地有密切的联系,还擅使元素魔法。她能够引导时空的魔法生机地脉,为土地赋予生命。',
mtg_ayeni:'金鬃阿耶尼是使用白色法术的鹏洛客。他长于净化身体与心灵的法术:用咒语来治疗、强化盟友,以及唤醒他人内在的心灵精华。', mtg_ayeni:'金鬃阿耶尼是使用白色法术的鹏洛客。他长于净化身体与心灵的法术:用咒语来治疗、强化盟友,以及唤醒他人内在的心灵精华。',
}, },
skill:{ skill:{
mduohun:{ mduohun:{
trigger:{player:'dyingAfter'}, trigger:{player:'dyingAfter'},
forced:true, forced:true,
@ -30,17 +30,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.source.loseHp(); trigger.source.loseHp();
}, },
ai:{ ai:{
threaten:function(player,target){ threaten:function(player,target){
if(target.hp==1) return 0.6; if(target.hp==1) return 0.6;
return 1; return 1;
}, },
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-1]; if(target.hp<=1&&get.tag(card,'damage')) return [1,0,0,-1];
} }
} }
} }
}, },
lingyong:{ lingyong:{
enable:'phaseUse', enable:'phaseUse',
@ -463,9 +463,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
} }
}, },
translate:{ translate:{
mtg_jiding:'基定', mtg_jiding:'基定',
mtg_qianzhuo:'茜卓', mtg_qianzhuo:'茜卓',
mtg_jiesi:'杰斯', mtg_jiesi:'杰斯',
mtg_lilianna:'莉莲娜', mtg_lilianna:'莉莲娜',
@ -490,6 +490,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
msuoling_old_info:'出牌阶段限一次若你手牌中有替身牌且手牌数不超过5你可以展示手牌若其中的非替身手牌能通过四则运算得到你的替身牌的点数你将替身牌转化为非替身牌然后获得一张新的替身牌此技能托管无效', msuoling_old_info:'出牌阶段限一次若你手牌中有替身牌且手牌数不超过5你可以展示手牌若其中的非替身手牌能通过四则运算得到你的替身牌的点数你将替身牌转化为非替身牌然后获得一张新的替身牌此技能托管无效',
mhuanyi:'幻逸', mhuanyi:'幻逸',
mhuanyi_info:'每两轮限一次,结束阶段,你可以选择一名其他角色和一种卡牌类型(选择结果对其他角色不可见),直到下一回合开始,当你首次成为该类型卡牌的惟一目标时,你将目标转移给你指定的角色(目标须合法)', mhuanyi_info:'每两轮限一次,结束阶段,你可以选择一名其他角色和一种卡牌类型(选择结果对其他角色不可见),直到下一回合开始,当你首次成为该类型卡牌的惟一目标时,你将目标转移给你指定的角色(目标须合法)',
}, },
}; };
}); });

View File

@ -2,44 +2,44 @@
game.import('character',function(lib,game,ui,get,ai,_status){ game.import('character',function(lib,game,ui,get,ai,_status){
return { return {
name:'old', name:'old',
character:{ character:{
zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu']], zhangjiao:['male','qun',3,['leiji','guidao','huangtian'],['zhu']],
masu:['male','shu',3,['xinzhan','huilei']], masu:['male','shu',3,['xinzhan','huilei']],
xushu:['male','shu',3,['wuyan','jujian']], xushu:['male','shu',3,['wuyan','jujian']],
fazheng:['male','shu',3,['enyuan','xuanhuo']], fazheng:['male','shu',3,['enyuan','xuanhuo']],
liru:['male','qun',3,['juece','mieji','fencheng']], liru:['male','qun',3,['juece','mieji','fencheng']],
yujin:['male','wei',4,['yizhong']], yujin:['male','wei',4,['yizhong']],
lusu:['male','wu',3,['haoshi','dimeng']], lusu:['male','wu',3,['haoshi','dimeng']],
yuanshao:['male','qun',4,['luanji','xueyi'],['zhu']], yuanshao:['male','qun',4,['luanji','xueyi'],['zhu']],
old_zhonghui:['male','wei',3,['zzhenggong','zquanji','zbaijiang']], old_zhonghui:['male','wei',3,['zzhenggong','zquanji','zbaijiang']],
old_xusheng:['male','wu',4,['pojun']], old_xusheng:['male','wu',4,['pojun']],
old_zhuran:['male','wu',4,['olddanshou']], old_zhuran:['male','wu',4,['olddanshou']],
old_lingtong:['male','wu',4,['oldxuanfeng']], old_lingtong:['male','wu',4,['oldxuanfeng']],
old_madai:['male','shu',4,['mashu','oldqianxi']], old_madai:['male','shu',4,['mashu','oldqianxi']],
old_caoxiu:['male','wei',4,['taoxi']], old_caoxiu:['male','wei',4,['taoxi']],
old_huaxiong:['male','qun',6,['shiyong']], old_huaxiong:['male','qun',6,['shiyong']],
old_wangyi:['female','wei',3,['oldzhenlie','oldmiji']], old_wangyi:['female','wei',3,['oldzhenlie','oldmiji']],
old_caozhen:['male','wei',4,['sidi']], old_caozhen:['male','wei',4,['sidi']],
old_quancong:['male','wu',4,['zhenshan']], old_quancong:['male','wu',4,['zhenshan']],
old_yuanshu:['male','qun',4,['yongsi','weidi']], old_yuanshu:['male','qun',4,['yongsi','weidi']],
old_lingju:['female','qun',3,['jieyuan','fenxin_old']], old_lingju:['female','qun',3,['jieyuan','fenxin_old']],
}, },
characterFilter:{ characterFilter:{
old_lingju:function(mode){ old_lingju:function(mode){
return mode=='identity'; return mode=='identity';
} }
}, },
skill:{ skill:{
zhenshan:{ zhenshan:{
trigger:{player:'chooseToRespondBegin'}, trigger:{player:'chooseToRespondBegin'},
filter:function(event,player){ filter:function(event,player){
if(event.responded) return false; if(event.responded) return false;
if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false; if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false;
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.countCards('h'); var nh=player.countCards('h');
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.countCards('h')<nh; return current!=player&&current.countCards('h')<nh;
}); });
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -53,33 +53,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(result.bool){ if(result.bool){
trigger.untrigger(); trigger.untrigger();
trigger.responded=true; trigger.responded=true;
if(trigger.filterCard({name:'shan'})){ if(trigger.filterCard({name:'shan'})){
trigger.result={bool:true,card:{name:'shan'}} trigger.result={bool:true,card:{name:'shan'}}
} }
else{ else{
trigger.result={bool:true,card:{name:'sha'}} trigger.result={bool:true,card:{name:'sha'}}
} }
player.logSkill('zhenshan',result.targets); player.logSkill('zhenshan',result.targets);
player.addTempSkill('zhenshan2'); player.addTempSkill('zhenshan2');
player.swapHandcards(result.targets[0]); player.swapHandcards(result.targets[0]);
} }
}, },
group:'zhenshan_use' group:'zhenshan_use'
}, },
zhenshan2:{}, zhenshan2:{},
zhenshan_use:{ zhenshan_use:{
enable:'chooseToUse', enable:'chooseToUse',
filter:function(event,player){ filter:function(event,player){
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.countCards('h'); var nh=player.countCards('h');
if(!game.hasPlayer(function(current){ if(!game.hasPlayer(function(current){
return current!=player&&current.countCards('h')<nh; return current!=player&&current.countCards('h')<nh;
})){ })){
return false; return false;
} }
return event.filterCard({name:'sha'},player,event)|| return event.filterCard({name:'sha'},player,event)||
event.filterCard({name:'jiu'},player,event)|| event.filterCard({name:'jiu'},player,event)||
event.filterCard({name:'tao'},player,event); event.filterCard({name:'tao'},player,event);
}, },
chooseButton:{ chooseButton:{
dialog:function(event,player){ dialog:function(event,player){
@ -100,18 +100,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(button){ check:function(button){
var player=_status.event.player; var player=_status.event.player;
var card={name:button.link[2],nature:button.link[3]}; 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){ if(game.hasPlayer(function(current){
return player.canUse(card,current)&&get.effect(current,card,player,player)>0; return player.canUse(card,current)&&get.effect(current,card,player,player)>0;
})){ })){
if(card.name=='sha'){ if(card.name=='sha'){
if(card.nature=='fire') return 2.95; if(card.nature=='fire') return 2.95;
else if(card.nature=='fire') return 2.92; else if(card.nature=='fire') return 2.92;
else return 2.9; else return 2.9;
} }
else if(card.name=='tao'){ else if(card.name=='tao'){
return 4; return 4;
} }
} }
return 0; return 0;
}, },
@ -119,22 +119,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return { return {
filterCard:function(){return false}, filterCard:function(){return false},
viewAs:{name:links[0][2],nature:links[0][3]}, viewAs:{name:links[0][2],nature:links[0][3]},
selectCard:-1, selectCard:-1,
popname:true, popname:true,
log:false, log:false,
precontent:function(){ precontent:function(){
'step 0' 'step 0'
player.chooseTarget('选择交换手牌的目标',function(card,player,target){ player.chooseTarget('选择交换手牌的目标',function(card,player,target){
return target.countCards('h')<player.countCards('h') return target.countCards('h')<player.countCards('h')
},true).ai=function(target){ },true).ai=function(target){
return get.attitude(player,target); return get.attitude(player,target);
} }
player.addTempSkill('zhenshan2'); player.addTempSkill('zhenshan2');
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('zhenshan',result.targets); player.logSkill('zhenshan',result.targets);
player.swapHandcards(result.targets[0]); player.swapHandcards(result.targets[0]);
} }
}, },
} }
}, },
@ -146,34 +146,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
order:function(){ order:function(){
var player=_status.event.player; var player=_status.event.player;
var event=_status.event; var event=_status.event;
var nh=player.countCards('h'); var nh=player.countCards('h');
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return get.attitude(player,current)>0&&current.countCards('h')<nh; return get.attitude(player,current)>0&&current.countCards('h')<nh;
})){ })){
if(event.type=='dying'){ if(event.type=='dying'){
if(event.filterCard({name:'tao'},player,event)){ if(event.filterCard({name:'tao'},player,event)){
return 0.5; return 0.5;
} }
} }
else{ else{
if(event.filterCard({name:'tao'},player,event)){ if(event.filterCard({name:'tao'},player,event)){
return 4; return 4;
} }
if(event.filterCard({name:'sha'},player,event)){ if(event.filterCard({name:'sha'},player,event)){
return 2.9; return 2.9;
} }
} }
} }
return 0; return 0;
}, },
save:true, save:true,
respondSha:true, respondSha:true,
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.countCards('h'); var nh=player.countCards('h');
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.countCards('h')<nh; return current!=player&&current.countCards('h')<nh;
}); });
}, },
result:{ result:{
player:function(player){ player:function(player){
@ -187,16 +187,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
}, },
oldzhenlie:{ oldzhenlie:{
audio:'zhenlie', audio:'zhenlie',
trigger:{player:'judge'}, trigger:{player:'judge'},
check:function(event,player){ check:function(event,player){
return event.judge(player.judging[0])<0; return event.judge(player.judging[0])<0;
}, },
content:function(){ content:function(){
var card=get.cards()[0]; var card=get.cards()[0];
player.$throw(card); player.$throw(card);
card.clone.classList.add('thrownhighlight'); card.clone.classList.add('thrownhighlight');
if(trigger.player.judging[0].clone){ if(trigger.player.judging[0].clone){
trigger.player.judging[0].clone.classList.remove('thrownhighlight'); trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
@ -208,144 +208,144 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.delay(2); game.delay(2);
}, },
}, },
oldmiji:{ oldmiji:{
trigger:{player:['phaseBegin','phaseEnd']}, trigger:{player:['phaseBegin','phaseEnd']},
filter:function(event,player){ filter:function(event,player){
return player.isDamaged(); return player.isDamaged();
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.judge(function(card){ player.judge(function(card){
return get.color(card)=='black'?1:-1; return get.color(card)=='black'?1:-1;
}); });
'step 1' 'step 1'
if(result.bool&&player.maxHp>player.hp){ if(result.bool&&player.maxHp>player.hp){
var cards=get.cards(player.maxHp-player.hp); var cards=get.cards(player.maxHp-player.hp);
event.cards=cards; event.cards=cards;
var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden'); var dialog=ui.create.dialog('选择获得卡牌的目标',cards,'hidden');
dialog.classList.add('noselect'); dialog.classList.add('noselect');
player.chooseTarget(true,dialog).ai=function(target){ player.chooseTarget(true,dialog).ai=function(target){
return get.attitude(player,target)/Math.sqrt(1+target.countCards('h')); return get.attitude(player,target)/Math.sqrt(1+target.countCards('h'));
} }
} }
else{ else{
event.finish(); event.finish();
} }
'step 2' 'step 2'
player.line(result.targets); player.line(result.targets);
result.targets[0].gain(event.cards,'draw'); result.targets[0].gain(event.cards,'draw');
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(get.tag(card,'recover')&&target.hp==target.maxHp-1) return [0,0]; if(get.tag(card,'recover')&&target.hp==target.maxHp-1) return [0,0];
if(target.hasFriend()){ if(target.hasFriend()){
if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp==target.maxHp) return [0,1]; if((get.tag(card,'damage')==1||get.tag(card,'loseHp'))&&target.hp==target.maxHp) return [0,1];
} }
} }
}, },
threaten:function(player,target){ threaten:function(player,target){
if(target.hp==1) return 3; if(target.hp==1) return 3;
if(target.hp==2) return 2; if(target.hp==2) return 2;
return 1; return 1;
}, },
} }
}, },
shiyong:{ shiyong:{
audio:2, audio:2,
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
forced:true, forced:true,
check:function(){ check:function(){
return false; return false;
}, },
filter:function(event,player){ filter:function(event,player){
return event.card&&event.card.name=='sha'&&(get.color(event.card)=='red'||event.source.hasSkill('jiu')); return event.card&&event.card.name=='sha'&&(get.color(event.card)=='red'||event.source.hasSkill('jiu'));
}, },
content:function(){ content:function(){
player.loseMaxHp(); player.loseMaxHp();
} }
}, },
oldqianxi:{ oldqianxi:{
trigger:{source:'damageBefore'}, trigger:{source:'damageBefore'},
check:function(event,player){ check:function(event,player){
var att=get.attitude(player,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) return att<0;
if(event.player.hp==event.player.maxHp-1&& if(event.player.hp==event.player.maxHp-1&&
(event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0; (event.player.maxHp<=3||event.player.hasSkillTag('maixie'))) return att<0;
return att>0; return att>0;
}, },
filter:function(event,player){ filter:function(event,player){
return event.card&&event.card.name=='sha'&&get.distance(player,event.player)<=1; return event.card&&event.card.name=='sha'&&get.distance(player,event.player)<=1;
}, },
logTarget:'player', logTarget:'player',
content:function(){ content:function(){
'step 0' 'step 0'
player.judge(function(card){ player.judge(function(card){
return get.suit(card)!='heart'?1:-1; return get.suit(card)!='heart'?1:-1;
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
trigger.cancel(); trigger.cancel();
trigger.player.loseMaxHp(true); trigger.player.loseMaxHp(true);
} }
} }
}, },
oldxuanfeng:{ oldxuanfeng:{
audio:'xuanfeng', audio:'xuanfeng',
trigger:{player:'loseEnd'}, trigger:{player:'loseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].original=='e') return true; if(event.cards[i].original=='e') return true;
} }
return false; return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget(get.prompt('xuanfeng'),function(card,player,target){ player.chooseTarget(get.prompt('xuanfeng'),function(card,player,target){
if(target==player) return false; if(target==player) return false;
return get.distance(player,target)<=1||player.canUse('sha',target,false); return get.distance(player,target)<=1||player.canUse('sha',target,false);
}).set('ai',function(target){ }).set('ai',function(target){
if(get.distance(player,target)<=1){ if(get.distance(player,target)<=1){
return get.damageEffect(target,player,player)*2; return get.damageEffect(target,player,player)*2;
} }
else{ else{
return get.effect(target,{name:'sha'},player,player); return get.effect(target,{name:'sha'},player,player);
} }
}); });
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.logSkill('xuanfeng',result.targets); player.logSkill('xuanfeng',result.targets);
var target=result.targets[0]; var target=result.targets[0];
var distance=get.distance(player,target); var distance=get.distance(player,target);
if(distance<=1&&player.canUse('sha',target,false)){ if(distance<=1&&player.canUse('sha',target,false)){
player.chooseControl('出杀','造成伤害').ai=function(){ player.chooseControl('出杀','造成伤害').ai=function(){
return '造成伤害'; return '造成伤害';
} }
event.target=target; event.target=target;
} }
else if(distance<=1){ else if(distance<=1){
target.damage(); target.damage();
event.finish(); event.finish();
} }
else{ else{
player.useCard({name:'sha'},target,false).animate=false; player.useCard({name:'sha'},target,false).animate=false;
game.delay(); game.delay();
event.finish(); event.finish();
} }
} }
else{ else{
event.finish(); event.finish();
} }
"step 2" "step 2"
var target=event.target; var target=event.target;
if(result.control=='出杀'){ if(result.control=='出杀'){
player.useCard({name:'sha'},target,false).animate=false; player.useCard({name:'sha'},target,false).animate=false;
game.delay(); game.delay();
} }
else{ else{
target.damage(); target.damage();
} }
}, },
ai:{ ai:{
effect:{ effect:{
@ -357,35 +357,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){
noe:true noe:true
} }
}, },
}, },
translate:{ translate:{
old_yuanshu:'旧袁术', old_yuanshu:'旧袁术',
old_xusheng:'旧徐盛', old_xusheng:'旧徐盛',
old_lingtong:'旧凌统', old_lingtong:'旧凌统',
old_zhuran:'旧朱然', old_zhuran:'旧朱然',
old_madai:'旧马岱', old_madai:'旧马岱',
old_caoxiu:'旧曹休', old_caoxiu:'旧曹休',
old_huaxiong:'旧华雄', old_huaxiong:'旧华雄',
old_wangyi:'旧王异', old_wangyi:'旧王异',
old_caozhen:'旧曹真', old_caozhen:'旧曹真',
old_quancong:'旧全琮', old_quancong:'旧全琮',
old_lingju:'旧灵雎', old_lingju:'旧灵雎',
zhenshan:'振赡', zhenshan:'振赡',
zhenshan_use:'振赡', zhenshan_use:'振赡',
zhenshan_use_backup:'振赡', zhenshan_use_backup:'振赡',
zhenshan_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌', zhenshan_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
zhenshan_use_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌', zhenshan_use_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
oldzhenlie:'贞烈', oldzhenlie:'贞烈',
oldzhenlie_info:'在你的判定牌生效前,你可以亮出牌堆顶的一张牌代替之', oldzhenlie_info:'在你的判定牌生效前,你可以亮出牌堆顶的一张牌代替之',
oldmiji:'秘计', oldmiji:'秘计',
oldmiji_info:'准备/结束阶段开始时若你已受伤你可以判定若判定结果为黑色你观看牌堆顶的X张牌X为你已损失的体力值然后将这些牌交给一名角色', oldmiji_info:'准备/结束阶段开始时若你已受伤你可以判定若判定结果为黑色你观看牌堆顶的X张牌X为你已损失的体力值然后将这些牌交给一名角色',
shiyong:'恃勇', shiyong:'恃勇',
shiyong_info:'锁定技当你受到一次红色【杀】或【酒】【杀】造成的伤害后须减1点体力上限', shiyong_info:'锁定技当你受到一次红色【杀】或【酒】【杀】造成的伤害后须减1点体力上限',
oldqianxi:'潜袭', oldqianxi:'潜袭',
oldqianxi_info:'当你使用【杀】对距离为1的目标角色造成伤害时你可以进行一次判定若判定结果不为红桃你防止此伤害令其减1点体力上限', oldqianxi_info:'当你使用【杀】对距离为1的目标角色造成伤害时你可以进行一次判定若判定结果不为红桃你防止此伤害令其减1点体力上限',
oldxuanfeng:'旋风', oldxuanfeng:'旋风',
oldxuanfeng_info:'每当你失去一次装备区里的牌时你可以执行下列两项中的一项1.视为对任意一名其他角色使用一张【杀】此【杀】不计入每回合的使用限制2.对与你距离1以内的一名其他角色造成一点伤害', oldxuanfeng_info:'每当你失去一次装备区里的牌时你可以执行下列两项中的一项1.视为对任意一名其他角色使用一张【杀】此【杀】不计入每回合的使用限制2.对与你距离1以内的一名其他角色造成一点伤害',
} }
}; };
}); });

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -168,6 +168,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return -10; return -10;
@ -210,7 +211,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ 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; return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.countCards('he')>0;
}, },
check:function(){ check:function(){
@ -1124,7 +1125,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
direct:true, direct:true,
filter:function(event){ 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&& return event.card&&event.card.name=='sha'&&event.cards&&
get.color(event.cards)=='black'&&event.player.countCards('e'); 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, audio:2,
trigger:{player:'damageEnd',source:'damageEnd'}, trigger:{player:'damageEnd',source:'damageEnd'},
filter:function(event){ 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&& return event.num&&event.source&&event.player&&
event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player; event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player;
}, },

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -375,13 +375,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"step 1" "step 1"
if(event.cards.length>1){ if(event.cards.length>1){
player.chooseCardButton('将“遗计”牌分配给任意角色',true,event.cards,[1,event.cards.length]).set('ai',function(button){ player.chooseCardButton('将“遗计”牌分配给任意角色',true,event.cards,[1,event.cards.length]).set('ai',function(button){
if(ui.selected.buttons.length==0) return 1; if(ui.selected.buttons.length==0) return 1;
return 0; return 0;
}); });
} }
else if(event.cards.length==1){ else if(event.cards.length==1){
event._result={links:event.cards.slice(0),bool:true}; event._result={links:event.cards.slice(0),bool:true};
} }
else{ else{
event.finish(); event.finish();
} }
@ -392,23 +392,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
event.togive=result.links.slice(0); event.togive=result.links.slice(0);
player.chooseTarget('将'+get.translation(result.links)+'交给一名角色',true).set('ai',function(target){ 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){ if(_status.event.enemy){
return -att; return -att;
} }
else if(att>0){ else if(att>0){
return att/(1+target.countCards('h')); return att/(1+target.countCards('h'));
} }
else{ else{
return att/100; return att/100;
} }
}).set('enemy',get.value(event.togive[0])<0); }).set('enemy',get.value(event.togive[0])<0);
} }
"step 3" "step 3"
if(result.targets.length){ if(result.targets.length){
result.targets[0].gain(event.togive,'draw'); result.targets[0].gain(event.togive,'draw');
player.line(result.targets[0],'green'); 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); event.goto(1);
} }
}, },
@ -564,6 +564,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0; if(target.hasSkillTag('nodu')) return 0;
return -10; return -10;
@ -1139,8 +1140,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(!player.countCards('h','shan')) return false; if(!player.countCards('h','shan')) return false;
}, },
order:function(){ order:function(){
return get.order({name:'sha'})+0.1; return get.order({name:'sha'})+0.1;
}, },
useful:-1, useful:-1,
value:-1 value:-1
} }

File diff suppressed because it is too large Load Diff

View File

@ -2,124 +2,124 @@
game.import('character',function(lib,game,ui,get,ai,_status){ game.import('character',function(lib,game,ui,get,ai,_status){
return { return {
name:'xiake', name:'xiake',
character:{ character:{
// xk_dongfangweiming:['male','shu',4,[]], // xk_dongfangweiming:['male','shu',4,[]],
xk_guyuexuan:['male','qun',4,['rouquan','gzhenji']], xk_guyuexuan:['male','qun',4,['rouquan','gzhenji']],
xk_jinji:['male','shu',4,['zhongzhan','lianpo']], 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']], xk_fujianhan:['male','qun',4,['zuijian','zitong']],
}, },
skill:{ skill:{
zhongzhan:{ zhongzhan:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
logTarget:'player', logTarget:'player',
check:function(event,player){ check:function(event,player){
if(get.damageEffect(event.player,player,player)>0&& if(get.damageEffect(event.player,player,player)>0&&
get.attitude(player,event.player)<0){ get.attitude(player,event.player)<0){
return player.hp>event.player.hp&&player.hp>=2; return player.hp>event.player.hp&&player.hp>=2;
} }
return false; return false;
}, },
content:function(){ content:function(){
player.loseHp(); player.loseHp();
trigger.num++; trigger.num++;
} }
}, },
rouquan:{ rouquan:{
mod:{ mod:{
selectTarget:function(card,player,range){ selectTarget:function(card,player,range){
if(card.name=='sha'&&!player.getEquip(1)&&range[1]!=-1) range[1]=Infinity; if(card.name=='sha'&&!player.getEquip(1)&&range[1]!=-1) range[1]=Infinity;
} }
}, },
enable:'phaseUse', enable:'phaseUse',
position:'e', position:'e',
filter:function(event,player){ filter:function(event,player){
return player.countCards('e')>0; return player.countCards('e')>0;
}, },
filterCard:true, filterCard:true,
prompt:'将要重铸的牌置入弃牌堆并摸一张牌', prompt:'将要重铸的牌置入弃牌堆并摸一张牌',
discard:false, discard:false,
delay:0.5, delay:0.5,
check:function(card,player){ check:function(card,player){
var val=get.equipValue(card); var val=get.equipValue(card);
var player=_status.event.player; var player=_status.event.player;
var cards=player.getCards('h',{subtype:get.subtype(card)}); var cards=player.getCards('h',{subtype:get.subtype(card)});
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
if(get.equipValue(cards[i])>=val){ if(get.equipValue(cards[i])>=val){
return 1; return 1;
} }
} }
return 0; return 0;
}, },
prepare:function(cards,player){ prepare:function(cards,player){
player.$throw(cards,1000); player.$throw(cards,1000);
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.draw(); player.draw();
"step 1" "step 1"
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
cards[i].discard(); cards[i].discard();
} }
}, },
ai:{ ai:{
order:9.5, order:9.5,
result:{ result:{
player:1 player:1
} }
} }
}, },
gzhenji:{ gzhenji:{
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
if(event._notrigger.contains(event.player)) return false; if(event._notrigger.contains(event.player)) return false;
return _status.currentPhase==player&&event.card&&event.card.name=='sha'; return _status.currentPhase==player&&event.card&&event.card.name=='sha';
}, },
content:function(){ content:function(){
player.draw(); player.draw();
player.addTempSkill('gzhenji3'); player.addTempSkill('gzhenji3');
} }
}, },
gzhenji3:{ gzhenji3:{
mod:{ mod:{
cardUsable:function(card,player,num){ cardUsable:function(card,player,num){
if(card.name=='sha') return num+1; if(card.name=='sha') return num+1;
} }
}, },
}, },
zitong:{ zitong:{
trigger:{player:'useCard'}, trigger:{player:'useCard'},
frequent:true, frequent:true,
filter:function(event,player){ filter:function(event,player){
return _status.currentPhase==player&&player.countUsed()==3; return _status.currentPhase==player&&player.countUsed()==3;
}, },
content:function(){ content:function(){
var card=get.cardPile('chuansongmen'); var card=get.cardPile('chuansongmen');
if(!card){ if(!card){
card=game.createCard('chuansongmen'); card=game.createCard('chuansongmen');
} }
player.gain(card,'gain2'); player.gain(card,'gain2');
}, },
ai:{ ai:{
threaten:1.2 threaten:1.2
} }
} }
}, },
translate:{ translate:{
xk_dongfangweiming:'东方未明', xk_dongfangweiming:'东方未明',
xk_guyuexuan:'谷月轩', xk_guyuexuan:'谷月轩',
xk_jinji:'荆棘', xk_jinji:'荆棘',
xk_shenxiangyun:'沈湘芸', xk_shenxiangyun:'沈湘芸',
xk_fujianhan:'傅剑寒', xk_fujianhan:'傅剑寒',
zhongzhan:'重斩', zhongzhan:'重斩',
zhongzhan_info:'每当你即将造成伤害,你可流失一点体力令伤害+1', zhongzhan_info:'每当你即将造成伤害,你可流失一点体力令伤害+1',
gzhenji:'震击', gzhenji:'震击',
gzhenji_info:'你使用杀造成伤害后,可以摸一张牌,并且本回合内可以额外使用一张杀', gzhenji_info:'你使用杀造成伤害后,可以摸一张牌,并且本回合内可以额外使用一张杀',
rouquan:'柔拳', rouquan:'柔拳',
rouquan_info:'你可以重铸装备区内的牌;当你没有武器牌时,你的杀可以指定任意个目标', rouquan_info:'你可以重铸装备区内的牌;当你没有武器牌时,你的杀可以指定任意个目标',
zitong:'通悟', zitong:'通悟',
zitong_info:'当你于自己的回合内使用第三张牌时,你可以将一张传送门置于你的手牌', zitong_info:'当你于自己的回合内使用第三张牌时,你可以将一张传送门置于你的手牌',
}, },
}; };
}); });

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -92,21 +92,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
skill:{ skill:{
guimian:{ guimian:{
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return event.card&&event.card.name=='sha'&&_status.currentPhase==player; return event.card&&event.card.name=='sha'&&_status.currentPhase==player;
}, },
content:function(){ content:function(){
player.getStat().card.sha--; player.getStat().card.sha--;
} }
}, },
lyuxue:{ lyuxue:{
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
forced:true, forced:true,
logTarget:'player', logTarget:'player',
filter:function(event,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'); return event.player.isIn()&&!event.player.hasSkill('lyuxue2');
}, },
content:function(){ content:function(){
@ -614,11 +614,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
trigger.directHit=true; trigger.directHit=true;
}, },
mod:{ mod:{
targetInRange:function(card){ targetInRange:function(card){
if(card.name=='sha') return true; if(card.name=='sha') return true;
}, },
}, },
}, },
lguiyin:{ lguiyin:{
unique:true, unique:true,
@ -863,7 +863,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
frequent:true, frequent:true,
filter:function(event){ 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; return event.player.isAlive()&&event.parent.name=='yanyi'&&event.player.hp<event.player.maxHp;
}, },
content:function(){ content:function(){
@ -1338,7 +1338,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{source:'damageEnd'}, trigger:{source:'damageEnd'},
direct:true, direct:true,
filter:function(event,player){ 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; if(event.player.isDead()) return false;
var nh=event.player.countCards('h'); var nh=event.player.countCards('h');
if(nh==0) return false; if(nh==0) return false;

View File

@ -2,52 +2,52 @@
game.import('character',function(lib,game,ui,get,ai,_status){ game.import('character',function(lib,game,ui,get,ai,_status){
return { return {
name:'zhuogui', name:'zhuogui',
character:{ character:{
nianshou:['male','shu',4,['nianrui','qixiang']], nianshou:['male','shu',4,['nianrui','qixiang']],
mamian:['male','qun',4,['lianyu','guiji']], mamian:['male','qun',4,['lianyu','guiji']],
niutou:['male','shu',4,['manjia','xiaoshou']], niutou:['male','shu',4,['manjia','xiaoshou']],
baiwuchang:['male','qun',3,['qiangzheng','moukui']], baiwuchang:['male','qun',3,['qiangzheng','moukui']],
heiwuchang:['male','qun',3,['suoling','xixing']], heiwuchang:['male','qun',3,['suoling','xixing']],
}, },
skill:{ skill:{
qixiang:{ qixiang:{
group:['qixiang1','qixiang2'], group:['qixiang1','qixiang2'],
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(card.name=='lebu'&&card.name=='bingliang') return 0.8; if(card.name=='lebu'&&card.name=='bingliang') return 0.8;
} }
} }
} }
}, },
qixiang1:{ qixiang1:{
trigger:{player:'judge'}, trigger:{player:'judge'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event.card){ if(event.card){
if(event.card.viewAs){ if(event.card.viewAs){
return event.card.viewAs=='lebu'; return event.card.viewAs=='lebu';
} }
else{ else{
return event.card.name=='lebu'; return event.card.name=='lebu';
} }
} }
}, },
content:function(){ content:function(){
player.addTempSkill('qixiang3','phaseJudgeAfter'); player.addTempSkill('qixiang3','phaseJudgeAfter');
} }
}, },
qixiang2:{ qixiang2:{
trigger:{player:'judge'}, trigger:{player:'judge'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event.card){ if(event.card){
if(event.card.viewAs){ if(event.card.viewAs){
return event.card.viewAs=='bingliang'; return event.card.viewAs=='bingliang';
} }
else{ else{
return event.card.name=='bingliang'; return event.card.name=='bingliang';
} }
} }
}, },
content:function(){ content:function(){
@ -68,19 +68,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
}, },
nianrui:{ nianrui:{
trigger:{player:['phaseBegin','phaseEnd']}, trigger:{player:['phaseBegin','phaseEnd']},
content:function(){ content:function(){
"step 0" "step 0"
player.judge(function(card){ player.judge(function(card){
return get.color(card)=='red'?1:0; return get.color(card)=='red'?1:0;
}); });
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.draw(); player.draw();
} }
} }
}, },
lianyu:{ lianyu:{
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
@ -88,7 +88,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check:function(card){return 6-get.value(card)}, check:function(card){return 6-get.value(card)},
filterTarget:true, filterTarget:true,
selectTarget:-1, selectTarget:-1,
line:'fire', line:'fire',
content:function(){ content:function(){
target.damage('fire'); target.damage('fire');
}, },
@ -104,18 +104,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return eff; return eff;
} }
}, },
expose:0.1 expose:0.1
} }
}, },
manjia:{ manjia:{
group:['manjia1','manjia2'] group:['manjia1','manjia2']
}, },
manjia1:{ manjia1:{
trigger:{target:'useCardToBefore'}, trigger:{target:'useCardToBefore'},
forced:true, forced:true,
priority:6, priority:6,
filter:function(event,player){ filter:function(event,player){
if(player.getEquip(2)) return false; if(player.getEquip(2)) return false;
return lib.skill.tengjia1.filter(event,player); return lib.skill.tengjia1.filter(event,player);
}, },
content:function(){ content:function(){
@ -124,187 +124,187 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ 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); return lib.skill.tengjia1.ai.effect.target.apply(this,arguments);
} }
} }
} }
}, },
manjia2:{ manjia2:{
trigger:{player:'damageBegin'}, trigger:{player:'damageBegin'},
filter:function(event,player){ filter:function(event,player){
if(player.getEquip(2)) return false; if(player.getEquip(2)) return false;
if(event.nature=='fire') return true; if(event.nature=='fire') return true;
}, },
forced:true, forced:true,
check:function(){ check:function(){
return false; return false;
}, },
content:function(){ content:function(){
trigger.num++; trigger.num++;
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ 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); return lib.skill.tengjia2.ai.effect.target.apply(this,arguments);
} }
} }
} }
}, },
xiaoshou:{ xiaoshou:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
filter:function(event,player){ filter:function(event,player){
var players=game.players.slice(0); var players=game.players.slice(0);
players.sort(function(a,b){ players.sort(function(a,b){
return b.hp-a.hp; return b.hp-a.hp;
}); });
return players[0].hp>players[1].hp&&players[0]!=player; return players[0].hp>players[1].hp&&players[0]!=player;
}, },
check:function(event,player){ check:function(event,player){
var players=game.players.slice(0); var players=game.players.slice(0);
players.sort(function(a,b){ players.sort(function(a,b){
return b.hp-a.hp; return b.hp-a.hp;
}); });
return get.damageEffect(players[0],player,player,'fire')>0; return get.damageEffect(players[0],player,player,'fire')>0;
}, },
prompt:function(){ prompt:function(){
var players=game.players.slice(0); var players=game.players.slice(0);
players.sort(function(a,b){ players.sort(function(a,b){
return b.hp-a.hp; return b.hp-a.hp;
}); });
return '枭首:是否对'+get.translation(players[0])+'造成一点火焰伤害?'; return '枭首:是否对'+get.translation(players[0])+'造成一点火焰伤害?';
}, },
content:function(){ content:function(){
var players=game.players.slice(0); var players=game.players.slice(0);
players.sort(function(a,b){ players.sort(function(a,b){
return b.hp-a.hp; return b.hp-a.hp;
}); });
if(players[0].hp>players[1].hp&&players[0]!=player){ if(players[0].hp>players[1].hp&&players[0]!=player){
players[0].damage('fire'); players[0].damage('fire');
player.line(players[0],'fire'); player.line(players[0],'fire');
} }
}, },
ai:{ ai:{
expose:0.2 expose:0.2
} }
}, },
guiji:{ guiji:{
trigger:{player:'phaseJudgeBegin'}, trigger:{player:'phaseJudgeBegin'},
forced:true, forced:true,
content:function(){ content:function(){
player.discard(player.getCards('j').randomGet()); player.discard(player.getCards('j').randomGet());
}, },
filter:function(event ,player){ filter:function(event ,player){
return player.countCards('j')>0; return player.countCards('j')>0;
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1; if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
} }
} }
} }
}, },
qiangzheng:{ qiangzheng:{
audio:2, audio:2,
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].countCards('h')) return true; if(game.players[i]!=player&&game.players[i].countCards('h')) return true;
} }
return false; return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){ player.chooseTarget('获得一名角色的一张手牌',true,function(card,player,target){
return player!=target&&target.countCards('h')>0; return player!=target&&target.countCards('h')>0;
}).ai=function(target){ }).ai=function(target){
return -get.attitude(player,target); return -get.attitude(player,target);
}; };
"step 1" "step 1"
if(result.targets&&result.targets.length){ if(result.targets&&result.targets.length){
player.logSkill('qiangzheng',result.targets); player.logSkill('qiangzheng',result.targets);
player.gain(result.targets[0].getCards('h').randomGet(),result.targets[0]); player.gain(result.targets[0].getCards('h').randomGet(),result.targets[0]);
result.targets[0].$give(1,player); result.targets[0].$give(1,player);
game.delay(); game.delay();
} }
}, },
ai:{ ai:{
threaten:1.7 threaten:1.7
} }
}, },
suoling:{ suoling:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.isLinked()) return true; if(player.isLinked()) return true;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&!game.players[i].isLinked()){ if(game.players[i]!=player&&!game.players[i].isLinked()){
return true; return true;
} }
} }
return false; return false;
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.targets=game.players.slice(0); event.targets=game.players.slice(0);
event.targets.remove(player); event.targets.remove(player);
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
if(player.isLinked()) player.link(); if(player.isLinked()) player.link();
"step 1" "step 1"
if(event.targets.length){ if(event.targets.length){
var target=event.targets.shift(); var target=event.targets.shift();
if(!target.isLinked()){ if(!target.isLinked()){
target.link(); target.link();
} }
event.redo(); event.redo();
} }
} }
}, },
xixing:{ xixing:{
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterCard:function(card){ filterCard:function(card){
var type=get.type(card); var type=get.type(card);
for(var i=0;i<ui.selected.cards.length;i++){ for(var i=0;i<ui.selected.cards.length;i++){
if(get.type(ui.selected.cards[i])==type) return false; if(get.type(ui.selected.cards[i])==type) return false;
} }
return true; return true;
}, },
complexCard:true, complexCard:true,
selectCard:3, selectCard:3,
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target; return player!=target;
}, },
check:function(card){ check:function(card){
if(_status.event.player.hp==_status.event.player.maxHp){ if(_status.event.player.hp==_status.event.player.maxHp){
return 5-get.value(card); return 5-get.value(card);
} }
return 10-get.value(card); return 10-get.value(card);
}, },
content:function(){ content:function(){
"step 0" "step 0"
target.damage(); target.damage();
"step 1" "step 1"
player.recover(); player.recover();
}, },
ai:{ ai:{
order:9.5, order:9.5,
result:{ result:{
target:function(player,target){ target:function(player,target){
return get.damageEffect(target,player); return get.damageEffect(target,player);
} }
}, },
expose:0.2 expose:0.2
} }
} }
}, },
translate:{ translate:{
nianshou:'年兽', nianshou:'年兽',
nianrui:'年瑞', nianrui:'年瑞',
qixiang:'祺祥', qixiang:'祺祥',
qixiang1:'祺祥', qixiang1:'祺祥',
@ -323,20 +323,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
manjia_info:'锁定技,若你的装备区内没有防具牌,则你视为装备了[藤甲]', manjia_info:'锁定技,若你的装备区内没有防具牌,则你视为装备了[藤甲]',
xiaoshou:'枭首', xiaoshou:'枭首',
xiaoshou_info:'结束阶段,若场上体力值最多的角色只有一个,你可以对其造成一点火焰伤害', xiaoshou_info:'结束阶段,若场上体力值最多的角色只有一个,你可以对其造成一点火焰伤害',
guiji:'诡计', guiji:'诡计',
guiji_info:'锁定技,准备阶段结束时,若你的判定区内有牌,你随机弃置其中一张牌', guiji_info:'锁定技,准备阶段结束时,若你的判定区内有牌,你随机弃置其中一张牌',
baiwuchang:'白无常', baiwuchang:'白无常',
qiangzheng:'强征', qiangzheng:'强征',
qiangzheng_info:'锁定技,结束阶段,你获得一名其他角色的一张手牌', qiangzheng_info:'锁定技,结束阶段,你获得一名其他角色的一张手牌',
zuijiu:'醉酒', zuijiu:'醉酒',
zuijiu_info:'锁定技,你的黑杀造成的伤害+1造成伤害后须弃置一张手牌', zuijiu_info:'锁定技,你的黑杀造成的伤害+1造成伤害后须弃置一张手牌',
heiwuchang:'黑无常', heiwuchang:'黑无常',
suoling:'索令', suoling:'索令',
suoling_info:'锁定技,结束阶段,你解除横置状态,除你之外的所有角色进入横置状态', suoling_info:'锁定技,结束阶段,你解除横置状态,除你之外的所有角色进入横置状态',
xixing:'吸星', xixing:'吸星',
xixing_info:'出牌阶段限一次,你可以弃置三张不同类别的牌,对一名其他角色造成一点伤害,然后回复一点体力', xixing_info:'出牌阶段限一次,你可以弃置三张不同类别的牌,对一名其他角色造成一点伤害,然后回复一点体力',
}, },
}; };
}); });

View File

@ -3,95 +3,95 @@ game.import('play',function(lib,game,ui,get,ai,_status){
return { return {
name:'cardpile', name:'cardpile',
arenaReady:function(){ arenaReady:function(){
var data={ var data={
total:160, total:160,
sha:{ sha:{
diamond:6, diamond:6,
club:14, club:14,
heart:3, heart:3,
spade:7, spade:7,
}, },
huosha:{ huosha:{
diamond:2, diamond:2,
heart:3 heart:3
}, },
leisha:{ leisha:{
spade:5, spade:5,
club:4 club:4
}, },
shan:{ shan:{
heart:6, heart:6,
diamond:18 diamond:18
}, },
jiu:{ jiu:{
diamond:1, diamond:1,
spade:2, spade:2,
club:2 club:2
}, },
tao:{ tao:{
heart:9, heart:9,
diamond:3, diamond:3,
}, },
wanjian:{ wanjian:{
heart:1, heart:1,
}, },
nanman:{ nanman:{
spade:2, spade:2,
club:1, club:1,
}, },
guohe:{ guohe:{
spade:3, spade:3,
club:2, club:2,
heart:1 heart:1
}, },
shunshou:{ shunshou:{
spade:3, spade:3,
diamond:2 diamond:2
}, },
wuxie:{ wuxie:{
heart:2, heart:2,
diamond:1, diamond:1,
spade:2, spade:2,
club:2 club:2
}, },
tiesuo:{ tiesuo:{
spade:2, spade:2,
club:4 club:4
} }
} }
var rand=function(){ var rand=function(){
return Math.ceil(Math.random()*13); return Math.ceil(Math.random()*13);
}; };
var getn=function(i,j){ var getn=function(i,j){
return Math.round(data[i][j]*parseFloat(lib.config['cardpile_'+i+'_playpackconfig'])); return Math.round(data[i][j]*parseFloat(lib.config['cardpile_'+i+'_playpackconfig']));
}; };
var num=0; var num=0;
for(var i in data){ for(var i in data){
for(var j in data[i]){ for(var j in data[i]){
num+=getn(i,j); num+=getn(i,j);
} }
} }
var dn=num*(lib.card.list.length-data.total)/(data.total-num); var dn=num*(lib.card.list.length-data.total)/(data.total-num);
if(dn>1000) dn=1000; if(dn>1000) dn=1000;
if(dn>0){ if(dn>0){
var p=0; var p=0;
for(var i in data){ for(var i in data){
for(var j in data[i]){ for(var j in data[i]){
var n=Math.round(dn*getn(i,j)/num); var n=Math.round(dn*getn(i,j)/num);
while(n--){ while(n--){
if(i=='huosha'){ if(i=='huosha'){
lib.card.list.push([j,rand(),'sha','fire']); lib.card.list.push([j,rand(),'sha','fire']);
} }
else if(i=='leisha'){ else if(i=='leisha'){
lib.card.list.push([j,rand(),'sha','thunder']); lib.card.list.push([j,rand(),'sha','thunder']);
} }
else{ else{
lib.card.list.push([j,rand(),i]); lib.card.list.push([j,rand(),i]);
} }
} }
} }
} }
} }
}, },
}; };
}); });

View File

@ -8,7 +8,7 @@ game.import('play',function(lib,game,ui,get,ai,_status){
} }
}, },
arenaReady:function(){ arenaReady:function(){
if(_status.video||_status.connectMode) return; if(_status.video||_status.connectMode) return;
if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){ if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){
var str; var str;
if(lib.config.coin_display_playpackconfig=='text'){ if(lib.config.coin_display_playpackconfig=='text'){
@ -106,7 +106,7 @@ game.import('play',function(lib,game,ui,get,ai,_status){
return uiintro; return uiintro;
},220,400); },220,400);
} }
}, },
game:{ game:{
changeCoin:function(num){ changeCoin:function(num){
if(typeof num=='number'&&ui.coin){ if(typeof num=='number'&&ui.coin){
@ -299,21 +299,21 @@ game.import('play',function(lib,game,ui,get,ai,_status){
//****************************************************** //******************************************************
// Yet Another Particle Engine // Yet Another Particle Engine
var cos = Math.cos, var cos = Math.cos,
sin = Math.sin, sin = Math.sin,
sqrt = Math.sqrt, sqrt = Math.sqrt,
abs = Math.abs, abs = Math.abs,
atan2 = Math.atan2, atan2 = Math.atan2,
log = Math.log, log = Math.log,
random = Math.random, random = Math.random,
PI = Math.PI, PI = Math.PI,
sqr = function(v){return v*v;}, sqr = function(v){return v*v;},
particles = [], particles = [],
drawScale = 1, drawScale = 1,
emitters = [], emitters = [],
forces = [], forces = [],
collidedMass = 0, collidedMass = 0,
maxParticles = 100, maxParticles = 100,
emissionRate = 1, emissionRate = 1,
minParticleSize = 2; minParticleSize = 2;
//------------------------------------------------------- //-------------------------------------------------------
@ -325,65 +325,65 @@ game.import('play',function(lib,game,ui,get,ai,_status){
} }
Vector.prototype = { Vector.prototype = {
add : function(vector) { add : function(vector) {
this.x += vector.x; this.x += vector.x;
this.y += vector.y; this.y += vector.y;
this.z += vector.z; this.z += vector.z;
return this; return this;
}, },
subtract : function(vector) { subtract : function(vector) {
this.x -= vector.x; this.x -= vector.x;
this.y -= vector.y; this.y -= vector.y;
this.z -= vector.z; this.z -= vector.z;
return this; return this;
}, },
multiply : function(another) { multiply : function(another) {
this.x /= another.x; this.x /= another.x;
this.y /= another.y; this.y /= another.y;
this.z /= another.z; this.z /= another.z;
return this; return this;
}, },
divide : function(another) { divide : function(another) {
this.x /= another.x; this.x /= another.x;
this.y /= another.y; this.y /= another.y;
this.z /= another.z; this.z /= another.z;
return this; return this;
}, },
scale : function(factor) { scale : function(factor) {
this.x *= factor; this.x *= factor;
this.y *= factor; this.y *= factor;
this.z *= factor; this.z *= factor;
return this; return this;
}, },
magnitude : function () { magnitude : function () {
return sqrt(sqr(this.x + this.y)); return sqrt(sqr(this.x + this.y));
}, },
distance : function (another) { 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) { angle : function (angle, magnitude) {
if(angle && magnitude) if(angle && magnitude)
return Vector.fromAngle(angle, magnitude); return Vector.fromAngle(angle, magnitude);
return atan2(this.y, this.x); return atan2(this.y, this.x);
}, },
clone : function() { clone : function() {
return new Vector(this.x, this.y, this.z); return new Vector(this.x, this.y, this.z);
}, },
equals : function(another) { equals : function(another) {
return this.x === another.x&& return this.x === another.x&&
this.y === another.y&& this.y === another.y&&
this.z === another.z; this.z === another.z;
}, },
random : function(r) { random : function(r) {
this.x += (random() * r * 2) - r; this.x += (random() * r * 2) - r;
this.y += (random() * r * 2) - r; this.y += (random() * r * 2) - r;
return this; return this;
} }
}; };
Vector.fromAngle = function (angle, magnitude) { Vector.fromAngle = function (angle, magnitude) {
return new Vector( return new Vector(
magnitude * cos(angle), magnitude * cos(angle),
magnitude * sin(angle), magnitude * sin(angle),
magnitude * sin(angle)); magnitude * sin(angle));
}; };
//****************************************************** //******************************************************
@ -404,41 +404,41 @@ game.import('play',function(lib,game,ui,get,ai,_status){
var totalAccelerationY = 0; var totalAccelerationY = 0;
for (var i = 0; i < fields.length; i++) { for (var i = 0; i < fields.length; i++) {
var field = fields[i]; var field = fields[i];
var vectorX = field.pos.x - this.pos.x; var vectorX = field.pos.x - this.pos.x;
var vectorY = field.pos.y - this.pos.y; var vectorY = field.pos.y - this.pos.y;
var distance = this.pos.distance(field.pos); var distance = this.pos.distance(field.pos);
if(distance < 1) field.grow(this); if(distance < 1) field.grow(this);
if(distance < 100) this.doubleSize = true; if(distance < 100) this.doubleSize = true;
var force = G(this.forceBetween(field, distance)); var force = G(this.forceBetween(field, distance));
totalAccelerationX += vectorX * force; totalAccelerationX += vectorX * force;
totalAccelerationY += vectorY * force; totalAccelerationY += vectorY * force;
} }
this.ac = new Vector(totalAccelerationX, totalAccelerationY); this.ac = new Vector(totalAccelerationX, totalAccelerationY);
totalAccelerationX = 0; totalAccelerationX = 0;
totalAccelerationY = 0; totalAccelerationY = 0;
for (var i = 0; i < particles.length; i++) { for (var i = 0; i < particles.length; i++) {
var field = particles[i]; var field = particles[i];
if(field === this || !field.alive) continue; if(field === this || !field.alive) continue;
var vectorX = field.pos.x - this.pos.x; var vectorX = field.pos.x - this.pos.x;
var vectorY = field.pos.y - this.pos.y; var vectorY = field.pos.y - this.pos.y;
var distance = this.pos.distance(field.pos); var distance = this.pos.distance(field.pos);
if(distance < 1) { if(distance < 1) {
if(this.mass >= field.mass) { if(this.mass >= field.mass) {
var massRatio = this.mass / field.mass; var massRatio = this.mass / field.mass;
if(particles.length <= maxParticles && this.mass>40) { if(particles.length <= maxParticles && this.mass>40) {
this.alive = false; this.alive = false;
this.nova = true; this.nova = true;
collidedMass += this.mass; collidedMass += this.mass;
} else this.grow(field); } else this.grow(field);
} else this.alive = false; } else this.alive = false;
} }
if(this.alive) { if(this.alive) {
var force = G(this.forceBetween(field, distance)); var force = G(this.forceBetween(field, distance));
totalAccelerationX += vectorX * G(force); totalAccelerationX += vectorX * G(force);
totalAccelerationY += vectorY * G(force); totalAccelerationY += vectorY * G(force);
} }
} }
var travelDist = this.pos.distance(this.lastPos ? this.lastPos : this.pos); 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 remainingMass = this.mass;
var num = 0; var num = 0;
while(remainingMass > 0) { while(remainingMass > 0) {
var np = new Particle(this.pos.clone().random(this.mass), new Vector(0,0)); var np = new Particle(this.pos.clone().random(this.mass), new Vector(0,0));
np.mass = 1 + Math.random() * (remainingMass - 1); np.mass = 1 + Math.random() * (remainingMass - 1);
if(num>=maxParts-1) np.mass = remainingMass; if(num>=maxParts-1) np.mass = remainingMass;
np.mass = np.mass < minMass ? minMass : np.mass; np.mass = np.mass < minMass ? minMass : np.mass;
remainingMass -= np.mass; remainingMass -= np.mass;
num++; num++;
} }
this.nova = true; this.nova = true;
delete this.size; delete this.size;
@ -498,14 +498,14 @@ game.import('play',function(lib,game,ui,get,ai,_status){
} }
ParticleEmitter.prototype.emit = function() { ParticleEmitter.prototype.emit = function() {
var angle = this.vc.angle() + 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 magnitude = this.vc.magnitude();
var position = this.pos.clone(); var position = this.pos.clone();
position.add( position.add(
new Vector( new Vector(
~~((Math.random() * 100) - 50) * drawScale, ~~((Math.random() * 100) - 50) * drawScale,
~~((Math.random() * 100) - 50) * drawScale ~~((Math.random() * 100) - 50) * drawScale
)); ));
var velocity = Vector.fromAngle(angle, magnitude); var velocity = Vector.fromAngle(angle, magnitude);
return new Particle(position,velocity); 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 renderToCanvas = function (width, height, renderFunction) {
var buffer = document.createElement('canvas'); var buffer = document.createElement('canvas');
buffer.width = width; buffer.width = width;
buffer.height = height; buffer.height = height;
renderFunction(buffer.getContext('2d')); renderFunction(buffer.getContext('2d'));
return buffer; return buffer;
}; };
maxParticles = 500; maxParticles = 500;
@ -560,12 +560,12 @@ game.import('play',function(lib,game,ui,get,ai,_status){
emitters = [ emitters = [
//br //br
new ParticleEmitter( new ParticleEmitter(
new Vector( new Vector(
canvasWidth / 2 * drawScale + 400, canvasWidth / 2 * drawScale + 400,
canvasHeight / 2 * drawScale canvasHeight / 2 * drawScale
), ),
Vector.fromAngle(2, 5), Vector.fromAngle(2, 5),
1 1
), ),
// // bl // // bl
// new ParticleEmitter( // new ParticleEmitter(
@ -576,14 +576,14 @@ game.import('play',function(lib,game,ui,get,ai,_status){
// Vector.fromAngle(1.5, 1), // Vector.fromAngle(1.5, 1),
// 1 // 1
// ), // ),
// tl // tl
new ParticleEmitter( new ParticleEmitter(
new Vector( new Vector(
canvasWidth / 2 * drawScale - 400, canvasWidth / 2 * drawScale - 400,
canvasHeight / 2 * drawScale canvasHeight / 2 * drawScale
), ),
Vector.fromAngle(5, 5), Vector.fromAngle(5, 5),
1 1
), ),
// // tr // // tr
// new ParticleEmitter( // new ParticleEmitter(
@ -597,8 +597,8 @@ game.import('play',function(lib,game,ui,get,ai,_status){
]; ];
forces = [ forces = [
new Force( new Force(
new Vector((canvasWidth / 2 * drawScale) , new Vector((canvasWidth / 2 * drawScale) ,
(canvasHeight / 2 * drawScale)), 1800) (canvasHeight / 2 * drawScale)), 1800)
]; ];
var loop=function() { var loop=function() {
@ -635,35 +635,35 @@ game.import('play',function(lib,game,ui,get,ai,_status){
var c2 = 'rgba(255,64,32,'; var c2 = 'rgba(255,64,32,';
var addNewParticles=function() { var addNewParticles=function() {
var _emit = function() { var _emit = function() {
var ret = 0; var ret = 0;
for (var i = 0; i < emitters.length; i++) { for (var i = 0; i < emitters.length; i++) {
for (var j = 0; j < emissionRate; j++) { for (var j = 0; j < emissionRate; j++) {
var p = emitters[i].emit(); var p = emitters[i].emit();
p.color = ( ctr % 10 === 0 )? p.color = ( ctr % 10 === 0 )?
( Math.random() * 5 <= 1 ? c2 : rndc() ) ( Math.random() * 5 <= 1 ? c2 : rndc() )
: rndc(); : rndc();
p.mass = ~~(Math.random() * 5); p.mass = ~~(Math.random() * 5);
particles.push(p); particles.push(p);
ret += p.mass; ret += p.mass;
ctr++; ctr++;
} }
} }
return ret; return ret;
}; };
if(collidedMass !== 0) { if(collidedMass !== 0) {
while(collidedMass !== 0) { while(collidedMass !== 0) {
collidedMass -= _emit(); collidedMass -= _emit();
collidedMass = collidedMass<0 ? 0 :collidedMass; collidedMass = collidedMass<0 ? 0 :collidedMass;
} }
} }
if (particles.length > maxParticles) if (particles.length > maxParticles)
return; return;
_emit(); _emit();
} }
var CLIPOFFSCREEN = 1, var CLIPOFFSCREEN = 1,
BUFFEROFFSCREEN = 2, BUFFEROFFSCREEN = 2,
LOOPSCREEN = 3; LOOPSCREEN = 3;
var isPositionAliveAndAdjust=function(particle,check) { var isPositionAliveAndAdjust=function(particle,check) {
return true; return true;
@ -693,77 +693,77 @@ game.import('play',function(lib,game,ui,get,ai,_status){
var plotParticles=function(boundsX, boundsY) { var plotParticles=function(boundsX, boundsY) {
var currentParticles = []; var currentParticles = [];
for (var i = 0; i < particles.length; i++) { for (var i = 0; i < particles.length; i++) {
var particle = particles[i]; var particle = particles[i];
particle.reactToForces(forces); particle.reactToForces(forces);
if(!isPositionAliveAndAdjust(particle)) if(!isPositionAliveAndAdjust(particle))
continue; continue;
particle.move(); particle.move();
currentParticles.push(particle); currentParticles.push(particle);
} }
} }
var offscreenCache = {}; var offscreenCache = {};
var renderParticle=function(p) { var renderParticle=function(p) {
var position = p.pos; var position = p.pos;
if(!p.size) p.size = Math.floor(p.mass / 100); if(!p.size) p.size = Math.floor(p.mass / 100);
if(!p.opacity) p.opacity = 0.05; if(!p.opacity) p.opacity = 0.05;
if(p.velocity > 0) { if(p.velocity > 0) {
if(p.opacity<=0.18) if(p.opacity<=0.18)
p.opacity += 0.04; p.opacity += 0.04;
} }
if(p.opacity>0.08) if(p.opacity>0.08)
p.opacity -= 0.02; p.opacity -= 0.02;
var actualSize = p.size / drawScale; var actualSize = p.size / drawScale;
actualSize = actualSize < minParticleSize ? minParticleSize : actualSize; actualSize = actualSize < minParticleSize ? minParticleSize : actualSize;
if(p.mass>8) actualSize *= 2; if(p.mass>8) actualSize *= 2;
if(p.nova) { if(p.nova) {
actualSize *= 4; actualSize *= 4;
p.nova = false; p.nova = false;
} }
if(p.doubleSize) { if(p.doubleSize) {
p.doubleSize = false; p.doubleSize = false;
actualSize *= 2; actualSize *= 2;
} }
// if(p.supernova) { // if(p.supernova) {
// actualSize *= 6; // actualSize *= 6;
// opacity = 0.15; // opacity = 0.15;
// p.supernovaDur = p.supernovaDur - 1; // p.supernovaDur = p.supernovaDur - 1;
// if(p.supernovaDur === 0) // if(p.supernovaDur === 0)
// p.supernova = false; // p.supernova = false;
// } // }
var cacheKey = actualSize + '_' + p.opacity + '_' + p.color; var cacheKey = actualSize + '_' + p.opacity + '_' + p.color;
var cacheValue = offscreenCache[cacheKey]; var cacheValue = offscreenCache[cacheKey];
if(!cacheValue) { if(!cacheValue) {
cacheValue = renderToCanvas(actualSize * 32, actualSize * 32, function(ofsContext) { cacheValue = renderToCanvas(actualSize * 32, actualSize * 32, function(ofsContext) {
var opacity = p.opacity; var opacity = p.opacity;
var fills = [ var fills = [
{size:actualSize/2, opacity:1}, {size:actualSize/2, opacity:1},
{size:actualSize, opacity:opacity}, {size:actualSize, opacity:opacity},
{size:actualSize * 2, opacity:opacity / 2}, {size:actualSize * 2, opacity:opacity / 2},
{size:actualSize * 4, opacity:opacity / 3}, {size:actualSize * 4, opacity:opacity / 3},
{size:actualSize * 8, opacity:opacity / 5}, {size:actualSize * 8, opacity:opacity / 5},
{size:actualSize * 16, opacity:opacity / 16} {size:actualSize * 16, opacity:opacity / 16}
]; ];
ofsContext.beginPath(); ofsContext.beginPath();
for(var f in fills) { for(var f in fills) {
f = fills[f]; f = fills[f];
ofsContext.fillStyle = p.color + f.opacity + ')'; ofsContext.fillStyle = p.color + f.opacity + ')';
ofsContext.arc( ofsContext.arc(
actualSize * 16, actualSize * 16,
actualSize * 16, actualSize * 16,
f.size , 0, Math.PI*2, true); f.size , 0, Math.PI*2, true);
ofsContext.fill(); ofsContext.fill();
} }
ofsContext.closePath(); ofsContext.closePath();
}); });
offscreenCache[cacheKey] = cacheValue; offscreenCache[cacheKey] = cacheValue;
} }
var posX = p.pos.x / drawScale; var posX = p.pos.x / drawScale;
var posY = p.pos.y / drawScale; var posY = p.pos.y / drawScale;
ctx.drawImage(cacheValue, posX, posY); ctx.drawImage(cacheValue, posX, posY);
} }
var fills = [ var fills = [
@ -773,27 +773,27 @@ game.import('play',function(lib,game,ui,get,ai,_status){
var renderScene=function(ofsContext) { var renderScene=function(ofsContext) {
for (var i = 0; i < forces.length; i++) { for (var i = 0; i < forces.length; i++) {
var p = forces[i]; var p = forces[i];
var position = p.pos; var position = p.pos;
var opacity = 1; var opacity = 1;
ofsContext.beginPath(); ofsContext.beginPath();
for(var f in fills) { for(var f in fills) {
f = fills[f]; f = fills[f];
var o = p.burp === true ? 1 : f.opacity; var o = p.burp === true ? 1 : f.opacity;
p.burp = false; p.burp = false;
// ofsContext.fillStyle = 'rgba(255,255,255,' + o + ')'; // ofsContext.fillStyle = 'rgba(255,255,255,' + o + ')';
// ofsContext.arc(position.x / drawScale, // ofsContext.arc(position.x / drawScale,
// position.y / drawScale, // position.y / drawScale,
// f.size / drawScale, 0, Math.PI*2, true); // f.size / drawScale, 0, Math.PI*2, true);
// ofsContext.fill(); // ofsContext.fill();
} }
ofsContext.closePath(); ofsContext.closePath();
} }
for (var i = 0; i < particles.length; i++) { for (var i = 0; i < particles.length; i++) {
var p = particles[i]; var p = particles[i];
renderParticle(p); renderParticle(p);
} }
} }
@ -933,7 +933,7 @@ game.import('play',function(lib,game,ui,get,ai,_status){
flakeMove.prototype.update = function() { flakeMove.prototype.update = function() {
var x = this.x, var x = this.x,
y = this.y; y = this.y;
// 左右摆动(余弦) // 左右摆动(余弦)
this.velX *= 0.98; this.velX *= 0.98;

View File

@ -1,66 +1,66 @@
(function(){ (function(){
if(typeof require !== 'function'||typeof document !== 'undefined') return; if(typeof require !== 'function'||typeof document !== 'undefined') return;
global.window=global; global.window=global;
require(__dirname+'/update.js'); require(__dirname+'/update.js');
var fs=require('fs'); var fs=require('fs');
var path=require('path'); var path=require('path');
fs.readFile('game/asset.js','utf-8',function(err, current){ fs.readFile('game/asset.js','utf-8',function(err, current){
var assetlist='\t\''+window.noname_update.version+'\''; var assetlist='\t\''+window.noname_update.version+'\'';
var skinlist='\nwindow.noname_skin_list={\n'; var skinlist='\nwindow.noname_skin_list={\n';
var get = function(dir,callback){ var get = function(dir,callback){
fs.readdir(dir,function(err,list){ fs.readdir(dir,function(err,list){
var shift=function(){ var shift=function(){
if(list.length){ if(list.length){
var filename=list.shift(); var filename=list.shift();
var delay=false; var delay=false;
if(!/\.|~|_/.test(filename[0])){ if(!/\.|~|_/.test(filename[0])){
var url=dir+'/'+filename; var url=dir+'/'+filename;
var stat=fs.statSync(url); var stat=fs.statSync(url);
if(stat.isFile()){ if(stat.isFile()){
if(['.jpg','.png','.mp3','.ttf'].indexOf(path.extname(url))!=-1){ if(['.jpg','.png','.mp3','.ttf'].indexOf(path.extname(url))!=-1){
assetlist+=',\n\t\''+path.relative(path.dirname(__dirname),url)+'\''; assetlist+=',\n\t\''+path.relative(path.dirname(__dirname),url)+'\'';
} }
} }
else if(stat.isDirectory()){ else if(stat.isDirectory()){
if(dir==path.dirname(__dirname)+'/image/skin'){ if(dir==path.dirname(__dirname)+'/image/skin'){
fs.readdir(url,function(err,list){ fs.readdir(url,function(err,list){
var num=0; var num=0;
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
var url2=url+'/'+list[i]; var url2=url+'/'+list[i];
var stat=fs.statSync(url2); var stat=fs.statSync(url2);
if(stat.isFile()&&path.extname(url2)=='.jpg'){ if(stat.isFile()&&path.extname(url2)=='.jpg'){
num++; num++;
} }
} }
skinlist+='\t'+filename+':'+num+',\n'; skinlist+='\t'+filename+':'+num+',\n';
shift(); shift();
}); });
delay=true; delay=true;
} }
else{ else{
get(url,shift); get(url,shift);
delay=true; delay=true;
} }
} }
} }
if(!delay){ if(!delay){
shift(); shift();
} }
} }
else{ else{
callback(); callback();
} }
} }
shift(); shift();
}); });
}; };
get(path.dirname(__dirname),function(){ get(path.dirname(__dirname),function(){
current=current.slice(0,current.lastIndexOf('window.noname_asset_list=[')+26); 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(){ fs.writeFile('game/asset.js',current+'\n'+assetlist+'\n];'+skinlist.slice(0,skinlist.length-2)+'\n};','utf-8',function(){
console.log('done'); console.log('done');
}); });
}); });
}); });
})(); })();
window.noname_asset_list=[ window.noname_asset_list=[

View File

@ -6534,7 +6534,9 @@
game.saveConfigValue('brokenFile'); game.saveConfigValue('brokenFile');
if(!lib.node.http) lib.node.http=require('http'); if(!lib.node.http) lib.node.http=require('http');
if(!lib.node.https) lib.node.https=require('https'); 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); var stream=response.pipe(file);
stream.on('finish',function(){ stream.on('finish',function(){
lib.config.brokenFile.remove(folder); lib.config.brokenFile.remove(folder);
@ -28630,6 +28632,13 @@
} }
return; 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(info.viewAs){
if(typeof info.viewAs=='string'){ if(typeof info.viewAs=='string'){
info.viewAs={name:info.viewAs}; info.viewAs={name:info.viewAs};
@ -35873,7 +35882,7 @@
else{ else{
updatep1.style.display=''; updatep1.style.display='';
updatep2.style.display=''; updatep2.style.display='';
updatep3.style.display='none'; // coding // updatep3.style.display='none'; // coding
updatepx.style.display='none'; updatepx.style.display='none';
updatep4.innerHTML='更新'; updatep4.innerHTML='更新';
} }
@ -35897,7 +35906,7 @@
var button6=document.createElement('button'); var button6=document.createElement('button');
button6.innerHTML='设为国内镜像'; button6.innerHTML='设为国内镜像';
button6.style.display='none';// coding // button6.style.display='none';// coding
// button6.style.marginLeft='5px'; // button6.style.marginLeft='5px';
button6.onclick=function(){ button6.onclick=function(){
game.saveConfig('updateURL',lib.mirrorURL); game.saveConfig('updateURL',lib.mirrorURL);
@ -44129,6 +44138,9 @@
if(method=='trick'&&lib.card[obj.name].type=='delay') return 'trick'; if(method=='trick'&&lib.card[obj.name].type=='delay') return 'trick';
return lib.card[obj.name].type; return lib.card[obj.name].type;
}, },
type2:function(card){
return get.type(card,'trick');
},
subtype:function(obj){ subtype:function(obj){
if(typeof obj=='string') obj={name:obj}; if(typeof obj=='string') obj={name:obj};
if(typeof obj!='object') return; if(typeof obj!='object') return;

View File

@ -3,85 +3,85 @@ var fs = require('fs');
var server = new http.Server(); var server = new http.Server();
server.listen(80); server.listen(80);
server.on('request', function(request, response) { server.on('request', function(request, response) {
var url = require('url').parse(request.url); var url = require('url').parse(request.url);
switch(url.pathname) { switch(url.pathname) {
case ''||'/' : case ''||'/' :
fs.readFile('./index.html', function(err, content){ fs.readFile('./index.html', function(err, content){
if(err) { if(err) {
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' }); response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' });
response.write(err.message); response.write(err.message);
response.end(); response.end();
} else { } else {
response.writeHead(200, { 'Content-Type' : 'text/html; charset=UTF-8' }); response.writeHead(200, { 'Content-Type' : 'text/html; charset=UTF-8' });
response.write(content); response.write(content);
response.end(); response.end();
} }
}); });
break; break;
case '/test/delay': case '/test/delay':
var delay = parseInt(url.query) || 2000; var delay = parseInt(url.query) || 2000;
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'}); response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'});
response.write('Sleeping for' + delay + ' milliseconds...'); response.write('Sleeping for' + delay + ' milliseconds...');
setTimeout(function(){ setTimeout(function(){
response.write('done.'); response.write('done.');
response.end(); response.end();
}, delay); }, delay);
break; break;
case '/test/mirror': case '/test/mirror':
response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'}); response.writeHead(200, {'Content-type':'text/plain; charset=UTF-8'});
response.write(request.mothod + ' ' + request.url + ' HTTP/' + request.httpVersion + '\r\n'); response.write(request.mothod + ' ' + request.url + ' HTTP/' + request.httpVersion + '\r\n');
for (var h in request.headers) { for (var h in request.headers) {
response.write(h + ':' + request.headers[h] + '\r\n'); response.write(h + ':' + request.headers[h] + '\r\n');
} }
response.write('\r\n'); response.write('\r\n');
request.on('data', function(chunk) { response.write(chunk); }); request.on('data', function(chunk) { response.write(chunk); });
request.on('end', function(chunk){ response.end(); }); request.on('end', function(chunk){ response.end(); });
break; break;
case '/json' : case '/json' :
response.writeHead(200, {'Content-type':'application/json; charset=UTF-8'}); response.writeHead(200, {'Content-type':'application/json; charset=UTF-8'});
response.write(JSON.stringify({test:'success'})); response.write(JSON.stringify({test:'success'}));
response.end(); response.end();
break; break;
default: default:
var filename = url.pathname.substring(1); var filename = url.pathname.substring(1);
var type = getType(filename.substring(filename.lastIndexOf('.')+1)); var type = getType(filename.substring(filename.lastIndexOf('.')+1));
fs.readFile(filename, function(err, content){ fs.readFile(filename, function(err, content){
if(err) { if(err) {
response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' }); response.writeHead(404, { 'Content-Type':'text/plain; charset="UTF-8"' });
response.write(err.message); response.write(err.message);
response.end(); response.end();
} else { } else {
response.writeHead(200, { 'Content-Type' : type }); response.writeHead(200, { 'Content-Type' : type });
response.write(content); response.write(content);
response.end(); response.end();
} }
}); });
break; break;
} }
}); });
function getType(endTag){ function getType(endTag){
var type=null; var type=null;
switch(endTag){ switch(endTag){
case 'html' : case 'html' :
case 'htm' : case 'htm' :
type = 'text/html; charset=UTF-8'; type = 'text/html; charset=UTF-8';
break; break;
case 'js' : case 'js' :
type = 'application/javascript; charset="UTF-8"'; type = 'application/javascript; charset="UTF-8"';
break; break;
case 'css' : case 'css' :
type = 'text/css; charset="UTF-8"'; type = 'text/css; charset="UTF-8"';
break; break;
case 'txt' : case 'txt' :
type = 'text/plain; charset="UTF-8"'; type = 'text/plain; charset="UTF-8"';
break; break;
case 'manifest' : case 'manifest' :
type = 'text/cache-manifest; charset="UTF-8"'; type = 'text/cache-manifest; charset="UTF-8"';
break; break;
default : default :
type = 'application/octet-stream'; type = 'application/octet-stream';
break; break;
} }
return type; return type;
} }

View File

@ -1,75 +1,75 @@
window.noname_package={ window.noname_package={
character:{ character:{
standard:'标准', standard:'标准',
shenhua:'神话再临', shenhua:'神话再临',
refresh:'界限突破', refresh:'界限突破',
yijiang:'一将成名', yijiang:'一将成名',
sp:'SP', sp:'SP',
extra:'神将', extra:'神将',
old:'怀旧', old:'怀旧',
diy:'DIY', diy:'DIY',
yxs:'英雄杀', yxs:'英雄杀',
hearth:'炉石传说', hearth:'炉石传说',
gwent:'昆特牌', gwent:'昆特牌',
mtg:'万智牌', mtg:'万智牌',
ow:'守望先锋', ow:'守望先锋',
swd:'轩辕剑', swd:'轩辕剑',
gujian:'古剑奇谭', gujian:'古剑奇谭',
xianjian:'仙剑', xianjian:'仙剑',
}, },
card:{ card:{
standard:'标准', standard:'标准',
extra:'军争', extra:'军争',
sp:'SP', sp:'SP',
guozhan:'国战', guozhan:'国战',
zhenfa:'阵法', zhenfa:'阵法',
yunchou:'运筹帷幄', yunchou:'运筹帷幄',
swd:'轩辕剑', swd:'轩辕剑',
gujian:'古剑奇谭', gujian:'古剑奇谭',
hearth:'炉石传说', hearth:'炉石传说',
gwent:'昆特牌', gwent:'昆特牌',
}, },
play:{ play:{
boss:'诸神降临', boss:'诸神降临',
cardpile:'牌堆补充', cardpile:'牌堆补充',
wuxing:'五行生克', wuxing:'五行生克',
coin:'富甲天下', coin:'富甲天下',
}, },
mode:{ mode:{
identity:'身份', identity:'身份',
guozhan:'国战', guozhan:'国战',
versus:'对决', versus:'对决',
connect:'联机', connect:'联机',
boss:'挑战', boss:'挑战',
chess:'战棋', chess:'战棋',
tafang:'塔防', tafang:'塔防',
stone:'炉石', stone:'炉石',
brawl:'乱斗', brawl:'乱斗',
}, },
background:{ background:{
ol_bg:'龙纹', ol_bg:'龙纹',
zhulin_bg:'竹林', zhulin_bg:'竹林',
shengshi_bg:'盛世', shengshi_bg:'盛世',
taoyuan_bg:'桃园', taoyuan_bg:'桃园',
zhanhuo_bg:'战火', zhanhuo_bg:'战火',
huangtian_bg:'黄天', huangtian_bg:'黄天',
september_bg:'九月', september_bg:'九月',
yinxiang_bg:'印象', yinxiang_bg:'印象',
}, },
music:{ music:{
music_diaochan:'貂蝉', music_diaochan:'貂蝉',
music_shezhan:'舌战', music_shezhan:'舌战',
music_danji:'单骑', music_danji:'单骑',
}, },
font:{ font:{
xiaozhuan:'小篆', xiaozhuan:'小篆',
xinwei:'新魏', xinwei:'新魏',
huangcao:'黄草', huangcao:'黄草',
lishu:'隶书', lishu:'隶书',
}, },
theme:{ theme:{
woodden:'木纹', woodden:'木纹',
music:'音乐', music:'音乐',
simple:'简约' simple:'简约'
} }
}; };

View File

@ -1,27 +1,27 @@
var fs = require('fs'); var fs = require('fs');
var webpage = require('webpage') var webpage = require('webpage')
var load = function(id){ var load = function(id){
var page = webpage.create(); var page = webpage.create();
page.settings.userAgent = 'SpecialAgent'; page.settings.userAgent = 'SpecialAgent';
page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) { page.open('file://'+fs.workingDirectory+'/index.html?server='+id, function(status) {
if(status !== 'success') { if(status !== 'success') {
console.log(fs.workingDirectory); console.log(fs.workingDirectory);
console.log('Unable to access network'); console.log('Unable to access network');
} }
setInterval(function(){ setInterval(function(){
if(page.evaluate(function(){ if(page.evaluate(function(){
if(!lib.node||!lib.node.clients||!lib.node.clients.length){ if(!lib.node||!lib.node.clients||!lib.node.clients.length){
return true; return true;
} }
else{ else{
return false; return false;
} }
})){ })){
page.close(); page.close();
load(id); load(id);
} }
},600000); },600000);
}); });
} }
load(1); load(1);

View File

@ -1,327 +1,327 @@
(function(){ (function(){
var WebSocketServer=require('ws').Server; var WebSocketServer=require('ws').Server;
var wss=new WebSocketServer({port:8080}); var wss=new WebSocketServer({port:8080});
var rooms=[{},{},{},{},{},{}]; var rooms=[{},{},{},{},{},{}];
var events=[]; var events=[];
var clients={}; var clients={};
var messages={ var messages={
enter:function(index,nickname,avatar,config,mode){ enter:function(index,nickname,avatar,config,mode){
this.nickname=nickname; this.nickname=nickname;
this.avatar=avatar; this.avatar=avatar;
var room=rooms[index]; var room=rooms[index];
if(!room){ if(!room){
index=0; index=0;
room=rooms[0]; room=rooms[0];
} }
this.room=room; this.room=room;
delete this.status; delete this.status;
if(room.owner){ if(room.owner){
if(room.servermode&&!room.owner._onconfig&&config&&mode){ if(room.servermode&&!room.owner._onconfig&&config&&mode){
room.owner.sendl('createroom',index,config,mode); room.owner.sendl('createroom',index,config,mode);
room.owner._onconfig=this; room.owner._onconfig=this;
room.owner.nickname=nickname; room.owner.nickname=nickname;
room.owner.avatar=avatar; room.owner.avatar=avatar;
} }
else if(!room.config){ else if(!room.config){
this.sendl('enterroomfailed'); this.sendl('enterroomfailed');
} }
else{ else{
this.owner=room.owner; this.owner=room.owner;
this.owner.sendl('onconnection',this.wsid); this.owner.sendl('onconnection',this.wsid);
} }
util.updaterooms(); util.updaterooms();
} }
else{ else{
room.owner=this; room.owner=this;
this.sendl('createroom',index); this.sendl('createroom',index);
} }
}, },
changeAvatar:function(nickname,avatar){ changeAvatar:function(nickname,avatar){
this.nickname=nickname; this.nickname=nickname;
this.avatar=avatar; this.avatar=avatar;
util.updateclients(); util.updateclients();
}, },
server:function(cfg){ server:function(cfg){
if(cfg){ if(cfg){
this.servermode=true; this.servermode=true;
var room=rooms[cfg[0]]; var room=rooms[cfg[0]];
if(!room||room.owner){ if(!room||room.owner){
this.sendl('reloadroom',true); this.sendl('reloadroom',true);
} }
else{ else{
room.owner=this; room.owner=this;
this.room=room; this.room=room;
this.nickname=cfg[1]; this.nickname=cfg[1];
this.avatar=cfg[2]; this.avatar=cfg[2];
this.sendl('createroom',cfg[0],{},'auto') this.sendl('createroom',cfg[0],{},'auto')
} }
} }
else{ else{
for(var i=0;i<rooms.length;i++){ for(var i=0;i<rooms.length;i++){
if(!rooms[i].owner){ if(!rooms[i].owner){
rooms[i].owner=this; rooms[i].owner=this;
rooms[i].servermode=true; rooms[i].servermode=true;
this.room=rooms[i]; this.room=rooms[i];
this.servermode=true; this.servermode=true;
break; break;
} }
} }
util.updaterooms(); util.updaterooms();
} }
}, },
events:function(cfg,id,type){ events:function(cfg,id,type){
var changed=false; var changed=false;
var time=(new Date()).getTime(); var time=(new Date()).getTime();
if(cfg&&id){ if(cfg&&id){
if(typeof cfg=='string'){ if(typeof cfg=='string'){
for(var i=0;i<events.length;i++){ for(var i=0;i<events.length;i++){
if(events[i].id==cfg){ if(events[i].id==cfg){
if(type=='join'){ if(type=='join'){
if(events[i].members.indexOf(id)==-1){ if(events[i].members.indexOf(id)==-1){
events[i].members.push(id); events[i].members.push(id);
} }
changed=true; changed=true;
} }
else if(type=='leave'){ else if(type=='leave'){
var index=events[i].members.indexOf(id); var index=events[i].members.indexOf(id);
if(index!=-1){ if(index!=-1){
events[i].members.splice(index,1); events[i].members.splice(index,1);
if(events[i].members.length==0){ if(events[i].members.length==0){
events.splice(i--,1); events.splice(i--,1);
} }
} }
changed=true; changed=true;
} }
} }
} }
} }
else if(cfg.hasOwnProperty('utc')&& else if(cfg.hasOwnProperty('utc')&&
cfg.hasOwnProperty('day')&& cfg.hasOwnProperty('day')&&
cfg.hasOwnProperty('hour')&& cfg.hasOwnProperty('hour')&&
cfg.hasOwnProperty('content')){ cfg.hasOwnProperty('content')){
if(events.length>=20){ if(events.length>=20){
this.sendl('eventsdenied','total'); this.sendl('eventsdenied','total');
} }
else if(cfg.utc<=time){ else if(cfg.utc<=time){
this.sendl('eventsdenied','time'); this.sendl('eventsdenied','time');
} }
else{ else{
cfg.nickname=cfg.nickname||'无名玩家'; cfg.nickname=cfg.nickname||'无名玩家';
cfg.avatar=cfg.nickname||'caocao'; cfg.avatar=cfg.nickname||'caocao';
cfg.creator=id; cfg.creator=id;
cfg.id=util.getid(); cfg.id=util.getid();
cfg.members=[id]; cfg.members=[id];
events.unshift(cfg); events.unshift(cfg);
changed=true; changed=true;
} }
} }
} }
if(changed){ if(changed){
util.updateevents(); util.updateevents();
} }
}, },
config:function(config){ config:function(config){
var room=this.room; var room=this.room;
if(room&&room.owner==this){ if(room&&room.owner==this){
if(room.servermode){ if(room.servermode){
room.servermode=false; room.servermode=false;
if(this._onconfig){ if(this._onconfig){
if(clients[this._onconfig.wsid]){ if(clients[this._onconfig.wsid]){
this._onconfig.owner=this; this._onconfig.owner=this;
this.sendl('onconnection',this._onconfig.wsid); this.sendl('onconnection',this._onconfig.wsid);
} }
delete this._onconfig; delete this._onconfig;
} }
} }
room.config=config; room.config=config;
} }
util.updaterooms(); util.updaterooms();
}, },
status:function(str){ status:function(str){
if(typeof str=='string'){ if(typeof str=='string'){
this.status=str; this.status=str;
} }
else{ else{
delete this.status; delete this.status;
} }
util.updateclients(); util.updateclients();
}, },
send:function(id,message){ send:function(id,message){
if(clients[id]&&clients[id].owner==this){ if(clients[id]&&clients[id].owner==this){
try{ try{
clients[id].send(message); clients[id].send(message);
} }
catch(e){ catch(e){
clients[id].close(); clients[id].close();
} }
} }
}, },
close:function(id){ close:function(id){
if(clients[id]&&clients[id].owner==this){ if(clients[id]&&clients[id].owner==this){
clients[id].close(); clients[id].close();
} }
}, },
}; };
var util={ var util={
sendl:function(){ sendl:function(){
var args=[]; var args=[];
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
args.push(arguments[i]); args.push(arguments[i]);
} }
try{ try{
this.send(JSON.stringify(args)); this.send(JSON.stringify(args));
} }
catch(e){ catch(e){
this.close(); this.close();
} }
}, },
getid:function(){ getid:function(){
return (Math.floor(1000000000+9000000000*Math.random())).toString(); return (Math.floor(1000000000+9000000000*Math.random())).toString();
}, },
getroomlist:function(){ getroomlist:function(){
var roomlist=[]; var roomlist=[];
for(var i=0;i<rooms.length;i++){ for(var i=0;i<rooms.length;i++){
rooms[i]._num=0; rooms[i]._num=0;
} }
for(var i in clients){ for(var i in clients){
if(clients[i].room&&!clients[i].servermode){ if(clients[i].room&&!clients[i].servermode){
clients[i].room._num++; clients[i].room._num++;
} }
} }
for(var i=0;i<rooms.length;i++){ for(var i=0;i<rooms.length;i++){
if(rooms[i].servermode){ if(rooms[i].servermode){
roomlist[i]='server'; roomlist[i]='server';
} }
else if(rooms[i].owner&&rooms[i].config){ else if(rooms[i].owner&&rooms[i].config){
if(rooms[i]._num==0){ if(rooms[i]._num==0){
rooms[i].owner.sendl('reloadroom'); rooms[i].owner.sendl('reloadroom');
} }
roomlist[i]=[rooms[i].owner.nickname,rooms[i].owner.avatar, roomlist[i]=[rooms[i].owner.nickname,rooms[i].owner.avatar,
rooms[i].config,rooms[i]._num]; rooms[i].config,rooms[i]._num];
} }
else{ else{
roomlist[i]=null; roomlist[i]=null;
} }
delete rooms[i]._num; delete rooms[i]._num;
} }
return roomlist; return roomlist;
}, },
getclientlist:function(){ getclientlist:function(){
var clientlist=[]; var clientlist=[];
for(var i in clients){ for(var i in clients){
clientlist.push([clients[i].nickname,clients[i].avatar,!clients[i].room,clients[i].status,clients[i].wsid]); clientlist.push([clients[i].nickname,clients[i].avatar,!clients[i].room,clients[i].status,clients[i].wsid]);
} }
return clientlist; return clientlist;
}, },
updaterooms:function(){ updaterooms:function(){
var roomlist=util.getroomlist(); var roomlist=util.getroomlist();
var clientlist=util.getclientlist(); var clientlist=util.getclientlist();
for(var i in clients){ for(var i in clients){
if(!clients[i].room){ if(!clients[i].room){
clients[i].sendl('updaterooms',roomlist,clientlist); clients[i].sendl('updaterooms',roomlist,clientlist);
} }
} }
}, },
updateclients:function(){ updateclients:function(){
var clientlist=util.getclientlist(); var clientlist=util.getclientlist();
for(var i in clients){ for(var i in clients){
if(!clients[i].room){ if(!clients[i].room){
clients[i].sendl('updateclients',clientlist); clients[i].sendl('updateclients',clientlist);
} }
} }
}, },
checkevents:function(){ checkevents:function(){
if(events.length){ if(events.length){
var time=(new Date()).getTime(); var time=(new Date()).getTime();
for(var i=0;i<events.length;i++){ for(var i=0;i<events.length;i++){
if(events[i].utc<=time){ if(events[i].utc<=time){
events.splice(i--,1); events.splice(i--,1);
} }
} }
} }
return events; return events;
}, },
updateevents:function(){ updateevents:function(){
util.checkevents(); util.checkevents();
for(var i in clients){ for(var i in clients){
if(!clients[i].room){ if(!clients[i].room){
clients[i].sendl('updateevents',events); clients[i].sendl('updateevents',events);
} }
} }
} }
}; };
wss.on('connection',function(ws){ wss.on('connection',function(ws){
ws.sendl=util.sendl; ws.sendl=util.sendl;
ws.wsid=util.getid(); ws.wsid=util.getid();
clients[ws.wsid]=ws; clients[ws.wsid]=ws;
ws.sendl('roomlist',util.getroomlist(),util.checkevents(),util.getclientlist(ws),ws.wsid); ws.sendl('roomlist',util.getroomlist(),util.checkevents(),util.getclientlist(ws),ws.wsid);
ws.heartbeat=setInterval(function(){ ws.heartbeat=setInterval(function(){
if(ws.beat){ if(ws.beat){
ws.close(); ws.close();
clearInterval(ws.heartbeat); clearInterval(ws.heartbeat);
} }
else{ else{
ws.beat=true; ws.beat=true;
try{ try{
ws.send('heartbeat'); ws.send('heartbeat');
} }
catch(e){ catch(e){
ws.close(); ws.close();
} }
} }
},60000); },60000);
ws.on('message',function(message){ ws.on('message',function(message){
if(!clients[this.wsid]) return; if(!clients[this.wsid]) return;
if(message=='heartbeat'){ if(message=='heartbeat'){
this.beat=false; this.beat=false;
} }
else if(this.owner){ else if(this.owner){
this.owner.sendl('onmessage',this.wsid,message); this.owner.sendl('onmessage',this.wsid,message);
} }
else{ else{
var arr; var arr;
try{ try{
arr=JSON.parse(message); arr=JSON.parse(message);
if(!Array.isArray(arr)){ if(!Array.isArray(arr)){
throw('err'); throw('err');
} }
} }
catch(e){ catch(e){
this.sendl('denied','banned'); this.sendl('denied','banned');
return; return;
} }
if(arr.shift()=='server'){ if(arr.shift()=='server'){
var type=arr.shift(); var type=arr.shift();
if(messages[type]){ if(messages[type]){
messages[type].apply(this,arr); messages[type].apply(this,arr);
} }
} }
} }
}); });
ws.on('close',function(){ ws.on('close',function(){
for(var i=0;i<rooms.length;i++){ for(var i=0;i<rooms.length;i++){
if(rooms[i].owner==this){ if(rooms[i].owner==this){
rooms[i].owner=null; rooms[i].owner=null;
rooms[i].config=null; rooms[i].config=null;
rooms[i].servermode=false; rooms[i].servermode=false;
for(var j in clients){ for(var j in clients){
if(clients[j].room==rooms[i]&&clients[j]!=this){ if(clients[j].room==rooms[i]&&clients[j]!=this){
clients[j].sendl('selfclose'); clients[j].sendl('selfclose');
// clients[j].close(); // clients[j].close();
// delete clients[j]; // delete clients[j];
} }
} }
} }
} }
if(clients[this.wsid]){ if(clients[this.wsid]){
if(this.owner){ if(this.owner){
this.owner.sendl('onclose',this.wsid); this.owner.sendl('onclose',this.wsid);
} }
delete clients[this.wsid]; delete clients[this.wsid];
} }
if(this.room) util.updaterooms(); if(this.room) util.updaterooms();
else util.updateclients(); else util.updateclients();
}); });
}); });
}()); }());

View File

@ -1,161 +1,161 @@
window.noname_source_list=[ window.noname_source_list=[
'card/extra.js', 'card/extra.js',
'card/gujian.js', 'card/gujian.js',
'card/guozhan.js', 'card/guozhan.js',
'card/gwent.js', 'card/gwent.js',
'card/hearth.js', 'card/hearth.js',
'card/sp.js', 'card/sp.js',
'card/standard.js', 'card/standard.js',
'card/swd.js', 'card/swd.js',
'card/yunchou.js', 'card/yunchou.js',
'card/zhenfa.js', 'card/zhenfa.js',
'character/diy.js', 'character/diy.js',
'character/extra.js', 'character/extra.js',
'character/gujian.js', 'character/gujian.js',
'character/gwent.js', 'character/gwent.js',
'character/hearth.js', 'character/hearth.js',
'character/mtg.js', 'character/mtg.js',
'character/old.js', 'character/old.js',
'character/ow.js', 'character/ow.js',
'character/rank.js', 'character/rank.js',
'character/refresh.js', 'character/refresh.js',
'character/shenhua.js', 'character/shenhua.js',
'character/sp.js', 'character/sp.js',
'character/standard.js', 'character/standard.js',
'character/swd.js', 'character/swd.js',
'character/xianjian.js', 'character/xianjian.js',
'character/yijiang.js', 'character/yijiang.js',
'character/yxs.js', 'character/yxs.js',
'game/asset.js', 'game/asset.js',
'game/codemirror.js', 'game/codemirror.js',
'game/config.js', 'game/config.js',
'game/game.js', 'game/game.js',
'game/http.js', 'game/http.js',
'game/jszip.js', 'game/jszip.js',
'game/package.js', 'game/package.js',
'game/phantom.js', 'game/phantom.js',
'game/pressure.js', 'game/pressure.js',
'game/server.js', 'game/server.js',
'game/source.js', 'game/source.js',
'game/update.js', 'game/update.js',
'layout/default/codemirror.css', 'layout/default/codemirror.css',
'layout/default/layout.css', 'layout/default/layout.css',
'layout/default/menu.css', 'layout/default/menu.css',
'layout/default/phone.css', 'layout/default/phone.css',
'layout/long/layout.css', 'layout/long/layout.css',
'layout/long2/layout.css', 'layout/long2/layout.css',
'layout/mobile/equip.css', 'layout/mobile/equip.css',
'layout/mobile/layout.css', 'layout/mobile/layout.css',
'layout/mode/boss.css', 'layout/mode/boss.css',
'layout/mode/chess.css', 'layout/mode/chess.css',
'layout/mode/stone.css', 'layout/mode/stone.css',
'layout/mode/tafang.css', 'layout/mode/tafang.css',
'layout/newlayout/equip.css', 'layout/newlayout/equip.css',
'layout/newlayout/global.css', 'layout/newlayout/global.css',
'layout/newlayout/layout.css', 'layout/newlayout/layout.css',
'mode/boss.js', 'mode/boss.js',
'mode/chess.js', 'mode/chess.js',
'mode/guozhan.js', 'mode/guozhan.js',
'mode/identity.js', 'mode/identity.js',
'mode/tafang.js', 'mode/tafang.js',
'mode/stone.js', 'mode/stone.js',
'mode/brawl.js', 'mode/brawl.js',
'mode/versus.js', 'mode/versus.js',
'mode/connect.js', 'mode/connect.js',
'extension/boss/extension.js', 'extension/boss/extension.js',
'extension/cardpile/extension.js', 'extension/cardpile/extension.js',
'extension/coin/extension.js', 'extension/coin/extension.js',
'extension/wuxing/extension.js', 'extension/wuxing/extension.js',
'theme/music/grid.png', 'theme/music/grid.png',
'theme/music/style.css', 'theme/music/style.css',
'theme/music/wood.png', 'theme/music/wood.png',
'theme/music/wood3.png', 'theme/music/wood3.png',
'theme/simple/card.png', 'theme/simple/card.png',
'theme/simple/grid.png', 'theme/simple/grid.png',
'theme/simple/style.css', 'theme/simple/style.css',
'theme/simple/unknown.png', 'theme/simple/unknown.png',
'theme/simple/wood.png', 'theme/simple/wood.png',
'theme/simple/wood3.png', 'theme/simple/wood3.png',
'theme/woodden/grid.png', 'theme/woodden/grid.png',
'theme/woodden/style.css', 'theme/woodden/style.css',
'theme/woodden/wood.jpg', 'theme/woodden/wood.jpg',
'theme/woodden/wood.png', 'theme/woodden/wood.png',
'theme/woodden/wood2.jpg', 'theme/woodden/wood2.jpg',
'theme/woodden/wood2.png', 'theme/woodden/wood2.png',
'theme/style/card/custom.css', 'theme/style/card/custom.css',
'theme/style/card/default.css', 'theme/style/card/default.css',
'theme/style/card/music.css', 'theme/style/card/music.css',
'theme/style/card/simple.css', 'theme/style/card/simple.css',
'theme/style/card/wood.css', 'theme/style/card/wood.css',
'theme/style/card/new.css', 'theme/style/card/new.css',
'theme/style/card/ol.css', 'theme/style/card/ol.css',
'theme/style/card/image/new.png', 'theme/style/card/image/new.png',
'theme/style/card/image/ol.png', 'theme/style/card/image/ol.png',
'theme/style/cardback/custom.css', 'theme/style/cardback/custom.css',
'theme/style/cardback/default.css', 'theme/style/cardback/default.css',
'theme/style/cardback/feicheng.css', 'theme/style/cardback/feicheng.css',
'theme/style/cardback/liusha.css', 'theme/style/cardback/liusha.css',
'theme/style/cardback/music.css', 'theme/style/cardback/music.css',
'theme/style/cardback/new.css', 'theme/style/cardback/new.css',
'theme/style/cardback/ol.css', 'theme/style/cardback/ol.css',
'theme/style/cardback/official.css', 'theme/style/cardback/official.css',
'theme/style/cardback/wood.css', 'theme/style/cardback/wood.css',
'theme/style/cardback/image/feicheng.png', 'theme/style/cardback/image/feicheng.png',
'theme/style/cardback/image/feicheng2.png', 'theme/style/cardback/image/feicheng2.png',
'theme/style/cardback/image/liusha.png', 'theme/style/cardback/image/liusha.png',
'theme/style/cardback/image/liusha2.png', 'theme/style/cardback/image/liusha2.png',
'theme/style/cardback/image/new.png', 'theme/style/cardback/image/new.png',
'theme/style/cardback/image/new2.png', 'theme/style/cardback/image/new2.png',
'theme/style/cardback/image/official.png', 'theme/style/cardback/image/official.png',
'theme/style/cardback/image/official2.png', 'theme/style/cardback/image/official2.png',
'theme/style/cardback/image/ol.png', 'theme/style/cardback/image/ol.png',
'theme/style/cardback/image/ol2.png', 'theme/style/cardback/image/ol2.png',
'theme/style/hp/custom.css', 'theme/style/hp/custom.css',
'theme/style/hp/default.css', 'theme/style/hp/default.css',
'theme/style/hp/emotion.css', 'theme/style/hp/emotion.css',
'theme/style/hp/glass.css', 'theme/style/hp/glass.css',
'theme/style/hp/official.css', 'theme/style/hp/official.css',
'theme/style/hp/ol.css', 'theme/style/hp/ol.css',
'theme/style/hp/round.css', 'theme/style/hp/round.css',
'theme/style/hp/image/emotion1.png', 'theme/style/hp/image/emotion1.png',
'theme/style/hp/image/emotion2.png', 'theme/style/hp/image/emotion2.png',
'theme/style/hp/image/emotion3.png', 'theme/style/hp/image/emotion3.png',
'theme/style/hp/image/emotion4.png', 'theme/style/hp/image/emotion4.png',
'theme/style/hp/image/glass1.png', 'theme/style/hp/image/glass1.png',
'theme/style/hp/image/glass2.png', 'theme/style/hp/image/glass2.png',
'theme/style/hp/image/glass3.png', 'theme/style/hp/image/glass3.png',
'theme/style/hp/image/glass4.png', 'theme/style/hp/image/glass4.png',
'theme/style/hp/image/official1.png', 'theme/style/hp/image/official1.png',
'theme/style/hp/image/official2.png', 'theme/style/hp/image/official2.png',
'theme/style/hp/image/official3.png', 'theme/style/hp/image/official3.png',
'theme/style/hp/image/official4.png', 'theme/style/hp/image/official4.png',
'theme/style/hp/image/ol1.png', 'theme/style/hp/image/ol1.png',
'theme/style/hp/image/ol2.png', 'theme/style/hp/image/ol2.png',
'theme/style/hp/image/ol3.png', 'theme/style/hp/image/ol3.png',
'theme/style/hp/image/ol4.png', 'theme/style/hp/image/ol4.png',
'theme/style/hp/image/round1.png', 'theme/style/hp/image/round1.png',
'theme/style/hp/image/round2.png', 'theme/style/hp/image/round2.png',
'theme/style/hp/image/round3.png', 'theme/style/hp/image/round3.png',
'theme/style/hp/image/round4.png', 'theme/style/hp/image/round4.png',
'node_modules/ws/index.js', 'node_modules/ws/index.js',
'node_modules/ws/package.json', 'node_modules/ws/package.json',
'node_modules/ws/lib/BufferPool.js', 'node_modules/ws/lib/BufferPool.js',
'node_modules/ws/lib/BufferUtil.fallback.js', 'node_modules/ws/lib/BufferUtil.fallback.js',
'node_modules/ws/lib/BufferUtil.js', 'node_modules/ws/lib/BufferUtil.js',
'node_modules/ws/lib/ErrorCodes.js', 'node_modules/ws/lib/ErrorCodes.js',
'node_modules/ws/lib/Extensions.js', 'node_modules/ws/lib/Extensions.js',
'node_modules/ws/lib/PerMessageDeflate.js', 'node_modules/ws/lib/PerMessageDeflate.js',
'node_modules/ws/lib/Receiver.hixie.js', 'node_modules/ws/lib/Receiver.hixie.js',
'node_modules/ws/lib/Receiver.js', 'node_modules/ws/lib/Receiver.js',
'node_modules/ws/lib/Sender.hixie.js', 'node_modules/ws/lib/Sender.hixie.js',
'node_modules/ws/lib/Sender.js', 'node_modules/ws/lib/Sender.js',
'node_modules/ws/lib/Validation.fallback.js', 'node_modules/ws/lib/Validation.fallback.js',
'node_modules/ws/lib/Validation.js', 'node_modules/ws/lib/Validation.js',
'node_modules/ws/lib/WebSocket.js', 'node_modules/ws/lib/WebSocket.js',
'node_modules/ws/lib/WebSocketServer.js', 'node_modules/ws/lib/WebSocketServer.js',
'node_modules/ultron/index.js', 'node_modules/ultron/index.js',
'node_modules/ultron/package.json', 'node_modules/ultron/package.json',
'node_modules/ultron/test.js', 'node_modules/ultron/test.js',
'node_modules/options/package.json', 'node_modules/options/package.json',
'node_modules/options/lib/options.js', 'node_modules/options/lib/options.js',
]; ];

View File

@ -1,55 +1,59 @@
window.noname_update={ window.noname_update={
version:'1.9.48.1', version:'1.9.49',
update:'1.9.48', // update:'1.9.48',
changeLog:[ changeLog:[
'bug修复' // '祭天祀地模式(在 选项-开始-身份 中开启)',
], '修复国内镜像更新问题',
files:[ '武将修改',
'game/game.js', '毛玻璃主题仅Safari可用',
// 'game/package.js', 'players://["chenqun","lifeng","maliang","huanghao"]'
// 'game/config.js', ],
// 'game/source.js', files:[
// 'game/pressure.js', // 'game/game.js',
// 'game/asset.js', // 'game/package.js',
// 'card/*', // 'game/config.js',
// 'card/extra.js', // 'game/source.js',
// 'card/yunchou.js', // 'game/pressure.js',
// 'card/swd.js', // 'game/asset.js',
// 'card/gwent.js', // 'card/*',
// 'card/standard.js', // 'card/extra.js',
// 'character/*', // 'card/yunchou.js',
// 'character/hearth.js', // 'card/swd.js',
// 'character/gwent.js', // 'card/gwent.js',
// 'character/diy.js', // 'card/standard.js',
// 'character/standard.js', // 'character/*',
'character/shenhua.js', // 'character/hearth.js',
// 'character/refresh.js', // 'character/gwent.js',
// 'character/yijiang.js', // 'character/diy.js',
// 'character/yxs.js', // 'character/standard.js',
// 'character/swd.js', // 'character/shenhua.js',
// 'character/sp.js', // 'character/refresh.js',
// 'character/rank.js', // 'character/yijiang.js',
// 'mode/identity.js', // 'character/yxs.js',
// 'mode/boss.js', // 'character/swd.js',
// 'mode/guozhan.js', // 'character/sp.js',
// 'mode/versus.js', // 'character/rank.js',
// 'mode/connect.js', // 'mode/identity.js',
// 'mode/chess.js', // 'mode/boss.js',
// 'mode/tafang.js', // 'mode/guozhan.js',
// 'mode/guozhan.js', // 'mode/versus.js',
// 'mode/stone.js', // 'mode/connect.js',
// 'theme/music/style.css', // 'mode/chess.js',
// 'theme/woodden/style.css', // 'mode/tafang.js',
// 'theme/simple/style.css', // 'mode/guozhan.js',
// 'layout/default/layout.css', // 'mode/stone.js',
// 'layout/default/phone.css', // 'theme/music/style.css',
// 'layout/default/menu.css', // 'theme/woodden/style.css',
// 'theme/style/cardback/*', // 'theme/simple/style.css',
// 'layout/long/layout.css', // 'layout/default/layout.css',
// 'layout/long2/layout.css', // 'layout/default/phone.css',
// 'layout/mobile/layout.css', // 'layout/default/menu.css',
// 'layout/newlayout/global.css', // 'theme/style/cardback/*',
// 'layout/mode/chess.css', // 'layout/long/layout.css',
// 'extension/boss/extension.js', // 'layout/long2/layout.css',
] // 'layout/mobile/layout.css',
// 'layout/newlayout/global.css',
// 'layout/mode/chess.css',
// 'extension/boss/extension.js',
]
} }

View File

@ -580,7 +580,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['guilongzhanyuedao'], skills:['guilongzhanyuedao'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:9 equipValue:9
} }
@ -591,7 +591,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
subtype:'equip2', subtype:'equip2',
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
skills:['guofengyupao'], skills:['guofengyupao'],
ai:{ ai:{
equipValue:9 equipValue:9
@ -604,7 +604,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['qimenbagua'], skills:['qimenbagua'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:9 equipValue:9
} }
@ -617,7 +617,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['chixueqingfeng'], skills:['chixueqingfeng'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:9 equipValue:9
} }
@ -630,7 +630,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['chiyanzhenhunqin'], skills:['chiyanzhenhunqin'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:5 equipValue:5
} }
@ -642,7 +642,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['juechenjinge'], skills:['juechenjinge'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:9 equipValue:9
} }
@ -655,7 +655,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['xiuluolianyuji'], skills:['xiuluolianyuji'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:9 equipValue:9
} }
@ -667,7 +667,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
skills:['xuwangzhimian'], skills:['xuwangzhimian'],
nomod:true, nomod:true,
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
equipValue:9 equipValue:9
} }
@ -1087,7 +1087,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
game.check(); game.check();
if(ui.cheat){ if(ui.cheat){
ui.cheat.animate('controlpressdownx',500); ui.cheat.animate('controlpressdownx',500);
ui.cheat.classList.remove('disabled'); ui.cheat.classList.remove('disabled');
} }
if(_status.bosschoice){ if(_status.bosschoice){
@ -1623,9 +1623,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
targetEnabled:function(card,player,target,now){ targetEnabled:function(card,player,target,now){
if(target.isEnemyOf(player)){ if(target.isEnemyOf(player)){
var type=get.type(card,'trick'); var type=get.type(card,'trick');
if(type=='trick'){ if(type=='trick'){
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return current.name=='boss_shuishenxuanming'; return current.name=='boss_shuishenxuanming';
})){ })){
@ -1639,8 +1639,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return false; return false;
} }
} }
} }
} }
} }
}, },
boss_lingqu:{ boss_lingqu:{
@ -2076,21 +2076,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
boss_futai2:{ boss_futai2:{
mod:{ mod:{
cardSavable:function(card,player){ cardSavable:function(card,player){
if(card.name=='tao'&&game.hasPlayer(function(current){ if(card.name=='tao'&&game.hasPlayer(function(current){
return current!=player&&current.hasSkill('boss_futai')&&_status.currentPhase!=current; return current!=player&&current.hasSkill('boss_futai')&&_status.currentPhase!=current;
})){ })){
return false; return false;
} }
}, },
cardEnabled:function(card,player){ cardEnabled:function(card,player){
if(card.name=='tao'&&game.hasPlayer(function(current){ if(card.name=='tao'&&game.hasPlayer(function(current){
return current!=player&&current.hasSkill('boss_futai')&&_status.currentPhase!=current; return current!=player&&current.hasSkill('boss_futai')&&_status.currentPhase!=current;
})){ })){
return false; return false;
} }
}, },
} }
}, },
boss_luanchang:{ boss_luanchang:{
group:['boss_luanchang_begin','boss_luanchang_end'], group:['boss_luanchang_begin','boss_luanchang_end'],
@ -2357,41 +2357,41 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
qimenbagua:{ qimenbagua:{
trigger:{target:'shaBefore'}, trigger:{target:'shaBefore'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event.player.hasSkillTag('unequip',false,event.card)) return false; if(event.player.hasSkillTag('unequip',false,event.card)) return false;
return true; return true;
}, },
content:function(){ content:function(){
trigger.cancel(); trigger.cancel();
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
if(player.hasSkillTag('unequip',false,card)) return; if(player.hasSkillTag('unequip',false,card)) return;
if(card.name=='sha') return 'zerotarget'; if(card.name=='sha') return 'zerotarget';
} }
} }
} }
}, },
guilongzhanyuedao:{ guilongzhanyuedao:{
trigger:{player:'shaBegin'}, trigger:{player:'shaBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return event.card&&get.color(event.card)=='red'; return event.card&&get.color(event.card)=='red';
}, },
content:function(){ content:function(){
trigger.directHit=true; trigger.directHit=true;
} }
}, },
guofengyupao:{ guofengyupao:{
mod:{ mod:{
targetEnabled:function(card,player,target,now){ targetEnabled:function(card,player,target,now){
if(player!=target){ if(player!=target){
if(get.type(card)=='trick') return false; if(get.type(card)=='trick') return false;
} }
} }
} }
}, },
boss_chiyan:{ boss_chiyan:{
trigger:{global:'gameStart'}, trigger:{global:'gameStart'},
@ -3276,10 +3276,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
global:'boss_huihuo2', global:'boss_huihuo2',
unique:true, unique:true,
mod:{ mod:{
cardUsable:function(card,player,num){ cardUsable:function(card,player,num){
if(card.name=='sha') return num+1; if(card.name=='sha') return num+1;
} }
}, },
ai:{ ai:{
revertsave:true, revertsave:true,
effect:{ effect:{
@ -3522,7 +3522,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
unique:true, unique:true,
filter:function(event,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.isEnemyOf(player)&&!event.player.hasSkill('boss_zhongdu'); return event.player.isIn()&&event.player.isEnemyOf(player)&&!event.player.hasSkill('boss_zhongdu');
}, },
logTarget:'player', logTarget:'player',
@ -4121,10 +4121,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
fengqi2:{ fengqi2:{
mod:{ mod:{
wuxieRespondable:function(){ wuxieRespondable:function(){
return false; return false;
} }
} }
}, },
gaiming:{ gaiming:{
trigger:{player:'judgeBefore'}, trigger:{player:'judgeBefore'},
@ -4691,43 +4691,43 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
}, },
boss_qixiang:{ boss_qixiang:{
group:['boss_qixiang1','boss_qixiang2'], group:['boss_qixiang1','boss_qixiang2'],
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(card.name=='lebu'&&card.name=='bingliang') return 0.8; if(card.name=='lebu'&&card.name=='bingliang') return 0.8;
} }
} }
} }
}, },
boss_qixiang1:{ boss_qixiang1:{
trigger:{player:'judge'}, trigger:{player:'judge'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event.card){ if(event.card){
if(event.card.viewAs){ if(event.card.viewAs){
return event.card.viewAs=='lebu'; return event.card.viewAs=='lebu';
} }
else{ else{
return event.card.name=='lebu'; return event.card.name=='lebu';
} }
} }
}, },
content:function(){ content:function(){
player.addTempSkill('boss_qixiang3','judgeAfter'); player.addTempSkill('boss_qixiang3','judgeAfter');
} }
}, },
boss_qixiang2:{ boss_qixiang2:{
trigger:{player:'judge'}, trigger:{player:'judge'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(event.card){ if(event.card){
if(event.card.viewAs){ if(event.card.viewAs){
return event.card.viewAs=='bingliang'; return event.card.viewAs=='bingliang';
} }
else{ else{
return event.card.name=='bingliang'; return event.card.name=='bingliang';
} }
} }
}, },
content:function(){ content:function(){
@ -4959,38 +4959,38 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
boss_suoming:{ boss_suoming:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&!current.isLinked(); return current!=player&&!current.isLinked();
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
var num=game.countPlayer(function(current){ var num=game.countPlayer(function(current){
return current!=player&&!current.isLinked(); return current!=player&&!current.isLinked();
}); });
player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){ player.chooseTarget(get.prompt('boss_suoming'),[1,num],function(card,player,target){
return !target.isLinked()&&player!=target; return !target.isLinked()&&player!=target;
}).ai=function(target){ }).ai=function(target){
return -get.attitude(player,target); return -get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.logSkill('boss_suoming',result.targets); player.logSkill('boss_suoming',result.targets);
event.targets=result.targets; event.targets=result.targets;
event.num=0; event.num=0;
} }
else{ else{
event.finish(); event.finish();
} }
"step 2" "step 2"
if(event.num<event.targets.length){ if(event.num<event.targets.length){
event.targets[event.num].link(); event.targets[event.num].link();
event.num++; event.num++;
event.redo(); event.redo();
} }
}, },
}, },
boss_taiping:{ boss_taiping:{
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
@ -5026,12 +5026,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
boss_manjia:{ boss_manjia:{
group:['boss_manjia1','boss_manjia2'] group:['boss_manjia1','boss_manjia2']
}, },
boss_manjia1:{ boss_manjia1:{
trigger:{target:'useCardToBefore'}, trigger:{target:'useCardToBefore'},
forced:true, forced:true,
priority:6, priority:6,
filter:function(event,player){ filter:function(event,player){
if(player.getEquip(2)) return false; if(player.getEquip(2)) return false;
return lib.skill.tengjia1.filter(event,player); return lib.skill.tengjia1.filter(event,player);
}, },
content:function(){ content:function(){
@ -5040,7 +5040,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ 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); 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:{ boss_manjia2:{
trigger:{player:'damageBegin'}, trigger:{player:'damageBegin'},
filter:function(event,player){ filter:function(event,player){
if(player.getEquip(2)) return false; if(player.getEquip(2)) return false;
if(event.nature=='fire') return true; if(event.nature=='fire') return true;
}, },
forced:true, forced:true,
check:function(){ check:function(){
return false; return false;
}, },
content:function(){ content:function(){
trigger.num++; trigger.num++;
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ 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); 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:{ boss_guiji:{
trigger:{player:'phaseJudgeBegin'}, trigger:{player:'phaseJudgeBegin'},
forced:true, forced:true,
content:function(){ content:function(){
player.discard(player.getCards('j').randomGet()); player.discard(player.getCards('j').randomGet());
}, },
filter:function(event ,player){ filter:function(event ,player){
return player.countCards('j')>0; return player.countCards('j')>0;
}, },
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1; if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1;
} }
} }
} }
}, },
boss_minbao:{ boss_minbao:{
global:'boss_minbao2' global:'boss_minbao2'
@ -5400,15 +5400,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
boss_qiangzheng:{ boss_qiangzheng:{
audio:2, audio:2,
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
unique:true, unique:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&current.countCards('h'); return current!=player&&current.countCards('h');
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
var players=get.players(player); var players=get.players(player);
players.remove(player); players.remove(player);
event.players=players; event.players=players;
@ -5424,7 +5424,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
event.redo(); event.redo();
} }
} }
}, },
guizhen:{ guizhen:{
audio:2, audio:2,
@ -5887,29 +5887,29 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
boss_tianyu:{ boss_tianyu:{
audio:true, audio:true,
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
if(player.isLinked()) return true; if(player.isLinked()) return true;
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current!=player&&!current.isLinked(); return current!=player&&!current.isLinked();
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
event.targets=game.filterPlayer(); event.targets=game.filterPlayer();
event.targets.remove(player); event.targets.remove(player);
event.targets.sort(lib.sort.seat); event.targets.sort(lib.sort.seat);
if(player.isLinked()) player.link(); if(player.isLinked()) player.link();
"step 1" "step 1"
if(event.targets.length){ if(event.targets.length){
var target=event.targets.shift(); var target=event.targets.shift();
if(!target.isLinked()){ if(!target.isLinked()){
target.link(); target.link();
player.line(target,'green'); player.line(target,'green');
} }
event.redo(); event.redo();
} }
} }
}, },
boss_jizhi:{ boss_jizhi:{
audio:2, audio:2,
@ -6236,48 +6236,48 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
}, },
qiwu:{ qiwu:{
audio:true, audio:true,
trigger:{player:'useCard'}, trigger:{player:'useCard'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
return get.suit(event.card)=='club'&&player.hp<player.maxHp; return get.suit(event.card)=='club'&&player.hp<player.maxHp;
}, },
content:function(){ content:function(){
player.recover(); player.recover();
} }
}, },
jizhen:{ jizhen:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
return current.isDamaged()&&current!=player; return current.isDamaged()&&current!=player;
}); });
}, },
content:function(){ content:function(){
"step 0" "step 0"
var num=0; var num=0;
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(!game.players[i].isLinked()&&player!=game.players[i]){ if(!game.players[i].isLinked()&&player!=game.players[i]){
num++; num++;
} }
} }
player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){ player.chooseTarget(get.prompt('jizhen'),[1,2],function(card,player,target){
return target.hp<target.maxHp&&player!=target; return target.hp<target.maxHp&&player!=target;
}).ai=function(target){ }).ai=function(target){
return get.attitude(player,target); return get.attitude(player,target);
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.logSkill('jizhen',result.targets); player.logSkill('jizhen',result.targets);
game.asyncDraw(result.targets); game.asyncDraw(result.targets);
} }
}, },
ai:{ ai:{
expose:0.3, expose:0.3,
threaten:1.3 threaten:1.3
} }
}, },
shenqu:{ shenqu:{
group:'shenqu2', group:'shenqu2',
trigger:{global:'phaseBegin'}, trigger:{global:'phaseBegin'},
@ -6626,10 +6626,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
boss_qixiang2:'祺祥', boss_qixiang2:'祺祥',
boss_qixiang_info:'乐不思蜀判定时,你的方块判定牌视为红桃;兵粮寸断判定时,你的黑桃判定牌视为草花', boss_qixiang_info:'乐不思蜀判定时,你的方块判定牌视为红桃;兵粮寸断判定时,你的黑桃判定牌视为草花',
qiwu:'栖梧', qiwu:'栖梧',
qiwu_info:'锁定技。每当你使用一张梅花牌,你回复一点体力', qiwu_info:'锁定技。每当你使用一张梅花牌,你回复一点体力',
jizhen:'激阵', jizhen:'激阵',
jizhen_info:'结束阶段,你可以令所至多两名已受伤角色摸一张牌', jizhen_info:'结束阶段,你可以令所至多两名已受伤角色摸一张牌',
boss_yushou:'驭兽', boss_yushou:'驭兽',
boss_yushou_info:'出牌阶段开始时,你可以对所有敌方角色使用一张南蛮入侵', boss_yushou_info:'出牌阶段开始时,你可以对所有敌方角色使用一张南蛮入侵',

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,156 +2,156 @@
game.import('mode',function(lib,game,ui,get,ai,_status){ game.import('mode',function(lib,game,ui,get,ai,_status){
return { return {
name:'connect', name:'connect',
start:function(){ start:function(){
var directstartmode=lib.config.directstartmode; var directstartmode=lib.config.directstartmode;
ui.create.menu(true); ui.create.menu(true);
event.textnode=ui.create.div('','输入联机地址'); event.textnode=ui.create.div('','输入联机地址');
var createNode=function(){ var createNode=function(){
if(event.created) return; if(event.created) return;
if(directstartmode&&lib.node){ if(directstartmode&&lib.node){
ui.exitroom=ui.create.system('退出房间',function(){ ui.exitroom=ui.create.system('退出房间',function(){
game.saveConfig('directstartmode'); game.saveConfig('directstartmode');
game.reload(); game.reload();
},true); },true);
game.switchMode(directstartmode); game.switchMode(directstartmode);
return; return;
} }
if(lib.node&&window.require){ if(lib.node&&window.require){
ui.startServer=ui.create.system('启动服务器',function(e){ ui.startServer=ui.create.system('启动服务器',function(e){
e.stopPropagation(); e.stopPropagation();
ui.click.connectMenu(); ui.click.connectMenu();
},true); },true);
} }
event.created=true; event.created=true;
var node=ui.create.div('.shadowed'); var node=ui.create.div('.shadowed');
node.style.width='400px'; node.style.width='400px';
node.style.height='30px'; node.style.height='30px';
node.style.lineHeight='30px'; node.style.lineHeight='30px';
node.style.fontFamily='xinwei'; node.style.fontFamily='xinwei';
node.style.fontSize='30px'; node.style.fontSize='30px';
node.style.padding='10px'; node.style.padding='10px';
node.style.left='calc(50% - 210px)'; node.style.left='calc(50% - 210px)';
node.style.top='calc(50% - 20px)'; node.style.top='calc(50% - 20px)';
node.style.whiteSpace='nowrap'; node.style.whiteSpace='nowrap';
node.innerHTML=lib.config.last_ip||lib.hallURL; node.innerHTML=lib.config.last_ip||lib.hallURL;
node.contentEditable=true; node.contentEditable=true;
node.style.webkitUserSelect='text'; node.style.webkitUserSelect='text';
node.style.textAlign='center'; node.style.textAlign='center';
var connect=function(e){ var connect=function(e){
event.textnode.innerHTML='正在连接...'; event.textnode.innerHTML='正在连接...';
clearTimeout(event.timeout); clearTimeout(event.timeout);
if(e) e.preventDefault(); if(e) e.preventDefault();
game.saveConfig('last_ip',node.innerHTML); game.saveConfig('last_ip',node.innerHTML);
game.connect(node.innerHTML,function(success){ game.connect(node.innerHTML,function(success){
if(!success&&event.textnode){ if(!success&&event.textnode){
alert('连接失败'); alert('连接失败');
event.textnode.innerHTML='输入联机地址'; event.textnode.innerHTML='输入联机地址';
} }
}); });
}; };
node.addEventListener('keydown',function(e){ node.addEventListener('keydown',function(e){
if(e.keyCode==13){ if(e.keyCode==13){
connect(e); connect(e);
} }
}); });
ui.window.appendChild(node); ui.window.appendChild(node);
ui.ipnode=node; ui.ipnode=node;
var text=event.textnode; var text=event.textnode;
text.style.width='400px'; text.style.width='400px';
text.style.height='30px'; text.style.height='30px';
text.style.lineHeight='30px'; text.style.lineHeight='30px';
text.style.fontFamily='xinwei'; text.style.fontFamily='xinwei';
text.style.fontSize='30px'; text.style.fontSize='30px';
text.style.padding='10px'; text.style.padding='10px';
text.style.left='calc(50% - 200px)'; text.style.left='calc(50% - 200px)';
text.style.top='calc(50% - 80px)'; text.style.top='calc(50% - 80px)';
text.style.textAlign='center'; text.style.textAlign='center';
ui.window.appendChild(text); ui.window.appendChild(text);
ui.iptext=text; ui.iptext=text;
var button=ui.create.div('.menubutton.highlight.large.pointerdiv','连接',connect); var button=ui.create.div('.menubutton.highlight.large.pointerdiv','连接',connect);
button.style.width='70px'; button.style.width='70px';
button.style.left='calc(50% - 35px)'; button.style.left='calc(50% - 35px)';
button.style.top='calc(50% + 60px)'; button.style.top='calc(50% + 60px)';
ui.window.appendChild(button); ui.window.appendChild(button);
ui.ipbutton=button; ui.ipbutton=button;
ui.hall_button=ui.create.system('联机大厅',function(){ ui.hall_button=ui.create.system('联机大厅',function(){
node.innerHTML=get.config('hall_ip')||lib.hallURL; node.innerHTML=get.config('hall_ip')||lib.hallURL;
connect(); connect();
},true); },true);
if(!get.config('hall_button')){ if(!get.config('hall_button')){
ui.hall_button.style.display='none'; ui.hall_button.style.display='none';
} }
ui.recentIP=ui.create.system('最近连接',null,true); ui.recentIP=ui.create.system('最近连接',null,true);
var clickLink=function(){ var clickLink=function(){
node.innerHTML=this.innerHTML; node.innerHTML=this.innerHTML;
connect(); connect();
}; };
lib.setPopped(ui.recentIP,function(){ lib.setPopped(ui.recentIP,function(){
if(!lib.config.recentIP.length) return; if(!lib.config.recentIP.length) return;
var uiintro=ui.create.dialog('hidden'); var uiintro=ui.create.dialog('hidden');
uiintro.listen(function(e){ uiintro.listen(function(e){
e.stopPropagation(); e.stopPropagation();
}); });
var list=ui.create.div('.caption'); var list=ui.create.div('.caption');
for(var i=0;i<lib.config.recentIP.length;i++){ for(var i=0;i<lib.config.recentIP.length;i++){
ui.create.div('.text.textlink',list,clickLink).innerHTML=get.trimip(lib.config.recentIP[i]); ui.create.div('.text.textlink',list,clickLink).innerHTML=get.trimip(lib.config.recentIP[i]);
} }
uiintro.add(list); uiintro.add(list);
var clear=uiintro.add('<div class="text center">清除</div>'); var clear=uiintro.add('<div class="text center">清除</div>');
clear.style.paddingTop=0; clear.style.paddingTop=0;
clear.style.paddingBottom='3px'; clear.style.paddingBottom='3px';
clear.listen(function(){ clear.listen(function(){
lib.config.recentIP.length=0; lib.config.recentIP.length=0;
game.saveConfig('recentIP',[]); game.saveConfig('recentIP',[]);
uiintro.delete(); uiintro.delete();
}); });
return uiintro; return uiintro;
},220); },220);
lib.init.onfree(); lib.init.onfree();
} }
if(window.isNonameServer){ if(window.isNonameServer){
game.connect(window.isNonameServerIp||'localhost'); game.connect(window.isNonameServerIp||'localhost');
} }
else if(lib.config.reconnect_info){ else if(lib.config.reconnect_info){
var info=lib.config.reconnect_info; var info=lib.config.reconnect_info;
game.onlineID=info[1]; game.onlineID=info[1];
game.roomId=info[2]; game.roomId=info[2];
if(typeof game.roomId=='number'){ if(typeof game.roomId=='number'){
game.roomIdServer=true; game.roomIdServer=true;
} }
var n=5; var n=5;
var connect=function(){ var connect=function(){
event.textnode.innerHTML='正在连接...'; event.textnode.innerHTML='正在连接...';
game.connect(info[0],function(success){ game.connect(info[0],function(success){
if(!success&&n--){ if(!success&&n--){
createNode(); createNode();
event.timeout=setTimeout(connect,1000); event.timeout=setTimeout(connect,1000);
} }
else{ else{
event.textnode.innerHTML='输入联机地址'; event.textnode.innerHTML='输入联机地址';
} }
}); });
}; };
event.timeout=setTimeout(connect,500); event.timeout=setTimeout(connect,500);
_status.createNodeTimeout=setTimeout(createNode,2000); _status.createNodeTimeout=setTimeout(createNode,2000);
} }
else{ else{
createNode(); createNode();
} }
_status.connectDenied=createNode; _status.connectDenied=createNode;
for(var i in lib.element.event){ for(var i in lib.element.event){
event.parent[i]=lib.element.event[i]; event.parent[i]=lib.element.event[i];
} }
event.parent.custom={ event.parent.custom={
add:{}, add:{},
replace:{} replace:{}
}; };
setTimeout(lib.init.onfree,1000); setTimeout(lib.init.onfree,1000);
} }
}; };
}); });

View File

@ -2,11 +2,11 @@
game.import('mode',function(lib,game,ui,get,ai,_status){ game.import('mode',function(lib,game,ui,get,ai,_status){
return { return {
name:'realtime', name:'realtime',
start:function(){ start:function(){
}, },
game:{ game:{
} }
}; };
}); });

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
ui.roundmenu.style.display=''; ui.roundmenu.style.display='';
} }
if(lib.config.player_border=='normal'&&(lib.config.layout=='long'||lib.config.layout=='long2')){ 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 i in result.element){
for(var j in result.element[i]){ for(var j in result.element[i]){
if(j!='dieAfter'){ if(j!='dieAfter'){
@ -50,27 +50,27 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
} }
// if(!localStorage.getItem(lib.configprefix+'playback')){ // if(!localStorage.getItem(lib.configprefix+'playback')){
// game.loadMap(); // game.loadMap();
// } // }
"step 2" "step 2"
var result='basic_medium'; var result='basic_medium';
_status.map=lib.tafang.map[result]; _status.map=lib.tafang.map[result];
_status.mapname=result; _status.mapname=result;
ui.chesssheet=document.createElement('style'); ui.chesssheet=document.createElement('style');
document.head.appendChild(ui.chesssheet); document.head.appendChild(ui.chesssheet);
var playback=localStorage.getItem(lib.configprefix+'playback'); var playback=localStorage.getItem(lib.configprefix+'playback');
lib.mechlist=[]; lib.mechlist=[];
for(var i in lib.characterPack.mode_tafang){ for(var i in lib.characterPack.mode_tafang){
if(i.indexOf('tafang_mech_')==0){ if(i.indexOf('tafang_mech_')==0){
lib.characterPack.mode_tafang[i][3].push(i+'_skill'); lib.characterPack.mode_tafang[i][3].push(i+'_skill');
lib.mechlist.push(i); lib.mechlist.push(i);
} }
lib.character[i]=lib.characterPack.mode_tafang[i]; lib.character[i]=lib.characterPack.mode_tafang[i];
if(!lib.character[i][4]){ if(!lib.character[i][4]){
lib.character[i][4]=[]; lib.character[i][4]=[];
} }
} }
ui.create.cardsAsync(); ui.create.cardsAsync();
game.finishCards(); game.finishCards();
game.addGlobalSkill('autoswap'); game.addGlobalSkill('autoswap');
@ -105,7 +105,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
_status.mylist=[]; _status.mylist=[];
_status.enemylist=[]; _status.enemylist=[];
"step 3" "step 3"
ui.arena.classList.add('chess'); ui.arena.classList.add('chess');
if(event.video){ if(event.video){
@ -115,7 +115,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
break; break;
} }
} }
_status.map=lib.tafang.map[_status.mapname]; _status.map=lib.tafang.map[_status.mapname];
game.playerMap=lib.posmap; game.playerMap=lib.posmap;
} }
ui.chesswidth=_status.map.size[0]; ui.chesswidth=_status.map.size[0];
@ -239,7 +239,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
lib.init.onfree(); lib.init.onfree();
event.trigger('gameStart'); event.trigger('gameStart');
game.phaseLoopTafang(); game.phaseLoopTafang();
}, },
element:{ element:{
@ -295,19 +295,19 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
tafang:{ tafang:{
map:{ map:{
basic_small:{ basic_small:{
name:'小型战场', name:'小型战场',
size:[6,11], size:[6,11],
obstacle:[] obstacle:[]
}, },
basic_medium:{ basic_medium:{
name:'中型战场', name:'中型战场',
size:[9,11], size:[9,11],
}, },
basic_large:{ basic_large:{
name:'大型战场', name:'大型战场',
size:[12,11], size:[12,11],
}, },
} }
}, },
game:{ game:{
@ -777,8 +777,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}); });
}, },
loadMap:function(){ loadMap:function(){
var next=game.createEvent('loadMap'); var next=game.createEvent('loadMap');
next.setContent(function(){ next.setContent(function(){
if(!lib.storage.map){ if(!lib.storage.map){
lib.storage.map=['basic_small','basic_medium','basic_large']; 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._scrollspeed=30;
sceneview._scrollnum=10; sceneview._scrollnum=10;
sceneview.onmousewheel=function(){ sceneview.onmousewheel=function(){
if(!this.classList.contains('lockscroll')){ if(!this.classList.contains('lockscroll')){
ui.click.mousewheel.apply(this,arguments); ui.click.mousewheel.apply(this,arguments);
} }
}; };
} }
lib.setScroll(sceneview); lib.setScroll(sceneview);
var switchScene=function(){ var switchScene=function(){
@ -801,125 +801,125 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
sceneview.delete(); sceneview.delete();
setTimeout(game.resume,300); setTimeout(game.resume,300);
} }
var clickScene=function(e){ var clickScene=function(e){
if(this.classList.contains('unselectable')) return; if(this.classList.contains('unselectable')) return;
if(this._clicking) return; if(this._clicking) return;
if(e&&e.stopPropagation) e.stopPropagation(); if(e&&e.stopPropagation) e.stopPropagation();
if(this.classList.contains('flipped')){ if(this.classList.contains('flipped')){
return; return;
} }
if(this.classList.contains('glow3')){ if(this.classList.contains('glow3')){
this.classList.remove('glow3'); this.classList.remove('glow3');
lib.storage.newmap.remove(this.name); lib.storage.newmap.remove(this.name);
game.save('newmap',lib.storage.newmap); game.save('newmap',lib.storage.newmap);
} }
var sceneNode=this.parentNode; var sceneNode=this.parentNode;
var current=document.querySelector('.flipped.scene'); var current=document.querySelector('.flipped.scene');
if(current){ if(current){
restoreScene(current,true); restoreScene(current,true);
} }
this.content.innerHTML=''; this.content.innerHTML='';
ui.create.div('.menubutton.large.enter','进入',this.content,switchScene).link=this.name; ui.create.div('.menubutton.large.enter','进入',this.content,switchScene).link=this.name;
sceneNode.classList.add('lockscroll'); sceneNode.classList.add('lockscroll');
var node=this; var node=this;
node._clicking=true; node._clicking=true;
setTimeout(function(){ setTimeout(function(){
node._clicking=false; node._clicking=false;
},700); },700);
sceneNode.dx=ui.window.offsetWidth/2-(-sceneNode.scrollLeft+this.offsetLeft+this.offsetWidth/2); sceneNode.dx=ui.window.offsetWidth/2-(-sceneNode.scrollLeft+this.offsetLeft+this.offsetWidth/2);
if(Math.abs(sceneNode.dx)<20){ if(Math.abs(sceneNode.dx)<20){
sceneNode.dx=0; sceneNode.dx=0;
} }
if(!sceneNode.sceneInterval&&sceneNode.dx){ if(!sceneNode.sceneInterval&&sceneNode.dx){
sceneNode.sceneInterval=setInterval(function(){ sceneNode.sceneInterval=setInterval(function(){
var dx=sceneNode.dx; var dx=sceneNode.dx;
if(Math.abs(dx)<=2){ if(Math.abs(dx)<=2){
sceneNode.scrollLeft-=dx; sceneNode.scrollLeft-=dx;
clearInterval(sceneNode.sceneInterval); clearInterval(sceneNode.sceneInterval);
delete sceneNode.sceneInterval; delete sceneNode.sceneInterval;
} }
else{ else{
var ddx=dx/Math.sqrt(Math.abs(dx))*1.5; var ddx=dx/Math.sqrt(Math.abs(dx))*1.5;
sceneNode.scrollLeft-=ddx; sceneNode.scrollLeft-=ddx;
sceneNode.dx-=ddx; sceneNode.dx-=ddx;
} }
},16); },16);
} }
node.style.transition='all ease-in 0.2s'; node.style.transition='all ease-in 0.2s';
node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)'; node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)';
var onEnd=function(){ var onEnd=function(){
node.removeEventListener('webkitTransitionEnd',onEnd); node.removeEventListener('webkitTransitionEnd',onEnd);
node.classList.add('flipped'); node.classList.add('flipped');
sceneNode.classList.add('lockscroll'); sceneNode.classList.add('lockscroll');
node.style.transition='all ease-out 0.4s'; node.style.transition='all ease-out 0.4s';
node.style.transform='perspective(1600px) rotateY(180deg) scale(1)' node.style.transform='perspective(1600px) rotateY(180deg) scale(1)'
}; };
node.listenTransition(onEnd); node.listenTransition(onEnd);
} }
ui.click.scene=clickScene; ui.click.scene=clickScene;
var restoreScene=function(node,forced){ var restoreScene=function(node,forced){
if(node._clicking&&!forced) return; if(node._clicking&&!forced) return;
if(node.transformInterval){ if(node.transformInterval){
clearInterval(node.transformInterval); clearInterval(node.transformInterval);
delete node.transformInterval; delete node.transformInterval;
} }
var sceneNode=node.parentNode; var sceneNode=node.parentNode;
node._clicking=true; node._clicking=true;
setTimeout(function(){ setTimeout(function(){
node._clicking=false; node._clicking=false;
},700); },700);
node.style.transition='all ease-in 0.2s'; node.style.transition='all ease-in 0.2s';
node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)'; node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)';
var onEnd=function(){ var onEnd=function(){
node.removeEventListener('webkitTransitionEnd',onEnd); node.removeEventListener('webkitTransitionEnd',onEnd);
node.classList.remove('flipped'); node.classList.remove('flipped');
if(!sceneNode.querySelector('.flipped')){ if(!sceneNode.querySelector('.flipped')){
sceneNode.classList.remove('lockscroll'); sceneNode.classList.remove('lockscroll');
} }
node.style.transition='all ease-out 0.4s'; node.style.transition='all ease-out 0.4s';
node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)' node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)'
}; };
node.listenTransition(onEnd); node.listenTransition(onEnd);
} }
ui.click.scene2=restoreScene; ui.click.scene2=restoreScene;
var createScene=function(name){ var createScene=function(name){
var scene=lib.tafang.map[name]; var scene=lib.tafang.map[name];
var node=ui.create.div('.scene',clickScene); var node=ui.create.div('.scene',clickScene);
node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)'; node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)';
node.name=name; node.name=name;
node.bgnode=ui.create.div('.background.player',node); node.bgnode=ui.create.div('.background.player',node);
node.info=scene; node.info=scene;
ui.create.div('.avatar.menu',node.bgnode); ui.create.div('.avatar.menu',node.bgnode);
node.namenode=ui.create.div('.name',node,(scene.name)); node.namenode=ui.create.div('.name',node,(scene.name));
if(lib.storage.map.contains(name)){ if(lib.storage.map.contains(name)){
if(lib.storage.newmap.contains(name)){ if(lib.storage.newmap.contains(name)){
node.classList.add('glow3'); node.classList.add('glow3');
} }
node.namenode.dataset.nature='soilm'; node.namenode.dataset.nature='soilm';
} }
else{ else{
node.classList.add('unselectable'); node.classList.add('unselectable');
node.namenode.innerHTML=('未开启'); node.namenode.innerHTML=('未开启');
} }
var content=ui.create.div('.menu',node); var content=ui.create.div('.menu',node);
lib.setScroll(content); lib.setScroll(content);
node.content=content; node.content=content;
sceneview.appendChild(node); sceneview.appendChild(node);
return node; return node;
} }
event.custom.add.window=function(){ event.custom.add.window=function(){
var current=document.querySelector('.flipped.scene'); var current=document.querySelector('.flipped.scene');
if(current){ if(current){
restoreScene(current); restoreScene(current);
} }
} }
for(var i in lib.tafang.map){ for(var i in lib.tafang.map){
createScene(i); createScene(i);
} }
ui.window.appendChild(sceneview.animate('start')); ui.window.appendChild(sceneview.animate('start'));
game.pause(); game.pause();
}); });
}, },
}, },
skill:{ skill:{
tafang_mech_weixingxianjing_skill:{ tafang_mech_weixingxianjing_skill:{

File diff suppressed because it is too large Load Diff