null
This commit is contained in:
parent
00acd45371
commit
4c52441407
|
@ -1191,7 +1191,8 @@ card.standard={
|
|||
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;
|
||||
},
|
||||
source:event.source
|
||||
source:event.source,
|
||||
source2:event.source2
|
||||
});
|
||||
"step 2"
|
||||
if(result.bool){
|
||||
|
|
|
@ -237,6 +237,9 @@ character.diy={
|
|||
// }
|
||||
},
|
||||
ai:{
|
||||
skillTagFilter:function(player){
|
||||
if(player.storage.guihan) return false;
|
||||
},
|
||||
save:true,
|
||||
result:{
|
||||
player:4,
|
||||
|
|
|
@ -381,10 +381,17 @@ character.extra={
|
|||
threaten:function(player,target){
|
||||
if(target.hp==1) return 0.5;
|
||||
},
|
||||
result:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
if(target.hp<=1&&get.tag(card,'damage')){
|
||||
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];
|
||||
return [1,0,0,-player.hp];
|
||||
}
|
||||
|
@ -820,6 +827,22 @@ character.extra={
|
|||
longhun:{
|
||||
group:['longhun1','longhun2','longhun3','longhun4'],
|
||||
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,
|
||||
save:true,
|
||||
respondSha:true,
|
||||
|
@ -879,9 +902,6 @@ character.extra={
|
|||
enable:['chooseToUse','chooseToRespond'],
|
||||
prompt:'将一张黑桃牌当无懈可击使用',
|
||||
position:'he',
|
||||
viewAsFilter:function(player){
|
||||
return player.num('he',{color:'black'})>=player.hp;
|
||||
},
|
||||
check:function(card,event){
|
||||
if(_status.event.player.hp>1) return 0;
|
||||
return 7-ai.get.value(card);
|
||||
|
@ -891,7 +911,7 @@ character.extra={
|
|||
},
|
||||
viewAs:{name:'wuxie'},
|
||||
viewAsFilter:function(player){
|
||||
return player.num('he',{suit:'spade'})>0;
|
||||
return player.num('he',{suit:'spade'})>=player.hp;
|
||||
},
|
||||
filterCard:function(card){
|
||||
return get.suit(card)=='spade';
|
||||
|
|
|
@ -127,6 +127,9 @@ character.fire={
|
|||
player.storage.niepan=true;
|
||||
},
|
||||
ai:{
|
||||
skillTagFilter:function(player){
|
||||
if(player.storage.niepan) return false;
|
||||
},
|
||||
save:true,
|
||||
result:{
|
||||
player:10
|
||||
|
|
|
@ -2546,6 +2546,13 @@ character.sp={
|
|||
check:function(event,player){
|
||||
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,
|
||||
content:function(){
|
||||
"step 0"
|
||||
|
@ -2556,6 +2563,8 @@ character.sp={
|
|||
}
|
||||
"step 1"
|
||||
if(result.bool){
|
||||
player.storage.suiren=true;
|
||||
player.unmarkSkill('suiren');
|
||||
player.logSkill('suiren',result.targets);
|
||||
player.removeSkill('yicong');
|
||||
player.gainMaxHp();
|
||||
|
|
|
@ -1208,6 +1208,9 @@ character.swd={
|
|||
}
|
||||
},
|
||||
ai:{
|
||||
skillTagFilter:function(player){
|
||||
if(player.storage.shouyin) return false;
|
||||
},
|
||||
expose:0.3,
|
||||
save:true,
|
||||
result:{
|
||||
|
|
|
@ -1079,12 +1079,12 @@ character.yijiang={
|
|||
"step 1"
|
||||
if(result.bool){
|
||||
var target=result.targets[0];
|
||||
player.logSkill('qiuyuan',target);
|
||||
event.target=target;
|
||||
target.chooseCard({name:'shan'},'交给'+get.translation(player)+
|
||||
'一张闪,或成为此杀的额外目标').ai=function(card){
|
||||
return ai.get.attitude(target,player)>=0?1:-1;
|
||||
}
|
||||
player.logSkill('qiuyuan',target);
|
||||
game.delay();
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -142,7 +142,8 @@ window.config={
|
|||
theme_config:'主题',
|
||||
layout_config:'布局',
|
||||
mode_config:'游戏模式',
|
||||
player_number_config:'角色个数',
|
||||
player_number_config:'游戏人数',
|
||||
battle_number_config:'参战人数',
|
||||
difficulty_config:'AI对人类态度',
|
||||
initshow_draw_config:'首亮摸牌',
|
||||
ai_strategy_config:'内奸策略',
|
||||
|
@ -276,6 +277,7 @@ window.config={
|
|||
free_choose:true,
|
||||
swap:true,
|
||||
change_identity:true,
|
||||
battle_number:1
|
||||
},
|
||||
identity:{
|
||||
identity:[
|
||||
|
@ -302,7 +304,7 @@ window.config={
|
|||
difficulty:'normal',
|
||||
initshow_draw:2,
|
||||
dierestart:true
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
game_intro:{
|
||||
|
|
283
game/game.js
283
game/game.js
|
@ -1128,11 +1128,8 @@ window.play={};
|
|||
"step 0"
|
||||
player.lose(cards);
|
||||
if(event.skill){
|
||||
player.popup(event.skill);
|
||||
player.logSkill(event.skill);
|
||||
player.popup(event.card.name);
|
||||
if(player.checkShow){
|
||||
player.checkShow(event.skill);
|
||||
}
|
||||
}
|
||||
if(lib.config.background_audio){
|
||||
var sex=player.sex=='female'?'female':'male';
|
||||
|
@ -1155,7 +1152,7 @@ window.play={};
|
|||
}
|
||||
if(event.animate!=false){
|
||||
if(card.name=='wuxie'&&event.parent.source){
|
||||
player.line(event.parent.source,'green');
|
||||
player.line(event.parent.source2||event.parent.source,'green');
|
||||
}
|
||||
else{
|
||||
var config={};
|
||||
|
@ -1849,13 +1846,13 @@ window.play={};
|
|||
}
|
||||
if(player==game.me&&!_status.over){
|
||||
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);
|
||||
}
|
||||
if(get.config('revive')){
|
||||
if(get.config('revive')&&lib.config.mode_choice.contains('revive')){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -3425,8 +3422,9 @@ window.play={};
|
|||
this.skipList.add(name);
|
||||
},
|
||||
logSkill:function(name,targets,nature){
|
||||
this.popup(name);
|
||||
if(get.itemtype(targets)=='player') targets=[targets];
|
||||
if(lib.translate[name]){
|
||||
this.popup(name);
|
||||
if(typeof targets=='object'&&targets.length){
|
||||
var str=get.translation(this)+'对'+get.translation(targets[0]);
|
||||
for(var i=1;i<targets.length;i++){
|
||||
|
@ -3434,13 +3432,14 @@ window.play={};
|
|||
}
|
||||
str+='发动了'+get.translation(name);
|
||||
game.log(str);
|
||||
if(nature!=false){
|
||||
this.line(targets,nature);
|
||||
}
|
||||
}
|
||||
else{
|
||||
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){
|
||||
this.logAi(lib.skill[name].ai.expose);
|
||||
}
|
||||
|
@ -3478,7 +3477,7 @@ window.play={};
|
|||
this.node.prompt=node;
|
||||
}
|
||||
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')){
|
||||
node.innerHTML=name2;
|
||||
}
|
||||
|
@ -3495,7 +3494,7 @@ window.play={};
|
|||
var name2=get.translation(name);
|
||||
var node=ui.create.div('.popup',ui.arena);
|
||||
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')){
|
||||
node.innerHTML=name2;
|
||||
}
|
||||
|
@ -3813,7 +3812,11 @@ window.play={};
|
|||
var skills=game.expandSkills(this.get('s',hidden));
|
||||
for(var i=0;i<skills.length;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;
|
||||
},
|
||||
|
@ -3956,7 +3959,7 @@ window.play={};
|
|||
this.$give(card[i],player,false);
|
||||
}
|
||||
}
|
||||
else if(typeof card=='number'){
|
||||
else if(typeof card=='number'&&card>=0){
|
||||
if(log!=false){
|
||||
game.log(get.translation(player)+'从'+get.translation(this)+'获得了'+get.cnNumber(card)+'张牌');
|
||||
}
|
||||
|
@ -4304,13 +4307,22 @@ window.play={};
|
|||
},
|
||||
trigger:function(name){
|
||||
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&&name!='gameStart') return;
|
||||
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;
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(event._endTrigger.isDead()){
|
||||
event._endTrigger=game.players.randomGet();
|
||||
}
|
||||
var player=event._endTrigger;
|
||||
var list=[],others=[];
|
||||
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);
|
||||
game.expandSkills(skills);
|
||||
for(i=0;i<skills.length;i++){
|
||||
|
@ -4369,8 +4381,10 @@ window.play={};
|
|||
}
|
||||
}
|
||||
player=player.next;
|
||||
if(player==event._endTrigger){
|
||||
break;
|
||||
}
|
||||
}
|
||||
while(player!=event._endTrigger);
|
||||
if(list.length){
|
||||
list.sort(lib.sort.priority);
|
||||
for(i=0;i<list.length;i++){
|
||||
|
@ -4550,7 +4564,7 @@ window.play={};
|
|||
if(ui.skills==this) delete ui.skills;
|
||||
},
|
||||
replace:function(){
|
||||
while(this.childNodes.length) this.childNodes[0].remove();
|
||||
while(this.childNodes.length) this.firstChild.remove();
|
||||
var i,controls;
|
||||
if(get.objtype(arguments[0])=='array') controls=arguments[0];
|
||||
else controls=arguments;
|
||||
|
@ -4698,7 +4712,11 @@ window.play={};
|
|||
},
|
||||
seat:function(a,b){
|
||||
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){
|
||||
return parseInt(a.dataset.position)-parseInt(b.dataset.position);
|
||||
|
@ -4872,6 +4890,7 @@ window.play={};
|
|||
enable:'phaseUse',
|
||||
prompt:'弃置要重铸的牌并摸一张牌',
|
||||
filter:function(event,player){
|
||||
if(player.isMin()) return false;
|
||||
return (player.get('h',function(card){
|
||||
return get.info(card).chongzhu;
|
||||
}).length);
|
||||
|
@ -5659,9 +5678,15 @@ window.play={};
|
|||
},
|
||||
swapSeat:function(player1,player2,prompt,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);
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(prompt!=false){
|
||||
game.log(get.translation(player1)+'将座位移至'+get.translation(player2)+'后');
|
||||
}
|
||||
|
@ -5994,74 +6019,6 @@ window.play={};
|
|||
if(_status.reloading) return;
|
||||
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){
|
||||
if(_status.reloading) return;
|
||||
var config;
|
||||
|
@ -6883,68 +6840,64 @@ window.play={};
|
|||
unfold(this,modeconfig);
|
||||
}
|
||||
}));
|
||||
for(i in lib.config.current_mode){
|
||||
if(i=='difficulty'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.local));
|
||||
}
|
||||
else if(i=='initshow_draw'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('initshow_draw',[0,1,2],get.config('initshow_draw'),ui.click.sidebar.local));
|
||||
}
|
||||
else if(i=='ai_strategy'&&lib.config.current_mode[i]==true){
|
||||
for(i=0;i<lib.config.current_mode.length;i++){
|
||||
switch(lib.config.current_mode[i]){
|
||||
case 'difficulty':
|
||||
modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.local));break;
|
||||
case 'initshow_draw':
|
||||
modeconfig.push(ui.create.switcher('initshow_draw',[0,1,2],get.config('initshow_draw'),ui.click.sidebar.local));break;
|
||||
case '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'],
|
||||
get.config('ai_strategy'),ui.click.sidebar.local));
|
||||
}
|
||||
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));
|
||||
}
|
||||
else if(i=='auto_identity'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('auto_identity',['一轮','两轮','三轮','关闭'],get.config('auto_identity'),ui.click.sidebar.auto_identity));
|
||||
}
|
||||
else if(i=='player_number'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('player_number',[2,3,4,5,6,7,8],get.config('player_number'),ui.click.sidebar.player_number));
|
||||
}
|
||||
else if(i=='double_character'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('double_character',get.config('double_character'),ui.click.sidebar.local2));
|
||||
}
|
||||
else if(i=='double_hp'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('double_hp',lib.config.all.double_hp,get.config('double_hp'),ui.click.sidebar.local2));
|
||||
}
|
||||
else if(i=='free_choose'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('free_choose',get.config('free_choose'),ui.click.sidebar.free_choose));
|
||||
}
|
||||
else if(i=='change_card'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('change_card',get.config('change_card'),ui.click.sidebar.local));
|
||||
}
|
||||
else if(i=='change_choice'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('change_choice',get.config('change_choice'),ui.click.sidebar.change_choice));
|
||||
}
|
||||
else if(i=='change_identity'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('change_identity',get.config('change_identity'),ui.click.sidebar.change_identity));
|
||||
}
|
||||
else if(i=='swap'&&lib.config.current_mode[i]==true){
|
||||
modeconfig.push(ui.create.switcher('swap',get.config('swap'),ui.click.sidebar.swap));
|
||||
}
|
||||
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){
|
||||
get.config('ai_strategy'),ui.click.sidebar.local));break;
|
||||
case 'ai_identity':
|
||||
modeconfig.push(ui.create.switcher('ai_identity',get.config('ai_identity'),ui.click.sidebar.local));break;
|
||||
case 'auto_identity':
|
||||
modeconfig.push(ui.create.switcher('auto_identity',['一轮','两轮','三轮','关闭'],get.config('auto_identity'),ui.click.sidebar.auto_identity));break;
|
||||
case 'player_number':
|
||||
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':
|
||||
modeconfig.push(ui.create.switcher('battle_number',[1,2,3,5,8,16],get.config('battle_number'),ui.click.sidebar.battle_number));break;
|
||||
case 'double_character':
|
||||
modeconfig.push(ui.create.switcher('double_character',get.config('double_character'),ui.click.sidebar.local));break;
|
||||
case 'double_hp':
|
||||
modeconfig.push(ui.create.switcher('double_hp',lib.config.all.double_hp,get.config('double_hp'),ui.click.sidebar.local2));break;
|
||||
case 'free_choose':
|
||||
modeconfig.push(ui.create.switcher('free_choose',get.config('free_choose'),ui.click.sidebar.free_choose));break;
|
||||
case 'change_card':
|
||||
modeconfig.push(ui.create.switcher('change_card',get.config('change_card'),ui.click.sidebar.local));break;
|
||||
case 'change_choice':
|
||||
modeconfig.push(ui.create.switcher('change_choice',get.config('change_choice'),ui.click.sidebar.change_choice));break;
|
||||
case 'change_identity':
|
||||
modeconfig.push(ui.create.switcher('change_identity',get.config('change_identity'),ui.click.sidebar.change_identity));break;
|
||||
case 'swap':
|
||||
modeconfig.push(ui.create.switcher('swap',get.config('swap'),ui.click.sidebar.swap));break;
|
||||
case 'revive':
|
||||
modeconfig.push(ui.create.switcher('revive',get.config('revive'),ui.click.sidebar.revive));break;
|
||||
case 'dierestart':
|
||||
modeconfig.push(ui.create.switcher('dierestart',get.config('dierestart'),ui.click.sidebar.local2));break;
|
||||
case 'ban_weak':
|
||||
modeconfig.push(ui.create.switcher('ban_weak',get.config('ban_weak'),ui.click.sidebar.local2));break;
|
||||
case 'enhance_zhu':
|
||||
modeconfig.push(ui.create.switcher('enhance_zhu',get.config('enhance_zhu'),ui.click.sidebar.local2));break;
|
||||
case 'strict_sort':
|
||||
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));
|
||||
}
|
||||
else if(Array.isArray(lib.config.current_mode[i])){
|
||||
modeconfig.push(ui.create.switcher('reverse_sort',get.config('reverse_sort'),ui.click.sidebar.reverse_sort));break;
|
||||
default:
|
||||
if(Array.isArray(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){
|
||||
for(i=0;i<modeconfig.length;i++){
|
||||
ui.config.appendChild(modeconfig[i]);
|
||||
|
@ -8980,6 +8933,13 @@ window.play={};
|
|||
else _status.event.parent.removeSetting(dialog);
|
||||
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){
|
||||
game.saveConfig('change_choice',bool,true);
|
||||
if(!_status.event.parent.showConfig&&!_status.event.showConfig) return;
|
||||
|
@ -9544,7 +9504,7 @@ window.play={};
|
|||
cards:function(num){
|
||||
var list=[];
|
||||
var card=false;
|
||||
if(num==undefined) num=1;
|
||||
if(typeof num!='number') num=1;
|
||||
if(num==0) {card=true;num=1;}
|
||||
while(num--){
|
||||
if(ui.cardPile.hasChildNodes()==false){
|
||||
|
@ -9579,16 +9539,24 @@ window.play={};
|
|||
},
|
||||
distance:function(from,to,method){
|
||||
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;
|
||||
if(to.isMin()||from.isMin()){
|
||||
if(method=='raw'||method=='pure') return 1;
|
||||
}
|
||||
else{
|
||||
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;
|
||||
if(player.isAlive()&&!player.isOut()&&!player.isMin()) n++;
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(i=0;i<game.players.length;i++){
|
||||
if(game.players[i].isOut()||game.players[i].isMin()) length--;
|
||||
}
|
||||
|
@ -10324,7 +10292,8 @@ window.play={};
|
|||
var event=_status.event;
|
||||
var i,j,range,buttons,buttons2;
|
||||
var ok=false,forced=event.forced;
|
||||
while(1){
|
||||
var iwhile=100;
|
||||
while(iwhile--){
|
||||
range=get.select(event.selectButton);
|
||||
if(range[1]==-1){
|
||||
j=0;
|
||||
|
@ -10363,7 +10332,8 @@ window.play={};
|
|||
if(event.filterCard==undefined) return (check()>0);
|
||||
var i,j,range,cards,cards2,skills,check,effect;
|
||||
var ok=false,forced=event.forced;
|
||||
while(1){
|
||||
var iwhile=100;
|
||||
while(iwhile--){
|
||||
range=get.select(event.selectCard);
|
||||
if(ui.selected.cards.length>=range[0]){
|
||||
ok=true;
|
||||
|
@ -10421,7 +10391,8 @@ window.play={};
|
|||
if(event.filterTarget==undefined) return (check()>0);
|
||||
var i,j,range,targets,targets2,effect;
|
||||
var ok=false,forced=event.forced;
|
||||
while(1){
|
||||
var iwhile=100;
|
||||
while(iwhile--){
|
||||
range=get.select(event.selectTarget);
|
||||
if(range[1]==-1){
|
||||
j=0;
|
||||
|
@ -11204,9 +11175,7 @@ window.play={};
|
|||
for(i in mode[lib.config.mode].get){
|
||||
get[i]=lib.init.eval(mode[lib.config.mode].get[i]);
|
||||
}
|
||||
for(i in mode[lib.config.mode].config){
|
||||
lib.config.current_mode[i]=mode[lib.config.mode].config[i];
|
||||
}
|
||||
lib.config.current_mode=mode[lib.config.mode].config||[];
|
||||
lib.config.mode_choice=mode[lib.config.mode].config;
|
||||
for(i in mode[lib.config.mode]){
|
||||
if(i=='element') continue;
|
||||
|
@ -11302,8 +11271,8 @@ window.play={};
|
|||
for(j in play[i].get){
|
||||
get[j]=lib.init.eval(play[i].get[j]);
|
||||
}
|
||||
for(j in play[i].config){
|
||||
lib.config.current_mode[j]=play[i].config[j];
|
||||
if(play[i].config){
|
||||
lib.config.current_mode=lib.config.current_mode.concat(play[i].config);
|
||||
}
|
||||
for(j in play[i]){
|
||||
if(j=='mode'||j=='forbid'||j=='init'||j=='element'||j=='game'||j=='get'||j=='config'||j=='ui') continue;
|
||||
|
|
|
@ -187,6 +187,8 @@ margin-bottom: 5px;
|
|||
/*--------角色--------*/
|
||||
.player{z-index: 4;width: 240px;height: 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.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);}
|
||||
.player>.name{left: 18px;top:36px;}
|
||||
|
@ -267,7 +269,7 @@ margin-bottom: 5px;
|
|||
.linked>.count{right: 154px;}
|
||||
.acted>.identity{-webkit-transform:rotate(180deg);}
|
||||
|
||||
/*--------位置(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);}
|
||||
|
@ -698,6 +700,8 @@ div[data-nature='soil']{
|
|||
@-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_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 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;}}
|
||||
|
|
|
@ -291,31 +291,7 @@
|
|||
.linked>.identity{top: -5px;}
|
||||
.linked>.count{right: auto;}
|
||||
/*--------位置(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人)------*/
|
||||
[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);}
|
||||
|
|
|
@ -695,18 +695,7 @@ mode.guozhan={
|
|||
},
|
||||
}
|
||||
},
|
||||
config:{
|
||||
player_number:true,
|
||||
initshow_draw:true,
|
||||
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,
|
||||
},
|
||||
config:['player_number','initshow_draw',
|
||||
'free_choose','change_identity','change_choice','change_card',
|
||||
'swap','dierestart','ai_identity','revive','double_hp','difficulty']
|
||||
}
|
||||
|
|
|
@ -697,22 +697,8 @@ mode.identity={
|
|||
}
|
||||
}
|
||||
},
|
||||
config:{
|
||||
player_number:true,
|
||||
double_character:true,
|
||||
double_hp:true,
|
||||
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,
|
||||
},
|
||||
config:['player_number','double_character','double_hp',
|
||||
'ban_weak','enhance_zhu','free_choose','change_identity',
|
||||
'change_choice','change_card','dierestart','swap','revive',
|
||||
'auto_identity','ai_strategy','ai_identity','difficulty']
|
||||
}
|
||||
|
|
208
mode/stone.js
208
mode/stone.js
|
@ -3,19 +3,30 @@ mode.stone={
|
|||
player:{
|
||||
init:function(player){
|
||||
if(!player.isMin()){
|
||||
if(!player.node.actcount){
|
||||
player.node.actcount=ui.create.div('.actcount.hp',player);
|
||||
}
|
||||
if(typeof player.actcount!=='number'){
|
||||
player.actcount=1;
|
||||
}
|
||||
if(!player.actcharacterlist){
|
||||
player.actcharacterlist=[];
|
||||
}
|
||||
player.updateActCount();
|
||||
}
|
||||
},
|
||||
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);
|
||||
}
|
||||
while(this.actcount<this.node.actcount.childElementCount){
|
||||
else if(this.actcount<this.node.actcount.childElementCount){
|
||||
this.node.actcount.lastChild.remove();
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
var count=this.actcount-get.cardCount(true,this);
|
||||
for(var i=0;i<this.actcount;i++){
|
||||
if(i<count){
|
||||
|
@ -26,10 +37,72 @@ mode.stone={
|
|||
}
|
||||
}
|
||||
},
|
||||
dieAfter:function(){
|
||||
if(game.me.isDead()) game.over(false);
|
||||
if(game.enemy.isDead()) game.over(true);
|
||||
dieAfter:function(source){
|
||||
var dead=this;
|
||||
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.arrangePlayers();
|
||||
var player,pos;
|
||||
if(this.side==game.me.side){
|
||||
player=game.me;
|
||||
|
@ -39,13 +112,12 @@ mode.stone={
|
|||
player=game.enemy;
|
||||
pos=4;
|
||||
}
|
||||
player.actcharacterlist.remove(this);
|
||||
var dead=this;
|
||||
setTimeout(function(){
|
||||
dead.delete();
|
||||
},500);
|
||||
for(var i=0;i<player.actcharacterlist.length;i++){
|
||||
player.actcharacterlist[i].dataset.position=i+4+pos;
|
||||
var index=player.actcharacterlist.indexOf(this);
|
||||
if(index>=0){
|
||||
player.actcharacterlist[index]=null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,9 +133,11 @@ mode.stone={
|
|||
player.phase();
|
||||
event.num=0;
|
||||
"step 1"
|
||||
if(event.num<player.actcharacterlist.length){
|
||||
var current=player.actcharacterlist[event.num];
|
||||
if(current){
|
||||
current.phase();
|
||||
}
|
||||
event.num++;
|
||||
event.redo();
|
||||
}
|
||||
|
@ -82,6 +156,8 @@ mode.stone={
|
|||
var i,j,name;
|
||||
for(i in lib.character){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +174,11 @@ mode.stone={
|
|||
opacity:1,
|
||||
enable:function(event,player){
|
||||
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,
|
||||
textShadow:'black 0 0 2px',
|
||||
|
@ -108,14 +188,23 @@ mode.stone={
|
|||
selectTarget:-1,
|
||||
content:function(){
|
||||
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){
|
||||
pos+=4;
|
||||
}
|
||||
var fellow=game.addFellow(pos,name);
|
||||
fellow.side=player.side;
|
||||
fellow.classList.add('turnedover');
|
||||
player.actcharacterlist.push(fellow);
|
||||
player.actcharacterlist[i]=fellow;
|
||||
fellow.$gain2(card);
|
||||
},
|
||||
ai:{
|
||||
|
@ -149,6 +238,9 @@ mode.stone={
|
|||
lib.card[i].chongzhu=true;
|
||||
}
|
||||
}
|
||||
|
||||
_status.deadfriend=[];
|
||||
_status.deadenemy=[];
|
||||
},
|
||||
start:function(){
|
||||
var next=game.createEvent('game',false);
|
||||
|
@ -159,10 +251,10 @@ mode.stone={
|
|||
ui.arena.classList.add('stone');
|
||||
game.delay();
|
||||
"step 1"
|
||||
game.enemy=game.me.next;
|
||||
game.chooseCharacter();
|
||||
"step 2"
|
||||
game.me.identity='zhu';
|
||||
game.enemy=game.me.next;
|
||||
game.enemy.identity='zhu';
|
||||
game.me.side=Math.random()<0.5;
|
||||
game.enemy.side=!game.me.side;
|
||||
|
@ -204,17 +296,19 @@ mode.stone={
|
|||
list.push(i);
|
||||
}
|
||||
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(){
|
||||
return get.config('double_character')?2:1
|
||||
return (get.config('double_character')?2:1)*get.config('battle_number');
|
||||
};
|
||||
ui.create.cheat=function(){
|
||||
ui.cheat=ui.create.control('更换',function(){
|
||||
event.changeDialog=function(){
|
||||
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.check();
|
||||
});
|
||||
};
|
||||
ui.create.cheat=function(){
|
||||
ui.cheat=ui.create.control('更换',event.changeDialog);
|
||||
};
|
||||
event.dialogxx=ui.create.characterDialog();
|
||||
ui.create.cheat2=function(){
|
||||
|
@ -260,18 +354,20 @@ mode.stone={
|
|||
ui.cheat2x.close();
|
||||
delete ui.cheat2x;
|
||||
}
|
||||
if(result.buttons.length==2){
|
||||
game.me.init(result.buttons[0].link,result.buttons[1].link)
|
||||
_status.mylist=result.links.slice(0);
|
||||
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{
|
||||
game.me.init(result.buttons[0].link)
|
||||
}
|
||||
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));
|
||||
}
|
||||
game.me.init(_status.mylist.shift());
|
||||
game.enemy.init(_status.enemylist.shift());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -346,6 +442,48 @@ mode.stone={
|
|||
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:{
|
||||
stone_weibing:'士兵',
|
||||
|
@ -377,18 +515,16 @@ mode.stone={
|
|||
stone_feipin:'妃嫔',
|
||||
stone_yiji:'艺伎',
|
||||
stone_daogu:'道姑',
|
||||
|
||||
stonesha:'炉杀',
|
||||
stoneshan:'石闪',
|
||||
},
|
||||
ai:{
|
||||
get:{
|
||||
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:{
|
||||
double_character:true,
|
||||
ban_weak:true,
|
||||
free_choose:true,
|
||||
change_choice:true,
|
||||
},
|
||||
config:['battle_number','double_character','ban_weak','free_choose','change_choice']
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue