This commit is contained in:
libccy 2017-05-22 11:18:10 +08:00
parent 2e28d89fe6
commit 38bd706f39
9 changed files with 193 additions and 80 deletions

View File

@ -322,7 +322,6 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip2', subtype:'equip2',
cardnature:'fire', cardnature:'fire',
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hasSkillTag('maixie')&&player.hp>1) return 0; if(player.hasSkillTag('maixie')&&player.hp>1) return 0;
if(player.hasSkillTag('noDirectDamage')) return 10; if(player.hasSkillTag('noDirectDamage')) return 10;
@ -335,7 +334,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hp==3) num--; if(player.hp==3) num--;
if(player.hp>3) num-=4; if(player.hp>3) num-=4;
return num; return num;
} },
basic:{
equipValue:3
}, },
}, },
skills:['tengjia1','tengjia2'] skills:['tengjia1','tengjia2']
@ -356,12 +357,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
}, },
ai:{ ai:{
order:9.5, order:9.5,
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hp==player.maxHp) return 5; if(player.hp==player.maxHp) return 5;
if(player.countCards('h','baiyin')) return 6; if(player.countCards('h','baiyin')) return 6;
return 0; return 0;
} },
basic:{
equipValue:5
} }
} }
}, },

View File

@ -402,6 +402,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hp>=3) return 4; if(player.hp>=3) return 4;
if(player.hp>=2) return 2; if(player.hp>=2) return 2;
return 1; return 1;
},
basic:{
equipValue:4
} }
} }
}, },
@ -421,6 +424,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hp>=3) return 6; if(player.hp>=3) return 6;
if(player.hp>=2) return 2.5; if(player.hp>=2) return 2.5;
return 1; return 1;
},
basic:{
equipValue:5
} }
} }
}, },
@ -440,6 +446,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
if(player.hp>=3) return 6; if(player.hp>=3) return 6;
if(player.hp>=2) return 2.5; if(player.hp>=2) return 2.5;
return 1; return 1;
},
basic:{
equipValue:7
} }
} }
}, },

View File

@ -24,6 +24,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 1; return 1;
} }
return 8; return 8;
},
basic:{
equipValue:7
} }
} }
}, },
@ -46,6 +49,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 1; return 1;
} }
return 6; return 6;
},
basic:{
equipValue:6
} }
}, },
onLose:function(){ onLose:function(){
@ -568,13 +574,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
global:'g_wuliu_skill', global:'g_wuliu_skill',
distance:{attackFrom:-1}, distance:{attackFrom:-1},
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.identity=='unknown'||player.identity=='ye') return 2.5; if(player.identity=='unknown'||player.identity=='ye') return 2.5;
return 2+game.countPlayer(function(current){ return 2+game.countPlayer(function(current){
return current.identity==player.identity; return current.identity==player.identity;
})/2; })/2;
} },
basic:{
equipValue:3
} }
}, },
skills:['wuliu_skill'], skills:['wuliu_skill'],

View File

@ -194,6 +194,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 5; return 5;
} }
return 3; return 3;
},
basic:{
equipValue:5
} }
}, },
}, },
@ -254,11 +257,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
loseDelay:false, loseDelay:false,
skills:['muniu_skill','muniu_skill2','muniu_skill6','muniu_skill7'], skills:['muniu_skill','muniu_skill2','muniu_skill6','muniu_skill7'],
ai:{ ai:{
basic:{
equipValue:function(card){ equipValue:function(card){
if(card.card) return 8+card.card.length; if(card.card) return 7+card.card.length;
return 8; return 7;
} },
basic:{
equipValue:7
} }
} }
}, },

View File

@ -336,7 +336,6 @@ game.import('card',function(lib,game,ui,get,ai,_status){
type:'equip', type:'equip',
subtype:'equip1', subtype:'equip1',
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(!game.hasPlayer(function(current){ if(!game.hasPlayer(function(current){
return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0; return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0;
@ -351,7 +350,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var num=player.countCards('h','sha'); var num=player.countCards('h','sha');
if(num>1) return 4+num; if(num>1) return 4+num;
return 2+num; return 2+num;
} },
basic:{
equipValue:5
}, },
tag:{ tag:{
valueswap:1 valueswap:1
@ -389,10 +390,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip1', subtype:'equip1',
distance:{attackFrom:-2}, distance:{attackFrom:-2},
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
return Math.min(2.5+player.countCards('h','sha'),4); return Math.min(2.5+player.countCards('h','sha'),4);
} },
basic:{
equipValue:3.5
} }
}, },
skills:['qinglong_skill'] skills:['qinglong_skill']
@ -403,11 +405,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip1', subtype:'equip1',
distance:{attackFrom:-2}, distance:{attackFrom:-2},
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
var num=2.5+player.countCards('h')/3; var num=2.5+player.countCards('h')/3;
return Math.min(num,4); return Math.min(num,4);
} },
basic:{
equipValue:3.5
} }
}, },
skills:['zhangba_skill'] skills:['zhangba_skill']
@ -418,11 +421,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip1', subtype:'equip1',
distance:{attackFrom:-2}, distance:{attackFrom:-2},
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5; var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5;
return Math.min(num,5); return Math.min(num,5);
} },
basic:{
equipValue:4.5,
} }
}, },
skills:['guanshi_skill'] skills:['guanshi_skill']

View File

@ -702,12 +702,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
nopower:true, nopower:true,
unique:true, unique:true,
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hp==2) return 7; if(player.hp==2) return 7;
if(player.hp==1) return 10; if(player.hp==1) return 10;
return 5; return 5;
} },
basic:{
equipValue:7
} }
} }
}, },
@ -1380,11 +1381,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:"equip2", subtype:"equip2",
skills:['baihupifeng'], skills:['baihupifeng'],
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.hp<=2) return 8; if(player.hp<=2) return 8;
return 6; return 6;
} },
basic:{
equipValue:7
}, },
}, },
}, },
@ -1951,11 +1953,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
subtype:'equip5', subtype:'equip5',
skills:['nigong'], skills:['nigong'],
ai:{ ai:{
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(!player.storage.nigong) return 5; if(!player.storage.nigong) return 5;
return 5+player.storage.nigong; return 5+player.storage.nigong;
} },
basic:{
equipValue:5
} }
}, },
equipDelay:false, equipDelay:false,

View File

@ -949,11 +949,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
skills:['qiankundai'], skills:['qiankundai'],
ai:{ ai:{
order:9.5, order:9.5,
basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.countCards('h','qiankundai')) return 6; if(player.countCards('h','qiankundai')) return 6;
return 1; return 1;
} },
basic:{
equipValue:5,
} }
} }
}, },

View File

@ -4511,7 +4511,6 @@
if(config.versus_mode=='two'){ if(config.versus_mode=='two'){
map.replace_handcard_two.show(); map.replace_handcard_two.show();
map.replace_character_two.show(); map.replace_character_two.show();
map.change_identity.show();
map.two_assign.show(); map.two_assign.show();
map.two_phaseswap.show(); map.two_phaseswap.show();
} }
@ -4521,6 +4520,12 @@
map.change_identity.remove(); map.change_identity.remove();
map.two_assign.hide(); map.two_assign.hide();
map.two_phaseswap.hide(); map.two_phaseswap.hide();
}
if(config.versus_mode=='two'||config.versus_mode=='siguo'){
map.change_identity.show();
}
else{
map.change_identity.hide();
} }
}, },
versus_mode:{ versus_mode:{
@ -42628,7 +42633,7 @@
num+=player.countCards('h')/2; num+=player.countCards('h')/2;
var es=player.getCards('e'); var es=player.getCards('e');
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
var val=get.value(es[i]); var val=get.equipValueNumber(es[i]);
if(val>=7) num+=0.8; if(val>=7) num+=0.8;
if(val>=5) num+=0.5; if(val>=5) num+=0.5;
if(val>=3) num+=0.2; if(val>=3) num+=0.2;
@ -42743,6 +42748,14 @@
if(typeof value=='function') return value(card,player); if(typeof value=='function') return value(card,player);
return 0; return 0;
}, },
equipValueNumber:function(card){
var info=get.info(card);
if(info.ai){
if(typeof info.ai.equipValue=='number') return info.ai.equipValue;
if(info.ai.basic&&typeof info.ai.basic.equipValue=='number') return info.ai.basic.equipValue;
}
return 0;
},
disvalue:function(card,player){ disvalue:function(card,player){
return -get.value(card,player); return -get.value(card,player);
}, },

View File

@ -722,6 +722,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
next.setContent(function(){ next.setContent(function(){
'step 0' 'step 0'
_status.firstAct=game.players.randomGet(); _status.firstAct=game.players.randomGet();
for(var i=0;i<game.players.length;i++){
game.players[i].node.name.innerHTML=get.verticalStr(get.cnNumber(get.distance(_status.firstAct,game.players[i],'absolute')+1,true)+'号位');
}
ui.arena.classList.add('choose-character'); ui.arena.classList.add('choose-character');
'step 1' 'step 1'
var list={ var list={
@ -735,6 +738,70 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
var dialog=ui.create.dialog('选择角色',[list[game.me.identity].randomGets(8),'character']); var dialog=ui.create.dialog('选择角色',[list[game.me.identity].randomGets(8),'character']);
var addSetting=function(dialog){
dialog.add('选择座位');
var seats=document.createElement('table');
seats.classList.add('pointertable');
seats.style.margin='0 auto';
seats.style.width='200px';
var tr=document.createElement('tr');
seats.appendChild(tr);
for(var i=1;i<=game.players.length;i++){
var td=document.createElement('td');
tr.appendChild(td);
td.style.width='40px';
td.style.fontSize='25px';
td.style.fontFamily='xinwei';
td.innerHTML='<span>'+get.cnNumber(i,true)+'</span>';
td.link=i-1;
if(get.distance(_status.firstAct,game.me,'absolute')===i-1){
td.classList.add('thundertext');
}
td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
if(_status.dragged) return;
if(_status.justdragged) return;
if(get.distance(_status.firstAct,game.me,'absolute')==this.link) return;
var current=this.parentNode.querySelector('.thundertext');
if(current){
current.classList.remove('thundertext');
}
this.classList.add('thundertext');
_status.firstAct=game.me;
for(var i=0;i<this.link;i++){
_status.firstAct=_status.firstAct.previous;
}
for(var i=0;i<game.players.length;i++){
game.players[i].node.name.innerHTML=get.verticalStr(get.cnNumber(get.distance(_status.firstAct,game.players[i],'absolute')+1,true)+'号位');
}
});
}
dialog.content.appendChild(seats);
if(game.me==game.zhu){
seats.previousSibling.style.display='none';
seats.style.display='none';
}
dialog.add(ui.create.div('.placeholder'));
dialog.add(ui.create.div('.placeholder'));
dialog.add(ui.create.div('.placeholder'));
};
var removeSetting=function(){
var dialog=_status.event.dialog;
if(dialog.querySelector('table')&&!get.config('change_identity')){
dialog.querySelector('table').previousSibling.remove();
dialog.querySelector('table').nextSibling.remove();
dialog.querySelector('table').nextSibling.remove();
dialog.querySelector('table').nextSibling.remove();
dialog.querySelector('table').remove();
}
};
event.addSetting=addSetting;
event.removeSetting=removeSetting;
if(get.config('change_identity')){
addSetting(dialog);
}
ui.create.cheat=function(){ ui.create.cheat=function(){
_status.createControl=ui.cheat2; _status.createControl=ui.cheat2;
ui.cheat=ui.create.control('更换',function(){ ui.cheat=ui.create.control('更换',function(){
@ -3465,10 +3532,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return event.player.storage.longchuanzhibao>0; return event.player.storage.longchuanzhibao>0;
}, },
content:function(){ content:function(){
if(trigger.player.storage.longchuanzhibao>0){
trigger.player.storage.longchuanzhibao--; trigger.player.storage.longchuanzhibao--;
trigger.player.updateMark('longchuanzhibao'); trigger.player.updateMark('longchuanzhibao');
player.storage.longchuanzhibao++; player.storage.longchuanzhibao++;
player.updateMark('longchuanzhibao'); player.updateMark('longchuanzhibao');
}
}, },
group:'longchuanzhibao_over', group:'longchuanzhibao_over',
subSkill:{ subSkill:{