1.8.2
This commit is contained in:
parent
4b300b1fc2
commit
59a1cc57ca
|
@ -53,6 +53,9 @@ card.mingzhong={
|
||||||
order:2.5,
|
order:2.5,
|
||||||
value:[4,1],
|
value:[4,1],
|
||||||
useful:1,
|
useful:1,
|
||||||
|
wuxie:function(){
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
var ok=false;
|
var ok=false;
|
||||||
|
|
120
card/standard.js
120
card/standard.js
|
@ -77,16 +77,18 @@ card.standard={
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var next=target.chooseToRespond({name:'shan'});
|
var next=target.chooseToRespond({name:'shan'});
|
||||||
next.ai=function(){
|
next.set('ai',function(){
|
||||||
|
var target=_status.event.player;
|
||||||
|
var evt=_status.event.getParent();
|
||||||
var sks=target.get('s');
|
var sks=target.get('s');
|
||||||
if(sks.contains('leiji')||
|
if(sks.contains('leiji')||
|
||||||
sks.contains('diyleiji')||
|
sks.contains('diyleiji')||
|
||||||
sks.contains('lingbo')){
|
sks.contains('lingbo')){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(ai.get.damageEffect(target,player,target,card.nature)>=0) return -1;
|
if(ai.get.damageEffect(target,evt.player,target,evt.card.nature)>=0) return -1;
|
||||||
return 1;
|
return 1;
|
||||||
};
|
});
|
||||||
next.autochoose=lib.filter.autoRespondShan;
|
next.autochoose=lib.filter.autoRespondShan;
|
||||||
}
|
}
|
||||||
"step 1"
|
"step 1"
|
||||||
|
@ -605,12 +607,13 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var next=target.chooseToRespond({name:'sha'});
|
var next=target.chooseToRespond({name:'sha'});
|
||||||
next.ai=function(card){
|
next.set('ai',function(card){
|
||||||
if(ai.get.damageEffect(target,player,target)>=0) return 0;
|
var evt=_status.event.getParent();
|
||||||
if(player.get('s').contains('xinwuyan')) return 0;
|
if(ai.get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
|
||||||
if(target.get('s').contains('xinwuyan')) return 0;
|
if(evt.player.get('s').contains('xinwuyan')) return 0;
|
||||||
|
if(evt.target.get('s').contains('xinwuyan')) return 0;
|
||||||
return 1;
|
return 1;
|
||||||
};
|
});
|
||||||
next.autochoose=lib.filter.autoRespondSha;
|
next.autochoose=lib.filter.autoRespondSha;
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool==false){
|
if(result.bool==false){
|
||||||
|
@ -664,12 +667,13 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var next=target.chooseToRespond({name:'shan'});
|
var next=target.chooseToRespond({name:'shan'});
|
||||||
next.ai=function(card){
|
next.set('ai',function(card){
|
||||||
if(ai.get.damageEffect(target,player,target)>=0) return 0;
|
var evt=_status.event.getParent();
|
||||||
if(player.get('s').contains('xinwuyan')) return 0;
|
if(ai.get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0;
|
||||||
if(target.get('s').contains('xinwuyan')) return 0;
|
if(evt.player.get('s').contains('xinwuyan')) return 0;
|
||||||
|
if(evt.target.get('s').contains('xinwuyan')) return 0;
|
||||||
return 1;
|
return 1;
|
||||||
};
|
});
|
||||||
next.autochoose=lib.filter.autoRespondShan;
|
next.autochoose=lib.filter.autoRespondShan;
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool==false){
|
if(result.bool==false){
|
||||||
|
@ -1196,9 +1200,10 @@ card.standard={
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
trigger.target.chooseToDiscard().ai=function(card){
|
trigger.target.chooseToDiscard().set('ai',function(card){
|
||||||
return -ai.get.attitude(trigger.target,player)-ai.get.value(card);
|
var trigger=_status.event.getParent()._trigger;
|
||||||
};
|
return -ai.get.attitude(trigger.target,trigger.player)-ai.get.value(card);
|
||||||
|
});
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool==false) player.draw();
|
if(result.bool==false) player.draw();
|
||||||
}
|
}
|
||||||
|
@ -1265,21 +1270,21 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var next=player.chooseToDiscard('是否发动贯石斧?',2,'he',function(card){
|
var next=player.chooseToDiscard('是否发动贯石斧?',2,'he',function(card){
|
||||||
return player.get('e',{subtype:'equip1'}).contains(card)==false;
|
return _status.event.player.get('e',{subtype:'equip1'}).contains(card)==false;
|
||||||
});
|
});
|
||||||
next.logSkill='guanshi_skill';
|
next.logSkill='guanshi_skill';
|
||||||
next.ai=
|
next.set('ai',function(card){
|
||||||
function(card){
|
var evt=_status.event.getParent();
|
||||||
if(ai.get.attitude(player,trigger.target)<0){
|
if(ai.get.attitude(evt.player,evt._trigger.target)<0){
|
||||||
if(player.skills.contains('jiu')||
|
if(evt.player.skills.contains('jiu')||
|
||||||
player.skills.contains('tianxianjiu')||
|
evt.player.skills.contains('tianxianjiu')||
|
||||||
trigger.target.hp==1){
|
evt._trigger.target.hp==1){
|
||||||
return 8-ai.get.value(card)
|
return 8-ai.get.value(card)
|
||||||
}
|
}
|
||||||
return 5-ai.get.value(card)
|
return 5-ai.get.value(card)
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
};
|
});
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
trigger.untrigger();
|
trigger.untrigger();
|
||||||
|
@ -1312,17 +1317,17 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
var att=(ai.get.attitude(player,trigger.target)<=0);
|
var att=(ai.get.attitude(player,trigger.target)<=0);
|
||||||
player.chooseButton(ui.create.dialog('选择要弃置的马',
|
var next=player.chooseButton();
|
||||||
trigger.target.get('e',{subtype:['equip3','equip4']}))).ai=function(button){
|
next.set('att',att);
|
||||||
if(att){
|
next.set('createDialog',['选择要弃置的马',trigger.target.get('e',{subtype:['equip3','equip4']})]);
|
||||||
return ai.get.buttonValue(button);
|
next.set('ai',function(button){
|
||||||
}
|
if(_status.event.att) return ai.get.buttonValue(button);
|
||||||
return 0;
|
return 0;
|
||||||
};
|
});
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.logSkill('qilin_skill');
|
player.logSkill('qilin_skill');
|
||||||
trigger.target.discard(result.buttons[0].link);
|
trigger.target.discard(result.links[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1399,6 +1404,7 @@ card.standard={
|
||||||
var id=get.id();
|
var id=get.id();
|
||||||
event.id=id;
|
event.id=id;
|
||||||
var send=function(state,isJudge,card,source,target,targets,id){
|
var send=function(state,isJudge,card,source,target,targets,id){
|
||||||
|
state=state?1:-1;
|
||||||
var str='';
|
var str='';
|
||||||
if(isJudge){
|
if(isJudge){
|
||||||
str+=get.translation(source)+'的';
|
str+=get.translation(source)+'的';
|
||||||
|
@ -1432,7 +1438,7 @@ card.standard={
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var eff=ai.get.effect(source,card,source,_status.event.player);
|
var eff=ai.get.effect(source,card,source,source);
|
||||||
if(eff>=0) return 0;
|
if(eff>=0) return 0;
|
||||||
return state*ai.get.attitude(_status.event.player,source);
|
return state*ai.get.attitude(_status.event.player,source);
|
||||||
}
|
}
|
||||||
|
@ -1466,20 +1472,44 @@ card.standard={
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var aix=function(player){
|
var aix=function(player){
|
||||||
var info=get.info(event.card);
|
var source=event.source;
|
||||||
if(info.ai&&info.ai.wuxie){
|
var card=event.card;
|
||||||
var aiii=info.ai.wuxie(event.target,event.card,event.source,player,event.state);
|
var state=event.state?1:-1;
|
||||||
if(typeof aiii=='number') return aiii;
|
var target=event.target;
|
||||||
}
|
var targets=event.targets;
|
||||||
if(info.multitarget&&targets){
|
if(event.triggername=='phaseJudge'){
|
||||||
var eff=0;
|
var info=lib.card[card.viewAs||card.name];
|
||||||
for(var i=0;i<event.targets.length;i++){
|
if(info&&info.ai&&info.ai.wuxie){
|
||||||
eff+=ai.get.effect(event.targets[i],event.card,event.source,player)
|
var aiii=info.ai.wuxie(source,card,source,player,state);
|
||||||
|
if(typeof aiii=='number') return aiii;
|
||||||
}
|
}
|
||||||
return -eff*state;
|
if(Math.abs(ai.get.attitude(player,source))<3) return 0;
|
||||||
|
if(source.skills.contains('guanxing')) return 0;
|
||||||
|
if(card.name!='lebu'&&card.name!='bingliang'){
|
||||||
|
if(source!=player){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var eff=ai.get.effect(source,card,source,source);
|
||||||
|
if(eff>=0) return 0;
|
||||||
|
return state*ai.get.attitude(player,source);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var info=get.info(card);
|
||||||
|
if(info.ai&&info.ai.wuxie){
|
||||||
|
var aiii=info.ai.wuxie(target,card,source,player,state);
|
||||||
|
if(typeof aiii=='number') return aiii;
|
||||||
|
}
|
||||||
|
if(info.multitarget&&targets){
|
||||||
|
var eff=0;
|
||||||
|
for(var i=0;i<targets.length;i++){
|
||||||
|
eff+=ai.get.effect(targets[i],card,source,player)
|
||||||
|
}
|
||||||
|
return -eff*state;
|
||||||
|
}
|
||||||
|
if(Math.abs(ai.get.attitude(player,target))<3) return 0;
|
||||||
|
return -ai.get.effect(target,card,source,player)*state;
|
||||||
}
|
}
|
||||||
if(Math.abs(ai.get.attitude(player,event.target))<3) return 0;
|
|
||||||
return -ai.get.effect(event.target,event.card,event.source,player)*event.state;
|
|
||||||
};
|
};
|
||||||
var sendback=function(result,player){
|
var sendback=function(result,player){
|
||||||
if(result&&result.id==id&&!event.wuxieresult&&result.bool){
|
if(result&&result.id==id&&!event.wuxieresult&&result.bool){
|
||||||
|
@ -1542,7 +1572,7 @@ card.standard={
|
||||||
game.resume();
|
game.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},event.aionly?200:(Math.random()*90000+3000));
|
},event.aionly?200:(Math.random()*5000+3000));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
event.aionly=false;
|
event.aionly=false;
|
||||||
|
|
|
@ -228,7 +228,7 @@ character.refresh={
|
||||||
cards.splice(i,1);i--;
|
cards.splice(i,1);i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.gain(cards);
|
player.gain(cards,'gain2');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reluoyi2:{
|
reluoyi2:{
|
||||||
|
|
|
@ -122,7 +122,7 @@ character.standard={
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.logSkill('fankui',trigger.source);
|
player.logSkill('fankui',trigger.source);
|
||||||
player.gain(result.buttons[0].link);
|
player.gain(result.links[0]);
|
||||||
trigger.source.$give(1,player);
|
trigger.source.$give(1,player);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1009,12 +1009,15 @@ character.standard={
|
||||||
filterCard:true,
|
filterCard:true,
|
||||||
selectCard:[1,Infinity],
|
selectCard:[1,Infinity],
|
||||||
prompt:'弃置任意张牌并摸等量的牌',
|
prompt:'弃置任意张牌并摸等量的牌',
|
||||||
check:function(card){return 6-ai.get.value(card)},
|
check:function(card){
|
||||||
|
return -1;
|
||||||
|
return 6-ai.get.value(card)
|
||||||
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
player.draw(cards.length);
|
player.draw(cards.length);
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
order:1,
|
order:11,
|
||||||
result:{
|
result:{
|
||||||
player:1
|
player:1
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
window.noname_asset_list=[
|
window.noname_asset_list=[
|
||||||
'1.8.1.1',
|
'1.8.2',
|
||||||
'image/background/huangtian_bg.jpg',
|
'image/background/huangtian_bg.jpg',
|
||||||
'image/background/shengshi_bg.jpg',
|
'image/background/shengshi_bg.jpg',
|
||||||
'image/background/xueji_bg.jpg',
|
'image/background/xueji_bg.jpg',
|
||||||
|
|
504
game/game.js
504
game/game.js
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
||||||
window.noname_update={
|
window.noname_update={
|
||||||
version:'1.8.2',
|
version:'1.8.2.0',
|
||||||
changeLog:[
|
changeLog:[
|
||||||
'联机预览版(身份模式、标准版包)',
|
'联机预览版(身份模式,标准包)',
|
||||||
'新卡牌样式(by @_游离感_ )',
|
'新卡牌样式(by @_游离感_ )',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,30 @@ mode.connect={
|
||||||
if(lib.config.reconnect_info){
|
if(lib.config.reconnect_info){
|
||||||
var info=lib.config.reconnect_info;
|
var info=lib.config.reconnect_info;
|
||||||
game.onlineID=info[1];
|
game.onlineID=info[1];
|
||||||
game.connect(info[0]);
|
game.connect(info[0],game.resume);
|
||||||
game.saveConfig('reconnect_info');
|
game.saveConfig('reconnect_info');
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
'step 1'
|
'step 1'
|
||||||
delete game.onlineID;
|
delete game.onlineID;
|
||||||
|
if(lib.config.reconnect_more){
|
||||||
|
var n=5;
|
||||||
|
var connect=function(){
|
||||||
|
game.connect(lib.config.reconnect_more,function(success){
|
||||||
|
if(success){
|
||||||
|
game.saveConfig('reconnect_more');
|
||||||
|
}
|
||||||
|
else if(n--){
|
||||||
|
event.timeout=setTimeout(connect,1000);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
game.saveConfig('reconnect_more');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
event.timeout=setTimeout(connect,500);
|
||||||
|
}
|
||||||
|
'step 2'
|
||||||
for(var i in lib.element.event){
|
for(var i in lib.element.event){
|
||||||
event.parent[i]=lib.element.event[i];
|
event.parent[i]=lib.element.event[i];
|
||||||
}
|
}
|
||||||
|
@ -18,6 +36,44 @@ mode.connect={
|
||||||
add:{},
|
add:{},
|
||||||
replace:{}
|
replace:{}
|
||||||
};
|
};
|
||||||
game.connect('localhost');
|
var node=ui.create.div('.shadowed');
|
||||||
|
node.style.width='400px';
|
||||||
|
node.style.height='30px';
|
||||||
|
node.style.lineHeight='30px';
|
||||||
|
node.style.fontFamily='xinwei';
|
||||||
|
node.style.fontSize='30px';
|
||||||
|
node.style.padding='10px';
|
||||||
|
node.style.left='calc(50% - 200px)';
|
||||||
|
node.style.top='calc(50% - 20px)';
|
||||||
|
node.style.whiteSpace='nowrap';
|
||||||
|
node.innerHTML=lib.config.last_ip||'';
|
||||||
|
node.contentEditable=true;
|
||||||
|
node.style.webkitUserSelect='text';
|
||||||
|
node.style.textAlign='center';
|
||||||
|
node.addEventListener('keydown',function(e){
|
||||||
|
if(e.keyCode==13){
|
||||||
|
clearTimeout(event.timeout);
|
||||||
|
e.preventDefault();
|
||||||
|
game.saveConfig('last_ip',node.innerHTML);
|
||||||
|
game.connect(node.innerHTML);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ui.window.appendChild(node);
|
||||||
|
ui.ipnode=node;
|
||||||
|
|
||||||
|
var text=ui.create.div();
|
||||||
|
text.style.width='400px';
|
||||||
|
text.style.height='30px';
|
||||||
|
text.style.lineHeight='30px';
|
||||||
|
text.style.fontFamily='xinwei';
|
||||||
|
text.style.fontSize='30px';
|
||||||
|
text.style.padding='10px';
|
||||||
|
text.style.left='calc(50% - 200px)';
|
||||||
|
text.style.top='calc(50% - 80px)';
|
||||||
|
text.innerHTML='输入联机地址';
|
||||||
|
text.style.textAlign='center';
|
||||||
|
ui.window.appendChild(text);
|
||||||
|
ui.iptext=text;
|
||||||
|
// game.connect('localhost');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue