This commit is contained in:
parent
2e28d89fe6
commit
38bd706f39
|
@ -322,20 +322,21 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip2',
|
||||
cardnature:'fire',
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hasSkillTag('maixie')&&player.hp>1) return 0;
|
||||
if(player.hasSkillTag('noDirectDamage')) return 10;
|
||||
if(get.damageEffect(player,player,player,'fire')>=0) return 10;
|
||||
var num=3-game.countPlayer(function(current){
|
||||
return get.attitude(current,player)<0;
|
||||
});
|
||||
if(player.hp==1) num+=4;
|
||||
if(player.hp==2) num+=1;
|
||||
if(player.hp==3) num--;
|
||||
if(player.hp>3) num-=4;
|
||||
return num;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hasSkillTag('maixie')&&player.hp>1) return 0;
|
||||
if(player.hasSkillTag('noDirectDamage')) return 10;
|
||||
if(get.damageEffect(player,player,player,'fire')>=0) return 10;
|
||||
var num=3-game.countPlayer(function(current){
|
||||
return get.attitude(current,player)<0;
|
||||
});
|
||||
if(player.hp==1) num+=4;
|
||||
if(player.hp==2) num+=1;
|
||||
if(player.hp==3) num--;
|
||||
if(player.hp>3) num-=4;
|
||||
return num;
|
||||
}
|
||||
equipValue:3
|
||||
},
|
||||
},
|
||||
skills:['tengjia1','tengjia2']
|
||||
|
@ -356,12 +357,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
ai:{
|
||||
order:9.5,
|
||||
equipValue:function(card,player){
|
||||
if(player.hp==player.maxHp) return 5;
|
||||
if(player.countCards('h','baiyin')) return 6;
|
||||
return 0;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hp==player.maxHp) return 5;
|
||||
if(player.countCards('h','baiyin')) return 6;
|
||||
return 0;
|
||||
}
|
||||
equipValue:5
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -402,7 +402,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(player.hp>=3) return 4;
|
||||
if(player.hp>=2) return 2;
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
basic:{
|
||||
equipValue:4
|
||||
}
|
||||
}
|
||||
},
|
||||
yuheng_plus:{
|
||||
|
@ -421,7 +424,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(player.hp>=3) return 6;
|
||||
if(player.hp>=2) return 2.5;
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
basic:{
|
||||
equipValue:5
|
||||
}
|
||||
}
|
||||
},
|
||||
yuheng_pro:{
|
||||
|
@ -440,7 +446,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
if(player.hp>=3) return 6;
|
||||
if(player.hp>=2) return 2.5;
|
||||
return 1;
|
||||
}
|
||||
},
|
||||
|
||||
basic:{
|
||||
equipValue:7
|
||||
}
|
||||
}
|
||||
},
|
||||
shujinsan:{
|
||||
|
|
|
@ -24,6 +24,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return 1;
|
||||
}
|
||||
return 8;
|
||||
},
|
||||
basic:{
|
||||
equipValue:7
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -46,6 +49,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return 1;
|
||||
}
|
||||
return 6;
|
||||
},
|
||||
basic:{
|
||||
equipValue:6
|
||||
}
|
||||
},
|
||||
onLose:function(){
|
||||
|
@ -568,13 +574,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
global:'g_wuliu_skill',
|
||||
distance:{attackFrom:-1},
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
if(player.identity=='unknown'||player.identity=='ye') return 2.5;
|
||||
return 2+game.countPlayer(function(current){
|
||||
return current.identity==player.identity;
|
||||
})/2;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(player.identity=='unknown'||player.identity=='ye') return 2.5;
|
||||
return 2+game.countPlayer(function(current){
|
||||
return current.identity==player.identity;
|
||||
})/2;
|
||||
}
|
||||
equipValue:3
|
||||
}
|
||||
},
|
||||
skills:['wuliu_skill'],
|
||||
|
|
12
card/sp.js
12
card/sp.js
|
@ -194,6 +194,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
return 5;
|
||||
}
|
||||
return 3;
|
||||
},
|
||||
basic:{
|
||||
equipValue:5
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -254,11 +257,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
loseDelay:false,
|
||||
skills:['muniu_skill','muniu_skill2','muniu_skill6','muniu_skill7'],
|
||||
ai:{
|
||||
equipValue:function(card){
|
||||
if(card.card) return 7+card.card.length;
|
||||
return 7;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card){
|
||||
if(card.card) return 8+card.card.length;
|
||||
return 8;
|
||||
}
|
||||
equipValue:7
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -336,22 +336,23 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
type:'equip',
|
||||
subtype:'equip1',
|
||||
ai:{
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(!game.hasPlayer(function(current){
|
||||
return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0;
|
||||
})){
|
||||
return 1;
|
||||
}
|
||||
if(player.hasSha()&&_status.currentPhase==player){
|
||||
if(player.getEquip('zhuge')||player.getCardUsable('sha')==0){
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
var num=player.countCards('h','sha');
|
||||
if(num>1) return 4+num;
|
||||
return 2+num;
|
||||
equipValue:function(card,player){
|
||||
if(!game.hasPlayer(function(current){
|
||||
return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0;
|
||||
})){
|
||||
return 1;
|
||||
}
|
||||
if(player.hasSha()&&_status.currentPhase==player){
|
||||
if(player.getEquip('zhuge')||player.getCardUsable('sha')==0){
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
var num=player.countCards('h','sha');
|
||||
if(num>1) return 4+num;
|
||||
return 2+num;
|
||||
},
|
||||
basic:{
|
||||
equipValue:5
|
||||
},
|
||||
tag:{
|
||||
valueswap:1
|
||||
|
@ -389,10 +390,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip1',
|
||||
distance:{attackFrom:-2},
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
return Math.min(2.5+player.countCards('h','sha'),4);
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
return Math.min(2.5+player.countCards('h','sha'),4);
|
||||
}
|
||||
equipValue:3.5
|
||||
}
|
||||
},
|
||||
skills:['qinglong_skill']
|
||||
|
@ -403,11 +405,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip1',
|
||||
distance:{attackFrom:-2},
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
var num=2.5+player.countCards('h')/3;
|
||||
return Math.min(num,4);
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
var num=2.5+player.countCards('h')/3;
|
||||
return Math.min(num,4);
|
||||
}
|
||||
equipValue:3.5
|
||||
}
|
||||
},
|
||||
skills:['zhangba_skill']
|
||||
|
@ -418,11 +421,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip1',
|
||||
distance:{attackFrom:-2},
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5;
|
||||
return Math.min(num,5);
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5;
|
||||
return Math.min(num,5);
|
||||
}
|
||||
equipValue:4.5,
|
||||
}
|
||||
},
|
||||
skills:['guanshi_skill']
|
||||
|
|
29
card/swd.js
29
card/swd.js
|
@ -702,12 +702,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
nopower:true,
|
||||
unique:true,
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hp==2) return 7;
|
||||
if(player.hp==1) return 10;
|
||||
return 5;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hp==2) return 7;
|
||||
if(player.hp==1) return 10;
|
||||
return 5;
|
||||
}
|
||||
equipValue:7
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1380,11 +1381,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:"equip2",
|
||||
skills:['baihupifeng'],
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hp<=2) return 8;
|
||||
return 6;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(player.hp<=2) return 8;
|
||||
return 6;
|
||||
}
|
||||
equipValue:7
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -1951,11 +1953,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
subtype:'equip5',
|
||||
skills:['nigong'],
|
||||
ai:{
|
||||
equipValue:function(card,player){
|
||||
if(!player.storage.nigong) return 5;
|
||||
return 5+player.storage.nigong;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(!player.storage.nigong) return 5;
|
||||
return 5+player.storage.nigong;
|
||||
}
|
||||
equipValue:5
|
||||
}
|
||||
},
|
||||
equipDelay:false,
|
||||
|
|
|
@ -949,11 +949,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
skills:['qiankundai'],
|
||||
ai:{
|
||||
order:9.5,
|
||||
equipValue:function(card,player){
|
||||
if(player.countCards('h','qiankundai')) return 6;
|
||||
return 1;
|
||||
},
|
||||
basic:{
|
||||
equipValue:function(card,player){
|
||||
if(player.countCards('h','qiankundai')) return 6;
|
||||
return 1;
|
||||
}
|
||||
equipValue:5,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
17
game/game.js
17
game/game.js
|
@ -4511,7 +4511,6 @@
|
|||
if(config.versus_mode=='two'){
|
||||
map.replace_handcard_two.show();
|
||||
map.replace_character_two.show();
|
||||
map.change_identity.show();
|
||||
map.two_assign.show();
|
||||
map.two_phaseswap.show();
|
||||
}
|
||||
|
@ -4522,6 +4521,12 @@
|
|||
map.two_assign.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:{
|
||||
name:'游戏模式',
|
||||
|
@ -42628,7 +42633,7 @@
|
|||
num+=player.countCards('h')/2;
|
||||
var es=player.getCards('e');
|
||||
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>=5) num+=0.5;
|
||||
if(val>=3) num+=0.2;
|
||||
|
@ -42743,6 +42748,14 @@
|
|||
if(typeof value=='function') return value(card,player);
|
||||
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){
|
||||
return -get.value(card,player);
|
||||
},
|
||||
|
|
|
@ -722,6 +722,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
next.setContent(function(){
|
||||
'step 0'
|
||||
_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');
|
||||
'step 1'
|
||||
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 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(){
|
||||
_status.createControl=ui.cheat2;
|
||||
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;
|
||||
},
|
||||
content:function(){
|
||||
trigger.player.storage.longchuanzhibao--;
|
||||
trigger.player.updateMark('longchuanzhibao');
|
||||
player.storage.longchuanzhibao++;
|
||||
player.updateMark('longchuanzhibao');
|
||||
if(trigger.player.storage.longchuanzhibao>0){
|
||||
trigger.player.storage.longchuanzhibao--;
|
||||
trigger.player.updateMark('longchuanzhibao');
|
||||
player.storage.longchuanzhibao++;
|
||||
player.updateMark('longchuanzhibao');
|
||||
}
|
||||
},
|
||||
group:'longchuanzhibao_over',
|
||||
subSkill:{
|
||||
|
|
Loading…
Reference in New Issue