This commit is contained in:
libccy 2015-05-04 11:17:03 +08:00
parent 00acd45371
commit 4c52441407
14 changed files with 382 additions and 281 deletions

View File

@ -1191,7 +1191,8 @@ card.standard={
if(Math.abs(ai.get.attitude(_status.event.player,trigger.target))<3) return 0; if(Math.abs(ai.get.attitude(_status.event.player,trigger.target))<3) return 0;
return -ai.get.effect(trigger.target,trigger.card,trigger.player,_status.event.player)*state; return -ai.get.effect(trigger.target,trigger.card,trigger.player,_status.event.player)*state;
}, },
source:event.source source:event.source,
source2:event.source2
}); });
"step 2" "step 2"
if(result.bool){ if(result.bool){

View File

@ -237,6 +237,9 @@ character.diy={
// } // }
}, },
ai:{ ai:{
skillTagFilter:function(player){
if(player.storage.guihan) return false;
},
save:true, save:true,
result:{ result:{
player:4, player:4,

View File

@ -381,10 +381,17 @@ character.extra={
threaten:function(player,target){ threaten:function(player,target){
if(target.hp==1) return 0.5; if(target.hp==1) return 0.5;
}, },
result:{ effect:{
target:function(card,player,target,current){ target:function(card,player,target,current){
if(target.hp<=1&&get.tag(card,'damage')){ if(target.hp<=1&&get.tag(card,'damage')){
if(player.skills.contains('jueqing')) return [1,-5]; if(player.skills.contains('jueqing')) return [1,-5];
var hasfriend=false;
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=target&&ai.get.attitude(game.players[i],target)>=0){
hasfriend=true;break;
}
}
if(!hasfriend) return;
if(player.hp>2&&ai.get.attitude(player,target<=0)) return [0,2]; if(player.hp>2&&ai.get.attitude(player,target<=0)) return [0,2];
return [1,0,0,-player.hp]; return [1,0,0,-player.hp];
} }
@ -820,6 +827,22 @@ character.extra={
longhun:{ longhun:{
group:['longhun1','longhun2','longhun3','longhun4'], group:['longhun1','longhun2','longhun3','longhun4'],
ai:{ ai:{
skillTagFilter:function(player,tag){
switch(tag){
case 'respondSha':{
if(player.num('he',{suit:'diamond'})<Math.max(1,player.hp)) return false;
break;
}
case 'respondShan':{
if(player.num('he',{suit:'club'})<Math.max(1,player.hp)) return false;
break;
}
case 'save':{
if(player.num('he',{suit:'heart'})<Math.max(1,player.hp)) return false;
break;
}
}
},
maixie:true, maixie:true,
save:true, save:true,
respondSha:true, respondSha:true,
@ -879,9 +902,6 @@ character.extra={
enable:['chooseToUse','chooseToRespond'], enable:['chooseToUse','chooseToRespond'],
prompt:'将一张黑桃牌当无懈可击使用', prompt:'将一张黑桃牌当无懈可击使用',
position:'he', position:'he',
viewAsFilter:function(player){
return player.num('he',{color:'black'})>=player.hp;
},
check:function(card,event){ check:function(card,event){
if(_status.event.player.hp>1) return 0; if(_status.event.player.hp>1) return 0;
return 7-ai.get.value(card); return 7-ai.get.value(card);
@ -891,7 +911,7 @@ character.extra={
}, },
viewAs:{name:'wuxie'}, viewAs:{name:'wuxie'},
viewAsFilter:function(player){ viewAsFilter:function(player){
return player.num('he',{suit:'spade'})>0; return player.num('he',{suit:'spade'})>=player.hp;
}, },
filterCard:function(card){ filterCard:function(card){
return get.suit(card)=='spade'; return get.suit(card)=='spade';

View File

@ -127,6 +127,9 @@ character.fire={
player.storage.niepan=true; player.storage.niepan=true;
}, },
ai:{ ai:{
skillTagFilter:function(player){
if(player.storage.niepan) return false;
},
save:true, save:true,
result:{ result:{
player:10 player:10

View File

@ -2546,6 +2546,13 @@ character.sp={
check:function(event,player){ check:function(event,player){
return player.hp==1||(player.hp==2&&player.num('h')<=1); return player.hp==1||(player.hp==2&&player.num('h')<=1);
}, },
filter:function(event,player){
return !player.storage.suiren;
},
intro:{
content:'limited',
},
mark:true,
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
@ -2556,6 +2563,8 @@ character.sp={
} }
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.storage.suiren=true;
player.unmarkSkill('suiren');
player.logSkill('suiren',result.targets); player.logSkill('suiren',result.targets);
player.removeSkill('yicong'); player.removeSkill('yicong');
player.gainMaxHp(); player.gainMaxHp();

View File

@ -1208,6 +1208,9 @@ character.swd={
} }
}, },
ai:{ ai:{
skillTagFilter:function(player){
if(player.storage.shouyin) return false;
},
expose:0.3, expose:0.3,
save:true, save:true,
result:{ result:{

View File

@ -1079,12 +1079,12 @@ character.yijiang={
"step 1" "step 1"
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];
player.logSkill('qiuyuan',target);
event.target=target; event.target=target;
target.chooseCard({name:'shan'},'交给'+get.translation(player)+ target.chooseCard({name:'shan'},'交给'+get.translation(player)+
'一张闪,或成为此杀的额外目标').ai=function(card){ '一张闪,或成为此杀的额外目标').ai=function(card){
return ai.get.attitude(target,player)>=0?1:-1; return ai.get.attitude(target,player)>=0?1:-1;
} }
player.logSkill('qiuyuan',target);
game.delay(); game.delay();
} }
else{ else{

View File

@ -142,7 +142,8 @@ window.config={
theme_config:'主题', theme_config:'主题',
layout_config:'布局', layout_config:'布局',
mode_config:'游戏模式', mode_config:'游戏模式',
player_number_config:'角色个数', player_number_config:'游戏人数',
battle_number_config:'参战人数',
difficulty_config:'AI对人类态度', difficulty_config:'AI对人类态度',
initshow_draw_config:'首亮摸牌', initshow_draw_config:'首亮摸牌',
ai_strategy_config:'内奸策略', ai_strategy_config:'内奸策略',
@ -276,6 +277,7 @@ window.config={
free_choose:true, free_choose:true,
swap:true, swap:true,
change_identity:true, change_identity:true,
battle_number:1
}, },
identity:{ identity:{
identity:[ identity:[
@ -302,7 +304,7 @@ window.config={
difficulty:'normal', difficulty:'normal',
initshow_draw:2, initshow_draw:2,
dierestart:true dierestart:true
} },
}, },
game_intro:{ game_intro:{

View File

@ -1128,11 +1128,8 @@ window.play={};
"step 0" "step 0"
player.lose(cards); player.lose(cards);
if(event.skill){ if(event.skill){
player.popup(event.skill); player.logSkill(event.skill);
player.popup(event.card.name); player.popup(event.card.name);
if(player.checkShow){
player.checkShow(event.skill);
}
} }
if(lib.config.background_audio){ if(lib.config.background_audio){
var sex=player.sex=='female'?'female':'male'; var sex=player.sex=='female'?'female':'male';
@ -1155,7 +1152,7 @@ window.play={};
} }
if(event.animate!=false){ if(event.animate!=false){
if(card.name=='wuxie'&&event.parent.source){ if(card.name=='wuxie'&&event.parent.source){
player.line(event.parent.source,'green'); player.line(event.parent.source2||event.parent.source,'green');
} }
else{ else{
var config={}; var config={};
@ -1849,13 +1846,13 @@ window.play={};
} }
if(player==game.me&&!_status.over){ if(player==game.me&&!_status.over){
ui.control.show(); ui.control.show();
if(get.config('swap')&&lib.config.mode!='versus'){ if(get.config('swap')&&lib.config.mode_choice.contains('swap')){
ui.swap=ui.create.control('换人',ui.click.dieswap); ui.swap=ui.create.control('换人',ui.click.dieswap);
} }
if(get.config('revive')){ if(get.config('revive')&&lib.config.mode_choice.contains('revive')){
ui.revive=ui.create.control('revive',ui.click.dierevive); ui.revive=ui.create.control('revive',ui.click.dierevive);
} }
if(get.config('dierestart')&&lib.config.mode!='versus'){ if(get.config('dierestart')&&lib.config.mode_choice.contains('dierestart')){
ui.restart=ui.create.control('restart',game.reload); ui.restart=ui.create.control('restart',game.reload);
} }
} }
@ -3425,8 +3422,9 @@ window.play={};
this.skipList.add(name); this.skipList.add(name);
}, },
logSkill:function(name,targets,nature){ logSkill:function(name,targets,nature){
this.popup(name);
if(get.itemtype(targets)=='player') targets=[targets]; if(get.itemtype(targets)=='player') targets=[targets];
if(lib.translate[name]){
this.popup(name);
if(typeof targets=='object'&&targets.length){ if(typeof targets=='object'&&targets.length){
var str=get.translation(this)+'对'+get.translation(targets[0]); var str=get.translation(this)+'对'+get.translation(targets[0]);
for(var i=1;i<targets.length;i++){ for(var i=1;i<targets.length;i++){
@ -3434,13 +3432,14 @@ window.play={};
} }
str+='发动了'+get.translation(name); str+='发动了'+get.translation(name);
game.log(str); game.log(str);
if(nature!=false){
this.line(targets,nature);
}
} }
else{ else{
game.log(get.translation(this)+'发动了'+get.translation(name)); game.log(get.translation(this)+'发动了'+get.translation(name));
} }
}
if(nature!=false){
this.line(targets,nature);
}
if(lib.skill[name]&&lib.skill[name].ai&&lib.skill[name].ai.expose!=undefined&&this.logAi){ if(lib.skill[name]&&lib.skill[name].ai&&lib.skill[name].ai.expose!=undefined&&this.logAi){
this.logAi(lib.skill[name].ai.expose); this.logAi(lib.skill[name].ai.expose);
} }
@ -3478,7 +3477,7 @@ window.play={};
this.node.prompt=node; this.node.prompt=node;
} }
node.dataset.position=this.dataset.position; node.dataset.position=this.dataset.position;
if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2|| if(this.dataset.position==0||parseInt(this.dataset.position)==parseInt(ui.arena.dataset.number)/2||
typeof name2=='number'||this.classList.contains('minskin')){ typeof name2=='number'||this.classList.contains('minskin')){
node.innerHTML=name2; node.innerHTML=name2;
} }
@ -3495,7 +3494,7 @@ window.play={};
var name2=get.translation(name); var name2=get.translation(name);
var node=ui.create.div('.popup',ui.arena); var node=ui.create.div('.popup',ui.arena);
node.dataset.position=this.dataset.position; node.dataset.position=this.dataset.position;
if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2|| if(this.dataset.position==0||parseInt(this.dataset.position)==parseInt(ui.arena.dataset.number)/2||
typeof name2=='number'||this.classList.contains('minskin')){ typeof name2=='number'||this.classList.contains('minskin')){
node.innerHTML=name2; node.innerHTML=name2;
} }
@ -3813,7 +3812,11 @@ window.play={};
var skills=game.expandSkills(this.get('s',hidden)); var skills=game.expandSkills(this.get('s',hidden));
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
var info=lib.skill[skills[i]]; var info=lib.skill[skills[i]];
if(info&&info.ai&&info.ai[tag]) return true; if(info&&info.ai){
if(info.ai.skillTagFilter&&
info.ai.skillTagFilter(this,tag)===false) continue;
if(info.ai[tag]) return true;
}
} }
return false; return false;
}, },
@ -3956,7 +3959,7 @@ window.play={};
this.$give(card[i],player,false); this.$give(card[i],player,false);
} }
} }
else if(typeof card=='number'){ else if(typeof card=='number'&&card>=0){
if(log!=false){ if(log!=false){
game.log(get.translation(player)+'从'+get.translation(this)+'获得了'+get.cnNumber(card)+'张牌'); game.log(get.translation(player)+'从'+get.translation(this)+'获得了'+get.cnNumber(card)+'张牌');
} }
@ -4304,13 +4307,22 @@ window.play={};
}, },
trigger:function(name){ trigger:function(name){
var event=this; var event=this;
var i,j,next,add; var i,j,iwhile,next,add;
var totalPopulation=game.players.length+game.dead.length+1;
if(event.player&&event.player.removed) return; if(event.player&&event.player.removed) return;
if(!event.player&&name!='gameStart') return; if(!event.player&&name!='gameStart') return;
event._endTrigger=event.player||game.me; event._endTrigger=event.player||game.me;
while(event._endTrigger.isDead()){ for(iwhile=0;iwhile<totalPopulation;iwhile++){
if(event._endTrigger.isDead()){
event._endTrigger=event._endTrigger.next; event._endTrigger=event._endTrigger.next;
} }
else{
break;
}
}
if(event._endTrigger.isDead()){
event._endTrigger=game.players.randomGet();
}
var player=event._endTrigger; var player=event._endTrigger;
var list=[],others=[]; var list=[],others=[];
for(i=0;i<game.players.length;i++){ for(i=0;i<game.players.length;i++){
@ -4332,7 +4344,7 @@ window.play={};
} }
} }
} }
do{ for(iwhile=0;iwhile<totalPopulation;iwhile++){
var skills=player.get('s',true).concat(lib.skill.global); var skills=player.get('s',true).concat(lib.skill.global);
game.expandSkills(skills); game.expandSkills(skills);
for(i=0;i<skills.length;i++){ for(i=0;i<skills.length;i++){
@ -4369,8 +4381,10 @@ window.play={};
} }
} }
player=player.next; player=player.next;
if(player==event._endTrigger){
break;
}
} }
while(player!=event._endTrigger);
if(list.length){ if(list.length){
list.sort(lib.sort.priority); list.sort(lib.sort.priority);
for(i=0;i<list.length;i++){ for(i=0;i<list.length;i++){
@ -4550,7 +4564,7 @@ window.play={};
if(ui.skills==this) delete ui.skills; if(ui.skills==this) delete ui.skills;
}, },
replace:function(){ replace:function(){
while(this.childNodes.length) this.childNodes[0].remove(); while(this.childNodes.length) this.firstChild.remove();
var i,controls; var i,controls;
if(get.objtype(arguments[0])=='array') controls=arguments[0]; if(get.objtype(arguments[0])=='array') controls=arguments[0];
else controls=arguments; else controls=arguments;
@ -4698,7 +4712,11 @@ window.play={};
}, },
seat:function(a,b){ seat:function(a,b){
var player=lib.tempSortSeat||_status.event.player; var player=lib.tempSortSeat||_status.event.player;
return get.distance(player,a,'absolute')-get.distance(player,b,'absolute'); var delta=get.distance(player,a,'absolute')-get.distance(player,b,'absolute');
if(delta) return delta;
delta=parseInt(a.dataset.position)-parseInt(b.dataset.position);
if(player.side==game.me.side) return delta;
return -delta;
}, },
position:function(a,b){ position:function(a,b){
return parseInt(a.dataset.position)-parseInt(b.dataset.position); return parseInt(a.dataset.position)-parseInt(b.dataset.position);
@ -4872,6 +4890,7 @@ window.play={};
enable:'phaseUse', enable:'phaseUse',
prompt:'弃置要重铸的牌并摸一张牌', prompt:'弃置要重铸的牌并摸一张牌',
filter:function(event,player){ filter:function(event,player){
if(player.isMin()) return false;
return (player.get('h',function(card){ return (player.get('h',function(card){
return get.info(card).chongzhu; return get.info(card).chongzhu;
}).length); }).length);
@ -5659,9 +5678,15 @@ window.play={};
}, },
swapSeat:function(player1,player2,prompt,behind){ swapSeat:function(player1,player2,prompt,behind){
if(behind){ if(behind){
while(player1.next!=player2){ var totalPopulation=game.players.length+game.dead.length+1;
for(var iwhile=0;i<totalPopulation;i++){
if(player1.next!=player2){
game.swapSeat(player1,player1.next,false,false); game.swapSeat(player1,player1.next,false,false);
} }
else{
break;
}
}
if(prompt!=false){ if(prompt!=false){
game.log(get.translation(player1)+'将座位移至'+get.translation(player2)+'后'); game.log(get.translation(player1)+'将座位移至'+get.translation(player2)+'后');
} }
@ -5994,74 +6019,6 @@ window.play={};
if(_status.reloading) return; if(_status.reloading) return;
localStorage.setItem(lib.configprefix+lib.config.mode,JSON.stringify(lib.storage)); localStorage.setItem(lib.configprefix+lib.config.mode,JSON.stringify(lib.storage));
}, },
import:function(name,replace){
var next=game.createEvent('import');
next.mode=name;
next.replace=replace;
next.content=function(){
"step 0"
window.mode={};
lib.init.js('mode',event.mode);
game.imported.add(event.mode);
"step 1"
if(window.mode[event.mode]==undefined){
game.delay(0.1);
event.redo();
}
"step 2"
var i,j,k;
var obj=window.mode[event.mode];
delete window.mode;
for(i in obj.element){
for(j in obj.element[i]){
if(lib.element[i][j]==undefined||event.replace) lib.element[i][j]=lib.init.eval(obj.element[i][j]);
}
}
for(i in obj.ai){
if(typeof obj.ai[i]=='object'){
if(ai[i]==undefined) ai[i]={};
for(j in obj.ai[i]){
if(ai[i][j]==undefined||event.replace) ai[i][j]=lib.init.eval(obj.ai[i][j]);
}
}
else{
if(ai[i]==undefined||event.replace) ai[i]=lib.init.eval(obj.ai[i]);
}
}
for(i in obj.ui){
if(typeof obj.ui[i]=='object'){
if(ui[i]==undefined) ui[i]={};
for(j in obj.ui[i]){
if(ui[i][j]==undefined||event.replace) ui[i][j]=lib.init.eval(obj.ui[i][j]);
}
}
else{
if(ui[i]==undefined||event.replace) ui[i]=lib.init.eval(obj.ui[i]);
}
}
for(i in obj.game){
if(game[i]==undefined||event.replace) game[i]=lib.init.eval(obj.game[i]);
}
for(i in obj.get){
if(get[i]==undefined||event.replace) get[i]=lib.init.eval(obj.get[i]);
}
for(i in obj.config){
if(lib.config.current_mode[i]==undefined||event.replace) lib.config.current_mode[i]=obj.config[i];
}
for(i in obj){
if(i=='element') continue;
if(i=='game') continue;
if(i=='get') continue;
if(i=='ai') continue;
if(i=='ui') continue;
if(i=='config') continue;
if(lib[i]==undefined||event.replace) lib[i]=(get.objtype(obj[i])=='array')?[]:{};
for(j in obj[i]){
if(lib[i][j]==undefined||event.replace) lib[i][j]=lib.init.eval(obj[i][j]);
}
}
}
},
saveConfig:function(key,value,local){ saveConfig:function(key,value,local){
if(_status.reloading) return; if(_status.reloading) return;
var config; var config;
@ -6883,68 +6840,64 @@ window.play={};
unfold(this,modeconfig); unfold(this,modeconfig);
} }
})); }));
for(i in lib.config.current_mode){ for(i=0;i<lib.config.current_mode.length;i++){
if(i=='difficulty'&&lib.config.current_mode[i]==true){ switch(lib.config.current_mode[i]){
modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.local)); case 'difficulty':
} modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.local));break;
else if(i=='initshow_draw'&&lib.config.current_mode[i]==true){ case 'initshow_draw':
modeconfig.push(ui.create.switcher('initshow_draw',[0,1,2],get.config('initshow_draw'),ui.click.sidebar.local)); modeconfig.push(ui.create.switcher('initshow_draw',[0,1,2],get.config('initshow_draw'),ui.click.sidebar.local));break;
} case 'ai_strategy':
else if(i=='ai_strategy'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('ai_strategy', modeconfig.push(ui.create.switcher('ai_strategy',
['ai_strategy_1','ai_strategy_2','ai_strategy_3','ai_strategy_4','ai_strategy_5','ai_strategy_6'], ['ai_strategy_1','ai_strategy_2','ai_strategy_3','ai_strategy_4','ai_strategy_5','ai_strategy_6'],
get.config('ai_strategy'),ui.click.sidebar.local)); get.config('ai_strategy'),ui.click.sidebar.local));break;
} case 'ai_identity':
else if(i=='ai_identity'&&lib.config.current_mode[i]==true){ modeconfig.push(ui.create.switcher('ai_identity',get.config('ai_identity'),ui.click.sidebar.local));break;
modeconfig.push(ui.create.switcher('ai_identity',get.config('ai_identity'),ui.click.sidebar.local)); case 'auto_identity':
} modeconfig.push(ui.create.switcher('auto_identity',['一轮','两轮','三轮','关闭'],get.config('auto_identity'),ui.click.sidebar.auto_identity));break;
else if(i=='auto_identity'&&lib.config.current_mode[i]==true){ case 'player_number':
modeconfig.push(ui.create.switcher('auto_identity',['一轮','两轮','三轮','关闭'],get.config('auto_identity'),ui.click.sidebar.auto_identity)); modeconfig.push(ui.create.switcher('player_number',[2,3,4,5,6,7,8],get.config('player_number'),ui.click.sidebar.player_number));break;
} case 'battle_number':
else if(i=='player_number'&&lib.config.current_mode[i]==true){ modeconfig.push(ui.create.switcher('battle_number',[1,2,3,5,8,16],get.config('battle_number'),ui.click.sidebar.battle_number));break;
modeconfig.push(ui.create.switcher('player_number',[2,3,4,5,6,7,8],get.config('player_number'),ui.click.sidebar.player_number)); case 'double_character':
} modeconfig.push(ui.create.switcher('double_character',get.config('double_character'),ui.click.sidebar.local));break;
else if(i=='double_character'&&lib.config.current_mode[i]==true){ case 'double_hp':
modeconfig.push(ui.create.switcher('double_character',get.config('double_character'),ui.click.sidebar.local2)); modeconfig.push(ui.create.switcher('double_hp',lib.config.all.double_hp,get.config('double_hp'),ui.click.sidebar.local2));break;
} case 'free_choose':
else if(i=='double_hp'&&lib.config.current_mode[i]==true){ modeconfig.push(ui.create.switcher('free_choose',get.config('free_choose'),ui.click.sidebar.free_choose));break;
modeconfig.push(ui.create.switcher('double_hp',lib.config.all.double_hp,get.config('double_hp'),ui.click.sidebar.local2)); case 'change_card':
} modeconfig.push(ui.create.switcher('change_card',get.config('change_card'),ui.click.sidebar.local));break;
else if(i=='free_choose'&&lib.config.current_mode[i]==true){ case 'change_choice':
modeconfig.push(ui.create.switcher('free_choose',get.config('free_choose'),ui.click.sidebar.free_choose)); modeconfig.push(ui.create.switcher('change_choice',get.config('change_choice'),ui.click.sidebar.change_choice));break;
} case 'change_identity':
else if(i=='change_card'&&lib.config.current_mode[i]==true){ modeconfig.push(ui.create.switcher('change_identity',get.config('change_identity'),ui.click.sidebar.change_identity));break;
modeconfig.push(ui.create.switcher('change_card',get.config('change_card'),ui.click.sidebar.local)); case 'swap':
} modeconfig.push(ui.create.switcher('swap',get.config('swap'),ui.click.sidebar.swap));break;
else if(i=='change_choice'&&lib.config.current_mode[i]==true){ case 'revive':
modeconfig.push(ui.create.switcher('change_choice',get.config('change_choice'),ui.click.sidebar.change_choice)); modeconfig.push(ui.create.switcher('revive',get.config('revive'),ui.click.sidebar.revive));break;
} case 'dierestart':
else if(i=='change_identity'&&lib.config.current_mode[i]==true){ modeconfig.push(ui.create.switcher('dierestart',get.config('dierestart'),ui.click.sidebar.local2));break;
modeconfig.push(ui.create.switcher('change_identity',get.config('change_identity'),ui.click.sidebar.change_identity)); case 'ban_weak':
} modeconfig.push(ui.create.switcher('ban_weak',get.config('ban_weak'),ui.click.sidebar.local2));break;
else if(i=='swap'&&lib.config.current_mode[i]==true){ case 'enhance_zhu':
modeconfig.push(ui.create.switcher('swap',get.config('swap'),ui.click.sidebar.swap)); modeconfig.push(ui.create.switcher('enhance_zhu',get.config('enhance_zhu'),ui.click.sidebar.local2));break;
} case 'strict_sort':
else if(i=='revive'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('revive',get.config('revive'),ui.click.sidebar.revive));
}
else if(i=='dierestart'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('dierestart',get.config('dierestart'),ui.click.sidebar.local2));
}
else if(i=='ban_weak'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('ban_weak',get.config('ban_weak'),ui.click.sidebar.local2));
}
else if(i=='enhance_zhu'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('enhance_zhu',get.config('enhance_zhu'),ui.click.sidebar.local2));
}
else if(i=='strict_sort'&&lib.config.current_mode[i]==true){
modeconfig.push(ui.create.switcher('strict_sort',get.config('strict_sort'),ui.click.sidebar.local)); modeconfig.push(ui.create.switcher('strict_sort',get.config('strict_sort'),ui.click.sidebar.local));
modeconfig.push(ui.create.switcher('reverse_sort',get.config('reverse_sort'),ui.click.sidebar.reverse_sort)); modeconfig.push(ui.create.switcher('reverse_sort',get.config('reverse_sort'),ui.click.sidebar.reverse_sort));break;
} default:
else if(Array.isArray(lib.config.current_mode[i])){ if(Array.isArray(lib.config.current_mode[i])){
modeconfig.push(ui.create.switcher.apply(this,lib.config.current_mode[i])); modeconfig.push(ui.create.switcher.apply(this,lib.config.current_mode[i]));
} }
} }
}
for(i in lib.config.current_mode){
if(i=='difficulty'&&lib.config.current_mode[i]==true){
}
else if(i=='initshow_draw'&&lib.config.current_mode[i]==true){
}
}
if(lib.config.modeconfig){ if(lib.config.modeconfig){
for(i=0;i<modeconfig.length;i++){ for(i=0;i<modeconfig.length;i++){
ui.config.appendChild(modeconfig[i]); ui.config.appendChild(modeconfig[i]);
@ -8980,6 +8933,13 @@ window.play={};
else _status.event.parent.removeSetting(dialog); else _status.event.parent.removeSetting(dialog);
ui.update(); ui.update();
}, },
battle_number:function(num){
game.saveConfig('battle_number',num,true);
if(!_status.event.parent.showConfig&&!_status.event.showConfig) return;
if(_status.event.parent.changeDialog){
_status.event.parent.changeDialog();
}
},
change_choice:function(bool){ change_choice:function(bool){
game.saveConfig('change_choice',bool,true); game.saveConfig('change_choice',bool,true);
if(!_status.event.parent.showConfig&&!_status.event.showConfig) return; if(!_status.event.parent.showConfig&&!_status.event.showConfig) return;
@ -9544,7 +9504,7 @@ window.play={};
cards:function(num){ cards:function(num){
var list=[]; var list=[];
var card=false; var card=false;
if(num==undefined) num=1; if(typeof num!='number') num=1;
if(num==0) {card=true;num=1;} if(num==0) {card=true;num=1;}
while(num--){ while(num--){
if(ui.cardPile.hasChildNodes()==false){ if(ui.cardPile.hasChildNodes()==false){
@ -9579,16 +9539,24 @@ window.play={};
}, },
distance:function(from,to,method){ distance:function(from,to,method){
if(from==to) return 0; if(from==to) return 0;
if(!game.players.contains(from)&&!game.dead.contains(from)) return Infinity;
if(!game.players.contains(to)&&!game.dead.contains(to)) return Infinity;
var player=from,m,n=1,i; var player=from,m,n=1,i;
if(to.isMin()||from.isMin()){ if(to.isMin()||from.isMin()){
if(method=='raw'||method=='pure') return 1; if(method=='raw'||method=='pure') return 1;
} }
else{ else{
var length=game.players.length; var length=game.players.length;
while(player.nextSeat!=to){ var totalPopulation=game.players.length+game.dead.length+1;
for(var iwhile=0;iwhile<totalPopulation;i++){
if(player.nextSeat!=to){
player=player.nextSeat; player=player.nextSeat;
if(player.isAlive()&&!player.isOut()&&!player.isMin()) n++; if(player.isAlive()&&!player.isOut()&&!player.isMin()) n++;
} }
else{
break;
}
}
for(i=0;i<game.players.length;i++){ for(i=0;i<game.players.length;i++){
if(game.players[i].isOut()||game.players[i].isMin()) length--; if(game.players[i].isOut()||game.players[i].isMin()) length--;
} }
@ -10324,7 +10292,8 @@ window.play={};
var event=_status.event; var event=_status.event;
var i,j,range,buttons,buttons2; var i,j,range,buttons,buttons2;
var ok=false,forced=event.forced; var ok=false,forced=event.forced;
while(1){ var iwhile=100;
while(iwhile--){
range=get.select(event.selectButton); range=get.select(event.selectButton);
if(range[1]==-1){ if(range[1]==-1){
j=0; j=0;
@ -10363,7 +10332,8 @@ window.play={};
if(event.filterCard==undefined) return (check()>0); if(event.filterCard==undefined) return (check()>0);
var i,j,range,cards,cards2,skills,check,effect; var i,j,range,cards,cards2,skills,check,effect;
var ok=false,forced=event.forced; var ok=false,forced=event.forced;
while(1){ var iwhile=100;
while(iwhile--){
range=get.select(event.selectCard); range=get.select(event.selectCard);
if(ui.selected.cards.length>=range[0]){ if(ui.selected.cards.length>=range[0]){
ok=true; ok=true;
@ -10421,7 +10391,8 @@ window.play={};
if(event.filterTarget==undefined) return (check()>0); if(event.filterTarget==undefined) return (check()>0);
var i,j,range,targets,targets2,effect; var i,j,range,targets,targets2,effect;
var ok=false,forced=event.forced; var ok=false,forced=event.forced;
while(1){ var iwhile=100;
while(iwhile--){
range=get.select(event.selectTarget); range=get.select(event.selectTarget);
if(range[1]==-1){ if(range[1]==-1){
j=0; j=0;
@ -11204,9 +11175,7 @@ window.play={};
for(i in mode[lib.config.mode].get){ for(i in mode[lib.config.mode].get){
get[i]=lib.init.eval(mode[lib.config.mode].get[i]); get[i]=lib.init.eval(mode[lib.config.mode].get[i]);
} }
for(i in mode[lib.config.mode].config){ lib.config.current_mode=mode[lib.config.mode].config||[];
lib.config.current_mode[i]=mode[lib.config.mode].config[i];
}
lib.config.mode_choice=mode[lib.config.mode].config; lib.config.mode_choice=mode[lib.config.mode].config;
for(i in mode[lib.config.mode]){ for(i in mode[lib.config.mode]){
if(i=='element') continue; if(i=='element') continue;
@ -11302,8 +11271,8 @@ window.play={};
for(j in play[i].get){ for(j in play[i].get){
get[j]=lib.init.eval(play[i].get[j]); get[j]=lib.init.eval(play[i].get[j]);
} }
for(j in play[i].config){ if(play[i].config){
lib.config.current_mode[j]=play[i].config[j]; lib.config.current_mode=lib.config.current_mode.concat(play[i].config);
} }
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;

View File

@ -187,6 +187,8 @@ margin-bottom: 5px;
/*--------角色--------*/ /*--------角色--------*/
.player{z-index: 4;width: 240px;height: 120px;} .player{z-index: 4;width: 240px;height: 120px;}
.player.minskin{width:120px;} .player.minskin{width:120px;}
.player.replaceme{-webkit-animation:replaceme 0.5s}
.player.replaceenemy{-webkit-animation:replaceenemy 0.5s}
.player>div{z-index: 2;} .player>div{z-index: 2;}
.player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);} .player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);}
.player>.name{left: 18px;top:36px;} .player>.name{left: 18px;top:36px;}
@ -267,7 +269,7 @@ margin-bottom: 5px;
.linked>.count{right: 154px;} .linked>.count{right: 154px;}
.acted>.identity{-webkit-transform:rotate(180deg);} .acted>.identity{-webkit-transform:rotate(180deg);}
/*--------位置(n人)------*/ /*--------位置(炉石)------*/
#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);} #arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);}
#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);} #arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);}
#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);} #arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);}
@ -698,6 +700,8 @@ div[data-nature='soil']{
@-webkit-keyframes equip_hover2{0% {}50% {opacity: 0.6}100%{opacity: 0.3}} @-webkit-keyframes equip_hover2{0% {}50% {opacity: 0.6}100%{opacity: 0.3}}
@-webkit-keyframes dialog_start{from {opacity: 0;top:100px;}} @-webkit-keyframes dialog_start{from {opacity: 0;top:100px;}}
@-webkit-keyframes dialog_start2{from {opacity: 0;-webkit-transform:scale(0.8);}} @-webkit-keyframes dialog_start2{from {opacity: 0;-webkit-transform:scale(0.8);}}
@-webkit-keyframes replaceme{from {opacity: 0;-webkit-transform:translateY(120px)}}
@-webkit-keyframes replaceenemy{from {opacity: 0;-webkit-transform:translateY(-120px)}}
@-webkit-keyframes drawing{0% {opacity: 0;left:calc(50% - 52px);top:calc(50% - 52px);}50%{opacity: 1}100%{opacity: 0}} @-webkit-keyframes drawing{0% {opacity: 0;left:calc(50% - 52px);top:calc(50% - 52px);}50%{opacity: 1}100%{opacity: 0}}
@-webkit-keyframes card_start{from {opacity: 0;-webkit-transform:scale(0);}} @-webkit-keyframes card_start{from {opacity: 0;-webkit-transform:scale(0);}}
@-webkit-keyframes card_start2{from {opacity: 0;-webkit-transform:scale(0);margin-left: -52px;margin-right: -52px;}} @-webkit-keyframes card_start2{from {opacity: 0;-webkit-transform:scale(0);margin-left: -52px;margin-right: -52px;}}

View File

@ -291,31 +291,7 @@
.linked>.identity{top: -5px;} .linked>.identity{top: -5px;}
.linked>.count{right: auto;} .linked>.count{right: auto;}
/*--------位置(n人)------*/ /*--------位置(n人)------*/
#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);}
#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);}
#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);}
#arena.stone>.player.minskin[data-position='6']{top:calc(100% - 305px);left:calc(100% - 260px);}
#arena.stone>.card[data-position='6']{top:calc(100% - 297px);left:calc(100% - 252px);}
#arena.stone>.popup[data-position='6']{top:calc(100% - 340px);left:calc(100% - 252px);}
#arena.stone>.player.minskin[data-position='7']{top:calc(100% - 305px);left:140px;}
#arena.stone>.card[data-position='7']{top:calc(100% - 297px);left:148px;}
#arena.stone>.popup[data-position='7']{top:calc(100% - 340px);left:148px;}
#arena.stone>.player.minskin[data-position='5']{top:calc(100% - 305px);left:0;}
#arena.stone>.card[data-position='5']{top:calc(100% - 297px);left:8px;}
#arena.stone>.popup[data-position='5']{top:calc(100% - 340px);left:8px;}
#arena>.player.minskin[data-position='9']{top:10px;left:calc(100% - 120px);}
#arena.stone>.card[data-position='9']{top:18px;left:calc(100% - 112px);}
#arena.stone>.popup[data-position='9']{top:140px;left:calc(100% - 112px);}
#arena>.player.minskin[data-position='11']{top:10px;left:calc(100% - 260px);}
#arena.stone>.card[data-position='11']{top:18px;left:calc(100% - 252px);}
#arena.stone>.popup[data-position='11']{top:140px;left:calc(100% - 252px);}
#arena>.player.minskin[data-position='10']{top:10px;left:140px;}
#arena.stone>.card[data-position='10']{top:18px;left:148px;}
#arena.stone>.popup[data-position='10']{top:140px;left:148px;}
#arena>.player.minskin[data-position='8']{top:10px;left:0;}
#arena.stone>.card[data-position='8']{top:18px;left:8px;}
#arena.stone>.popup[data-position='8']{top:140px;left:8px;}
/*--------位置(8人)------*/ /*--------位置(8人)------*/
[data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 160px);left:calc(100% - 150px);} [data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 160px);left:calc(100% - 150px);}
[data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 170px);left:calc(100% - 150px);} [data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 170px);left:calc(100% - 150px);}

View File

@ -695,18 +695,7 @@ mode.guozhan={
}, },
} }
}, },
config:{ config:['player_number','initshow_draw',
player_number:true, 'free_choose','change_identity','change_choice','change_card',
initshow_draw:true, 'swap','dierestart','ai_identity','revive','double_hp','difficulty']
free_choose:true,
change_identity:true,
change_choice:true,
change_card:true,
swap:true,
dierestart:true,
ai_identity:true,
revive:true,
double_hp:true,
difficulty:true,
},
} }

View File

@ -697,22 +697,8 @@ mode.identity={
} }
} }
}, },
config:{ config:['player_number','double_character','double_hp',
player_number:true, 'ban_weak','enhance_zhu','free_choose','change_identity',
double_character:true, 'change_choice','change_card','dierestart','swap','revive',
double_hp:true, 'auto_identity','ai_strategy','ai_identity','difficulty']
ban_weak:true,
enhance_zhu:true,
free_choose:true,
change_identity:true,
change_choice:true,
change_card:true,
dierestart:true,
swap:true,
revive:true,
auto_identity:true,
ai_strategy:true,
ai_identity:true,
difficulty:true,
},
} }

View File

@ -3,19 +3,30 @@ mode.stone={
player:{ player:{
init:function(player){ init:function(player){
if(!player.isMin()){ if(!player.isMin()){
if(!player.node.actcount){
player.node.actcount=ui.create.div('.actcount.hp',player); player.node.actcount=ui.create.div('.actcount.hp',player);
}
if(typeof player.actcount!=='number'){
player.actcount=1; player.actcount=1;
}
if(!player.actcharacterlist){
player.actcharacterlist=[]; player.actcharacterlist=[];
}
player.updateActCount(); player.updateActCount();
} }
}, },
updateActCount:function(){ updateActCount:function(){
while(this.actcount>this.node.actcount.childElementCount){ for(var i=0;i<10;i++){
if(this.actcount>this.node.actcount.childElementCount){
ui.create.div(this.node.actcount); ui.create.div(this.node.actcount);
} }
while(this.actcount<this.node.actcount.childElementCount){ else if(this.actcount<this.node.actcount.childElementCount){
this.node.actcount.lastChild.remove(); this.node.actcount.lastChild.remove();
} }
else{
break;
}
}
var count=this.actcount-get.cardCount(true,this); var count=this.actcount-get.cardCount(true,this);
for(var i=0;i<this.actcount;i++){ for(var i=0;i<this.actcount;i++){
if(i<count){ if(i<count){
@ -26,10 +37,72 @@ mode.stone={
} }
} }
}, },
dieAfter:function(){ dieAfter:function(source){
if(game.me.isDead()) game.over(false); var dead=this;
if(game.enemy.isDead()) game.over(true); if(game.me.isDead()){
if(!_status.mylist.length){
game.over(false);
}
else{
game.pause();
_status.deadfriend.push(this);
setTimeout(function(){
var player=ui.create.player();
player.dataset.position=dead.dataset.position;
player.side=dead.side;
player.actcharacterlist=dead.actcharacterlist;
player.animate('replaceme');
player.actcount=dead.actcount-1;
if(_status.double_character){
player.init(_status.mylist.shift(),_status.mylist.shift());
}
else{
player.init(_status.mylist.shift());
}
game.players.push(player);
ui.arena.appendChild(player);
game.swapControl(player);
game.arrangePlayers();
player.draw(2,false);
game.resume();
},lib.config.duration);
}
}
else if(game.enemy.isDead()){
if(!_status.enemylist.length){
game.over(true);
}
else{
game.pause();
_status.deadenemy.push(this);
setTimeout(function(){
var player=ui.create.player();
player.dataset.position=dead.dataset.position;
player.side=dead.side;
player.actcharacterlist=dead.actcharacterlist;
player.animate('replaceenemy');
player.actcount=dead.actcount-1;
if(_status.double_character){
player.init(_status.enemylist.shift(),_status.enemylist.shift());
}
else{
player.init(_status.enemylist.shift());
}
game.players.push(player);
game.enemy=player;
ui.arena.appendChild(player);
game.arrangePlayers();
player.draw(2,false);
game.resume();
},lib.config.duration);
}
}
if(source&&source.side!=this.side){
source.draw(2);
}
game.dead.remove(this); game.dead.remove(this);
game.arrangePlayers();
var player,pos; var player,pos;
if(this.side==game.me.side){ if(this.side==game.me.side){
player=game.me; player=game.me;
@ -39,13 +112,12 @@ mode.stone={
player=game.enemy; player=game.enemy;
pos=4; pos=4;
} }
player.actcharacterlist.remove(this);
var dead=this;
setTimeout(function(){ setTimeout(function(){
dead.delete(); dead.delete();
},500); },500);
for(var i=0;i<player.actcharacterlist.length;i++){ var index=player.actcharacterlist.indexOf(this);
player.actcharacterlist[i].dataset.position=i+4+pos; if(index>=0){
player.actcharacterlist[index]=null;
} }
} }
} }
@ -61,9 +133,11 @@ mode.stone={
player.phase(); player.phase();
event.num=0; event.num=0;
"step 1" "step 1"
if(event.num<player.actcharacterlist.length){
var current=player.actcharacterlist[event.num]; var current=player.actcharacterlist[event.num];
if(current){ if(current){
current.phase(); current.phase();
}
event.num++; event.num++;
event.redo(); event.redo();
} }
@ -82,6 +156,8 @@ mode.stone={
var i,j,name; var i,j,name;
for(i in lib.character){ for(i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('minskin')){ if(lib.character[i][4]&&lib.character[i][4].contains('minskin')){
lib.character[i][3].add('stonesha');
lib.character[i][3].add('stoneshan');
list.push(i); list.push(i);
} }
} }
@ -98,7 +174,11 @@ mode.stone={
opacity:1, opacity:1,
enable:function(event,player){ enable:function(event,player){
if(!player.actcharacterlist) return false; if(!player.actcharacterlist) return false;
return player.actcharacterlist.length<4; if(player.actcharacterlist.length<4) return true;
for(var i=0;i<player.actcharacterlist.length;i++){
if(player.actcharacterlist[i]===null) return true;
}
return false;
}, },
chongzhu:true, chongzhu:true,
textShadow:'black 0 0 2px', textShadow:'black 0 0 2px',
@ -108,14 +188,23 @@ mode.stone={
selectTarget:-1, selectTarget:-1,
content:function(){ content:function(){
var name=card.name.slice(0,card.name.indexOf('_stonecharacter')); var name=card.name.slice(0,card.name.indexOf('_stonecharacter'));
var pos=player.actcharacterlist.length+4; var added=false;
var i;
for(i=0;i<player.actcharacterlist.length;i++){
if(player.actcharacterlist[i]===null){
added=true;
break;
}
}
var pos=i+4;
if(player!=game.me){ if(player!=game.me){
pos+=4; pos+=4;
} }
var fellow=game.addFellow(pos,name); var fellow=game.addFellow(pos,name);
fellow.side=player.side; fellow.side=player.side;
fellow.classList.add('turnedover'); fellow.classList.add('turnedover');
player.actcharacterlist.push(fellow); player.actcharacterlist[i]=fellow;
fellow.$gain2(card); fellow.$gain2(card);
}, },
ai:{ ai:{
@ -149,6 +238,9 @@ mode.stone={
lib.card[i].chongzhu=true; lib.card[i].chongzhu=true;
} }
} }
_status.deadfriend=[];
_status.deadenemy=[];
}, },
start:function(){ start:function(){
var next=game.createEvent('game',false); var next=game.createEvent('game',false);
@ -159,10 +251,10 @@ mode.stone={
ui.arena.classList.add('stone'); ui.arena.classList.add('stone');
game.delay(); game.delay();
"step 1" "step 1"
game.enemy=game.me.next;
game.chooseCharacter(); game.chooseCharacter();
"step 2" "step 2"
game.me.identity='zhu'; game.me.identity='zhu';
game.enemy=game.me.next;
game.enemy.identity='zhu'; game.enemy.identity='zhu';
game.me.side=Math.random()<0.5; game.me.side=Math.random()<0.5;
game.enemy.side=!game.me.side; game.enemy.side=!game.me.side;
@ -204,17 +296,19 @@ mode.stone={
list.push(i); list.push(i);
} }
list.randomSort(); list.randomSort();
var dialog=ui.create.dialog('选择角色',[list.slice(0,7),'character']); var dialog=ui.create.dialog('选择角色',[list.slice(0,get.config('battle_number')*2+5),'character']);
game.me.chooseButton(dialog,true).selectButton=function(){ game.me.chooseButton(dialog,true).selectButton=function(){
return get.config('double_character')?2:1 return (get.config('double_character')?2:1)*get.config('battle_number');
}; };
ui.create.cheat=function(){ event.changeDialog=function(){
ui.cheat=ui.create.control('更换',function(){
list.randomSort(); list.randomSort();
_status.event.dialog=ui.create.dialog('选择角色',[list.slice(0,7),'character']); _status.event.dialog.close();
_status.event.dialog=ui.create.dialog('选择角色',[list.slice(0,get.config('battle_number')*2+5),'character']);
game.uncheck(); game.uncheck();
game.check(); game.check();
}); };
ui.create.cheat=function(){
ui.cheat=ui.create.control('更换',event.changeDialog);
}; };
event.dialogxx=ui.create.characterDialog(); event.dialogxx=ui.create.characterDialog();
ui.create.cheat2=function(){ ui.create.cheat2=function(){
@ -260,18 +354,20 @@ mode.stone={
ui.cheat2x.close(); ui.cheat2x.close();
delete ui.cheat2x; delete ui.cheat2x;
} }
if(result.buttons.length==2){ _status.mylist=result.links.slice(0);
game.me.init(result.buttons[0].link,result.buttons[1].link) for(var i=0;i<result.links.length;i++){
event.list.remove(result.links[i]);
}
event.list.randomSort();
_status.enemylist=event.list.slice(0,result.links.length);
_status.double_character=get.config('double_character');
if(_status.double_character){
game.me.init(_status.mylist.shift(),_status.mylist.shift());
game.enemy.init(_status.enemylist.shift(),_status.enemylist.shift());
} }
else{ else{
game.me.init(result.buttons[0].link) game.me.init(_status.mylist.shift());
} game.enemy.init(_status.enemylist.shift());
event.list.remove(game.me.name);
event.list.remove(game.me.name2);
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=game.me){
event.ai(game.players[i],event.list.splice(0,7));
}
} }
} }
}, },
@ -346,6 +442,48 @@ mode.stone={
player.updateActCount(); player.updateActCount();
} }
}, },
stonesha:{
enable:['chooseToUse','chooseToRespond'],
filterCard:{type:'stonecharacter'},
viewAs:{name:'sha'},
check:function(){return 1},
filter:function(event,player){
return player.num('h',{type:'stonecharacter'})>0;
},
viewAsFilter:function(player){
return player.num('h',{type:'stonecharacter'})>0;
},
ai:{
skillTagFilter:function(player){
return player.num('h',{type:'stonecharacter'})>0;
},
respondSha:true,
order:4,
useful:-1,
value:-1
}
},
stoneshan:{
enable:['chooseToRespond'],
filterCard:{type:'equip'},
viewAs:{name:'shan'},
check:function(){return 1},
filter:function(event,player){
return player.num('h',{type:'equip'})>0;
},
viewAsFilter:function(player){
return player.num('h',{type:'equip'})>0;
},
ai:{
skillTagFilter:function(player){
return player.num('h',{type:'equip'})>0;
},
respondShan:true,
order:4,
useful:-1,
value:-1
}
},
}, },
translate:{ translate:{
stone_weibing:'士兵', stone_weibing:'士兵',
@ -377,18 +515,16 @@ mode.stone={
stone_feipin:'妃嫔', stone_feipin:'妃嫔',
stone_yiji:'艺伎', stone_yiji:'艺伎',
stone_daogu:'道姑', stone_daogu:'道姑',
stonesha:'炉杀',
stoneshan:'石闪',
}, },
ai:{ ai:{
get:{ get:{
attitude:function(from,to){ attitude:function(from,to){
return (to.identity=='zhu'?7:5)*(from.side==to.side?1:-1); return (to.identity=='zhu'?6:5)*(from.side==to.side?1:-1);
} }
} }
}, },
config:{ config:['battle_number','double_character','ban_weak','free_choose','change_choice']
double_character:true,
ban_weak:true,
free_choose:true,
change_choice:true,
},
} }