This commit is contained in:
libccy 2015-06-13 14:53:40 +08:00
parent d0731c7326
commit 2dee083760
9 changed files with 202 additions and 76 deletions

View File

@ -1,3 +1,4 @@
'use strict';
card.qimou={ card.qimou={
card:{ card:{
chenhuodajie:{ chenhuodajie:{
@ -28,6 +29,7 @@ card.qimou={
multitarget:true, multitarget:true,
multiline:true, multiline:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return true;
var num=target.num('h'); var num=target.num('h');
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].num('h')<num) return false; if(game.players[i].num('h')<num) return false;
@ -175,7 +177,7 @@ card.qimou={
ai:{ ai:{
order:4, order:4,
result:{ result:{
target:function(player,target){ target:function(player){
if(player.get('h').length<=1) return 0; if(player.get('h').length<=1) return 0;
return -1; return -1;
}, },
@ -310,7 +312,7 @@ card.qimou={
shuiyanqijun:'水淹七军', shuiyanqijun:'水淹七军',
shuiyanqijun_info:'令所有有装备的角色各弃置一张装备牌', shuiyanqijun_info:'令所有有装备的角色各弃置一张装备牌',
shushangkaihua:'树上开花', shushangkaihua:'树上开花',
shushangkaihua_info:'手牌数最少的所有角色各摸一张牌', shushangkaihua_info:'使用者与手牌数最少的所有角色各摸一张牌',
huoshaolianying:'火烧连营', huoshaolianying:'火烧连营',
huoshaolianying_bg:'烧', huoshaolianying_bg:'烧',
huoshaolianying_info:'对逆时针方向离你最近的一名横置角色使用(若无横置角色则对你的下家使用),对其造成一点火焰伤害', huoshaolianying_info:'对逆时针方向离你最近的一名横置角色使用(若无横置角色则对你的下家使用),对其造成一点火焰伤害',

View File

@ -1,14 +0,0 @@
card.wanxiang={
card:{
},
skill:{
},
translate:{
},
list:[
],
}

View File

@ -9,9 +9,104 @@ character.hearth={
hs_guldan:['male','wei',3,['fenliu','hongxi'],['fullskin']], hs_guldan:['male','wei',3,['fenliu','hongxi'],['fullskin']],
// hs_anduin:['male','qun',4,[],['fullskin']], // hs_anduin:['male','qun',4,[],['fullskin']],
hs_thrall:['male','qun',4,['tuteng','tzhenji'],['fullskin']], hs_thrall:['male','qun',4,['tuteng','tzhenji'],['fullskin']],
// hs_waleera:['female','qun',4,[],['fullskin']], hs_waleera:['female','qun',3,['jianren','mengun','wlianji'],['fullskin']],
}, },
skill:{ skill:{
wlianji:{
trigger:{player:'phaseEnd'},
frequent:true,
filter:function(event,player){
return get.cardCount(true,player)>player.hp;
},
content:function(){
player.draw(2);
},
init:function(player){player.storage.jingce=true},
intro:{
content:function(storage,player){
if(_status.currentPhase==player) return '已使用'+get.cardCount(true,player)+'张牌';
}
}
},
mengun:{
trigger:{global:'useCardToBefore'},
priority:12,
filter:function(event,player){
if(event.player==player) return false;
if(_status.currentPhase!=event.player) return false;
if(event.player.skills.contains('mengun2')) return false;
if(get.itemtype(event.card)!='card') return false;
if(!player.num('h',{suit:get.suit(event.card)})) return false;
return get.type(event.card)=='basic';
},
direct:true,
content:function(){
"step 0"
var val=ai.get.value(trigger.card);
var suit=get.suit(trigger.card);
var eff=ai.get.effect(trigger.target,trigger.card,trigger.player,player);
player.chooseToDiscard('是否对'+get.translation(trigger.player)+'使用的'+get.translation(trigger.card)+'发动【闷棍】?',function(card){
return get.suit(card)==suit;
}).ai=function(card){
if(eff>=0) return 0;
return Math.min(8,1+val)-ai.get.value(card);
}
"step 1"
if(result.bool){
player.logSkill('mengun',trigger.player);
game.log(get.translation(trigger.player)+'收回了'+get.translation(trigger.cards));
trigger.untrigger();
trigger.finish();
game.delay();
}
"step 2"
trigger.player.$gain2(trigger.cards);
trigger.player.gain(trigger.cards);
trigger.player.storage.mengun2=trigger.cards[0];
trigger.player.addTempSkill('mengun2','phaseEnd');
}
},
mengun2:{
mark:'card',
mod:{
cardEnabled:function(card,player){
if(card==player.storage.mengun2) return false;
},
},
intro:{
content:'card',
onunmark:function(storage,player){
delete player.storage.mengun2;
}
},
},
jianren:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.get('e','1')?true:false;
},
filterCard:function(card,player){
return card==player.get('e','1');
},
position:'e',
filterTarget:function(card,player,target){
return target!=player;
},
selectCard:-1,
selectTarget:-1,
content:function(){
target.damage();
},
ai:{
order:9,
result:{
target:function(player,target){
return ai.get.damageEffect(target,player,target);
}
}
}
},
jihuo:{ jihuo:{
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
filter:function(event,player){ filter:function(event,player){
@ -371,5 +466,12 @@ character.hearth={
hongxi_info:'锁定技,每当有一名角色死亡,你将体力回复至体力上限', hongxi_info:'锁定技,每当有一名角色死亡,你将体力回复至体力上限',
jihuo:'激活', jihuo:'激活',
jihuo_info:'回合结束阶段,你可以弃置一张手牌并进行一个额外的回合', jihuo_info:'回合结束阶段,你可以弃置一张手牌并进行一个额外的回合',
jianren:'剑刃',
jianren_info:'出牌阶段限一次,你可以弃置装备区内的武器牌,对所有其他角色造成一点伤害',
mengun:'闷棍',
mengun2:'闷棍',
mengun_info:'每当一名其他角色于回合内使用基本牌,你可以弃置一张与之花色相同的牌令其收回此牌,且在本回合内不能再次使用,每回合限一次',
wlianji:'连击',
wlianji_info:'回合结束阶段,若你本回合使用的卡牌数大于你当前的体力值,你可以摸两张牌',
}, },
} }

View File

@ -20,7 +20,7 @@ character.swd={
swd_yuxiaoxue:['female','wei',3,['huanhun','daixing','yinyue'],['fullskin']], swd_yuxiaoxue:['female','wei',3,['huanhun','daixing','yinyue'],['fullskin']],
swd_jiliang:['male','wu',3,['yunchou','gongxin','qimou'],['fullskin']], swd_jiliang:['male','wu',3,['yunchou','gongxin','qimou'],['fullskin']],
swd_shuijing:['female','qun',4,['mojian','duoren','duanyue'],['fullskin']], swd_shuijing:['female','qun',4,['mojian','duanyue'],['fullskin']],
swd_cheyun:['female','wu',3,['shengong','xianjiang3','qiaoxie'],['fullskin']], swd_cheyun:['female','wu',3,['shengong','xianjiang3','qiaoxie'],['fullskin']],
swd_huanyuanzhi:['male','qun',3,['lanzhi','mufeng','tianshu'],['fullskin']], swd_huanyuanzhi:['male','qun',3,['lanzhi','mufeng','tianshu'],['fullskin']],
swd_murongshi:['female','shu',4,['duanyi','guxing'],['fullskin']], swd_murongshi:['female','shu',4,['duanyi','guxing'],['fullskin']],
@ -1898,7 +1898,7 @@ character.swd={
event.finish(); event.finish();
} }
"step 2" "step 2"
if(event.num>2){ if(event.num>=2){
player.loseHp(); player.loseHp();
} }
}, },
@ -7788,7 +7788,7 @@ character.swd={
mojian:'墨剑', mojian:'墨剑',
mojian_info:'每当你使用杀并指定目标后,你可以令其摸一张牌,然后你回复一点体力', mojian_info:'每当你使用杀并指定目标后,你可以令其摸一张牌,然后你回复一点体力',
duanyue:'断月', duanyue:'断月',
duanyue_info:'出牌阶段限一次,你可以弃置一张装备牌,对一名其他角色造成一点伤害,并弃其所有手牌。若弃置的手牌数不少于3,你流失一点体力', duanyue_info:'出牌阶段限一次,你可以弃置一张装备牌,对一名其他角色造成一点伤害,并弃其所有手牌。若弃置的手牌数有两张或更多,你流失一点体力',
fengmo:'封魔', fengmo:'封魔',
fengmo_info:'出牌阶段限一次,你可以弃置场所有武器牌(至少两张),然后令一名未翻面的角色摸等量的牌并翻面', fengmo_info:'出牌阶段限一次,你可以弃置场所有武器牌(至少两张),然后令一名未翻面的角色摸等量的牌并翻面',
pozhou:'破咒', pozhou:'破咒',

View File

@ -393,7 +393,6 @@ character.yxs={
} }
}, },
xiangma:{ xiangma:{
// group:['mashu','feiying']
inherit:'yicong' inherit:'yicong'
}, },
weiyi:{ weiyi:{

View File

@ -12,11 +12,6 @@ window.config={
layoutfixed:['chess','boss'], layoutfixed:['chess','boss'],
all:{ all:{
mode:['identity','guozhan','versus','boss','chess','stone'], mode:['identity','guozhan','versus','boss','chess','stone'],
characters:['standard','wind','fire','woods','mountain',
'extra','sp','yijiang','refresh','guozhan',
'jiange','zhuogui','diy','hearth','yxs','swd','xswd','gujian','xianjian'],
cards:['standard','ex','extra','refresh','guozhan','zhenfa','qimou','yibao','shenbing','wanxiang','swd','shenqi','compensate'],
plays:['character','soldier','wuxing'],
layout:['default','newlayout'], layout:['default','newlayout'],
theme:['woodden','music'], theme:['woodden','music'],
card_font:['xiaozhuan','huangcao','caoshu','xingshu'], card_font:['xiaozhuan','huangcao','caoshu','xingshu'],
@ -42,43 +37,12 @@ window.config={
infinity:'无限', infinity:'无限',
qunyingzhuan:'群英', qunyingzhuan:'群英',
swd:'剧情', swd:'剧情',
standard_card_config:'标准',
ex_card_config:'ex',
extra_card_config:'军争',
guozhan_card_config:'国战',
zhenfa_card_config:'阵法',
qimou_card_config:'奇谋',
yibao_card_config:'异宝',
shenbing_card_config:'神兵',
wanxiang_card_config:'万象',
swd_card_config:'轩辕剑',
shenqi_card_config:'上古神器',
compensate_card_config:'补充卡牌',
refresh_card_config:'界限突破',
standard_character_config:'标准包',
wind_character_config:'风包',
fire_character_config:'火包',
woods_character_config:'林包',
mountain_character_config:'山包',
guozhan_character_config:'国战',
sp_character_config:'SP',
yijiang_character_config:'一将成名',
jiange_character_config:'守卫剑阁',
zhuogui_character_config:'捉鬼驱邪',
refresh_character_config:'界限突破',
diy_character_config:'DIY',
extra_character_config:'神将',
swd_character_config:'轩辕剑',
xswd_character_config:'轩辕剑·二',
hearth_character_config:'炉石传说',
yxs_character_config:'英雄杀',
gujian_character_config:'古剑奇谭',
xianjian_character_config:'仙剑',
others_character_config:'其他',
character_play_config:'角色卡牌', character_play_config:'角色卡牌',
soldier_play_config:'士兵模式', soldier_play_config:'士兵模式',
strategy_play_config:'尔虞我诈', strategy_play_config:'尔虞我诈',
wuxing_play_config:'五行生克', wuxing_play_config:'五行生克',
sanguozhi:'三国志', sanguozhi:'三国志',
online:'OL', online:'OL',
background_music_config:'背景音乐', background_music_config:'背景音乐',
@ -236,6 +200,7 @@ window.config={
long_info:true, long_info:true,
background_music:'music_default', background_music:'music_default',
background_audio:true, background_audio:true,
background_speak:true,
theme:'woodden', theme:'woodden',
@ -359,4 +324,8 @@ window.config={
['jiushi','jushou'], ['jiushi','jushou'],
['jiushi','kuiwei'], ['jiushi','kuiwei'],
] ]
} };
window.mode={};
window.card={};
window.character={};
window.play={};

View File

@ -1,8 +1,4 @@
"use strict"; "use strict";
window.mode={};
window.card={};
window.character={};
window.play={};
(function(){ (function(){
var _status={ var _status={
paused:false, paused:false,
@ -158,7 +154,6 @@ window.play={};
lib.config.defaultcards=lib.config.cards.slice(0); lib.config.defaultcards=lib.config.cards.slice(0);
} }
for(var i in config2){ for(var i in config2){
if(i.indexOf('_mode_config')!=-1&&i.substr(i.indexOf('_mode_config')+13)==lib.config.mode){ if(i.indexOf('_mode_config')!=-1&&i.substr(i.indexOf('_mode_config')+13)==lib.config.mode){
lib.config.mode_config[lib.config.mode][i.substr(0,i.indexOf('_mode_config'))]=config2[i]; lib.config.mode_config[lib.config.mode][i.substr(0,i.indexOf('_mode_config'))]=config2[i];
} }
@ -171,6 +166,26 @@ window.play={};
for(var i in lib.config.translate){ for(var i in lib.config.translate){
lib.translate[i]=lib.config.translate[i]; lib.translate[i]=lib.config.translate[i];
} }
lib.config.all.characters=[];
lib.config.all.cards=[];
lib.config.all.plays=[];
for(i in character.pack){
lib.config.all.characters.push(i);
lib.translate[i+'_character_config']=character.pack[i];
}
for(i in card.pack){
lib.config.all.cards.push(i);
lib.translate[i+'_card_config']=card.pack[i];
}
for(i in play.pack){
lib.config.all.plays.push(i);
lib.translate[i+'_play_config']=play.pack[i];
}
delete character.pack;
delete card.pack;
delete play.pack;
lib.init.js('mode',lib.config.mode); lib.init.js('mode',lib.config.mode);
lib.init.js('card',lib.config.all.cards); lib.init.js('card',lib.config.all.cards);
lib.init.js('character',lib.config.all.characters); lib.init.js('character',lib.config.all.characters);
@ -11657,11 +11672,12 @@ window.play={};
} }
} }
} }
if(j=='translate'&&k==i){
lib[j][k+'_character_config']=character[i][j][k];
}
else{
if(lib[j][k]==undefined){ if(lib[j][k]==undefined){
lib[j][k]=lib.init.eval(character[i][j][k]); lib[j][k]=lib.init.eval(character[i][j][k]);
// if(j=='skill'||j=='character'){
// lib[j][k].packname=i;
// }
} }
else{ else{
alert('dublicate '+j+' in character '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+character[i][j][k]); alert('dublicate '+j+' in character '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+character[i][j][k]);
@ -11669,6 +11685,7 @@ window.play={};
} }
} }
} }
}
for(i in card){ for(i in card){
if(card[i].forbid&&card[i].forbid.contains(lib.config.mode)) continue; if(card[i].forbid&&card[i].forbid.contains(lib.config.mode)) continue;
if(card[i].mode&&card[i].mode.contains(lib.config.mode)==false) continue; if(card[i].mode&&card[i].mode.contains(lib.config.mode)==false) continue;
@ -11686,8 +11703,13 @@ window.play={};
} }
else{ else{
for(k in card[i][j]){ for(k in card[i][j]){
if(j=='translate'&&k==i){
lib[j][k+'_card_config']=card[i][j][k];
}
else{
if(lib[j][k]==undefined) lib[j][k]=lib.init.eval(card[i][j][k]); if(lib[j][k]==undefined) lib[j][k]=lib.init.eval(card[i][j][k]);
else alert('dublicate '+j+' in card '+i+':\n'+k+'\n'+lib[j][k]+'\n'+card[i][j][k]) else alert('dublicate '+j+' in card '+i+':\n'+k+'\n'+lib[j][k]+'\n'+card[i][j][k]);
}
} }
} }
} }
@ -11730,12 +11752,17 @@ window.play={};
for(j in play[i]){ for(j in play[i]){
if(j=='mode'||j=='forbid'||j=='init'||j=='element'||j=='game'||j=='get'||j=='config'||j=='ui') continue; if(j=='mode'||j=='forbid'||j=='init'||j=='element'||j=='game'||j=='get'||j=='config'||j=='ui') continue;
for(k in play[i][j]){ for(k in play[i][j]){
if(j=='translate'&&k==i){
lib[j][k+'_play_config']=play[i][j][k];
}
else{
if(lib[j][k]!=undefined){ if(lib[j][k]!=undefined){
console.log('dublicate '+j+' in play '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+play[i][j][k]); console.log('dublicate '+j+' in play '+i+':\n'+k+'\n'+': '+lib[j][k]+'\n'+play[i][j][k]);
} }
lib[j][k]=lib.init.eval(play[i][j][k]); lib[j][k]=lib.init.eval(play[i][j][k]);
} }
} }
}
if(typeof play[i].init=='function') (lib.init.eval(play[i].init))(); if(typeof play[i].init=='function') (lib.init.eval(play[i].init))();
} }
for(i=0;i<lib.card.list.length;i++){ for(i=0;i<lib.card.list.length;i++){

40
game/package.js Normal file
View File

@ -0,0 +1,40 @@
character.pack={
standard:'标准',
wind:'风包',
fire:'火包',
woods:'林包',
mountain:'山包',
extra:'神将',
sp:'SP',
guozhan:'国战',
yijiang:'一将成名',
refresh:'界限突破',
jiange:'守卫剑阁',
zhuogui:'捉鬼驱邪',
diy:'DIY',
yxs:'英雄杀',
hearth:'炉石传说',
swd:'轩辕剑',
xswd:'轩辕剑·二',
gujian:'古剑奇谭',
xianjian:'仙剑',
};
card.pack={
standard:'标准',
ex:'EX',
extra:'军争',
refresh:'界限突破',
guozhan:'国战',
zhenfa:'阵法',
qimou:'奇谋',
yibao:'异宝',
shenbing:'神兵',
swd:'轩辕剑',
shenqi:'上古神器',
compensate:'补充卡牌',
};
play.pack={
character:'武将卡牌',
soldier:'士兵模式',
wuxing:'五行生克'
};

View File

@ -5,6 +5,7 @@
<link rel="apple-touch-startup-image" href="starts/image/meta/icon.png"> <link rel="apple-touch-startup-image" href="starts/image/meta/icon.png">
<title>无名杀</title> <title>无名杀</title>
<script src="game/config.js"></script> <script src="game/config.js"></script>
<script src="game/package.js"></script>
<script src="game/game.js"></script> <script src="game/game.js"></script>
<div class='background static'></div> <div class='background static'></div>
<script src="game/background.js"></script> <script src="game/background.js"></script>